lkml.org 
[lkml]   [2021]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v2 28/32] x86/tdx: Make pages shared in ioremap()
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?

If so, feel free to suggest a better one - the name does not have to
have "guest" in it.

Thx.


--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

\
 
 \ /
  Last update: 2021-05-21 20:50    [W:0.427 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site