Re: [PATCH v8 1/2] x86/mm: add .bss..decrypted section to hold shared variables

From: Thomas Gleixner
Date: Fri Sep 14 2018 - 10:56:02 EST


On Fri, 14 Sep 2018, Tom Lendacky wrote:

> On 09/14/2018 09:12 AM, Borislav Petkov wrote:
> > On Fri, Sep 14, 2018 at 02:17:05PM +0200, Thomas Gleixner wrote:
> >>> The sme_encrypt_kernel() does not have access to pmd (after pointer
> >>> fixup is applied). You can extend the sme_encrypt_kernel() to pass an
> >>> additional arguments but then we start getting in include hell. The pmd
> >>> is defined as "pmdval_t". If we extend the sme_encrypt_kernel() thenÂ
> >>> asm/mem_encrypt.h need to include the header file which defines
> >>> "pmdval_t". Adding the 'asm/pgtable_type.h' was causing all kind of
> >>> compilation errors. I didn't spend much time on it. IMO, we really don't
> >>> need to go in this path unless we see some value from doing this.
> >>
> >> Keep it here then.
> >
> > *For what is worth*, a simple forward declaration works. I've taken the
> > 64-bit forward declaration of pmdval_t as SME is 64-bit only anyway.
>
> Just my 2 cents, but I'd prefer it to be in head64.c. This is where
> the future pagetable entries are all updated to set the encryption
> mask by applying sme_get_me_mask() to load_delta. So, to me, it makes
> sense to keep the clearing of the encryption mask for the bss_decrypted
> section here.

Yes, at least for now, I just keep it there and we can sort that out after
we fixed the problem at hand.

Thanks,

tglx