[Xen-devel] [PATCH] xen:arm: we never get into schedule_tail() with prev==current

Andrii Anisov posted 1 patch 10 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/1557309578-6436-1-git-send-email-andrii.anisov@gmail.com
xen/arch/arm/domain.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

[Xen-devel] [PATCH] xen:arm: we never get into schedule_tail() with prev==current

Posted by Andrii Anisov 10 weeks ago
From: Andrii Anisov <andrii_anisov@epam.com>

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.

Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
---
 xen/arch/arm/domain.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 6dc633e..721d40e 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -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);
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] xen:arm: we never get into schedule_tail() with prev==current

Posted by Dario Faggioli 10 weeks ago
On Wed, 2019-05-08 at 12:59 +0300, Andrii Anisov wrote:
> From: Andrii Anisov <andrii_anisov@epam.com>
> 
> 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.
> 
> Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
>
FWIW,

Reviewed-by: Dario Faggioli <dfaggioli@suse.com>

Thanks and Regards
-- 
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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH] xen:arm: we never get into schedule_tail() with prev==current

Posted by Julien Grall 8 weeks ago
Hi,

On 08/05/2019 12:25, Dario Faggioli wrote:
> On Wed, 2019-05-08 at 12:59 +0300, Andrii Anisov wrote:
>> From: Andrii Anisov <andrii_anisov@epam.com>
>>
>> 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.
>>
>> Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
>>
> FWIW,
> 
> Reviewed-by: Dario Faggioli <dfaggioli@suse.com>

Acked-by: Julien Grall <julien.grall@arm.com>

I have now committed the patch.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel