• Juergen Gross's avatar
    x86/xen: Drop USERGS_SYSRET64 paravirt call · afd30525
    Juergen Gross authored
    USERGS_SYSRET64 is used to return from a syscall via SYSRET, but
    a Xen PV guest will nevertheless use the IRET hypercall, as there
    is no sysret PV hypercall defined.
    
    So instead of testing all the prerequisites for doing a sysret and
    then mangling the stack for Xen PV again for doing an iret just use
    the iret exit from the beginning.
    
    This can easily be done via an ALTERNATIVE like it is done for the
    sysenter compat case already.
    
    It should be noted that this drops the optimization in Xen for not
    restoring a few registers when returning to user mode, but it seems
    as if the saved instructions in the kernel more than compensate for
    this drop (a kernel build in a Xen PV guest was slightly faster with
    this patch applied).
    
    While at it remove the stale sysret32 remnants.
    Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Link: https://lkml.kernel.org/r/20210120135555.32594-6-jgross@suse.com
    afd30525
paravirt_patch.c 2.9 KB