]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
x86/PVH: properly disable vLAPIC
authorJan Beulich <jbeulich@suse.com>
Thu, 27 Nov 2014 13:03:23 +0000 (14:03 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 27 Nov 2014 13:03:23 +0000 (14:03 +0100)
Rather than guarding higher level operations (like vPMU initialization
as suggested by Boris in
http://lists.xenproject.org/archives/html/xen-devel/2014-11/msg02278.html)
mark the vLAPIC hardware disabled for PVH guests and prevent it from
getting moved out of this state.

Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/vlapic.c

index 8f49b440dd125ef658b172bbba6dd3b8104317f2..51ffc90a57bcd297ffc774d35628fedb576e29e4 100644 (file)
@@ -2217,8 +2217,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
         goto fail1;
 
     /* NB: vlapic_init must be called before hvm_funcs.vcpu_initialise */
-    if ( is_hvm_vcpu(v) )
-        rc = vlapic_init(v);
+    rc = vlapic_init(v);
     if ( rc != 0 ) /* teardown: vlapic_destroy */
         goto fail2;
 
@@ -4483,7 +4482,8 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
         break;
 
     case MSR_IA32_APICBASE:
-        if ( !vlapic_msr_set(vcpu_vlapic(v), msr_content) )
+        if ( unlikely(is_pvh_vcpu(v)) ||
+             !vlapic_msr_set(vcpu_vlapic(v), msr_content) )
             goto gp_fault;
         break;
 
index 0b7b607de466da6c9b245f1543917d263c7c3c5c..72b6509c5ed8f70b794a6a2e1f2c35c39c318f32 100644 (file)
@@ -1429,6 +1429,12 @@ int vlapic_init(struct vcpu *v)
 
     HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "%d", v->vcpu_id);
 
+    if ( is_pvh_vcpu(v) )
+    {
+        vlapic->hw.disabled = VLAPIC_HW_DISABLED;
+        return 0;
+    }
+
     vlapic->pt.source = PTSRC_lapic;
 
     if (vlapic->regs_page == NULL)