From patchwork Thu Mar 3 20:23:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 547804 Delivered-To: patch@linaro.org Received: by 2002:ac0:f585:0:0:0:0:0 with SMTP id s5csp953187imq; Thu, 3 Mar 2022 12:25:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyeEp6pDqIP6ac25HP0AqbEi1ceq6TXstnoTSMaea+G/FBXu8ID52MSkapaDZOfIHmUqoc6 X-Received: by 2002:a81:f57:0:b0:2d2:abf6:489c with SMTP id 84-20020a810f57000000b002d2abf6489cmr37796898ywp.232.1646339109515; Thu, 03 Mar 2022 12:25:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646339109; cv=none; d=google.com; s=arc-20160816; b=eZhmIQb44kRYbHxnU9kelmLNOFXnM4SJgmk3nO9LSq1z6/aMJTvmRfX3WW/BgtF8zP kHsbwgOhf+Nt7lVv09LfDnNWqvkeYOCru/ONGEfF27PiS4V1rSvkd5HO/TcM6efgOZ/T E7nlVOuu9nf3EN4+l1aUj739mNHqCi9WyfEDTsDz10ZRMpN9h4JoX79tkUZCCBsBap1e CrjCdlHoQHLrhnvYCtlL9p1EntY1rfhk/TPRX/e7DRUkyaBFhD35nFyTyHEQFroJkQUj W4jyLS5e/L1PjHZyMiZNeALiOtRmCFzEY2DXBfUkYldF0EqEDxyL75kqE6jOeM9fcJle rRFQ== 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=BwQur4NZBGGWfHrVPMLWwKCyDvLwx3c9PUY0EKxgx9k=; b=L8t9JkskZIUU+w57nzbbqT25soCkdicUdCdfd1ZqFqCF0ccQeHnRZthi0UQYsJBbNM WEv6SMu+uKyRFHnAAQ0GLJzVMRzDlS1FTA5l7OpySBgrmcEoUh1O5Y9FWrrj/IsKG90O cIt7vRx7fangAdrU7egmo33S3P1K6PJg8+IVoKay2Qa/p57HoLsZ8SAp4x+gq18vngfC jRz0zezlLbhUMRux6uD4trUDQV6mVNaVzDEOvm4UcqIAHAGoaz8ptpPpREKGzdqklRFL /J3uK+m8PFN47YoJ5KzrAJc/+6j8RM5P2WHl9EL3VxOK5qjb5aN0JFhUBqNmx6kndEt4 P//g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dnTyXeu1; 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 j21-20020a252315000000b006288cd863b5si2414355ybj.490.2022.03.03.12.25.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Mar 2022 12:25:09 -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=dnTyXeu1; 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]:34068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPs0b-0002y2-1a for patch@linaro.org; Thu, 03 Mar 2022 15:25:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPrzK-0001ut-Qn for qemu-devel@nongnu.org; Thu, 03 Mar 2022 15:23:50 -0500 Received: from [2a00:1450:4864:20::32e] (port=53868 helo=mail-wm1-x32e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPrzI-0001Zz-Gt for qemu-devel@nongnu.org; Thu, 03 Mar 2022 15:23:50 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 19so3574938wmy.3 for ; Thu, 03 Mar 2022 12:23:48 -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=BwQur4NZBGGWfHrVPMLWwKCyDvLwx3c9PUY0EKxgx9k=; b=dnTyXeu1Yaiit8GnHMv0BTLnhMuUWGKjNnwyZ6lmKiSXTrd+TuVV72sNBvqSS0Ag2A FpRdeJ8+7KgV5TH1M+5jE3/WhiWhRkN6Z0eS5SMiq7U7HC6uI7qA0Tnia6vZjdYYD/ug m2o+ls1iCbirTUg2um/VeaHHHRsySaA0pjQLLgXpWLtO/lAYbHKpq1dbt9hi1mtHSXRW vwm2Xy32mAsNEY92jj66Op34Ml06WTblylElZNSXPYGwQ8q8Rkom21gNc30fTkt/sdBV QKViKUiamVLpiHg5ViTa3hY7QYuTho/Esctg/cDBGPZBYu4FdDK4FwEFV/QjApQw4n1c RERw== 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=BwQur4NZBGGWfHrVPMLWwKCyDvLwx3c9PUY0EKxgx9k=; b=MMbYm85Jp5FMKtGKLxsg+1naAPtxcyt7k476+mkyx3MQeQ2+pYGHA+uHmKf5af7OPD 5mh4PgrAneBmpPZI6orqEm2FR5/UDxzyUWvP3qaa6lmNzFXDNsgoyRdRJMRzc624qfsY 9exoPoNL2mmZo0Tx+iFMd2i2vZQvQ1yj+y4Tx4XALGhT77X2Mi07g/tO/gc7fRYosJvC lpsP/bcx/Ca9jxzTPpTYFubbmFpstzUrpBZdadMbYfEtxAe79afybJzoULMWPn3YUJN1 H3mIfxqJKi/rBRxtwZ8VIGM9nztFcX/8NJJrmLNxrnCgJmjnn5+a9X93wiylWJKgBa4z YqHQ== X-Gm-Message-State: AOAM533Vrx8SfFAznoTblvpX60S77EGAugPZP6cQP/j4eh8eQ3IUJ5zd GWkk+0IQ5sbw9s7Cd9BOXxYTyA== X-Received: by 2002:a05:600c:3d0b:b0:382:aa17:8f16 with SMTP id bh11-20020a05600c3d0b00b00382aa178f16mr5025218wmb.82.1646339027128; Thu, 03 Mar 2022 12:23:47 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id t5-20020adff045000000b001f0684c3404sm517060wro.11.2022.03.03.12.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 12:23:46 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 3/5] hw/intc/arm_gicv3: Specify valid and impl in MemoryRegionOps Date: Thu, 3 Mar 2022 20:23:39 +0000 Message-Id: <20220303202341.2232284-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220303202341.2232284-1-peter.maydell@linaro.org> References: <20220303202341.2232284-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32e (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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.659, 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 GICv3 has some registers that support byte accesses, and some that support 8-byte accesses. Our TCG implementation implements all of this, switching on the 'size' argument and handling the registers that must support reads of that size while logging an error for attempted accesses to registers that do not support that size access. However we forgot to tell the core memory subsystem about this by specifying the .impl and .valid fields in the MemoryRegionOps struct, so the core was happily simulating 8 byte accesses by combining two 4 byte accesses. This doesn't have much guest-visible effect, since there aren't many 8 byte registers and they all support being written in two 4 byte parts. Set the .impl and .valid fields to say that all sizes from 1 to 8 bytes are both valid and implemented by the device. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- hw/intc/arm_gicv3.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/intc/arm_gicv3.c b/hw/intc/arm_gicv3.c index 6d3c8ee231c..0b8f79a1227 100644 --- a/hw/intc/arm_gicv3.c +++ b/hw/intc/arm_gicv3.c @@ -369,11 +369,19 @@ static const MemoryRegionOps gic_ops[] = { .read_with_attrs = gicv3_dist_read, .write_with_attrs = gicv3_dist_write, .endianness = DEVICE_NATIVE_ENDIAN, + .valid.min_access_size = 1, + .valid.max_access_size = 8, + .impl.min_access_size = 1, + .impl.max_access_size = 8, }, { .read_with_attrs = gicv3_redist_read, .write_with_attrs = gicv3_redist_write, .endianness = DEVICE_NATIVE_ENDIAN, + .valid.min_access_size = 1, + .valid.max_access_size = 8, + .impl.min_access_size = 1, + .impl.max_access_size = 8, } };