From patchwork Fri Jan 28 15:30:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 537614 Delivered-To: patch@linaro.org Received: by 2002:adf:f849:0:0:0:0:0 with SMTP id d9csp756797wrq; Fri, 28 Jan 2022 08:36:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHOnblYeFakvkaVZX02fiZBEk55GNlY+JMEtk0zkWTt2DwdYOVodwMhuiZmT0qtFyxvkT8 X-Received: by 2002:aed:3071:: with SMTP id 104mr6802651qte.548.1643387787856; Fri, 28 Jan 2022 08:36:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643387787; cv=none; d=google.com; s=arc-20160816; b=It7BBU/F2GsLu8hZdoOTvqkwjn6vQEUh+XgHNjvZpAtw4LTrVVzpMtGfPZ7eVK9kXb UtM4xpPQtbXPbNYELsO3+Kkw5vOwoFb9tdv9NEZQhfenlE73nq/ITxOtOgBzdjuQGxzL GJqjX+bVI2N10x+UT1smGMaNxIhvVaWF2z5Nve/ZJsNL5+XSDgWvsj2Tqo2IQNJg82yg gBiXbISWExLcEBG614kcwBFJpt+QutPE8n/pq6RC+sC41HdrJiaMTh009ScGQAJpiMjA QsamTvLNx2Lx6YvNUf9/HQl8+yTg5A0VincCLlqG2cgigkOgVakTJx7yfIPefh/g0RdT evdQ== 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=GGXtm2CCFREumE88uavqGv2tctQ72q04jesCEJ5hOrc=; b=e0/cLuQaS3sFLe75Vhp8Dvlew4ooKG7HdlxEMOflivANZZGa0dL5riEWjZQ0zA5OyF Nv0K4efn7fBa5CpktrOPdTRR8yq7LA3d3avidrz/WA15HOblPCEhKenMfq6pyZcZY9Oe YIGh16xCnETJe1TDXyXjdMjMu3JJmkT07Yjl8+l5Q2I4AuSBOqGWd2C3xG16MKWbkQBr e/iclOQ7K94Y4fXwvmnO3JF7hquhX0usQfZgh+zq5X6xm09jgYqN0xUmtH2rWZfvHlhD K/ZSQPoth3voWUvsmZYKtOWWUAvsuItH+fk6izA+jIKb8X6DlCmgAM6K+KFwCGmbzK51 x8NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UXkE5MuO; 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 p6si3205454qtw.429.2022.01.28.08.36.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jan 2022 08:36:27 -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=UXkE5MuO; 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]:34342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDUEd-0004qL-6e for patch@linaro.org; Fri, 28 Jan 2022 11:36:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDTDM-0002Fl-He for qemu-devel@nongnu.org; Fri, 28 Jan 2022 10:31:06 -0500 Received: from [2a00:1450:4864:20::42a] (port=33703 helo=mail-wr1-x42a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDTDJ-0006QY-6I for qemu-devel@nongnu.org; Fri, 28 Jan 2022 10:31:04 -0500 Received: by mail-wr1-x42a.google.com with SMTP id e8so11670346wrc.0 for ; Fri, 28 Jan 2022 07:30:38 -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=GGXtm2CCFREumE88uavqGv2tctQ72q04jesCEJ5hOrc=; b=UXkE5MuOIxoS8ihBAvLOVlUGgUDilUovsl392icdr/SPZxapL3aT09oz7ch9tC6dio HmCEEXAX3XlC8fJ+7437fOPZcvsplUPng3Pz8xM16QeRwmaAJihJx46w5DSPIRUu1L9n JX9ZwQ8JQiCCgmIJG/CHHcd4JPLVLNsbM0wpkm0/ixsf6yMTZlVU+EKYkWbUW9TU+NZE CKH91/bjFlU98t/n/TkysEdeECkMB8p2a3vGXoxWbQeWs9kNHdPjlPWwHHk+HdaOS2e+ RKPyqBOElLf2TlcpvTbVgpOGnAlGUUgEKfdBzCA104KhyaeMLngQgJBlV4/zV6s6KLbE Zhaw== 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=GGXtm2CCFREumE88uavqGv2tctQ72q04jesCEJ5hOrc=; b=zxdVEmdZURpFcIH8Wg0BHiYV9ER/X+CRIN2Xvw1OKwkqQ9V7FzTnL9RQ3Vi0jahyF4 tDhWOnKnzHltuqjNM60VqrS0c0u7tL4ffvfR0qOezqhiPJBnpzBrtHfMtXKojdMiDYuJ 61DVQiZpCM9aa0skg5KaHcXjQNcSnu4qaSSiJsTTFa48KcWRLw8KxdugKKJUy8WXRPXx D1+kP+5G4SL9cd+hWL9lpMvL25NuCGDzoh8OT3c72rmMkUMn5/LuTWvUTdoscjoaLAaS 2MrvJtj4GjzN2MgNL9KfiYArISsmeLu7RFCoeTWFejkKUCAU13anAkt1/EL+SLsuk+F6 D7tg== X-Gm-Message-State: AOAM531k1KpItMho+9K0H/2i2qRUnIbnX/eE2UyO3dXYM/nBPJIon5WG fsi7STzCViImrbf2KPQWCvHfgMA5ieMkGw== X-Received: by 2002:adf:f006:: with SMTP id j6mr7365314wro.444.1643383837512; Fri, 28 Jan 2022 07:30:37 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id j3sm4749485wrb.57.2022.01.28.07.30.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 07:30:36 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 24/32] hw/intc/arm_gicv3_redist: Remove unnecessary zero checks Date: Fri, 28 Jan 2022 15:30:01 +0000 Message-Id: <20220128153009.2467560-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220128153009.2467560-1-peter.maydell@linaro.org> References: <20220128153009.2467560-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.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, T_SCC_BODY_TEXT_LINE=-0.01 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" The ITS-related parts of the redistributor code make some checks for whether registers like GICR_PROPBASER and GICR_PENDBASER are zero. There is no requirement in the specification for treating zeroes in these address registers specially -- they contain guest physical addresses and it is entirely valid (if unusual) for the guest to choose to put the tables they address at guest physical address zero. We use these values only to calculate guest addresses, and attempts by the guest to use a bad address will be handled by the address_space_* functions which we use to do the loads and stores. Remove the unnecessary checks. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20220122182444.724087-9-peter.maydell@linaro.org --- hw/intc/arm_gicv3_redist.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/intc/arm_gicv3_redist.c b/hw/intc/arm_gicv3_redist.c index 99b11ca5eee..d81d8e5f076 100644 --- a/hw/intc/arm_gicv3_redist.c +++ b/hw/intc/arm_gicv3_redist.c @@ -591,8 +591,7 @@ void gicv3_redist_update_lpi_only(GICv3CPUState *cs) idbits = MIN(FIELD_EX64(cs->gicr_propbaser, GICR_PROPBASER, IDBITS), GICD_TYPER_IDBITS); - if (!(cs->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) || !cs->gicr_propbaser || - !cs->gicr_pendbaser) { + if (!(cs->gicr_ctlr & GICR_CTLR_ENABLE_LPIS)) { return; } @@ -673,9 +672,8 @@ void gicv3_redist_process_lpi(GICv3CPUState *cs, int irq, int level) idbits = MIN(FIELD_EX64(cs->gicr_propbaser, GICR_PROPBASER, IDBITS), GICD_TYPER_IDBITS); - if (!(cs->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) || !cs->gicr_propbaser || - !cs->gicr_pendbaser || (irq > (1ULL << (idbits + 1)) - 1) || - irq < GICV3_LPI_INTID_START) { + if (!(cs->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) || + (irq > (1ULL << (idbits + 1)) - 1) || irq < GICV3_LPI_INTID_START) { return; }