From patchwork Tue Feb 1 19:31:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 538967 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp1101889imr; Tue, 1 Feb 2022 14:02:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMuDBBnN+jFCESeS85QpqQ1ZlwmKaRUh3A9NF8IhDvyXaUKrO4N3Vo1Sbt34+DkkXd43Kv X-Received: by 2002:a02:6f48:: with SMTP id b8mr14775393jae.9.1643752927684; Tue, 01 Feb 2022 14:02:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643752927; cv=none; d=google.com; s=arc-20160816; b=jI4HMiMxurS2vdfCkGJqD784SuXNBQzIrVF/sUlIBtSUxY/7zzzzmFV82ca5ArVwXc V6a4erTicHAmnJrduZHCMS2nDdq22viepf1oLWpbmQfnnrDnJGRGK42YNtXoj7GyRf4G QM4IhMBkHPVV3mrl7HwCULBUf13glHzn9c6CuYC+Yson4SlC/xqKYYPLBS4i55ecWrJ4 zr2JrVXzTMTN2bjttMs6EZNwEN5LTwmmn6mf/mDey5cmRdxJKwmRd176w/o56wyE32hr ESKVrtCBlS3QU45P0wTjekcxtdZZ9CoeiFMTuvi0A0p0/x7t7/IdoxWgXMJjIuC+o4s+ USqQ== 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:message-id:date:subject:to:from:dkim-signature; bh=NNxoGTM339928Yo84PwOxlFiC7fEAQLsnAwUVkrE8PA=; b=Arj9PuoDqAbx/jj8AyOQC1EGyWebdl3DwlOyRAs44RogOxiEJ3NRlXFVKUb3MIPyF9 bU+hXXH4AiNDrMKpI8oPyjjHbB+uTi3ff38l+fld8jsJ7y6rgbcH/Jyj3kZxBT6pNuBk znNQQLtx75wyHaI7sApI9sZREwqp6I/PmvBkGrQnHdl4cJH672pqa94NTxQQ71/wgbFL KHkdN6UudHfxJ867OcimmwiLM306tTeQ110Y3hHOQfapd8q+X9dwDt40x7GSFdxRfuR6 pxpwLqpLUhr/OJDscqBUkDyXBDGvR3GujmEaRxlsGxYsVnbZfY4QudruD1TZI0vfk9cG ctPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YF+9zX61; 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 x7si10507672ilp.58.2022.02.01.14.02.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Feb 2022 14:02:07 -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=YF+9zX61; 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]:43462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nF1Dz-0005G2-5M for patch@linaro.org; Tue, 01 Feb 2022 17:02:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEysv-0001ew-8K for qemu-devel@nongnu.org; Tue, 01 Feb 2022 14:32:13 -0500 Received: from [2a00:1450:4864:20::32b] (port=51108 helo=mail-wm1-x32b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nEyst-0002V5-EE for qemu-devel@nongnu.org; Tue, 01 Feb 2022 14:32:12 -0500 Received: by mail-wm1-x32b.google.com with SMTP id m26so7265755wms.0 for ; Tue, 01 Feb 2022 11:32:10 -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:mime-version :content-transfer-encoding; bh=NNxoGTM339928Yo84PwOxlFiC7fEAQLsnAwUVkrE8PA=; b=YF+9zX61KuTHcViYxllPrM+r4NAINAqlrcNFRCRBFo/vZllYIqWB6Vq3+GKKXCGnCR /Yi1sqquVxG9KnkY/ONzpAx14v7lntfI82WmiHaIucDwROE8DVuumWCcBIiCdyokNOJm LKTDLX82U51LQFhhHZNpc+YcEiCd3O/D3KjlPBdxKUugO3g+5h9k/6XHCTRMBI6fxdLL 2oDTaXHLyFWpRY1EKBO6KzIQlFsYBVZ/s92rQxlNq5xPZ4JcGLrWAde1ljpsldQOoAUF rrS/hN2bu+iWXT/jVdXHOZh9mrrLIgsTkllMGh/Y98P7w+/neSZvItvDWnBLIbhhb33i epzQ== 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:mime-version :content-transfer-encoding; bh=NNxoGTM339928Yo84PwOxlFiC7fEAQLsnAwUVkrE8PA=; b=TB0vJHkq6e6sm1RjDEWabE6H6I8/CWzfwlR1LTG1seUcxiyDFnMP47etSlomvnvZDP nYlCdt3aCDCod4sXriYosH0Fk4w5HxnKFSrpSOWiZTa3ERK0LnV2j4fk+alg8iRm2xom dKKb4zEGObLMboDP/XfAADruIO92oOEnvVdohlisdG9595FhazYguEQDLSgJYvNbKihS thWMyL7Wqq6yeDYnPNO0ah2K7JluH0vu27BvIzx47YKDvLOJRjNacfJ+VMmGKmPg6/+p cHT4TJX1yFhz4zuGseNWS7M61fgO9/7ObfsJQLib4xENG74/5TQbfEJ87nob0zwvCvpz N0vw== X-Gm-Message-State: AOAM531u/M5Ge+O+DFzyAuNHniYTDASS5DV49ByyrooOyzcBn5dsbexe PNXe3mtf+0uW51PDpckE7h1UgQ== X-Received: by 2002:a1c:a98f:: with SMTP id s137mr3163722wme.51.1643743929353; Tue, 01 Feb 2022 11:32:09 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id z5sm3491265wmp.10.2022.02.01.11.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 11:32:08 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 00/13] hw/intc/arm_gicv3_its: more cleanups, bugfixes Date: Tue, 1 Feb 2022 19:31:54 +0000 Message-Id: <20220201193207.2771604-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32b (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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: , Cc: Richard Henderson , Shashi Mallela , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is another set of patches to the ITS emulation; mostly cleanups, but there are two bug fixes. Cleanups: (1) Switch away from reading command packets by multiple separate calls to address_space_ldq_le(), and instead use address_space_map()/unmap() to get all 4 doublewords in the command packet at once in the top level queue-processing loop. This gets all the handling of loading words out of the individual command-handling functions and makes them a lot easier to read IMHO. Plus it reduces the number of lines of code by about a hundred. (2) Unify all of the get_foo()/update_foo() functions that we use for reading and writing the various in-guest-memory tables so that they use a single style of API rather than being confusingly different about how they indicate failure and how they return the interesting fields from the table entries. (3) A handful of less exciting minor tweaks. Bugfixes: (1) We were mis-calculating the address to use for the last 4 bytes in an interrupt table entry, so they overwrote the middle 4 bytes... The fix for this one is slightly awkward because we need to handle migration from guests which have in-memory tables written using the buggy code. (2) We shouldn't validity-check rdbase in MAPC with V=0 (3) MAPI/MAPTI with intid 1023 should be rejected thanks -- PMM Peter Maydell (13): hw/intc/arm_gicv3_its: Use address_space_map() to access command queue packets hw/intc/arm_gicv3_its: Keep DTEs as a struct, not a raw uint64_t hw/intc/arm_gicv3_its: Pass DTEntry to update_dte() hw/intc/arm_gicv3_its: Keep CTEs as a struct, not a raw uint64_t hw/intc/arm_gicv3_its: Pass CTEntry to update_cte() hw/intc/arm_gicv3_its: Fix address calculation in get_ite() and update_ite() hw/intc/arm_gicv3_its: Avoid nested ifs in get_ite() hw/intc/arm_gicv3_its: Pass ITE values back from get_ite() via a struct hw/intc/arm_gicv3_its: Make update_ite() use ITEntry hw/intc/arm_gicv3_its: Drop TableDesc and CmdQDesc valid fields hw/intc/arm_gicv3_its: In MAPC with V=0, don't check rdbase field hw/intc/arm_gicv3_its: Don't allow intid 1023 in MAPI/MAPTI hw/intc/arm_gicv3_its: Split error checks hw/intc/gicv3_internal.h | 23 +- include/hw/intc/arm_gicv3_its_common.h | 2 - hw/intc/arm_gicv3_its.c | 696 +++++++++++-------------- 3 files changed, 328 insertions(+), 393 deletions(-)