From patchwork Wed May 8 09:59:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 10934875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A25C713AD for ; Wed, 8 May 2019 10:01:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9289A288BC for ; Wed, 8 May 2019 10:01:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 853AC289F9; Wed, 8 May 2019 10:01:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 307CF288F8 for ; Wed, 8 May 2019 10:01:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOJMX-0005e6-BH; Wed, 08 May 2019 09:59:45 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOJMW-0005dv-KZ for xen-devel@lists.xen.org; Wed, 08 May 2019 09:59:44 +0000 X-Inumbo-ID: 0010a965-7178-11e9-843c-bc764e045a96 Received: from mail-lj1-x242.google.com (unknown [2a00:1450:4864:20::242]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 0010a965-7178-11e9-843c-bc764e045a96; Wed, 08 May 2019 09:59:43 +0000 (UTC) Received: by mail-lj1-x242.google.com with SMTP id e13so2341699ljl.11 for ; Wed, 08 May 2019 02:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ub7oPvhz5Sx32zhTP0sFlTWKTefTxr3drYY/p0XkoKg=; b=V9FtBmDiOIBMtybCvbmfqXYMvt2jWqTugD+mPOjjtkJ3R+DgDLB5G9TJnHSM5NrSar EIjgEBZZJu7kU/bs1n4CZIgK7oloz5pW2yUI8Av8Zg9cGnmFhD9FJflAULU/AQuy+cCG CK0JpXxUvDeXp4nU7rMQjFZLCxtYmFEqSspzWcULMt63I/pxdYOVO3TNNg5sxbCYiT1p XuZ2AN2PbOP3B4X8OEVnGaeIwJBYbHLZvKbqYywojRbtX6ebjcdnLK/QWvUhT57kzsaQ /YDJCBloRPMK1JeJgkCh6FmfK2hRnhMuhH45A4XXX1pdc/bXBFob3IVwdK8oQ3ARqoiW h0uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ub7oPvhz5Sx32zhTP0sFlTWKTefTxr3drYY/p0XkoKg=; b=id5Aa4XvjwrUQIlSgEwxqQt/jC53bcym0NW1pUBkH1uNO0EuKKE7Xh+7pWt1hGl0Ou wSy0uE8vwA94O+XHVMMLYmpX+uIoY+WYn4lXA7q0vK/OkdkVdVD5g1BChAfjbbs2l/Ny TP5kIjnkV0V6OyXXglUKD7JsD2XcBFkhtGMwwwhXx/6/cdAQV4fwDMKr7B0lzqxOUusF DpTSGzloZf1pjKPqcStPmZEeiBkODR3MFuaO08FFfuVYxIJwlG9/Lt6Je7BQdWsJ7/Zw Rr0BQViBqebKtuQSCdUQe6K/YdStL2ENCO3u9SjMHwldNZducu/r74A3HG+DG3OWOPnH dofw== X-Gm-Message-State: APjAAAXkODvYTSUMjRJbnF3XmWjyluc46QrifXezFJSK2diVnwsN+dg7 xGBtyDZcgcj44mJpTYEpNgu/K/bJTXU= X-Google-Smtp-Source: APXvYqykNxqbbMH8afa4aRzQyR8FV8CuF0npjZu0eg/E7GqRQpCSmR1ybj6TQFoYallsLDaeR4xV5w== X-Received: by 2002:a2e:7f12:: with SMTP id a18mr3473498ljd.144.1557309580986; Wed, 08 May 2019 02:59:40 -0700 (PDT) Received: from aanisov-work.kyiv.epam.com (ll-22.209.223.85.sovam.net.ua. [85.223.209.22]) by smtp.gmail.com with ESMTPSA id x2sm3779665ljx.13.2019.05.08.02.59.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 02:59:40 -0700 (PDT) From: Andrii Anisov To: xen-devel@lists.xen.org Date: Wed, 8 May 2019 12:59:38 +0300 Message-Id: <1557309578-6436-1-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Xen-devel] [PATCH] xen:arm: we never get into schedule_tail() with prev==current X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: xen-devel@lists.xenproject.org, Julien Grall , Stefano Stabellini , Andrii Anisov , Dario Faggioli MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Andrii Anisov 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 Reviewed-by: Dario Faggioli Acked-by: Julien Grall --- 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);