x86/HVM: Fix teardown ordering in hvm_vcpu_destroy()
PATCH v3 1/1 x86/HVM: Fix teardown ordering in hvm_vcpu_destroy()
The order of destroy function calls in hvm_vcpu_destroy() should be the reverse of init calls in hvm_vcpu_initialise().
---
Note: I separate this out from the previously sent AMD SVM AVIC patch series since this is a standalone fix.
xen/arch/x86/hvm/hvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
xen/arch/x86/hvm/hvm.c +3 -3
@@ -1610,13 +1610,13 @@ void hvm_vcpu_destroy(struct vcpu *v)free_compat_arg_xlat (v); -tasklet_kill (&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet); -hvm_vcpu_cacheattr_destroy (v); + hvm_funcs.vcpu_destroy (v);if (is_hvm_vcpu (v) )vlapic_destroy (v); - hvm_funcs.vcpu_destroy (v); +tasklet_kill (&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet); +hvm_vcpu_cacheattr_destroy (v); }void hvm_vcpu_down (struct vcpu *v)
Signature · 7 lines
1.9.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 8 lines · Suravee Suthikulpanit
The order of destroy function calls in
hvm_vcpu_destroy()should be the reverse of init calls inhvm_vcpu_initialise().Signed-off-by Suravee Suthikulpanit <[email protected]>Reviewed-by Konrad Rzeszutek Wilk <[email protected]>Reviewed-by Kevin Tian <[email protected]>Cc Jan Beulich <[email protected]>Cc Boris Ostrovsky <[email protected]>
Quoted 18 lines
---
Note: I separate this out from the previously sent AMD SVM AVIC patch series since this is a standalone fix.xen/arch/x86/hvm/hvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)xen/arch/x86/hvm/hvm.c +1
-2@@ -1610,13 +1610,13 @@ void hvm_vcpu_destroy(struct vcpu *v)free_compat_arg_xlat (v); -tasklet_kill (&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet); -hvm_vcpu_cacheattr_destroy (v); + hvm_funcs.vcpu_destroy (v);
xen/arch/x86/hvm/hvm.c void hvm_vcpu_destroy(struct vcpu *v) · line 1622
Quoted 10 lines
xen/arch/x86/hvm/hvm.c +2
-1if (is_hvm_vcpu (v) )vlapic_destroy (v); - hvm_funcs.vcpu_destroy (v); +tasklet_kill (&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet); +hvm_vcpu_cacheattr_destroy (v); }void hvm_vcpu_down (struct vcpu *v)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 10 lines · Andrew Cooper
Quoted 8 lines · Suravee Suthikulpanit
The order of destroy function calls in
hvm_vcpu_destroy()should be the reverse of init calls inhvm_vcpu_initialise().Signed-off-by Suravee Suthikulpanit <[email protected]>Reviewed-by Konrad Rzeszutek Wilk <[email protected]>Reviewed-by Kevin Tian <[email protected]>Cc Jan Beulich <[email protected]>Cc Boris Ostrovsky <[email protected]>Reviewed-by Andrew Cooper <[email protected]> and queued.
Wait no.
The order in vcpu_initialise is
hvm_vcpu_cacheattr_init()vlapic_init()hvm_funcs.vcpu_initialise()softirq_tasklet_init()setup_compat_arg_xlat()
Therefore, moving the tasklet_kill() is wrong.
The overall delta should be:
andrewcoop@andrewcoop:/local/xen.git/xen$ git diff HEAD^
xen/arch/x86/hvm/hvm.c +2 -2
@@ -1626,12 +1626,12 @@ void hvm_vcpu_destroy(struct vcpu *v)free_compat_arg_xlat (v);tasklet_kill (&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet); -hvm_vcpu_cacheattr_destroy (v); + hvm_funcs.vcpu_destroy (v);if (is_hvm_vcpu (v) )vlapic_destroy (v); - hvm_funcs.vcpu_destroy (v); +hvm_vcpu_cacheattr_destroy (v); }
IIRC.
If you agree, I will fold this correction in while committing.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Jan Beulich
Reviewed-byQuoted 6 lines
Quoted 1 line
Quoted 1 line · On 10.01.17 at 15:26, <[email protected]> wrote:
Quoted 4 lines · Andrew Cooper
Quoted 3 lines · Suravee Suthikulpanit
The order of destroy function calls in
hvm_vcpu_destroy()should be the reverse of init calls inhvm_vcpu_initialise().
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Signed-off-by Suravee Suthikulpanit <[email protected]>Reviewed-by Konrad Rzeszutek Wilk <[email protected]>Reviewed-by Kevin Tian <[email protected]>Cc Jan Beulich <[email protected]>Cc Boris Ostrovsky <[email protected]>Reviewed-by Andrew Cooper <[email protected]> and queued.Wait no.
Which clearly suggests that the earlier R-b-s should have been dropped too.
Quoted 30 lines
The order in
vcpu_initialiseis
hvm_vcpu_cacheattr_init()vlapic_init()hvm_funcs.vcpu_initialise()softirq_tasklet_init()setup_compat_arg_xlat()Therefore, moving the
tasklet_kill()is wrong.The overall delta should be:
xen/arch/x86/hvm/hvm.c +2
-2@@ -1626,12 +1626,12 @@ void hvm_vcpu_destroy(struct vcpu *v)free_compat_arg_xlat (v);tasklet_kill (&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet); -hvm_vcpu_cacheattr_destroy (v); + hvm_funcs.vcpu_destroy (v);if (is_hvm_vcpu (v) )vlapic_destroy (v); - hvm_funcs.vcpu_destroy (v); +hvm_vcpu_cacheattr_destroy (v); }IIRC.
Quoted 1 line
If you agree, I will fold this correction in while committing.
This variant is
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 49 lines
From: Jan Beulich [mailto:[email protected]]
Sent: Tuesday, January 10, 2017 10:42 PMQuoted 6 lines
Quoted 1 line
Quoted 1 line · On 10.01.17 at 15:26, <[email protected]> wrote:
Quoted 4 lines · Andrew Cooper
Quoted 3 lines · Suravee Suthikulpanit
The order of destroy function calls in
hvm_vcpu_destroy()should be the reverse of init calls inhvm_vcpu_initialise().Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Signed-off-by Suravee Suthikulpanit <[email protected]>Reviewed-by Konrad Rzeszutek Wilk <[email protected]>Reviewed-by Kevin Tian <[email protected]>Cc Jan Beulich <[email protected]>Cc Boris Ostrovsky <[email protected]>Reviewed-by Andrew Cooper <[email protected]> and queued.Wait no.
Which clearly suggests that the earlier R-b-s should have been dropped too.
Quoted 28 lines
The order in
vcpu_initialiseis
hvm_vcpu_cacheattr_init()vlapic_init()hvm_funcs.vcpu_initialise()softirq_tasklet_init()setup_compat_arg_xlat()Therefore, moving the
tasklet_kill()is wrong.The overall delta should be:
xen/arch/x86/hvm/hvm.c +2
-2@@ -1626,12 +1626,12 @@ void hvm_vcpu_destroy(struct vcpu *v)free_compat_arg_xlat (v);tasklet_kill (&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet); -hvm_vcpu_cacheattr_destroy (v); + hvm_funcs.vcpu_destroy (v);if (is_hvm_vcpu (v) )vlapic_destroy (v); - hvm_funcs.vcpu_destroy (v); +hvm_vcpu_cacheattr_destroy (v); }
Quoted 8 lines
Quoted 3 lines
IIRC.
If you agree, I will fold this correction in while committing.
This variant is
Reviewed-by Jan Beulich <[email protected]>Jan
here is my updated Reviewed-by: Kevin Tian <[email protected]> with Andrew's change.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 47 lines · Andrew Cooper
Quoted 10 lines · Andrew Cooper
Quoted 8 lines · Suravee Suthikulpanit
The order of destroy function calls in
hvm_vcpu_destroy()should be the reverse of init calls inhvm_vcpu_initialise().Signed-off-by Suravee Suthikulpanit <[email protected]>Reviewed-by Konrad Rzeszutek Wilk <[email protected]>Reviewed-by Kevin Tian <[email protected]>Cc Jan Beulich <[email protected]>Cc Boris Ostrovsky <[email protected]>Reviewed-by Andrew Cooper <[email protected]> and queued.Wait no.
The order in
vcpu_initialiseis
hvm_vcpu_cacheattr_init()vlapic_init()hvm_funcs.vcpu_initialise()softirq_tasklet_init()setup_compat_arg_xlat()Therefore, moving the
tasklet_kill()is wrong.The overall delta should be:
andrewcoop@andrewcoop:/local/xen.git/xen$ git diff HEAD^xen/arch/x86/hvm/hvm.c +2
-2@@ -1626,12 +1626,12 @@ void hvm_vcpu_destroy(struct vcpu *v)free_compat_arg_xlat (v);tasklet_kill (&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet); -hvm_vcpu_cacheattr_destroy (v); + hvm_funcs.vcpu_destroy (v);if (is_hvm_vcpu (v) )vlapic_destroy (v); - hvm_funcs.vcpu_destroy (v); +hvm_vcpu_cacheattr_destroy (v); }IIRC.
Quoted 4 lines
If you agree, I will fold this correction in while committing.
~Andrew
Ah, right... sorry I missed the tasklet stuff.
Thanks,
Suravee
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel