Re: [PATCH 21/70] x86/boot/compressed/64: Add function to map a page unencrypted

2020-03-21 Thread Joerg Roedel
On Fri, Mar 20, 2020 at 03:26:09PM -0700, Dave Hansen wrote: > In any case, I thought this all came through initialize_identity_maps(), > which does, for instance: > > mapping_info.page_flag = __PAGE_KERNEL_LARGE_EXEC | sme_me_mask; > > Where: > > #define __PAGE_KERNEL_LARGE_EXEC

Re: [PATCH 21/70] x86/boot/compressed/64: Add function to map a page unencrypted

2020-03-20 Thread Dave Hansen
On 3/20/20 3:12 PM, Joerg Roedel wrote: > On Fri, Mar 20, 2020 at 02:02:13PM -0700, Dave Hansen wrote: >> It *never* flushes global pages. For a generic function like this, that >> seems pretty dangerous because the PTEs it goes after could quite easily >> be Global. It's also not _obviously_

Re: [PATCH 21/70] x86/boot/compressed/64: Add function to map a page unencrypted

2020-03-20 Thread Joerg Roedel
On Fri, Mar 20, 2020 at 02:02:13PM -0700, Dave Hansen wrote: > It *never* flushes global pages. For a generic function like this, that > seems pretty dangerous because the PTEs it goes after could quite easily > be Global. It's also not _obviously_ correct if PCIDs are in play > (which I don't

Re: [PATCH 21/70] x86/boot/compressed/64: Add function to map a page unencrypted

2020-03-20 Thread Dave Hansen
On 3/20/20 1:53 PM, David Rientjes wrote: >> + >> +/* Clear encryption flag and write new pte */ >> +pte = pte_clear_flags(*ptep, _PAGE_ENC); >> +set_pte(ptep, pte); >> + >> +/* Flush TLB to map the page unencrypted */ >> +write_cr3(top_level_pgt); >> + > Is there a guarantee

Re: [PATCH 21/70] x86/boot/compressed/64: Add function to map a page unencrypted

2020-03-20 Thread David Rientjes via Virtualization
On Thu, 19 Mar 2020, Joerg Roedel wrote: > From: Joerg Roedel > > This function is needed to map the GHCB for SEV-ES guests. The GHCB is > used for communication with the hypervisor, so its content must not be > encrypted. > > Signed-off-by: Joerg Roedel > --- >

[PATCH 21/70] x86/boot/compressed/64: Add function to map a page unencrypted

2020-03-19 Thread Joerg Roedel
From: Joerg Roedel This function is needed to map the GHCB for SEV-ES guests. The GHCB is used for communication with the hypervisor, so its content must not be encrypted. Signed-off-by: Joerg Roedel --- arch/x86/boot/compressed/ident_map_64.c | 125