KVM: TDX: Don't report base TDVMCALLs
Subsystems (4)
PATCH 1/1 KVM: TDX: Don't report base TDVMCALLs
Remove TDVMCALLINFO_GET_QUOTE from user_tdvmcallinfo_1_r11 reported to userspace to align with the direction of the GHCI spec.
Recently, concern was raised about a gap in the GHCI spec that left ambiguity in how to expose to the guest that only a subset of GHCI TDVMCalls were supported. During the back and forth on the spec details[0], <GetQuote> was moved from an individually enumerable TDVMCall, to one that is part of the 'base spec', meaning it doesn't have a specific bit in the <GetTDVMCallInfo> return values. Although the spec[1] is still in draft form, the GetQoute part has been agreed by the major TDX VMMs.
Unfortunately the commits that were upstreamed still treat <GetQuote> as individually enumerable. They set bit 0 in the user_tdvmcallinfo_1_r11 which is reported to userspace to tell supported optional TDVMCalls, intending to say that <GetQuote> is supported.
So stop reporting <GetQute> in user_tdvmcallinfo_1_r11 to align with the direction of the spec, and allow some future TDVMCall to use that bit.
[0] https://lore.kernel.org/all/[email protected]/
[1] https://cdrdv2.intel.com/v1/dl/getContent/858626
--- arch/x86/kvm/vmx/tdx.c | 2 -- 1 file changed, 2 deletions(-)
arch/x86/kvm/vmx/tdx.c +0 -2
@@ -173,7 +173,6 @@ static void td_init_cpuid_entry2(struct kvm_cpuid_entry2 *entry, unsigned char itdx_clear_unsupported_cpuid (entry); } -#define TDVMCALLINFO_GET_QUOTE BIT(0)#define TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT BIT(1) static int init_kvm_tdx_caps(const struct tdx_sys_info_td_conf *td_conf,
@@ -192,7 +191,6 @@ static int init_kvm_tdx_caps(const struct tdx_sys_info_td_conf *td_conf, caps->cpuid.nent = td_conf->num_cpuid_config; caps->user_tdvmcallinfo_1_r11 = -TDVMCALLINFO_GET_QUOTE |TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT ;for (i =0 ; i < td_conf->num_cpuid_config; i++)
Signature · 1 line
2.43.0
Quoted 8 lines · Xiaoyao Li
Remove
TDVMCALLINFO_GET_QUOTEfromuser_tdvmcallinfo_1_r11reported to userspace to align with the direction of the GHCI spec.Recently, concern was raised about a gap in the GHCI spec that left ambiguity in how to expose to the guest that only a subset of GHCI TDVMCalls were supported. During the back and forth on the spec details[0], <GetQuote> was moved from an individually enumerable TDVMCall, to one that is part of the 'base spec', meaning it doesn't have a specific bit in the
'GHCI base API' is more appropriate instead of 'base spec'
Quoted 2 lines
<GetTDVMCallInfo> return values. Although the spec[1] is still in draft form, the GetQoute part has been agreed by the major TDX VMMs.
GetQoute -> <GetQuote>
typo and use <> to align with others.
Quoted 7 lines
Unfortunately the commits that were upstreamed still treat <GetQuote> as individually enumerable. They set bit 0 in the
user_tdvmcallinfo_1_r11which is reported to userspace to tell supported optional TDVMCalls, intending to say that <GetQuote> is supported.So stop reporting <GetQute> in
user_tdvmcallinfo_1_r11to align with
GetQute -> GetQuote
Quoted 7 lines
the direction of the spec, and allow some future TDVMCall to use that bit.
[0] https://lore.kernel.org/all/[email protected]/
[1] https://cdrdv2.intel.com/v1/dl/getContent/858626Fixes 28224ef02b56 ("KVM: TDX: Report supported optional TDVMCALLs in TDX capabilities")Signed-off-by Xiaoyao Li <[email protected]>
Nits: typos and wording suggested above.
Quoted 24 lines
--- arch/x86/kvm/vmx/tdx.c | 2 -- 1 file changed, 2 deletions(-)arch/x86/kvm/vmx/tdx.c +0
-2@@ -173,7 +173,6 @@ static void td_init_cpuid_entry2(struct kvm_cpuid_entry2 *entry, unsigned char itdx_clear_unsupported_cpuid (entry); } -#define TDVMCALLINFO_GET_QUOTE BIT(0)#define TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT BIT(1) static int init_kvm_tdx_caps(const struct tdx_sys_info_td_conf *td_conf,@@ -192,7 +191,6 @@ static int init_kvm_tdx_caps(const struct tdx_sys_info_td_conf *td_conf, caps->cpuid.nent = td_conf->num_cpuid_config; caps->user_tdvmcallinfo_1_r11 = -TDVMCALLINFO_GET_QUOTE |TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT ;for (i =0 ; i < td_conf->num_cpuid_config; i++)
Quoted 32 lines · Binbin Wu
Quoted 8 lines · Xiaoyao Li
Remove
TDVMCALLINFO_GET_QUOTEfromuser_tdvmcallinfo_1_r11reported to userspace to align with the direction of the GHCI spec.Recently, concern was raised about a gap in the GHCI spec that left ambiguity in how to expose to the guest that only a subset of GHCI TDVMCalls were supported. During the back and forth on the spec details[0], <GetQuote> was moved from an individually enumerable TDVMCall, to one that is part of the 'base spec', meaning it doesn't have a specific bit in the
'GHCI base API' is more appropriate instead of 'base spec'
Quoted 2 lines
<GetTDVMCallInfo> return values. Although the spec[1] is still in draft form, the GetQoute part has been agreed by the major TDX VMMs.
GetQoute -> <GetQuote>
typo and use <> to align with others.
Quoted 7 lines
Unfortunately the commits that were upstreamed still treat <GetQuote> as individually enumerable. They set bit 0 in the
user_tdvmcallinfo_1_r11which is reported to userspace to tell supported optional TDVMCalls, intending to say that <GetQuote> is supported.So stop reporting <GetQute> in
user_tdvmcallinfo_1_r11to align withGetQute -> GetQuote
Quoted 2 lines
the direction of the spec, and allow some future TDVMCall to use that bit.
Quoted 7 lines
Quoted 5 lines
[0] https://lore.kernel.org/all/[email protected]/
[1] https://cdrdv2.intel.com/v1/dl/getContent/858626Fixes 28224ef02b56 ("KVM: TDX: Report supported optional TDVMCALLs in TDX capabilities")Signed-off-by Xiaoyao Li <[email protected]>Nits: typos and wording suggested above.
thanks for catching them!
I would like to leave them to Paolo to fix when he applies the patch instead of spinning a v2.
Quoted 25 lines
Reviewed-by Binbin Wu <[email protected]>Quoted 22 lines
---
arch/x86/kvm/vmx/tdx.c| 2 --1 file changed, 2 deletions(-)arch/x86/kvm/vmx/tdx.c +0
-0@@ -173,7 +173,6 @@ static void td_init_cpuid_entry2(struct
kvm_cpuid_entry2*entry, unsigned char itdx_clear_unsupported_cpuid(entry);
}
-#define TDVMCALLINFO_GET_QUOTE BIT(0)
#define TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT BIT(1) static int init_kvm_tdx_caps(const structtdx_sys_info_td_conf*td_conf,arch/x86/kvm/vmx/tdx.c +0
-0@@ -192,7 +191,6 @@ static int init_kvm_tdx_caps(const structtdx_sys_info_td_conf *td_conf, caps->cpuid.nent = td_conf->num_cpuid_config;
caps->user_tdvmcallinfo_1_r11=
-TDVMCALLINFO_GET_QUOTE|TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT; for (i = 0; i <td_conf->num_cpuid_config; i++)
arch/x86/kvm/vmx/tdx.c static void td_init_cpuid_entry2(struct kvm_cpuid_entry2 *entry, unsigned char i · line 176
Quoted 10 lines · Xiaoyao Li
arch/x86/kvm/vmx/tdx.c +0
-1@@ -173,7 +173,6 @@ static void td_init_cpuid_entry2(struct kvm_cpuid_entry2 *entry, unsigned char itdx_clear_unsupported_cpuid (entry); } -#define TDVMCALLINFO_GET_QUOTE BIT(0)#define TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT BIT(1)
I am struggling to find the patch that adds support for TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT. Can you help point out the series that adds this support?
Thanks,
Vishal
Edgecombe, Rick P
maintainerQuoted 9 lines · Vishal Annapurve
Quoted 8 lines · Xiaoyao Li
arch/x86/kvm/vmx/tdx.c +0
-0@@ -173,7 +173,6 @@ static void td_init_cpuid_entry2(struct kvm_cpuid_entry2 *entry, unsigned char i tdx_clear_unsupported_cpuid(entry); }
Quoted 6 lines
arch/x86/kvm/vmx/tdx.c static void td_init_cpuid_entry2(struct kvm_cpuid_entry2 *entry, unsigned char i · line 176
Quoted 2 lines
arch/x86/kvm/vmx/tdx.c +0
-1-#define TDVMCALLINFO_GET_QUOTE BIT(0) #define TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT BIT(1)I am struggling to find the patch that adds support for
TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT. Can you help point out the series that adds this support?
This was the last version of the series posted:
https://lore.kernel.org/kvm/[email protected]/#t
But it didn't have those changes. They got added before it was sent upstream. Possibly in response to this discussion, but I'm not sure:
https://lore.kernel.org/kvm/[email protected]/
Paolo Bonzini
maintainerQuoted 17 lines · Rick P
Quoted 9 lines · Vishal Annapurve
Quoted 8 lines · Xiaoyao Li
arch/x86/kvm/vmx/tdx.c +0
-0@@ -173,7 +173,6 @@ static void td_init_cpuid_entry2(struct kvm_cpuid_entry2 *entry, unsigned char i tdx_clear_unsupported_cpuid(entry); }Quoted 6 lines
arch/x86/kvm/vmx/tdx.c static void td_init_cpuid_entry2(struct kvm_cpuid_entry2 *entry, unsigned char i · line 176
Quoted 2 lines
arch/x86/kvm/vmx/tdx.c +0
-1-#define TDVMCALLINFO_GET_QUOTE BIT(0) #define TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT BIT(1)I am struggling to find the patch that adds support for
TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT. Can you help point out the series that adds this support?
Quoted 2 lines
This was the last version of the series posted:
https://lore.kernel.org/kvm/[email protected]/#t
Yep, I didn't send the patches for SetupEventNotifyInterrupt to the KVM mailing list.
I hadn't even noticed until now that I hadn't sent them because, when I came back from vacation, I found the matching QEMU patches in my inbox. So when git reported them to be in the next pull request I didn't think of double checking. Of course the blame is mine---thanks Xiaoyao for writing the QEMU side.
They are:
- commit 28224ef02b56fceee2c161fe2a49a0bb197e44f5
KVM: TDX: Report supported optional TDVMCALLs in TDX capabilities
- commit 4580dbef5ce0f95a4bd8ac2d007bc4fbf1539332
KVM: TDX: Exit to userspace for SetupEventNotifyInterrupt
Sorry about that.
Paolo