lkml.org 
[lkml]   [2021]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 04/11] x86/tdx: Add protected guest support for TDX guest
From
Date


On 9/28/21 4:46 AM, Joerg Roedel wrote:
> On Fri, Sep 03, 2021 at 10:28:05AM -0700, Kuppuswamy Sathyanarayanan wrote:
>> static inline bool prot_guest_has(unsigned int attr)
>> {
>> if (sme_me_mask)
>> return amd_prot_guest_has(attr);
>> + else if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
>> + return intel_prot_guest_has(attr);
>
> This causes a function call on every Intel machine this code runs. is
> there an easier to check whether TDX is enabled, like the sme_me_mask
> check on AMD?

This will only be called when CONFIG_ARCH_HAS_CC_PLATFORM is set by a platform.
So it won't be called for all platforms.

Also, intel_prot_guest_has() is a generic Intel platform branch call (so we can't
directly check for TDX here).

>

--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer

\
 
 \ /
  Last update: 2021-09-28 14:57    [W:1.182 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site