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]
Message-ID: <20211227141436.ahvdngnae6xnf4nl@black.fi.intel.com>
Date:   Mon, 27 Dec 2021 17:14:36 +0300
From:   "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To:     Borislav Petkov <bp@...en8.de>
Cc:     "Kirill A. Shutemov" <kirill@...temov.name>,
        Dave Hansen <dave.hansen@...el.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, Dec 27, 2021 at 12:51:21PM +0100, Borislav Petkov wrote:
> On Fri, Dec 24, 2021 at 02:03:00PM +0300, Kirill A. Shutemov wrote:
> > Okay. Meanwhile I leave it this way:
> > 
> > 	pgprot_t pgprot_cc_encrypted(pgprot_t prot)
> > 	{
> > 		if (cc_platform_has(CC_ATTR_MEM_ENCRYPT)) {
> > 			if (cc_platform_has(CC_ATTR_GUEST_TDX))
> > 				return __pgprot(pgprot_val(prot) & ~tdx_shared_mask());
> > 			else if (sme_me_mask)
> > 				return __pgprot(__sme_set(pgprot_val(prot)));
> > 			else
> > 				WARN_ON_ONCE(1);
> 
> I'm wondering if defining a generic cc_attr especially for this:
> 
> 	if (cc_platform_has(CC_ATTR_MEMORY_SHARING))
> 
> to mean, the CC guest needs to do special stuff in order to share memory
> with the host (naming sucks, ofc) would be cleaner?

Looks like CC_ATTR_MEM_ENCRYPT already does this. The attribute doesn't
have much meaning beyond that, no?

-- 
 Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ