[lkml]   [2018]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH 0/2] x86: Fix SEV guest regression
The following commit

x86/kvmclock: Remove memblock dependency

introduced SEV guest regression.

The guest physical address holding the wall_clock and hv_clock_boot
are shared with the hypervisor must be mapped with C=0 when SEV
is active. To clear the C-bit we use kernel_physical_mapping_init() to
split the large pages. The above commit moved the kvmclock initialization
very early and kernel_physical_mapping_init() fails to allocate memory
while spliting the large page.

To solve it, we add a special .data..decrypted section, this section can be
used to hold the shared variables. Early boot code maps this section with
C=0. The section is pmd aligned and sized to avoid the need to split the pages.
Caller can use __decrypted attribute to add the variables in .data..decrypted

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 declaring shared variables

arch/x86/include/asm/mem_encrypt.h | 4 +
arch/x86/kernel/head64.c | 12 ++
arch/x86/kernel/kvmclock.c | 26 ++++-
arch/x86/kernel/ | 18 +++
arch/x86/mm/mem_encrypt_identity.c | 220 +++++++++++++++++++++++++++----------
5 files changed, 218 insertions(+), 62 deletions(-)


 \ /
  Last update: 2018-08-27 13:26    [W:0.059 / U:5.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site