In the Linux kernel, the following vulnerability has been resolved: x86/xen: Drop USERGSSYSRET64 paravirt call commit afd30525a659ac0ae0904f0cb4a2ca75522c3123 upstream. USERGSSYSRET64 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. [ pawan: Brad Spengler and Salvatore Bonaccorso carnil@debian.org reported a problem with the 5.10 backport commit edc702b4a820 ("x86/entry64: Add VERW just before userspace transition"). When CONFIGPARAVIRTXXL=y, CLEARCPUBUFFERS is not executed in syscallreturnviasysret path as USERGSSYSRET64 is runtime patched to: .cpuusergssysret64 = { 0x0f, 0x01, 0xf8, 0x48, 0x0f, 0x07 }, // swapgs; sysretq which is missing CLEARCPUBUFFERS. It turns out dropping USERGSSYSRET64 simplifies the code, allowing CLEARCPUBUFFERS to be explicitly added to syscallreturnviasysret path. Below is with CONFIGPARAVIRTXXL=y and this patch applied: syscallreturnviasysret: ... <+342>: swapgs <+345>: xchg %ax,%ax <+347>: verw -0x1a2(%rip) <------ <+354>: sysretq ]