61 lines
2.2 KiB
Diff
61 lines
2.2 KiB
Diff
From fd2d6e5623acae8b935c2ee5cb03d1a1b1631bb9 Mon Sep 17 00:00:00 2001
|
|
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
Date: Fri, 18 Jul 2025 18:03:48 +0200
|
|
Subject: [PATCH 081/115] i386/tdx: Don't treat SYSCALL as unavailable
|
|
|
|
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
|
|
RH-MergeRequest: 391: TDX support, including attestation and device assignment
|
|
RH-Jira: RHEL-15710 RHEL-20798 RHEL-49728
|
|
RH-Acked-by: Yash Mankad <None>
|
|
RH-Acked-by: Peter Xu <peterx@redhat.com>
|
|
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
|
RH-Commit: [81/115] f742fd685ae68e7828947fa1013a5bdb0b49750d (bonzini/rhel-qemu-kvm)
|
|
|
|
On Intel CPU, the value of CPUID_EXT2_SYSCALL depends on the mode of
|
|
the vcpu. It's 0 outside 64-bit mode and 1 in 64-bit mode.
|
|
|
|
The initial state of TDX vcpu is 32-bit protected mode. At the time of
|
|
calling KVM_TDX_GET_CPUID, vcpu hasn't started running so the value read
|
|
is 0.
|
|
|
|
In reality, 64-bit mode should always be supported. So mark
|
|
CPUID_EXT2_SYSCALL always supported to avoid false warning.
|
|
|
|
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
|
|
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
|
|
Link: https://lore.kernel.org/r/20250508150002.689633-53-xiaoyao.li@intel.com
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
(cherry picked from commit deb9db6fb789cfe80527b75983e86137589227a4)
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
---
|
|
target/i386/kvm/tdx.c | 13 +++++++++++++
|
|
1 file changed, 13 insertions(+)
|
|
|
|
diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
|
|
index 01fff9a27a..3e23010094 100644
|
|
--- a/target/i386/kvm/tdx.c
|
|
+++ b/target/i386/kvm/tdx.c
|
|
@@ -845,6 +845,19 @@ static int tdx_check_features(X86ConfidentialGuest *cg, CPUState *cs)
|
|
continue;
|
|
}
|
|
|
|
+ /* Fixup for special cases */
|
|
+ switch (w) {
|
|
+ case FEAT_8000_0001_EDX:
|
|
+ /*
|
|
+ * Intel enumerates SYSCALL bit as 1 only when processor in 64-bit
|
|
+ * mode and before vcpu running it's not in 64-bit mode.
|
|
+ */
|
|
+ actual |= CPUID_EXT2_SYSCALL;
|
|
+ break;
|
|
+ default:
|
|
+ break;
|
|
+ }
|
|
+
|
|
requested = env->features[w];
|
|
unavailable = requested & ~actual;
|
|
mark_unavailable_features(cpu, w, unavailable, unav_prefix);
|
|
--
|
|
2.50.1
|
|
|