[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c805df30-6ce6-6032-06b8-6b06e046744e@intel.com>
Date: Tue, 6 Apr 2021 09:12:48 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: "Kirill A. Shutemov" <kirill@...temov.name>
Cc: Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Andi Kleen <ak@...ux.intel.com>,
Kirill Shutemov <kirill.shutemov@...ux.intel.com>,
Kuppuswamy Sathyanarayanan <knsathya@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Raj Ashok <ashok.raj@...el.com>,
Sean Christopherson <seanjc@...gle.com>,
linux-kernel@...r.kernel.org
Subject: Re: [RFC v1 22/26] x86/tdx: Exclude Shared bit from __PHYSICAL_MASK
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?
Powered by blists - more mailing lists