From nobody Thu Apr 10 03:30:31 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1642701567; cv=none; d=zohomail.com; s=zohoarc; b=dwrYr9JWSCw2Wv3esKoB5dNwj52QpNN0OX3qOh1X8+wtf5fgfRDL1FkSvtaObXcEkDHNVvziVBy27oo7q+IJfT9i2LhyDedE2sHnCE8bPVB/hUom2F5DQK7NWdN4iYktj5aj65nQA8iFF6ILiByAbClszhSqX+Atg2P9HyoA/L8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642701567; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hKLoZfUAnWxE8TsczUrRYAiB9/tCAzdNKRMombqtkAk=; b=YPImFb+QDyuLZg6Ec1tymixgSIcmW3VnHkATmFZh/QDadJNlwmoAvY5Wf42BxsRsKOfsUyRzw0vw5ert5+mnaX36Ma84CiyY+Zp14vIDqIIG/wCx+uxUjmFqN7mNujt0TUsi9nmFyWAGl0w14K12MK60/YPzvqBztTWfvREFu8I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642701567329131.48406670863505; Thu, 20 Jan 2022 09:59:27 -0800 (PST) Received: from localhost ([::1]:34184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAbiY-0001cg-Am for importer@patchew.org; Thu, 20 Jan 2022 12:59:26 -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) 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) 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-Google-Smtp-Source: ABdhPJxYLnWL3HVH30b7J/eKSmvG5UNgMqz7bsJCkh8o+QdAVZFtV83byb6gVSkJH37LOjh5mh5G8A== X-Received: by 2002:a05:6000:545:: with SMTP id b5mr33465532wrf.452.1642682227813; 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::335 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1642701569224100001 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=C3=A9e 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, uint= 32_t offset) uint64_t rdbase; bool valid; MemTxResult res =3D MEMTX_OK; - ItsCmdResult result =3D CMD_STALL; uint64_t value; =20 offset +=3D NUM_BYTES_IN_DW; @@ -501,7 +500,7 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, uint= 32_t offset) MEMTXATTRS_UNSPECIFIED, &res); =20 if (res !=3D MEMTX_OK) { - return result; + return CMD_STALL; } =20 icid =3D value & ICID_MASK; @@ -520,11 +519,10 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, ui= nt32_t offset) * we ignore this command and move onto the next * command in the queue */ - } else { - result =3D update_cte(s, icid, valid, rdbase) ? CMD_CONTINUE : CMD= _STALL; + return CMD_CONTINUE; } =20 - return result; + return update_cte(s, icid, valid, rdbase) ? CMD_CONTINUE : CMD_STALL; } =20 static bool update_dte(GICv3ITSState *s, uint32_t devid, bool valid, --=20 2.25.1