* [PATCH v2] sync CPU state upon final domain destruction
@ 2017-11-22 12:39 Jan Beulich
2017-11-22 12:54 ` Andrew Cooper
2017-11-22 13:00 ` Jan Beulich
0 siblings, 2 replies; 4+ messages in thread
From: Jan Beulich @ 2017-11-22 12:39 UTC (permalink / raw)
To: xen-devel
Cc: Sergey Dyasli, Stefano Stabellini, Wei Liu, Igor Druzhinin,
George Dunlap, Andrew Cooper, Konrad Rzeszutek Wilk, Ian Jackson,
Tim Deegan, Dario Faggioli
See the code comment being added for why we need this.
This is being placed here to balance between the desire to prevent
future similar issues (the risk of which would grow if it was put
further down the call stack, e.g. in vmx_vcpu_destroy()) and the
intention to limit the performance impact (otherwise it could also go
into rcu_do_batch(), paralleling the use in do_tasklet_work()).
Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Move from vmx_vcpu_destroy() to complete_domain_destroy().
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -794,6 +794,14 @@ static void complete_domain_destroy(stru
struct vcpu *v;
int i;
+ /*
+ * Flush all state for the vCPU previously having run on the current CPU.
+ * This is in particular relevant for x86 HVM ones on VMX, so that this
+ * flushing of state won't happen from the TLB flush IPI handler behind
+ * the back of a vmx_vmcs_enter() / vmx_vmcs_exit() section.
+ */
+ sync_local_execstate();
+
for ( i = d->max_vcpus - 1; i >= 0; i-- )
{
if ( (v = d->vcpu[i]) == NULL )
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] sync CPU state upon final domain destruction
2017-11-22 12:39 [PATCH v2] sync CPU state upon final domain destruction Jan Beulich
@ 2017-11-22 12:54 ` Andrew Cooper
2017-11-22 13:00 ` Jan Beulich
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Cooper @ 2017-11-22 12:54 UTC (permalink / raw)
To: Jan Beulich, xen-devel
Cc: Igor Druzhinin, Stefano Stabellini, Wei Liu, Sergey Dyasli,
George Dunlap, Tim Deegan, Konrad Rzeszutek Wilk, Ian Jackson,
Dario Faggioli
On 22/11/17 12:39, Jan Beulich wrote:
> See the code comment being added for why we need this.
>
> This is being placed here to balance between the desire to prevent
> future similar issues (the risk of which would grow if it was put
> further down the call stack, e.g. in vmx_vcpu_destroy()) and the
> intention to limit the performance impact (otherwise it could also go
> into rcu_do_batch(), paralleling the use in do_tasklet_work()).
>
> Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> v2: Move from vmx_vcpu_destroy() to complete_domain_destroy().
>
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -794,6 +794,14 @@ static void complete_domain_destroy(stru
> struct vcpu *v;
> int i;
>
> + /*
> + * Flush all state for the vCPU previously having run on the current CPU.
> + * This is in particular relevant for x86 HVM ones on VMX, so that this
> + * flushing of state won't happen from the TLB flush IPI handler behind
> + * the back of a vmx_vmcs_enter() / vmx_vmcs_exit() section.
> + */
> + sync_local_execstate();
> +
> for ( i = d->max_vcpus - 1; i >= 0; i-- )
> {
> if ( (v = d->vcpu[i]) == NULL )
>
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] sync CPU state upon final domain destruction
2017-11-22 12:39 [PATCH v2] sync CPU state upon final domain destruction Jan Beulich
2017-11-22 12:54 ` Andrew Cooper
@ 2017-11-22 13:00 ` Jan Beulich
2017-11-22 16:04 ` Julien Grall
1 sibling, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2017-11-22 13:00 UTC (permalink / raw)
To: Julien Grall
Cc: Sergey Dyasli, Stefano Stabellini, Wei Liu, Igor Druzhinin,
George Dunlap, Andrew Cooper, Konrad Rzeszutek Wilk, Ian Jackson,
Tim Deegan, Dario Faggioli, xen-devel
>>> On 22.11.17 at 13:39, <JBeulich@suse.com> wrote:
> See the code comment being added for why we need this.
>
> This is being placed here to balance between the desire to prevent
> future similar issues (the risk of which would grow if it was put
> further down the call stack, e.g. in vmx_vcpu_destroy()) and the
> intention to limit the performance impact (otherwise it could also go
> into rcu_do_batch(), paralleling the use in do_tasklet_work()).
>
> Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
I'm sorry, Julien, I did forget to Cc you (for 4.10 inclusion).
> ---
> v2: Move from vmx_vcpu_destroy() to complete_domain_destroy().
>
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -794,6 +794,14 @@ static void complete_domain_destroy(stru
> struct vcpu *v;
> int i;
>
> + /*
> + * Flush all state for the vCPU previously having run on the current CPU.
> + * This is in particular relevant for x86 HVM ones on VMX, so that this
> + * flushing of state won't happen from the TLB flush IPI handler behind
> + * the back of a vmx_vmcs_enter() / vmx_vmcs_exit() section.
> + */
> + sync_local_execstate();
> +
> for ( i = d->max_vcpus - 1; i >= 0; i-- )
> {
> if ( (v = d->vcpu[i]) == NULL )
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2] sync CPU state upon final domain destruction
2017-11-22 13:00 ` Jan Beulich
@ 2017-11-22 16:04 ` Julien Grall
0 siblings, 0 replies; 4+ messages in thread
From: Julien Grall @ 2017-11-22 16:04 UTC (permalink / raw)
To: Jan Beulich, Julien Grall
Cc: Sergey Dyasli, Stefano Stabellini, Wei Liu, Igor Druzhinin,
George Dunlap, Andrew Cooper, Konrad Rzeszutek Wilk, Ian Jackson,
Tim Deegan, Dario Faggioli, xen-devel
Hi,
On 11/22/2017 01:00 PM, Jan Beulich wrote:
>>>> On 22.11.17 at 13:39, <JBeulich@suse.com> wrote:
>> See the code comment being added for why we need this.
>>
>> This is being placed here to balance between the desire to prevent
>> future similar issues (the risk of which would grow if it was put
>> further down the call stack, e.g. in vmx_vcpu_destroy()) and the
>> intention to limit the performance impact (otherwise it could also go
>> into rcu_do_batch(), paralleling the use in do_tasklet_work()).
>>
>> Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> I'm sorry, Julien, I did forget to Cc you (for 4.10 inclusion).
Release-acked-by: Julien Grall <julien.grall@linaro.org>
Cheers,
>
>> ---
>> v2: Move from vmx_vcpu_destroy() to complete_domain_destroy().
>>
>> --- a/xen/common/domain.c
>> +++ b/xen/common/domain.c
>> @@ -794,6 +794,14 @@ static void complete_domain_destroy(stru
>> struct vcpu *v;
>> int i;
>>
>> + /*
>> + * Flush all state for the vCPU previously having run on the current CPU.
>> + * This is in particular relevant for x86 HVM ones on VMX, so that this
>> + * flushing of state won't happen from the TLB flush IPI handler behind
>> + * the back of a vmx_vmcs_enter() / vmx_vmcs_exit() section.
>> + */
>> + sync_local_execstate();
>> +
>> for ( i = d->max_vcpus - 1; i >= 0; i-- )
>> {
>> if ( (v = d->vcpu[i]) == NULL )
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-11-22 16:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-22 12:39 [PATCH v2] sync CPU state upon final domain destruction Jan Beulich
2017-11-22 12:54 ` Andrew Cooper
2017-11-22 13:00 ` Jan Beulich
2017-11-22 16:04 ` Julien Grall
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).