Skip to content

WHPX x86 updates for QEMU 11.1

Mohamed Mediouni qemu-arm qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest37 patches 7 repliesIn review
  2. v238 patches 1 replySuperseded
  3. v138 patches 0 repliesSuperseded

v1->v2 from the cover letter

- Build fixup for macOS and OpenBSD
- a bit of cleanup

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/37target/i386: emulate: include name of unhandled instructiontarget/i386/emulate/x86_emu.c+2 -20 replies
2/37whpx: i386: x2apic emulationtarget/i386/whpx/whpx-all.c+133 -10 replies
3/37whpx: i386: wire up feature probinginclude/system/whpx-internal.h target/i386/cpu.c target/i386/whpx/meson.build +3 more+370 -50 replies
4/37whpx: i386: disable TbFlushHypercalls for emulated LAPICtarget/i386/whpx/whpx-all.c+6 -30 replies
5/37whpx: i386: enable x2apic by default for user-mode LAPICtarget/i386/whpx/whpx-all.c+7 -00 replies
6/37whpx: i386: reintroduce enlightenments for Windows 10accel/whpx/whpx-common.c include/system/whpx-internal.h target/arm/whpx/whpx-all.c +1 more+58 -90 replies
7/37whpx: i386: introduce proper cpuid supporttarget/i386/whpx/whpx-all.c target/i386/whpx/whpx-cpu-legacy.c+122 -290 replies
8/37whpx: i386: kernel-irqchip=off fixesinclude/system/whpx-common.h target/i386/whpx/whpx-all.c+7 -370 replies
9/37whpx: i386: use WHvX64RegisterCr8 only when kernel-irqchip=offtarget/i386/whpx/whpx-all.c+22 -150 replies
10/37whpx: i386: disable kernel-irqchip on Windows 10 when PIC enabledtarget/i386/whpx/whpx-all.c+39 -300 replies
11/37whpx: i386: IO port fast path cleanuptarget/i386/whpx/whpx-all.c+13 -40 replies
12/37whpx: i386: disable enlightenments and LAPIC for isapctarget/i386/whpx/whpx-all.c+8 -00 replies
13/37whpx: i386: interrupt priority supporttarget/i386/whpx/whpx-all.c+20 -40 replies
14/37hw/intc: apic: disallow APIC reads when disabledhw/intc/apic.c+9 -00 replies
15/37whpx: i386: fix CPUID[1:EDX].APIC reportinginclude/system/whpx-common.h target/i386/whpx/whpx-all.c target/i386/whpx/whpx-apic.c+84 -220 replies
16/37whpx: i386: set apicbase value only on successtarget/i386/whpx/whpx-all.c+2 -10 replies
17/37whpx: i386: unknown MSR configurabilityaccel/whpx/whpx-common.c include/system/whpx-all.h include/system/whpx-internal.h +2 more+54 -00 replies
18/37whpx: i386: enable GuestIdleReg enlightenmenttarget/i386/whpx/whpx-all.c+1 -00 replies
19/37whpx: i386: tighten APIC base validity checktarget/i386/whpx/whpx-all.c+3 -00 replies
20/37whpx: i386: ignore vpassist when kernel-irqchip=offtarget/i386/whpx/whpx-all.c+13 -00 replies
21/37target: i386: HLT type that ignores EFLAGS.IFtarget/i386/cpu.c target/i386/cpu.h+8 -41 reply
22/37whpx: i386: add HV_X64_MSR_GUEST_IDLE when !kernel-irqchiptarget/i386/whpx/whpx-all.c+43 -31 reply
23/37whpx: i386: some x2APIC awarenesstarget/i386/whpx/whpx-apic.c+10 -20 replies
24/37whpx: i386: set WHvX64RegisterInitialApicIdtarget/i386/whpx/whpx-all.c+5 -00 replies
25/37whpx: i386: Pause VM on fatal exception to be able to inspect statetarget/i386/whpx/whpx-all.c+1 -10 replies
26/37target/i386: emulate: use exception_payload for fault addresstarget/i386/emulate/x86_mmu.c target/i386/whpx/whpx-all.c+5 -41 reply
27/37target/i386: make xsave_buf present unconditionallytarget/i386/cpu.h+0 -20 replies
28/37target/i386: add de/compaction to xsave_helpertarget/i386/cpu.h target/i386/xsave_helper.c+258 -01 reply
29/37whpx: xsave supportinclude/system/whpx-internal.h target/i386/whpx/whpx-all.c+292 -1030 replies
30/37whpx: i386: set APIC ID only when APIC presenttarget/i386/whpx/whpx-all.c+1 -10 replies
31/37whpx: i386: update migration blocker messagetarget/i386/whpx/whpx-all.c+2 -20 replies
32/37whpx: i386: don't increment eip on MSR access raising GPFtarget/i386/whpx/whpx-all.c+12 -00 replies
33/37target/i386: emulate, hvf: rdmsr/wrmsr GPF handlingtarget/i386/emulate/x86_emu.c target/i386/emulate/x86_emu.h target/i386/hvf/hvf-i386.h +1 more+17 -100 replies
34/37whpx: i386: add feature to intercept #GP MSR accessesaccel/whpx/whpx-common.c include/system/whpx-internal.h target/i386/whpx/whpx-all.c+166 -190 replies
35/37whpx: i386: nested virt settingsaccel/whpx/whpx-common.c include/system/whpx-internal.h target/i386/whpx/whpx-all.c+66 -52 replies
36/37whpx: i386: add SeparateSecurityDomain flag and make defaultaccel/whpx/whpx-common.c include/system/whpx-internal.h target/i386/whpx/whpx-all.c+65 -00 replies
37/37whpx: i386: documentation updatedocs/system/whpx.rst+11 -290 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 00/37] WHPX x86 updates for QEMU 11.1

This rolls over my previous series posted earlier in this mailing list. ..and adds some more.

Git tree: https://github.com/mediouni-m/qemu whpx-i386-202604-4

Some highlights:
1
- user-mode x2APIC emulation (kernel-irqchip=off) for better performance when it has to be used.
- CPU model emulation on both Windows 10 and 11
- configurable behavior for unknown MSRs and adding a way to trap on GPFs raised by Hyper-V on MSR acccess
- when -M hyperv=off, report the hypervisor as VMware for guests to use either the VMware CPUID leaf or the vmport interface to get the TSC and APIC frequencies.

If the vmware CPUID frequency leaf is disabled, then KVM is reported.
- xsave save/restore support
- Pause the VM to be able to inspect state on a fatal fault instead of just exiting
- adding emulation of an oddball idle MSR used by Windows when kernel-irqchip=off.
- disable kernel-irqchip and Hyper-V enlightenments for isapc
- for Windows 10, change the default to an emulated x2APIC (kernel-irqchip=off). The recommended way to use the Hyper-V LAPIC is not to use -M kernel-irqchip=on, but -M pic=off.

And as the last commit, a documentation update.

Bug reports and patches are welcome.

However, due to reasons, I'll probably step aside from this all for a bit so don't expect immediate replies.

v1->v2:

- Build fixup for macOS and OpenBSD
- a bit of cleanup

v2->v3:

Unfortunately this rev has quite a bit of changes...

- Some fixes here and there.
- Merging in Windows 10 support into something less separate.
- Move new x86-specific (at least for now) properties into a new whpx_arch_accel_class_init method.
- Add nested virt settings and separate security domain accelerator properties.

Magnus Kulke (1):
target/i386: add de/compaction to xsave_helper

Mohamed Mediouni (36):
target/i386: emulate: include name of unhandled instruction
whpx: i386: x2apic emulation
whpx: i386: wire up feature probing
whpx: i386: disable TbFlushHypercalls for emulated LAPIC
whpx: i386: enable x2apic by default for user-mode LAPIC
whpx: i386: reintroduce enlightenments for Windows 10
whpx: i386: introduce proper cpuid support
whpx: i386: kernel-irqchip=off fixes
whpx: i386: use WHvX64RegisterCr8 only when kernel-irqchip=off
whpx: i386: disable kernel-irqchip on Windows 10 when PIC enabled
whpx: i386: IO port fast path cleanup
whpx: i386: disable enlightenments and LAPIC for isapc
whpx: i386: interrupt priority support
hw/intc: apic: disallow APIC reads when disabled
whpx: i386: fix CPUID[1:EDX].APIC reporting
whpx: i386: set apicbase value only on success
whpx: i386: unknown MSR configurability
whpx: i386: enable GuestIdleReg enlightenment
whpx: i386: tighten APIC base validity check
whpx: i386: ignore vpassist when kernel-irqchip=off
target: i386: HLT type that ignores EFLAGS.IF
whpx: i386: add HV_X64_MSR_GUEST_IDLE when !kernel-irqchip
whpx: i386: some x2APIC awareness
whpx: i386: set WHvX64RegisterInitialApicId
whpx: i386: Pause VM on fatal exception to be able to inspect state target/i386: emulate: use exception_payload for fault address target/i386: make xsave_buf present unconditionally
whpx: xsave support
whpx: i386: set APIC ID only when APIC present
whpx: i386: update migration blocker message
whpx: i386: don't increment eip on MSR access raising GPF target/i386: emulate, hvf: rdmsr/wrmsr GPF handling
whpx: i386: add feature to intercept #GP MSR accesses
whpx: i386: nested virt settings
whpx: i386: add SeparateSecurityDomain flag and make default
whpx: i386: documentation update

 accel/whpx/whpx-common.c           |    8 +
 docs/system/whpx.rst               |   40 +-
 hw/intc/apic.c                     |    9 +
 include/system/whpx-all.h          |    1 +
 include/system/whpx-common.h       |    2 +-
 include/system/whpx-internal.h     |   31 +
 target/arm/whpx/whpx-all.c         |    5 +
 target/i386/cpu.c                  |   27 +-
 target/i386/cpu.h                  |    6 +-
 target/i386/emulate/x86_emu.c      |   14 +-
 target/i386/emulate/x86_emu.h      |    4 +-
 target/i386/emulate/x86_mmu.c      |    3 +-
 target/i386/hvf/hvf-i386.h         |    4 +-
 target/i386/hvf/hvf.c              |    9 +-
 target/i386/whpx/meson.build       |    1 +
 target/i386/whpx/whpx-all.c        | 1489 +++++++++++++++++++++++-----
 target/i386/whpx/whpx-apic.c       |   83 +-
 target/i386/whpx/whpx-cpu-legacy.c |  158 +++
 target/i386/whpx/whpx-i386.h       |   12 +
 target/i386/xsave_helper.c         |  256 +++++
 20 files changed, 1875 insertions(+), 287 deletions(-)
 create mode 100644 target/i386/whpx/whpx-cpu-legacy.c
 create mode 100644 target/i386/whpx/whpx-i386.h
Signature · 1 line
2.50.1 (Apple Git-155)