Skip to content

hvf: stability fixes for HVF

Cameron Esfahani via qemu-devel 3 versions – Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 1 replyApplied
  2. v25 patches 10 repliesSuperseded
  3. v15 patches 1 replySuperseded

Changes in v3 from the cover letter

- Change previous code which saved interrupt/exception type in hvf_store_events() to inject later in hvf_inject_interrupts(). Now, hvf_inject_interrupts() will correctly determine when it's appropriate to inject VMCS_INTR_T_HWINTR versus VMCS_INTR_T_SWINTR. From feedback by Paolo Bonzini to make code more similar to KVM model.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/5hvf: non-RAM, non-ROMD memory ranges are now correctly mapped intarget/i386/hvf/hvf.c+35 -150 replies
2/5hvf: remove TSC synchronization code because it isn't fully completetarget/i386/hvf/hvf.c target/i386/hvf/x86_emu.c target/i386/hvf/x86hvf.c+1 -90 replies
3/5hvf: correctly handle REX prefix in relation to legacy prefixestarget/i386/hvf/x86_decode.c target/i386/hvf/x86_decode.h+46 -380 replies
4/5hvf: more accurately match SDM when setting CR0 and PDPTE registerstarget/i386/hvf/hvf.c target/i386/hvf/vmx.h+18 -80 replies
5/5hvf: correctly inject VMCS_INTR_T_HWINTR versus VMCS_INTR_T_SWINTR.target/i386/hvf/hvf.c target/i386/hvf/x86hvf.c+12 -60 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 0/5] hvf: stability fixes for HVF

The following patches fix stability issues with running QEMU on Apple Hypervisor Framework (HVF):
- non-RAM, non-ROMD areas need to trap so accesses can be correctly emulated.
- Current TSC synchronization implementation is insufficient: when running with more than 1 core, TSC values can go backwards. Until a correct implementation can be written, remove calls to hv_vm_sync_tsc(). Pass through TSC to guest OS.
- Fix REX emulation in relation to legacy prefixes.
- More correctly match SDM when setting CR0 and PDPTE registers.
- Previous implementation in hvf_inject_interrupts() would always inject VMCS_INTR_T_SWINTR even when VMCS_INTR_T_HWINTR was required. Now correctly determine when VMCS_INTR_T_HWINTR is appropriate versus VMCS_INTR_T_SWINTR. Under heavy loads, interrupts got misrouted.

Changes in v3:
- Change previous code which saved interrupt/exception type in hvf_store_events() to inject later in hvf_inject_interrupts(). Now, hvf_inject_interrupts() will correctly determine when it's appropriate to inject VMCS_INTR_T_HWINTR versus VMCS_INTR_T_SWINTR. From feedback by Paolo Bonzini to make code more similar to KVM model.

Changes in v2:
- Fix code style errors.

Cameron Esfahani (5):
hvf: non-RAM, non-ROMD memory ranges are now correctly mapped in
hvf: remove TSC synchronization code because it isn't fully complete
hvf: correctly handle REX prefix in relation to legacy prefixes
hvf: more accurately match SDM when setting CR0 and PDPTE registers
hvf: correctly inject VMCS_INTR_T_HWINTR versus VMCS_INTR_T_SWINTR.

 target/i386/hvf/hvf.c        | 65 ++++++++++++++++++++++++++----------
 target/i386/hvf/vmx.h        | 18 +++++-----
 target/i386/hvf/x86_decode.c | 64 +++++++++++++++++++----------------
 target/i386/hvf/x86_decode.h | 20 +++++------
 target/i386/hvf/x86_emu.c    |  3 --
 target/i386/hvf/x86hvf.c     | 18 +++++-----
 6 files changed, 112 insertions(+), 76 deletions(-)
Signature · 1 line
2.24.0