All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/vmx: remove dead code to create domains without a vLAPIC
@ 2022-02-15 11:28 Roger Pau Monne
  2022-02-15 13:27 ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Roger Pau Monne @ 2022-02-15 11:28 UTC (permalink / raw)
  To: xen-devel
  Cc: Roger Pau Monne, Jun Nakajima, Kevin Tian, Jan Beulich,
	Andrew Cooper, Wei Liu

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>
---
 xen/arch/x86/hvm/vmx/vmcs.c | 14 --------------
 xen/arch/x86/hvm/vmx/vmx.c  |  4 ++--
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 7ab15e07a0..9eda8a5f0f 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -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);
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 36c8a12cfe..0f98fb4f29 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -419,7 +419,7 @@ static void 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,
@@ -3317,7 +3317,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);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86/vmx: remove dead code to create domains without a vLAPIC
  2022-02-15 11:28 [PATCH] x86/vmx: remove dead code to create domains without a vLAPIC Roger Pau Monne
@ 2022-02-15 13:27 ` Jan Beulich
  2022-03-10 16:22   ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2022-02-15 13:27 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Jun Nakajima, Kevin Tian, Andrew Cooper, Wei Liu, xen-devel

On 15.02.2022 12:28, Roger Pau Monne wrote:
> 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>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86/vmx: remove dead code to create domains without a vLAPIC
  2022-02-15 13:27 ` Jan Beulich
@ 2022-03-10 16:22   ` Jan Beulich
  2022-03-14  3:42     ` Tian, Kevin
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2022-03-10 16:22 UTC (permalink / raw)
  To: Jun Nakajima, Kevin Tian
  Cc: Andrew Cooper, Wei Liu, xen-devel, Roger Pau Monne

On 15.02.2022 14:27, Jan Beulich wrote:
> On 15.02.2022 12:28, Roger Pau Monne wrote:
>> 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>

Just fyi - I'm inclined to put this in without further waiting for an
ack by one of the two of you.

Jan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] x86/vmx: remove dead code to create domains without a vLAPIC
  2022-03-10 16:22   ` Jan Beulich
@ 2022-03-14  3:42     ` Tian, Kevin
  0 siblings, 0 replies; 4+ messages in thread
From: Tian, Kevin @ 2022-03-14  3:42 UTC (permalink / raw)
  To: Beulich, Jan, Nakajima, Jun
  Cc: Cooper, Andrew, Wei Liu, xen-devel, Pau Monné, Roger

> From: Jan Beulich <jbeulich@suse.com>
> Sent: Friday, March 11, 2022 12:22 AM
> 
> On 15.02.2022 14:27, Jan Beulich wrote:
> > On 15.02.2022 12:28, Roger Pau Monne wrote:
> >> 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>
> 
> Just fyi - I'm inclined to put this in without further waiting for an
> ack by one of the two of you.
> 

In case you haven't done it:

	Reviewed-by: Kevin Tian <kevin.tian@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-14  3:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 11:28 [PATCH] x86/vmx: remove dead code to create domains without a vLAPIC Roger Pau Monne
2022-02-15 13:27 ` Jan Beulich
2022-03-10 16:22   ` Jan Beulich
2022-03-14  3:42     ` Tian, Kevin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.