Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-30 Thread Borislav Petkov
dropping stable@ On Wed, Aug 29, 2018 at 10:33:24AM -0500, Brijesh Singh wrote: > During the initial SEV/SME patch review cycle we had some discussion about > using decrypted vs unencrypted. At that time the consensus was > that a memory range mapped with C=0 should be referred as 'decrypted'.

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-30 Thread Borislav Petkov
dropping stable@ On Wed, Aug 29, 2018 at 10:33:24AM -0500, Brijesh Singh wrote: > During the initial SEV/SME patch review cycle we had some discussion about > using decrypted vs unencrypted. At that time the consensus was > that a memory range mapped with C=0 should be referred as 'decrypted'.

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-30 Thread Borislav Petkov
On Wed, Aug 29, 2018 at 10:54:37AM -0500, Brijesh Singh wrote: > Please note that the _WP flags and helper functions are used by this > patch only. Introducing a helper in a separate patch will cause a build > warning. ... a build warning which goes away with the next patch, adding the users,

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-30 Thread Borislav Petkov
On Wed, Aug 29, 2018 at 10:54:37AM -0500, Brijesh Singh wrote: > Please note that the _WP flags and helper functions are used by this > patch only. Introducing a helper in a separate patch will cause a build > warning. ... a build warning which goes away with the next patch, adding the users,

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-30 Thread Borislav Petkov
On Wed, Aug 29, 2018 at 09:37:46AM -0500, Brijesh Singh wrote: > > > @@ -491,28 +510,69 @@ static void __init remove_workarea_map(struct > > > sme_workarea_data *wa, > > > native_write_cr3(__native_read_cr3()); > > > } > > > +static void __init decrypt_data_decrypted_section(struct >

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-30 Thread Borislav Petkov
On Wed, Aug 29, 2018 at 09:37:46AM -0500, Brijesh Singh wrote: > > > @@ -491,28 +510,69 @@ static void __init remove_workarea_map(struct > > > sme_workarea_data *wa, > > > native_write_cr3(__native_read_cr3()); > > > } > > > +static void __init decrypt_data_decrypted_section(struct >

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-29 Thread Brijesh Singh
Hi Boris, On 08/29/2018 08:59 AM, Borislav Petkov wrote: ... static void __init __sme_map_range_pmd(struct sme_populate_pgd_data *ppd) @@ -235,6 +235,11 @@ static void __init sme_map_range_encrypted(struct sme_populate_pgd_data *ppd) __sme_map_range(ppd, PMD_FLAGS_ENC,

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-29 Thread Brijesh Singh
Hi Boris, On 08/29/2018 08:59 AM, Borislav Petkov wrote: ... static void __init __sme_map_range_pmd(struct sme_populate_pgd_data *ppd) @@ -235,6 +235,11 @@ static void __init sme_map_range_encrypted(struct sme_populate_pgd_data *ppd) __sme_map_range(ppd, PMD_FLAGS_ENC,

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-29 Thread Brijesh Singh
On 08/29/2018 10:03 AM, Sean Christopherson wrote: On Tue, Aug 28, 2018 at 05:12:56PM -0500, Brijesh Singh wrote: kvmclock defines few static variables which are shared with hypervisor during the kvmclock initialization. When SEV is active, memory is encrypted with a guest-specific key, and

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-29 Thread Brijesh Singh
On 08/29/2018 10:03 AM, Sean Christopherson wrote: On Tue, Aug 28, 2018 at 05:12:56PM -0500, Brijesh Singh wrote: kvmclock defines few static variables which are shared with hypervisor during the kvmclock initialization. When SEV is active, memory is encrypted with a guest-specific key, and

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-29 Thread Sean Christopherson
On Tue, Aug 28, 2018 at 05:12:56PM -0500, Brijesh Singh wrote: > kvmclock defines few static variables which are shared with hypervisor > during the kvmclock initialization. > > When SEV is active, memory is encrypted with a guest-specific key, and > if guest OS wants to share the memory region

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-29 Thread Sean Christopherson
On Tue, Aug 28, 2018 at 05:12:56PM -0500, Brijesh Singh wrote: > kvmclock defines few static variables which are shared with hypervisor > during the kvmclock initialization. > > When SEV is active, memory is encrypted with a guest-specific key, and > if guest OS wants to share the memory region

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-29 Thread Brijesh Singh
On 08/29/2018 08:59 AM, Borislav Petkov wrote: On Tue, Aug 28, 2018 at 05:12:56PM -0500, Brijesh Singh wrote: kvmclock defines few static variables which are shared with hypervisor ... with the hypervisor ... during the kvmclock

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-29 Thread Brijesh Singh
On 08/29/2018 08:59 AM, Borislav Petkov wrote: On Tue, Aug 28, 2018 at 05:12:56PM -0500, Brijesh Singh wrote: kvmclock defines few static variables which are shared with hypervisor ... with the hypervisor ... during the kvmclock

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-29 Thread Borislav Petkov
On Tue, Aug 28, 2018 at 05:12:56PM -0500, Brijesh Singh wrote: > kvmclock defines few static variables which are shared with hypervisor ... with the hypervisor ... > during the kvmclock initialization. > > When SEV is active, memory is

Re: [PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-29 Thread Borislav Petkov
On Tue, Aug 28, 2018 at 05:12:56PM -0500, Brijesh Singh wrote: > kvmclock defines few static variables which are shared with hypervisor ... with the hypervisor ... > during the kvmclock initialization. > > When SEV is active, memory is

[PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-28 Thread Brijesh Singh
kvmclock defines few static variables which are shared with hypervisor during the kvmclock initialization. When SEV is active, memory is encrypted with a guest-specific key, and if guest OS wants to share the memory region with hypervisor then it must clear the C-bit before sharing it. Currently,

[PATCH v2 2/3] x86/mm: add .data..decrypted section to hold shared variables

2018-08-28 Thread Brijesh Singh
kvmclock defines few static variables which are shared with hypervisor during the kvmclock initialization. When SEV is active, memory is encrypted with a guest-specific key, and if guest OS wants to share the memory region with hypervisor then it must clear the C-bit before sharing it. Currently,