Re: [PATCH v4 4/4] x86/kvm: use __decrypted attribute in shared variables

2018-09-05 Thread Brijesh Singh
Hi Sean, On 09/04/2018 05:32 PM, Sean Christopherson wrote: ... /* Use the static page for the first CPUs, allocate otherwise */ - if (cpu < HVC_BOOT_ARRAY_SIZE) + if (cpu < HVC_BOOT_ARRAY_SIZE) { p = _clock_boot[cpu]; - else - p =

Re: [PATCH v4 4/4] x86/kvm: use __decrypted attribute in shared variables

2018-09-05 Thread Brijesh Singh
Hi Sean, On 09/04/2018 05:32 PM, Sean Christopherson wrote: ... /* Use the static page for the first CPUs, allocate otherwise */ - if (cpu < HVC_BOOT_ARRAY_SIZE) + if (cpu < HVC_BOOT_ARRAY_SIZE) { p = _clock_boot[cpu]; - else - p =

[PATCH v4 0/4] x86: Fix SEV guest regression

2018-09-03 Thread Brijesh Singh
the workarea buffer as encrypted when SEV is enabled - enhance the sme_populate_pgd to update the pte/pmd flags when mapping exist Brijesh Singh (4): x86/mm: Restructure sme_encrypt_kernel() x86/mm: fix sme_populate_pgd() to update page flags x86/mm: add .data..decrypted section to hold shared vari

[PATCH v4 0/4] x86: Fix SEV guest regression

2018-09-03 Thread Brijesh Singh
the workarea buffer as encrypted when SEV is enabled - enhance the sme_populate_pgd to update the pte/pmd flags when mapping exist Brijesh Singh (4): x86/mm: Restructure sme_encrypt_kernel() x86/mm: fix sme_populate_pgd() to update page flags x86/mm: add .data..decrypted section to hold shared vari

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

2018-09-03 Thread Brijesh Singh
and SEV cases. Signed-off-by: Brijesh Singh Reviewed-by: Tom Lendacky Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org Cc: Paolo Bonzini Cc: Sean Christopherson Cc: k...@vger.kernel.org Cc: &qu

[PATCH v4 1/4] x86/mm: Restructure sme_encrypt_kernel()

2018-09-03 Thread Brijesh Singh
Re-arrange the sme_encrypt_kernel() by moving the workarea map/unmap logic in a separate static function. There are no logical changes in this patch. The restructuring will allow us to expand the sme_encrypt_kernel in future. Signed-off-by: Brijesh Singh Reviewed-by: Tom Lendacky Cc: Tom

[PATCH v4 2/4] x86/mm: fix sme_populate_pgd() to update page flags

2018-09-03 Thread Brijesh Singh
Fix sme_populate_pgd() to update page flags if the PMD/PTE entry already exists. Signed-off-by: Brijesh Singh Reviewed-by: Tom Lendacky Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org Cc: Pao

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

2018-09-03 Thread Brijesh Singh
and SEV cases. Signed-off-by: Brijesh Singh Reviewed-by: Tom Lendacky Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org Cc: Paolo Bonzini Cc: Sean Christopherson Cc: k...@vger.kernel.org Cc: &qu

[PATCH v4 1/4] x86/mm: Restructure sme_encrypt_kernel()

2018-09-03 Thread Brijesh Singh
Re-arrange the sme_encrypt_kernel() by moving the workarea map/unmap logic in a separate static function. There are no logical changes in this patch. The restructuring will allow us to expand the sme_encrypt_kernel in future. Signed-off-by: Brijesh Singh Reviewed-by: Tom Lendacky Cc: Tom

[PATCH v4 2/4] x86/mm: fix sme_populate_pgd() to update page flags

2018-09-03 Thread Brijesh Singh
Fix sme_populate_pgd() to update page flags if the PMD/PTE entry already exists. Signed-off-by: Brijesh Singh Reviewed-by: Tom Lendacky Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org Cc: Pao

[PATCH v4 4/4] x86/kvm: use __decrypted attribute in shared variables

2018-09-03 Thread Brijesh Singh
during boot. Use __decrypted attribute to put the wall_clock and hv_clock_boot in .data..decrypted section so that they are mapped with C=0. Signed-off-by: Brijesh Singh Reviewed-by: Tom Lendacky Fixes: 368a540e0232 ("x86/kvmclock: Remove memblock dependency") Cc: Tom Lenda

[PATCH v4 4/4] x86/kvm: use __decrypted attribute in shared variables

2018-09-03 Thread Brijesh Singh
during boot. Use __decrypted attribute to put the wall_clock and hv_clock_boot in .data..decrypted section so that they are mapped with C=0. Signed-off-by: Brijesh Singh Reviewed-by: Tom Lendacky Fixes: 368a540e0232 ("x86/kvmclock: Remove memblock dependency") Cc: Tom Lenda

Re: [PATCH v3 4/4] x86/kvm: use __decrypted attribute in shared variables

2018-08-30 Thread Brijesh Singh
On 08/29/2018 02:56 PM, Sean Christopherson wrote: On Wed, Aug 29, 2018 at 01:24:00PM -0500, Brijesh Singh wrote: The following commit: 368a540e0232 (x86/kvmclock: Remove memblock dependency) Checkpatch prefers: Commit 368a540e0232 ("x86/kvmclock: Remove memblock depen

Re: [PATCH v3 4/4] x86/kvm: use __decrypted attribute in shared variables

2018-08-30 Thread Brijesh Singh
On 08/29/2018 02:56 PM, Sean Christopherson wrote: On Wed, Aug 29, 2018 at 01:24:00PM -0500, Brijesh Singh wrote: The following commit: 368a540e0232 (x86/kvmclock: Remove memblock dependency) Checkpatch prefers: Commit 368a540e0232 ("x86/kvmclock: Remove memblock depen

[PATCH v3 2/4] x86/mm: fix sme_populate_pgd() to update page flags

2018-08-29 Thread Brijesh Singh
Fix sme_populate_pgd() to update page flags if the PMD/PTE entry already exists. Signed-off-by: Brijesh Singh Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org Cc: Paolo Bonzini Cc: Sean Christop

[PATCH v3 2/4] x86/mm: fix sme_populate_pgd() to update page flags

2018-08-29 Thread Brijesh Singh
Fix sme_populate_pgd() to update page flags if the PMD/PTE entry already exists. Signed-off-by: Brijesh Singh Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org Cc: Paolo Bonzini Cc: Sean Christop

[PATCH v3 4/4] x86/kvm: use __decrypted attribute in shared variables

2018-08-29 Thread Brijesh Singh
to hold the shared variables. This section is mapped with C=0 early during boot. Use __decrypted attribute to put the wall_clock and hv_clock_boot in .data..decrypted section so that they are mapped with C=0. Signed-off-by: Brijesh Singh Fixes: 368a540e0232 ("x86/kvmclock: Remove mem

[PATCH v3 4/4] x86/kvm: use __decrypted attribute in shared variables

2018-08-29 Thread Brijesh Singh
to hold the shared variables. This section is mapped with C=0 early during boot. Use __decrypted attribute to put the wall_clock and hv_clock_boot in .data..decrypted section so that they are mapped with C=0. Signed-off-by: Brijesh Singh Fixes: 368a540e0232 ("x86/kvmclock: Remove mem

[PATCH v3 1/4] x86/mm: Restructure sme_encrypt_kernel()

2018-08-29 Thread Brijesh Singh
Re-arrange the sme_encrypt_kernel() by moving the workarea map/unmap logic in a separate static function. There are no logical changes in this patch. The restructuring will allow us to expand the sme_encrypt_kernel in future. Signed-off-by: Brijesh Singh Cc: Tom Lendacky Cc: k

[PATCH v3 1/4] x86/mm: Restructure sme_encrypt_kernel()

2018-08-29 Thread Brijesh Singh
Re-arrange the sme_encrypt_kernel() by moving the workarea map/unmap logic in a separate static function. There are no logical changes in this patch. The restructuring will allow us to expand the sme_encrypt_kernel in future. Signed-off-by: Brijesh Singh Cc: Tom Lendacky Cc: k

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

2018-08-29 Thread Brijesh Singh
and SEV cases. Signed-off-by: Brijesh Singh Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org Cc: Paolo Bonzini Cc: Sean Christopherson Cc: k...@vger.kernel.org Cc: "Radim Krčmář" ---

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

2018-08-29 Thread Brijesh Singh
and SEV cases. Signed-off-by: Brijesh Singh Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: linux-kernel@vger.kernel.org Cc: Paolo Bonzini Cc: Sean Christopherson Cc: k...@vger.kernel.org Cc: "Radim Krčmář" ---

[PATCH v3 0/4] x86: Fix SEV guest regression

2018-08-29 Thread Brijesh Singh
o update the pte/pmd flags when mapping exist Brijesh Singh (4): x86/mm: Restructure sme_encrypt_kernel() x86/mm: fix sme_populate_pgd() to update page flags x86/mm: add .data..decrypted section to hold shared variables x86/kvm: use __decrypted attribute in shared variables arch/x86/inclu

[PATCH v3 0/4] x86: Fix SEV guest regression

2018-08-29 Thread Brijesh Singh
o update the pte/pmd flags when mapping exist Brijesh Singh (4): x86/mm: Restructure sme_encrypt_kernel() x86/mm: fix sme_populate_pgd() to update page flags x86/mm: add .data..decrypted section to hold shared variables x86/kvm: use __decrypted attribute in shared variables arch/x86/inclu

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

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

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

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

2018-08-28 Thread Brijesh Singh
the sme_populate_pgd() we found that the function does not update the flags if the pte/pmd entry already exists. The patch updates the function to take care of it. Signed-off-by: Brijesh Singh Cc: sta...@vger.kernel.org Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Borislav Petkov Cc

[PATCH v2 1/3] x86/mm: Restructure sme_encrypt_kernel()

2018-08-28 Thread Brijesh Singh
Re-arrange the sme_encrypt_kernel() by moving the workarea map/unmap logic in a separate static function. There are no logical changes in this patch. The restructuring will allow us to expand the sme_encrypt_kernel in future. Signed-off-by: Brijesh Singh Cc: sta...@vger.kernel.org Cc: Tom

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

2018-08-28 Thread Brijesh Singh
the sme_populate_pgd() we found that the function does not update the flags if the pte/pmd entry already exists. The patch updates the function to take care of it. Signed-off-by: Brijesh Singh Cc: sta...@vger.kernel.org Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Borislav Petkov Cc

[PATCH v2 1/3] x86/mm: Restructure sme_encrypt_kernel()

2018-08-28 Thread Brijesh Singh
Re-arrange the sme_encrypt_kernel() by moving the workarea map/unmap logic in a separate static function. There are no logical changes in this patch. The restructuring will allow us to expand the sme_encrypt_kernel in future. Signed-off-by: Brijesh Singh Cc: sta...@vger.kernel.org Cc: Tom

[PATCH v2 3/3] x86/kvm: use __decrypted attribute when declaring shared variables

2018-08-28 Thread Brijesh Singh
..decrypted section to hold the shared variables. This section is mapped with C=0 very early. Use __decrypted attribute to put the wall_clock and hv_clock_boot in .data..decrypted section so that they are mapped with C=0. Signed-off-by: Brijesh Singh Fixes: 368a540e0232 ("x86/kvmclock: Remove mem

[PATCH v2 3/3] x86/kvm: use __decrypted attribute when declaring shared variables

2018-08-28 Thread Brijesh Singh
..decrypted section to hold the shared variables. This section is mapped with C=0 very early. Use __decrypted attribute to put the wall_clock and hv_clock_boot in .data..decrypted section so that they are mapped with C=0. Signed-off-by: Brijesh Singh Fixes: 368a540e0232 ("x86/kvmclock: Remove mem

[PATCH v2 0/3] x86: Fix SEV guest regression

2018-08-28 Thread Brijesh Singh
- map the workarea buffer as encrypted when SEV is enabled - enhance the sme_populate_pgd to update the pte/pmd flags when mapping exist Brijesh Singh (3): x86/mm: Restructure sme_encrypt_kernel() x86/mm: add .data..decrypted section to hold shared variables x86/kvm: use __decrypted attr

[PATCH v2 0/3] x86: Fix SEV guest regression

2018-08-28 Thread Brijesh Singh
- map the workarea buffer as encrypted when SEV is enabled - enhance the sme_populate_pgd to update the pte/pmd flags when mapping exist Brijesh Singh (3): x86/mm: Restructure sme_encrypt_kernel() x86/mm: add .data..decrypted section to hold shared variables x86/kvm: use __decrypted attr

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

2018-08-28 Thread Brijesh Singh
On 08/27/2018 05:11 PM, Tom Lendacky wrote: On 08/27/2018 06:24 AM, 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

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

2018-08-28 Thread Brijesh Singh
On 08/27/2018 05:11 PM, Tom Lendacky wrote: On 08/27/2018 06:24 AM, 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

[PATCH 2/2] x86/kvm: use __decrypted attribute when declaring shared variables

2018-08-27 Thread Brijesh Singh
..decrypted section to hold the shared variables. This section is mapped with C=0 very early. Use __decrypted attribute to put the wall_clock and hv_clock_boot in .data..decrypted section so that they are mapped with C=0. Signed-off-by: Brijesh Singh Fixes: 368a540e0232 ("x86/kvmclock: Remove mem

[PATCH 2/2] x86/kvm: use __decrypted attribute when declaring shared variables

2018-08-27 Thread Brijesh Singh
..decrypted section to hold the shared variables. This section is mapped with C=0 very early. Use __decrypted attribute to put the wall_clock and hv_clock_boot in .data..decrypted section so that they are mapped with C=0. Signed-off-by: Brijesh Singh Fixes: 368a540e0232 ("x86/kvmclock: Remove mem

[PATCH 0/2] x86: Fix SEV guest regression

2018-08-27 Thread Brijesh Singh
variables in .data..decrypted section. Cc: Tom Lendacky Cc: Thomas Gleixner Cc: Borislav Petkov Cc: Paolo Bonzini Cc: Sean Christopherson Cc: "Radim Krčmář" Brijesh Singh (2): x86/mm: add .data..decrypted section to hold shared variables x86/kvm: use __decrypted attribute when declar

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

2018-08-27 Thread Brijesh Singh
is PMD aligned and sized so that we avoid the need for spliting the pages when map with C=0. Signed-off-by: Brijesh Singh Fixes: 368a540e0232 ("x86/kvmclock: Remove memblock dependency") Cc: sta...@vger.kernel.org Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Boris

[PATCH 0/2] x86: Fix SEV guest regression

2018-08-27 Thread Brijesh Singh
variables in .data..decrypted section. Cc: Tom Lendacky Cc: Thomas Gleixner Cc: Borislav Petkov Cc: Paolo Bonzini Cc: Sean Christopherson Cc: "Radim Krčmář" Brijesh Singh (2): x86/mm: add .data..decrypted section to hold shared variables x86/kvm: use __decrypted attribute when declar

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

2018-08-27 Thread Brijesh Singh
is PMD aligned and sized so that we avoid the need for spliting the pages when map with C=0. Signed-off-by: Brijesh Singh Fixes: 368a540e0232 ("x86/kvmclock: Remove memblock dependency") Cc: sta...@vger.kernel.org Cc: Tom Lendacky Cc: k...@vger.kernel.org Cc: Thomas Gleixner Cc: Boris

Re: SEV guest regression in 4.18

2018-08-24 Thread Brijesh Singh
On 08/24/2018 11:24 AM, Sean Christopherson wrote: On Fri, Aug 24, 2018 at 10:41:27AM -0500, Brijesh Singh wrote: On 08/23/2018 11:16 AM, Paolo Bonzini wrote: On 23/08/2018 17:29, Sean Christopherson wrote: On Thu, Aug 23, 2018 at 01:26:55PM +0200, Paolo Bonzini wrote: On 22/08/2018 22

Re: SEV guest regression in 4.18

2018-08-24 Thread Brijesh Singh
On 08/24/2018 11:24 AM, Sean Christopherson wrote: On Fri, Aug 24, 2018 at 10:41:27AM -0500, Brijesh Singh wrote: On 08/23/2018 11:16 AM, Paolo Bonzini wrote: On 23/08/2018 17:29, Sean Christopherson wrote: On Thu, Aug 23, 2018 at 01:26:55PM +0200, Paolo Bonzini wrote: On 22/08/2018 22

Re: SEV guest regression in 4.18

2018-08-24 Thread Brijesh Singh
On 08/24/2018 10:50 AM, Paolo Bonzini wrote: On 24/08/2018 17:41, Brijesh Singh wrote: Wouldn't that result in exposing/leaking whatever code/data happened to reside on the same 2M page (or corrupting it if the entire page isn't decrypted)?  Or are you suggesting that we'd also leave

Re: SEV guest regression in 4.18

2018-08-24 Thread Brijesh Singh
On 08/24/2018 10:50 AM, Paolo Bonzini wrote: On 24/08/2018 17:41, Brijesh Singh wrote: Wouldn't that result in exposing/leaking whatever code/data happened to reside on the same 2M page (or corrupting it if the entire page isn't decrypted)?  Or are you suggesting that we'd also leave

Re: SEV guest regression in 4.18

2018-08-24 Thread Brijesh Singh
On 08/23/2018 11:16 AM, Paolo Bonzini wrote: On 23/08/2018 17:29, Sean Christopherson wrote: On Thu, Aug 23, 2018 at 01:26:55PM +0200, Paolo Bonzini wrote: On 22/08/2018 22:11, Brijesh Singh wrote: Yes, this is one of approach I have in mind. It will avoid splitting the larger pages; I am

Re: SEV guest regression in 4.18

2018-08-24 Thread Brijesh Singh
On 08/23/2018 11:16 AM, Paolo Bonzini wrote: On 23/08/2018 17:29, Sean Christopherson wrote: On Thu, Aug 23, 2018 at 01:26:55PM +0200, Paolo Bonzini wrote: On 22/08/2018 22:11, Brijesh Singh wrote: Yes, this is one of approach I have in mind. It will avoid splitting the larger pages; I am

Re: SEV guest regression in 4.18

2018-08-22 Thread Brijesh Singh
Hi Sean, On 08/22/2018 10:00 AM, Sean Christopherson wrote: On Wed, Aug 22, 2018 at 10:14:17AM +0200, Borislav Petkov wrote: Dropping Pavel as it bounces. On Tue, Aug 21, 2018 at 11:07:38AM -0500, Brijesh Singh wrote: The tsc_early_init() is called before setup_arch() -> init_mem_mapp

Re: SEV guest regression in 4.18

2018-08-22 Thread Brijesh Singh
Hi Sean, On 08/22/2018 10:00 AM, Sean Christopherson wrote: On Wed, Aug 22, 2018 at 10:14:17AM +0200, Borislav Petkov wrote: Dropping Pavel as it bounces. On Tue, Aug 21, 2018 at 11:07:38AM -0500, Brijesh Singh wrote: The tsc_early_init() is called before setup_arch() -> init_mem_mapp

Re: SEV guest regression in 4.18

2018-08-21 Thread Brijesh Singh
On 08/21/2018 10:19 AM, Borislav Petkov wrote: On Tue, Aug 21, 2018 at 09:37:56AM -0500, Brijesh Singh wrote: Those variables are accessed immediately by the tsc calibration code path hence we will not able to delay the allocation. If you mean, check_tsc_sync_source/_target(), those

Re: SEV guest regression in 4.18

2018-08-21 Thread Brijesh Singh
On 08/21/2018 10:19 AM, Borislav Petkov wrote: On Tue, Aug 21, 2018 at 09:37:56AM -0500, Brijesh Singh wrote: Those variables are accessed immediately by the tsc calibration code path hence we will not able to delay the allocation. If you mean, check_tsc_sync_source/_target(), those

Re: SEV guest regression in 4.18

2018-08-21 Thread Brijesh Singh
Hi Boris, On 08/21/2018 03:39 AM, Borislav Petkov wrote: On Mon, Aug 20, 2018 at 05:11:53PM -0500, Brijesh Singh wrote: Hi All, The following commit " x86/kvmclock: Remove memblock dependency https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commi

Re: SEV guest regression in 4.18

2018-08-21 Thread Brijesh Singh
Hi Boris, On 08/21/2018 03:39 AM, Borislav Petkov wrote: On Mon, Aug 20, 2018 at 05:11:53PM -0500, Brijesh Singh wrote: Hi All, The following commit " x86/kvmclock: Remove memblock dependency https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commi

SEV guest regression in 4.18

2018-08-20 Thread Brijesh Singh
Hi All, The following commit " x86/kvmclock: Remove memblock dependency https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=368a540e0232ad446931f5a4e8a5e06f69f21343 " broke the SEV support in 4.18. Since the guest physical address holding the wall_clock and

SEV guest regression in 4.18

2018-08-20 Thread Brijesh Singh
Hi All, The following commit " x86/kvmclock: Remove memblock dependency https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=368a540e0232ad446931f5a4e8a5e06f69f21343 " broke the SEV support in 4.18. Since the guest physical address holding the wall_clock and

[tip:efi/urgent] x86/efi: Access EFI MMIO data as unencrypted when SEV is active

2018-07-22 Thread tip-bot for Brijesh Singh
Commit-ID: 9b788f32bee6b0b293a4bdfca4ad4bb0206407fb Gitweb: https://git.kernel.org/tip/9b788f32bee6b0b293a4bdfca4ad4bb0206407fb Author: Brijesh Singh AuthorDate: Fri, 20 Jul 2018 10:28:46 +0900 Committer: Ingo Molnar CommitDate: Sun, 22 Jul 2018 14:10:38 +0200 x86/efi: Access EFI MMIO

[tip:efi/urgent] x86/efi: Access EFI MMIO data as unencrypted when SEV is active

2018-07-22 Thread tip-bot for Brijesh Singh
Commit-ID: 9b788f32bee6b0b293a4bdfca4ad4bb0206407fb Gitweb: https://git.kernel.org/tip/9b788f32bee6b0b293a4bdfca4ad4bb0206407fb Author: Brijesh Singh AuthorDate: Fri, 20 Jul 2018 10:28:46 +0900 Committer: Ingo Molnar CommitDate: Sun, 22 Jul 2018 14:10:38 +0200 x86/efi: Access EFI MMIO

Re: [patch 0/7] x86/kvmclock: Remove memblock dependency and further cleanups

2018-07-06 Thread Brijesh Singh
Adding Tom and Boris On 7/6/18 12:47 PM, Paolo Bonzini wrote: > On 06/07/2018 18:13, Thomas Gleixner wrote: >> To allow early utilization of kvmclock it is required to remove the >> memblock dependency. memblock is currently used to allocate the per >> cpu data for kvmclock. >> >> The first

Re: [patch 0/7] x86/kvmclock: Remove memblock dependency and further cleanups

2018-07-06 Thread Brijesh Singh
Adding Tom and Boris On 7/6/18 12:47 PM, Paolo Bonzini wrote: > On 06/07/2018 18:13, Thomas Gleixner wrote: >> To allow early utilization of kvmclock it is required to remove the >> memblock dependency. memblock is currently used to allocate the per >> cpu data for kvmclock. >> >> The first

Re: [PATCH v2] x86/kvm/Kconfig: Ensure CRYPTO_DEV_CCP_DD state at minimum matches KVM_AMD

2018-07-02 Thread Brijesh Singh
mit message. Fixes: 505c9e94d832 ("KVM: x86: prefer "depends on" to "select" for SEV") Cc: # 4.16.x Signed-off-by: Janakarajan Natarajan --- Reviewed-by: Brijesh Singh arch/x86/kvm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ar

Re: [PATCH v2] x86/kvm/Kconfig: Ensure CRYPTO_DEV_CCP_DD state at minimum matches KVM_AMD

2018-07-02 Thread Brijesh Singh
mit message. Fixes: 505c9e94d832 ("KVM: x86: prefer "depends on" to "select" for SEV") Cc: # 4.16.x Signed-off-by: Janakarajan Natarajan --- Reviewed-by: Brijesh Singh arch/x86/kvm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ar

Re: [PATCH] Use 'imply' with SEV Kconfig CRYPTO dependencies

2018-06-19 Thread Brijesh Singh
On 06/19/2018 02:43 PM, Borislav Petkov wrote: On Tue, Jun 19, 2018 at 02:22:53PM -0500, Brijesh Singh wrote: It would be nice to have a single depends. But the main issue is, PSP support is provided through the ccp driver (aka CRYPTO_DEV_CCP_DD). And this sentence states also your

Re: [PATCH] Use 'imply' with SEV Kconfig CRYPTO dependencies

2018-06-19 Thread Brijesh Singh
On 06/19/2018 02:43 PM, Borislav Petkov wrote: On Tue, Jun 19, 2018 at 02:22:53PM -0500, Brijesh Singh wrote: It would be nice to have a single depends. But the main issue is, PSP support is provided through the ccp driver (aka CRYPTO_DEV_CCP_DD). And this sentence states also your

Re: [PATCH] Use 'imply' with SEV Kconfig CRYPTO dependencies

2018-06-19 Thread Brijesh Singh
Hi Boris, On 06/19/2018 04:46 AM, Borislav Petkov wrote: On Thu, Jun 14, 2018 at 07:08:26AM -0500, Brijesh Singh wrote: I think depends should look like this: config KVM_AMD_SEV     def_bool y     bool "AMD Secure Encrypted Virtualization (SEV) support"     depends KVM_AMD

Re: [PATCH] Use 'imply' with SEV Kconfig CRYPTO dependencies

2018-06-19 Thread Brijesh Singh
Hi Boris, On 06/19/2018 04:46 AM, Borislav Petkov wrote: On Thu, Jun 14, 2018 at 07:08:26AM -0500, Brijesh Singh wrote: I think depends should look like this: config KVM_AMD_SEV     def_bool y     bool "AMD Secure Encrypted Virtualization (SEV) support"     depends KVM_AMD

Re: [PATCH] Use 'imply' with SEV Kconfig CRYPTO dependencies

2018-06-14 Thread Brijesh Singh
On 6/14/18 2:58 AM, Richard Weinberger wrote: > On Wed, May 23, 2018 at 4:46 PM, Borislav Petkov wrote: >> + Tom and Brijesh. >> >> On Mon, May 21, 2018 at 10:12:53AM -0500, Janakarajan Natarajan wrote: >>> Use Kconfig imply 'option' when specifying SEV CRYPTO dependencies. >>> >>> Example

Re: [PATCH] Use 'imply' with SEV Kconfig CRYPTO dependencies

2018-06-14 Thread Brijesh Singh
On 6/14/18 2:58 AM, Richard Weinberger wrote: > On Wed, May 23, 2018 at 4:46 PM, Borislav Petkov wrote: >> + Tom and Brijesh. >> >> On Mon, May 21, 2018 at 10:12:53AM -0500, Janakarajan Natarajan wrote: >>> Use Kconfig imply 'option' when specifying SEV CRYPTO dependencies. >>> >>> Example

Re: [PATCH] KVM: X86: prevent integer overflows in KVM_MEMORY_ENCRYPT_REG_REGION

2018-05-21 Thread Brijesh Singh
e math works in the current code so far as I can see but it's just weird. This change looks good. thanks Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> Reviewed-by: Brijesh Singh <brijesh.si...@amd.com> --- Again, this is a static checker fix. The most risky part

Re: [PATCH] KVM: X86: prevent integer overflows in KVM_MEMORY_ENCRYPT_REG_REGION

2018-05-21 Thread Brijesh Singh
e math works in the current code so far as I can see but it's just weird. This change looks good. thanks Signed-off-by: Dan Carpenter Reviewed-by: Brijesh Singh --- Again, this is a static checker fix. The most risky parts of this patch are blocking "ulen == 0" and changin

Re: [PATCH] crypto: ccp: Use memdup_user() rather than duplicating its implementation

2018-03-05 Thread Brijesh Singh
ing the Coccinelle software. > > Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net> > --- > drivers/crypto/ccp/psp-dev.c | 15 +-- > 1 file changed, 1 insertion(+), 14 deletions(-) Reviewed-by: Brijesh Singh <brijesh.si...@amd.com> thanks > d

Re: [PATCH] crypto: ccp: Use memdup_user() rather than duplicating its implementation

2018-03-05 Thread Brijesh Singh
> Signed-off-by: Markus Elfring > --- > drivers/crypto/ccp/psp-dev.c | 15 +-- > 1 file changed, 1 insertion(+), 14 deletions(-) Reviewed-by: Brijesh Singh thanks > diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c > index fcfa5b1eae61..8255258c

[PATCH] KVM: SVM: no need to call access_ok() in LAUNCH_MEASURE command

2018-02-23 Thread Brijesh Singh
oerg Roedel <j...@8bytes.org> Signed-off-by: Brijesh Singh <brijesh.si...@amd.com> --- We no longer need patch [1]. This patch implements Al Viro's recommendation [2] [1] https://marc.info/?l=linux-kernel=151905677729098=2. [2] https://marc.info/?l=linux-kernel=151923536116467=2 arch/x8

[PATCH] KVM: SVM: no need to call access_ok() in LAUNCH_MEASURE command

2018-02-23 Thread Brijesh Singh
for KVM_SEV_LAUNCH_MEASURE ...) Cc: Paolo Bonzini Cc: "Radim Krčmář" Cc: Borislav Petkov Cc: Tom Lendacky Cc: linux-kernel@vger.kernel.org Cc: Joerg Roedel Signed-off-by: Brijesh Singh --- We no longer need patch [1]. This patch implements Al Viro's recommendation [2] [1] https://ma

Re: [PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)

2018-02-23 Thread Brijesh Singh
On 02/23/2018 12:05 PM, Paolo Bonzini wrote: On 22/02/2018 16:56, Brijesh Singh wrote: On 02/21/2018 02:18 PM, Al Viro wrote: On Wed, Feb 21, 2018 at 01:59:55PM -0600, Brijesh Singh wrote: Sure, checking access_ok() does not guarantee that later copy_from_user() will not fail

Re: [PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)

2018-02-23 Thread Brijesh Singh
On 02/23/2018 12:05 PM, Paolo Bonzini wrote: On 22/02/2018 16:56, Brijesh Singh wrote: On 02/21/2018 02:18 PM, Al Viro wrote: On Wed, Feb 21, 2018 at 01:59:55PM -0600, Brijesh Singh wrote: Sure, checking access_ok() does not guarantee that later copy_from_user() will not fail

Re: [PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)

2018-02-22 Thread Brijesh Singh
On 02/21/2018 02:18 PM, Al Viro wrote: On Wed, Feb 21, 2018 at 01:59:55PM -0600, Brijesh Singh wrote: Sure, checking access_ok() does not guarantee that later copy_from_user() will not fail. But it does eliminate one possible reason for the failure. We are trying to validate most of the user

Re: [PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)

2018-02-22 Thread Brijesh Singh
On 02/21/2018 02:18 PM, Al Viro wrote: On Wed, Feb 21, 2018 at 01:59:55PM -0600, Brijesh Singh wrote: Sure, checking access_ok() does not guarantee that later copy_from_user() will not fail. But it does eliminate one possible reason for the failure. We are trying to validate most of the user

Re: [PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)

2018-02-21 Thread Brijesh Singh
On 2/21/18 11:49 AM, Al Viro wrote: > On Mon, Feb 19, 2018 at 10:12:28AM -0600, Brijesh Singh wrote: >> Fix sparse: incorrect type in argument 1 (different base types). Typecast >> the userspace address argument. > Better question: why the hell do we want that access_ok(),

Re: [PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)

2018-02-21 Thread Brijesh Singh
On 2/21/18 11:49 AM, Al Viro wrote: > On Mon, Feb 19, 2018 at 10:12:28AM -0600, Brijesh Singh wrote: >> Fix sparse: incorrect type in argument 1 (different base types). Typecast >> the userspace address argument. > Better question: why the hell do we want that access_ok(),

[PATCH v2] crypto: ccp: add check to get PSP master only when PSP is detected

2018-02-21 Thread Brijesh Singh
nel crash. Add check to call get master device only when PSP/SEV is detected. Reported-by: Paulian Bogdan Marinca <paul...@marinca.net> Cc: Borislav Petkov <b...@suse.de> Cc: Tom Lendacky <thomas.lenda...@amd.com> CC: Gary R Hook <gary.h...@amd.com> Cc: linux-kernel@vger.kernel

[PATCH v2] crypto: ccp: add check to get PSP master only when PSP is detected

2018-02-21 Thread Brijesh Singh
nel crash. Add check to call get master device only when PSP/SEV is detected. Reported-by: Paulian Bogdan Marinca Cc: Borislav Petkov Cc: Tom Lendacky CC: Gary R Hook Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh --- Changes since v1: v1 contained a local change I u

[PATCH] crypto: ccp: add check to get PSP master only when PSP is detected

2018-02-21 Thread Brijesh Singh
nel crash. Add check to call get master device only when PSP/SEV is detected. Reported-by: Paulian Bogdan Marinca <paul...@marinca.net> Cc: Borislav Petkov <b...@suse.de> Cc: Tom Lendacky <thomas.lenda...@amd.com> CC: Gary R Hook <gary.h...@amd.com> Cc: linux-kernel@vger.kernel

[PATCH] crypto: ccp: add check to get PSP master only when PSP is detected

2018-02-21 Thread Brijesh Singh
nel crash. Add check to call get master device only when PSP/SEV is detected. Reported-by: Paulian Bogdan Marinca Cc: Borislav Petkov Cc: Tom Lendacky CC: Gary R Hook Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh --- drivers/crypto/ccp/psp-dev.c | 1 + drivers/crypto/ccp/sp-de

[PATCH] KVM: SVM: Fix SEV LAUNCH_SECRET command

2018-02-19 Thread Brijesh Singh
adim Krčmář" <rkrc...@redhat.com> Cc: Borislav Petkov <b...@suse.de> Cc: Tom Lendacky <thomas.lenda...@amd.com> Cc: linux-kernel@vger.kernel.org Cc: Joerg Roedel <j...@8bytes.org> Signed-off-by: Brijesh Singh <brijesh.si...@amd.com> --- arch/x86/kvm/svm.c | 10

[PATCH] KVM: SVM: Fix SEV LAUNCH_SECRET command

2018-02-19 Thread Brijesh Singh
: Borislav Petkov Cc: Tom Lendacky Cc: linux-kernel@vger.kernel.org Cc: Joerg Roedel Signed-off-by: Brijesh Singh --- arch/x86/kvm/svm.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index a2f1bb73640c..22fc3022386a 100644 ---

[PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)

2018-02-19 Thread Brijesh Singh
v Petkov <b...@suse.de> Cc: Tom Lendacky <thomas.lenda...@amd.com> Cc: linux-kernel@vger.kernel.org Cc: Joerg Roedel <j...@8bytes.org> Signed-off-by: Brijesh Singh <brijesh.si...@amd.com> --- arch/x86/kvm/svm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -

[PATCH] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)

2018-02-19 Thread Brijesh Singh
nel.org Cc: Joerg Roedel Signed-off-by: Brijesh Singh --- arch/x86/kvm/svm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index b3e488a74828..a2f1bb73640c 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -6262,7 +6262,9 @@

[PATCH 1/4] crypto: ccp: Fix sparse, use plain integer as NULL pointer

2018-01-15 Thread Brijesh Singh
a.org.au> Cc: Gary Hook <gary.h...@amd.com> Cc: Tom Lendacky <thomas.lenda...@amd.com> Cc: linux-cry...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh <brijesh.si...@amd.com> --- drivers/crypto/ccp/psp-dev.c | 8 1 file changed, 4 insert

[PATCH 1/4] crypto: ccp: Fix sparse, use plain integer as NULL pointer

2018-01-15 Thread Brijesh Singh
org Signed-off-by: Brijesh Singh --- drivers/crypto/ccp/psp-dev.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c index fcfa5b1eae61..b3afb6cc9d72 100644 --- a/drivers/crypto/ccp/psp-dev.c +++ b/drivers/cryp

[PATCH 3/4] include: psp-sev: Capitalize invalid length enum

2018-01-15 Thread Brijesh Singh
t; <rkrc...@redhat.com> Cc: Borislav Petkov <b...@suse.de> Cc: Tom Lendacky <thomas.lenda...@amd.com> CC: Gary R Hook <gary.h...@amd.com> Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh <brijesh.si...@amd.com> --- include/uapi/linux/psp-sev.h | 2 +- 1 file chan

[PATCH 3/4] include: psp-sev: Capitalize invalid length enum

2018-01-15 Thread Brijesh Singh
Lendacky CC: Gary R Hook Cc: linux-kernel@vger.kernel.org Signed-off-by: Brijesh Singh --- include/uapi/linux/psp-sev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/psp-sev.h b/include/uapi/linux/psp-sev.h index 3d77fe91239a..9008f31c7eb6 100644 --- a/in

[PATCH 2/4] KVM: SVM: Fix sparse: incorrect type in argument 1 (different base types)

2018-01-15 Thread Brijesh Singh
; Cc: linux-kernel@vger.kernel.org Cc: Joerg Roedel <j...@8bytes.org> Signed-off-by: Brijesh Singh <brijesh.si...@amd.com> --- arch/x86/kvm/svm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 99476c706c16..8ce5bb7b0

[PATCH 0/4] KVM: SVM: kbuild test robot warning fixes

2018-01-15 Thread Brijesh Singh
gt; Cc: "Radim Krčmář" <rkrc...@redhat.com> Cc: Borislav Petkov <b...@suse.de> Cc: Herbert Xu <herb...@gondor.apana.org.au> Cc: Gary Hook <gary.h...@amd.com> Cc: Tom Lendacky <thomas.lenda...@amd.com> Cc: Joerg Roedel <j...@8bytes.org> Cc: linux-cry...@vger.

[PATCH 4/4] KVM: SVM: Fix SEV LAUNCH_SECRET command

2018-01-15 Thread Brijesh Singh
adim Krčmář" <rkrc...@redhat.com> Cc: Borislav Petkov <b...@suse.de> Cc: Tom Lendacky <thomas.lenda...@amd.com> Cc: linux-kernel@vger.kernel.org Cc: Joerg Roedel <j...@8bytes.org> Signed-off-by: Brijesh Singh <brijesh.si...@amd.com> --- arch/x86/kvm/svm.c | 10

[PATCH 4/4] KVM: SVM: Fix SEV LAUNCH_SECRET command

2018-01-15 Thread Brijesh Singh
: Borislav Petkov Cc: Tom Lendacky Cc: linux-kernel@vger.kernel.org Cc: Joerg Roedel Signed-off-by: Brijesh Singh --- arch/x86/kvm/svm.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 8ce5bb7b04d1..ef33bef85691 100644 ---

<    1   2   3   4   5   6   7   8   9   10   >