Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1631920 > unrolled thread

Re: [PATCH v5 31/32] x86: Add sysfs support for Secure Memory Encryption

Started byDave Young <dyoung@redhat.com>
First post2017-04-27 09:30 +0200
Last post2017-04-28 07:40 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v5 31/32] x86: Add sysfs support for Secure Memory  Encryption Dave Young <dyoung@redhat.com> - 2017-04-27 09:30 +0200
    Re: [PATCH v5 31/32] x86: Add sysfs support for Secure Memory  Encryption Dave Hansen <dave.hansen@intel.com> - 2017-04-27 18:00 +0200
      Re: [PATCH v5 31/32] x86: Add sysfs support for Secure Memory  Encryption Dave Young <dyoung@redhat.com> - 2017-04-28 07:40 +0200

#1631920 — Re: [PATCH v5 31/32] x86: Add sysfs support for Secure Memory Encryption

FromDave Young <dyoung@redhat.com>
Date2017-04-27 09:30 +0200
SubjectRe: [PATCH v5 31/32] x86: Add sysfs support for Secure Memory Encryption
Message-ID<tAM2d-5H5-1@gated-at.bofh.it>
On 04/21/17 at 02:55pm, Dave Hansen wrote:
> On 04/18/2017 02:22 PM, Tom Lendacky wrote:
> > Add sysfs support for SME so that user-space utilities (kdump, etc.) can
> > determine if SME is active.
> > 
> > A new directory will be created:
> >   /sys/kernel/mm/sme/
> > 
> > And two entries within the new directory:
> >   /sys/kernel/mm/sme/active
> >   /sys/kernel/mm/sme/encryption_mask
> 
> Why do they care, and what will they be doing with this information?

Since kdump will copy old memory but need this to know if the old memory
was encrypted or not. With this sysfs file we can know the previous SME
status and pass to kdump kernel as like a kernel param.

Tom, have you got chance to try if it works or not?

Thanks
Dave

[toc] | [next] | [standalone]


#1632203

FromDave Hansen <dave.hansen@intel.com>
Date2017-04-27 18:00 +0200
Message-ID<tATZL-2FN-9@gated-at.bofh.it>
In reply to#1631920
On 04/27/2017 12:25 AM, Dave Young wrote:
> On 04/21/17 at 02:55pm, Dave Hansen wrote:
>> On 04/18/2017 02:22 PM, Tom Lendacky wrote:
>>> Add sysfs support for SME so that user-space utilities (kdump, etc.) can
>>> determine if SME is active.
>>>
>>> A new directory will be created:
>>>   /sys/kernel/mm/sme/
>>>
>>> And two entries within the new directory:
>>>   /sys/kernel/mm/sme/active
>>>   /sys/kernel/mm/sme/encryption_mask
>>
>> Why do they care, and what will they be doing with this information?
> 
> Since kdump will copy old memory but need this to know if the old memory
> was encrypted or not. With this sysfs file we can know the previous SME
> status and pass to kdump kernel as like a kernel param.
> 
> Tom, have you got chance to try if it works or not?

What will the kdump kernel do with it though?  We kexec() into that
kernel so the SME keys will all be the same, right?  So, will the kdump
kernel be just setting the encryption bit in the PTE so it can copy the
old plaintext out?

Why do we need both 'active' and 'encryption_mask'?  How could it be
that the hardware-enumerated 'encryption_mask' changes across a kexec()?

[toc] | [prev] | [next] | [standalone]


#1632541

FromDave Young <dyoung@redhat.com>
Date2017-04-28 07:40 +0200
Message-ID<tB6Nk-35H-13@gated-at.bofh.it>
In reply to#1632203
On 04/27/17 at 08:52am, Dave Hansen wrote:
> On 04/27/2017 12:25 AM, Dave Young wrote:
> > On 04/21/17 at 02:55pm, Dave Hansen wrote:
> >> On 04/18/2017 02:22 PM, Tom Lendacky wrote:
> >>> Add sysfs support for SME so that user-space utilities (kdump, etc.) can
> >>> determine if SME is active.
> >>>
> >>> A new directory will be created:
> >>>   /sys/kernel/mm/sme/
> >>>
> >>> And two entries within the new directory:
> >>>   /sys/kernel/mm/sme/active
> >>>   /sys/kernel/mm/sme/encryption_mask
> >>
> >> Why do they care, and what will they be doing with this information?
> > 
> > Since kdump will copy old memory but need this to know if the old memory
> > was encrypted or not. With this sysfs file we can know the previous SME
> > status and pass to kdump kernel as like a kernel param.
> > 
> > Tom, have you got chance to try if it works or not?
> 
> What will the kdump kernel do with it though?  We kexec() into that
> kernel so the SME keys will all be the same, right?  So, will the kdump
> kernel be just setting the encryption bit in the PTE so it can copy the
> old plaintext out?

I assume it is for active -> non active case, the new boot need to know
the old memory is encrypted. But I think I did not read all the patches
I may miss things.

> 
> Why do we need both 'active' and 'encryption_mask'?  How could it be
> that the hardware-enumerated 'encryption_mask' changes across a kexec()?

Leave this question to Tom..

Thanks
Dave

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web