Skip to content

add sysenter/syscall emulation for 32bit compat mode

Andre Przywara kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6allow emulation of syscalls instructions on #UDarch/x86/kvm/x86.c+26 -70 replies
2/6add missing EFLAGS bit definitionsarch/x86/kvm/x86_emulate.c+3 -00 replies
3/6prepare for emulation of syscall instructionsarch/x86/kvm/x86_emulate.c+15 -20 replies
4/6add syscall emulationarch/x86/kvm/x86_emulate.c+88 -13 replies
5/6add sysenter emulationarch/x86/kvm/x86_emulate.c+71 -10 replies
6/6add sysexit emulationarch/x86/kvm/x86_emulate.c+78 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] add sysenter/syscall emulation for 32bit compat mode

sysenter/sysexit are not supported on AMD's 32bit compat mode, whereas syscall is not supported on Intel's 32bit compat mode. To allow cross vendor migration we emulate the missing instructions by setting up the processor state accordingly.
The sysenter code was originally sketched by Amit Shah, it was completed, debugged, syscall added and made-to-work by Christoph Egger and polished up by Andre Przywara.
Please note that sysret does not need to be emulated, because it will be exectued in 64bit mode and returning to 32bit compat mode works on Intel.

This has been tested with GETPIDs in a tight loop in compat mode on both Intel and AMD boxes. Additionally a 32-bit userland was booted under a 64-bit kernel and then cross-vendor migrated.

Please apply or comment ;-)

Regards,
Andre.