Re: [PATCH v2 3/5] x86/boot/compressed/64: Check SEV encryption in 64-bit boot-path

2020-10-21 Thread Joerg Roedel
On Tue, Oct 20, 2020 at 12:04:28PM -0400, Arvind Sankar wrote: > This is called from both assembly and C, but anyway, you're already > assuming r10 and r11 can be clobbered safely, and you just took out the > save/restores in set_sev_encryption_mask, which is actually called only > from assembly.

Re: [PATCH v2 3/5] x86/boot/compressed/64: Check SEV encryption in 64-bit boot-path

2020-10-20 Thread Arvind Sankar
On Tue, Oct 20, 2020 at 05:48:12PM +0200, Joerg Roedel wrote: > On Tue, Oct 20, 2020 at 10:12:59AM -0400, Arvind Sankar wrote: > > On Tue, Oct 20, 2020 at 02:18:54PM +0200, Joerg Roedel wrote: > > Why use r10-r12 rather than the caller-save registers? Even for the head > > code where you need to

Re: [PATCH v2 3/5] x86/boot/compressed/64: Check SEV encryption in 64-bit boot-path

2020-10-20 Thread Joerg Roedel
On Tue, Oct 20, 2020 at 10:12:59AM -0400, Arvind Sankar wrote: > On Tue, Oct 20, 2020 at 02:18:54PM +0200, Joerg Roedel wrote: > Why use r10-r12 rather than the caller-save registers? Even for the head > code where you need to perserve the cr3 value you can just return it in > rax? It can surely

Re: [PATCH v2 3/5] x86/boot/compressed/64: Check SEV encryption in 64-bit boot-path

2020-10-20 Thread Arvind Sankar
On Tue, Oct 20, 2020 at 02:18:54PM +0200, Joerg Roedel wrote: > From: Joerg Roedel > > Check whether the hypervisor reported the correct C-bit when running as > an SEV guest. Using a wrong C-bit position could be used to leak > sensitive data from the guest to the hypervisor. > > The check

[PATCH v2 3/5] x86/boot/compressed/64: Check SEV encryption in 64-bit boot-path

2020-10-20 Thread Joerg Roedel
From: Joerg Roedel Check whether the hypervisor reported the correct C-bit when running as an SEV guest. Using a wrong C-bit position could be used to leak sensitive data from the guest to the hypervisor. The check function is in arch/x86/kernel/sev_verify_cbit.S so that it can be re-used in