From patchwork Mon Mar 7 16:47:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 548883 Delivered-To: patch@linaro.org Received: by 2002:adf:80eb:0:0:0:0:0 with SMTP id 98csp1097227wrl; Mon, 7 Mar 2022 08:57:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVhCfTYm8dAldD4RRhXoDq8lIw+5d7AwgfZIVFNARxcylwvKBHHBwjEVaGwekaU9JiaJIt X-Received: by 2002:a25:d181:0:b0:629:1919:d8e5 with SMTP id i123-20020a25d181000000b006291919d8e5mr7580851ybg.85.1646672274920; Mon, 07 Mar 2022 08:57:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646672274; cv=none; d=google.com; s=arc-20160816; b=psi8xHuZAFFmCNAUxVmJODWVEGZ7IrDVXOdt11mtICO/W/TIPFN/qXVk/FC37q53sM T8k+ctImTbG1R8eyiCWWg4mPmhQSJQBZrQlhDMfOIQQj8Qc5obqm3e0+NXqncBuRpoNp wX6KPr2Q+1lCSRbzJqerBCVKg1Gzc7D5AHhfz42bKaosz07Sd9YdH/1j9t2O0B29KACt RuVLs4qxMqFnj3BWT9oDRCoMpsROvZTaYgohIkaCjis2mnR/FAfrf1Rrhgu9zwzVkBXX 5lU8LuLYS1DsPRzEZ2wMz0I7SeuocYBA/GXZSsq/LmCIDadq4Jqdaf/A0mUIJ4rNrvtj WBxQ== 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=k3XXdEEkAT8rtcP4zgQB24XrJWOVDRQK/GtPyU/3Usc=; b=an5lLtfeI7Rj5/alkO4rxTg3OglnslgLB8XURojAnURVSKmnaUn0q2UcznbGgOeYA6 u76C5yJsYsQPIZUGdJbg5YsRMJ12ajV9WRwiFASVXV1hphpt4dQ9iANGXzUkv2WVJSid OfUPaAWskekr7cBxSV0xZLJ3XU8k/zJGq3sefytM1BMW7i6LmosWjy+w/t2t4ksuUOKS /Vlfe9yDuP3LVQSWq6ARTEryV3v6bCL73qG7a+63PSdYORmhFuEu4sTL6uJe6ecLT0Mb 2OUMKuTG5hYdygLOm9zaDtN8OE3S60faDhgH2Gor3CsKCfHihRxoLnYkQvLyuFl0bqWN tvPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qt78X5T3; 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 a196-20020a81a3cd000000b002dbf4269b93si9007807ywh.333.2022.03.07.08.57.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Mar 2022 08:57:54 -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=qt78X5T3; 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]:38238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRGgE-00071Q-Bn for patch@linaro.org; Mon, 07 Mar 2022 11:57:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRGW5-0001pG-T7 for qemu-devel@nongnu.org; Mon, 07 Mar 2022 11:47:25 -0500 Received: from [2a00:1450:4864:20::42f] (port=33631 helo=mail-wr1-x42f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRGW4-0007lU-8J for qemu-devel@nongnu.org; Mon, 07 Mar 2022 11:47:25 -0500 Received: by mail-wr1-x42f.google.com with SMTP id j17so24367559wrc.0 for ; Mon, 07 Mar 2022 08:47:23 -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=k3XXdEEkAT8rtcP4zgQB24XrJWOVDRQK/GtPyU/3Usc=; b=qt78X5T32qE3+V+QdB9RtVkOR845+/Wnc0L498DnmiZub4fOypKPtmG0LLhOmjgV/U qGxG5vy80ycliH+owJGNW0KW6TI4L6aS22ohN3m6ZsXbpcWnjVgJjAOhFRNwaxZNY5lP rhK5Piqub2JazJaY6icSaKtr2VYFZ1AKwrSdP9kNWYgW4w8WtP/yzq8l+bGhugKGR4Y6 TW2yXQM9XKLBaE1w9eZrMbiIv8g5x+rF7Z7eXyCjOLcnAZq1pt5MTeCfC9ANg0tYfjc1 f9+J7wCh5oxgI6V3/Zptxjbb9G+Z0Xqt9Ez+F4458ZmmK1QCl9pK46/YvmFrHD+hnNBS 3Ojw== 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=k3XXdEEkAT8rtcP4zgQB24XrJWOVDRQK/GtPyU/3Usc=; b=sonNTaJ0rAac+qPe0k7XV8/TLhqzs9E6pATdU7W5jer0gwU90s91fMimCVEy3fb07x 3ApXGQVwOWTdpRNT2gH1pEyl0o8Oj73oQg7AcRZDg4QwOyC7Me79JmB5RQwCjIJ2pfgy nEJWEgikqwUjsZ3PmmNQX+QhTJeLX0xS4Xa7c4YaTQVzKoLG9hFOM71coZD8yOJIvO2+ aNKLx6u5zUqlD6dzRxHUjE5LyjSaEZ3rZDkiK1YhUGK7c5P2KjUIfYx6VCp1YPpX8+OV KKprYfI+UARB0DKj6YzXIIjs2yJ+8I/GayqEr3YUQBBsVZE3VSkPx6t+9eKSiONu8GFq umVQ== X-Gm-Message-State: AOAM531Eh/jdJbe1sAS295kfF5+05UECdxlKDpZWlCceDilxkciqAgIx iAq1cKpHpMhMOA2YOcBh/s5Cj3EsVsbYEg== X-Received: by 2002:adf:ea0f:0:b0:1f0:61f6:c3df with SMTP id q15-20020adfea0f000000b001f061f6c3dfmr8895702wrm.543.1646671642978; Mon, 07 Mar 2022 08:47:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id v188-20020a1cacc5000000b00384b71a50d5sm13806652wme.24.2022.03.07.08.47.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 08:47:22 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/18] hw/intc/arm_gicv3: Specify valid and impl in MemoryRegionOps Date: Mon, 7 Mar 2022 16:47:04 +0000 Message-Id: <20220307164709.2503250-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220307164709.2503250-1-peter.maydell@linaro.org> References: <20220307164709.2503250-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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 Message-id: 20220303202341.2232284-4-peter.maydell@linaro.org --- 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, } };