From patchwork Sat Dec 11 19:11:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 523086 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp4114926imb; Sat, 11 Dec 2021 11:40:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMWIyD+iBV+kogdJz6OIhcZImCYeCe40R0qnu5ZYiJScW9L0kiEf2D/7lN8REbLrBo/TkD X-Received: by 2002:a05:622a:388:: with SMTP id j8mr34419454qtx.131.1639251639947; Sat, 11 Dec 2021 11:40:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639251639; cv=none; d=google.com; s=arc-20160816; b=ndea73yb3BKd3q2Iad1f4fqVkvYtaX8HMCDV1zRDiiysPk4dSEM8dRyfBJGF0cYc8x iMWxx+LwgDvqVEsRjLYotyWyeUu79z2TSKVpPVTZcBDvIfzhNp/axdSYvtmT9ONi5beQ cDOvKs2cIMyXeaGLOQGraje/haFA/qLGTtXJLC3TGNviJ/Tb8mtCI88dJwJuyYMPtaSd yh7KND7BOl/VQ3k9hUl/DrYoPd33Y6/SV+Khu+tnADg4Mtznnr0/gfvijNadgDPlJtkz xjizXNMc6I1Un0nPbUteMHgT9JHkOvk8LNkLZrKQtLXGGr60WvP4tyoPnE3KUMBO3rEi X/iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=nosYSlY6B8BjGiEgE79mxQI/EMOO+ggHFy7fpPzljqU=; b=cIdllep/HNI3eysy/5r6sq6GNy1fKAfPvs5kDeFkNQWVXsAVQ1rUW8RwUhcMS0av/4 6Yccyd2Jey5s2rkbU2icI0NoTa9AhCiDz7PxafcRusAPA3ukppod3JFhC1W9fXUpLHfM gft9oEAZNIz0eAkPeGvn22jSJK1oTOiMfC72ov2seFIuEFcRishWinUGI3QRozbMdPGI TuAeamigj5lF36RaUjxCf7LX9JOMeutXpO5+TghlXLC+94XR/iKD2LbjKb+56JX/3aH5 tBWgDh0ULN9AEh5A9WXLSiCf7g6/JOyc8gtx3wNujBLooGMvQHnv2r0X8tErsLHLRa2P LUSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ox7AOAvs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 13si6922036qvk.515.2021.12.11.11.40.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 Dec 2021 11:40:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ox7AOAvs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mw8EZ-0004bK-Da for patch@linaro.org; Sat, 11 Dec 2021 14:40:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw7mr-00052K-Nt for qemu-devel@nongnu.org; Sat, 11 Dec 2021 14:12:02 -0500 Received: from [2a00:1450:4864:20::430] (port=40947 helo=mail-wr1-x430.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mw7mo-0006I0-SB for qemu-devel@nongnu.org; Sat, 11 Dec 2021 14:12:01 -0500 Received: by mail-wr1-x430.google.com with SMTP id t9so20344801wrx.7 for ; Sat, 11 Dec 2021 11:11:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nosYSlY6B8BjGiEgE79mxQI/EMOO+ggHFy7fpPzljqU=; b=ox7AOAvscN3ZMdOx+B9sxNJnoafh7hnqLOj9MkCuC1sjg7QwHQPl5KTtKTcWTB6Kw8 K+Vx75qOkaL1NQhvwN0b8KZUViY8LOZhV2ZwQsziqNGVXRzs4MpxMHA8/wBs+bvcf0V6 UCc89V++XzXJRfkeemppb7onb42NBqrWoifFKq5i06BObNUcS+MDlG2t5CSGd4CNBmaE nzipY7BA6oA17n6PJEC34CfatrK/1pujVCiE0GT661kzXTHRb+E+BapojNNh605wKBdx p7LHSGOpjyCxx1Xl+7SPmjbVgFaFLxmZdflEuwoDrU9QdkVklX1fXdAIN6+efQClk8CX NhCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nosYSlY6B8BjGiEgE79mxQI/EMOO+ggHFy7fpPzljqU=; b=1lh5dKbNYRPOHzLF9jXICrUEoRGwP8wyJEeUKdqfW5b2eOpo6CzqgAFWlmfLJxwetd NlqlQ3xJk9xTUWvwvJRe01x/bL8L14UIvZfY8pdUJxtueRXFJvZWr+Co9MKURGO89mSE kWrUxcsyIqP/i9XYUF/YBs+P1C7E0AfCtHXuUoQbah7VFdVN8j8K4EjPvrWTVKAOkaEA 8RX7sQb2xzB08nQWv+oUM6btZCOwASB8wF30GLFBUsxPnp/Of4VlJGe1vaBc6ZpAtZZb 1YUNR3We2pOnCsgzJVt1Y50wNNYYgdUtdAtiZoOrUYrmCfUQEtTSXC3NJ59yHkKohGp+ d1lQ== X-Gm-Message-State: AOAM5306Re4oXki0w5VxOEI256quGMJLOJeVGTrT5/WZaw9Ztw5JPx7J JXmDtJ6amUNc3YEleHeNdZEoUg== X-Received: by 2002:a05:6000:1a48:: with SMTP id t8mr21587075wry.66.1639249915796; Sat, 11 Dec 2021 11:11:55 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id m20sm2205300wmq.11.2021.12.11.11.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Dec 2021 11:11:55 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 24/26] hw/intc/arm_gicv3_its: Fix return codes in process_mapc() Date: Sat, 11 Dec 2021 19:11:33 +0000 Message-Id: <20211211191135.1764649-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211211191135.1764649-1-peter.maydell@linaro.org> References: <20211211191135.1764649-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::430 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Shashi Mallela , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Fix process_mapc() to consistently return CMD_STALL for memory errors and CMD_CONTINUE for parameter errors, as we claim in the comments that we do. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée --- hw/intc/arm_gicv3_its.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/intc/arm_gicv3_its.c b/hw/intc/arm_gicv3_its.c index 5b25347de12..7615e9aa279 100644 --- a/hw/intc/arm_gicv3_its.c +++ b/hw/intc/arm_gicv3_its.c @@ -489,7 +489,6 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, uint32_t offset) uint64_t rdbase; bool valid; MemTxResult res = MEMTX_OK; - ItsCmdResult result = CMD_STALL; uint64_t value; offset += NUM_BYTES_IN_DW; @@ -499,7 +498,7 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, uint32_t offset) MEMTXATTRS_UNSPECIFIED, &res); if (res != MEMTX_OK) { - return result; + return CMD_STALL; } icid = value & ICID_MASK; @@ -518,11 +517,10 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, uint32_t offset) * we ignore this command and move onto the next * command in the queue */ - } else { - result = update_cte(s, icid, valid, rdbase) ? CMD_CONTINUE : CMD_STALL; + return CMD_CONTINUE; } - return result; + return update_cte(s, icid, valid, rdbase) ? CMD_CONTINUE : CMD_STALL; } static bool update_dte(GICv3ITSState *s, uint32_t devid, bool valid,