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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9dcfed93-1bf3-a60a-85e4-df5626189b76@linux.intel.com>
Date:   Thu, 14 Oct 2021 10:31:49 -0700
From:   Sathyanarayanan Kuppuswamy 
        <sathyanarayanan.kuppuwamy@...ux.intel.com>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Kuppuswamy Sathyanarayanan 
        <sathyanarayanan.kuppuswamy@...ux.intel.com>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        x86@...nel.org, Paolo Bonzini <pbonzini@...hat.com>,
        David Hildenbrand <david@...hat.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Juergen Gross <jgross@...e.com>, Deep Shah <sdeep@...are.com>,
        VMware Inc <pv-drivers@...are.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>
Cc:     Peter H Anvin <hpa@...or.com>, Dave Hansen <dave.hansen@...el.com>,
        Tony Luck <tony.luck@...el.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Kirill Shutemov <kirill.shutemov@...ux.intel.com>,
        Sean Christopherson <seanjc@...gle.com>,
        Kuppuswamy Sathyanarayanan <knsathya@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v10 04/11] x86/tdx: Add TDX support to
 intel_cc_platform_has()


On 10/14/21 12:12 AM, Thomas Gleixner wrote:
> On Fri, Oct 08 2021 at 22:37, Kuppuswamy Sathyanarayanan wrote:
>>   
>> -static bool __maybe_unused intel_cc_platform_has(enum cc_attr attr)
>> +static bool intel_cc_platform_has(enum cc_attr attr)
>>   {
>>   #ifdef CONFIG_INTEL_TDX_GUEST
>> -	return false;
>> +	switch (attr) {
>> +	case CC_ATTR_GUEST_TDX:
>> +		return is_tdx_guest();
> This function is only called when is_tdx_guest() is true. So
> is_tdx_guest() has to be called again to make sure?


Agree. In future, if intel_cc_platform_has() is used in non-tdx case then
we can add is_tdx_guest() back there. For now it is redundant
as you have mentioned. I will remove it in next version.

>
> Also the ifdeffery can just go away simply because the compiler will
> discard this function when CONFIG_INTEL_TDX_GUEST=n due to:
Agree. I will remove it.
>
>> +#ifdef CONFIG_INTEL_TDX_GUEST
>> +
>> +bool is_tdx_guest(void);
>> +void __init tdx_early_init(void);
>> +
>> +#else
>> +
>> +static inline bool is_tdx_guest(void) { return false; }
>> +static inline void tdx_early_init(void) { };
>> +
>> +#endif /* CONFIG_INTEL_TDX_GUEST */
> Thanks,
>
>          tglx

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ