Re: [RFC Part2 PATCH 01/30] x86: Add the host SEV-SNP initialization support

2021-04-14 Thread Brijesh Singh
On 4/14/21 2:27 AM, Borislav Petkov wrote: > On Wed, Mar 24, 2021 at 12:04:07PM -0500, Brijesh Singh wrote: >> @@ -538,6 +540,10 @@ >> #define MSR_K8_SYSCFG 0xc0010010 >> #define MSR_K8_SYSCFG_MEM_ENCRYPT_BIT 23 >> #define MSR_K8_SYSCFG_MEM_ENCRYPT BIT_ULL(MSR_K8_

Re: [RFC Part2 PATCH 01/30] x86: Add the host SEV-SNP initialization support

2021-04-14 Thread Borislav Petkov
On Wed, Mar 24, 2021 at 12:04:07PM -0500, Brijesh Singh wrote: > @@ -538,6 +540,10 @@ > #define MSR_K8_SYSCFG0xc0010010 > #define MSR_K8_SYSCFG_MEM_ENCRYPT_BIT23 > #define MSR_K8_SYSCFG_MEM_ENCRYPTBIT_ULL(MSR_K8_SYSCFG_MEM_ENCRYPT_BIT) > +#define MSR_K8_SYSCFG

Re: [RFC Part2 PATCH 01/30] x86: Add the host SEV-SNP initialization support

2021-03-25 Thread Brijesh Singh
On 3/25/21 10:51 AM, Dave Hansen wrote: > On 3/25/21 8:31 AM, Brijesh Singh wrote: >> On 3/25/21 9:58 AM, Dave Hansen wrote: +static int __init mem_encrypt_snp_init(void) +{ + if (!boot_cpu_has(X86_FEATURE_SEV_SNP)) + return 1; + + if (rmptable_init()) { >

Re: [RFC Part2 PATCH 01/30] x86: Add the host SEV-SNP initialization support

2021-03-25 Thread Dave Hansen
On 3/25/21 8:31 AM, Brijesh Singh wrote: > > On 3/25/21 9:58 AM, Dave Hansen wrote: >>> +static int __init mem_encrypt_snp_init(void) >>> +{ >>> + if (!boot_cpu_has(X86_FEATURE_SEV_SNP)) >>> + return 1; >>> + >>> + if (rmptable_init()) { >>> + setup_clear_cpu_cap(X86_FEATUR

Re: [RFC Part2 PATCH 01/30] x86: Add the host SEV-SNP initialization support

2021-03-25 Thread Brijesh Singh
On 3/25/21 9:58 AM, Dave Hansen wrote: >> +static int __init mem_encrypt_snp_init(void) >> +{ >> +if (!boot_cpu_has(X86_FEATURE_SEV_SNP)) >> +return 1; >> + >> +if (rmptable_init()) { >> +setup_clear_cpu_cap(X86_FEATURE_SEV_SNP); >> +return 1; >> +}

Re: [RFC Part2 PATCH 01/30] x86: Add the host SEV-SNP initialization support

2021-03-25 Thread Dave Hansen
> +static int __init mem_encrypt_snp_init(void) > +{ > + if (!boot_cpu_has(X86_FEATURE_SEV_SNP)) > + return 1; > + > + if (rmptable_init()) { > + setup_clear_cpu_cap(X86_FEATURE_SEV_SNP); > + return 1; > + } > + > + static_branch_enable(&snp_enabl

[RFC Part2 PATCH 01/30] x86: Add the host SEV-SNP initialization support

2021-03-24 Thread Brijesh Singh
The memory integrity guarantees of SEV-SNP are enforced through a new structure called the Reverse Map Table (RMP). The RMP is a single data structure shared across the system that contains one entry for every 4K page of DRAM that may be used by SEV-SNP VMs. The goal of RMP is to track the owner of