From patchwork Thu Jan 20 12:36:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 533574 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp24599imr; Thu, 20 Jan 2022 09:58:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1lFpALDMuaTuTTh1odcjbv4vNPa8R6ehXPY1zrsim7cjPPTQcFUwpduSKTuMCv2EmXtRC X-Received: by 2002:a05:6902:10c2:: with SMTP id w2mr335581ybu.250.1642701512975; Thu, 20 Jan 2022 09:58:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642701512; cv=none; d=google.com; s=arc-20160816; b=BDQmwNz493n6I8BYoZ0m83VZocBumzGEFDKT1W/wKOuBndKL5mQMeK3WfOv1YFtfKu NhzFkHv9mJmEbo91KuJzpyLDRNNPy5rMa5udu8LSLIvEyN3YQmE0VRxDE1yunKi9J7VF gn0P2rbE/jH22pDlIowyrjn+5H3xgzLLcX1eIpJQRf3UNmgXn8CgXJvWTUsQ1ugYXxaw 07Ev/kBH0JwsX+KMttn28wA8YmsYyNTDA2LwbmT6kKoSiOLNuXKKnZNKHDF0rYUJwDa+ ZkQyiYHsifIeZuKf4yhPsdqP8XUT8FepBW0k5zxAny2cuNuAzVgXiCcVbmxEndGAMUZ0 W0+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=hKLoZfUAnWxE8TsczUrRYAiB9/tCAzdNKRMombqtkAk=; b=xw3JtaoyBcW11y2N3+fhBusdSqNAvkyCI5cDzlboyll+FxLA+vx4yONId32nJ+jImf wJaicRDTwk9fpuEsSleH+j1doknILpeWr6bx5j7CjFptd6WGasLjZ/0VYdz8iL0xhS34 avekUAgt0AAxV1o57WKNOTk8oTmQ5NFrkZr5Zt7+pCbYSxKSq6VShXKo17EwpxqTHRGi cszbtjnrH6jKWD20pJNE+00XJBCWl4HkKLMvQ3lBf/q53ogtD7UvrkxlPim4Al/B1R1S Ie7nS0oUe2CiJTVoWVu/iOzk+Mnhj/S1KNnojDrkDcvFnQ3mEMJ2nGyjTOPaF8rlTODC w+qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aPxWUZYE; 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=pass (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 o3si5647294ybu.625.2022.01.20.09.58.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Jan 2022 09:58:32 -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=pass header.i=@linaro.org header.s=google header.b=aPxWUZYE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAbhg-0007Fc-8E for patch@linaro.org; Thu, 20 Jan 2022 12:58:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAWgm-0004Jn-0f for qemu-devel@nongnu.org; Thu, 20 Jan 2022 07:37:16 -0500 Received: from [2a00:1450:4864:20::335] (port=43653 helo=mail-wm1-x335.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAWgi-0003Jo-4F for qemu-devel@nongnu.org; Thu, 20 Jan 2022 07:37:15 -0500 Received: by mail-wm1-x335.google.com with SMTP id e9-20020a05600c4e4900b0034d23cae3f0so13401035wmq.2 for ; Thu, 20 Jan 2022 04:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=hKLoZfUAnWxE8TsczUrRYAiB9/tCAzdNKRMombqtkAk=; b=aPxWUZYE9xUp7qMR8wlmSO2tTkTwNauiaKSCkUoihG+7bZlE8FwmRs6R8Vh7Gby76G mFeSYabYZUZu0oDfUo9beu2yZi5/dWfQj6At084OyE4d3QuFTYDRo8o9dxrVvqs5b+aI bqUkANVC2jv/WUmlcbUMMvz1jvNZs08Wehca4OkbuZHgKewuxSLEBspJkzXTKDB9NXww zmtR2LBH8xHjZxV2OILraXJ6wppk8OkBbgcI1TQOorM+f2CF/O0Dvwp5GxP8I98palJv tXjNhHN8aCeapn5b8Pzicb686l9TO8Ejnzd+vINc65NZZKHHrzXBDflWXV5p2sisOiNT NrGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hKLoZfUAnWxE8TsczUrRYAiB9/tCAzdNKRMombqtkAk=; b=EIXf4BcJEPxYTgV8WYHTyT/U04e4qqpRlXuBaSG6ztyt4aTjgPm6nXKTNykrQcYO/H nwO9qQvo20oFa0sPb4Q1oDE7f6n6xRQa+ymesXJ0y8oimwOr8zwTBUBTLT+j6USjXjiD ktw1mpbQkQ37yqWPNU+oSJZ3ZLSSx6LYBTq25/ygp1EnxBvc48K434e65iHeVjuco+IU WuYXoUwscM9M3eBUti6VPGKLlRMCmpBHosAPvNvxCKyLaymhZulBz44oTQA+rwOo2CB/ sKLrQgbOfGbnEXg6NRdydZDTRlliq7VI/L5ZHOwT7g7Qv9lXD75IxvfQp3NUc3SUDI9l NPNg== X-Gm-Message-State: AOAM531UWupvfYA+jjmfrJdVKDJFCgPV4mzIPAYxMMgBBrA09RwYNwmz zKQjXZ0oMWHHBVOeD1qXYgPI6nKJRLffvw== X-Received: by 2002:a05:6000:545:: with SMTP id b5mr33465532wrf.452.1642682227813; Thu, 20 Jan 2022 04:37:07 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id t8sm7993324wmq.43.2022.01.20.04.37.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 04:37:07 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 33/38] hw/intc/arm_gicv3_its: Fix return codes in process_mapc() Date: Thu, 20 Jan 2022 12:36:25 +0000 Message-Id: <20220120123630.267975-34-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220120123630.267975-1-peter.maydell@linaro.org> References: <20220120123630.267975-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::335 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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, PDS_HP_HELO_NORDNS=0.001, 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: , 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 Message-id: 20220111171048.3545974-10-peter.maydell@linaro.org --- 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,