lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 5 Jan 2022 04:02:37 +0300
From:   "Kirill A. Shutemov" <kirill@...temov.name>
To:     Dave Hansen <dave.hansen@...el.com>
Cc:     Borislav Petkov <bp@...en8.de>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        Tom Lendacky <thomas.lendacky@....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: [PATCH 19/26] x86/tdx: Make pages shared in ioremap()

On Wed, Jan 05, 2022 at 03:57:20AM +0300, Kirill A. Shutemov wrote:
> On Tue, Jan 04, 2022 at 04:43:09PM -0800, 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.
> 
> Apart from pgprot_t, __pgprot() and pgrot_val() helpers are defined
> differently depending on STRICT_MM_TYPECHECKS.
> 
> > I just compiled these patches on sparc with no issues.
> 
> Hm. I can't see how
> 
> #define pgprot_val(x)	(x)
> 
> can work to access value for the pgprot_t defined as a struct.

Ah. I guess you compiled 64-bit sparc, right? STRICT_MM_TYPECHECKS is
default there, unline 32-bit.

-- 
 Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ