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:   Mon, 3 Jan 2022 21:10:59 +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 Mon, Jan 03, 2022 at 08:50:12AM -0800, Dave Hansen wrote:
> On 1/3/22 7:15 AM, Kirill A. Shutemov wrote:
> > On Mon, Jan 03, 2022 at 03:29:44PM +0100, Borislav Petkov wrote:
> >> On Mon, Jan 03, 2022 at 05:17:05PM +0300, Kirill A. Shutemov wrote:
> >>> I'm not sure how to unwind this dependency hell. Any clues?
> >> Forward-declaration maybe?
> >>
> >> I.e., something like
> >>
> >> struct task_struct;
> >>
> >> at the top of arch/x86/include/asm/switch_to.h, for example...
> > Forward-declaration only works if you refer the struct/union by pointer,
> > not value.
> > 
> > And pgprot_t is not always a struct and when it is a struct it is
> > anonymous.
> > 
> > See "git grep 'typedef.*pgprot_t;'".
> 
> In the end, the new functions get used like this:
> 
> 	prot = pgprot_decrypted(prot);
> 
> I think they _could_ be:
> 
> 	pgprot_set_decrypted(&prot);
> 
> Which would let you have a declaration like this:
> 
> 	extern void pgprot_cc_set_decrypted(pgprot_t *prot);
> 
> It does not exactly give me warm and fuzzy feelings, but it would work
> around the header problem.

Apart for being ugly, I don't see how it solves anything. How would you
forward-declare a typedef?

-- 
 Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ