[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86b4d995-9619-81fa-5ef4-86f48ab01e96@amd.com>
Date: Fri, 21 May 2021 16:14:11 -0500
From: Tom Lendacky <thomas.lendacky@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: "Kuppuswamy, Sathyanarayanan"
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Sean Christopherson <seanjc@...gle.com>,
Dave Hansen <dave.hansen@...el.com>,
Andi Kleen <ak@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Tony Luck <tony.luck@...el.com>,
Kirill Shutemov <kirill.shutemov@...ux.intel.com>,
Kuppuswamy Sathyanarayanan <knsathya@...nel.org>,
Raj Ashok <ashok.raj@...el.com>, linux-kernel@...r.kernel.org,
Brijesh Singh <brijesh.singh@....com>
Subject: Re: [RFC v2 28/32] x86/tdx: Make pages shared in ioremap()
On 5/21/21 1:49 PM, Borislav Petkov wrote:
> On Fri, May 21, 2021 at 11:19:15AM -0500, Tom Lendacky wrote:
>> In arch/x86/mm/mem_encrypt.c, sme_early_init() (should have renamed that
>> when SEV support was added), we do:
>> if (sev_active())
>> swiotlb_force = SWIOTLB_FORCE;
>>
>> TDX should be able to do a similar thing without having to touch
>> arch/x86/kernel/pci-swiotlb.c.
>>
>> That would remove any confusion over SME being part of a
>> protected_guest_has() call.
>
> Even better.
>
>> I kinda like the separate function, though.
>
> Only if you clean it up and get rid of the inverted logic and drop that
> silly switch-case.
>
>> Except mem_encrypt_active() covers both SME and SEV, so
>> protected_guest_has() would be confusing.
>
> I don't understand - the AMD-specific function amd_protected_guest_has()
> would return sme_me_mask just like mem_encrypt_active() does and we can
> get rid of latter.
>
> Or do you have a problem with the name protected_guest_has() containing
> "guest" while we're talking about SME here?
The latter.
>
> If so, feel free to suggest a better one - the name does not have to
> have "guest" in it.
Let me see if I can come up with something that will make sense.
Thanks,
Tom
>
> Thx.
>
>
Powered by blists - more mailing lists