From: Keir Fraser Date: Fri, 11 Jun 2010 12:57:52 +0000 (+0100) Subject: svm: use msr safe for erratum 383 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11941 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e63c7db802e14bb5af3abf45539c0e6b2085cc23;p=xen.git svm: use msr safe for erratum 383 Make erratum 383 use msr safe variants to work on top of KVM. Signed-off-by: Christoph Egger --- diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 3e022e19d0..c29ff34ea5 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -849,10 +849,14 @@ static void svm_init_erratum_383(struct cpuinfo_x86 *c) if ( c->x86 != 0x10 ) return; - rdmsrl(MSR_AMD64_DC_CFG, msr_content); - wrmsrl(MSR_AMD64_DC_CFG, msr_content | (1ULL << 47)); - - amd_erratum383_found = 1; + /* use safe methods to be compatible with nested virtualization */ + if (rdmsr_safe(MSR_AMD64_DC_CFG, msr_content) == 0 && + wrmsr_safe(MSR_AMD64_DC_CFG, msr_content | (1ULL << 47)) == 0) + { + amd_erratum383_found = 1; + } else { + printk("Failed to enable erratum 383\n"); + } } static int svm_cpu_up(void)