lkml.org 
[lkml]   [2022]   [Jan]   [5]   [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 Wed, Jan 05, 2022 at 08:16:49AM -0600, Tom Lendacky wrote:
> On 1/4/22 6:43 PM, Dave Hansen wrote:
> > On 1/4/22 4:31 PM, Kirill A. Shutemov wrote:
> > > On Tue, Jan 04, 2022 at 12:36:06PM -0800, Dave Hansen wrote:
> > > > @@ -57,7 +58,6 @@ typedef struct { unsigned long iopte; }
> > > > typedef struct { unsigned long pmd; } pmd_t;
> > > > typedef struct { unsigned long pgd; } pgd_t;
> > > > typedef struct { unsigned long ctxd; } ctxd_t;
> > > > -typedef struct { unsigned long pgprot; } pgprot_t;
> > > > typedef struct { unsigned long iopgprot; } iopgprot_t;
> > > > #define pte_val(x) ((x).pte)
> > > > @@ -85,7 +85,6 @@ typedef unsigned long iopte_t;
> > > > typedef unsigned long pmd_t;
> > > > typedef unsigned long pgd_t;
> > > > typedef unsigned long ctxd_t;
> > > > -typedef unsigned long pgprot_t;
> > > > typedef unsigned long iopgprot_t;
> > > > #define pte_val(x) (x)
> > >
> > > Any arch that use STRICT_MM_TYPECHECKS hacks will get broken if compiled
> > > without the define (as sparc by default).
> >
> > My read of STRICT_MM_TYPECHECKS was that "typedef unsigned long
> > pgprot_t" produces better code, but "typedef struct { unsigned long
> > pgprot; } pgprot_t;" produces better type checking.
> >
> > I just compiled these patches on sparc with no issues.
> >
> > ...
> > > Is it the way to go we want?
> >
> > I _think_ this was all a result of some review feedback from Tom
> > Lendacky about where the encryption-modifying pgprot helpers got placed
> > in the code. I don't feel strongly about it, but I'm not quite sure
> > that this is worth the trouble.
> >
> > I'd be curious what Tom thinks now that he's gotten a peek at what it's
> > going to take to address his concerns.
>
> I have vague memories of pgprot_t and what a pain it could be, which is why
> my feedback suggested putting it in cc_platform.c, but said there might be
> issues :)
>
> I'm fine with it living somewhere else, just thought it would be nice to
> have everything consolidated, if possible.

In this case I would rather leave it in <asm/pgtable.h>. We still can
rename it to cc_pgprot_decrypted()/cc_pgprot_encrypted().

--
Kirill A. Shutemov

\
 
 \ /
  Last update: 2022-01-05 17:02    [W:0.155 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site