lkml.org 
[lkml]   [2021]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC v1 22/26] x86/tdx: Exclude Shared bit from __PHYSICAL_MASK
From
Date
On 4/6/21 8:54 AM, Kirill A. Shutemov wrote:
> On Thu, Apr 01, 2021 at 01:13:16PM -0700, Dave Hansen wrote:
>>> @@ -56,6 +61,9 @@ static void tdx_get_info(void)
>>>
>>> td_info.gpa_width = rcx & GENMASK(5, 0);
>>> td_info.attributes = rdx;
>>> +
>>> + /* Exclude Shared bit from the __PHYSICAL_MASK */
>>> + physical_mask &= ~tdx_shared_mask();
>>> }
>> I wish we had all of these 'physical_mask' manipulations in a single
>> spot. Can we consolidate these instead of having TDX and SME poke at
>> them individually?
> SME has to do it very early -- from __startup_64() -- as it sets the bit
> on all memory, except what used for communication. TDX can postpone as we
> don't need any shared mapping in very early boot.
>
> Basically, to make it done from the same place we would need to move TDX
> enumeration earlier into boot. It's risky: everything is more fragile
> there.
>
> I would rather keep it as is. We should be fine as long as we only allow
> to clear bits from the mask.

I'll buy that. Could you mention it in the changelog, please?

\
 
 \ /
  Last update: 2021-04-06 18:13    [W:0.095 / U:23.988 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site