xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] VMX, apicv: add boot parameter to enable/disable APIC-v dynamically
@ 2013-08-09  9:01 Yang Zhang
  2013-08-09  9:42 ` Andrew Cooper
  0 siblings, 1 reply; 7+ messages in thread
From: Yang Zhang @ 2013-08-09  9:01 UTC (permalink / raw)
  To: xen-devel; +Cc: Yang Zhang, JBeulich

From: Yang Zhang <yang.z.zhang@Intel.com>

Add a boot parameter to enable/disable the APIC-v dynamically. APIC-v is
enabled by default. User can use apicv=0 to disable it.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index de9f592..b52408d 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -46,6 +46,9 @@ boolean_param("vpid", opt_vpid_enabled);
 static bool_t __read_mostly opt_unrestricted_guest_enabled = 1;
 boolean_param("unrestricted_guest", opt_unrestricted_guest_enabled);
 
+static bool_t __read_mostly opt_apicv_enabled = 1;
+boolean_param("apicv", opt_apicv_enabled);
+
 /*
  * These two parameters are used to config the controls for Pause-Loop Exiting:
  * ple_gap:    upper bound on the amount of time between two successive
@@ -196,12 +199,12 @@ static int vmx_init_vmcs_config(void)
          * "APIC Register Virtualization" and "Virtual Interrupt Delivery"
          * can be set only when "use TPR shadow" is set
          */
-        if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW )
+        if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW &&
+                opt_apicv_enabled )
             opt |= SECONDARY_EXEC_APIC_REGISTER_VIRT |
                    SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
                    SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE;
 
-
         _vmx_secondary_exec_control = adjust_vmx_controls(
             "Secondary Exec Control", min, opt,
             MSR_IA32_VMX_PROCBASED_CTLS2, &mismatch);
-- 
1.7.1

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

* Re: [PATCH] VMX, apicv: add boot parameter to enable/disable APIC-v dynamically
  2013-08-09  9:01 [PATCH] VMX, apicv: add boot parameter to enable/disable APIC-v dynamically Yang Zhang
@ 2013-08-09  9:42 ` Andrew Cooper
  2013-08-09 10:00   ` Zhang, Yang Z
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cooper @ 2013-08-09  9:42 UTC (permalink / raw)
  To: Yang Zhang; +Cc: xen-devel, JBeulich

On 09/08/13 10:01, Yang Zhang wrote:
> From: Yang Zhang <yang.z.zhang@Intel.com>
>
> Add a boot parameter to enable/disable the APIC-v dynamically. APIC-v is
> enabled by default. User can use apicv=0 to disable it.
>
> Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
> ---

Please patch docs/misc/xen-command-line.markdown as well.

>  xen/arch/x86/hvm/vmx/vmcs.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
> index de9f592..b52408d 100644
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -46,6 +46,9 @@ boolean_param("vpid", opt_vpid_enabled);
>  static bool_t __read_mostly opt_unrestricted_guest_enabled = 1;
>  boolean_param("unrestricted_guest", opt_unrestricted_guest_enabled);
>  
> +static bool_t __read_mostly opt_apicv_enabled = 1;
> +boolean_param("apicv", opt_apicv_enabled);
> +
>  /*
>   * These two parameters are used to config the controls for Pause-Loop Exiting:
>   * ple_gap:    upper bound on the amount of time between two successive
> @@ -196,12 +199,12 @@ static int vmx_init_vmcs_config(void)
>           * "APIC Register Virtualization" and "Virtual Interrupt Delivery"
>           * can be set only when "use TPR shadow" is set
>           */
> -        if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW )
> +        if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW &&
> +                opt_apicv_enabled )
>              opt |= SECONDARY_EXEC_APIC_REGISTER_VIRT |
>                     SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
>                     SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE;
>  
> -

Unrelated whitespace alteration.

~Andrew

>          _vmx_secondary_exec_control = adjust_vmx_controls(
>              "Secondary Exec Control", min, opt,
>              MSR_IA32_VMX_PROCBASED_CTLS2, &mismatch);

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

* Re: [PATCH] VMX, apicv: add boot parameter to enable/disable APIC-v dynamically
  2013-08-09  9:42 ` Andrew Cooper
@ 2013-08-09 10:00   ` Zhang, Yang Z
  2013-08-09 10:07     ` Andrew Cooper
  0 siblings, 1 reply; 7+ messages in thread
From: Zhang, Yang Z @ 2013-08-09 10:00 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel@lists.xensource.com, JBeulich@suse.com

Andrew Cooper wrote on 2013-08-09:
> On 09/08/13 10:01, Yang Zhang wrote:
>> From: Yang Zhang <yang.z.zhang@Intel.com>
>> 
>> Add a boot parameter to enable/disable the APIC-v dynamically.
>> APIC-v is enabled by default. User can use apicv=0 to disable it.
>> 
>> Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
>> ---
> 
> Please patch docs/misc/xen-command-line.markdown as well.
Sure.

> 
>>  xen/arch/x86/hvm/vmx/vmcs.c |    7 +++++--
>>  1 files changed, 5 insertions(+), 2 deletions(-)
>> diff --git a/xen/arch/x86/hvm/vmx/vmcs.c
>> b/xen/arch/x86/hvm/vmx/vmcs.c index de9f592..b52408d 100644
>> --- a/xen/arch/x86/hvm/vmx/vmcs.c
>> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
>> @@ -46,6 +46,9 @@ boolean_param("vpid", opt_vpid_enabled);  static
>> bool_t __read_mostly opt_unrestricted_guest_enabled = 1;
>> boolean_param("unrestricted_guest", opt_unrestricted_guest_enabled);
>> 
>> +static bool_t __read_mostly opt_apicv_enabled = 1;
>> +boolean_param("apicv", opt_apicv_enabled);
>> +
>>  /*
>>   * These two parameters are used to config the controls for
>> Pause-Loop
> Exiting:
>>   * ple_gap:    upper bound on the amount of time between two
> successive
>> @@ -196,12 +199,12 @@ static int vmx_init_vmcs_config(void)
>>           * "APIC Register Virtualization" and "Virtual Interrupt Delivery"
>>           * can be set only when "use TPR shadow" is set
>>           */
>> -        if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW ) +   
>>     if ( _vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW && +       
>>         opt_apicv_enabled )
>>              opt |= SECONDARY_EXEC_APIC_REGISTER_VIRT |
>>                     SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
>>                     SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE;
>> -
> 
> Unrelated whitespace alteration.
The whitespace is redundant. It is introduced by my previous patch of enabling APIC-v, so I remove it here.

> ~Andrew
> 
>>          _vmx_secondary_exec_control = adjust_vmx_controls(
>>              "Secondary Exec Control", min, opt,
>>              MSR_IA32_VMX_PROCBASED_CTLS2, &mismatch);


Best regards,
Yang

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

* Re: [PATCH] VMX, apicv: add boot parameter to enable/disable APIC-v dynamically
  2013-08-09 10:00   ` Zhang, Yang Z
@ 2013-08-09 10:07     ` Andrew Cooper
  2013-08-09 10:19       ` Zhang, Yang Z
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cooper @ 2013-08-09 10:07 UTC (permalink / raw)
  To: Zhang, Yang Z; +Cc: xen-devel@lists.xensource.com, JBeulich@suse.com

On 09/08/13 11:00, Zhang, Yang Z wrote:
> -
>> Unrelated whitespace alteration.
> The whitespace is redundant. It is introduced by my previous patch of enabling APIC-v, so I remove it here.

Then please correct your previous patch not to introduce it in the first
place.

~Andrew

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

* Re: [PATCH] VMX, apicv: add boot parameter to enable/disable APIC-v dynamically
  2013-08-09 10:07     ` Andrew Cooper
@ 2013-08-09 10:19       ` Zhang, Yang Z
  2013-08-09 10:20         ` Andrew Cooper
  2013-08-09 11:55         ` Jan Beulich
  0 siblings, 2 replies; 7+ messages in thread
From: Zhang, Yang Z @ 2013-08-09 10:19 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel@lists.xensource.com, JBeulich@suse.com

Andrew Cooper wrote on 2013-08-09:
> On 09/08/13 11:00, Zhang, Yang Z wrote:
>> -
>>> Unrelated whitespace alteration.
>> The whitespace is redundant. It is introduced by my previous patch
>> of
> enabling APIC-v, so I remove it here.
> 
> Then please correct your previous patch not to introduce it in the first place.
No, those patches already got applied in last year. Anyway, I can send out a separate patch to do this.

Best regards,
Yang

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

* Re: [PATCH] VMX, apicv: add boot parameter to enable/disable APIC-v dynamically
  2013-08-09 10:19       ` Zhang, Yang Z
@ 2013-08-09 10:20         ` Andrew Cooper
  2013-08-09 11:55         ` Jan Beulich
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Cooper @ 2013-08-09 10:20 UTC (permalink / raw)
  To: Zhang, Yang Z; +Cc: xen-devel@lists.xensource.com, JBeulich@suse.com

On 09/08/13 11:19, Zhang, Yang Z wrote:
> Andrew Cooper wrote on 2013-08-09:
>> On 09/08/13 11:00, Zhang, Yang Z wrote:
>>> -
>>>> Unrelated whitespace alteration.
>>> The whitespace is redundant. It is introduced by my previous patch
>>> of
>> enabling APIC-v, so I remove it here.
>>
>> Then please correct your previous patch not to introduce it in the first place.
> No, those patches already got applied in last year. Anyway, I can send out a separate patch to do this.
>
> Best regards,
> Yang
>
>

Ah ok.

~Andrew

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

* Re: [PATCH] VMX, apicv: add boot parameter to enable/disable APIC-v dynamically
  2013-08-09 10:19       ` Zhang, Yang Z
  2013-08-09 10:20         ` Andrew Cooper
@ 2013-08-09 11:55         ` Jan Beulich
  1 sibling, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2013-08-09 11:55 UTC (permalink / raw)
  To: Andrew Cooper, Yang Z Zhang; +Cc: xen-devel

>>> On 09.08.13 at 12:19, "Zhang, Yang Z" <yang.z.zhang@intel.com> wrote:
> Andrew Cooper wrote on 2013-08-09:
>> On 09/08/13 11:00, Zhang, Yang Z wrote:
>>> -
>>>> Unrelated whitespace alteration.
>>> The whitespace is redundant. It is introduced by my previous patch
>>> of
>> enabling APIC-v, so I remove it here.
>> 
>> Then please correct your previous patch not to introduce it in the first 
> place.
> No, those patches already got applied in last year. Anyway, I can send out a 
> separate patch to do this.

No, let's keep it here. The patch itself is simple enough to warrant
that cleanup being included.

Jan

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

end of thread, other threads:[~2013-08-09 11:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-09  9:01 [PATCH] VMX, apicv: add boot parameter to enable/disable APIC-v dynamically Yang Zhang
2013-08-09  9:42 ` Andrew Cooper
2013-08-09 10:00   ` Zhang, Yang Z
2013-08-09 10:07     ` Andrew Cooper
2013-08-09 10:19       ` Zhang, Yang Z
2013-08-09 10:20         ` Andrew Cooper
2013-08-09 11:55         ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).