]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
x86/vmx: remove dead code to create domains without a vLAPIC
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 14 Mar 2022 09:29:24 +0000 (10:29 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 14 Mar 2022 09:29:24 +0000 (10:29 +0100)
After the removal of PVHv1 it's no longer supported to create a domain
using hardware virtualization extensions and without a local APIC:
PVHv2 mandates domains to always have a LAPIC. Remove some stale code
in VMCS construction and related helpers that catered for that
use-case.

No functional change.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/hvm/vmx/vmx.c

index e1e1fa14e65e7c0a6d8b50d69ed7dab8180397bf..56fed2db036fdf51490b7afe8da60e86a3055e75 100644 (file)
@@ -1123,20 +1123,6 @@ static int construct_vmcs(struct vcpu *v)
     /* Do not enable Monitor Trap Flag unless start single step debug */
     v->arch.hvm.vmx.exec_control &= ~CPU_BASED_MONITOR_TRAP_FLAG;
 
-    if ( !has_vlapic(d) )
-    {
-        /* Disable virtual apics, TPR */
-        v->arch.hvm.vmx.secondary_exec_control &=
-            ~(SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES
-              | SECONDARY_EXEC_APIC_REGISTER_VIRT
-              | SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY);
-        v->arch.hvm.vmx.exec_control &= ~CPU_BASED_TPR_SHADOW;
-
-        /* In turn, disable posted interrupts. */
-        __vmwrite(PIN_BASED_VM_EXEC_CONTROL,
-                  vmx_pin_based_exec_control & ~PIN_BASED_POSTED_INTERRUPT);
-    }
-
     vmx_update_cpu_exec_control(v);
 
     __vmwrite(VM_EXIT_CONTROLS, vmexit_ctl);
index c075370f642ad898fca9c55be9a8f94f369a7431..af9ee7cebbe08ec57ceb60ac7722caa0a4b5003e 100644 (file)
@@ -421,7 +421,7 @@ static void cf_check domain_creation_finished(struct domain *d)
     gfn_t gfn = gaddr_to_gfn(APIC_DEFAULT_PHYS_BASE);
     bool ipat;
 
-    if ( !has_vlapic(d) || mfn_eq(apic_access_mfn, INVALID_MFN) )
+    if ( mfn_eq(apic_access_mfn, INVALID_MFN) )
         return;
 
     ASSERT(epte_get_entry_emt(d, gfn, apic_access_mfn, 0, &ipat,
@@ -3328,7 +3328,7 @@ static void vmx_install_vlapic_mapping(struct vcpu *v)
 {
     paddr_t virt_page_ma, apic_page_ma;
 
-    if ( !has_vlapic(v->domain) || mfn_eq(apic_access_mfn, INVALID_MFN) )
+    if ( mfn_eq(apic_access_mfn, INVALID_MFN) )
         return;
 
     ASSERT(cpu_has_vmx_virtualize_apic_accesses);