From: Kai Huang <kai.huang@intel.com>
To: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, pbonzini@redhat.com,
seanjc@google.com, vkuznets@redhat.com, jmattson@google.com,
joro@8bytes.org, wanpengli@tencent.com
Subject: [PATCH 0/3] Include MKTME KeyID bits to MMU shadow_zero_check
Date: Tue, 19 Apr 2022 23:17:01 +1200 [thread overview]
Message-ID: <cover.1650363789.git.kai.huang@intel.com> (raw)
Host kernel never sets any Intel MKTME KeyID bits (including TDX KeyID
bits) in any mapping. KVM should not set any of them to MMU's SPTE which
maps to guest memory either. KVM MMU has shadow_zero_check which
contains those bits must be 0 for SPTE. This series adds MKTME bits to
shadow_zero_check. The first patch is not directly needed but looks
better to have IMHO. Patch 02/03 actually do the job.
Sanity tested by creating normal VMs on TDX capable machine (with TDX
turned on). However this is not tested on AMD machine since I don't have
access to any, though the risk should be very small I suppose.
Kai Huang (3):
KVM: x86/mmu: Rename reset_rsvds_bits_mask()
KVM: x86/mmu: Add shadow_me_value and repurpose shadow_me_mask
KVM: VMX: Include MKTME KeyID bits to shadow_zero_check
arch/x86/kvm/mmu.h | 20 ++++++++++++++++++++
arch/x86/kvm/mmu/mmu.c | 22 +++++++++++++++-------
arch/x86/kvm/mmu/spte.c | 40 ++++++++++++++++------------------------
arch/x86/kvm/mmu/spte.h | 1 +
arch/x86/kvm/svm/svm.c | 3 +++
arch/x86/kvm/vmx/vmx.c | 31 +++++++++++++++++++++++++++++++
6 files changed, 86 insertions(+), 31 deletions(-)
--
2.35.1
next reply other threads:[~2022-04-19 11:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 11:17 Kai Huang [this message]
2022-04-19 11:17 ` [PATCH 1/3] KVM: x86/mmu: Rename reset_rsvds_bits_mask() Kai Huang
2022-04-19 11:17 ` [PATCH 2/3] KVM: x86/mmu: Add shadow_me_value and repurpose shadow_me_mask Kai Huang
2022-04-19 11:17 ` [PATCH 3/3] KVM: VMX: Include MKTME KeyID bits to shadow_zero_check Kai Huang
2022-05-02 16:22 ` [PATCH 0/3] Include MKTME KeyID bits to MMU shadow_zero_check Paolo Bonzini
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.1650363789.git.kai.huang@intel.com \
--to=kai.huang@intel.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.