Skip to contentSkip to conversation

xen:arm: we never get into schedule_tail() with prev==current

PATCH In review Andrii Anisov 3 participants 3 messages May 8, 2019 – May 16, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen:arm: we never get into schedule_tail() with prev==current

From: Andrii Anisov <[email protected]>

ARM's schedule_tail() is called from two places: context_switch() and continue_new_vcpu(). Both functions are always called with prev!=current. So replace the correspondent check in schedule_tail() with ASSERT() which is the development (debug) build guard.

---
 xen/arch/arm/domain.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
xen/arch/arm/domain.c +3 -2
index 6dc633e..721d40e 100644
@@ -305,6 +305,8 @@ static void update_runstate_area(struct vcpu *v)
 
 static void schedule_tail(struct vcpu *prev)
 {
+    ASSERT(prev != current);
+
     ctxt_switch_from(prev);
 
     ctxt_switch_to(current);
@@ -313,8 +315,7 @@ static void schedule_tail(struct vcpu *prev)
 
     context_saved(prev);
 
-    if ( prev != current )
-        update_runstate_area(current);
+    update_runstate_area(current);
 
     /* Ensure that the vcpu has an up-to-date time base. */
     update_vcpu_system_time(current);
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Andrii Anisov

From: Andrii Anisov <[email protected]>

ARM's schedule_tail() is called from two places: context_switch() and continue_new_vcpu(). Both functions are always called with prev!=current. So replace the correspondent check in schedule_tail() with ASSERT() which is the development (debug) build guard.

FWIW,

Thanks and Regards

Signature · 6 lines
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by
#2 lore raw

Hi,

Quoted 8 lines · Dario Faggioli
Quoted 7 lines · Andrii Anisov

From: Andrii Anisov <[email protected]>

ARM's schedule_tail() is called from two places: context_switch() and continue_new_vcpu(). Both functions are always called with prev!=current. So replace the correspondent check in schedule_tail() with ASSERT() which is the development (debug) build guard.

Quoted 5 lines
Quoted 2 lines

FWIW,

I have now committed the patch.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel