[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1b4b247e8a374e1b8c2d7c2bee948f8e50a9ea5b.1673539699.git.isaku.yamahata@intel.com>
Date: Thu, 12 Jan 2023 08:32:46 -0800
From: isaku.yamahata@...el.com
To: kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: isaku.yamahata@...el.com, isaku.yamahata@...il.com,
Paolo Bonzini <pbonzini@...hat.com>, erdemaktas@...gle.com,
Sean Christopherson <seanjc@...gle.com>,
Sagi Shahar <sagis@...gle.com>,
David Matlack <dmatlack@...gle.com>
Subject: [PATCH v11 098/113] KVM: TDX: Handle TDX PV report fatal error hypercall
From: Isaku Yamahata <isaku.yamahata@...el.com>
Wire up TDX PV report fatal error hypercall to exit to device model so that
it can gracefully handle it.
Signed-off-by: Isaku Yamahata <isaku.yamahata@...el.com>
---
arch/x86/kvm/vmx/tdx.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
index 5dc7dae55c57..4bbde58510a4 100644
--- a/arch/x86/kvm/vmx/tdx.c
+++ b/arch/x86/kvm/vmx/tdx.c
@@ -1199,6 +1199,13 @@ static int handle_tdvmcall(struct kvm_vcpu *vcpu)
return tdx_emulate_rdmsr(vcpu);
case EXIT_REASON_MSR_WRITE:
return tdx_emulate_wrmsr(vcpu);
+ case TDG_VP_VMCALL_REPORT_FATAL_ERROR:
+ /*
+ * Exit to userspace device model for tear down.
+ * Because guest TD is already panicking, returning an error to
+ * guest TD doesn't make sense. No argument check is done.
+ */
+ return tdx_vp_vmcall_to_user(vcpu);
default:
break;
}
--
2.25.1
Powered by blists - more mailing lists