Re: [PATCH 19/26] x86/tdx: Make pages shared in ioremap()

From: Kirill A. Shutemov
Date: Thu Dec 23 2021 - 16:01:01 EST


On Thu, Dec 23, 2021 at 08:53:27PM +0100, Borislav Petkov wrote:
> On Thu, Dec 23, 2021 at 11:45:19AM -0800, Dave Hansen wrote:
> > CC_ATTR_SME_SOMETHING would get set when sme_me_mask is initialized to
> > something non-zero. That will keep folks from falling into the same
> > trap that you did in the long term.
>
> I guess CC_ATTR_MEM_ENCRYPT which basically says generic memory
> encryption...

Except CC_ATTR_MEM_ENCRYPT is true for TDX too, so it will also depend on
check order. It is fragile.

Frankly, naked sme_me_mask check would be better. Hm?

--
Kirill A. Shutemov