Re: [PATCH] x86/mm: Create an SME workarea in the kernel for early encryption

2019-06-13 Thread Lendacky, Thomas
On 6/13/19 1:06 PM, Dave Hansen wrote: > On 6/13/19 10:59 AM, Lendacky, Thomas wrote: >>> After I say all that... Why can't you just stick your data in a normal, >>> vanilla __init variable? Wouldn't that be a lot less subtle? >> The area needs to be outside of the kernel proper as the kernel is

Re: [PATCH] x86/mm: Create an SME workarea in the kernel for early encryption

2019-06-13 Thread Dave Hansen
On 6/13/19 10:59 AM, Lendacky, Thomas wrote: >> After I say all that... Why can't you just stick your data in a normal, >> vanilla __init variable? Wouldn't that be a lot less subtle? > The area needs to be outside of the kernel proper as the kernel is > encrypted "in place." So an __init variabl

Re: [PATCH] x86/mm: Create an SME workarea in the kernel for early encryption

2019-06-13 Thread Lendacky, Thomas
On 6/13/19 12:47 PM, Dave Hansen wrote: > On 6/12/19 10:46 AM, Lendacky, Thomas wrote: >> On 6/12/19 10:00 AM, Dave Hansen wrote: >>> On 6/12/19 6:32 AM, Lendacky, Thomas wrote: Create a section for SME in the vmlinux.lds.S. Position it after "_end" so that the memory will be reclaimed d

Re: [PATCH] x86/mm: Create an SME workarea in the kernel for early encryption

2019-06-13 Thread Dave Hansen
On 6/12/19 10:46 AM, Lendacky, Thomas wrote: > On 6/12/19 10:00 AM, Dave Hansen wrote: >> On 6/12/19 6:32 AM, Lendacky, Thomas wrote: >>> Create a section for SME in the vmlinux.lds.S. Position it after "_end" >>> so that the memory will be reclaimed during boot and, since it is all >>> zeroes, it

Re: [PATCH] x86/mm: Create an SME workarea in the kernel for early encryption

2019-06-13 Thread lijiang
Hi, After applied this patch, i made a test on the following machines. It works well. [a] HPE ProLiant DL385 Gen10 (878612-B21) AMD EPYC 7251 8-Core Processor [b] Dell PowerEdge R7425 AMD EPYC 7401 24-Core Processor [c] AMD Speedway AMD Eng Sample: 2S1405A3VIHF4_28/14_N [d] AMD Ethanol X AMD

Re: [PATCH] x86/mm: Create an SME workarea in the kernel for early encryption

2019-06-13 Thread Baoquan He
On 06/12/19 at 01:32pm, Lendacky, Thomas wrote: > The SME workarea used during early encryption of the kernel during boot > is situated on a 2MB boundary after the end of the kernel text, data, > etc. sections (_end). This works well during initial boot of a compressed > kernel because of the relo

Re: [PATCH] x86/mm: Create an SME workarea in the kernel for early encryption

2019-06-12 Thread Lendacky, Thomas
On 6/12/19 10:00 AM, Dave Hansen wrote: > On 6/12/19 6:32 AM, Lendacky, Thomas wrote: >> Create a section for SME in the vmlinux.lds.S. Position it after "_end" >> so that the memory will be reclaimed during boot and, since it is all >> zeroes, it compresses well. > > I don't think I realized th

Re: [PATCH] x86/mm: Create an SME workarea in the kernel for early encryption

2019-06-12 Thread Dave Hansen
On 6/12/19 6:32 AM, Lendacky, Thomas wrote: > Create a section for SME in the vmlinux.lds.S. Position it after "_end" > so that the memory will be reclaimed during boot and, since it is all > zeroes, it compresses well. I don't think I realized that things after _end get reclaimed. Do we do tha

[PATCH] x86/mm: Create an SME workarea in the kernel for early encryption

2019-06-12 Thread Lendacky, Thomas
The SME workarea used during early encryption of the kernel during boot is situated on a 2MB boundary after the end of the kernel text, data, etc. sections (_end). This works well during initial boot of a compressed kernel because of the relocation used for decompression of the kernel. But when pe