[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YhPst1DdG3T5hsnM@zn.tnic>
Date: Mon, 21 Feb 2022 20:49:11 +0100
From: Borislav Petkov <bp@...en8.de>
To: Dave Hansen <dave.hansen@...el.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
tglx@...utronix.de, mingo@...hat.com, luto@...nel.org,
peterz@...radead.org, sathyanarayanan.kuppuswamy@...ux.intel.com,
aarcange@...hat.com, ak@...ux.intel.com, dan.j.williams@...el.com,
david@...hat.com, hpa@...or.com, jgross@...e.com,
jmattson@...gle.com, joro@...tes.org, jpoimboe@...hat.com,
knsathya@...nel.org, pbonzini@...hat.com, sdeep@...are.com,
seanjc@...gle.com, tony.luck@...el.com, vkuznets@...hat.com,
wanpengli@...cent.com, x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv3 02/32] x86/coco: Add API to handle encryption mask
On Mon, Feb 21, 2022 at 11:28:16AM -0800, Dave Hansen wrote:
> Why don't we just have:
>
> pgprot_t cc_mkenc(pgprot prot)
> pgprot_t cc_mkenc(pgprot prot)
>
> and *no* pgprot_{en,de}crypted()?
Yes, and can the above cc_get_mask() thing be:
cpa.mask_set = enc ? cc_mkenc(0) : cc_mkdec(0);
cpa.mask_clr = enc ? cc_mkdec(0) : cc_mkenc(0);
since we're going to feed it pgprot things?
And then you don't need a separate cc_get_mask() thing or whatever
- there's only those two mkenc and mkdec things converting pgprots
back'n'forth.
> sme_me_mask does look quite AMD-specialized, like its assembly
> manipulation. Even if it's just a copy of cc_mask, it would be nice to
> call that out so the relationship is crystal clear.
Yes, the ultimate goal is to have cc_mask be shared by both AMD and
Intel. We'll phase out sme_me_mask on the AMD side gradually while Intel
can use cc_mask directly.
Methinks.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists