From patchwork Sat Dec 11 19:11:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 523069 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp4095485imb; Sat, 11 Dec 2021 11:13:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxe+WhyM2m+dhlgthk3xz3V1Vw93veUPU6gWu9TaPwXc1VwlCd1EYJeTC0OTdxyBS1LIWPH X-Received: by 2002:a05:622a:19aa:: with SMTP id u42mr35294876qtc.443.1639250035166; Sat, 11 Dec 2021 11:13:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639250035; cv=none; d=google.com; s=arc-20160816; b=WVfWD/4YA6hMDXrwgMfba0l/bottWYtRQs6ls/zyrsIRFfRvVMdkRlWBIk9pHPHBU2 4eh0tkw81mr+2BUTdQPm7FFgGhf72A2cHppc+0hI+Y1Gs3N1791OZopJPwQVgB2qYlVc MbrVZ+kz5tTdq0mtaXnbW933FXhTpNIW4zCSERRFXtSe2zUcx3f2THxrM+4RntX2ulXF ZCqYKPJWtnpEY/3assYxMvWaSB7IVXEhcUYEOTN68TdLUXTw1aWZ3imdDUrcFCmYVjdm rAYwqjuHIv2f9vTnUMBVpGGjGmBKThfPbljuhkVzFbrhsZgemJ6ZIAk5z7pFI4QhyEp/ kthA== 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/WoaEcAXkHQDQGnYA2VaWKRKb5cvTpqbwK+SMbmTCw=; b=oRWvbsaGcGCEYJ+u2u3vmL74PM4Ak611C9CDbwiiifgj5QRzIjP1kSMoxvLM/VJ3tg 2WYHJH16cEVyOZb2PPkYfS5ndO+g9EEFW4NqFXsSqkFRdhCM+70YFXXVyR1w2hBfWs3K z8nOkkvkeoKkajLJA9IJSolG37lT0KKtHAeExPFlPWzRkEZ6NuqVtKBRFlQZXgNJHSF2 vFVNFjzp9FTnuwa379HYmemF8rMlpUOdBiP8jI/15BoECBvP/RAWLENMMUkxrFbhXCl/ VIMmZm+C71U8D8X2tqUDKIFotIzGzabAXi83rE27WdPrZBRxMMIFLn0DVzgCjRQBSVXX fybg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=h3Ph0Dfw; 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 t5si6836112qta.232.2021.12.11.11.13.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 Dec 2021 11:13:55 -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=h3Ph0Dfw; 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]:53834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mw7og-0005ua-K9 for patch@linaro.org; Sat, 11 Dec 2021 14:13:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw7mZ-0004oI-L6 for qemu-devel@nongnu.org; Sat, 11 Dec 2021 14:11:43 -0500 Received: from [2a00:1450:4864:20::433] (port=47073 helo=mail-wr1-x433.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mw7mW-0006Bi-LU for qemu-devel@nongnu.org; Sat, 11 Dec 2021 14:11:43 -0500 Received: by mail-wr1-x433.google.com with SMTP id u1so20257802wru.13 for ; Sat, 11 Dec 2021 11:11:40 -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/WoaEcAXkHQDQGnYA2VaWKRKb5cvTpqbwK+SMbmTCw=; b=h3Ph0Dfws5fw5CWIFcyqSGOd4BHzj+ETZCT7WVSl6xmt6W3Thjony2p7hiWiKwvtWK IwKcsCLKPYwPS+TA34DDvlmsvf6va4oFsHlZW3+dj0er+cDtnUOFvBVzYlcPkMpPqDNp il1x+4nZHfhKd/vd8S639fKKhATJjyUbv+hshdUYBntkeYGmYSP81yXX0fgh12aBYjM2 N4UMXjKLrrzf+5M/cp/gcwOJXkjJcCmTx2uAuB//4qGkQjKlotEUh0OWvhuE455wyApy 82mmY/XMC39iouIkkvqURcvdZwESp8uSpJnMSd3nq+O+FhIuEnVocVIoBBuShDq5Vgc0 3+Wg== 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/WoaEcAXkHQDQGnYA2VaWKRKb5cvTpqbwK+SMbmTCw=; b=TcwbJ9x3TgSlmM/v8ANnuzq5uNjdAspPeqTaekqA97FEmu0QpZV+ImA0KD8eSR5tjN Ei043DNzm8HlBnSjeRJxam3qDMpwYGOx8XHAwoWA53gP6yGnfEftWkcBpkMxNCeF6HhI A29/82QNgd/nh/ykV7Y3u1tDgc3/34TCioFnLyDV+oweR92kHaw0JJkBXyA2aw3radlo T/bnqO5KxkQRIcVuLsZ98jYdrh3xqx2dHQPihpeJoWvRGmCty47lYIlPyoATcPPL/gaB X/cgX+Iw+QiUKvTKohCs+J8cAceFggLmwxqCWP67uqFRrl0xhfo7W0VguwsFgPNiq1G6 gxZA== X-Gm-Message-State: AOAM531ZqyXilM6rL7iXw4g2lW1+GJmlazM6OMGwl5eACmvzOHir7Qkh WzS1LDK+DjD15v4K4JufAisvxw== X-Received: by 2002:a5d:4b06:: with SMTP id v6mr22091003wrq.194.1639249899312; Sat, 11 Dec 2021 11:11:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Dec 2021 11:11:39 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 03/26] hw/intc/arm_gicv3_its: Remove redundant ITS_CTLR_ENABLED define Date: Sat, 11 Dec 2021 19:11:12 +0000 Message-Id: <20211211191135.1764649-4-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::433 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x433.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" We currently define a bitmask for the GITS_CTLR ENABLED bit in two ways: as ITS_CTLR_ENABLED, and via the FIELD() macro as R_GITS_CTLR_ENABLED_MASK. Consistently use the FIELD macro version everywhere and remove the redundant ITS_CTLR_ENABLED define. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée --- hw/intc/gicv3_internal.h | 2 -- hw/intc/arm_gicv3_its.c | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/intc/gicv3_internal.h b/hw/intc/gicv3_internal.h index b9c37453b04..63de8667c61 100644 --- a/hw/intc/gicv3_internal.h +++ b/hw/intc/gicv3_internal.h @@ -289,8 +289,6 @@ FIELD(GITS_TYPER, CIL, 36, 1) #define GITS_IDREGS 0xFFD0 -#define ITS_CTLR_ENABLED (1U) /* ITS Enabled */ - #define GITS_BASER_RO_MASK (R_GITS_BASER_ENTRYSIZE_MASK | \ R_GITS_BASER_TYPE_MASK) diff --git a/hw/intc/arm_gicv3_its.c b/hw/intc/arm_gicv3_its.c index 677b96dfe23..985ae03f5fc 100644 --- a/hw/intc/arm_gicv3_its.c +++ b/hw/intc/arm_gicv3_its.c @@ -651,7 +651,7 @@ static void process_cmdq(GICv3ITSState *s) uint8_t cmd; int i; - if (!(s->ctlr & ITS_CTLR_ENABLED)) { + if (!(s->ctlr & R_GITS_CTLR_ENABLED_MASK)) { return; } @@ -887,7 +887,7 @@ static MemTxResult gicv3_its_translation_write(void *opaque, hwaddr offset, switch (offset) { case GITS_TRANSLATER: - if (s->ctlr & ITS_CTLR_ENABLED) { + if (s->ctlr & R_GITS_CTLR_ENABLED_MASK) { devid = attrs.requester_id; result = process_its_cmd(s, data, devid, NONE); } @@ -912,13 +912,13 @@ static bool its_writel(GICv3ITSState *s, hwaddr offset, switch (offset) { case GITS_CTLR: if (value & R_GITS_CTLR_ENABLED_MASK) { - s->ctlr |= ITS_CTLR_ENABLED; + s->ctlr |= R_GITS_CTLR_ENABLED_MASK; extract_table_params(s); extract_cmdq_params(s); s->creadr = 0; process_cmdq(s); } else { - s->ctlr &= ~ITS_CTLR_ENABLED; + s->ctlr &= ~R_GITS_CTLR_ENABLED_MASK; } break; case GITS_CBASER: @@ -926,7 +926,7 @@ static bool its_writel(GICv3ITSState *s, hwaddr offset, * IMPDEF choice:- GITS_CBASER register becomes RO if ITS is * already enabled */ - if (!(s->ctlr & ITS_CTLR_ENABLED)) { + if (!(s->ctlr & R_GITS_CTLR_ENABLED_MASK)) { s->cbaser = deposit64(s->cbaser, 0, 32, value); s->creadr = 0; s->cwriter = s->creadr; @@ -937,7 +937,7 @@ static bool its_writel(GICv3ITSState *s, hwaddr offset, * IMPDEF choice:- GITS_CBASER register becomes RO if ITS is * already enabled */ - if (!(s->ctlr & ITS_CTLR_ENABLED)) { + if (!(s->ctlr & R_GITS_CTLR_ENABLED_MASK)) { s->cbaser = deposit64(s->cbaser, 32, 32, value); s->creadr = 0; s->cwriter = s->creadr; @@ -979,7 +979,7 @@ static bool its_writel(GICv3ITSState *s, hwaddr offset, * IMPDEF choice:- GITS_BASERn register becomes RO if ITS is * already enabled */ - if (!(s->ctlr & ITS_CTLR_ENABLED)) { + if (!(s->ctlr & R_GITS_CTLR_ENABLED_MASK)) { index = (offset - GITS_BASER) / 8; if (offset & 7) { @@ -1076,7 +1076,7 @@ static bool its_writell(GICv3ITSState *s, hwaddr offset, * IMPDEF choice:- GITS_BASERn register becomes RO if ITS is * already enabled */ - if (!(s->ctlr & ITS_CTLR_ENABLED)) { + if (!(s->ctlr & R_GITS_CTLR_ENABLED_MASK)) { index = (offset - GITS_BASER) / 8; s->baser[index] &= GITS_BASER_RO_MASK; s->baser[index] |= (value & ~GITS_BASER_RO_MASK); @@ -1087,7 +1087,7 @@ static bool its_writell(GICv3ITSState *s, hwaddr offset, * IMPDEF choice:- GITS_CBASER register becomes RO if ITS is * already enabled */ - if (!(s->ctlr & ITS_CTLR_ENABLED)) { + if (!(s->ctlr & R_GITS_CTLR_ENABLED_MASK)) { s->cbaser = value; s->creadr = 0; s->cwriter = s->creadr; @@ -1298,7 +1298,7 @@ static void gicv3_its_reset(DeviceState *dev) static void gicv3_its_post_load(GICv3ITSState *s) { - if (s->ctlr & ITS_CTLR_ENABLED) { + if (s->ctlr & R_GITS_CTLR_ENABLED_MASK) { extract_table_params(s); extract_cmdq_params(s); }