From: Cameron Esfahani via <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, r.bolshakov@yadro.com
Subject: [PATCH v1 0/3] hvf: Support AVX512 guests and cleanup
Date: Mon, 30 Mar 2020 17:16:03 -0700 [thread overview]
Message-ID: <cover.1585607927.git.dirty@apple.com> (raw)
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
next reply other threads:[~2020-03-31 0:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-31 0:16 Cameron Esfahani via [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1585607927.git.dirty@apple.com \
--to=qemu-devel@nongnu.org \
--cc=dirty@apple.com \
--cc=pbonzini@redhat.com \
--cc=r.bolshakov@yadro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).