lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e80c6b47-c4ce-4465-82f3-8e82160fa2b3@intel.com>
Date: Tue, 8 Jul 2025 22:28:18 +0800
From: Xiaoyao Li <xiaoyao.li@...el.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>,
 Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org,
 linux-coco@...ts.linux.dev, kvm@...r.kernel.org,
 "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
 Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
 Borislav Petkov <bp@...en8.de>, x86@...nel.org,
 "H. Peter Anvin" <hpa@...or.com>, rick.p.edgecombe@...el.com,
 Kai Huang <kai.huang@...el.com>, binbin.wu@...ux.intel.com,
 yan.y.zhao@...el.com, reinette.chatre@...el.com, isaku.yamahata@...el.com,
 adrian.hunter@...el.com, tony.lindgren@...el.com
Subject: Re: [PATCH 2/2] KVM: TDX: Remove redundant definitions of
 TDX_TD_ATTR_*

On 7/8/2025 10:03 PM, Sean Christopherson wrote:
> On Tue, Jul 08, 2025, Xiaoyao Li wrote:
>> There are definitions of TD attributes bits inside asm/shared/tdx.h as
>> TDX_ATTR_*.
>>
>> Remove KVM's definitions and use the ones in asm/shared/tdx.h
>>
>> Reviewed-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
>> Signed-off-by: Xiaoyao Li <xiaoyao.li@...el.com>
>> ---
>>   arch/x86/kvm/vmx/tdx.c      | 4 ++--
>>   arch/x86/kvm/vmx/tdx_arch.h | 6 ------
>>   2 files changed, 2 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
>> index c539c2e6109f..efb7d589b672 100644
>> --- a/arch/x86/kvm/vmx/tdx.c
>> +++ b/arch/x86/kvm/vmx/tdx.c
>> @@ -62,7 +62,7 @@ void tdh_vp_wr_failed(struct vcpu_tdx *tdx, char *uclass, char *op, u32 field,
>>   	pr_err("TDH_VP_WR[%s.0x%x]%s0x%llx failed: 0x%llx\n", uclass, field, op, val, err);
>>   }
>>   
>> -#define KVM_SUPPORTED_TD_ATTRS (TDX_TD_ATTR_SEPT_VE_DISABLE)
>> +#define KVM_SUPPORTED_TD_ATTRS (TDX_ATTR_SEPT_VE_DISABLE)
> 
> Would it make sense to rename KVM_SUPPORTED_TD_ATTRS to KVM_SUPPORTED_TDX_ATTRS?
> The names from common code lack the TD qualifier, and I think it'd be helpful for
> readers to have have TDX in the name (even though I agree "TD" is more precise).

Personally, I prefer adding _TD_ to the common header, i.e., rename 
TDX_ATTR_SEPT_VE_DISABLE to TDX_TD_ATTR_SEPT_VE_DISABLE, or just 
TD_ATTR_SEPT_VE_DISABLE if dropping TDX prefix is acceptable.

Because TDX_ATTR OR TDX_ATTRIBUTES is ambiguous to me. There are other 
attributes defined in TDX spec, e.g., TDSYSINFO_STRUCT.ATTRIBUTES, GPA 
attributes.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ