[{"id":1768241,"web_url":"http://patchwork.ozlabs.org/comment/1768241/","msgid":"<8cf54de7-a40d-dbed-b491-7cdf7f3b67ff@linaro.org>","list_archive_url":null,"date":"2017-09-13T23:25:26","subject":"Re: [Qemu-devel] [PATCH 04/19] nvic: Add cached vectpending_prio\n\tstate","submitter":{"id":72104,"url":"http://patchwork.ozlabs.org/api/people/72104/","name":"Richard Henderson","email":"richard.henderson@linaro.org"},"content":"On 09/12/2017 11:13 AM, Peter Maydell wrote:\n> Instead of looking up the pending priority\n> in nvic_pending_prio(), cache it in a new state struct\n> field. The calculation of the pending priority given\n> the interrupt number is more complicated in v8M with\n> the security extension, so the caching will be worthwhile.\n> \n> This changes nvic_pending_prio() from returning a full\n> (group + subpriority) priority value to returning a group\n> priority. This doesn't require changes to its callsites\n> because we use it only in comparisons of the form\n>   execution_prio > nvic_pending_prio()\n> and execution priority is always a group priority, so\n> a test (exec prio > full prio) is true if and only if\n> (execprio > group_prio).\n> \n> (Architecturally the expected comparison is with the\n> group priority for this sort of \"would we preempt\" test;\n> we were only doing a test with a full priority as an\n> optimisation to avoid the mask, which is possible\n> precisely because the two comparisons always give the\n> same answer.)\n> \n> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>\n> ---\n>  include/hw/intc/armv7m_nvic.h |  2 ++\n>  hw/intc/armv7m_nvic.c         | 23 +++++++++++++----------\n>  hw/intc/trace-events          |  2 +-\n>  3 files changed, 16 insertions(+), 11 deletions(-)\n\nReviewed-by: Richard Henderson <richard.henderson@linaro.org>\n\n\nr~","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"DBupNe3s\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsyTN2sbcz9t2h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 09:26:00 +1000 (AEST)","from localhost ([::1]:45015 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsH2c-0005CK-8L\n\tfor incoming@patchwork.ozlabs.org; Wed, 13 Sep 2017 19:25:58 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60900)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <richard.henderson@linaro.org>) id 1dsH2D-00058h-GY\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 19:25:34 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <richard.henderson@linaro.org>) id 1dsH2A-0002Ud-Ct\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 19:25:33 -0400","from mail-pg0-x22e.google.com ([2607:f8b0:400e:c05::22e]:44666)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <richard.henderson@linaro.org>)\n\tid 1dsH2A-0002U3-5x\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 19:25:30 -0400","by mail-pg0-x22e.google.com with SMTP id j16so3155194pga.1\n\tfor <qemu-devel@nongnu.org>; Wed, 13 Sep 2017 16:25:30 -0700 (PDT)","from bigtime.twiddle.net (97-126-103-167.tukw.qwest.net.\n\t[97.126.103.167]) by smtp.gmail.com with ESMTPSA id\n\tl15sm24328122pfk.44.2017.09.13.16.25.27\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 13 Sep 2017 16:25:28 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=ywPa2/mB6yartzmn8yx69ptHBofuI0WGo3kdMiZOJU4=;\n\tb=DBupNe3siQRrIZDtK7CxCw6PZr4VFkJYUtPONhJMioHmdsJIgbLTdlHs2SGGWYgQfr\n\tev1pcqE+HQEmgr8hlov7ORtH52WyFNzf7xi18DNJuEqXPKZqtfBJ2cZs3HslADu3PqoZ\n\tsCbGbrWPVMnu/qbofBT9NbnH3RU5K9iUuxVCM=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=ywPa2/mB6yartzmn8yx69ptHBofuI0WGo3kdMiZOJU4=;\n\tb=KHg7qEVKEF5vxen35MWaJq0S5fanX0bqtTdfFdVWbkxgNPEPTszLpc4GzlQoI5cEEY\n\tvU0bZ9yBAigTX5ubJUnO0bQw68klYgTfMSVdcpd/Qpbkyhqz7/4Lw9qnrKozTl7tTp62\n\tfGeolwiAnC4VOuyBGU7tInahr4+DO3EMtP3nh6gGKkYfTQ023glInSlE8fXKHi2zgtcY\n\t3kmkOlqNxxdTPQs4N90ZRPBUb6BlqPCvV8OC63Z6LwMWVovEBs70LpjrrW0TGj/glQ45\n\tDMdmXkzlQrDOzpQ9OVC8qM3jV28HgNt0AVsWRJjuOb7ino8xUS4g3/ldJtBRyQay67Vv\n\tH52A==","X-Gm-Message-State":"AHPjjUhhHKBfYsaSmrcRyby8coPq+o3bdcd6oG2IXNTrRsmgVjELAxDb\n\tCK1Ur7FzxKQZ34eF","X-Google-Smtp-Source":"ADKCNb5FX+aHH4tSze+B5OVIs/MAu7fQjCGd1dppaQZWdHmlTdUxa88wsBn6vzaT2+oznyHU2/FLRg==","X-Received":"by 10.99.96.140 with SMTP id u134mr18054892pgb.264.1505345129049;\n\tWed, 13 Sep 2017 16:25:29 -0700 (PDT)","To":"Peter Maydell <peter.maydell@linaro.org>, qemu-arm@nongnu.org,\n\tqemu-devel@nongnu.org","References":"<1505240046-11454-1-git-send-email-peter.maydell@linaro.org>\n\t<1505240046-11454-5-git-send-email-peter.maydell@linaro.org>","From":"Richard Henderson <richard.henderson@linaro.org>","Message-ID":"<8cf54de7-a40d-dbed-b491-7cdf7f3b67ff@linaro.org>","Date":"Wed, 13 Sep 2017 16:25:26 -0700","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<1505240046-11454-5-git-send-email-peter.maydell@linaro.org>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400e:c05::22e","Subject":"Re: [Qemu-devel] [PATCH 04/19] nvic: Add cached vectpending_prio\n\tstate","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"patches@linaro.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]