lkml.org 
[lkml]   [2020]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v9 16/18] KVM: x86: Mark _bss_decrypted section variables as decrypted in page encryption bitmap.
Date
From: Ashish Kalra <ashish.kalra@amd.com>

Ensure that _bss_decrypted section variables such as hv_clock_boot and
wall_clock are marked as decrypted in the page encryption bitmap if
sev live migration is supported.

Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
---
arch/x86/kernel/kvmclock.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index aa593743acf6..f80cc637ff2c 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -333,6 +333,18 @@ void __init kvmclock_init(void)
pr_info("kvm-clock: Using msrs %x and %x",
msr_kvm_system_time, msr_kvm_wall_clock);

+ if (sev_live_migration_enabled()) {
+ unsigned long nr_pages;
+ /*
+ * sizeof(hv_clock_boot) is already PAGE_SIZE aligned
+ */
+ early_set_mem_enc_dec_hypercall((unsigned long)hv_clock_boot,
+ 1, 0);
+ nr_pages = DIV_ROUND_UP(sizeof(wall_clock), PAGE_SIZE);
+ early_set_mem_enc_dec_hypercall((unsigned long)&wall_clock,
+ nr_pages, 0);
+ }
+
this_cpu_write(hv_clock_per_cpu, &hv_clock_boot[0]);
kvm_register_clock("primary cpu clock");
pvclock_set_pvti_cpu0_va(hv_clock_boot);
--
2.17.1
\
 
 \ /
  Last update: 2020-12-08 23:10    [W:0.084 / U:1.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site