qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] hvf: Support AVX512 guests and cleanup
@ 2020-03-31  0:16 Cameron Esfahani via
  2020-03-31  0:16 ` [PATCH v1 1/3] hvf: use standard CR0 and CR4 register definitions Cameron Esfahani via
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Cameron Esfahani via @ 2020-03-31  0:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, r.bolshakov

HVF had its own copy of the CR0 and CR4 register definitions.  Remove
them in favor of the definitions in target/i386/cpu.h.

Change long mode enter and exit code to be clearer.

Support AVX512 guests on capable hardware.  This involves two separate
changes:
- Correctly manage the OSXSAVE bit in CPUID[0x01].  cpu_x86_cpuid()
  attempts to account for OSXSAVE, but it refers to env->cr[4] for the
  guest copy of CR4.  That field isn't up to date under HVF.  Instead,
  we track OSXSAVE separately, by adding OSXSAVE to CR4 mask and saving
  the state.  Then, when handling CPUID[0x01] in EXIT_REASON_CPUID, we
  reflect the current state of CR4[OSXSAVE]. 
- macOS lazily enables AVX512 for processes.  Explicitly enable AVX512
  for QEMU.
With these two changes, guests can correctly detect and enable AVX512.

Cameron Esfahani (3):
  hvf: use standard CR0 and CR4 register definitions
  hvf: Make long mode enter and exit code clearer.
  hvf: Support AVX512 guests on capable hardware

 target/i386/cpu.h          |  3 ++
 target/i386/hvf/hvf.c      | 69 ++++++++++++++++++++++++++++++++++++--
 target/i386/hvf/vmx.h      | 32 ++++++++++++------
 target/i386/hvf/x86.c      |  6 ++--
 target/i386/hvf/x86.h      | 34 -------------------
 target/i386/hvf/x86_mmu.c  |  2 +-
 target/i386/hvf/x86_task.c |  3 +-
 target/i386/hvf/x86hvf.c   |  2 +-
 8 files changed, 98 insertions(+), 53 deletions(-)

-- 
2.24.0



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-04-08 13:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-31  0:16 [PATCH v1 0/3] hvf: Support AVX512 guests and cleanup Cameron Esfahani via
2020-03-31  0:16 ` [PATCH v1 1/3] hvf: use standard CR0 and CR4 register definitions Cameron Esfahani via
2020-04-05 17:58   ` Roman Bolshakov
2020-04-08  6:09     ` Cameron Esfahani via
2020-04-08  8:28       ` Paolo Bonzini
2020-03-31  0:16 ` [PATCH v1 2/3] hvf: Make long mode enter and exit code clearer Cameron Esfahani via
2020-04-05 18:51   ` Roman Bolshakov
2020-04-08  6:13     ` Cameron Esfahani via
2020-03-31  0:16 ` [PATCH v1 3/3] hvf: Support AVX512 guests on capable hardware Cameron Esfahani via
2020-04-06 10:00   ` Paolo Bonzini
2020-04-08 13:56   ` Roman Bolshakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).