lkml.org 
[lkml]   [2021]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 19/26] x86/tdx: Make pages shared in ioremap()
On Thu, Dec 23, 2021 at 11:56:04PM +0300, Kirill A. Shutemov wrote:
> Except CC_ATTR_MEM_ENCRYPT is true for TDX too, so it will also depend on
> check order. It is fragile.

So the query you wanna do is:

if (memory encryption in use)
use mask;

and the mask you use depends on whether it is SEV or TDX. Right?

If so, you can either do a cc_get_mask() function which gives you either
the SEV or TDX mask or simply do:

if (CC_ATTR_MEM_ENCRYPT) {
if (CC_ATTR_GUEST_TDX)
mask = tdx_shared_mask();
else if (sme_me_mask)
mask = sme_me_mask;
}

Yeah, sme_me_mask has become synonymous with the kernel running as a AMD
confidential guest. I need to think about how to make this cleaner...

--
Regards/Gruss,
Boris.

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

\
 
 \ /
  Last update: 2021-12-23 22:09    [W:0.139 / U:1.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site