All of lore.kernel.org
 help / color / mirror / Atom feed
From: isaku.yamahata@intel.com
To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: isaku.yamahata@intel.com, isaku.yamahata@gmail.com,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH v7 054/102] KVM: TDX: TDP MMU TDX support
Date: Mon, 27 Jun 2022 14:53:46 -0700	[thread overview]
Message-ID: <e43d6ef9434712c61d65195794e7e4d154fa0290.1656366338.git.isaku.yamahata@intel.com> (raw)
In-Reply-To: <cover.1656366337.git.isaku.yamahata@intel.com>

From: Isaku Yamahata <isaku.yamahata@intel.com>

Implement hooks of TDP MMU for TDX backend.  TLB flush, TLB shootdown,
propagating the change private EPT entry to Secure EPT and freeing Secure
EPT page.

TLB flush handles both shared EPT and private EPT.  It flushes shared EPT
same as VMX.  It also waits for the TDX TLB shootdown.

For the hook to free Secure EPT page, unlinks the Secure EPT page from the
Secure EPT so that the page can be freed to OS.

Propagating the entry change to Secure EPT.  The possible entry changes are
present -> non-present(zapping) and non-present -> present(population).  On
population just link the Secure EPT page or the private guest page to the
Secure EPT by TDX SEAMCALL.

Because TDP MMU allows concurrent zapping/population, zapping requires
synchronous TLB shootdown with the frozen EPT entry.  It zaps the secure
entry, increments TLB counter, sends IPI to remote vcpus to trigger TLB
flush, and then unlinks the private guest page from the Secure EPT.

For simplicity, batched zapping with exclude lock is handled as concurrent
zapping.  Although it's inefficient, it can be optimized in the future.

Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
 arch/x86/kvm/vmx/main.c    |  40 ++++-
 arch/x86/kvm/vmx/tdx.c     | 318 +++++++++++++++++++++++++++++++++++++
 arch/x86/kvm/vmx/tdx.h     |  21 +++
 arch/x86/kvm/vmx/x86_ops.h |   2 +
 4 files changed, 377 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c
index 252b7298b230..442d89e02459 100644
--- a/arch/x86/kvm/vmx/main.c
+++ b/arch/x86/kvm/vmx/main.c
@@ -110,6 +110,38 @@ static void vt_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
 	return vmx_vcpu_reset(vcpu, init_event);
 }
 
+static void vt_flush_tlb_all(struct kvm_vcpu *vcpu)
+{
+	if (is_td_vcpu(vcpu))
+		return tdx_flush_tlb(vcpu);
+
+	vmx_flush_tlb_all(vcpu);
+}
+
+static void vt_flush_tlb_current(struct kvm_vcpu *vcpu)
+{
+	if (is_td_vcpu(vcpu))
+		return tdx_flush_tlb(vcpu);
+
+	vmx_flush_tlb_current(vcpu);
+}
+
+static void vt_flush_tlb_gva(struct kvm_vcpu *vcpu, gva_t addr)
+{
+	if (KVM_BUG_ON(is_td_vcpu(vcpu), vcpu->kvm))
+		return;
+
+	vmx_flush_tlb_gva(vcpu, addr);
+}
+
+static void vt_flush_tlb_guest(struct kvm_vcpu *vcpu)
+{
+	if (is_td_vcpu(vcpu))
+		return;
+
+	vmx_flush_tlb_guest(vcpu);
+}
+
 static void vt_load_mmu_pgd(struct kvm_vcpu *vcpu, hpa_t root_hpa,
 			int pgd_level)
 {
@@ -185,10 +217,10 @@ struct kvm_x86_ops vt_x86_ops __initdata = {
 	.set_rflags = vmx_set_rflags,
 	.get_if_flag = vmx_get_if_flag,
 
-	.flush_tlb_all = vmx_flush_tlb_all,
-	.flush_tlb_current = vmx_flush_tlb_current,
-	.flush_tlb_gva = vmx_flush_tlb_gva,
-	.flush_tlb_guest = vmx_flush_tlb_guest,
+	.flush_tlb_all = vt_flush_tlb_all,
+	.flush_tlb_current = vt_flush_tlb_current,
+	.flush_tlb_gva = vt_flush_tlb_gva,
+	.flush_tlb_guest = vt_flush_tlb_guest,
 
 	.vcpu_pre_run = vmx_vcpu_pre_run,
 	.vcpu_run = vmx_vcpu_run,
diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
index 24b428b7491d..3d578197d567 100644
--- a/arch/x86/kvm/vmx/tdx.c
+++ b/arch/x86/kvm/vmx/tdx.c
@@ -5,7 +5,9 @@
 
 #include "capabilities.h"
 #include "x86_ops.h"
+#include "mmu.h"
 #include "tdx.h"
+#include "vmx.h"
 #include "x86.h"
 
 #undef pr_fmt
@@ -290,6 +292,22 @@ int tdx_vm_init(struct kvm *kvm)
 	int ret, i;
 	u64 err;
 
+	/*
+	 * Because guest TD is protected, VMM can't parse the instruction in TD.
+	 * Instead, guest uses MMIO hypercall.  For unmodified device driver,
+	 * #VE needs to be injected for MMIO and #VE handler in TD converts MMIO
+	 * instruction into MMIO hypercall.
+	 *
+	 * SPTE value for MMIO needs to be setup so that #VE is injected into
+	 * TD instead of triggering EPT MISCONFIG.
+	 * - RWX=0 so that EPT violation is triggered.
+	 * - suppress #VE bit is cleared to inject #VE.
+	 */
+	kvm_mmu_set_mmio_spte_mask(kvm, 0, VMX_EPT_RWX_MASK, 0);
+
+	/* TODO: Enable 2mb and 1gb large page support. */
+	kvm->arch.tdp_max_page_level = PG_LEVEL_4K;
+
 	/* vCPUs can't be created until after KVM_TDX_INIT_VM. */
 	kvm->max_vcpus = 0;
 
@@ -374,6 +392,8 @@ int tdx_vm_init(struct kvm *kvm)
 		tdx_mark_td_page_added(&kvm_tdx->tdcs[i]);
 	}
 
+	spin_lock_init(&kvm_tdx->seamcall_lock);
+
 	/*
 	 * Note, TDH_MNG_INIT cannot be invoked here.  TDH_MNG_INIT requires a dedicated
 	 * ioctl() to define the configure CPUID values for the TD.
@@ -537,6 +557,281 @@ void tdx_load_mmu_pgd(struct kvm_vcpu *vcpu, hpa_t root_hpa, int pgd_level)
 	td_vmcs_write64(to_tdx(vcpu), SHARED_EPT_POINTER, root_hpa & PAGE_MASK);
 }
 
+static void tdx_unpin_pfn(struct kvm *kvm, kvm_pfn_t pfn)
+{
+	struct page *page = pfn_to_page(pfn);
+
+	put_page(page);
+	WARN_ON(!page_count(page) && to_kvm_tdx(kvm)->hkid > 0);
+}
+
+static void __tdx_sept_set_private_spte(struct kvm *kvm, gfn_t gfn,
+					enum pg_level level, kvm_pfn_t pfn)
+{
+	struct kvm_tdx *kvm_tdx = to_kvm_tdx(kvm);
+	hpa_t hpa = pfn_to_hpa(pfn);
+	gpa_t gpa = gfn_to_gpa(gfn);
+	struct tdx_module_output out;
+	u64 err;
+
+	if (WARN_ON_ONCE(is_error_noslot_pfn(pfn) || kvm_is_reserved_pfn(pfn)))
+		return;
+
+	/* TODO: handle large pages. */
+	if (KVM_BUG_ON(level != PG_LEVEL_4K, kvm))
+		return;
+
+	/* To prevent page migration, do nothing on mmu notifier. */
+	get_page(pfn_to_page(pfn));
+
+	if (likely(is_td_finalized(kvm_tdx))) {
+		err = tdh_mem_page_aug(kvm_tdx->tdr.pa, gpa, hpa, &out);
+		if (KVM_BUG_ON(err, kvm)) {
+			pr_tdx_error(TDH_MEM_PAGE_AUG, err, &out);
+			put_page(pfn_to_page(pfn));
+		}
+		return;
+	}
+}
+
+static void tdx_sept_set_private_spte(struct kvm *kvm, gfn_t gfn,
+				      enum pg_level level, kvm_pfn_t pfn)
+{
+	struct kvm_tdx *kvm_tdx = to_kvm_tdx(kvm);
+
+	spin_lock(&kvm_tdx->seamcall_lock);
+	__tdx_sept_set_private_spte(kvm, gfn, level, pfn);
+	spin_unlock(&kvm_tdx->seamcall_lock);
+}
+
+static void tdx_sept_drop_private_spte(
+	struct kvm *kvm, gfn_t gfn, enum pg_level level, kvm_pfn_t pfn)
+{
+	int tdx_level = pg_level_to_tdx_sept_level(level);
+	struct kvm_tdx *kvm_tdx = to_kvm_tdx(kvm);
+	gpa_t gpa = gfn_to_gpa(gfn);
+	hpa_t hpa = pfn_to_hpa(pfn);
+	hpa_t hpa_with_hkid;
+	struct tdx_module_output out;
+	u64 err = 0;
+
+	/* TODO: handle large pages. */
+	if (KVM_BUG_ON(level != PG_LEVEL_4K, kvm))
+		return;
+
+	spin_lock(&kvm_tdx->seamcall_lock);
+	if (is_hkid_assigned(kvm_tdx)) {
+		err = tdh_mem_page_remove(kvm_tdx->tdr.pa, gpa, tdx_level, &out);
+		if (KVM_BUG_ON(err, kvm)) {
+			pr_tdx_error(TDH_MEM_PAGE_REMOVE, err, &out);
+			goto unlock;
+		}
+
+		hpa_with_hkid = set_hkid_to_hpa(hpa, (u16)kvm_tdx->hkid);
+		err = tdh_phymem_page_wbinvd(hpa_with_hkid);
+		if (WARN_ON_ONCE(err)) {
+			pr_tdx_error(TDH_PHYMEM_PAGE_WBINVD, err, NULL);
+			goto unlock;
+		}
+	} else
+		/*
+		 * The HKID assigned to this TD was already freed and cache
+		 * was already flushed. We don't have to flush again.
+		 */
+		err = tdx_reclaim_page((unsigned long)__va(hpa), hpa, false, 0);
+
+unlock:
+	spin_unlock(&kvm_tdx->seamcall_lock);
+
+	if (!err)
+		tdx_unpin_pfn(kvm, pfn);
+}
+
+static int tdx_sept_link_private_sp(struct kvm *kvm, gfn_t gfn,
+				    enum pg_level level, void *sept_page)
+{
+	int tdx_level = pg_level_to_tdx_sept_level(level);
+	struct kvm_tdx *kvm_tdx = to_kvm_tdx(kvm);
+	gpa_t gpa = gfn_to_gpa(gfn);
+	hpa_t hpa = __pa(sept_page);
+	struct tdx_module_output out;
+	u64 err;
+
+	spin_lock(&kvm_tdx->seamcall_lock);
+	err = tdh_mem_sept_add(kvm_tdx->tdr.pa, gpa, tdx_level, hpa, &out);
+	spin_unlock(&kvm_tdx->seamcall_lock);
+	if (KVM_BUG_ON(err, kvm)) {
+		pr_tdx_error(TDH_MEM_SEPT_ADD, err, &out);
+		return -EIO;
+	}
+
+	return 0;
+}
+
+static void tdx_sept_zap_private_spte(struct kvm *kvm, gfn_t gfn,
+				      enum pg_level level)
+{
+	int tdx_level = pg_level_to_tdx_sept_level(level);
+	struct kvm_tdx *kvm_tdx = to_kvm_tdx(kvm);
+	gpa_t gpa = gfn_to_gpa(gfn);
+	struct tdx_module_output out;
+	u64 err;
+
+	/* For now large page isn't supported yet. */
+	WARN_ON_ONCE(level != PG_LEVEL_4K);
+	spin_lock(&kvm_tdx->seamcall_lock);
+	err = tdh_mem_range_block(kvm_tdx->tdr.pa, gpa, tdx_level, &out);
+	spin_unlock(&kvm_tdx->seamcall_lock);
+	if (KVM_BUG_ON(err, kvm))
+		pr_tdx_error(TDH_MEM_RANGE_BLOCK, err, &out);
+}
+
+/*
+ * TLB shoot down procedure:
+ * There is a global epoch counter and each vcpu has local epoch counter.
+ * - TDH.MEM.RANGE.BLOCK(TDR. level, range) on one vcpu
+ *   This blocks the subsequenct creation of TLB translation on that range.
+ *   This corresponds to clear the present bit(all RXW) in EPT entry
+ * - TDH.MEM.TRACK(TDR): advances the epoch counter which is global.
+ * - IPI to remote vcpus
+ * - TDExit and re-entry with TDH.VP.ENTER on remote vcpus
+ * - On re-entry, TDX module compares the local epoch counter with the global
+ *   epoch counter.  If the local epoch counter is older than the global epoch
+ *   counter, update the local epoch counter and flushes TLB.
+ */
+static void tdx_track(struct kvm_tdx *kvm_tdx)
+{
+	u64 err;
+
+	WARN_ON(!is_hkid_assigned(kvm_tdx));
+	/* If TD isn't finalized, it's before any vcpu running. */
+	if (unlikely(!is_td_finalized(kvm_tdx)))
+		return;
+
+	/*
+	 * tdx_flush_tlb() waits for this function to issue TDH.MEM.TRACK() by
+	 * the counter.  The counter is used instead of bool because multiple
+	 * TDH_MEM_TRACK() can be issued concurrently by multiple vcpus.
+	 */
+	atomic_inc(&kvm_tdx->tdh_mem_track);
+	/*
+	 * KVM_REQ_TLB_FLUSH waits for the empty IPI handler, ack_flush(), with
+	 * KVM_REQUEST_WAIT.
+	 */
+	kvm_make_all_cpus_request(&kvm_tdx->kvm, KVM_REQ_TLB_FLUSH);
+
+	spin_lock(&kvm_tdx->seamcall_lock);
+	err = tdh_mem_track(kvm_tdx->tdr.pa);
+	spin_unlock(&kvm_tdx->seamcall_lock);
+
+	/* Release remote vcpu waiting for TDH.MEM.TRACK in tdx_flush_tlb(). */
+	atomic_dec(&kvm_tdx->tdh_mem_track);
+
+	if (KVM_BUG_ON(err, &kvm_tdx->kvm))
+		pr_tdx_error(TDH_MEM_TRACK, err, NULL);
+
+}
+
+static int tdx_sept_free_private_sp(struct kvm *kvm, gfn_t gfn, enum pg_level level,
+				    void *sept_page)
+{
+	struct kvm_tdx *kvm_tdx = to_kvm_tdx(kvm);
+	int ret;
+
+	/*
+	 * free_private_sp() is (obviously) called when a shadow page is being
+	 * zapped.  KVM doesn't (yet) zap private SPs while the TD is active.
+	 * Note: This function is for private shadow page.  Not for private
+	 * guest page.   private guest page can be zapped during TD is active.
+	 * shared <-> private conversion and slot move/deletion.
+	 *
+	 * TODO: large page support.  If large page is supported, S-EPT page
+	 * can be freed when promoting 4K page to 2M/1G page during TD running.
+	 * In such case, flush cache and TDH.PAGE.RECLAIM.
+	 */
+	if (KVM_BUG_ON(is_hkid_assigned(to_kvm_tdx(kvm)), kvm))
+		return -EINVAL;
+
+	/*
+	 * The HKID assigned to this TD was already freed and cache was
+	 * already flushed. We don't have to flush again.
+	 */
+	spin_lock(&kvm_tdx->seamcall_lock);
+	ret = tdx_reclaim_page((unsigned long)sept_page, __pa(sept_page), false, 0);
+	spin_unlock(&kvm_tdx->seamcall_lock);
+
+	return ret;
+}
+
+static int tdx_sept_tlb_remote_flush(struct kvm *kvm)
+{
+	struct kvm_tdx *kvm_tdx;
+
+	if (!is_td(kvm))
+		return -EOPNOTSUPP;
+
+	kvm_tdx = to_kvm_tdx(kvm);
+	if (is_hkid_assigned(kvm_tdx))
+		tdx_track(kvm_tdx);
+
+	return 0;
+}
+
+static void tdx_handle_changed_private_spte(
+	struct kvm *kvm, const struct kvm_spte_change *change)
+{
+	const gfn_t gfn = change->gfn;
+	const enum pg_level level = change->level;
+
+	WARN_ON(!is_td(kvm));
+	lockdep_assert_held(&kvm->mmu_lock);
+
+	if (change->new.is_present) {
+		/* TDP MMU doesn't change present -> present */
+		WARN_ON(change->old.is_present);
+
+		/*
+		 * Use different call to either set up middle level
+		 * private page table, or leaf.
+		 */
+		if (change->new.is_leaf)
+			tdx_sept_set_private_spte(
+				kvm, gfn, level, change->new.pfn);
+		else {
+			WARN_ON(!change->sept_page);
+			if (tdx_sept_link_private_sp(
+				    kvm, gfn, level, change->sept_page))
+				/* failed to update Secure-EPT.  */
+				WARN_ON(1);
+		}
+	} else if (change->old.is_leaf) {
+		/* non-present -> non-present doesn't make sense. */
+		WARN_ON(!change->old.is_present);
+
+		/*
+		 * Zap private leaf SPTE.  Zapping private table is done
+		 * below in handle_removed_tdp_mmu_page().
+		 */
+		tdx_sept_zap_private_spte(kvm, gfn, level);
+
+		/*
+		 * TDX requires TLB tracking before dropping private page.  Do
+		 * it here, although it is also done later.
+		 * If hkid isn't assigned, the guest is destroying and no vcpu
+		 * runs further.  TLB shootdown isn't needed.
+		 *
+		 * TODO: implement with_range version for optimization.
+		 * kvm_flush_remote_tlbs_with_address(kvm, gfn, 1);
+		 *   => tdx_sept_tlb_remote_flush_with_range(kvm, gfn,
+		 *                                 KVM_PAGES_PER_HPAGE(level));
+		 */
+		if (is_hkid_assigned(to_kvm_tdx(kvm)))
+			kvm_flush_remote_tlbs(kvm);
+
+		tdx_sept_drop_private_spte(kvm, gfn, level, change->old.pfn);
+	}
+}
+
 int tdx_dev_ioctl(void __user *argp)
 {
 	struct kvm_tdx_capabilities __user *user_caps;
@@ -786,6 +1081,25 @@ static int tdx_td_init(struct kvm *kvm, struct kvm_tdx_cmd *cmd)
 	return ret;
 }
 
+void tdx_flush_tlb(struct kvm_vcpu *vcpu)
+{
+	struct kvm_tdx *kvm_tdx = to_kvm_tdx(vcpu->kvm);
+	struct kvm_mmu *mmu = vcpu->arch.mmu;
+	u64 root_hpa = mmu->root.hpa;
+
+	/* Flush the shared EPTP, if it's valid. */
+	if (VALID_PAGE(root_hpa))
+		ept_sync_context(construct_eptp(vcpu, root_hpa,
+						mmu->root_role.level));
+
+	/*
+	 * See tdx_track().  Wait for tlb shootdown initiater to finish
+	 * TDH_MEM_TRACK() so that TLB is flushed on the next TDENTER.
+	 */
+	while (atomic_read(&kvm_tdx->tdh_mem_track))
+		cpu_relax();
+}
+
 int tdx_vm_ioctl(struct kvm *kvm, void __user *argp)
 {
 	struct kvm_tdx_cmd tdx_cmd;
@@ -927,6 +1241,10 @@ int __init tdx_hardware_setup(struct kvm_x86_ops *x86_ops)
 	pr_info("kvm: TDX is supported. hkid start pos %d mask 0x%llx\n",
 		hkid_start_pos, hkid_mask);
 
+	x86_ops->tlb_remote_flush = tdx_sept_tlb_remote_flush;
+	x86_ops->free_private_sp = tdx_sept_free_private_sp;
+	x86_ops->handle_changed_private_spte = tdx_handle_changed_private_spte;
+
 	return 0;
 }
 
diff --git a/arch/x86/kvm/vmx/tdx.h b/arch/x86/kvm/vmx/tdx.h
index 337c3adb4fcf..d8dcbedd690b 100644
--- a/arch/x86/kvm/vmx/tdx.h
+++ b/arch/x86/kvm/vmx/tdx.h
@@ -26,9 +26,24 @@ struct kvm_tdx {
 	int hkid;
 
 	bool finalized;
+	atomic_t tdh_mem_track;
 
 	u64 tsc_offset;
 	unsigned long tsc_khz;
+
+	/*
+	 * Some SEAMCALLs try to lock TD resources (e.g. Secure-EPT) they use or
+	 * update.  If TDX module fails to obtain the lock, it returns
+	 * TDX_OPERAND_BUSY error without spinning.  It's VMM/OS responsibility
+	 * to retry or guarantee no contention because TDX module has the
+	 * restriction on cpu cycles it can spend and VMM/OS knows better
+	 * vcpu scheduling.
+	 *
+	 * TDP MMU uses read lock of kvm.arch.mmu_lock so TDP MMU code can be
+	 * run concurrently with multiple vCPUs.   Lock to prevent seamcalls from
+	 * running concurrently when TDP MMU is enabled.
+	 */
+	spinlock_t seamcall_lock;
 };
 
 struct vcpu_tdx {
@@ -169,6 +184,12 @@ static __always_inline u64 td_tdcs_exec_read64(struct kvm_tdx *kvm_tdx, u32 fiel
 	return out.r8;
 }
 
+static __always_inline int pg_level_to_tdx_sept_level(enum pg_level level)
+{
+	WARN_ON(level == PG_LEVEL_NONE);
+	return level - 1;
+}
+
 #else
 static inline int tdx_module_setup(void) { return -ENODEV; };
 
diff --git a/arch/x86/kvm/vmx/x86_ops.h b/arch/x86/kvm/vmx/x86_ops.h
index e70f84d29d21..2c55aea8963f 100644
--- a/arch/x86/kvm/vmx/x86_ops.h
+++ b/arch/x86/kvm/vmx/x86_ops.h
@@ -145,6 +145,7 @@ void tdx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event);
 int tdx_vm_ioctl(struct kvm *kvm, void __user *argp);
 int tdx_vcpu_ioctl(struct kvm_vcpu *vcpu, void __user *argp);
 
+void tdx_flush_tlb(struct kvm_vcpu *vcpu);
 void tdx_load_mmu_pgd(struct kvm_vcpu *vcpu, hpa_t root_hpa, int root_level);
 #else
 static inline int tdx_hardware_setup(struct kvm_x86_ops *x86_ops) { return 0; }
@@ -164,6 +165,7 @@ static inline void tdx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event) {}
 static inline int tdx_vm_ioctl(struct kvm *kvm, void __user *argp) { return -EOPNOTSUPP; }
 static inline int tdx_vcpu_ioctl(struct kvm_vcpu *vcpu, void __user *argp) { return -EOPNOTSUPP; }
 
+static inline void tdx_flush_tlb(struct kvm_vcpu *vcpu) {}
 static inline void tdx_load_mmu_pgd(struct kvm_vcpu *vcpu, hpa_t root_hpa, int root_level) {}
 #endif
 
-- 
2.25.1


  parent reply	other threads:[~2022-06-27 21:59 UTC|newest]

Thread overview: 219+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 21:52 [PATCH v7 000/102] KVM TDX basic feature support isaku.yamahata
2022-06-27 21:52 ` [PATCH v7 001/102] KVM: x86: Move check_processor_compatibility from init ops to runtime ops isaku.yamahata
2022-06-27 21:52 ` [PATCH v7 002/102] Partially revert "KVM: Pass kvm_init()'s opaque param to additional arch funcs" isaku.yamahata
2022-07-13  1:55   ` Kai Huang
2022-07-26 23:57     ` Isaku Yamahata
2022-06-27 21:52 ` [PATCH v7 003/102] KVM: Refactor CPU compatibility check on module initialiization isaku.yamahata
2022-07-12  1:15   ` Kai Huang
2022-07-13  3:16     ` Kai Huang
2022-07-13  3:11   ` Kai Huang
2022-07-27 22:04   ` Isaku Yamahata
2022-06-27 21:52 ` [PATCH v7 004/102] KVM: VMX: Move out vmx_x86_ops to 'main.c' to wrap VMX and TDX isaku.yamahata
2022-06-27 21:52 ` [PATCH v7 005/102] x86/virt/vmx/tdx: export platform_tdx_enabled() isaku.yamahata
2022-06-27 21:52 ` [PATCH v7 006/102] KVM: TDX: Detect CPU feature on kernel module initialization isaku.yamahata
2022-06-28  3:43   ` Kai Huang
2022-07-11 23:48     ` Isaku Yamahata
2022-07-12  0:45       ` Kai Huang
2022-06-27 21:52 ` [PATCH v7 007/102] KVM: Enable hardware before doing arch VM initialization isaku.yamahata
2022-06-28  2:59   ` Kai Huang
2022-06-27 21:53 ` [PATCH v7 008/102] KVM: x86: Refactor KVM VMX module init/exit functions isaku.yamahata
2022-06-28  3:53   ` Kai Huang
2022-07-12  0:38     ` Isaku Yamahata
2022-07-12  1:30       ` Kai Huang
2022-07-27  0:44         ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 009/102] KVM: TDX: Add placeholders for TDX VM/vcpu structure isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 010/102] x86/virt/tdx: Add a helper function to return system wide info about TDX module isaku.yamahata
2022-07-07  2:46   ` Yuan Yao
2022-07-12  0:39     ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 011/102] KVM: TDX: Initialize TDX module when loading kvm_intel.ko isaku.yamahata
2022-06-28  4:31   ` Kai Huang
2022-07-12  0:46     ` Isaku Yamahata
2022-07-12  1:13       ` Kai Huang
2022-07-27  0:39         ` Isaku Yamahata
2022-07-27  4:38           ` Kai Huang
2022-06-27 21:53 ` [PATCH v7 012/102] KVM: x86: Introduce vm_type to differentiate default VMs from confidential VMs isaku.yamahata
2022-06-28  2:52   ` Kai Huang
2022-07-04  6:44     ` Kai Huang
2022-07-12  1:01     ` Isaku Yamahata
2022-07-12  1:24       ` Kai Huang
2022-06-27 21:53 ` [PATCH v7 013/102] KVM: TDX: Make TDX VM type supported isaku.yamahata
2022-07-07  2:55   ` Yuan Yao
2022-07-12  1:06     ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 014/102] [MARKER] The start of TDX KVM patch series: TDX architectural definitions isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 015/102] KVM: TDX: Define " isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 016/102] KVM: TDX: Add TDX "architectural" error codes isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 017/102] KVM: TDX: Add C wrapper functions for SEAMCALLs to the TDX module isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 018/102] KVM: TDX: Add helper functions to print TDX SEAMCALL error isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 019/102] [MARKER] The start of TDX KVM patch series: TD VM creation/destruction isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 020/102] KVM: TDX: Stub in tdx.h with structs, accessors, and VMCS helpers isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 021/102] x86/cpu: Add helper functions to allocate/free TDX private host key id isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 022/102] KVM: TDX: create/destroy VM structure isaku.yamahata
2022-07-07  6:16   ` Yuan Yao
2022-07-12  6:21     ` Isaku Yamahata
2022-08-02 19:46   ` Sean Christopherson
2022-08-11 18:29     ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 023/102] KVM: TDX: x86: Add ioctl to get TDX systemwide parameters isaku.yamahata
2022-07-07  6:48   ` Yuan Yao
2022-06-27 21:53 ` [PATCH v7 024/102] KVM: TDX: Add place holder for TDX VM specific mem_enc_op ioctl isaku.yamahata
2022-07-07  7:12   ` Yuan Yao
2022-06-27 21:53 ` [PATCH v7 025/102] KVM: TDX: initialize VM with TDX specific parameters isaku.yamahata
2022-06-28  8:30   ` Xiaoyao Li
2022-07-12  7:11     ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 026/102] KVM: TDX: Make pmu_intel.c ignore guest TD case isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 027/102] [MARKER] The start of TDX KVM patch series: TD vcpu creation/destruction isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 028/102] KVM: TDX: allocate/free TDX vcpu structure isaku.yamahata
2022-08-02 19:56   ` Sean Christopherson
2022-06-27 21:53 ` [PATCH v7 029/102] " isaku.yamahata
2022-06-28 11:34   ` Kai Huang
2022-07-12  7:55     ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 030/102] KVM: TDX: Do TDX specific vcpu initialization isaku.yamahata
2022-07-08  2:14   ` Yuan Yao
2022-07-12 20:35     ` Isaku Yamahata
2022-07-13  0:22       ` Xiaoyao Li
2022-06-27 21:53 ` [PATCH v7 031/102] [MARKER] The start of TDX KVM patch series: KVM MMU GPA shared bits isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 032/102] KVM: x86/mmu: introduce config for PRIVATE KVM MMU isaku.yamahata
2022-07-08  1:53   ` Kai Huang
2022-07-13  1:25     ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 033/102] KVM: x86/mmu: Add address conversion functions for TDX shared bits isaku.yamahata
2022-07-08  2:15   ` Kai Huang
2022-07-13  4:52     ` Isaku Yamahata
2022-07-13 10:41       ` Kai Huang
2022-07-14  0:14         ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 034/102] [MARKER] The start of TDX KVM patch series: KVM TDP refactoring for TDX isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 035/102] KVM: x86/mmu: Explicitly check for MMIO spte in fast page fault isaku.yamahata
2022-06-30 11:37   ` Kai Huang
2022-07-13  8:35     ` Isaku Yamahata
2022-07-13 10:29       ` Kai Huang
2022-06-27 21:53 ` [PATCH v7 036/102] KVM: x86/mmu: Allow non-zero value for non-present SPTE isaku.yamahata
2022-06-30 11:03   ` Kai Huang
2022-07-14 18:05     ` Isaku Yamahata
2022-07-08  5:18   ` Yuan Yao
2022-07-08 15:30     ` Sean Christopherson
2022-07-11  7:05       ` Yuan Yao
2022-07-11 14:47         ` Sean Christopherson
2022-07-14 18:41   ` Isaku Yamahata
2022-07-20  2:44     ` Kai Huang
2022-07-20  3:12     ` Kai Huang
2022-06-27 21:53 ` [PATCH v7 037/102] KVM: x86/mmu: Track shadow MMIO value/mask on a per-VM basis isaku.yamahata
2022-06-30 11:45   ` Kai Huang
2022-07-05 14:06   ` Kai Huang
2022-07-19  8:47   ` Isaku Yamahata
2022-07-20  3:45     ` Kai Huang
2022-07-27 23:20       ` Isaku Yamahata
2022-07-28  0:48         ` Kai Huang
2022-06-27 21:53 ` [PATCH v7 038/102] KVM: x86/mmu: Disallow fast page fault on private GPA isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 039/102] KVM: x86/mmu: Allow per-VM override of the TDP max page level isaku.yamahata
2022-06-30 12:27   ` Kai Huang
2022-07-19 10:26     ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 040/102] KVM: x86/mmu: Zap only leaf SPTEs for deleted/moved memslot for private mmu isaku.yamahata
2022-07-01 10:41   ` Kai Huang
2022-07-19 11:06     ` Isaku Yamahata
2022-07-19 23:17       ` Kai Huang
2022-06-27 21:53 ` [PATCH v7 041/102] KVM: VMX: Introduce test mode related to EPT violation VE isaku.yamahata
2022-07-08  2:23   ` Kai Huang
2022-07-19 14:49     ` Isaku Yamahata
2022-07-20  5:13       ` Kai Huang
2022-07-27 23:39         ` Isaku Yamahata
2022-07-28  0:54           ` Kai Huang
2022-07-28 20:11             ` Sean Christopherson
2022-08-09  0:48               ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 042/102] [MARKER] The start of TDX KVM patch series: KVM TDP MMU hooks isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 043/102] KVM: x86/mmu: Focibly use TDP MMU for TDX isaku.yamahata
2022-07-11  5:48   ` Yuan Yao
2022-07-11 14:56   ` Sean Christopherson
2022-07-19 15:04     ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 044/102] KVM: x86/mmu: Add a private pointer to struct kvm_mmu_page isaku.yamahata
2022-07-01 11:12   ` Kai Huang
2022-07-19 15:35     ` Isaku Yamahata
2022-07-11  6:28   ` Yuan Yao
2022-07-28 19:41   ` David Matlack
2022-08-09 23:52     ` Isaku Yamahata
2022-07-28 20:13   ` David Matlack
2022-08-09 23:50     ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 045/102] KVM: x86/tdp_mmu: refactor kvm_tdp_mmu_map() isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 046/102] KVM: x86/tdp_mmu: Support TDX private mapping for TDP MMU isaku.yamahata
2022-07-08  3:44   ` Kai Huang
2022-07-26 23:39     ` Isaku Yamahata
2022-07-11  8:28   ` Yuan Yao
2022-07-26 23:41     ` Isaku Yamahata
2022-07-12  2:36   ` Yuan Yao
2022-07-26 23:42     ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 047/102] [MARKER] The start of TDX KVM patch series: TDX EPT violation isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 048/102] KVM: x86/mmu: Disallow dirty logging for x86 TDX isaku.yamahata
2022-07-08  2:30   ` Kai Huang
2022-06-27 21:53 ` [PATCH v7 049/102] KVM: x86/tdp_mmu: Ignore unsupported mmu operation on private GFNs isaku.yamahata
2022-07-12  2:58   ` Yuan Yao
2022-07-19 18:03     ` Isaku Yamahata
2022-06-27 21:53 ` [PATCH v7 050/102] KVM: VMX: Split out guts of EPT violation to common/exposed function isaku.yamahata
2022-07-08 10:25   ` Kai Huang
2022-06-27 21:53 ` [PATCH v7 051/102] KVM: VMX: Move setting of EPT MMU masks to common VT-x code isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 052/102] KVM: TDX: Add load_mmu_pgd method for TDX isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 053/102] KVM: TDX: don't request KVM_REQ_APIC_PAGE_RELOAD isaku.yamahata
2022-07-12  3:47   ` Yuan Yao
2022-07-12  6:14     ` Chao Gao
2022-07-19 18:12       ` Isaku Yamahata
2022-06-27 21:53 ` isaku.yamahata [this message]
2022-06-27 21:53 ` [PATCH v7 055/102] [MARKER] The start of TDX KVM patch series: KVM TDP MMU MapGPA isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 056/102] KVM: x86/mmu: steal software usable git to record if GFN is for shared or not isaku.yamahata
2022-07-18  8:37   ` Yuan Yao
2022-06-27 21:53 ` [PATCH v7 057/102] KVM: x86/tdp_mmu: implement MapGPA hypercall for TDX isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 058/102] KVM: x86/mmu: Introduce kvm_mmu_map_tdp_page() for use by TDX isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 059/102] [MARKER] The start of TDX KVM patch series: TD finalization isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 060/102] KVM: TDX: Create initial guest memory isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 061/102] KVM: TDX: Finalize VM initialization isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 062/102] [MARKER] The start of TDX KVM patch series: TD vcpu enter/exit isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 063/102] KVM: TDX: Add helper assembly function to TDX vcpu isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 064/102] KVM: TDX: Implement TDX vcpu enter/exit path isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 065/102] KVM: TDX: vcpu_run: save/restore host state(host kernel gs) isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 066/102] KVM: TDX: restore host xsave state when exit from the guest TD isaku.yamahata
2022-06-27 21:53 ` [PATCH v7 067/102] KVM: x86: Allow to update cached values in kvm_user_return_msrs w/o wrmsr isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 068/102] KVM: TDX: restore user ret MSRs isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 069/102] [MARKER] The start of TDX KVM patch series: TD vcpu exits/interrupts/hypercalls isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 070/102] KVM: TDX: complete interrupts after tdexit isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 071/102] KVM: TDX: restore debug store when TD exit isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 072/102] KVM: TDX: handle vcpu migration over logical processor isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 073/102] KVM: x86: Add a switch_db_regs flag to handle TDX's auto-switched behavior isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 074/102] KVM: TDX: Add support for find pending IRQ in a protected local APIC isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 075/102] KVM: x86: Assume timer IRQ was injected if APIC state is proteced isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 076/102] KVM: TDX: remove use of struct vcpu_vmx from posted_interrupt.c isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 077/102] KVM: TDX: Implement interrupt injection isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 078/102] KVM: TDX: Implements vcpu request_immediate_exit isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 079/102] KVM: TDX: Implement methods to inject NMI isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 080/102] KVM: VMX: Modify NMI and INTR handlers to take intr_info as function argument isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 081/102] KVM: VMX: Move NMI/exception handler to common helper isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 082/102] KVM: x86: Split core of hypercall emulation to helper function isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 083/102] KVM: TDX: Add a place holder to handle TDX VM exit isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 084/102] KVM: TDX: handle EXIT_REASON_OTHER_SMI isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 085/102] KVM: TDX: handle ept violation/misconfig exit isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 086/102] KVM: TDX: handle EXCEPTION_NMI and EXTERNAL_INTERRUPT isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 087/102] KVM: TDX: Add a place holder for handler of TDX hypercalls (TDG.VP.VMCALL) isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 088/102] KVM: TDX: handle KVM hypercall with TDG.VP.VMCALL isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 089/102] KVM: TDX: Handle TDX PV CPUID hypercall isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 090/102] KVM: TDX: Handle TDX PV HLT hypercall isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 091/102] KVM: TDX: Handle TDX PV port io hypercall isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 092/102] KVM: TDX: Handle TDX PV MMIO hypercall isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 093/102] KVM: TDX: Implement callbacks for MSR operations for TDX isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 094/102] KVM: TDX: Handle TDX PV rdmsr/wrmsr hypercall isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 095/102] KVM: TDX: Handle TDX PV report fatal error hypercall isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 096/102] KVM: TDX: Handle TDX PV map_gpa hypercall isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 097/102] KVM: TDX: Handle TDG.VP.VMCALL<GetTdVmCallInfo> hypercall isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 098/102] KVM: TDX: Silently discard SMI request isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 099/102] KVM: TDX: Silently ignore INIT/SIPI isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 100/102] KVM: TDX: Add methods to ignore accesses to CPU state isaku.yamahata
2022-06-27 21:54 ` [PATCH v7 101/102] Documentation/virtual/kvm: Document on Trust Domain Extensions(TDX) isaku.yamahata
2022-07-08  1:34   ` Kai Huang
2022-06-27 21:54 ` [PATCH v7 102/102] KVM: x86: design documentation on TDX support of x86 KVM TDP MMU isaku.yamahata
2022-07-11 15:17 ` [PATCH v7 000/102] KVM TDX basic feature support Isaku Yamahata
2022-07-12  5:07   ` Chao Gao
2022-07-12 10:54     ` Chao Peng
2022-07-12 17:22       ` Isaku Yamahata
2022-07-13  7:37         ` Chao Peng
2022-07-12 10:49   ` Chao Peng
2022-07-12 17:35     ` Isaku Yamahata
2022-07-14  1:03 ` Sean Christopherson
2022-07-14  4:09   ` Xiaoyao Li
2022-07-20 14:59   ` Chao Peng
2022-07-25 13:46     ` Nikunj A. Dadhania
2022-07-26 14:32       ` Chao Peng
2022-07-27  9:26         ` Nikunj A. Dadhania
2022-08-03 10:48           ` Chao Peng

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=e43d6ef9434712c61d65195794e7e4d154fa0290.1656366338.git.isaku.yamahata@intel.com \
    --to=isaku.yamahata@intel.com \
    --cc=isaku.yamahata@gmail.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 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.