lkml.org 
[lkml]   [2018]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v7 4/5] x86/kvm: use __decrypted attribute in shared variables
    Date
    The recent removal of the memblock dependency from kvmclock caused a SEV
    guest regression because the wall_clock and hv_clock_boot variables are
    no longer mapped decrypted when SEV is active.

    Use the __decrypted attribute to put the wall_clock and hv_clock_boot in
    the .data..decrypted section so that they are mapped decrypted during boot.

    Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
    Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
    Reviewed-by: Borislav Petkov <bp@suse.de>
    Acked-by: Paolo Bonzini <pbonzini@redhat.com>
    Fixes: 368a540e0232 ("x86/kvmclock: Remove memblock dependency")
    Cc: Tom Lendacky <thomas.lendacky@amd.com>
    Cc: kvm@vger.kernel.org
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Borislav Petkov <bp@suse.de>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: linux-kernel@vger.kernel.org
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Sean Christopherson <sean.j.christopherson@intel.com>
    Cc: "Radim Krčmář" <rkrcmar@redhat.com>
    ---
    arch/x86/kernel/kvmclock.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
    index a36b93a..0b3110b 100644
    --- a/arch/x86/kernel/kvmclock.c
    +++ b/arch/x86/kernel/kvmclock.c
    @@ -61,8 +61,8 @@ early_param("no-kvmclock-vsyscall", parse_no_kvmclock_vsyscall);
    (PAGE_SIZE / sizeof(struct pvclock_vsyscall_time_info))

    static struct pvclock_vsyscall_time_info
    - hv_clock_boot[HVC_BOOT_ARRAY_SIZE] __aligned(PAGE_SIZE);
    -static struct pvclock_wall_clock wall_clock;
    + hv_clock_boot[HVC_BOOT_ARRAY_SIZE] __decrypted __aligned(PAGE_SIZE);
    +static struct pvclock_wall_clock wall_clock __decrypted;
    static DEFINE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu);

    static inline struct pvclock_vcpu_time_info *this_cpu_pvti(void)
    --
    2.7.4
    \
     
     \ /
      Last update: 2018-09-10 23:53    [W:3.305 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site