From patchwork Tue Jan 11 17:10:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 531131 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp3695159imp; Tue, 11 Jan 2022 09:48:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvXNdFnDEsfLW/VOhPd+LxW68+7r1tOSNiqKTa24mSjodoY/9BfNNA7ZnCRCqoOUxsOhzt X-Received: by 2002:a05:6e02:1a0a:: with SMTP id s10mr3177788ild.217.1641923301511; Tue, 11 Jan 2022 09:48:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641923301; cv=none; d=google.com; s=arc-20160816; b=oA0hwj4VRMHFQyYChZfq4f+UOnPlBeh1jxjE0b+TyRhZjs6GdMkTrp39TBJ6yjIyO+ DuiNtA/2Q8I4wrUolFxZCPNJ4HaaXf5ZveMO0//nUG091TdL1Q+3uoMQX0VtAzllZlPI j8C6+zRWdlu5F3cstUrkVJliA1ezLNhQoa2W/oSdYOhc6O9e3+F7USoFdPEz4A8qkZ0n Ve6BwGXyk5322CoyUbUalPt2gQG84Obg1sUVWtbsaS7/It/ZsvHvzD9rP9X/JLdaBb0x n235YK/l3hRBGx6ZlH+eaaOZGZg3PIeJNk3FeGnLnezeAL1HBBrHPql/T0TM6xx7DsaR OH1Q== 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=M+19OihughmoJEL8u1lX7s3OdjR7r5E5GvgmNdTNC5k=; b=lNt6LeV+UnHOtlKXcmICTAbC3QG9KKb8hNDHouxNp2puflkUexQZXVziArszSmtAlS fLTu4etFjtW3ycjlJRrLb0oj+tcrwYMKXc92pe+J+jML8MDSDXcZ66FPHfqLh+xLXt2A Do5j5maMfNNfcmrhbm5HcaXZaQ7xNzbfVqE8g8zvl8DCBOz7kHEw/cpult3YIGvdphAZ Pwux6lzBglAG2fjSjmBjsP9oEvj9Mxl5Md0xzYSKfSy1BpdvOyC98i8pRbaAKBwlnluz 5scsAHedCkhFWhU7Bd2HPEVnSqFYmKtT8V49JNqRUmpf0COi3y5/3UYS4mRc0Z7QuU6V hL9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NcnspWi5; 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 w8si2778137ilq.71.2022.01.11.09.48.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jan 2022 09:48:21 -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=NcnspWi5; 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]:49146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7LFs-0003gx-Sy for patch@linaro.org; Tue, 11 Jan 2022 12:48:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7Kfn-0005D5-NM for qemu-devel@nongnu.org; Tue, 11 Jan 2022 12:11:08 -0500 Received: from [2a00:1450:4864:20::432] (port=34634 helo=mail-wr1-x432.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n7Kfl-0007KB-9z for qemu-devel@nongnu.org; Tue, 11 Jan 2022 12:11:03 -0500 Received: by mail-wr1-x432.google.com with SMTP id h10so24085531wrb.1 for ; Tue, 11 Jan 2022 09:10:59 -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=M+19OihughmoJEL8u1lX7s3OdjR7r5E5GvgmNdTNC5k=; b=NcnspWi5FCgsfZ0IvLq/25en3LBApDx+u0lRl8aY8aUxyLL+QdyZKubivzOt5frFUq Uk+lrymARDw+sCAmIahgrzWmptzHJoMfwdbLdRYtLdmfDoh3enkZgrQM5+SGIeyXxtq1 P8+lhwepXlXno9Ku6d3+WN1u1AJE7ZxU198Ug047AdyUEaKxg6cSJo1arC7MtGLbkBbz 4SrapmHJxM3YY2ex1ck34Egxjxfaoz+mGvvsxG0DyZ2QagP/m/NZkoXFAVLnEc40gMI8 +GSr4IZSa7SoHnJMa9XS6d0VjOCCnlGO17bzH5oE6u59IjyzRjT1F9ve+muZZ+grWkZp ztrQ== 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=M+19OihughmoJEL8u1lX7s3OdjR7r5E5GvgmNdTNC5k=; b=xAUR6wGNybt6GguB4bcYHM/D4O0RfEbNoOemK6yIa26rBb/ayxg2nYNZn3NlOlTFEH UQS05gq20BV1nWc5I2bWeQmlgGBoGgJXjQ7P1mx7Nj3jCIQFb69ZCwIM4IKKcq0IU1wB ho/MfKTEGlGuYqeqxhZykgmzVw1Hm+lNK2xL9eLOWOzDsAP/ZFDLyggg7+MqwrT8WRJJ LLRz23o6LKhMXET3nQPlu2/8nlcal5dEigmtqc3/l7ccgW2ZX97fW5fCLbxunvzUZlTh dlSyxZsIhh+lKL4+v9pd/Cwu7dfAyhoYhs7FITuY62QUEvqHC4ZL4Vip3d51427/IZ4I YBEg== X-Gm-Message-State: AOAM531cn808axngxTBaiepRoukqcpS7Hd66Gd2Ge/ga5fH5BKXTnduW ypahwPwSvSfO9A5P4QikgbNRqQ== X-Received: by 2002:a05:6000:15cd:: with SMTP id y13mr4763157wry.28.1641921057153; Tue, 11 Jan 2022 09:10:57 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id c7sm11157941wri.21.2022.01.11.09.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 09:10:56 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 09/13] hw/intc/arm_gicv3_its: Fix return codes in process_mapc() Date: Tue, 11 Jan 2022 17:10:44 +0000 Message-Id: <20220111171048.3545974-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220111171048.3545974-1-peter.maydell@linaro.org> References: <20220111171048.3545974-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::432 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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: Alex Bennée Reviewed-by: Richard Henderson --- 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 010779a9fdc..80ef4dbcadf 100644 --- a/hw/intc/arm_gicv3_its.c +++ b/hw/intc/arm_gicv3_its.c @@ -491,7 +491,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; @@ -501,7 +500,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; @@ -520,11 +519,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,