From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Kai Huang <kai.huang@intel.com>
Subject: [PATCH v2 0/3] KVM: x86: SGX vs. XCR0 cleanups
Date: Wed, 3 May 2023 09:08:35 -0700 [thread overview]
Message-ID: <20230503160838.3412617-1-seanjc@google.com> (raw)
Stop adjusting the guest's CPUID info for the allowed XFRM (a.k.a. XCR0)
for SGX enclaves. Past me didn't understand the roles and responsibilities
between userspace and KVM with respect to CPUID leafs, i.e. I thought I was
being helpful by having KVM adjust the entries.
This is clearly an ABI change, but QEMU does the right thing and AFAIK no
other VMMs support SGX (yet), so I'm hopeful/confident that we can excise
the ugly before userspace starts depending on the bad behavior.
v2:
- Collect reviews/testing. [Kai]
- Require FP+SSE to always be set in XFRM, and exempt them from the XFRM
vs. XCR0 check. [Kai]
v1: https://lore.kernel.org/all/20230405005911.423699-1-seanjc@google.com
Sean Christopherson (3):
KVM: VMX: Don't rely _only_ on CPUID to enforce XCR0 restrictions for
ECREATE
KVM: x86: Don't adjust guest's CPUID.0x12.1 (allowed SGX enclave XFRM)
KVM: x86: Open code supported XCR0 calculation in
kvm_vcpu_after_set_cpuid()
arch/x86/kvm/cpuid.c | 43 ++++++++++--------------------------------
arch/x86/kvm/vmx/sgx.c | 11 +++++++++--
2 files changed, 19 insertions(+), 35 deletions(-)
base-commit: 5c291b93e5d665380dbecc6944973583f9565ee5
--
2.40.1.495.gc816e09b53d-goog
next reply other threads:[~2023-05-03 16:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-03 16:08 Sean Christopherson [this message]
2023-05-03 16:08 ` [PATCH v2 1/3] KVM: VMX: Don't rely _only_ on CPUID to enforce XCR0 restrictions for ECREATE Sean Christopherson
2023-05-03 16:08 ` [PATCH v2 2/3] KVM: x86: Don't adjust guest's CPUID.0x12.1 (allowed SGX enclave XFRM) Sean Christopherson
2023-05-03 16:08 ` [PATCH v2 3/3] KVM: x86: Open code supported XCR0 calculation in kvm_vcpu_after_set_cpuid() Sean Christopherson
2023-05-19 17:54 ` [PATCH v2 0/3] KVM: x86: SGX vs. XCR0 cleanups Paolo Bonzini
2023-05-19 20:57 ` Sean Christopherson
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=20230503160838.3412617-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=kai.huang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.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
all inboxes | Powered by JetHome®