[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220221222149.jpuwlinaihq6fjwy@black.fi.intel.com>
Date: Tue, 22 Feb 2022 01:21:49 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Dave Hansen <dave.hansen@...el.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 08:49:11PM +0100, Borislav Petkov wrote:
> 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?
Well, it actually going to be
cpa.mask_set = enc ? cc_mkenc(__pgprot(0)) : cc_mkdec(__pgprot(0));
cpa.mask_clr = enc ? cc_mkdec(__pgprot(0)) : cc_mkenc(__pgprot(0));
as '0' is not a valid pgprot_t.
Still wonna go this path?
--
Kirill A. Shutemov
Powered by blists - more mailing lists