From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997619; cv=none; d=zohomail.com; s=zohoarc; b=VmdNMfqY4ieALYkVDhAYWIiCvSDulBH/PrL47wL5G2QoJEPETFpDt/SmniiPTBMcCDT6W1f6eoSzAdaBO0pDkaO0xfnYaW+7QFWaHsxbu7mSQ/n5g8JwZ0qp7z9Y2IiOUd4Ql5qpPWGE05yFsGiRr4SkY1RQdsKsfKS/kq0/7y0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997619; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zsdsn6GEibPooC9i8v4/KTHqsG/TGIImbYgqLlFLm94=; b=lydDUExwUD3zFpxpqMupZ/EZw47WVZAYk01AZrWoFL7AU68b9/OYNAk3wxl2J3zrynkou4+CrnffsBuxElFjNy248l7bVERby1o7QUQP67b/bpPoKBOurHb7/a+oFjixU/WyDH3HAqiQe0tjoL+QXqEtmNdUhq5+yFqY6mEWtCY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629997619451518.2699378456039; Thu, 26 Aug 2021 10:06:59 -0700 (PDT) Received: from localhost ([::1]:48266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIqA-00033y-ET for importer@patchew.org; Thu, 26 Aug 2021 13:06:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImd-00052a-Gm for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:19 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:46643) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImX-0008FV-H6 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:16 -0400 Received: by mail-wr1-x42a.google.com with SMTP id f5so6089565wrm.13 for ; Thu, 26 Aug 2021 10:03:12 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:10 -0700 (PDT) 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=zsdsn6GEibPooC9i8v4/KTHqsG/TGIImbYgqLlFLm94=; b=vjOPRL+W4MnGR2V40YLm0LA+XN3r7WYiuYYLGcmawVmz+EQ92Af7PSTSSWKHX5uxEF 4OS7U3SWhGJ3+RZKlii3epgOHhcphQSQLvEKs+H6yxV9lECZywa1O2wBD/rd+k8HsWAQ l/BOaHPb3w/0RnIdEjJG9JqEVgaI1SiGyL57my1HH3ppwIBbgnSziou06SxdIjpnCtCb gN7axgzf9mlTgWWd8uciZqBsNh3fuA5qwI1mlvT/DWIHUBV5xn+SU/akPCe8qAdt821K SnhhaO52LojFO/o2TOMbY3si28LsdOd9qvwCVKbI0+B0+5kdB5B4QdI1/rC2OJtLVNTL qsPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zsdsn6GEibPooC9i8v4/KTHqsG/TGIImbYgqLlFLm94=; b=RwHzQNdr7li/I6qJB6x6iTEscvGjnKK6ucX/s8Ly4EwXPUd+WD1C1/zAMtVqZMrzpp rlfQz3VCYaFSv3NbaMiSq7fI6I4ckH4s6HZFqyQV97gX/NlRrtS1H3kAfp6NzneTmxnQ WPqM9U0m1EtuvtzzUNGVSjUTZIBeynCaXjYeyCu7xBR4Krd+HgqpA9xERklgNYS0Tznl sJJN8fMZ+fi1Ex6UFfHvM60rrhLHmXL3t9AG/gQi9wesfdCdeuPeOdE6gjPQZxZaK2fr hkzHYcqIMD9gTxU8J8uTDQv35ArIW2UVqYIfkN3vPskW2pgVA9BZclvaFchyHogQvDzg 3E1w== X-Gm-Message-State: AOAM5323du9X2bRbu109H9d+SB1Sonsz317C1WL8yAsXJXyLK7Cb6BXF Kjg1VE+ziTy5WObjjx9l9LeHIrMdGA0a2Q== X-Google-Smtp-Source: ABdhPJwHOSNoH20B4nUORfde1u3DQ9rjCwroAVGGTcUaCphCT9tRQ8jSQWZdp/FNS36q4jCPnBw+hw== X-Received: by 2002:adf:e901:: with SMTP id f1mr5264854wrm.13.1629997391331; Thu, 26 Aug 2021 10:03:11 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 01/37] hw/arm/xlnx-zynqmp: Realize qspi controller *after* qspi_dma Date: Thu, 26 Aug 2021 18:02:31 +0100 Message-Id: <20210826170307.27733-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997619903100001 From: Philippe Mathieu-Daud=C3=A9 If we link QOM object (a) as a property of QOM object (b), we must set the property *before* (b) is realized. Move QSPI realization *after* QSPI DMA. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20210819163422.2863447-2-philmd@redhat.com Signed-off-by: Peter Maydell --- hw/arm/xlnx-zynqmp.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 3597e8db4de..9724978761b 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -570,26 +570,6 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Erro= r **errp) g_free(bus_name); } =20 - if (!sysbus_realize(SYS_BUS_DEVICE(&s->qspi), errp)) { - return; - } - sysbus_mmio_map(SYS_BUS_DEVICE(&s->qspi), 0, QSPI_ADDR); - sysbus_mmio_map(SYS_BUS_DEVICE(&s->qspi), 1, LQSPI_ADDR); - sysbus_connect_irq(SYS_BUS_DEVICE(&s->qspi), 0, gic_spi[QSPI_IRQ]); - - for (i =3D 0; i < XLNX_ZYNQMP_NUM_QSPI_BUS; i++) { - gchar *bus_name; - gchar *target_bus; - - /* Alias controller SPI bus to the SoC itself */ - bus_name =3D g_strdup_printf("qspi%d", i); - target_bus =3D g_strdup_printf("spi%d", i); - object_property_add_alias(OBJECT(s), bus_name, - OBJECT(&s->qspi), target_bus); - g_free(bus_name); - g_free(target_bus); - } - if (!sysbus_realize(SYS_BUS_DEVICE(&s->dp), errp)) { return; } @@ -646,8 +626,26 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Erro= r **errp) =20 sysbus_mmio_map(SYS_BUS_DEVICE(&s->qspi_dma), 0, QSPI_DMA_ADDR); sysbus_connect_irq(SYS_BUS_DEVICE(&s->qspi_dma), 0, gic_spi[QSPI_IRQ]); - object_property_set_link(OBJECT(&s->qspi), "stream-connected-dma", - OBJECT(&s->qspi_dma), errp); + + if (!object_property_set_link(OBJECT(&s->qspi), "stream-connected-dma", + OBJECT(&s->qspi_dma), errp)) { + return; + } + if (!sysbus_realize(SYS_BUS_DEVICE(&s->qspi), errp)) { + return; + } + sysbus_mmio_map(SYS_BUS_DEVICE(&s->qspi), 0, QSPI_ADDR); + sysbus_mmio_map(SYS_BUS_DEVICE(&s->qspi), 1, LQSPI_ADDR); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->qspi), 0, gic_spi[QSPI_IRQ]); + + for (i =3D 0; i < XLNX_ZYNQMP_NUM_QSPI_BUS; i++) { + g_autofree gchar *bus_name =3D g_strdup_printf("qspi%d", i); + g_autofree gchar *target_bus =3D g_strdup_printf("spi%d", i); + + /* Alias controller SPI bus to the SoC itself */ + object_property_add_alias(OBJECT(s), bus_name, + OBJECT(&s->qspi), target_bus); + } } =20 static Property xlnx_zynqmp_props[] =3D { --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997672; cv=none; d=zohomail.com; s=zohoarc; b=gVnXSDPQe1zBkLM75awrvXHgZZTlQwzub7zkSHFdcpuTpuXNkagV/IQ3EYfoOgXf/s+QYoc90UUBIIq19IlQxeMtkPK/xH8H9RYZq83P+aCBWFH2oCNdHCHwxNBGts01hR9uDwigZPlqUrnMoOmPkw7WSxyJRMpTxASmEY3Bb6Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997672; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pKk+LOcRzNeYyyROZF52+vFq5RB02o3Jr5ppaRV11yQ=; b=e6SBZfIy72VP7nQq/461TZQ+M3FmZkGNGevqWFPEtqFVzbLKs/JWcKTFvDsxXJLTlXSHeNYH+cHocsuqHYgJA7K0BzjHJ24O0THVM9PaAEbmOTLwgbMCIRJmt4H5Eo+u923EROm2AGUuNCtc5PCTZc443AlqMdbj+jFnFYPxAqc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629997672564263.0433059605866; Thu, 26 Aug 2021 10:07:52 -0700 (PDT) Received: from localhost ([::1]:51694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIr1-0005LN-Iu for importer@patchew.org; Thu, 26 Aug 2021 13:07:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIme-000552-H0 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:20 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:37570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImX-0008G1-PC for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:20 -0400 Received: by mail-wm1-x32c.google.com with SMTP id c8-20020a7bc008000000b002e6e462e95fso7374475wmb.2 for ; Thu, 26 Aug 2021 10:03:13 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:11 -0700 (PDT) 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=pKk+LOcRzNeYyyROZF52+vFq5RB02o3Jr5ppaRV11yQ=; b=UdHyq0tGtQVXKED7TLJyReT/UgXtt+Rf7VWVina+l9Jc8SOIUojxdmttrCPSS09Bms DFmMQGWxqj1/4hW8wH15CHQ9zDXGYAJXrsxI6kl5V9uKR5jvCzXD8Fk3mL4p+D/SNuXb JD4fonGpUzh7x6hl39uqNnWd1CV9yJ8C8jHw3bZHasPJMtnQeUDU3rGzISjZf+AUGgDh Hcc+Xacf8IO9wUQIbpHeZJTy7HhaoJ9aavPgZ3lcsboQp3G4E3m7zBPK2mCZc/f8LYef IUV5nTkWVwhER7hrppU0DU69bNfWnbqpMdosOf6xtc7GHLx9JRn9YFBOplfP9Srs6VkU tKYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pKk+LOcRzNeYyyROZF52+vFq5RB02o3Jr5ppaRV11yQ=; b=ptuEpVEujSTvhEFK32zw/PBlt/foFOQc8X/v+trfpveuQN4iZdOLyP0ibBW7/ocGvN 7AzZeJ0X/+1cIk6pqvtoe/9FTekiesYssPiSfnrcx72TU0+h4LgN17qBat/4JcR2Skr3 LFXWEUdg1NuFf7UawNkFp1HIBlx4rgAI3uYJnblKEZikmsPWNSXSamFi4WTKk7andrAC 72UyQrFT4Z4oOaXEO+oyt+X2Tz81oFJ6AT/ngf7lQWgOTQb1CKF4LcwVZJbhzz/Qv84Q ci3bDooE6mwfuD1hTA0tGFC7IaIxSeiIgMYM6Bed3ubDWex398WkQ5dKbk5Uke1Rya2P o/EA== X-Gm-Message-State: AOAM532BgXa2JTOahoSaWG6Svjei+IbF6p7dG584VsG+yhOlMfuU3FnN WgVL/tYT/1FpDD2PcB4LkPAUkk7LGhHc1A== X-Google-Smtp-Source: ABdhPJztne7xvd9t1nDdH4UV1CoNRaXw/Ad/YLPLa2OzER4AJOtYVkNloQO19liSD/IP7w4lw6R59A== X-Received: by 2002:a05:600c:154e:: with SMTP id f14mr15446976wmg.162.1629997392384; Thu, 26 Aug 2021 10:03:12 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 02/37] hw/dma/xlnx_csu_dma: Run trivial checks early in realize() Date: Thu, 26 Aug 2021 18:02:32 +0100 Message-Id: <20210826170307.27733-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997672827100001 From: Philippe Mathieu-Daud=C3=A9 If some property are not set, we'll return indicating a failure, so it is pointless to allocate / initialize some fields too early. Move the trivial checks earlier in realize(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Message-id: 20210819163422.2863447-3-philmd@redhat.com Signed-off-by: Peter Maydell --- hw/dma/xlnx_csu_dma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/dma/xlnx_csu_dma.c b/hw/dma/xlnx_csu_dma.c index 797b4fed8f5..2d19f415ef3 100644 --- a/hw/dma/xlnx_csu_dma.c +++ b/hw/dma/xlnx_csu_dma.c @@ -626,6 +626,11 @@ static void xlnx_csu_dma_realize(DeviceState *dev, Err= or **errp) XlnxCSUDMA *s =3D XLNX_CSU_DMA(dev); RegisterInfoArray *reg_array; =20 + if (!s->is_dst && !s->tx_dev) { + error_setg(errp, "zynqmp.csu-dma: Stream not connected"); + return; + } + reg_array =3D register_init_block32(dev, xlnx_csu_dma_regs_info[!!s->is_dst], XLNX_CSU_DMA_R_MAX, @@ -640,11 +645,6 @@ static void xlnx_csu_dma_realize(DeviceState *dev, Err= or **errp) sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq); =20 - if (!s->is_dst && !s->tx_dev) { - error_setg(errp, "zynqmp.csu-dma: Stream not connected"); - return; - } - s->src_timer =3D ptimer_init(xlnx_csu_dma_src_timeout_hit, s, PTIMER_POLICY_DEFAULT); =20 --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997658; cv=none; d=zohomail.com; s=zohoarc; b=kEUGgVhB560s9dAnz6lRDNGtr0ZzgB4k0tbqpvRn/25wGxjjevAtGDMArKFS3bU+CBc51Kr44Ez9iWiR4W1lQ8NVCukgXVBqTJrfEtL/cfEl8qg3JTLIPm4QbaBUOcRy1Ot3Rs4Li3h/4Ti0Ib9iBW6m2PgWpW+Z2djXiTFrqEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997658; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JxrPIrv+BafNnBdy7gYwocYvuCT9Z/KLIIcRd1zGVj0=; b=Z6VtXl3hYvKJGdFOmgH3ktTLnrztpZrSJzkQdc68Y1VTOI9hNw/eG52O3GhcNc42/KXx53AmqL1SQ5BcEHwpCdlkN6p/Nw9zlzSMkIJUffsblZuLjfzZfczP0P9BkqfaNHgDXtSnhAexlbY48AgPjP1F8aWLtIHvdz8i3lWHT1k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162999765817773.71599457257844; Thu, 26 Aug 2021 10:07:38 -0700 (PDT) Received: from localhost ([::1]:51212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIqn-00051g-6f for importer@patchew.org; Thu, 26 Aug 2021 13:07:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImd-00052h-IY for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:19 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:52753) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImY-0008Gu-O5 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:19 -0400 Received: by mail-wm1-x336.google.com with SMTP id f10so2259470wml.2 for ; Thu, 26 Aug 2021 10:03:14 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:12 -0700 (PDT) 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=JxrPIrv+BafNnBdy7gYwocYvuCT9Z/KLIIcRd1zGVj0=; b=BVLpAxxJu4X4wE/BaHKlLeaJ1zhBTmhKNE79zOJ7FdqfEsd25Ao1QyDIMg2QM3qUfk /4euEbURTO/xaiIHWthTDED2QM3LR5h7+W3jId/zT8uO4CtRt6uN+JSf1b/LnnmOpTLx 0CJ1QDey+8Q5h3uf8dlVlXdGKHizOQhf3/Mx4TBSVcZlzrafR6VzYcvLW043N8qpu9TK EhPtagCfgXFBPUWeN3K1kZyRk7oNUgjoeIVZoMC+c934cgfK4JkXyBQfFbKDqSRAyF0D yB/OmCJyMsc8hsZ7vijfx4kejA9fNu/d2XP1Oc6cqIZNGIVnl6NuZ9gEkczfDOd0tAlC yB+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JxrPIrv+BafNnBdy7gYwocYvuCT9Z/KLIIcRd1zGVj0=; b=Q11d6H63GlLoc5341l4JmXO7QNgRWVqsBnPWRy/oLCQE2jTrM8gSTy9rz5MRnme3QC WhS8/1oIe9pycLv+3h/N10NmESYSX3wbIofGrqweA3gMaDsXM6n7ttwCnXgzbiCnenBz vA+7i+9GKw5kzBaXrb8DGOTFBxOTaeu/FKFkVyFLfC56/WOy+LiDI8zigK1lGOFplN0I YaeD912CqLN5j7b64F7mIQJzsRvIXY8vrzm4gywFk+hdS8Zu3Or0LLvtJ1kdyJ/YO42+ SVeLp33p5m8WKFui1YnAXTmiLkV8Yj87M/lF7b7KSpE0VxHPFKBpHUfWVRq8MlmRrj3+ 64Eg== X-Gm-Message-State: AOAM531msxVQ/1T+/e6RMBDj3TYwmq3DhkoCMYgLTNxAObuFXzq3DrCu e8gjKs1F+cxh8qj7SChisk47DixeewoG1A== X-Google-Smtp-Source: ABdhPJwToJNmwt2jFCACAdmI1Nvhw85EN/mPyav1ysaCe4Aj2AGUZ7+t+WO0xc/W58b5VJjjX6RWKQ== X-Received: by 2002:a05:600c:3656:: with SMTP id y22mr15118635wmq.58.1629997393297; Thu, 26 Aug 2021 10:03:13 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/37] hw/dma/xlnx_csu_dma: Always expect 'dma' link property to be set Date: Thu, 26 Aug 2021 18:02:33 +0100 Message-Id: <20210826170307.27733-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997659717100001 From: Philippe Mathieu-Daud=C3=A9 Simplify by always passing a MemoryRegion property to the device. Doing so we can move the AddressSpace field to the device struct, removing need for heap allocation. Update the Xilinx ZynqMP SoC model to pass the default system memory instead of a NULL value. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Message-id: 20210819163422.2863447-4-philmd@redhat.com Signed-off-by: Peter Maydell --- include/hw/dma/xlnx_csu_dma.h | 2 +- hw/arm/xlnx-zynqmp.c | 4 ++++ hw/dma/xlnx_csu_dma.c | 21 ++++++++++----------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/include/hw/dma/xlnx_csu_dma.h b/include/hw/dma/xlnx_csu_dma.h index 204d94c6737..9e9dc551e99 100644 --- a/include/hw/dma/xlnx_csu_dma.h +++ b/include/hw/dma/xlnx_csu_dma.h @@ -30,7 +30,7 @@ typedef struct XlnxCSUDMA { MemoryRegion iomem; MemTxAttrs attr; MemoryRegion *dma_mr; - AddressSpace *dma_as; + AddressSpace dma_as; qemu_irq irq; StreamSink *tx_dev; /* Used as generic StreamSink */ ptimer_state *src_timer; diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 9724978761b..4344e223f2d 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -620,6 +620,10 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Erro= r **errp) gic_spi[adma_ch_intr[i]]); } =20 + if (!object_property_set_link(OBJECT(&s->qspi_dma), "dma", + OBJECT(system_memory), errp)) { + return; + } if (!sysbus_realize(SYS_BUS_DEVICE(&s->qspi_dma), errp)) { return; } diff --git a/hw/dma/xlnx_csu_dma.c b/hw/dma/xlnx_csu_dma.c index 2d19f415ef3..896bb3574dd 100644 --- a/hw/dma/xlnx_csu_dma.c +++ b/hw/dma/xlnx_csu_dma.c @@ -201,11 +201,11 @@ static uint32_t xlnx_csu_dma_read(XlnxCSUDMA *s, uint= 8_t *buf, uint32_t len) for (i =3D 0; i < len && (result =3D=3D MEMTX_OK); i +=3D s->width= ) { uint32_t mlen =3D MIN(len - i, s->width); =20 - result =3D address_space_rw(s->dma_as, addr, s->attr, + result =3D address_space_rw(&s->dma_as, addr, s->attr, buf + i, mlen, false); } } else { - result =3D address_space_rw(s->dma_as, addr, s->attr, buf, len, fa= lse); + result =3D address_space_rw(&s->dma_as, addr, s->attr, buf, len, f= alse); } =20 if (result =3D=3D MEMTX_OK) { @@ -232,12 +232,12 @@ static uint32_t xlnx_csu_dma_write(XlnxCSUDMA *s, uin= t8_t *buf, uint32_t len) for (i =3D 0; i < len && (result =3D=3D MEMTX_OK); i +=3D s->width= ) { uint32_t mlen =3D MIN(len - i, s->width); =20 - result =3D address_space_rw(s->dma_as, addr, s->attr, + result =3D address_space_rw(&s->dma_as, addr, s->attr, buf, mlen, true); buf +=3D mlen; } } else { - result =3D address_space_rw(s->dma_as, addr, s->attr, buf, len, tr= ue); + result =3D address_space_rw(&s->dma_as, addr, s->attr, buf, len, t= rue); } =20 if (result !=3D MEMTX_OK) { @@ -631,6 +631,12 @@ static void xlnx_csu_dma_realize(DeviceState *dev, Err= or **errp) return; } =20 + if (!s->dma_mr) { + error_setg(errp, TYPE_XLNX_CSU_DMA " 'dma' link not set"); + return; + } + address_space_init(&s->dma_as, s->dma_mr, "csu-dma"); + reg_array =3D register_init_block32(dev, xlnx_csu_dma_regs_info[!!s->is_dst], XLNX_CSU_DMA_R_MAX, @@ -648,13 +654,6 @@ static void xlnx_csu_dma_realize(DeviceState *dev, Err= or **errp) s->src_timer =3D ptimer_init(xlnx_csu_dma_src_timeout_hit, s, PTIMER_POLICY_DEFAULT); =20 - if (s->dma_mr) { - s->dma_as =3D g_malloc0(sizeof(AddressSpace)); - address_space_init(s->dma_as, s->dma_mr, NULL); - } else { - s->dma_as =3D &address_space_memory; - } - s->attr =3D MEMTXATTRS_UNSPECIFIED; =20 s->r_size_last_word =3D 0; --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997739; cv=none; d=zohomail.com; s=zohoarc; b=FOVDSjY29gyDQAcuyU3Xo9q6PbwnRP7x8BTLpixJ/YO9ar3tGHWNJiNOwP/IM5nFm7r/eTUNcmuAwDZbBbxFZ+n10vyjRgtJPsUuPEfMcJ3XH+xC1AS2x0hNmGK8JxRhVNOFst/7nFgA1rvMYu3zYZZ21712dmVd8D5yPHNJcGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997739; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=edu7yXEsds87c0fEWhTabD3K7GBv5VOGHbQoii2mmig=; b=PqDZsKjE5rdoX7v/0w9QmNpXgzDuR9jTZsdglzbp1LjnTH9tDpqN6SSnNMQ6E+D1R7Iq4xh8+MhsYNpJ7YosT2X5UUh4WflsElkcpa94PdnOOX6AC6rJFOf/8CevNx9rRi/FWz7rOQ6gjPkEKb+wbCjdXk01I5L0yfiR20yerM4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162999773953629.847016750613648; Thu, 26 Aug 2021 10:08:59 -0700 (PDT) Received: from localhost ([::1]:56828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIs6-0000Ka-C1 for importer@patchew.org; Thu, 26 Aug 2021 13:08:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImf-00057Y-WB for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:22 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:46655) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImZ-0008Hc-HJ for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:21 -0400 Received: by mail-wr1-x436.google.com with SMTP id f5so6089744wrm.13 for ; Thu, 26 Aug 2021 10:03:15 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:13 -0700 (PDT) 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=edu7yXEsds87c0fEWhTabD3K7GBv5VOGHbQoii2mmig=; b=sJQSqGQZ7I/49k+6RELf551LQU9sIv3VWLg+Ud+A6P3iC9WSy7sBnO0n1SQ3lR9EDc ii3ZAGP7WHsz29bgQwPFtCk27faR9cjzyTtUFCqdC7uAlpwclglEi4qem8yQ4fNZdfUy br/9EJhpcGbcqmc1bUrMbAmgJ8TLfn/8YmzLLrztv+AvWnuEh5Ejkzeh8fNhDnR4zkmz pj0xKOCB6UWFNNZ1d7KR9QteW1FgasHK4gxiK4zInys4M5NodlifSeCJxOam7gVH+AtS GDlqrDo1UFSKwmiHSZWZpVQok2TWv144HYDItdfwpP+YR+PeUp678Hd6JecMXtbQX7MR NwuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=edu7yXEsds87c0fEWhTabD3K7GBv5VOGHbQoii2mmig=; b=cUeYVA5280wbI0kQuGWxAJfWuh51Q0epCf6gYA/I3qUti9w05z8Uxp3kXmiWhgEHX6 vOnnT45rb2uO9SP288PBmyuQs9/+KP5Sjk8jdb2ugz6ZXo7eccfW4lUytrbdRnwxB/5d XW47ICrc0MXbzstsBud1YgeEUBwN7SxwehSnT4D+Gk+a/vPo4NftaY/kXAUSwPjv9tGH 9OhH4YQdQc5QRJSrChou1gNfWU8nW2QI2RJXZYPFOkRRog823oepAwS93D4vqng3AcAN UBNysNaWlTUbZOBVJYyumeMkllUD8nUFhuzgnFL1KZaEuSp4QTmW6siJQpnu+WMwmH9+ xXFg== X-Gm-Message-State: AOAM532c/E8ebjAzOnbRH4NRyXk1A+zW9m+qvP9DrSv9Hl+1N919NN3o d5Dyzu8+s2DxvKboBnNVHvzqF98mc5hXIA== X-Google-Smtp-Source: ABdhPJxRVDGxvKgy3WzZUEINtpNjfBbgj8M9lD9iMazUwRMWgnLcROVSu+goTMPupxjftwiVCHFgpg== X-Received: by 2002:adf:fdd2:: with SMTP id i18mr5276492wrs.406.1629997394193; Thu, 26 Aug 2021 10:03:14 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/37] hw/dma/xlnx-zdma Always expect 'dma' link property to be set Date: Thu, 26 Aug 2021 18:02:34 +0100 Message-Id: <20210826170307.27733-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997741479100001 From: Philippe Mathieu-Daud=C3=A9 Simplify by always passing a MemoryRegion property to the device. Doing so we can move the AddressSpace field to the device struct, removing need for heap allocation. Update the Xilinx ZynqMP / Versal SoC models to pass the default system memory instead of a NULL value. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Message-id: 20210819163422.2863447-5-philmd@redhat.com Signed-off-by: Peter Maydell --- include/hw/dma/xlnx-zdma.h | 2 +- hw/arm/xlnx-versal.c | 2 ++ hw/arm/xlnx-zynqmp.c | 8 ++++++++ hw/dma/xlnx-zdma.c | 24 ++++++++++++------------ 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/include/hw/dma/xlnx-zdma.h b/include/hw/dma/xlnx-zdma.h index 6602e7ffa72..efc75217d59 100644 --- a/include/hw/dma/xlnx-zdma.h +++ b/include/hw/dma/xlnx-zdma.h @@ -56,7 +56,7 @@ struct XlnxZDMA { MemoryRegion iomem; MemTxAttrs attr; MemoryRegion *dma_mr; - AddressSpace *dma_as; + AddressSpace dma_as; qemu_irq irq_zdma_ch_imr; =20 struct { diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index fb776834f7e..d60eb4fb184 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -218,6 +218,8 @@ static void versal_create_admas(Versal *s, qemu_irq *pi= c) TYPE_XLNX_ZDMA); dev =3D DEVICE(&s->lpd.iou.adma[i]); object_property_set_int(OBJECT(dev), "bus-width", 128, &error_abor= t); + object_property_set_link(OBJECT(dev), "dma", + OBJECT(get_system_memory()), &error_fatal= ); sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal); =20 mr =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0); diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 4344e223f2d..6cfce26210d 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -601,6 +601,10 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Erro= r **errp) errp)) { return; } + if (!object_property_set_link(OBJECT(&s->gdma[i]), "dma", + OBJECT(system_memory), errp)) { + return; + } if (!sysbus_realize(SYS_BUS_DEVICE(&s->gdma[i]), errp)) { return; } @@ -611,6 +615,10 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Erro= r **errp) } =20 for (i =3D 0; i < XLNX_ZYNQMP_NUM_ADMA_CH; i++) { + if (!object_property_set_link(OBJECT(&s->adma[i]), "dma", + OBJECT(system_memory), errp)) { + return; + } if (!sysbus_realize(SYS_BUS_DEVICE(&s->adma[i]), errp)) { return; } diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c index fa38a556341..a5a92b4ff8c 100644 --- a/hw/dma/xlnx-zdma.c +++ b/hw/dma/xlnx-zdma.c @@ -320,9 +320,9 @@ static bool zdma_load_descriptor(XlnxZDMA *s, uint64_t = addr, return false; } =20 - descr->addr =3D address_space_ldq_le(s->dma_as, addr, s->attr, NULL); - descr->size =3D address_space_ldl_le(s->dma_as, addr + 8, s->attr, NUL= L); - descr->attr =3D address_space_ldl_le(s->dma_as, addr + 12, s->attr, NU= LL); + descr->addr =3D address_space_ldq_le(&s->dma_as, addr, s->attr, NULL); + descr->size =3D address_space_ldl_le(&s->dma_as, addr + 8, s->attr, NU= LL); + descr->attr =3D address_space_ldl_le(&s->dma_as, addr + 12, s->attr, N= ULL); return true; } =20 @@ -354,7 +354,7 @@ static void zdma_update_descr_addr(XlnxZDMA *s, bool ty= pe, } else { addr =3D zdma_get_regaddr64(s, basereg); addr +=3D sizeof(s->dsc_dst); - next =3D address_space_ldq_le(s->dma_as, addr, s->attr, NULL); + next =3D address_space_ldq_le(&s->dma_as, addr, s->attr, NULL); } =20 zdma_put_regaddr64(s, basereg, next); @@ -421,7 +421,7 @@ static void zdma_write_dst(XlnxZDMA *s, uint8_t *buf, u= int32_t len) } } =20 - address_space_write(s->dma_as, s->dsc_dst.addr, s->attr, buf, dlen= ); + address_space_write(&s->dma_as, s->dsc_dst.addr, s->attr, buf, dle= n); if (burst_type =3D=3D AXI_BURST_INCR) { s->dsc_dst.addr +=3D dlen; } @@ -497,7 +497,7 @@ static void zdma_process_descr(XlnxZDMA *s) len =3D s->cfg.bus_width / 8; } } else { - address_space_read(s->dma_as, src_addr, s->attr, s->buf, len); + address_space_read(&s->dma_as, src_addr, s->attr, s->buf, len); if (burst_type =3D=3D AXI_BURST_INCR) { src_addr +=3D len; } @@ -765,6 +765,12 @@ static void zdma_realize(DeviceState *dev, Error **err= p) XlnxZDMA *s =3D XLNX_ZDMA(dev); unsigned int i; =20 + if (!s->dma_mr) { + error_setg(errp, TYPE_XLNX_ZDMA " 'dma' link not set"); + return; + } + address_space_init(&s->dma_as, s->dma_mr, "zdma-dma"); + for (i =3D 0; i < ARRAY_SIZE(zdma_regs_info); ++i) { RegisterInfo *r =3D &s->regs_info[zdma_regs_info[i].addr / 4]; =20 @@ -777,12 +783,6 @@ static void zdma_realize(DeviceState *dev, Error **err= p) }; } =20 - if (s->dma_mr) { - s->dma_as =3D g_malloc0(sizeof(AddressSpace)); - address_space_init(s->dma_as, s->dma_mr, NULL); - } else { - s->dma_as =3D &address_space_memory; - } s->attr =3D MEMTXATTRS_UNSPECIFIED; } =20 --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997793; cv=none; d=zohomail.com; s=zohoarc; b=eECQE5v1ctongsX7AnqOsOCPB9BxKx7SSCdbwdqCW3YgZISncYAtu3msFBIR4eGNC6SsebCJiscwE6V5D91FDKSKXi9AQuawOCSUQrlEDIrkJlb/38x6DouvpcwwdK0iOA/JEKTXZzWdhbR2yhVHZiXGaVa/5VHRQEfw6I1Whzs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997793; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=x/Nq7lPd453gnrtSLW1mI2yW4d8E0EVPspmERk/DwAo=; b=b8kfULvxXqgwTiol5GGMVPZuwezHDow+gJR/AmJpq2oW9X7Gi4OsW8/PrnWTqvzEAM03YSKFl2bTfNhi0wusKIOTOOknHfIYPhBtB/YNg3L/3Dobheo1ZrjVpi/dtucwvsSAOS5jeN1NB3k8geJE8hZAUCGFcr6GY5Wh4ziW5UY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629997793961364.28798621015835; Thu, 26 Aug 2021 10:09:53 -0700 (PDT) Received: from localhost ([::1]:59718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIsy-0002Et-Pz for importer@patchew.org; Thu, 26 Aug 2021 13:09:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImg-00057p-44 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:22 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:34798) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImd-0008Hp-A1 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:21 -0400 Received: by mail-wr1-x430.google.com with SMTP id h13so6201635wrp.1 for ; Thu, 26 Aug 2021 10:03:16 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:14 -0700 (PDT) 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=x/Nq7lPd453gnrtSLW1mI2yW4d8E0EVPspmERk/DwAo=; b=ZsTzuPdOYNgrnjhcyGELA9LpGq2TGOzomIX1TyjBFGn5qXP2//Ntjv6n+N5M+aJh4F IHqOeWdR+3CLXgGcJjugx0dPCsEmfeBtyZJ6K2e2PpjLJMCJ+D4QmuyCG0XbxuyuoFAD h3e6Y42bXyBCTodJ+CoLBiBERSp4Dix8Ya2YRayUJU5V9PsP3z44+cfhx9yEruDqaPaf Rxke9zFUqJS8L/HNdzw71oerdM+3i1pmiHM5P7HpNMyhY1PQxjp71AlFRx7K7YUmwBrz pZd5ct6WRm+8ViXp48CCmuxjvOSwXXBzfnBRmLKZXeELdnCwo9KRIy0P4JX3gWltX0yd GAAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x/Nq7lPd453gnrtSLW1mI2yW4d8E0EVPspmERk/DwAo=; b=NnGEDceYB3YcTTYeiHMQI09ZTEaprlIqU+q1zJp2VF+05Y009+6vBigvUMmbCj9kVf m7vhrdqmvym/hcorbYC/lEAHAEMl1N20qOP8SlahB/+/dU5Vx+0+WlziiwaG1gLJ+Wya SRNPtElcxwofaLJ9cFGk+XdYLeNSaB5Rty7kCHtaUzwsi8UAuKs/XKxam9bRcrLnN37D pR5NmI9ZwnfXqFChwOaiyH8lnLeRiq/xGj2QMtG1XDkksfB7oOrHj0NfbYlIC8rCed6B amYY1c097+VMVnyOogBMX3veK08zo3En2My3/5yaZvgmA3c1+Ek5Y1D9Cg0751oXidbt W8QA== X-Gm-Message-State: AOAM532qd4fTCZKT66U/3082/rTTTrznBdT32wLhRewJyV6OQBkJbatI 7ZolPDoEIVWXp2BQgknmkEL0tq0jc3/1FQ== X-Google-Smtp-Source: ABdhPJxHD02ympb4C6d9GSEoc90ON4lpTqAhTioN6ZdjdGnUVUmhAXFGIufWeoROuyyaexiE1okU2w== X-Received: by 2002:adf:c40f:: with SMTP id v15mr2057940wrf.316.1629997395491; Thu, 26 Aug 2021 10:03:15 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/37] hw/arm/Kconfig: no need to enable ACPI_MEMORY_HOTPLUG/ACPI_NVDIMM explicitly Date: Thu, 26 Aug 2021 18:02:35 +0100 Message-Id: <20210826170307.27733-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997795509100001 From: Ani Sinha Since commit 36b79e3219d ("hw/acpi/Kconfig: Add missing Kconfig dependencies (build erro= r)"), ACPI_MEMORY_HOTPLUG and ACPI_NVDIMM is implicitly turned on when ACPI_HW_REDUCED is selected. ACPI_HW_REDUCED is already enabled. No need to turn on ACPI_MEMORY_HOTPLUG or ACPI_NVDIMM explicitly. This is a minor clea= nup. Signed-off-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20210819162637.518507-1-ani@anisinha.ca Signed-off-by: Peter Maydell --- hw/arm/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 4ba0aca0676..dc050b5c37f 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -25,9 +25,7 @@ config ARM_VIRT select ACPI_PCI select MEM_DEVICE select DIMM - select ACPI_MEMORY_HOTPLUG select ACPI_HW_REDUCED - select ACPI_NVDIMM select ACPI_APEI =20 config CHEETAH --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997894; cv=none; d=zohomail.com; s=zohoarc; b=WfE7lZwqJ2hvK4JR/SEdzZBWUpo4krKT4oAcC4ksgPn/+s6wofZ6CzhVztXNbGxjdloSgE9vqu7SXhgsaMIAnS4PMu7mRN1MKYlP1b7AF+Pda2CNKcG1GIMXleJdZSaBIiVJrPYvZRLVydYPsBHOihXQcmSVfsuIJn5CT2eCuFo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997894; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ekDeRLUXDV67GkBcdjvaNeAu7C7psK02VAbALc84YcU=; b=b5Y7SFDbidVyUbZ0l7AyVDnIDbqv64Ek7AapWPX6oOTNpHz7T9QjWSwK2ehcVyIJsxr0n8tKPeIdspvOmW3EFgSES1M16B02dGclZxiyAbh8H4354c1fT9r5k6j00T30+Jwle/ak9C9YMCGiqWBmHBjWO6AsBE0EDDo3ZpK99Yc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629997894192501.3548828517539; Thu, 26 Aug 2021 10:11:34 -0700 (PDT) Received: from localhost ([::1]:37160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIub-00065a-3R for importer@patchew.org; Thu, 26 Aug 2021 13:11:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImg-00059G-I2 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:22 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:44679) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImd-0008JS-9z for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:22 -0400 Received: by mail-wr1-x42a.google.com with SMTP id x12so6125391wrr.11 for ; Thu, 26 Aug 2021 10:03:17 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:15 -0700 (PDT) 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=ekDeRLUXDV67GkBcdjvaNeAu7C7psK02VAbALc84YcU=; b=V4jrOwQx2o8x7VG5Xio9v5W7bRUznMg0Yq9tcjDKx28KA1zPX9acwtTYrvKpn+Wdhf XQaRvBQ0NOEn8vkyEuAgLnU2SigNnNSphoVAv2J4DgPYztDG+nfcQTWu72N89NJbwIsr mqWetdjjSZ5ioa/SNbt7MUf4Edkjrhd7DJ/KLrtBiCtw+eQ1Ojyn7KRHO2IgqPboblVO 4DZsH3O8Nd5cWsdrj8FnIws2QfK+Oej96LfZqz2HZeDTb0mKIR+j95vm4HU9EtAnE2tp C0aTiY06COYxjYZF3CEXc2mtNeVwVJgtmUjqaQcXh9p11p8rK2PaR2p1dWhXwcgj4yca pBIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ekDeRLUXDV67GkBcdjvaNeAu7C7psK02VAbALc84YcU=; b=F/AnbR1OjNOxTw9ju8B3gUbZ/J93dpd+BWA7+w07wc/vQqqF/K/ksy1hD3jgljIPmB Rcr8j5Q2mWBXmkE5uQs5IPy7Cpj+XCCZdSrSD+BRxlc5M7TLlpTufMuNLT5y9Eg4crhn 53xPrxkosaRGIKIaecLCx/yF0qp2YtWWq8dbtsS+jLp1WWbdDX4y8eMGuYdGVevYNyvg B4UF0Bvmib02u7ZeRilrGATCU9FFd7QFgMwuc0L805DVRWV43uJ+5xZ9QnQrCYjuOznN C5cLHbbjB8yMQbiMM+t8g6b2j3HXcNzaiwVaFL9NGohZHXCG60hqRuxT7dtOUOFgPhdO bwbw== X-Gm-Message-State: AOAM532UkCblhHAloE6A0WV9yK/tdVW6uCd3vFd+m5boQS2N4B4BdISU fwiBjRWD3QqJfKVey5sJKdhpKptkhT1/Lg== X-Google-Smtp-Source: ABdhPJxz6bzVUETeKrjx/i3ghFieu6CcVfr8zG9JhOzarjCy/qQ09KZF8BxDfEAoTL042LKKRRnttQ== X-Received: by 2002:adf:e702:: with SMTP id c2mr5124842wrm.397.1629997396480; Thu, 26 Aug 2021 10:03:16 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/37] target/arm/cpu: Introduce sve_vq_supported bitmap Date: Thu, 26 Aug 2021 18:02:36 +0100 Message-Id: <20210826170307.27733-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997895514100001 From: Andrew Jones Allow CPUs that support SVE to specify which SVE vector lengths they support by setting them in this bitmap. Currently only the 'max' and 'host' CPU types supports SVE and 'host' requires KVM which obtains its supported bitmap from the host. So, we only need to initialize the bitmap for 'max' with TCG. And, since 'max' should support all SVE vector lengths we simply fill the bitmap. Future CPU types may have less trivial maps though. Signed-off-by: Andrew Jones Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20210823160647.34028-2-drjones@redhat.com Signed-off-by: Peter Maydell --- target/arm/cpu.h | 4 ++++ target/arm/cpu64.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 5cf8996ae3c..1060825c746 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1020,9 +1020,13 @@ struct ARMCPU { * While processing properties during initialization, corresponding * sve_vq_init bits are set for bits in sve_vq_map that have been * set by properties. + * + * Bits set in sve_vq_supported represent valid vector lengths for + * the CPU type. */ DECLARE_BITMAP(sve_vq_map, ARM_MAX_VQ); DECLARE_BITMAP(sve_vq_init, ARM_MAX_VQ); + DECLARE_BITMAP(sve_vq_supported, ARM_MAX_VQ); =20 /* Generic timer counter frequency, in Hz */ uint64_t gt_cntfrq_hz; diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index c690318a9b6..eb9318c83b7 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -840,6 +840,8 @@ static void aarch64_max_initfn(Object *obj) /* Default to PAUTH on, with the architected algorithm. */ qdev_property_add_static(DEVICE(obj), &arm_cpu_pauth_property); qdev_property_add_static(DEVICE(obj), &arm_cpu_pauth_impdef_proper= ty); + + bitmap_fill(cpu->sve_vq_supported, ARM_MAX_VQ); } =20 aarch64_add_sve_properties(obj); --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997972; cv=none; d=zohomail.com; s=zohoarc; b=LCaSwXuG3sFHGdXR5wh1qVVHXTbl4JaF380vaWihJCnbssy6x3CRucnCYjYI0RhouAFEwEM0U++iadcwbopX+D/KOvAjbNSpkAAT4DS57losQv5J2W+um1ZD3tPW79VTyXt32wP+sB/InJXTiAKJlK8lVneoN/NG4OJwMYkKzd4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997972; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EvoRcnyCFOrgqqPAPIvrI7CFDH0wKQC6sRUNatl+1mw=; b=auCGqzu+z5vp5TNv20FfoFktefeZ1p73zDW3v1EUhcxAkPMgChx88xrqgRckO3df+Vzefk2yb2CybOP6tNYwiOuE3DnNoFnuY0AHzRv+RmnT+Dn/nY7TetG87xLhjMHb/qf0IqECBrww39WYFPzVQQqJ03CpJX607gt3jPU6xIk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629997972337410.4208488271221; Thu, 26 Aug 2021 10:12:52 -0700 (PDT) Received: from localhost ([::1]:39926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIvr-0007zy-98 for importer@patchew.org; Thu, 26 Aug 2021 13:12:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImg-0005AG-Qp for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:22 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:42633) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImd-0008Jq-AG for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:22 -0400 Received: by mail-wm1-x32e.google.com with SMTP id k20-20020a05600c0b5400b002e87ad6956eso2659385wmr.1 for ; Thu, 26 Aug 2021 10:03:18 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:16 -0700 (PDT) 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=EvoRcnyCFOrgqqPAPIvrI7CFDH0wKQC6sRUNatl+1mw=; b=JG+62Ba+k+kJDfMH+BPDA39RmhbrkeDgPBh6Reg6r7ww62BJ2H+VkqwC3cW5AH/Si9 m22zHVctm9kD3hfXMSscUVH6CfpojO8L0hM4aoqEz34/glvsLolGA4P+2a+RZJff4oLo 9ToyVAObbrCrsn0/latZeJLWj/A21ML731mMMp7l6IplGG80D4q6azHxEzFRYfuHTp8k w56Thej10oK+PzwFYsmtI1YRCGJdhwtSZp2IQYoLmMKZepq+ZOj7GZwCSoD1JrTiDqJv x66Scy37zO42daBLae/ljL/b3NNZlyn+Fx8AkdV1WIa4pLI+/KXX9TIU5zr1u64qGCwQ rOXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EvoRcnyCFOrgqqPAPIvrI7CFDH0wKQC6sRUNatl+1mw=; b=CclPbqSf4DJIZqOWZqceSCh/JuRfidGAKszaGp2EjjT1cWEHloL5yDrAWT7fO+7n2V GIjbi1G1WYSzqBF+x0hmmixwVUNNS7VTjh8JburhAdd04CvVwtBOW6SVwnLIEZ1IKur4 DKVCbPD5U4n+5w/OjHzq5SEKM0iLOKKCZo284T1zIx4C4orocLPbZKqv4PobaH2HR6WO 9xDMJu+vMSZG6XzuE2mlgCcVYZ+26NFiXzpAJV5eoxmdcHhKSFw74PMqoIqrWPuBHjbm HlNnTd+/GuQMmiW9wgkj0huCUPKATwgIQIlVeYEh1LxkZhZtlD2qvFueO09ljSvGJ+7d byTQ== X-Gm-Message-State: AOAM533OwtKTmGBL6075VnFwo+/Qplc0+ttPC8ng+fFjEEZARS7Al+Jw +bLu/X0w26Av49kYRta+QH4w1JeODHavCA== X-Google-Smtp-Source: ABdhPJy4PEYtKNNVhwS8nq4kmcjVX8aDZSOpV8vBTWC9ZSAJq+EoF3lQ62wezuTg9tTuT47XRAAodA== X-Received: by 2002:a7b:c441:: with SMTP id l1mr4660745wmi.69.1629997397271; Thu, 26 Aug 2021 10:03:17 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/37] target/arm/kvm64: Ensure sve vls map is completely clear Date: Thu, 26 Aug 2021 18:02:37 +0100 Message-Id: <20210826170307.27733-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997974565100001 From: Andrew Jones bitmap_clear() only clears the given range. While the given range should be sufficient in this case we might as well be 100% sure all bits are zeroed by using bitmap_zero(). Signed-off-by: Andrew Jones Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20210823160647.34028-3-drjones@redhat.com Signed-off-by: Peter Maydell --- target/arm/kvm64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 59982d470d3..e790d6c9a57 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -740,7 +740,7 @@ void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *m= ap) uint32_t vq =3D 0; int i, j; =20 - bitmap_clear(map, 0, ARM_MAX_VQ); + bitmap_zero(map, ARM_MAX_VQ); =20 /* * KVM ensures all host CPUs support the same set of vector lengths. --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998077; cv=none; d=zohomail.com; s=zohoarc; b=cUzum0J9XRGLThF0if6I59gbbJrPoiZmJII3f6PmqnQR8Ko7XgTNqiGXuVcWo1ih66V3tAAUMUtmox73Yn//O98ZF/jprcmtV29WcWW1LoXLdPXUpdfgdQ5/pLhir8MrCsxRNr1KYQ6SXPNc3eo4rLA/2NrW1hhe8wLIogXkrjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998077; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tyR1y0HDeb4qDYNOGLutqZ2YiIjaqyovJPhaX/u5RCk=; b=WVc90lzEZXb8jh2CXnMCdh31hpb/8tZzwox0MkHO7JenrzulBTl8Tbh4WOaTgorj0oeRbuk6I8nO5PJZGKJMySTEykTnYS40kgtadKWsRCi5jhd7sQqNgJq2b7KgRQ9YVvtZxTVIPwlErWBqDMEL6Qgs7xENHSblwz5fE+9GQhI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998077531365.6421077374936; Thu, 26 Aug 2021 10:14:37 -0700 (PDT) Received: from localhost ([::1]:48534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIxY-0005Iz-H1 for importer@patchew.org; Thu, 26 Aug 2021 13:14:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImi-0005FI-FM for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:24 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:33759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImd-0008Jx-Tj for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:24 -0400 Received: by mail-wm1-x335.google.com with SMTP id j14-20020a1c230e000000b002e748b9a48bso5954454wmj.0 for ; Thu, 26 Aug 2021 10:03:19 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:17 -0700 (PDT) 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=tyR1y0HDeb4qDYNOGLutqZ2YiIjaqyovJPhaX/u5RCk=; b=r0VOVJgvnqQAIROCgP/vEh61C8Viks7tdU6rWw3GuFrDnM1YdvqgWRrJiyAlikHnSf m53DGyTkti/HCzBKV92d2MOUKzNY66bNdSvGZ/gno6/A7QAcOjRhO9SGv5kvwGNfdzVw qZnhmiCt3fw/MnmuBTJ8SXCnZVbZjdr30j+keUkBoNDJZf5HKMRIGmmuJnBvI7SFixu/ r5fa7cWW0kUtlv5EFaq0DLwWTcRisMw7lUP6iMckveOvEhtqOyIq9eAxwO6XFCPaqGki gZV1pL6DQ1dcFso6kDMpqyLqPdevM2myhwOrBMkocQIfuJSi3GyZduDxHsJ/1meoVn5P +K4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tyR1y0HDeb4qDYNOGLutqZ2YiIjaqyovJPhaX/u5RCk=; b=a77vWiojOVQnqwgM+NgdrxhqCZChKraiKcvMQt470cu9FAuFlqPAjFKsm0UMRU++fS M5R2t+kICr+8/9ZuEs9HQLQALA2/OlyPF5JlqzbUSm71x/dJjSb7PoMyXg1w3yKHM12m W7ohD+W7tN90vX4OpKWH0jv5FFnSM9ijniNzMOsq0hQT2hZngqFIkqWl2TL15pMT1DwR dltfLv6KXUKGtKORHp3Bx80wHk9xA+OM7gcxi9FcFvM+7EcCR934WvtgieTxUWFxC/FW RMMs0Rgy5a3PWJX9nKsblfALVXcez2hzv3vLeMwfFWbhPPC1PzfQlNBzqjNgSgkEMtBe H0aQ== X-Gm-Message-State: AOAM531WBc2pT1v88wT4daQAFD/LFMwstBlCLQziCX5eR7Oi3SsI9CJs 1SS2Ky3lZwT7B3skWGuhT7lsh6m3FR6UwQ== X-Google-Smtp-Source: ABdhPJwJdl7dmTI2nCmFKYKloiS/ieSIgtjEWHq+KjkfDP7W+Fw3tbEBFnJZxsXd4LvMgy9fhPeuOg== X-Received: by 2002:a05:600c:3514:: with SMTP id h20mr15521753wmq.31.1629997398429; Thu, 26 Aug 2021 10:03:18 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/37] target/arm/cpu64: Replace kvm_supported with sve_vq_supported Date: Thu, 26 Aug 2021 18:02:38 +0100 Message-Id: <20210826170307.27733-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998078146100001 From: Andrew Jones Now that we have an ARMCPU member sve_vq_supported we no longer need the local kvm_supported bitmap for KVM's supported vector lengths. Signed-off-by: Andrew Jones Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20210823160647.34028-4-drjones@redhat.com Signed-off-by: Peter Maydell --- target/arm/cpu64.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index eb9318c83b7..557fd475774 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -265,14 +265,17 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) * any of the above. Finally, if SVE is not disabled, then at least o= ne * vector length must be enabled. */ - DECLARE_BITMAP(kvm_supported, ARM_MAX_VQ); DECLARE_BITMAP(tmp, ARM_MAX_VQ); uint32_t vq, max_vq =3D 0; =20 - /* Collect the set of vector lengths supported by KVM. */ - bitmap_zero(kvm_supported, ARM_MAX_VQ); + /* + * CPU models specify a set of supported vector lengths which are + * enabled by default. Attempting to enable any vector length not set + * in the supported bitmap results in an error. When KVM is enabled we + * fetch the supported bitmap from the host. + */ if (kvm_enabled() && kvm_arm_sve_supported()) { - kvm_arm_sve_get_vls(CPU(cpu), kvm_supported); + kvm_arm_sve_get_vls(CPU(cpu), cpu->sve_vq_supported); } else if (kvm_enabled()) { assert(!cpu_isar_feature(aa64_sve, cpu)); } @@ -299,7 +302,7 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) * For KVM we have to automatically enable all supported uniti= alized * lengths, even when the smaller lengths are not all powers-o= f-two. */ - bitmap_andnot(tmp, kvm_supported, cpu->sve_vq_init, max_vq); + bitmap_andnot(tmp, cpu->sve_vq_supported, cpu->sve_vq_init, ma= x_vq); bitmap_or(cpu->sve_vq_map, cpu->sve_vq_map, tmp, max_vq); } else { /* Propagate enabled bits down through required powers-of-two.= */ @@ -322,12 +325,12 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) /* Disabling a supported length disables all larger lengths. */ for (vq =3D 1; vq <=3D ARM_MAX_VQ; ++vq) { if (test_bit(vq - 1, cpu->sve_vq_init) && - test_bit(vq - 1, kvm_supported)) { + test_bit(vq - 1, cpu->sve_vq_supported)) { break; } } max_vq =3D vq <=3D ARM_MAX_VQ ? vq - 1 : ARM_MAX_VQ; - bitmap_andnot(cpu->sve_vq_map, kvm_supported, + bitmap_andnot(cpu->sve_vq_map, cpu->sve_vq_supported, cpu->sve_vq_init, max_vq); if (max_vq =3D=3D 0 || bitmap_empty(cpu->sve_vq_map, max_vq)) { error_setg(errp, "cannot disable sve%d", vq * 128); @@ -392,7 +395,7 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) =20 if (kvm_enabled()) { /* Ensure the set of lengths matches what KVM supports. */ - bitmap_xor(tmp, cpu->sve_vq_map, kvm_supported, max_vq); + bitmap_xor(tmp, cpu->sve_vq_map, cpu->sve_vq_supported, max_vq); if (!bitmap_empty(tmp, max_vq)) { vq =3D find_last_bit(tmp, max_vq) + 1; if (test_bit(vq - 1, cpu->sve_vq_map)) { --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998049; cv=none; d=zohomail.com; s=zohoarc; b=OpmE4zKZ2zbX43OkWFT/vNRa90D03IBl9xZU6hw2Lo/Gaz1FxhCcluvfjvTBLOiFz8aGLwGB1D3nlDhFOsKbY7Y6pJoax91daYV1OM8AWHmkXZHBZeDR4dWRNWWTtaTpUq7AVWmcRsV7pnyDLiusj2thstEZLZPufLRjlWhs8lI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998049; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6qj0VLNCYgASFVMdt6JQgvSntH4PzChad90nSq2diw8=; b=LUtf6F/oPmKY7Ae6mjwmh9+6HwsJRSmo4GwpJWAM7Ec7IkipPzcUmdPfypeQ4fg9q4F2l70KJQqgDwmcb/vUCw4j/Y2s2BuvBhLS250E1gCvVK0oY2num9Aw2hjOb9+OgiENelo1T0odoIQNXT3EEpbffb3qhi7VviPNy22WyX0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998049657816.9579187423587; Thu, 26 Aug 2021 10:14:09 -0700 (PDT) Received: from localhost ([::1]:45772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIx6-0003RV-Ii for importer@patchew.org; Thu, 26 Aug 2021 13:14:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImi-0005G7-O6 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:24 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:39914) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImf-0008KP-0V for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:24 -0400 Received: by mail-wm1-x331.google.com with SMTP id f9-20020a05600c1549b029025b0f5d8c6cso7370562wmg.4 for ; Thu, 26 Aug 2021 10:03:20 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:19 -0700 (PDT) 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=6qj0VLNCYgASFVMdt6JQgvSntH4PzChad90nSq2diw8=; b=MZi2+VrEkyt4tG3ILqXMrkqfwNn4YP+ZyPxPbz73FFvCIPC2PqI3n1WS7D4LwHyUxk VyVZdisJVA7cOVVb7cOeXeh7GO0MwNr5O3/g3Ntw6t9vHm7HuytntL9cGrY8vRNZp7y2 tvMIV8GCQsaA6Qpz97885BItW7xyOwiAkSzAnOpXj3zwBFTCT6i9JrAqAbJh1E0/eMLs bZjmNr/0vGU5tUAaUVnyay4hK9A4Dj318EeDcbwDrzDPJ7FsYYZ4BxDe2D6gLvON4uQm l+gSD4Z4u5v6DUErd3jqREpPOkJq5aeRiJxPRnKbKgRyzwOnZ/KAuuqo3jzhll/r1IZ6 CB+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6qj0VLNCYgASFVMdt6JQgvSntH4PzChad90nSq2diw8=; b=EEZkw/9dT2qCIqWWROMXsTc/LASzP+eKNFOvhpARQYEVbnHqGpCd43ifLf8PeIC+o7 cJZ4KAB5Jpi6c/wE3gX1fiLdbc4abn3GhC3kHSvD7bQ5HOkFg/c1tHSjIf+ILM6ooyks KCNfwD6ujVdpqoUcTmW7QBe/4gmB0ruYZvYj5kaHHcUan4zVgLoykb/w7tULJ26ioFtx w+QVMi94cyXTwz7Oymb4fflJ5APwsQxHpso0Xaykh8/rFA9KUnQu+tkkjjd4SZ8ma8e2 2/zeB6E5/ExWT+igmwhA6vkjZiOSvN+KeBw1D3+oRigRHJAoOA0oB1RBUPNjjfpWTY4F ++Xg== X-Gm-Message-State: AOAM530j/beTcabvFfx+/eWzv/GDQJG0XEUZOw1NrnP11p6td24EncE7 X0sGLlrAQSy0Wnodvy75zrPNf9jkeYcogA== X-Google-Smtp-Source: ABdhPJwtNIO6Op4TNELyxmraFcNSnICAMd2m1UsDcA8BQdmlLnHogXYPsQleqxW61n+TXEB6t7CoJQ== X-Received: by 2002:a1c:1c2:: with SMTP id 185mr4628330wmb.11.1629997399564; Thu, 26 Aug 2021 10:03:19 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/37] target/arm/cpu64: Validate sve vector lengths are supported Date: Thu, 26 Aug 2021 18:02:39 +0100 Message-Id: <20210826170307.27733-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998051902100001 Content-Type: text/plain; charset="utf-8" From: Andrew Jones Future CPU types may specify which vector lengths are supported. We can apply nearly the same logic to validate those lengths as we do for KVM's supported vector lengths. We merge the code where we can, but unfortunately can't completely merge it because KVM requires all vector lengths, power-of-two or not, smaller than the maximum enabled length to also be enabled. The architecture only requires all the power-of-two lengths, though, so TCG will only enforce that. Signed-off-by: Andrew Jones Reviewed-by: Richard Henderson Message-id: 20210823160647.34028-5-drjones@redhat.com Signed-off-by: Peter Maydell --- target/arm/cpu64.c | 101 ++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 56 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 557fd475774..2f0cbddab56 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -329,35 +329,26 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) break; } } - max_vq =3D vq <=3D ARM_MAX_VQ ? vq - 1 : ARM_MAX_VQ; - bitmap_andnot(cpu->sve_vq_map, cpu->sve_vq_supported, - cpu->sve_vq_init, max_vq); - if (max_vq =3D=3D 0 || bitmap_empty(cpu->sve_vq_map, max_vq)) { - error_setg(errp, "cannot disable sve%d", vq * 128); - error_append_hint(errp, "Disabling sve%d results in all " - "vector lengths being disabled.\n", - vq * 128); - error_append_hint(errp, "With SVE enabled, at least one " - "vector length must be enabled.\n"); - return; - } } else { /* Disabling a power-of-two disables all larger lengths. */ - if (test_bit(0, cpu->sve_vq_init)) { - error_setg(errp, "cannot disable sve128"); - error_append_hint(errp, "Disabling sve128 results in all " - "vector lengths being disabled.\n"); - error_append_hint(errp, "With SVE enabled, at least one " - "vector length must be enabled.\n"); - return; - } - for (vq =3D 2; vq <=3D ARM_MAX_VQ; vq <<=3D 1) { + for (vq =3D 1; vq <=3D ARM_MAX_VQ; vq <<=3D 1) { if (test_bit(vq - 1, cpu->sve_vq_init)) { break; } } - max_vq =3D vq <=3D ARM_MAX_VQ ? vq - 1 : ARM_MAX_VQ; - bitmap_complement(cpu->sve_vq_map, cpu->sve_vq_init, max_vq); + } + + max_vq =3D vq <=3D ARM_MAX_VQ ? vq - 1 : ARM_MAX_VQ; + bitmap_andnot(cpu->sve_vq_map, cpu->sve_vq_supported, + cpu->sve_vq_init, max_vq); + if (max_vq =3D=3D 0 || bitmap_empty(cpu->sve_vq_map, max_vq)) { + error_setg(errp, "cannot disable sve%d", vq * 128); + error_append_hint(errp, "Disabling sve%d results in all " + "vector lengths being disabled.\n", + vq * 128); + error_append_hint(errp, "With SVE enabled, at least one " + "vector length must be enabled.\n"); + return; } =20 max_vq =3D find_last_bit(cpu->sve_vq_map, max_vq) + 1; @@ -393,46 +384,44 @@ void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) assert(max_vq !=3D 0); bitmap_clear(cpu->sve_vq_map, max_vq, ARM_MAX_VQ - max_vq); =20 - if (kvm_enabled()) { - /* Ensure the set of lengths matches what KVM supports. */ - bitmap_xor(tmp, cpu->sve_vq_map, cpu->sve_vq_supported, max_vq); - if (!bitmap_empty(tmp, max_vq)) { - vq =3D find_last_bit(tmp, max_vq) + 1; - if (test_bit(vq - 1, cpu->sve_vq_map)) { - if (cpu->sve_max_vq) { - error_setg(errp, "cannot set sve-max-vq=3D%d", - cpu->sve_max_vq); - error_append_hint(errp, "This KVM host does not suppor= t " - "the vector length %d-bits.\n", - vq * 128); - error_append_hint(errp, "It may not be possible to use= " - "sve-max-vq with this KVM host. Try " - "using only sve properties.\n"); - } else { - error_setg(errp, "cannot enable sve%d", vq * 128); - error_append_hint(errp, "This KVM host does not suppor= t " - "the vector length %d-bits.\n", - vq * 128); - } + /* Ensure the set of lengths matches what is supported. */ + bitmap_xor(tmp, cpu->sve_vq_map, cpu->sve_vq_supported, max_vq); + if (!bitmap_empty(tmp, max_vq)) { + vq =3D find_last_bit(tmp, max_vq) + 1; + if (test_bit(vq - 1, cpu->sve_vq_map)) { + if (cpu->sve_max_vq) { + error_setg(errp, "cannot set sve-max-vq=3D%d", cpu->sve_ma= x_vq); + error_append_hint(errp, "This CPU does not support " + "the vector length %d-bits.\n", vq * 128= ); + error_append_hint(errp, "It may not be possible to use " + "sve-max-vq with this CPU. Try " + "using only sve properties.\n"); } else { + error_setg(errp, "cannot enable sve%d", vq * 128); + error_append_hint(errp, "This CPU does not support " + "the vector length %d-bits.\n", vq * 128= ); + } + return; + } else { + if (kvm_enabled()) { error_setg(errp, "cannot disable sve%d", vq * 128); error_append_hint(errp, "The KVM host requires all " "supported vector lengths smaller " "than %d bits to also be enabled.\n", max_vq * 128); - } - return; - } - } else { - /* Ensure all required powers-of-two are enabled. */ - for (vq =3D pow2floor(max_vq); vq >=3D 1; vq >>=3D 1) { - if (!test_bit(vq - 1, cpu->sve_vq_map)) { - error_setg(errp, "cannot disable sve%d", vq * 128); - error_append_hint(errp, "sve%d is required as it " - "is a power-of-two length smaller than " - "the maximum, sve%d\n", - vq * 128, max_vq * 128); return; + } else { + /* Ensure all required powers-of-two are enabled. */ + for (vq =3D pow2floor(max_vq); vq >=3D 1; vq >>=3D 1) { + if (!test_bit(vq - 1, cpu->sve_vq_map)) { + error_setg(errp, "cannot disable sve%d", vq * 128); + error_append_hint(errp, "sve%d is required as it " + "is a power-of-two length smalle= r " + "than the maximum, sve%d\n", + vq * 128, max_vq * 128); + return; + } + } } } } --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998268; cv=none; d=zohomail.com; s=zohoarc; b=Qk92PVPRmGOCeXbeKT0PRw7bD7bU2oYVGZjx8zu3ZltdW9lBd4NaLhyjQfio0bIwyWzWmUwkkfrmNQ35vrRqQ5HPgxq9BA3mX/k0ZaZf+zwrt7Eupx0VIp8nYYrEgfFG05HcmDVX1QOrMVPMANw/D98yOvlYT1jyFzYXR43zT2g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998268; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bpKy06aWQHGk5o8oeE1BHvM+Caiu8yoY/ltq+d1ag6s=; b=OIhaR4mpFgYHwmPN9Vh92qae18zwK9/Q23bLK50TkIzRNeo0G1ngFSOGvBp/lFePb0W9R/J+PpkRH37VH1XS1tl1ivSVJaSAJUVz3tilftV36BSU0uxN//Tf90HRdYdnTVlmaf+MYHa6s6bkZwLakGJudGrM8QIQlCYPIf14bSc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998268912677.5845072689523; Thu, 26 Aug 2021 10:17:48 -0700 (PDT) Received: from localhost ([::1]:57142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ0d-0002go-JL for importer@patchew.org; Thu, 26 Aug 2021 13:17:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImk-0005La-LA for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:26 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:33556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImg-0008MM-IK for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:26 -0400 Received: by mail-wr1-x42b.google.com with SMTP id d26so6252070wrc.0 for ; Thu, 26 Aug 2021 10:03:22 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:20 -0700 (PDT) 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=bpKy06aWQHGk5o8oeE1BHvM+Caiu8yoY/ltq+d1ag6s=; b=Y72MQp6KWceCt6kkPIj4YFBefTrAvdeCyU2RB2u5DJYIQ+sVV+0UjSU6OC0E5jYUW2 PrK89Y+Y39pFV0B73SU0uJBF/Yes4E71kh5zETuq8Ru1umWiO/PYmh2UFcjK7aoiNC3S 3zw/qqCQ3WqDZT1qW2mpJsWo6K60wjGOGVUDga2BrarVN1jnhsrtDeLkOcRzHRCZWN7r X/hcteOPWJYfcgfJrUbfYpvNTiiRykDru61iSVfsAmHhCH9d8hrq8iFtWlrhYzhP8oJQ h+dYyWvvd7pJppWqKfBmMqU1zlrMDf8XiRgCpC61MPk/acOMZUL6/qHu2UtNV8bn12ar h+PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bpKy06aWQHGk5o8oeE1BHvM+Caiu8yoY/ltq+d1ag6s=; b=LBp8dQr7jWk9QNdS/F/rQVRYKmmBiFliuI9RTCGgItxupL7lBmMjAwoZG1M9lb79eb pb0jlLzAFvrKUDOFsPAb1ZZnKLIfvqyHhihMHDDpKGrtYcSjxU4CKEHgimkDmtKhyhZt uv+h/sCm819v5wDrvivu7A2l8GMW5ueGYYqnFjKeVRv7cwjW1TmnRLS5hCKj+L+mhbB1 ptdsMbHpXTsQjuuzpnRr7dcsIa+3xtW5KQ0UNqI4ZrNl/sbA2dOJwvDx4qIRbPtKjJ3L VSheoqWHA+1V7X/n0q5CDEg8QL4pnQOLH8PKR29+kRSPxT+ANkBjzZfXNOwgOYrjBPsm OLSQ== X-Gm-Message-State: AOAM532ut7GnHd+4LxsRy2wvckQHRE+gLMDW7CvzzZsP995uslIDwZUK tHwAmlXRHfl4xqeR8Ut5ZbLjEWEwfGFSag== X-Google-Smtp-Source: ABdhPJwPDNhgjee5ciyYC712Qbo8Xd1aGyERTNGkBT2ELiQQT3wdtoRgP3YVapSmLnddeKdn+hvo5g== X-Received: by 2002:adf:fb44:: with SMTP id c4mr5101210wrs.179.1629997400789; Thu, 26 Aug 2021 10:03:20 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/37] docs/specs/acpu_cpu_hotplug: Convert to rST Date: Thu, 26 Aug 2021 18:02:40 +0100 Message-Id: <20210826170307.27733-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998269951100001 Content-Type: text/plain; charset="utf-8" Do a basic conversion of the acpi_cpu_hotplug spec document to rST. Signed-off-by: Peter Maydell Reviewed-by: Igor Mammedov Message-id: 20210727170414.3368-2-peter.maydell@linaro.org --- docs/specs/acpi_cpu_hotplug.rst | 235 ++++++++++++++++++++++++++++++++ docs/specs/acpi_cpu_hotplug.txt | 160 ---------------------- docs/specs/index.rst | 1 + 3 files changed, 236 insertions(+), 160 deletions(-) create mode 100644 docs/specs/acpi_cpu_hotplug.rst delete mode 100644 docs/specs/acpi_cpu_hotplug.txt diff --git a/docs/specs/acpi_cpu_hotplug.rst b/docs/specs/acpi_cpu_hotplug.= rst new file mode 100644 index 00000000000..351057c9676 --- /dev/null +++ b/docs/specs/acpi_cpu_hotplug.rst @@ -0,0 +1,235 @@ +QEMU<->ACPI BIOS CPU hotplug interface +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +QEMU supports CPU hotplug via ACPI. This document +describes the interface between QEMU and the ACPI BIOS. + +ACPI BIOS GPE.2 handler is dedicated for notifying OS about CPU hot-add +and hot-remove events. + + +Legacy ACPI CPU hotplug interface registers +------------------------------------------- + +CPU present bitmap for: + +- ICH9-LPC (IO port 0x0cd8-0xcf7, 1-byte access) +- PIIX-PM (IO port 0xaf00-0xaf1f, 1-byte access) +- One bit per CPU. Bit position reflects corresponding CPU APIC ID. Read-o= nly. +- The first DWORD in bitmap is used in write mode to switch from legacy + to modern CPU hotplug interface, write 0 into it to do switch. + +QEMU sets corresponding CPU bit on hot-add event and issues SCI +with GPE.2 event set. CPU present map is read by ACPI BIOS GPE.2 handler +to notify OS about CPU hot-add events. CPU hot-remove isn't supported. + + +Modern ACPI CPU hotplug interface registers +------------------------------------------- + +Register block base address: + +- ICH9-LPC IO port 0x0cd8 +- PIIX-PM IO port 0xaf00 + +Register block size: + +- ACPI_CPU_HOTPLUG_REG_LEN =3D 12 + +All accesses to registers described below, imply little-endian byte order. + +Reserved registers behavior: + +- write accesses are ignored +- read accesses return all bits set to 0. + +The last stored value in 'CPU selector' must refer to a possible CPU, othe= rwise + +- reads from any register return 0 +- writes to any other register are ignored until valid value is stored int= o it + +On QEMU start, 'CPU selector' is initialized to a valid value, on reset it +keeps the current value. + +Read access behavior +^^^^^^^^^^^^^^^^^^^^ + +offset [0x0-0x3] + Command data 2: (DWORD access) + + If value last stored in 'Command field' is: + + 0: + reads as 0x0 + 3: + upper 32 bits of architecture specific CPU ID value + other values: + reserved + +offset [0x4] + CPU device status fields: (1 byte access) + + bits: + + 0: + Device is enabled and may be used by guest + 1: + Device insert event, used to distinguish device for which + no device check event to OSPM was issued. + It's valid only when bit 0 is set. + 2: + Device remove event, used to distinguish device for which + no device eject request to OSPM was issued. Firmware must + ignore this bit. + 3: + reserved and should be ignored by OSPM + 4: + if set to 1, OSPM requests firmware to perform device eject. + 5-7: + reserved and should be ignored by OSPM + +offset [0x5-0x7] + reserved + +offset [0x8] + Command data: (DWORD access) + + If value last stored in 'Command field' is one of: + + 0: + contains 'CPU selector' value of a CPU with pending event[s] + 3: + lower 32 bits of architecture specific CPU ID value + (in x86 case: APIC ID) + otherwise: + contains 0 + +Write access behavior +^^^^^^^^^^^^^^^^^^^^^ + +offset [0x0-0x3] + CPU selector: (DWORD access) + + Selects active CPU device. All following accesses to other + registers will read/store data from/to selected CPU. + Valid values: [0 .. max_cpus) + +offset [0x4] + CPU device control fields: (1 byte access) + + bits: + + 0: + reserved, OSPM must clear it before writing to register. + 1: + if set to 1 clears device insert event, set by OSPM + after it has emitted device check event for the + selected CPU device + 2: + if set to 1 clears device remove event, set by OSPM + after it has emitted device eject request for the + selected CPU device. + 3: + if set to 1 initiates device eject, set by OSPM when it + triggers CPU device removal and calls _EJ0 method or by firmware + when bit #4 is set. In case bit #4 were set, it's cleared as + part of device eject. + 4: + if set to 1, OSPM hands over device eject to firmware. + Firmware shall issue device eject request as described above + (bit #3) and OSPM should not touch device eject bit (#3) in case + it's asked firmware to perform CPU device eject. + 5-7: + reserved, OSPM must clear them before writing to register + +offset[0x5] + Command field: (1 byte access) + + value: + + 0: + selects a CPU device with inserting/removing events and + following reads from 'Command data' register return + selected CPU ('CPU selector' value). + If no CPU with events found, the current 'CPU selector' doesn't + change and corresponding insert/remove event flags are not modified. + + 1: + following writes to 'Command data' register set OST event + register in QEMU + 2: + following writes to 'Command data' register set OST status + register in QEMU + 3: + following reads from 'Command data' and 'Command data 2' return + architecture specific CPU ID value for currently selected CPU. + other values: + reserved + +offset [0x6-0x7] + reserved + +offset [0x8] + Command data: (DWORD access) + + If last stored 'Command field' value is: + + 1: + stores value into OST event register + 2: + stores value into OST status register, triggers + ACPI_DEVICE_OST QMP event from QEMU to external applications + with current values of OST event and status registers. + other values: + reserved + +Typical usecases +---------------- + +(x86) Detecting and enabling modern CPU hotplug interface +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +QEMU starts with legacy CPU hotplug interface enabled. Detecting and +switching to modern interface is based on the 2 legacy CPU hotplug feature= s: + +#. Writes into CPU bitmap are ignored. +#. CPU bitmap always has bit #0 set, corresponding to boot CPU. + +Use following steps to detect and enable modern CPU hotplug interface: + +#. Store 0x0 to the 'CPU selector' register, attempting to switch to moder= n mode +#. Store 0x0 to the 'CPU selector' register, to ensure valid selector value +#. Store 0x0 to the 'Command field' register +#. Read the 'Command data 2' register. + If read value is 0x0, the modern interface is enabled. + Otherwise legacy or no CPU hotplug interface available + +Get a cpu with pending event +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +#. Store 0x0 to the 'CPU selector' register. +#. Store 0x0 to the 'Command field' register. +#. Read the 'CPU device status fields' register. +#. If both bit #1 and bit #2 are clear in the value read, there is no CPU + with a pending event and selected CPU remains unchanged. +#. Otherwise, read the 'Command data' register. The value read is the + selector of the CPU with the pending event (which is already selected). + +Enumerate CPUs present/non present CPUs +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +#. Set the present CPU count to 0. +#. Set the iterator to 0. +#. Store 0x0 to the 'CPU selector' register, to ensure that it's in + a valid state and that access to other registers won't be ignored. +#. Store 0x0 to the 'Command field' register to make 'Command data' + register return 'CPU selector' value of selected CPU +#. Read the 'CPU device status fields' register. +#. If bit #0 is set, increment the present CPU count. +#. Increment the iterator. +#. Store the iterator to the 'CPU selector' register. +#. Read the 'Command data' register. +#. If the value read is not zero, goto 05. +#. Otherwise store 0x0 to the 'CPU selector' register, to put it + into a valid state and exit. + The iterator at this point equals "max_cpus". diff --git a/docs/specs/acpi_cpu_hotplug.txt b/docs/specs/acpi_cpu_hotplug.= txt deleted file mode 100644 index 9bd59ae0dae..00000000000 --- a/docs/specs/acpi_cpu_hotplug.txt +++ /dev/null @@ -1,160 +0,0 @@ -QEMU<->ACPI BIOS CPU hotplug interface --------------------------------------- - -QEMU supports CPU hotplug via ACPI. This document -describes the interface between QEMU and the ACPI BIOS. - -ACPI BIOS GPE.2 handler is dedicated for notifying OS about CPU hot-add -and hot-remove events. - -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -Legacy ACPI CPU hotplug interface registers: --------------------------------------------- -CPU present bitmap for: - ICH9-LPC (IO port 0x0cd8-0xcf7, 1-byte access) - PIIX-PM (IO port 0xaf00-0xaf1f, 1-byte access) - One bit per CPU. Bit position reflects corresponding CPU APIC ID. Read-o= nly. - The first DWORD in bitmap is used in write mode to switch from legacy - to modern CPU hotplug interface, write 0 into it to do switch. ---------------------------------------------------------------- -QEMU sets corresponding CPU bit on hot-add event and issues SCI -with GPE.2 event set. CPU present map is read by ACPI BIOS GPE.2 handler -to notify OS about CPU hot-add events. CPU hot-remove isn't supported. - -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -Modern ACPI CPU hotplug interface registers: -------------------------------------- -Register block base address: - ICH9-LPC IO port 0x0cd8 - PIIX-PM IO port 0xaf00 -Register block size: - ACPI_CPU_HOTPLUG_REG_LEN =3D 12 - -All accesses to registers described below, imply little-endian byte order. - -Reserved resisters behavior: - - write accesses are ignored - - read accesses return all bits set to 0. - -The last stored value in 'CPU selector' must refer to a possible CPU, othe= rwise - - reads from any register return 0 - - writes to any other register are ignored until valid value is stored i= nto it -On QEMU start, 'CPU selector' is initialized to a valid value, on reset it -keeps the current value. - -read access: - offset: - [0x0-0x3] Command data 2: (DWORD access) - if value last stored in 'Command field': - 0: reads as 0x0 - 3: upper 32 bits of architecture specific CPU ID value - other values: reserved - [0x4] CPU device status fields: (1 byte access) - bits: - 0: Device is enabled and may be used by guest - 1: Device insert event, used to distinguish device for which - no device check event to OSPM was issued. - It's valid only when bit 0 is set. - 2: Device remove event, used to distinguish device for which - no device eject request to OSPM was issued. Firmware must - ignore this bit. - 3: reserved and should be ignored by OSPM - 4: if set to 1, OSPM requests firmware to perform device eject. - 5-7: reserved and should be ignored by OSPM - [0x5-0x7] reserved - [0x8] Command data: (DWORD access) - contains 0 unless value last stored in 'Command field' is one of: - 0: contains 'CPU selector' value of a CPU with pending event= [s] - 3: lower 32 bits of architecture specific CPU ID value - (in x86 case: APIC ID) - -write access: - offset: - [0x0-0x3] CPU selector: (DWORD access) - selects active CPU device. All following accesses to other - registers will read/store data from/to selected CPU. - Valid values: [0 .. max_cpus) - [0x4] CPU device control fields: (1 byte access) - bits: - 0: reserved, OSPM must clear it before writing to register. - 1: if set to 1 clears device insert event, set by OSPM - after it has emitted device check event for the - selected CPU device - 2: if set to 1 clears device remove event, set by OSPM - after it has emitted device eject request for the - selected CPU device. - 3: if set to 1 initiates device eject, set by OSPM when it - triggers CPU device removal and calls _EJ0 method or by fir= mware - when bit #4 is set. In case bit #4 were set, it's cleared as - part of device eject. - 4: if set to 1, OSPM hands over device eject to firmware. - Firmware shall issue device eject request as described above - (bit #3) and OSPM should not touch device eject bit (#3) in= case - it's asked firmware to perform CPU device eject. - 5-7: reserved, OSPM must clear them before writing to register - [0x5] Command field: (1 byte access) - value: - 0: selects a CPU device with inserting/removing events and - following reads from 'Command data' register return - selected CPU ('CPU selector' value). - If no CPU with events found, the current 'CPU selector' doe= sn't - change and corresponding insert/remove event flags are not = modified. - 1: following writes to 'Command data' register set OST event - register in QEMU - 2: following writes to 'Command data' register set OST status - register in QEMU - 3: following reads from 'Command data' and 'Command data 2' re= turn - architecture specific CPU ID value for currently selected C= PU. - other values: reserved - [0x6-0x7] reserved - [0x8] Command data: (DWORD access) - if last stored 'Command field' value: - 1: stores value into OST event register - 2: stores value into OST status register, triggers - ACPI_DEVICE_OST QMP event from QEMU to external applicati= ons - with current values of OST event and status registers. - other values: reserved - -Typical usecases: - - (x86) Detecting and enabling modern CPU hotplug interface. - QEMU starts with legacy CPU hotplug interface enabled. Detecting and - switching to modern interface is based on the 2 legacy CPU hotplug f= eatures: - 1. Writes into CPU bitmap are ignored. - 2. CPU bitmap always has bit#0 set, corresponding to boot CPU. - - Use following steps to detect and enable modern CPU hotplug interfac= e: - 1. Store 0x0 to the 'CPU selector' register, - attempting to switch to modern mode - 2. Store 0x0 to the 'CPU selector' register, - to ensure valid selector value - 3. Store 0x0 to the 'Command field' register, - 4. Read the 'Command data 2' register. - If read value is 0x0, the modern interface is enabled. - Otherwise legacy or no CPU hotplug interface available - - - Get a cpu with pending event - 1. Store 0x0 to the 'CPU selector' register. - 2. Store 0x0 to the 'Command field' register. - 3. Read the 'CPU device status fields' register. - 4. If both bit#1 and bit#2 are clear in the value read, there is no = CPU - with a pending event and selected CPU remains unchanged. - 5. Otherwise, read the 'Command data' register. The value read is the - selector of the CPU with the pending event (which is already - selected). - - - Enumerate CPUs present/non present CPUs - 01. Set the present CPU count to 0. - 02. Set the iterator to 0. - 03. Store 0x0 to the 'CPU selector' register, to ensure that it's in - a valid state and that access to other registers won't be ignore= d. - 04. Store 0x0 to the 'Command field' register to make 'Command data' - register return 'CPU selector' value of selected CPU - 05. Read the 'CPU device status fields' register. - 06. If bit#0 is set, increment the present CPU count. - 07. Increment the iterator. - 08. Store the iterator to the 'CPU selector' register. - 09. Read the 'Command data' register. - 10. If the value read is not zero, goto 05. - 11. Otherwise store 0x0 to the 'CPU selector' register, to put it - into a valid state and exit. - The iterator at this point equals "max_cpus". diff --git a/docs/specs/index.rst b/docs/specs/index.rst index b7b08ea30d7..24b765e1a45 100644 --- a/docs/specs/index.rst +++ b/docs/specs/index.rst @@ -13,3 +13,4 @@ guest hardware that is specific to QEMU. acpi_hw_reduced_hotplug tpm acpi_hest_ghes + acpi_cpu_hotplug --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998383; cv=none; d=zohomail.com; s=zohoarc; b=EAbXNm0yQV7B+ysy/EjgZVdJJmJWbTOaYZkcqgZXNGFPa+Z/C/siLfDKuVNh97VnxlJwLPQ+Z0c6BqzUnPzZhIpX3asFpt7C06SuKUZQhHecbWdvVJD+P7yZSoacGpMXQGC6VVbw2lrkp/beXcKY7hxpqLhY5uWku1tFNQdHSXg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998383; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=umdqEHNcd/kOIObIprqQSXQ+aP7HYiCnogSEnAV1qew=; b=GM/XRPCjpyzgNGwMkMS+oriWpQyl1PIn2wYBShtxUKwn4F76wJuhpLebnrgLeTlbJyMZezs1GrOGXE5Jz2Lsn18l49hTONTF1xSthTrGLKC4K63AUSYBTeb8K002pkv0ed8HKqaC1Cj267dXnrvRpm4dfu3zpARShlbxBJ0UD2U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998383133292.64609720386386; Thu, 26 Aug 2021 10:19:43 -0700 (PDT) Received: from localhost ([::1]:34708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ2T-0006Vg-Tt for importer@patchew.org; Thu, 26 Aug 2021 13:19:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImm-0005Sv-Ut for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:28 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:39774) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImh-0008Mg-Em for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:28 -0400 Received: by mail-wr1-x433.google.com with SMTP id z4so6155273wrr.6 for ; Thu, 26 Aug 2021 10:03:22 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:21 -0700 (PDT) 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=umdqEHNcd/kOIObIprqQSXQ+aP7HYiCnogSEnAV1qew=; b=fpPdVY1lr9X1nbDUZVGHHvW39qdIeo0bRiNNqfbP18TCIhEx5MTLsiDvUB5TUndpAH h2wy2Br7gu8frHR4z14bf/V7A8dMesV9U2+I6qxXFIHN22pYMhmeZkFcyBPM0Ay1KRpx vxYenZ/RSMPM0zvLVPjtpsXv2rt3kqAc+YKBX9AiuQezYikkCkSSz/2MsF0rBw1P9dlq mNO197UmOuP10ZfLNknjTLwt70la+bngsmH0E9iOadBivRTXp+Av7zmODxxBv9KMiOoN t5vU9nKUpvqY1aiUX6HaCl3peQ11b9XSj3JeX3yG+wbyrilpmDxSN8zrn/UuYmi2PRcb m5tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=umdqEHNcd/kOIObIprqQSXQ+aP7HYiCnogSEnAV1qew=; b=K1n5aJHESCbdWq98bgs4jBchwdNlMbTnTHJA2q3kSlFEF64O0J2X0lTwFCiCk6s1SK 20yDQv/dgP6/PB+AucDJGxX8WF2R9bpyVGwrKcwjE+4cZYeZUEfEdbl9nADW9+gqU/4I 72KbAPDrsi2aAOGBy7Tzgu8tbff/qx9XeDtPbfcFqh2A5i/JI62FpSmvkZG+ZvAQZYrx MKHQKJuTXUtjVt/djEEC+OAfC4By7r8cgO04ydn+5ncjpdx31BzzeC3w70JkKbItRv05 iIf85CL4w6VcL/XnaFeeFszto4dQpbfBjNC7qVIfzTQVtK/VuHBjp0NRjCL3Ae3U8JqY M0ZA== X-Gm-Message-State: AOAM530TvKZvpfKYhulvX34qS1IbwDHkmsMPUEw9EkFWUu+N+nneiA2H jCQO7CA4Vz2LjZ4WaRH/9OSMsiFnbZmb/A== X-Google-Smtp-Source: ABdhPJxGu8se8mPDf+zyfQ1T5BOg44w5Bj8s4oDKuXki7yZjUgokrmqRPFHbQ46ndnMdQKFqPykcdQ== X-Received: by 2002:adf:9783:: with SMTP id s3mr5365645wrb.349.1629997401896; Thu, 26 Aug 2021 10:03:21 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/37] docs/specs/acpi_mem_hotplug: Convert to rST Date: Thu, 26 Aug 2021 18:02:41 +0100 Message-Id: <20210826170307.27733-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998385394100001 Convert the acpi memory hotplug spec to rST. Note that this includes converting a lot of weird whitespace characters to plain old spaces (the rST parser does not like whatever the old ones were). Signed-off-by: Peter Maydell Reviewed-by: Igor Mammedov Message-id: 20210727170414.3368-3-peter.maydell@linaro.org --- docs/specs/acpi_mem_hotplug.rst | 128 ++++++++++++++++++++++++++++++++ docs/specs/acpi_mem_hotplug.txt | 94 ----------------------- docs/specs/index.rst | 1 + 3 files changed, 129 insertions(+), 94 deletions(-) create mode 100644 docs/specs/acpi_mem_hotplug.rst delete mode 100644 docs/specs/acpi_mem_hotplug.txt diff --git a/docs/specs/acpi_mem_hotplug.rst b/docs/specs/acpi_mem_hotplug.= rst new file mode 100644 index 00000000000..069819bc3e0 --- /dev/null +++ b/docs/specs/acpi_mem_hotplug.rst @@ -0,0 +1,128 @@ +QEMU<->ACPI BIOS memory hotplug interface +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +ACPI BIOS GPE.3 handler is dedicated for notifying OS about memory hot-add +and hot-remove events. + +Memory hot-plug interface (IO port 0xa00-0xa17, 1-4 byte access) +---------------------------------------------------------------- + +Read access behavior +^^^^^^^^^^^^^^^^^^^^ + +[0x0-0x3] + Lo part of memory device phys address +[0x4-0x7] + Hi part of memory device phys address +[0x8-0xb] + Lo part of memory device size in bytes +[0xc-0xf] + Hi part of memory device size in bytes +[0x10-0x13] + Memory device proximity domain +[0x14] + Memory device status fields + + bits: + + 0: + Device is enabled and may be used by guest + 1: + Device insert event, used to distinguish device for which + no device check event to OSPM was issued. + It's valid only when bit 1 is set. + 2: + Device remove event, used to distinguish device for which + no device eject request to OSPM was issued. + 3-7: + reserved and should be ignored by OSPM + +[0x15-0x17] + reserved + +Write access behavior +^^^^^^^^^^^^^^^^^^^^^ + + +[0x0-0x3] + Memory device slot selector, selects active memory device. + All following accesses to other registers in 0xa00-0xa17 + region will read/store data from/to selected memory device. +[0x4-0x7] + OST event code reported by OSPM +[0x8-0xb] + OST status code reported by OSPM +[0xc-0x13] + reserved, writes into it are ignored +[0x14] + Memory device control fields + + bits: + + 0: + reserved, OSPM must clear it before writing to register. + Due to BUG in versions prior 2.4 that field isn't cleared + when other fields are written. Keep it reserved and don't + try to reuse it. + 1: + if set to 1 clears device insert event, set by OSPM + after it has emitted device check event for the + selected memory device + 2: + if set to 1 clears device remove event, set by OSPM + after it has emitted device eject request for the + selected memory device + 3: + if set to 1 initiates device eject, set by OSPM when it + triggers memory device removal and calls _EJ0 method + 4-7: + reserved, OSPM must clear them before writing to register + +Selecting memory device slot beyond present range has no effect on platfor= m: + +- write accesses to memory hot-plug registers not documented above are ign= ored +- read accesses to memory hot-plug registers not documented above return + all bits set to 1. + +Memory hot remove process diagram +--------------------------------- + +:: + + +-------------+ +-----------------------+ +------------------+ + | 1. QEMU | | 2. QEMU | |3. QEMU | + | device_del +---->+ device unplug request +----->+Send SCI to guest,| + | | | cb | |return control to | + | | | | |management | + +-------------+ +-----------------------+ +------------------+ + + +---------------------------------------------------------------------+ + + +---------------------+ +-------------------------+ + | OSPM: | remove event | OSPM: | + | send Eject Request, | | Scan memory devices | + | clear remove event +<-------------+ for event flags | + | | | | + +---------------------+ +-------------------------+ + | + | + +---------v--------+ +-----------------------+ + | Guest OS: | success | OSPM: | + | process Ejection +----------->+ Execute _EJ0 method, | + | request | | set eject bit in flags| + +------------------+ +-----------------------+ + |failure | + v v + +------------------------+ +-----------------------+ + | OSPM: | | QEMU: | + | set OST event & status | | call device unplug cb | + | fields | | | + +------------------------+ +-----------------------+ + | | + v v + +------------------+ +-------------------+ + |QEMU: | |QEMU: | + |Send OST QMP event| |Send device deleted| + | | |QMP event | + +------------------+ | | + +-------------------+ diff --git a/docs/specs/acpi_mem_hotplug.txt b/docs/specs/acpi_mem_hotplug.= txt deleted file mode 100644 index 3df3620ce42..00000000000 --- a/docs/specs/acpi_mem_hotplug.txt +++ /dev/null @@ -1,94 +0,0 @@ -QEMU<->ACPI BIOS memory hotplug interface --------------------------------------- - -ACPI BIOS GPE.3 handler is dedicated for notifying OS about memory hot-add -and hot-remove events. - -Memory hot-plug interface (IO port 0xa00-0xa17, 1-4 byte access): ---------------------------------------------------------------- -0xa00: - read access: - [0x0-0x3] Lo part of memory device phys address - [0x4-0x7] Hi part of memory device phys address - [0x8-0xb] Lo part of memory device size in bytes - [0xc-0xf] Hi part of memory device size in bytes - [0x10-0x13] Memory device proximity domain - [0x14] Memory device status fields - bits: - 0: Device is enabled and may be used by guest - 1: Device insert event, used to distinguish device for which - no device check event to OSPM was issued. - It's valid only when bit 1 is set. - 2: Device remove event, used to distinguish device for which - no device eject request to OSPM was issued. - 3-7: reserved and should be ignored by OSPM - [0x15-0x17] reserved - - write access: - [0x0-0x3] Memory device slot selector, selects active memory device. - All following accesses to other registers in 0xa00-0xa17 - region will read/store data from/to selected memory device. - [0x4-0x7] OST event code reported by OSPM - [0x8-0xb] OST status code reported by OSPM - [0xc-0x13] reserved, writes into it are ignored - [0x14] Memory device control fields - bits: - 0: reserved, OSPM must clear it before writing to register. - Due to BUG in versions prior 2.4 that field isn't cleared - when other fields are written. Keep it reserved and don't - try to reuse it. - 1: if set to 1 clears device insert event, set by OSPM - after it has emitted device check event for the - selected memory device - 2: if set to 1 clears device remove event, set by OSPM - after it has emitted device eject request for the - selected memory device - 3: if set to 1 initiates device eject, set by OSPM when it - triggers memory device removal and calls _EJ0 method - 4-7: reserved, OSPM must clear them before writing to regist= er - -Selecting memory device slot beyond present range has no effect on platfor= m: - - write accesses to memory hot-plug registers not documented above are - ignored - - read accesses to memory hot-plug registers not documented above return - all bits set to 1. - -Memory hot remove process diagram: ----------------------------------- - +-------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89+------------= -----------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89+--------= ----------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89=E2=80=891.=E2=80=89QEMU=E2=80=89=E2=80=89=E2=80=89=E2= =80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=892.=E2=80=89QE= MU=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|3.=E2=80=89QEMU=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89=E2=80=89device_del=E2=80=89+---->+=E2=80=89device=E2= =80=89unplug=E2=80=89request=E2=80=89+----->+Send=E2=80=89SCI=E2=80=89to=E2= =80=89guest,|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89cb=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|return=E2=80=89contr= ol=E2=80=89to=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89+-------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89+----= -------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|= management=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89+------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89 -=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89 -=E2=80=89+----------------------------------------------------------------= -----+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89 -=E2=80=89+---------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89+-------------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89OSPM:=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89|=E2=80=89remove=E2=80=89event=E2=80=89|=E2=80=89OSPM:=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89send=E2=80=89Eject=E2=80=89Request,=E2=80=89|=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89Scan=E2=80=89memory=E2= =80=89devices=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89clear=E2=80=89remove=E2=80=89event=E2=80=89=E2=80=89+<-= ------------+=E2=80=89for=E2=80=89event=E2=80=89flags=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89+---------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89+-------------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89 -=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89 -=E2=80=89+---------v--------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89+-----------= ------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89Guest=E2=80=89OS:=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89success=E2=80=89=E2= =80=89=E2=80=89|=E2=80=89OSPM:=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89process=E2=80=89Ejection=E2=80=89+----------->+=E2=80= =89Execute=E2=80=89_EJ0=E2=80=89method, =E2=80=89|=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89request =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|= =E2=80=89set=E2=80=89eject=E2=80=89bit=E2=80=89in=E2=80=89flags|=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89 -=E2=80=89+------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89+-----------= ------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89|failure=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89 -=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89v=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89v=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89 -=E2=80=89+------------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89+-----------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89OSPM:=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89|=E2=80=89QEMU:=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89set=E2=80=89OST=E2=80=89event=E2=80=89&=E2=80=89status= =E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89c= all=E2=80=89device=E2=80=89unplug=E2=80=89cb=E2=80=89|=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89fields=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89 -=E2=80=89+------------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89+-----------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89 -=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89v=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89v=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89 -=E2=80=89+------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89+-------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|QEMU:=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89|QEMU:=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|Send=E2=80=89OST=E2=80=89QMP=E2=80=89event|=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89|Send=E2=80=89device=E2=80=89deleted|=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89|QMP=E2=80=89event=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89 -=E2=80=89+------------------+=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89|=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89 -=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2= =80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80= =89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89= =E2=80=89=E2=80=89+-------------------+ diff --git a/docs/specs/index.rst b/docs/specs/index.rst index 24b765e1a45..17cc7868b91 100644 --- a/docs/specs/index.rst +++ b/docs/specs/index.rst @@ -14,3 +14,4 @@ guest hardware that is specific to QEMU. tpm acpi_hest_ghes acpi_cpu_hotplug + acpi_mem_hotplug --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997571; cv=none; d=zohomail.com; s=zohoarc; b=GXoSvFToNn+cZcOct0zmR12hay4ltHDbfs9raSb87wWIv3I6nxG8w/SlWqnaEXXD/mRKsm+KtIw+/DpLZWIJgnk/O1sHLHQ2uzhlnYLMlggNkXKZUCs15cAhv/7mnXanwxGnOmDZvCDikF+gX84X1Mophqwq9uivVzVz6bcQAlY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997571; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kFz9cdCuHFlGvHx243QpYrt+H+eFiCSkf8eXbm4ZxFQ=; b=QZXMAExSEDtaPYZVA293f6t+3PB+QU8NYKM4QVuK+8mIsqA4qxJzRoJqd9sSyD25VaBaXfIDNchIm9LXu2ZkBwEOimkNFxD44Reo9KuyNullhQpV6utviHCraCQxVqItN4OtYq9ap8cT70rwkiEZ/sMEdFj4Sx4ivMmCokTfXjY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629997571774717.8929525566285; Thu, 26 Aug 2021 10:06:11 -0700 (PDT) Received: from localhost ([::1]:43820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIpO-0008PI-JG for importer@patchew.org; Thu, 26 Aug 2021 13:06:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImm-0005QN-1l for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:28 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:44853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImi-0008Ms-8m for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:27 -0400 Received: by mail-wm1-x32d.google.com with SMTP id l7-20020a1c2507000000b002e6be5d86b3so2640017wml.3 for ; Thu, 26 Aug 2021 10:03:23 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:22 -0700 (PDT) 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=kFz9cdCuHFlGvHx243QpYrt+H+eFiCSkf8eXbm4ZxFQ=; b=h/o3ohNiRLXIj8k7+gcEezV3X2a2nfOJLzYF1cKBsgDwXMNAC9xlo4UzmwjATh7pHp XOSfOycQd8SilljuD3X7YEfsjq33SRRnVR1yMqRgDBJUgCGayrBdDFf23FmNzDylPypd VYXp5gvWacdh9qvJ9q6htttdOkcl03zX4jET//9OtrC/Xr/cOzjEnLyGDakcNge9j1eb cxDnJ20oUUbCE0SOh3vH0lcq7Vwi972TJiR6I/CeXFCseFyeZs4hAYBg1iwqN4xc+pq+ 3sP2R4FK/3Pa5e5LOE2MW/jmPTpynfu1WrwoVloe56IjeDLqXK78UEpdKMjOj0yhF67S oHGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kFz9cdCuHFlGvHx243QpYrt+H+eFiCSkf8eXbm4ZxFQ=; b=lME6f4h1Xk0I6l4LUey0/MGFWoQrLKeGW2ERsj36sRwvFUZJGFLvhb9UwTnkszMqmu jbtKU/dx61rErC4yegryAN8bXkHnJHNyqfOL4aODNHtP6YioX7tT5PuzNcILytF1Gvrp VHWi6kegeluKhHk2A3st8VuQLWsw38lpWeZM+iu8ay9Crbj2IXRcvA9cGkBYmcsDWMpk /xS9b9z+jQ0XU/TztCyCj2EJtGIus4WbhgtQdXFJEnAkYSCiAwUV7H+4TIf3wOU1CyHg QC2pyPVA4cijkd8Laywa4Cni28gTS2+SHWCd+033kr8LUweTC4PnQ16T4C6L/GtuQlJP 7MWg== X-Gm-Message-State: AOAM533BsyW+yvLBpUVJJ8XV6EOzTLYJHP9vvRmxzgDusuyoz9pbx5vY vtdUnPqT2vpu3l5JzTwSQlp37Yppfa46Gw== X-Google-Smtp-Source: ABdhPJyDSajbCraK47ZA6o/DkHta0USasPY2MCXDr6IHJFz6bD2EFq3mSAPaMSRh4jaVJpKSZ84aCA== X-Received: by 2002:a1c:7413:: with SMTP id p19mr4745049wmc.30.1629997402745; Thu, 26 Aug 2021 10:03:22 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 12/37] docs/specs/acpi_pci_hotplug: Convert to rST Date: Thu, 26 Aug 2021 18:02:42 +0100 Message-Id: <20210826170307.27733-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997573581100001 Content-Type: text/plain; charset="utf-8" Convert the PCI hotplug spec document to rST. Signed-off-by: Peter Maydell Reviewed-by: Igor Mammedov --- ...i_pci_hotplug.txt =3D> acpi_pci_hotplug.rst} | 37 ++++++++++--------- docs/specs/index.rst | 1 + 2 files changed, 21 insertions(+), 17 deletions(-) rename docs/specs/{acpi_pci_hotplug.txt =3D> acpi_pci_hotplug.rst} (51%) diff --git a/docs/specs/acpi_pci_hotplug.txt b/docs/specs/acpi_pci_hotplug.= rst similarity index 51% rename from docs/specs/acpi_pci_hotplug.txt rename to docs/specs/acpi_pci_hotplug.rst index a839434f313..685bc5c322f 100644 --- a/docs/specs/acpi_pci_hotplug.txt +++ b/docs/specs/acpi_pci_hotplug.rst @@ -1,45 +1,48 @@ QEMU<->ACPI BIOS PCI hotplug interface --------------------------------------- +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 QEMU supports PCI hotplug via ACPI, for PCI bus 0. This document describes the interface between QEMU and the ACPI BIOS. =20 -ACPI GPE block (IO ports 0xafe0-0xafe3, byte access): ------------------------------------------ +ACPI GPE block (IO ports 0xafe0-0xafe3, byte access) +---------------------------------------------------- =20 Generic ACPI GPE block. Bit 1 (GPE.1) used to notify PCI hotplug/eject event to ACPI BIOS, via SCI interrupt. =20 -PCI slot injection notification pending (IO port 0xae00-0xae03, 4-byte acc= ess): ---------------------------------------------------------------- +PCI slot injection notification pending (IO port 0xae00-0xae03, 4-byte acc= ess) +--------------------------------------------------------------------------= ---- + Slot injection notification pending. One bit per slot. =20 Read by ACPI BIOS GPE.1 handler to notify OS of injection events. Read-only. =20 -PCI slot removal notification (IO port 0xae04-0xae07, 4-byte access): ------------------------------------------------------ +PCI slot removal notification (IO port 0xae04-0xae07, 4-byte access) +-------------------------------------------------------------------- + Slot removal notification pending. One bit per slot. =20 Read by ACPI BIOS GPE.1 handler to notify OS of removal events. Read-only. =20 -PCI device eject (IO port 0xae08-0xae0b, 4-byte access): ----------------------------------------- +PCI device eject (IO port 0xae08-0xae0b, 4-byte access) +------------------------------------------------------- =20 Write: Used by ACPI BIOS _EJ0 method to request device removal. One bit per slot. =20 Read: Hotplug features register. Used by platform to identify features available. Current base feature set (no bits set): - - Read-only "up" register @0xae00, 4-byte access, bit per slot - - Read-only "down" register @0xae04, 4-byte access, bit per slot - - Read/write "eject" register @0xae08, 4-byte access, - write: bit per slot eject, read: hotplug feature set - - Read-only hotplug capable register @0xae0c, 4-byte access, bit per slot =20 -PCI removability status (IO port 0xae0c-0xae0f, 4-byte access): ------------------------------------------------ +- Read-only "up" register @0xae00, 4-byte access, bit per slot +- Read-only "down" register @0xae04, 4-byte access, bit per slot +- Read/write "eject" register @0xae08, 4-byte access, + write: bit per slot eject, read: hotplug feature set +- Read-only hotplug capable register @0xae0c, 4-byte access, bit per slot + +PCI removability status (IO port 0xae0c-0xae0f, 4-byte access) +-------------------------------------------------------------- =20 Used by ACPI BIOS _RMV method to indicate removability status to OS. One -bit per slot. Read-only +bit per slot. Read-only. diff --git a/docs/specs/index.rst b/docs/specs/index.rst index 17cc7868b91..8296fb19b72 100644 --- a/docs/specs/index.rst +++ b/docs/specs/index.rst @@ -15,3 +15,4 @@ guest hardware that is specific to QEMU. acpi_hest_ghes acpi_cpu_hotplug acpi_mem_hotplug + acpi_pci_hotplug --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998580; cv=none; d=zohomail.com; s=zohoarc; b=FI3gm3y+ozRSkCMou1bXyE7Su/KW3pPh3MOcyhY6Gm00Hpr6SooyaQ0qK1oqyYP9KauAd62nHCHMQ/wld0cMI9uNCJ1c82Lh4YTFZuwWVBnbSC37u8ZSy3OMdmKtZiS0cqCFrRwgHuXSaHa17U7wwAvHJP8jwUWtNsjQitd9SqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998580; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ChUttIc68iZkmw41W1FrNjDeUGwRlRF6AIoMDfs22XQ=; b=gsJL03LbV8DMWmuz1/9ZjCmh3P1sk4IfJgeSeTSdTzSYq3mD7ie9yYmdVhfVhtI+HU/ndQ+9Yxw/GvyDULYWamssJRIAuKPTkGZgZ3fmykRIxcqin9tLiV5rBzO20/nW5EE0LX7TiJpx5mE47P4ySozANObv4zXyoDmifkiVPkY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998580026837.3404987620306; Thu, 26 Aug 2021 10:23:00 -0700 (PDT) Received: from localhost ([::1]:45746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ5e-0005TP-TB for importer@patchew.org; Thu, 26 Aug 2021 13:22:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImn-0005Tv-6i for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:29 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:36458) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImj-0008P2-Rr for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:28 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 79-20020a1c0452000000b002e6cf79e572so7402929wme.1 for ; Thu, 26 Aug 2021 10:03:25 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:23 -0700 (PDT) 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=ChUttIc68iZkmw41W1FrNjDeUGwRlRF6AIoMDfs22XQ=; b=Qy/58P5nZkeR+vvNV3W0uLZhwuPFBVCHaxRbFmwdELoeETUxTBds3HouZRsBq5lV5S Hum7x6xx3iaLk+Sbt0TVUhUuKaDzl4oJqi8/II0NtqDRWJayKwYUZx2F3gE5/tbsOfoj vW6cgl129Vfmv9NfIHrAZekbiJqNPLMmchsjguz1hu5k9cdpyiitbS55RZL++cep3azs Dt/yNuxYuA6FAN2TBG39DGhWr8DXTXMidHZtQGu+P41K8YDG6Z6gg79QxTnJNTigB/Rr hIk7tcvl5tW7HPKYDMA1VZHn9952pPpN+Rte/tvD1tV2xRm6b68cjyPB/aSCkiy3p0dG 8+aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ChUttIc68iZkmw41W1FrNjDeUGwRlRF6AIoMDfs22XQ=; b=FEdWUIVMvAq2b3t3TmvwSnhlASUVPa7bkZZPJEpoeLBNsZRUnTik5fWA1nO1u8r0L1 8Zoag9gFp1YnzjdKPJnewtEeTfiIXSLnGOQNCGIl0hIxvFeJq8Ncw1bylJZZCknzdH/p Om5kZU3A7gBJBklJuJO+pu8by3sfOqL5RlKWp6jDWA2uiH5LUm/HhOcTA+PhrTkfhQjU ONZIn2hug6VK2HtoIXJviwibTFHLfoX7GR76OHHHmJHFEO1N8RdPuEtdhtrlYwuEAg4J ZYLI3kwQTcVzodyKi4XVb1Q4P0cVpxTnyhQ4no86TFltq1WL6JaSd+bbic7dfv59O9J+ M96Q== X-Gm-Message-State: AOAM533xQ1nH8KH0XyrAG35TwATjZ+ymxgNEkJ3i0qZ7LkFjTMZGaQhB BPc36u2LcrP10yzFiv0RXoJf9ckrJ0SkuQ== X-Google-Smtp-Source: ABdhPJwCv4xvJF/kEXjKqbgvKgQAvQsU1S+qemU9gnUeQfZTPM3C5qoHLf8ZYSGiuusYiYZTK8NECQ== X-Received: by 2002:a1c:98d5:: with SMTP id a204mr15282898wme.52.1629997403967; Thu, 26 Aug 2021 10:03:23 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/37] docs/specs/acpi_nvdimm: Convert to rST Date: Thu, 26 Aug 2021 18:02:43 +0100 Message-Id: <20210826170307.27733-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998582444100001 Convert the ACPI NVDIMM spec document to rST. Signed-off-by: Peter Maydell Reviewed-by: Igor Mammedov Message-id: 20210727170414.3368-5-peter.maydell@linaro.org --- docs/specs/acpi_nvdimm.rst | 228 +++++++++++++++++++++++++++++++++++++ docs/specs/acpi_nvdimm.txt | 188 ------------------------------ docs/specs/index.rst | 1 + 3 files changed, 229 insertions(+), 188 deletions(-) create mode 100644 docs/specs/acpi_nvdimm.rst delete mode 100644 docs/specs/acpi_nvdimm.txt diff --git a/docs/specs/acpi_nvdimm.rst b/docs/specs/acpi_nvdimm.rst new file mode 100644 index 00000000000..ab0335253d7 --- /dev/null +++ b/docs/specs/acpi_nvdimm.rst @@ -0,0 +1,228 @@ +QEMU<->ACPI BIOS NVDIMM interface +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D + +QEMU supports NVDIMM via ACPI. This document describes the basic concepts = of +NVDIMM ACPI and the interface between QEMU and the ACPI BIOS. + +NVDIMM ACPI Background +---------------------- + +NVDIMM is introduced in ACPI 6.0 which defines an NVDIMM root device under +_SB scope with a _HID of "ACPI0012". For each NVDIMM present or intended +to be supported by platform, platform firmware also exposes an ACPI +Namespace Device under the root device. + +The NVDIMM child devices under the NVDIMM root device are defined with _ADR +corresponding to the NFIT device handle. The NVDIMM root device and the +NVDIMM devices can have device specific methods (_DSM) to provide addition= al +functions specific to a particular NVDIMM implementation. + +This is an example from ACPI 6.0, a platform contains one NVDIMM:: + + Scope (\_SB){ + Device (NVDR) // Root device + { + Name (_HID, "ACPI0012") + Method (_STA) {...} + Method (_FIT) {...} + Method (_DSM, ...) {...} + Device (NVD) + { + Name(_ADR, h) //where h is NFIT Device Handle for this NVDIMM + Method (_DSM, ...) {...} + } + } + } + +Methods supported on both NVDIMM root device and NVDIMM device +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_DSM (Device Specific Method) + It is a control method that enables devices to provide device specific + control functions that are consumed by the device driver. + The NVDIMM DSM specification can be found at + http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf + + Arguments: + + Arg0 + A Buffer containing a UUID (16 Bytes) + Arg1 + An Integer containing the Revision ID (4 Bytes) + Arg2 + An Integer containing the Function Index (4 Bytes) + Arg3 + A package containing parameters for the function specified by the + UUID, Revision ID, and Function Index + + Return Value: + + If Function Index =3D 0, a Buffer containing a function index bitfield. + Otherwise, the return value and type depends on the UUID, revision ID + and function index which are described in the DSM specification. + +Methods on NVDIMM ROOT Device +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +_FIT(Firmware Interface Table) + It evaluates to a buffer returning data in the format of a series of NF= IT + Type Structure. + + Arguments: None + + Return Value: + A Buffer containing a list of NFIT Type structure entries. + + The detailed definition of the structure can be found at ACPI 6.0: 5.2.= 25 + NVDIMM Firmware Interface Table (NFIT). + +QEMU NVDIMM Implementation +-------------------------- + +QEMU uses 4 bytes IO Port starting from 0x0a18 and a RAM-based memory page +for NVDIMM ACPI. + +Memory: + QEMU uses BIOS Linker/loader feature to ask BIOS to allocate a memory + page and dynamically patch its address into an int32 object named "MEMA" + in ACPI. + + This page is RAM-based and it is used to transfer data between _DSM + method and QEMU. If ACPI has control, this pages is owned by ACPI which + writes _DSM input data to it, otherwise, it is owned by QEMU which + emulates _DSM access and writes the output data to it. + + ACPI writes _DSM Input Data (based on the offset in the page): + + [0x0 - 0x3] + 4 bytes, NVDIMM Device Handle. + + The handle is completely QEMU internal thing, the values in + range [1, 0xFFFF] indicate nvdimm device. Other values are + reserved for other purposes. + + Reserved handles: + + - 0 is reserved for nvdimm root device named NVDR. + - 0x10000 is reserved for QEMU internal DSM function called on + the root device. + + [0x4 - 0x7] + 4 bytes, Revision ID, that is the Arg1 of _DSM method. + + [0x8 - 0xB] + 4 bytes. Function Index, that is the Arg2 of _DSM method. + + [0xC - 0xFFF] + 4084 bytes, the Arg3 of _DSM method. + + QEMU writes Output Data (based on the offset in the page): + + [0x0 - 0x3] + 4 bytes, the length of result + + [0x4 - 0xFFF] + 4092 bytes, the DSM result filled by QEMU + +IO Port 0x0a18 - 0xa1b: + ACPI writes the address of the memory page allocated by BIOS to this + port then QEMU gets the control and fills the result in the memory page. + + Write Access: + + [0x0a18 - 0xa1b] + 4 bytes, the address of the memory page allocated by BIOS. + +_DSM process diagram +-------------------- + +"MEMA" indicates the address of memory page allocated by BIOS. + +:: + + +----------------------+ +-----------------------+ + | 1. OSPM | | 2. OSPM | + | save _DSM input data | | write "MEMA" to | Exit to QEMU + | to the page +----->| IO port 0x0a18 +------------+ + | indicated by "MEMA" | | | | + +----------------------+ +-----------------------+ | + | + v + +--------------------+ +-----------+ +------------------+-----= ---+ + | 5 QEMU | | 4 QEMU | | 3. QEMU = | + | write _DSM result | | emulate | | get _DSM input data fro= m | + | to the page +<------+ _DSM +<-----+ the page indicated by t= he | + | | | | | value from the IO port = | + +--------+-----------+ +-----------+ +------------------------= ---+ + | + | Enter Guest + | + v + +--------------------------+ +--------------+ + | 6 OSPM | | 7 OSPM | + | result size is returned | | _DSM return | + | by reading DSM +----->+ | + | result from the page | | | + +--------------------------+ +--------------+ + +NVDIMM hotplug +-------------- + +ACPI BIOS GPE.4 handler is dedicated for notifying OS about nvdimm device +hot-add event. + +QEMU internal use only _DSM functions +------------------------------------- + +Read FIT +^^^^^^^^ + +_FIT method uses _DSM method to fetch NFIT structures blob from QEMU +in 1 page sized increments which are then concatenated and returned +as _FIT method result. + +Input parameters: + +Arg0 + UUID {set to 648B9CF2-CDA1-4312-8AD9-49C4AF32BD62} +Arg1 + Revision ID (set to 1) +Arg2 + Function Index, 0x1 +Arg3 + A package containing a buffer whose layout is as follows: + + +----------+--------+--------+-----------------------------------------= --+ + | Field | Length | Offset | Description = | + +----------+--------+--------+-----------------------------------------= --+ + | offset | 4 | 0 | offset in QEMU's NFIT structures blob to= | + | | | | read from = | + +----------+--------+--------+-----------------------------------------= --+ + +Output layout in the dsm memory page: + + +----------+--------+--------+-----------------------------------------= --+ + | Field | Length | Offset | Description = | + +----------+--------+--------+-----------------------------------------= --+ + | length | 4 | 0 | length of entire returned data = | + | | | | (including this header) = | + +----------+--------+--------+-----------------------------------------= --+ + | | | | return status codes = | + | | | | = | + | | | | - 0x0 - success = | + | | | | - 0x100 - error caused by NFIT update = | + | status | 4 | 4 | while read by _FIT wasn't completed = | + | | | | - other codes follow Chapter 3 in = | + | | | | DSM Spec Rev1 = | + +----------+--------+--------+-----------------------------------------= --+ + | fit data | Varies | 8 | contains FIT data. This field is present= | + | | | | if status field is 0. = | + +----------+--------+--------+-----------------------------------------= --+ + +The FIT offset is maintained by the OSPM itself, current offset plus +the size of the fit data returned by the function is the next offset +OSPM should read. When all FIT data has been read out, zero fit data +size is returned. + +If it returns status code 0x100, OSPM should restart to read FIT (read +from offset 0 again). diff --git a/docs/specs/acpi_nvdimm.txt b/docs/specs/acpi_nvdimm.txt deleted file mode 100644 index 3ec42ecbce4..00000000000 --- a/docs/specs/acpi_nvdimm.txt +++ /dev/null @@ -1,188 +0,0 @@ -QEMU<->ACPI BIOS NVDIMM interface ---------------------------------- - -QEMU supports NVDIMM via ACPI. This document describes the basic concepts = of -NVDIMM ACPI and the interface between QEMU and the ACPI BIOS. - -NVDIMM ACPI Background ----------------------- -NVDIMM is introduced in ACPI 6.0 which defines an NVDIMM root device under -_SB scope with a _HID of =E2=80=9CACPI0012=E2=80=9D. For each NVDIMM prese= nt or intended -to be supported by platform, platform firmware also exposes an ACPI -Namespace Device under the root device. - -The NVDIMM child devices under the NVDIMM root device are defined with _ADR -corresponding to the NFIT device handle. The NVDIMM root device and the -NVDIMM devices can have device specific methods (_DSM) to provide addition= al -functions specific to a particular NVDIMM implementation. - -This is an example from ACPI 6.0, a platform contains one NVDIMM: - -Scope (\_SB){ - Device (NVDR) // Root device - { - Name (_HID, =E2=80=9CACPI0012=E2=80=9D) - Method (_STA) {...} - Method (_FIT) {...} - Method (_DSM, ...) {...} - Device (NVD) - { - Name(_ADR, h) //where h is NFIT Device Handle for this NVDIMM - Method (_DSM, ...) {...} - } - } -} - -Method supported on both NVDIMM root device and NVDIMM device -_DSM (Device Specific Method) - It is a control method that enables devices to provide device specific - control functions that are consumed by the device driver. - The NVDIMM DSM specification can be found at: - http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf - - Arguments: - Arg0 =E2=80=93 A Buffer containing a UUID (16 Bytes) - Arg1 =E2=80=93 An Integer containing the Revision ID (4 Bytes) - Arg2 =E2=80=93 An Integer containing the Function Index (4 Bytes) - Arg3 =E2=80=93 A package containing parameters for the function specifi= ed by the - UUID, Revision ID, and Function Index - - Return Value: - If Function Index =3D 0, a Buffer containing a function index bitfield. - Otherwise, the return value and type depends on the UUID, revision ID - and function index which are described in the DSM specification. - -Methods on NVDIMM ROOT Device -_FIT(Firmware Interface Table) - It evaluates to a buffer returning data in the format of a series of NF= IT - Type Structure. - - Arguments: None - - Return Value: - A Buffer containing a list of NFIT Type structure entries. - - The detailed definition of the structure can be found at ACPI 6.0: 5.2.= 25 - NVDIMM Firmware Interface Table (NFIT). - -QEMU NVDIMM Implementation -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D -QEMU uses 4 bytes IO Port starting from 0x0a18 and a RAM-based memory page -for NVDIMM ACPI. - -Memory: - QEMU uses BIOS Linker/loader feature to ask BIOS to allocate a memory - page and dynamically patch its address into an int32 object named "MEMA" - in ACPI. - - This page is RAM-based and it is used to transfer data between _DSM - method and QEMU. If ACPI has control, this pages is owned by ACPI which - writes _DSM input data to it, otherwise, it is owned by QEMU which - emulates _DSM access and writes the output data to it. - - ACPI writes _DSM Input Data (based on the offset in the page): - [0x0 - 0x3]: 4 bytes, NVDIMM Device Handle. - - The handle is completely QEMU internal thing, the values in - range [1, 0xFFFF] indicate nvdimm device. Other values are - reserved for other purposes. - - Reserved handles: - 0 is reserved for nvdimm root device named NVDR. - 0x10000 is reserved for QEMU internal DSM function called = on - the root device. - - [0x4 - 0x7]: 4 bytes, Revision ID, that is the Arg1 of _DSM method. - [0x8 - 0xB]: 4 bytes. Function Index, that is the Arg2 of _DSM method. - [0xC - 0xFFF]: 4084 bytes, the Arg3 of _DSM method. - - QEMU Writes Output Data (based on the offset in the page): - [0x0 - 0x3]: 4 bytes, the length of result - [0x4 - 0xFFF]: 4092 bytes, the DSM result filled by QEMU - -IO Port 0x0a18 - 0xa1b: - ACPI writes the address of the memory page allocated by BIOS to this - port then QEMU gets the control and fills the result in the memory page. - - write Access: - [0x0a18 - 0xa1b]: 4 bytes, the address of the memory page allocated - by BIOS. - -_DSM process diagram: ---------------------- -"MEMA" indicates the address of memory page allocated by BIOS. - - +----------------------+=E2=80=89=E2=80=89 +-----------------------+ -=E2=80=89|=E2=80=89=E2=80=89 1.=E2=80=89OSPM=E2=80=89=E2=80=89 |= =E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89=E2=80=89| 2. OSPM = | -=E2=80=89|=E2=80=89save _DSM input data | | write "MEMA" to | E= xit to QEMU -=E2=80=89| to the page +----->| IO port 0x0a18 +----------= --+ -=E2=80=89| indicated by "MEMA" | | | = | -=E2=80=89+----------------------+ +-----------------------+ = | -=E2=80=89 = | -=E2=80=89 = v -=E2=80=89+------------- ----+ +-----------+ +----------------= --+--------+ -=E2=80=89| 5 QEMU | | 4 QEMU | | 3. QEMU = | -=E2=80=89| write _DSM result | | emulate | | get _DSM input = data from | - | to the page +<------+ _DSM +<-----+ the page indicated by t= he | -=E2=80=89| | | | | value from the = IO port | - +--------+-----------+ +-----------+ +------------------------= ---+ - | - | Enter Guest - | - v - +--------------------------+ +--------------+ - | 6 OSPM | | 7 OSPM | - | result size is returned | | _DSM return | - | by reading DSM +----->+ | - | result from the page | | | - +--------------------------+ +--------------+ - -NVDIMM hotplug --------------- -ACPI BIOS GPE.4 handler is dedicated for notifying OS about nvdimm device -hot-add event. - -QEMU internal use only _DSM function ------------------------------------- -1) Read FIT - _FIT method uses _DSM method to fetch NFIT structures blob from QEMU - in 1 page sized increments which are then concatenated and returned - as _FIT method result. - - Input parameters: - Arg0 =E2=80=93 UUID {set to 648B9CF2-CDA1-4312-8AD9-49C4AF32BD62} - Arg1 =E2=80=93 Revision ID (set to 1) - Arg2 - Function Index, 0x1 - Arg3 - A package containing a buffer whose layout is as follows: - - +----------+--------+--------+-----------------------------------------= --+ - | Field | Length | Offset | Description = | - +----------+--------+--------+-----------------------------------------= --+ - | offset | 4 | 0 | offset in QEMU's NFIT structures blob to= | - | | | | read from = | - +----------+--------+--------+-----------------------------------------= --+ - - Output layout in the dsm memory page: - +----------+--------+--------+-----------------------------------------= --+ - | Field | Length | Offset | Description = | - +----------+--------+--------+-----------------------------------------= --+ - | length | 4 | 0 | length of entire returned data = | - | | | | (including this header) = | - +----------+-----------------+-----------------------------------------= --+ - | | | | return status codes = | - | | | | 0x0 - success = | - | | | | 0x100 - error caused by NFIT update whil= e | - | status | 4 | 4 | read by _FIT wasn't completed, other = | - | | | | codes follow Chapter 3 in DSM Spec Rev1 = | - +----------+-----------------+-----------------------------------------= --+ - | fit data | Varies | 8 | contains FIT data, this field is present= | - | | | | if status field is 0; = | - +----------+--------+--------+-----------------------------------------= --+ - - The FIT offset is maintained by the OSPM itself, current offset plus - the size of the fit data returned by the function is the next offset - OSPM should read. When all FIT data has been read out, zero fit data - size is returned. - - If it returns status code 0x100, OSPM should restart to read FIT (read - from offset 0 again). diff --git a/docs/specs/index.rst b/docs/specs/index.rst index 8296fb19b72..65e9663916a 100644 --- a/docs/specs/index.rst +++ b/docs/specs/index.rst @@ -16,3 +16,4 @@ guest hardware that is specific to QEMU. acpi_cpu_hotplug acpi_mem_hotplug acpi_pci_hotplug + acpi_nvdimm --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998207; cv=none; d=zohomail.com; s=zohoarc; b=PeBTuPassjERq1SSLxFhpbFxdfyZA3qrAWKW2DB3NIoHXXH014uJ7YW2jh6XCKao0K4NXJsYG+pvY8d/Zqxb4vvijXP6IaZ1UVNWMew5s5Aq2o30eD1Rur6KN5irJBiKsUnDpIAJ+bnTC5U74BjU6zfwbj+LuKyyqmbJI6JH5hk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998207; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TnzDm71KYQud7PpDKftXAENgNcbR1ab0xNUtbCpYsT8=; b=nFroOC75A5lob8nJ4alNIpG/XA3hpblcgnfqS0flqEoeBIwJbJSo/+a1PH2ZEG9GvWl9FGSdK34yZRCe9vKatzXRWje84Ev60XH3kDo9gwWAVyHP/fA3W/kLSHe1h/UmuWy5KVgcO1cRxxE+hO7GExU12NoNkGkOAjs76Dmf5RI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998207599870.1296827729565; Thu, 26 Aug 2021 10:16:47 -0700 (PDT) Received: from localhost ([::1]:54444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIze-0000m8-CG for importer@patchew.org; Thu, 26 Aug 2021 13:16:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImm-0005Ry-KC for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:28 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:46655) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImk-0008P5-36 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:28 -0400 Received: by mail-wr1-x434.google.com with SMTP id f5so6090421wrm.13 for ; Thu, 26 Aug 2021 10:03:25 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:24 -0700 (PDT) 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=TnzDm71KYQud7PpDKftXAENgNcbR1ab0xNUtbCpYsT8=; b=GmOW035Az/K6UJTzhy1VKDXx8AJGdoqdUiYgLsmUnfAxHNL46gCOnByy5WBbQiYCl/ YHkp21/zvqxsWuRQBQjBmeykEIcw//p0es1C2G8QEUBHj6vjj6rQhwhjABkBkRCWMIkr nEVkrb43oFK9ew/YhSkBB/fNF9yP7K5gXyjIxHLItG//iqXCe+Fs9JT474JVPfoW0BqI oZtZHwEfsq99fI3PigrmRqm7qWoQrBQVIBpV5Hb1haiGx/4W3BzxVfPYhWpSG1BXdrFt WuhKkyCtcXndgjfBtPjIlFUsDpyf8Lo3swQAFwPHw5wTiW4J3Psjy47zRCg7xpBzIg/N +unQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TnzDm71KYQud7PpDKftXAENgNcbR1ab0xNUtbCpYsT8=; b=N5ol6QBiS5SJ5lsXbeN9PETZzmCLZYgYCluZg8Jkf5NdWCIay2W7MZKQ+akjVwYsDq anF6+So9ATQ2PevjA2ICnJD41EkfBV7+0Zqg6BA72owS6eR7TCgB9oI0qoazXo8B/mMO etYejeqM1zaXYMzltSPeAzlobK9Q9ZivDzdwgRIvmqfvXmkdklt99ykSl44qW1ecAwMX /Z+xrmgsVpgY2cPm+auiL6mC1UCGuCHskDMMYTVqDqLvQRf+oVtfhRWMQ40IYMUaOPAg 7KQ8l5H+3Y3w3IigjvfSchCEua9jEbXttVaB/LFKGRh+VF7aEGVz4iFamt86vd2GNUVJ kmcg== X-Gm-Message-State: AOAM532UXna+pOVn4+L8FN5muZdZWQqMSzN5inpRaJnjHm9aGlBT/H4Q PuSfvU6R9/SokvH6fiXAHB7erSVmx6nzhA== X-Google-Smtp-Source: ABdhPJyYS2C8m9sS3sUTfMfE4R/KR2PDvTvCoJjssL4n2A/+Z/7prH5KHVUhswptzhvpYecl1TUTIQ== X-Received: by 2002:adf:f7ce:: with SMTP id a14mr5247523wrq.174.1629997404748; Thu, 26 Aug 2021 10:03:24 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/37] MAINTAINERS: Add ACPI specs documents to ACPI and NVDIMM sections Date: Thu, 26 Aug 2021 18:02:44 +0100 Message-Id: <20210826170307.27733-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998209162100001 Content-Type: text/plain; charset="utf-8" Add entries for the ACPI specs documents in docs/specs to appropriate sections of MAINTAINERS. Signed-off-by: Peter Maydell Reviewed-by: Igor Mammedov Message-id: 20210727170414.3368-6-peter.maydell@linaro.org --- MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6b3697962c1..dffcb651f46 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1751,6 +1751,10 @@ F: qapi/acpi.json F: tests/qtest/bios-tables-test* F: tests/qtest/acpi-utils.[hc] F: tests/data/acpi/ +F: docs/specs/acpi_cpu_hotplug.rst +F: docs/specs/acpi_mem_hotplug.rst +F: docs/specs/acpi_pci_hotplug.rst +F: docs/specs/acpi_hw_reduced_hotplug.rst =20 ACPI/HEST/GHES R: Dongjiu Geng @@ -2057,6 +2061,7 @@ F: hw/acpi/nvdimm.c F: hw/mem/nvdimm.c F: include/hw/mem/nvdimm.h F: docs/nvdimm.txt +F: docs/specs/acpi_nvdimm.rst =20 e1000x M: Dmitry Fleytman --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998431; cv=none; d=zohomail.com; s=zohoarc; b=jYsUCFUqg7K0k+yvJE4DUCgDr8C0Z2s/72RBppDRD3sv29T+72BEHmfgKgmAsptxSw5CEdtr25UyDMlCvUvseRB+9k0YLki4tIeH4kCEC5wbmi8Et3eujN3ExS6dtRcQO+dzFoTrT6n4/Iq/D7P8NI4SjIOsuM4JQIEP8R/SnKg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998431; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CUaqCgRdZUrBir0XqdrPdZbfnwGdAj64KAvzQjt31Zk=; b=i4S6TNEPeyEWX96kdmEH9YybPIWIfBu8vMtODxy2PhNknOawhzxPH0ZfB+zmgW2a8HiYgffs7E5gQC/2xRPJJgut7Xc1hALDYuuR9cyxUFbKBLdZ/ezh8xy3WjdvV6/iP4wbzGD9+vFEZhbRTbDi6+bpbXusxPlGfH9Ga7DIidw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998431365323.77857183394246; Thu, 26 Aug 2021 10:20:31 -0700 (PDT) Received: from localhost ([::1]:37484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ3G-0008Lc-Av for importer@patchew.org; Thu, 26 Aug 2021 13:20:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImm-0005SV-Qg for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:28 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:52753) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImk-0008PH-VX for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:28 -0400 Received: by mail-wm1-x335.google.com with SMTP id f10so2259790wml.2 for ; Thu, 26 Aug 2021 10:03:26 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:25 -0700 (PDT) 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=CUaqCgRdZUrBir0XqdrPdZbfnwGdAj64KAvzQjt31Zk=; b=con71/czuTJoZYcTzRph79ZKKof/+scTk7hLhq4OOcAjziw/8qStalWqMG3p7brxpP uqPE8yvXcs4KfN8pWxI16Fd+9Z8jGq+WzuNgCSCEdNnvYEQlRxu5gsIZh2elOK1Sz26h fwdj5c+2q9SgthEE6avuUiTrzpcWb/QmrIrYPg+I+l64+pTUK3K5lr+sCWPxxy/8k9a8 anVxKfcDWxHeWEo5MZtlzZpDqC1gtm7NpJntaPCoTiTFiILPci6X+EwHDR8DKO28ZVgO 9hXB9x+zAZRnMrFol5eDLcBep31iVp+kIVei4MEGQfBWQuUdfcf2TGtcdHaJxeI5S1Ib Wo3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CUaqCgRdZUrBir0XqdrPdZbfnwGdAj64KAvzQjt31Zk=; b=owZxPd/dnQ4Mw2slkWso8DEENqDNoc5r45+X1eFVpGQB4lGilybRbwBo11y/kkMU/s z7sn3A7mYV3xT+z3thawb+wTiXaiq51IWhozrOZGr5EQuluDoHXW4raWPWV0qRW5HHYc 4tt9StBb2rOnHfAxRIlb6WqN5yKeA65A/gZIU+22BojOcz0s2qnF6vCPH2d0BboFsIJ1 hFd96THR304LjAtsCOcLzqFGYkuUdae1dFSNQpAOp7616pE79ryxyuog86r34QKjW23Q eudcMuhYF6VnoVY424ZIyUGtIAwTZX010XynL6ane/PKzrok8UtjUPePU+jO05CyDWU3 Khjg== X-Gm-Message-State: AOAM531ViQ2kbc8pV1FeZLcXjeG7+k3RXpgQCjGS8NIJLMUAEDhDGtxc oxcxYes1iRu+HxgjfLXv49WxQEQSEo6XYg== X-Google-Smtp-Source: ABdhPJxTc5XoXwU2YrIh2G0QxEVkHQ3wSt+L35FuaPhcaUZt2hH5QLwklB35GRNkmBiCwfqJXOcI5Q== X-Received: by 2002:a05:600c:1d11:: with SMTP id l17mr4622895wms.58.1629997405610; Thu, 26 Aug 2021 10:03:25 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 15/37] softmmu: Use accel_find("xen") instead of xen_available() Date: Thu, 26 Aug 2021 18:02:45 +0100 Message-Id: <20210826170307.27733-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998432276100001 Content-Type: text/plain; charset="utf-8" The xen_available() function is used only to produce an error for some Xen-specific command line options in QEMU binaries where Xen support was not compiled in: it just returns the value of the CONFIG_XEN define. Now that accelerators are QOM classes, we can check for "does this binary have Xen compiled in" with accel_find("xen"), and drop the xen_available() function. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20210730105947.28215-2-peter.maydell@linaro.org --- include/sysemu/arch_init.h | 1 - softmmu/arch_init.c | 9 --------- softmmu/vl.c | 6 +++--- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index e723c467eb2..7acfc62418f 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -30,7 +30,6 @@ enum { extern const uint32_t arch_type; =20 int kvm_available(void); -int xen_available(void); =20 /* default virtio transport per architecture */ #define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \ diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c index 6ff9f30badd..3f4d7c1b1cd 100644 --- a/softmmu/arch_init.c +++ b/softmmu/arch_init.c @@ -96,12 +96,3 @@ int kvm_available(void) return 0; #endif } - -int xen_available(void) -{ -#ifdef CONFIG_XEN - return 1; -#else - return 0; -#endif -} diff --git a/softmmu/vl.c b/softmmu/vl.c index 5ca11e74694..82d574fe4b2 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3448,21 +3448,21 @@ void qemu_init(int argc, char **argv, char **envp) has_defaults =3D 0; break; case QEMU_OPTION_xen_domid: - if (!(xen_available())) { + if (!(accel_find("xen"))) { error_report("Option not supported for this target"); exit(1); } xen_domid =3D atoi(optarg); break; case QEMU_OPTION_xen_attach: - if (!(xen_available())) { + if (!(accel_find("xen"))) { error_report("Option not supported for this target"); exit(1); } xen_mode =3D XEN_ATTACH; break; case QEMU_OPTION_xen_domid_restrict: - if (!(xen_available())) { + if (!(accel_find("xen"))) { error_report("Option not supported for this target"); exit(1); } --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998518; cv=none; d=zohomail.com; s=zohoarc; b=dfUqO7jE786PpLUYX0Q1dfuLRDOjn0/x11kBTmKtsynGqZQcmW+jfg+fMek19WkMtR+qRP4UE/o4nrV1TRnLn3N5FcUHVHUA5Pq2mNwLNhWG5d7905i7iAnJrsqPGHUvob5S5E/iibY9GwaxICb6bmSVmIlJbtFKH/jAyZCaGqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998518; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QYIzSbPGGQ8PqEzqRSOYqRmsLXlRFr8Koh660vhg0c0=; b=J9TXSCD6ciMgUEyoa437RCYT2PAD1nL/3xAfIFFLqUvNb3hTmtxHZbZEcelGF3hF88PAtAGLLY7BePUUJiBuwIr2bRKHCZDctsxrYC65ToOkC9zeCZpHi/FUkdm9YyLnz2uLgUX4ZjKL5yWz3L0uJo4+FthzwltSsZE405yORTg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998518420900.2796022920462; Thu, 26 Aug 2021 10:21:58 -0700 (PDT) Received: from localhost ([::1]:43244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ4f-0003oE-Aa for importer@patchew.org; Thu, 26 Aug 2021 13:21:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImn-0005Uh-Sj for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:30 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:43978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImm-0008Q8-A6 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:29 -0400 Received: by mail-wr1-x435.google.com with SMTP id b6so6124675wrh.10 for ; Thu, 26 Aug 2021 10:03:27 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:26 -0700 (PDT) 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=QYIzSbPGGQ8PqEzqRSOYqRmsLXlRFr8Koh660vhg0c0=; b=VjMLMjBSHhSrxhxWVdRzrs+ssaQjVUQHs6c1QXECcxfWt13Z5RiU6stkwmUfisCjov KcTDLOJ9lBYrsskA45g/wc60lGuKvCm8Wnz+RfZKrkG1tjMp2TMyqqJiJqJ/hoPQKVpZ ArlTqLvIK0pY5bKmIlZPPbpr5UxApwEwpyRrZa0SGlIqCHCEd5iE4eCwYLo0Hp0PzmXC RaRry6XlAnUAu/7TMF6zDmzvaC/XbgJi/jcQZU7yeDUH11jw99AVB10piDnchRNGet+f VuPq+8BiPpgkKadExcCgtBHY6XaLX9/XKT4PELIKaVZXGLYJ8RDkdOQUQBbyIHVXVy8M DA+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QYIzSbPGGQ8PqEzqRSOYqRmsLXlRFr8Koh660vhg0c0=; b=ileOmpkUsXpsAbt+w4MUrQqma9aIWABwYYJE+TbokYA4ZMxSQ959fh+/quFC0QzZn6 G7W90211sMx9RkIrTuR9vM0dQ8QFRH06y/3gNLl99/WOv9lcNgnpW1LO8PV7G6Gjmwyl SIOvam2C8xzTuyMfJettytvzZFsekityjTPSBm4a/AHIfg3YQ2Fi8HDzCsARkVDOpko8 1c+QEoJL4N5AgckxxA+mi3IeLTGtOdBgFcwBNJMdqZzVZKKUKe3rp9Eklqr/IBbpIval 39FcePc5BfmXZ9OmiZRr0Z79Pre7yL74O76xMlDTAdLn9jWIqs2jSVtR8Gb+4jfMSTFC qOdw== X-Gm-Message-State: AOAM5318AIvpYDkNVpPx3dRp9BFF5erQf41851QUSvRBG8AmjVQrr3dS /9rm5lh0d4LOOHdBK1855E1nV9UPWwokWA== X-Google-Smtp-Source: ABdhPJyCnYagAhM2hmDUU5IcUgw1zzQNd+m6zXZLyFQJb6NT8JGds22obey+S9TLHEavyzNBapNIqA== X-Received: by 2002:adf:ebc8:: with SMTP id v8mr5170906wrn.153.1629997406749; Thu, 26 Aug 2021 10:03:26 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/37] monitor: Use accel_find("kvm") instead of kvm_available() Date: Thu, 26 Aug 2021 18:02:46 +0100 Message-Id: <20210826170307.27733-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998519005100001 Content-Type: text/plain; charset="utf-8" The kvm_available() function reports whether KVM support was compiled into the QEMU binary; it returns the value of the CONFIG_KVM define. The only place in the codebase where we use this function is in qmp_query_kvm(). Now that accelerators are based on QOM classes we can instead use accel_find("kvm") and remove the kvm_available() function. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20210730105947.28215-3-peter.maydell@linaro.org --- include/sysemu/arch_init.h | 2 -- monitor/qmp-cmds.c | 2 +- softmmu/arch_init.c | 9 --------- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 7acfc62418f..57caad1c675 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -29,8 +29,6 @@ enum { =20 extern const uint32_t arch_type; =20 -int kvm_available(void); - /* default virtio transport per architecture */ #define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \ QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \ diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index f7d64a64577..9ddb9352e65 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -58,7 +58,7 @@ KvmInfo *qmp_query_kvm(Error **errp) KvmInfo *info =3D g_malloc0(sizeof(*info)); =20 info->enabled =3D kvm_enabled(); - info->present =3D kvm_available(); + info->present =3D accel_find("kvm"); =20 return info; } diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c index 3f4d7c1b1cd..9011af74e4a 100644 --- a/softmmu/arch_init.c +++ b/softmmu/arch_init.c @@ -87,12 +87,3 @@ int graphic_depth =3D 32; #endif =20 const uint32_t arch_type =3D QEMU_ARCH; - -int kvm_available(void) -{ -#ifdef CONFIG_KVM - return 1; -#else - return 0; -#endif -} --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998738; cv=none; d=zohomail.com; s=zohoarc; b=IpIChSPlCB1eG5111ml4UzY3PHJIycWUK2rjz86If0V6TWAC8sDjPs7fk8GIuwQ8qaHL2bQwmmkBIje5W41f5svwOvbs0SicUVY3v4YIzUt9HrTqH3nzUYTuFjSo+KUVO385IZV4A5IWqtLXmcvRJ8xkYEKDvk6w8UfVInvIx+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998738; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cd8xI6PJSFZZ22zgXrYlDJesxftGci2nDGziFuXwknM=; b=HZFendu2FyTXWAxKeYgre46+3M48lTQBO9D8b1GP09rugYbgSb3g8uIOnWhOzCfy2WeKGVxLJFYTqX0iqgrhRB/O1+gQEO4Flghks7wgWjvTZX5IEtTuFX/ouRfilhXkCvfPa0YaCkOkWiChTEarrKAf9tShJjzY+1dgEXh2/wY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998738203208.44849118789602; Thu, 26 Aug 2021 10:25:38 -0700 (PDT) Received: from localhost ([::1]:50808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ8D-0000Sw-7L for importer@patchew.org; Thu, 26 Aug 2021 13:25:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImo-0005Vk-Kq for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:30 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:33757) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImn-0008RN-5W for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:30 -0400 Received: by mail-wm1-x332.google.com with SMTP id j14-20020a1c230e000000b002e748b9a48bso5954664wmj.0 for ; Thu, 26 Aug 2021 10:03:28 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:27 -0700 (PDT) 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=cd8xI6PJSFZZ22zgXrYlDJesxftGci2nDGziFuXwknM=; b=nOARUw393EgupQDpXMBNkihIUqtLIULbKdYQYw1hm20w2rBPU1hO2DF9XEheR7aTXc pwaBYr3O76VCz9+s8L4uP8kzfJ8WJW3vjYzq7RmgrxotOkcZmjRUkWc5kP74nJ+fIO8j kj583qO/EVLlWnr0thyerXK0MFYbrq9u3l4eTJ9n3mz+yvnZGrk6Hpgy/8KIFlPfyu2Z k4x2usdP5YW7iEqjmgQBbui6Cq/VzxHxyMKjDpwtB3PLOfFe4adPAN+gdnlG+d99Rnwy RfW2H4J5zRmTkrQ1y6ZiMIRTrAzXay7CCp8m3zZmhXhYVzBA7a9SWOqVdVgP66+NFdtR psoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cd8xI6PJSFZZ22zgXrYlDJesxftGci2nDGziFuXwknM=; b=aJzpdfqxwcts/TPZ/lpy8KFL/M/x2ZpjmWR5kxe3mvoj5u6gnz9KzRjmKHDNVM3KlV jaOikj/c7wMnbQTrwCvi9tKW8BYwej7LCjUOu3mZiuBTH1dkmmWpYnPp2l3uaeKJdS1Z yGvRTSdbcWD4RZnT4mf7dVjg/LOFiADTXMpj5sONiDftIkodT3yuezAeh1Q78YB6QTyn DmXLCudsCUUIeJrsslCpgdt8qk7RIiySQxyu/7uoPXg4IORNN1buvzk6C0s72By00YaM yNZ66pkWqIMml7cAuTOmIZRvyfG61PrY6pbDlw8F7aee+g5mRmsQPP9Qe2SkX8PPnCmQ pYgQ== X-Gm-Message-State: AOAM531V4RDrxFf72sg8hrUQrBDABXzITGrHJ2L2YcFtvj59oDErJfT1 XlUKL7A8pB1PqUbSwGa5v+T+x92VnZqQwQ== X-Google-Smtp-Source: ABdhPJx/Y3r9zHKnoHL25PO3k42ajypMJx3IRHdnmeONvIEIdFJ3TbdXlpGl3kcu8UHBV9HG+/ntag== X-Received: by 2002:a05:600c:299:: with SMTP id 25mr2672228wmk.107.1629997407770; Thu, 26 Aug 2021 10:03:27 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 17/37] softmmu/arch_init.c: Trim down include list Date: Thu, 26 Aug 2021 18:02:47 +0100 Message-Id: <20210826170307.27733-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998739939100001 Content-Type: text/plain; charset="utf-8" arch_init.c does very little but has a long list of #include lines. Remove all the unnecessary ones. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20210730105947.28215-4-peter.maydell@linaro.org --- softmmu/arch_init.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c index 9011af74e4a..91cbf883e28 100644 --- a/softmmu/arch_init.c +++ b/softmmu/arch_init.c @@ -23,13 +23,6 @@ */ #include "qemu/osdep.h" #include "sysemu/arch_init.h" -#include "hw/pci/pci.h" -#include "hw/audio/soundhw.h" -#include "qapi/error.h" -#include "qemu/config-file.h" -#include "qemu/error-report.h" -#include "hw/acpi/acpi.h" -#include "qemu/help_option.h" =20 #ifdef TARGET_SPARC int graphic_width =3D 1024; --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998832; cv=none; d=zohomail.com; s=zohoarc; b=VKAu/ZEpYMUK51BGFjiGuz+USjClY8PlzdBlZ8o0efzW/ynBIvc8IvqNwY1WXP/1pwQW3BqrfSMdXxcHC5Gc3mHOmYhJSu4JAG3EoRPxZm/bpX8Wn6Bt9E2HfS6vbGNi6+sFKu6tVPLon3NWLjtTVY0qw0FXaD8A7SbDY5+v+OE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998832; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lGvmFfdtSs7YGgPJ+UvDEX8ttejeZpWGK6v4y8O9lpE=; b=FKC4YoQeR3ISiCzFyBqjxaBIlhklzhML4tdyeH+OXPka+3xfTgQBK+0Olh8sCXwRhQ7jyWl/oDT5fPTO4Q8f9BukfalFaGS/EwZSfkPI2S5OyxxeUrQ6WZz7qgJP4EigWoa78BDwUT76059G34cVYLq+gciJNTqtA/4ieUsqGw4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998832923328.5050087709968; Thu, 26 Aug 2021 10:27:12 -0700 (PDT) Received: from localhost ([::1]:57456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ9j-00050a-V6 for importer@patchew.org; Thu, 26 Aug 2021 13:27:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImq-0005ah-52 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:32 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:38838) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImo-0008SD-8d for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:31 -0400 Received: by mail-wr1-x432.google.com with SMTP id u16so6173223wrn.5 for ; Thu, 26 Aug 2021 10:03:29 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:28 -0700 (PDT) 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=lGvmFfdtSs7YGgPJ+UvDEX8ttejeZpWGK6v4y8O9lpE=; b=DT/OmsOzZ0OGiNF+pcWDtxOHCi1rwcq+fmJzhV8beuyq1FrIcEOWuZirVzKE34f+fK BO+0yv4aulgDM4OtSFxBMcOR/PB+/i0I4LRJIf9a8pg/qCqh6Lvi/G9RFwTFXgVqroV9 9GJvgEFUE9zrkVJdVp5IP+2V5AcRmWhecvoPjxz22kX7fbQ3aunVXQY20lIqk8+pK82v +WGwcCi9kbZdWtwr6EqwfdvqQLXvKOIgLEVGRAYcEsrKgUMT+43NMk5bJ9zQKbctWXEX SNCTNxEOKw/Vi1Uz3pNwdWuqu9yuYN/lJ7kPCz5geaUkWi7LnPBSW8YQAH7Z8ZzzROFa 7pZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lGvmFfdtSs7YGgPJ+UvDEX8ttejeZpWGK6v4y8O9lpE=; b=Xef9GpiyLeFvejxdWXUxlBpL7aAHYp/wbav98Eh1h1vlMXetyVZKDRVSnpmi7kfn/2 OOCmfszQ2jsFQ14bge+6bwudpeVxR4qqvwZqKGZXVvrWf70igZztk3tTLPM4EeAR8o/w /T/STW5iD5J8FVw/s9/opqOaJHt5MFAKr8fe2QmS0VyqTML+4GBJfffGi3VDUtLhGTf+ 1axi/O+yBoB0H6yBCLBtRLcvk7nssbXYEmfvNaBwrVsjIi0bUbw7D8MSL6uDlQM9KWgw sxuHPqqw2z12PFsT8FgKUELAa7s6sbuPZf1+QzHhUoYPFWL3pFWVfLExt41qviouGfg1 1H0Q== X-Gm-Message-State: AOAM530ssTTED4QerAxaNIXSgw3/jAVRuSYLzqIL8g5uJTsUjC46x8YH 6WwlGEKRX8lI1JXO8rYDXavg9wKeG4Sb1Q== X-Google-Smtp-Source: ABdhPJy7augtv27QxHL0puOMqKnxsBzDfzH15TgOlbj/4XUiP7y+IAnZP/F0rw5DO8zq8voisRuZFA== X-Received: by 2002:a5d:690a:: with SMTP id t10mr5368767wru.304.1629997408891; Thu, 26 Aug 2021 10:03:28 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/37] meson.build: Define QEMU_ARCH in config-target.h Date: Thu, 26 Aug 2021 18:02:48 +0100 Message-Id: <20210826170307.27733-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998833882100002 Instead of using an ifdef ladder in arch_init.c (which we then have to manually update every time we add or remove a target architecture), have meson.build put "#define QEMU_ARCH QEMU_ARCH_FOO" in the config-target.h file. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20210730105947.28215-5-peter.maydell@linaro.org --- meson.build | 2 ++ softmmu/arch_init.c | 41 ----------------------------------------- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/meson.build b/meson.build index b3e7ec0e92d..bf637848125 100644 --- a/meson.build +++ b/meson.build @@ -1625,6 +1625,8 @@ foreach target : target_dirs config_target_data.set(k, v) endif endforeach + config_target_data.set('QEMU_ARCH', + 'QEMU_ARCH_' + config_target['TARGET_BASE_ARCH'].= to_upper()) config_target_h +=3D {target: configure_file(output: target + '-config-t= arget.h', configuration: config_targe= t_data)} =20 diff --git a/softmmu/arch_init.c b/softmmu/arch_init.c index 91cbf883e28..8919405c7b2 100644 --- a/softmmu/arch_init.c +++ b/softmmu/arch_init.c @@ -38,45 +38,4 @@ int graphic_height =3D 600; int graphic_depth =3D 32; #endif =20 - -#if defined(TARGET_ALPHA) -#define QEMU_ARCH QEMU_ARCH_ALPHA -#elif defined(TARGET_ARM) -#define QEMU_ARCH QEMU_ARCH_ARM -#elif defined(TARGET_CRIS) -#define QEMU_ARCH QEMU_ARCH_CRIS -#elif defined(TARGET_HPPA) -#define QEMU_ARCH QEMU_ARCH_HPPA -#elif defined(TARGET_I386) -#define QEMU_ARCH QEMU_ARCH_I386 -#elif defined(TARGET_M68K) -#define QEMU_ARCH QEMU_ARCH_M68K -#elif defined(TARGET_MICROBLAZE) -#define QEMU_ARCH QEMU_ARCH_MICROBLAZE -#elif defined(TARGET_MIPS) -#define QEMU_ARCH QEMU_ARCH_MIPS -#elif defined(TARGET_NIOS2) -#define QEMU_ARCH QEMU_ARCH_NIOS2 -#elif defined(TARGET_OPENRISC) -#define QEMU_ARCH QEMU_ARCH_OPENRISC -#elif defined(TARGET_PPC) -#define QEMU_ARCH QEMU_ARCH_PPC -#elif defined(TARGET_RISCV) -#define QEMU_ARCH QEMU_ARCH_RISCV -#elif defined(TARGET_RX) -#define QEMU_ARCH QEMU_ARCH_RX -#elif defined(TARGET_S390X) -#define QEMU_ARCH QEMU_ARCH_S390X -#elif defined(TARGET_SH4) -#define QEMU_ARCH QEMU_ARCH_SH4 -#elif defined(TARGET_SPARC) -#define QEMU_ARCH QEMU_ARCH_SPARC -#elif defined(TARGET_TRICORE) -#define QEMU_ARCH QEMU_ARCH_TRICORE -#elif defined(TARGET_XTENSA) -#define QEMU_ARCH QEMU_ARCH_XTENSA -#elif defined(TARGET_AVR) -#define QEMU_ARCH QEMU_ARCH_AVR -#endif - const uint32_t arch_type =3D QEMU_ARCH; --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997726; cv=none; d=zohomail.com; s=zohoarc; b=Cj0vBXCgy9OXB3iUtxbP242xo5CpDghiL/xBTvEmB0+jrIt7Lcgh5hprrYq83lMAKKIVUHeCjls+iI0NYNG1g3WGZP2PGS1mO/n23wGx0u8MJxLE0aMGgQKJjaCkIyWgDVFFBwv1su0A6unSFCauVI8kmY09ZMVkPqWvjs76vWY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997726; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gElcNWN3M9Jq5lKNbD/CRw0/G5CG8Srht/Gqb5hcJyc=; b=extXe+qVPSW6YjYuQKV0r1XhGhe4FadEqnCeDCWp/sPY8dcrz4tsMAz4GULb8hOt+FLUlSLfAPG5K62TY1pizwtjEX9is7z3VPP6ozLcFhIUTwxmHUxi95caI/NNaxP+4Gn+ABea53AdN283Cu1NQ+Tw5GMuge9k5GuW2WxZabs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629997726400467.4374876699861; Thu, 26 Aug 2021 10:08:46 -0700 (PDT) Received: from localhost ([::1]:55528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIrt-0007vz-69 for importer@patchew.org; Thu, 26 Aug 2021 13:08:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImq-0005dM-Ly for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:32 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:38452) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImo-0008SP-VG for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:32 -0400 Received: by mail-wm1-x336.google.com with SMTP id d22-20020a1c1d16000000b002e7777970f0so7366695wmd.3 for ; Thu, 26 Aug 2021 10:03:30 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:29 -0700 (PDT) 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=gElcNWN3M9Jq5lKNbD/CRw0/G5CG8Srht/Gqb5hcJyc=; b=lEgQqtyyh0bqOB1GHvGVlBf+Qsro+203Siy3qnQnycLa473qiQLh7Eg8BWyMvz5/Zx VaUNt9KIIBQ3DKqFzKlJQ3wTSsww5KjTgUVJ3HRay22IXJsplr02WRN5+HtbZEwh3Tp9 FLGxxB5+KmYXd+bqOdUXVRwNiJEzn71qWQkqqSEiQbSadrkJu+alQvkaG6NA6uimNzJT 09S1SfnPlaanFLrWP24b4M75mK/ZQ71Nuqq1up+cwSY1egniP/F+I/72JLgcg5KrkgV7 9FQFx+ipztH/WYDjWRQbBwxz5EFuXms8zJXPB635zs+6QPPk9aUcUxtj4aGHFddLxiwC p+Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gElcNWN3M9Jq5lKNbD/CRw0/G5CG8Srht/Gqb5hcJyc=; b=K1RYueNoSEJNa3MT+b1uUloUeVJyVNstq5dl1Kij9m4PvX9TlJNVVXQ62oYoRiXSJX xP8lqvADF117qipFPwlxNpQ+IU+kVZnCJSc+xAZyLEBC3qOxB4V4Pt2LK5fV9T+5rr9j 4dGmk2EoddWRkFIfAi11iw9WJYqV9kxTqAdoZqTfP/Mm2LtVkWTxijQFLcBhzass5pUj O4xGCXDNkJVdwPcf7f1aKhKoxqhDR3Gmyo+Vw0vG1gTuSBwiINxwu/dDaEP2AnCrjvPI Hsy2gs7skPw2MH2BAkjJ+RKCMY2T6uetv4sleSeXWKPNjDzxCjHejiptN0L1dlHC0WJ5 yOmQ== X-Gm-Message-State: AOAM533R1/JJrP1SF2UoCPTERErsJCxbpSQ0m7fsufvR+rdeBfl/zZ9s qDt0oVo4E8X9VLX9w8GnzfCrzRR04E4gfw== X-Google-Smtp-Source: ABdhPJzNbWclHv3NlAiS3QkGS5hCyWR0mVBtkBsjrD2U6c4y6gFudzRlkaxBYDex01NEcVT5h1aniQ== X-Received: by 2002:a05:600c:4b88:: with SMTP id e8mr595615wmp.164.1629997409699; Thu, 26 Aug 2021 10:03:29 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/37] arch_init.h: Add QEMU_ARCH_HEXAGON Date: Thu, 26 Aug 2021 18:02:49 +0100 Message-Id: <20210826170307.27733-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997727987100001 When Hexagon was added we forgot to add it to the QEMU_ARCH_* enumeration. This doesn't cause a visible effect because at the moment Hexagon is linux-user only and the QEMU_ARCH_* constants are only used in softmmu, but we might as well add it in, since it's the only architecture currently missing from the list. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Taylor Simpson Message-id: 20210730105947.28215-6-peter.maydell@linaro.org --- include/sysemu/arch_init.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 57caad1c675..60270c5ad15 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -23,6 +23,7 @@ enum { QEMU_ARCH_RISCV =3D (1 << 19), QEMU_ARCH_RX =3D (1 << 20), QEMU_ARCH_AVR =3D (1 << 21), + QEMU_ARCH_HEXAGON =3D (1 << 22), =20 QEMU_ARCH_NONE =3D (1 << 31), }; --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997864; cv=none; d=zohomail.com; s=zohoarc; b=WhP5xlQzTYShsY+6PeeM4kwt9BbZena0l/Ab3Qq3gq0W3jC1HkZUFJu6gZX1EW7XaKqeptcQX30iu9KZzfc64zz7WOAyn+uoroufhrxSBCltVmwMevqdEYDjrSPl97ZIoNKAMyh0aDD5VHFIoIlyb5dsiEFNr2PvSdMYZTuKV7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997864; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9S9qaExeEhXE11YYRh9+JjtdaNpjXkfjgsg5lVi2dxo=; b=IWfB5imCAqkfTl/m2uLK6GTH/t1j3O7W+jyI5Nwh+xo/djgD42LzPrerFz80ZB7uvLdFeCK9Tv8Jn3cW8e3++mIOdm47m+9hkq9txxic8yUUvGoJe4JCch7vNB1L2nRqdfCvdNNh0YuhL9sr4v+HQ8cRjP/fLH7rW1kEIAtIt+E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629997864681721.8821551147365; Thu, 26 Aug 2021 10:11:04 -0700 (PDT) Received: from localhost ([::1]:35830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIu7-0005Al-L9 for importer@patchew.org; Thu, 26 Aug 2021 13:11:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImr-0005ir-Pz for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:33 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:38440) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImp-0008TJ-Vz for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:33 -0400 Received: by mail-wm1-x329.google.com with SMTP id d22-20020a1c1d16000000b002e7777970f0so7366715wmd.3 for ; Thu, 26 Aug 2021 10:03:31 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:30 -0700 (PDT) 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=9S9qaExeEhXE11YYRh9+JjtdaNpjXkfjgsg5lVi2dxo=; b=sfXghfE+twl1JYaOEQZzV7aTIr0RfcD9zbM6R9AfpYYLcR1KmzHEtD05MUlrFd3sta ZEXaT6BhxgCS1okIe78W08QV6whIFhD7oE0rRuBATt3lpTBNkvwyNa0jrJE94mnsCrqc HEE64gHS01obxkynoUchLnuX6o3mVOlTLvmxzRKthE2i0XPf0bM17ckdcFtJC2hwpiFr cLzw4BL3xaXi56iE3jo4cDI+WGw8NTYOIh0xvM7eCTXVL44ML/D38sjgMruNC6ILqqYv ZtAb16DFxaGeZOqIBpKnoM8FOemxSEkGbs9B+J9G0Ly2goTy+xwLn+sOsM1LU3UyZrtz cZrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9S9qaExeEhXE11YYRh9+JjtdaNpjXkfjgsg5lVi2dxo=; b=FbGfxgH4RpYWR7BpY3h3NoABZtzJXWtB2Dz81UVPhJqeYSyGbEicsi22jcdHyQXEEg +78bF1yh/Fbl3lJe7gMizMs2oTHvd7rR2GzJWXAkG8rLMuo/QQA36YnzDk9PWaQPTyhQ 1+JtDhpVTkEqS1wMGWnjKJZUeTLF7S+chV4XHd2PnRJ61Eb7+lC+Lr4VALYPgXTVxdLO N1auoUbYx+9D+MOE6dKRxZTXGs5uP8uWvIhM3Yjdtf4UC4IfUrLANc7+AUEk5v5bnj3Q YcjyDFrHTvje6XiVXWfM57K7mnItHvzpMQxXspp843w/HtgyWLBKmi3vZiKhOEMlvshy BMhQ== X-Gm-Message-State: AOAM531Qep8p0AzxhCDgHztdBHnMTwSTtLP0+BaweOXUtZZ0l3+ESjbJ H2jumyJLtnNCnMmcYnP/bvB+eZW5eie3yg== X-Google-Smtp-Source: ABdhPJyR5faZx3WlY/be2m0vBYeYzHVafnZoAnTwsoihtcGPbbdEM5DYQkLf2DCG+MqW2rf8cZQ0pA== X-Received: by 2002:a05:600c:154e:: with SMTP id f14mr15448697wmg.162.1629997410588; Thu, 26 Aug 2021 10:03:30 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 20/37] arch_init.h: Move QEMU_ARCH_VIRTIO_* to qdev-monitor.c Date: Thu, 26 Aug 2021 18:02:50 +0100 Message-Id: <20210826170307.27733-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997866340100001 Content-Type: text/plain; charset="utf-8" The QEMU_ARCH_VIRTIO_* defines are used only in one file, qdev-monitor.c. Move them to that file. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Markus Armbruster Message-id: 20210730105947.28215-7-peter.maydell@linaro.org --- include/sysemu/arch_init.h | 9 --------- softmmu/qdev-monitor.c | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 60270c5ad15..e7789399508 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -30,13 +30,4 @@ enum { =20 extern const uint32_t arch_type; =20 -/* default virtio transport per architecture */ -#define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \ - QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \ - QEMU_ARCH_MIPS | QEMU_ARCH_PPC | \ - QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \ - QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA) -#define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X) -#define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K) - #endif diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 721dec2d820..a304754ab91 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -52,6 +52,15 @@ typedef struct QDevAlias uint32_t arch_mask; } QDevAlias; =20 +/* default virtio transport per architecture */ +#define QEMU_ARCH_VIRTIO_PCI (QEMU_ARCH_ALPHA | QEMU_ARCH_ARM | \ + QEMU_ARCH_HPPA | QEMU_ARCH_I386 | \ + QEMU_ARCH_MIPS | QEMU_ARCH_PPC | \ + QEMU_ARCH_RISCV | QEMU_ARCH_SH4 | \ + QEMU_ARCH_SPARC | QEMU_ARCH_XTENSA) +#define QEMU_ARCH_VIRTIO_CCW (QEMU_ARCH_S390X) +#define QEMU_ARCH_VIRTIO_MMIO (QEMU_ARCH_M68K) + /* Please keep this table sorted by typename. */ static const QDevAlias qdev_alias_table[] =3D { { "AC97", "ac97" }, /* -soundhw name */ --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998938; cv=none; d=zohomail.com; s=zohoarc; b=dU3UheVGPJu4QgAtGzaYQjeduEi5BnPim8iQcOtiUqZF2Va0px8NeFFSQL4i3kZCnYAb8uzN8TDzAHYW79aFFM9dIelF823zvIPZV1F6noroRWat8SzNptI7hpfMLwOrnyoyX8D8Q0Zexo0Q4VDyBDLrnVtXgRZMuHim2tALuLA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998938; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Iet8M/NeCrzb5+h+XHxXY29OeXdXIKP1DX2AdZZom80=; b=F/IsnFYaPQq247LglUsixwNh5Ml7/va4YeeelQmxqvQIxUIDtHIJ2ZmnPGS9pxH9PnRog8CUXOHyD2DTS2tODSD3yL2KTEIq43cgAqKqB+m45JooEgyshf/3mrvoY+O1/uOh659Tmvf46IFGbvZzpuAUC7by7D4xA4nNN36G0zc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998938633385.6340839999681; Thu, 26 Aug 2021 10:28:58 -0700 (PDT) Received: from localhost ([::1]:35630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJBR-0000rE-G3 for importer@patchew.org; Thu, 26 Aug 2021 13:28:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImt-0005ng-17 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:35 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:44019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImr-0008UZ-1k for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:34 -0400 Received: by mail-wm1-x329.google.com with SMTP id o39-20020a05600c512700b002e74638b567so2655665wms.2 for ; Thu, 26 Aug 2021 10:03:32 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:31 -0700 (PDT) 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=Iet8M/NeCrzb5+h+XHxXY29OeXdXIKP1DX2AdZZom80=; b=KO1WLPATQmkR6qkZi2rJumIbeztKXjPS3qr4o9iLnJJ9k5mTnBOnMudc3jowaBmg+b W4YFqt52Wt48vpDezJdwjPPNSpYjwQj28l4oK/IdDPijrZsfLmaHJHmlw7XGju+7Dpz4 Y5mDNo+ABUIUvj90arkE3xVgKA9OtSBYA7/efchVEL2FZ4h1gcVLwPOWKDTJxE1y5w3Q 8pPmpE2eZ7FF3boeL8qs3ZbJXUX8olTbWwm4XB/PMsrQlL31Ib7atC9JxLc7ynsVDQGY CnfE+C6IwM/lI+CwJyQZgX/kUv+MxvsH2ukh94O3v56JrDxOrj1Vlf4W2q972GBHEJu0 sOxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Iet8M/NeCrzb5+h+XHxXY29OeXdXIKP1DX2AdZZom80=; b=YJrJVWKVw5OlZwjtdbe3WnF1Zcd+poOZfFfPmybypbFwbK1byQL3c3ZQFBBG0QiWFx 1di1yzRTz0qext2SaFJKk/UBgGg0TFyLuSDmoRZja+i0ld4iFc2vzDcmwPMI7XZVWs/I 7ddedNymy2NPFiKDKwGYj/E/GgBX1ZwJpRpIOg/uXy2NurvCp8JGvqpBOSmhS+I1JFtV d5mQBsnMgJFxVD5Hvj9R7qPrDDjhKOjTxJa8Z46xS1jFmJjasjBbG3qZwFVZXcVrth4S Pi0USlbIuAn1Jq4kKPv7ILin4iVaYPvAAEPhd0pWu6QQG39ZuOaPAt1gz4WdCaVwREbQ Os0Q== X-Gm-Message-State: AOAM530tDQj0ZtUHTFKove19UxXwdp08mM5S4NCJIEdFTr53rApQNPUF syxFXyP8rsVv+p0Dx0c0qmUkKySnXd1l2Q== X-Google-Smtp-Source: ABdhPJzqrw3Qb0UmcPZml6fSLv/W6CnyShdSYjTNds9u4gex0tz1fYGXmIKjuxu61mK5h5s+JNYksA== X-Received: by 2002:a7b:c048:: with SMTP id u8mr4673549wmc.113.1629997411610; Thu, 26 Aug 2021 10:03:31 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 21/37] arch_init.h: Don't include arch_init.h unnecessarily Date: Thu, 26 Aug 2021 18:02:51 +0100 Message-Id: <20210826170307.27733-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998939595100001 arch_init.h only defines the QEMU_ARCH_* enumeration and the arch_type global. Don't include it in files that don't use those. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Message-id: 20210730105947.28215-8-peter.maydell@linaro.org --- blockdev.c | 1 - hw/i386/pc.c | 1 - hw/i386/pc_piix.c | 1 - hw/i386/pc_q35.c | 1 - hw/mips/jazz.c | 1 - hw/mips/malta.c | 1 - hw/ppc/prep.c | 1 - hw/riscv/sifive_e.c | 1 - hw/riscv/sifive_u.c | 1 - hw/riscv/spike.c | 1 - hw/riscv/virt.c | 1 - monitor/qmp-cmds.c | 1 - target/ppc/cpu_init.c | 1 - target/s390x/cpu-sysemu.c | 1 - 14 files changed, 14 deletions(-) diff --git a/blockdev.c b/blockdev.c index 3d8ac368a19..e79c5f3b5e8 100644 --- a/blockdev.c +++ b/blockdev.c @@ -56,7 +56,6 @@ #include "sysemu/iothread.h" #include "block/block_int.h" #include "block/trace.h" -#include "sysemu/arch_init.h" #include "sysemu/runstate.h" #include "sysemu/replay.h" #include "qemu/cutils.h" diff --git a/hw/i386/pc.c b/hw/i386/pc.c index c2b9d62a358..102b2239468 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -65,7 +65,6 @@ #include "hw/xen/start_info.h" #include "ui/qemu-spice.h" #include "exec/memory.h" -#include "sysemu/arch_init.h" #include "qemu/bitmap.h" #include "qemu/config-file.h" #include "qemu/error-report.h" diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 30b8bd6ea92..1bc30167acc 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -43,7 +43,6 @@ #include "sysemu/kvm.h" #include "hw/kvm/clock.h" #include "hw/sysbus.h" -#include "sysemu/arch_init.h" #include "hw/i2c/smbus_eeprom.h" #include "hw/xen/xen-x86.h" #include "exec/memory.h" diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 04b4a4788d7..eeb0b185b11 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -31,7 +31,6 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "hw/loader.h" -#include "sysemu/arch_init.h" #include "hw/i2c/smbus_eeprom.h" #include "hw/rtc/mc146818rtc.h" #include "sysemu/kvm.h" diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index d6183e18821..f5a26e174d5 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -35,7 +35,6 @@ #include "hw/isa/isa.h" #include "hw/block/fdc.h" #include "sysemu/sysemu.h" -#include "sysemu/arch_init.h" #include "hw/boards.h" #include "net/net.h" #include "hw/scsi/esp.h" diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 7dcf175d726..b770b8d3671 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -38,7 +38,6 @@ #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h" #include "hw/pci/pci.h" -#include "sysemu/arch_init.h" #include "qemu/log.h" #include "hw/mips/bios.h" #include "hw/ide.h" diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index acfc2a91d8e..25a2e86b421 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -40,7 +40,6 @@ #include "hw/rtc/mc146818rtc.h" #include "hw/isa/pc87312.h" #include "hw/qdev-properties.h" -#include "sysemu/arch_init.h" #include "sysemu/kvm.h" #include "sysemu/reset.h" #include "trace.h" diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c index ddc658c8d68..5b7b245e1f3 100644 --- a/hw/riscv/sifive_e.c +++ b/hw/riscv/sifive_e.c @@ -45,7 +45,6 @@ #include "hw/intc/sifive_plic.h" #include "hw/misc/sifive_e_prci.h" #include "chardev/char.h" -#include "sysemu/arch_init.h" #include "sysemu/sysemu.h" =20 static const MemMapEntry sifive_e_memmap[] =3D { diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index 87bbd10b211..6cc1a62b0f7 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -55,7 +55,6 @@ #include "hw/intc/sifive_plic.h" #include "chardev/char.h" #include "net/eth.h" -#include "sysemu/arch_init.h" #include "sysemu/device_tree.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index fead77f0c48..aae36f2cb4d 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -37,7 +37,6 @@ #include "hw/char/riscv_htif.h" #include "hw/intc/sifive_clint.h" #include "chardev/char.h" -#include "sysemu/arch_init.h" #include "sysemu/device_tree.h" #include "sysemu/sysemu.h" =20 diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 4a3cd2599a5..0e55411045a 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -36,7 +36,6 @@ #include "hw/intc/sifive_plic.h" #include "hw/misc/sifive_test.h" #include "chardev/char.h" -#include "sysemu/arch_init.h" #include "sysemu/device_tree.h" #include "sysemu/sysemu.h" #include "hw/pci/pci.h" diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 9ddb9352e65..5c0d5e116b9 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -27,7 +27,6 @@ #include "sysemu/kvm.h" #include "sysemu/runstate.h" #include "sysemu/runstate-action.h" -#include "sysemu/arch_init.h" #include "sysemu/blockdev.h" #include "sysemu/block-backend.h" #include "qapi/error.h" diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 505a0ed6ac0..319a272d4c9 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -22,7 +22,6 @@ #include "disas/dis-asm.h" #include "exec/gdbstub.h" #include "kvm_ppc.h" -#include "sysemu/arch_init.h" #include "sysemu/cpus.h" #include "sysemu/hw_accel.h" #include "sysemu/tcg.h" diff --git a/target/s390x/cpu-sysemu.c b/target/s390x/cpu-sysemu.c index df2c6bf6941..5471e01ee82 100644 --- a/target/s390x/cpu-sysemu.c +++ b/target/s390x/cpu-sysemu.c @@ -34,7 +34,6 @@ =20 #include "hw/s390x/pv.h" #include "hw/boards.h" -#include "sysemu/arch_init.h" #include "sysemu/sysemu.h" #include "sysemu/tcg.h" #include "hw/core/sysemu-cpu-ops.h" --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629999092; cv=none; d=zohomail.com; s=zohoarc; b=eh5NrXv8WMONAdkhjvfSWjtNB4fVN1LgdQDHeh72b0wRN7lcwqZHieWdM8Cp3zAjPfVbidpf4KawGWt1fECVHVxlzGH31h6Nq9JAlUqUQObywZdildUxlvgJxpd5+fnGanhoyHN6L8q4sY9boyRHoJV4WiFO696irt8NAWBzBn4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629999092; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kA2IUnctNyzUdfw7J0NuYj+Tjg7lyZY/fnc0JxtxmlE=; b=hvK6rzTUjRd76Ck0pCMcWugectv+ffKC7haoUqEoyPmZu1FiCqUHu0eeyFE7/Y/SWMYh8TylSUdH+CZf6EMY4PUM/xYLmBdFrN6WXZJ5iEBBPFAP9YbX4wKwc4ylJfFfDS+ohlBVGUVoQwedNTERt1n9HU3nPm6BQyeVR1p28X8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629999092454275.57930950307184; Thu, 26 Aug 2021 10:31:32 -0700 (PDT) Received: from localhost ([::1]:42116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJDv-0005Jw-AE for importer@patchew.org; Thu, 26 Aug 2021 13:31:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImu-0005s3-JZ for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:36 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:42639) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJIms-0008Us-Ps for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:36 -0400 Received: by mail-wm1-x333.google.com with SMTP id k20-20020a05600c0b5400b002e87ad6956eso2659841wmr.1 for ; Thu, 26 Aug 2021 10:03:34 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:32 -0700 (PDT) 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=kA2IUnctNyzUdfw7J0NuYj+Tjg7lyZY/fnc0JxtxmlE=; b=slqpRDyR3RaGyQgaF2kiU3Gbn6fZcbmIh15L+FgGjOuQGLkIBAUybIs57mujsDbIHh EXPrf9OvNRSqr35mF45SIRKYXWxGVWCKZw5lLYkmGipA8m8Hm3D/tIGJFNC0tHscU/He jw0BrJcVSlWZ8dV9tTm2BOveeFNCKBFdhNbWqMI6Sn4LiLTro8vbpcKy1Cuos2TYHl20 xKTtwr7/w6/rtzwBhhIbwdyg4hot6KVOuyR/1kRBTdNh2/TJUcT5EJzn4QuAfTzbj3OU Y08AcaAvtOX2izmLhvTJRZavFo5n0vopQV+9xaLehT7Y2DCaI7zAU5sifUICN73PsbZX +uOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kA2IUnctNyzUdfw7J0NuYj+Tjg7lyZY/fnc0JxtxmlE=; b=b0rMVCLaNr6Js2KHCV7pURjJJnDK7iMdrJ2iqgOQwkqKna1DfPUh/WThsOUS+Eko34 QB8kNhNuf7PzA0aJrRTc67MUwcgkDHpIKkEzkNnrk8w0d5Prlc4mMIskdaaNs+wggOhG fXss+bS5UZR0oGNmSqRnCVMdJETye6bi4EnMvJbW2cGUosMyO8JrdhamLHbUHXXZIbE8 Y8Vh6HhfuPRgTv6laXifYDcP0Vr3UwnnjerWvmlk4iZCSSGQ3BmGkMt5/dLo4lmM7iho qxnG0jVenJNSYkgwz7LrHEuWeCsec2XsTDnFw89g/OMb3VC5WkH9/MqUYEgI5iNnkTR6 DoQg== X-Gm-Message-State: AOAM530tWXZ6jduZ3b35USP0ycGyin0HGemwiJrtnE+yrtqCWNKEhFcZ V+JZLs1+tF3Xi7GWDWX3SLnFOC0Qo+btfQ== X-Google-Smtp-Source: ABdhPJxir+hbzOmJn5itTj6fUBJpRTnqZtQYQWRrsbziCRooTi11Kd4HnhItup+IVX6blwFrgWyuAg== X-Received: by 2002:a7b:c441:: with SMTP id l1mr4662197wmi.69.1629997412562; Thu, 26 Aug 2021 10:03:32 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/37] stubs: Remove unused arch_type.c stub Date: Thu, 26 Aug 2021 18:02:52 +0100 Message-Id: <20210826170307.27733-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629999093589100001 We added a stub for the arch_type global in commit 5964ed56d9a1 so that we could compile blockdev.c into the tools. However, in commit 9db1d3a2be9bf we removed the only use of arch_type from blockdev.c. The stub is therefore no longer needed, and we can delete it again, together with the QEMU_ARCH_NONE value that only the stub was using. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20210730105947.28215-9-peter.maydell@linaro.org --- include/sysemu/arch_init.h | 2 -- stubs/arch_type.c | 4 ---- stubs/meson.build | 1 - 3 files changed, 7 deletions(-) delete mode 100644 stubs/arch_type.c diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index e7789399508..70c579560ad 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -24,8 +24,6 @@ enum { QEMU_ARCH_RX =3D (1 << 20), QEMU_ARCH_AVR =3D (1 << 21), QEMU_ARCH_HEXAGON =3D (1 << 22), - - QEMU_ARCH_NONE =3D (1 << 31), }; =20 extern const uint32_t arch_type; diff --git a/stubs/arch_type.c b/stubs/arch_type.c deleted file mode 100644 index fc5423bc98a..00000000000 --- a/stubs/arch_type.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "qemu/osdep.h" -#include "sysemu/arch_init.h" - -const uint32_t arch_type =3D QEMU_ARCH_NONE; diff --git a/stubs/meson.build b/stubs/meson.build index d3fa8646b38..717bfa9a999 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -1,4 +1,3 @@ -stub_ss.add(files('arch_type.c')) stub_ss.add(files('bdrv-next-monitor-owned.c')) stub_ss.add(files('blk-commit-all.c')) stub_ss.add(files('blk-exp-close-all.c')) --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629999386; cv=none; d=zohomail.com; s=zohoarc; b=SbVFX0oRHYuAgFSBhbHVRTlqFtYr5MwGG4OypWsNB2c6RtH7gmRv4m+d3CzsYXQqwhXMgHUSkJQaIMxyWPPsGfeyS3JepfS847wLAyyADtWaw9RJO0hhZ5Sg0qs9CAp42deGns+pyM4Rk+7d7OOVxIvQWLp56FZYxokAIk6pnrA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629999386; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EuexV4o32sG9HqBah+72XnHnmYlbBGMXodWVIYM5Po4=; b=M2PaxD9xMLxCeLxt4AxADgRbLagYhQgdn+d+BSPB2ygoJczCfPts0ylQzQeBSXcLKrLfX3sYh3+8FWhK9UaPn+sUBuGUgjC6V4VbnUUzVIChmOxe1MpB1ZZ9ks6YycCTCtMJCpEo3jd/db/KNoockMwna8iHLPzWVEp5uALhD3E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629999386933147.37754527656386; Thu, 26 Aug 2021 10:36:26 -0700 (PDT) Received: from localhost ([::1]:51512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJIf-0003Lf-Q2 for importer@patchew.org; Thu, 26 Aug 2021 13:36:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImx-00062l-Bn for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:39 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:54816) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImt-0008VM-Hm for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:39 -0400 Received: by mail-wm1-x333.google.com with SMTP id g138so2240677wmg.4 for ; Thu, 26 Aug 2021 10:03:35 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:33 -0700 (PDT) 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=EuexV4o32sG9HqBah+72XnHnmYlbBGMXodWVIYM5Po4=; b=zvvdKr1iGjm25ZC+Yy1VcxVU0K/5BZWhtvdbMUnWF1u4y4j2r+tPtuZOSG9ghrvaOj cHlNWBTHwN2sP2HI+I4HIdW02JSn2ST11pB8F4Na3XBcSs8lEVp4Vgdgcl9X4JDHT9qG wuAWHrF1tmxQMa0SapxprWqooLhTHCM3sv1eMp5J87MGYVRT36y63VXme1Yo+B6mglbo +NavK8EpJkAYtCVIMP1Q4Um+pnL9cWxp7IN8ekYb4838dRLLBlb2ivkGCbMc3NRyNVGX UAdVoYrPYt0Pw7AuvY01cWUijm74cHuT3cfGUQcqy0a2k7+trDrpqtADyZTs0TjXHNdY SC7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EuexV4o32sG9HqBah+72XnHnmYlbBGMXodWVIYM5Po4=; b=Nal65O5EzDj9++vhIu2/PrF47lFdNQPNg3RT6XvyEXnKYfCcFKOXpjDxwrP+mvapnP y/J1BsG670TVA2BW4BM2T0EGOQVZBlFdU92dhxUtHZ21XbAvh1wOUeXttOmOy27/rCah Fg18BoeClAAu0UDSB+k3Vx+jUhcYiIinPRgY/npSnlDD7108WrV9EC5fmEci398eQy5r 6mLI5qNwF1PmjSN1xGaIGSjfJN2+5DFvamnBYHYenjlLZ1ozOfHSrzHKyctq9FX2VmQZ Mqjb1KsTX628zfTQ5vZbFjAt5leAh8WPEVfAh/+bt28uirCuO0Qa/6LGZuxD755/g0zR 75Mw== X-Gm-Message-State: AOAM5337kd6puGOTaaiHp7CZnDiCkEUhYEj/C3/8a39Dz9HuUtGMidi9 f1AojPU9Twc78bRMZSDI8TByMUsoNBSFxA== X-Google-Smtp-Source: ABdhPJzb4TN3FzYh8/IBT3jMdlK5V+nF28qJI5Kx2BkfHeHehI9o60TM0WydFEd/XOq0eCV2f+SBBg== X-Received: by 2002:a7b:cc85:: with SMTP id p5mr15589532wma.42.1629997414186; Thu, 26 Aug 2021 10:03:34 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 23/37] hw/core/loader: In gunzip(), check index is in range before use, not after Date: Thu, 26 Aug 2021 18:02:53 +0100 Message-Id: <20210826170307.27733-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629999388390100001 The gunzip() function reads various fields from a passed in source buffer in order to skip a header before passing the actual compressed data to the zlib inflate() function. It does check whether the passed in buffer is too small, but unfortunately it checks that only after reading bytes from the src buffer, so it could read off the end of the buffer. You can see this with valgrind: $ printf "%b" '\x1f\x8b' > /tmp/image $ valgrind qemu-system-aarch64 -display none -M virt -cpu max -kernel /tmp= /image [...] =3D=3D19224=3D=3D Invalid read of size 1 =3D=3D19224=3D=3D at 0x67302E: gunzip (loader.c:558) =3D=3D19224=3D=3D by 0x673907: load_image_gzipped_buffer (loader.c:788) =3D=3D19224=3D=3D by 0xA18032: load_aarch64_image (boot.c:932) =3D=3D19224=3D=3D by 0xA18489: arm_setup_direct_kernel_boot (boot.c:106= 3) =3D=3D19224=3D=3D by 0xA18D90: arm_load_kernel (boot.c:1317) =3D=3D19224=3D=3D by 0x9F3651: machvirt_init (virt.c:2114) =3D=3D19224=3D=3D by 0x794B7A: machine_run_board_init (machine.c:1272) =3D=3D19224=3D=3D by 0xD5CAD3: qemu_init_board (vl.c:2618) =3D=3D19224=3D=3D by 0xD5CCA6: qmp_x_exit_preconfig (vl.c:2692) =3D=3D19224=3D=3D by 0xD5F32E: qemu_init (vl.c:3713) =3D=3D19224=3D=3D by 0x5ADDB1: main (main.c:49) =3D=3D19224=3D=3D Address 0x3802a873 is 0 bytes after a block of size 3 a= lloc'd =3D=3D19224=3D=3D at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_= memcheck-amd64-linux.so) =3D=3D19224=3D=3D by 0x61E7657: g_file_get_contents (in /usr/lib/x86_64= -linux-gnu/libglib-2.0.so.0.5600.4) =3D=3D19224=3D=3D by 0x673895: load_image_gzipped_buffer (loader.c:771) =3D=3D19224=3D=3D by 0xA18032: load_aarch64_image (boot.c:932) =3D=3D19224=3D=3D by 0xA18489: arm_setup_direct_kernel_boot (boot.c:106= 3) =3D=3D19224=3D=3D by 0xA18D90: arm_load_kernel (boot.c:1317) =3D=3D19224=3D=3D by 0x9F3651: machvirt_init (virt.c:2114) =3D=3D19224=3D=3D by 0x794B7A: machine_run_board_init (machine.c:1272) =3D=3D19224=3D=3D by 0xD5CAD3: qemu_init_board (vl.c:2618) =3D=3D19224=3D=3D by 0xD5CCA6: qmp_x_exit_preconfig (vl.c:2692) =3D=3D19224=3D=3D by 0xD5F32E: qemu_init (vl.c:3713) =3D=3D19224=3D=3D by 0x5ADDB1: main (main.c:49) Check that we have enough bytes of data to read the header bytes that we read before we read them. Fixes: Coverity 1458997 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20210812141803.20913-1-peter.maydell@linaro.org --- hw/core/loader.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 5b34869a541..c623318b737 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -555,24 +555,35 @@ ssize_t gunzip(void *dst, size_t dstlen, uint8_t *src= , size_t srclen) =20 /* skip header */ i =3D 10; + if (srclen < 4) { + goto toosmall; + } flags =3D src[3]; if (src[2] !=3D DEFLATED || (flags & RESERVED) !=3D 0) { puts ("Error: Bad gzipped data\n"); return -1; } - if ((flags & EXTRA_FIELD) !=3D 0) + if ((flags & EXTRA_FIELD) !=3D 0) { + if (srclen < 12) { + goto toosmall; + } i =3D 12 + src[10] + (src[11] << 8); - if ((flags & ORIG_NAME) !=3D 0) - while (src[i++] !=3D 0) - ; - if ((flags & COMMENT) !=3D 0) - while (src[i++] !=3D 0) - ; - if ((flags & HEAD_CRC) !=3D 0) + } + if ((flags & ORIG_NAME) !=3D 0) { + while (i < srclen && src[i++] !=3D 0) { + /* do nothing */ + } + } + if ((flags & COMMENT) !=3D 0) { + while (i < srclen && src[i++] !=3D 0) { + /* do nothing */ + } + } + if ((flags & HEAD_CRC) !=3D 0) { i +=3D 2; + } if (i >=3D srclen) { - puts ("Error: gunzip out of data in header\n"); - return -1; + goto toosmall; } =20 s.zalloc =3D zalloc; @@ -596,6 +607,10 @@ ssize_t gunzip(void *dst, size_t dstlen, uint8_t *src,= size_t srclen) inflateEnd(&s); =20 return dstbytes; + +toosmall: + puts("Error: gunzip out of data in header\n"); + return -1; } =20 /* Load a U-Boot image. */ --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629999242; cv=none; d=zohomail.com; s=zohoarc; b=Ky1hH5fMFuZGv0dwqfFKq25FMtEKgockjOwiXyexL3cBSbCpSalPg+nptUREYMbRtFFRfytrgAJssS/6DYBlS15EOcmUouM+9Qwz0JQxXGMQsvpg03bhSvbxtumC+XoL8azoVgX4YE1h4Env6pweWczkTCgNh4cXdu9sIMMIbbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629999242; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vsjf44r81JJtO2ZQ/K/wAzsmQJ0pJW4BjlfezsZEjlk=; b=QrRmi1F0IAomg5ckGaJ1U01bwH6oTGJr5yr0z5q5qMYobzt4hG38asCAbGjRR3MCdf92iI/l7IWXbGh1jDEJfu+fiHlGWxZmDpgJzbZkQLvKYMVW9dFecA3EFfir/BLgGzHqbQf8TRMa8fJOtzTAl4zuhQ8wEjOejypoCjYrvDE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629999242798999.3599406051812; Thu, 26 Aug 2021 10:34:02 -0700 (PDT) Received: from localhost ([::1]:47344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJGL-0000UG-KL for importer@patchew.org; Thu, 26 Aug 2021 13:34:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImw-0005yb-9C for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:38 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:39912) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImu-000050-FR for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:37 -0400 Received: by mail-wm1-x32d.google.com with SMTP id f9-20020a05600c1549b029025b0f5d8c6cso7371039wmg.4 for ; Thu, 26 Aug 2021 10:03:35 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:34 -0700 (PDT) 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=vsjf44r81JJtO2ZQ/K/wAzsmQJ0pJW4BjlfezsZEjlk=; b=VVcMlAj3Ja4edCc2S7Blhl78LUgNcPDdtCTksMPQqzHwR7tEVrCTs3YczhnEoFDUwa NANSgsFcZFeov8uh/Hm+qhm3xyNVKx/Ues9CHXyNeDahfhfKnriDxgvIg2ql3m8RIOAx +oS3ieLeYtpyBxTgTpTUvD/anLl0f9SVfPGAlqwB8MW4LZmSJjQj4FKSMxs6XutOgvJP 3bBqhOfWOzoZumfAeIKtHepto+vjEHMJqNeOqc4wzpi7/dmbG7XGL/VjZwbB/c1w0Usr 4wsSknyRG+8R0frs59cZzAy+1bAX5v5i4GNJXfnykj/xOlWWctvjpY2+Z3DFwya2/WnF v3gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vsjf44r81JJtO2ZQ/K/wAzsmQJ0pJW4BjlfezsZEjlk=; b=p5TYTFxLaT2PCG+G+cMJ/PiMAbzxDhtgMTg6eHO4itv1gqwdRL/YkzMunE+to8/csf WkojUsW+cmm7Q/ntIWXmNQ1k/5kQ2aQf2I1SYZoOBMH1s7Cz9TgplVdZYJlAEb8Mkxpz Vw87ui1QpthCJYrkftIDivZJQcYwwjN7j2s5LveNjpPo0/l73Q+rKLizG1FHdy5EEo0S S/h4CIOhWT03MnxxDemgJqeo4IxL5NN65joNGEQO2I5q/0kWD5k4abXhvn3uh6H8ZZie bSR1ZmvqbXQDsyPd94dDYWsu5SrzP4dvsG4DLlug08anNOK5VzHlna+P0IQPrdNkZepr 8y9A== X-Gm-Message-State: AOAM533RnkOfgwvsDL23rnWwUWBEdtXjiLOdXs3a1mqywSz/5kmnW5km ohWHUtwwwZfgok7yeibvsHb4+zmfX1kHJA== X-Google-Smtp-Source: ABdhPJwhRPTxoqUtyhPUiGA6vLEvvH1izOMyDRvoViBMkC2cR5VYdKHlj0AbSpzz0keObZ6yFgRT7Q== X-Received: by 2002:a1c:7506:: with SMTP id o6mr15863476wmc.112.1629997414965; Thu, 26 Aug 2021 10:03:34 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 24/37] softmmu/physmem.c: Remove unneeded NULL check in qemu_ram_alloc_from_fd() Date: Thu, 26 Aug 2021 18:02:54 +0100 Message-Id: <20210826170307.27733-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629999243784100001 Content-Type: text/plain; charset="utf-8" In the alignment check added to qemu_ram_alloc_from_fd() in commit ce317be98db0dfdfa, the condition includes a check that 'mr' is not NULL. This check is unnecessary because we can assume that the caller always passes us a valid MemoryRegion, and indeed later in the function we assume mr is not NULL when we pass it to file_ram_alloc() as new_block->mr. Remove it. Fixes: Coverity 1459867 Fixes: ce317be98d ("exec: fetch the alignment of Linux devdax pmem characte= r device nodes") Signed-off-by: Peter Maydell Reviewed-by: Jingqi Liu Message-id: 20210812150624.29139-1-peter.maydell@linaro.org --- softmmu/physmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 2e18947598e..31baf3a8877 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -2075,7 +2075,7 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, Mem= oryRegion *mr, } =20 file_align =3D get_file_align(fd); - if (file_align > 0 && mr && file_align > mr->align) { + if (file_align > 0 && file_align > mr->align) { error_setg(errp, "backing store align 0x%" PRIx64 " is larger than 'align' option 0x%" PRIx64, file_align, mr->align); --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998680; cv=none; d=zohomail.com; s=zohoarc; b=BM3JtZhLumV37L53eCIxE3QXl1MkzOGkOvd2lD0z6YmsXB8WGhMq4wuPbFTpo4nkoiswV/pN3kylcQuZSanIA4wa9SNSaPFOtVcc90hyQk3hdDuA9N0nzwMIUopg9Nk+jBRaswP7zhs2KahZnEdmRO1YtofQnVuWxtyv9Qs2Rec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998680; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uBfKuvC9vU4hge2NlBpeQ1rXhY8CEOUWhY6VAa6lKr8=; b=e4xUFdZPPr/EZbxMhpV5DY7qlOng1okAO9OSYogLzillbHuuR240qRFGmIbOjCx9uv6JHHmxt01XQzrbxEjaYGS4oQSqRuZjXpDx3Cgi1ql9ssSsi1/w3cnYTVsNqCQuzxU7KSjPz+bYenepQZoy78LwmHOY8YqoUP4tP2EhB7I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998680018132.28714077036045; Thu, 26 Aug 2021 10:24:40 -0700 (PDT) Received: from localhost ([::1]:49104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ7H-0007i2-0q for importer@patchew.org; Thu, 26 Aug 2021 13:24:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImw-00060d-S2 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:38 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:41684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImv-00005N-5d for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:38 -0400 Received: by mail-wm1-x32f.google.com with SMTP id c129-20020a1c35870000b02902e6b6135279so2677571wma.0 for ; Thu, 26 Aug 2021 10:03:36 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:35 -0700 (PDT) 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=uBfKuvC9vU4hge2NlBpeQ1rXhY8CEOUWhY6VAa6lKr8=; b=VRXpm+/bujLAHl3N0mlFnpR09gEOsygHWtImjA1PAhWHsPXb3n9ua1gQ5nZrAjddYT HRyik5gtecTGbbdBMgrkS2v/cQAMTDTF61HQz4nVMrCFPkOL0L2gBje4bXd338WbCnWH iYuGCVTmgZ8sH9aVoPQwE8vA25lIAF0hdcVyVcAvgx5zvqWh+IGNGOoD01UIUmGIVMoa 7T4lv07FWgFy0JNBeJimv2wiOUsUJMQkZCB9yVE2sCOhDtwMBR0pMEIUMLc0pKKqquwF xMH1fKaY68d+dwuqbeQ+Hh0YmgGoHRWIeFhNb9NFxC5aO2PwyKpPm53Hk+uCpnx84Tp9 P0jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uBfKuvC9vU4hge2NlBpeQ1rXhY8CEOUWhY6VAa6lKr8=; b=n/ToynBAv9p0S1l5ZoQR5XNlDc3oonA3aBGh90C55o/9HqKXW1wVh55FUSqt0vctDe PsIezwZXTGL4x4mQM3/oaOw7ceZ6TctX3vWePaMQsbKOYWc1Kvg9kRkruE8F2liOPER6 BiW1vc6AkcxCLPxwXKfhpg8He1rrJtHYYiMpFdYW7lQv35a2sT48djkzb5TNkymQn2Dt dxqt5fhyLr/cJar0P4V0fbWm6+giEkCN5P9u5sKDS3qA571Jf/+kJECq1wYLnmI9IgzJ eZ42700dN8kHg8fJFFr/vtcF13lzb4KUqzhRf/moKsElpUf8lH1+9XjmZz19pRl3b/YT /wtg== X-Gm-Message-State: AOAM531fKXg7TkOpqGnsRz5EllFiuCdgx45AY0RKCFJ3LQsSQ2HuwOz7 3GIGIwFVMKyxEugXT4W3m1HIRR1uu4MwYQ== X-Google-Smtp-Source: ABdhPJyxCGTKY5n4hdEPSlE47hxakcYoU72Kus+VQp/wTS6+qs1KrBcgIHWRav8dQb473CKtQ65ujQ== X-Received: by 2002:a1c:1c2:: with SMTP id 185mr4629806wmb.11.1629997415758; Thu, 26 Aug 2021 10:03:35 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 25/37] softmmu/physmem.c: Check return value from realpath() Date: Thu, 26 Aug 2021 18:02:55 +0100 Message-Id: <20210826170307.27733-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998681499100001 Content-Type: text/plain; charset="utf-8" The realpath() function can return NULL on error, so we need to check for it to avoid crashing when we try to strstr() into it. This can happen if we run out of memory, or if /sys/ is not mounted, among other situations. Fixes: Coverity 1459913, 1460474 Fixes: ce317be98db0 ("exec: fetch the alignment of Linux devdax pmem charac= ter device nodes") Signed-off-by: Peter Maydell Reviewed-by: Jingqi Liu Message-id: 20210812151525.31456-1-peter.maydell@linaro.org --- softmmu/physmem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 31baf3a8877..23e77cb7715 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -1451,6 +1451,9 @@ static int64_t get_file_align(int fd) path =3D g_strdup_printf("/sys/dev/char/%d:%d", major(st.st_rdev), minor(st.st_rdev)); rpath =3D realpath(path, NULL); + if (!rpath) { + return -errno; + } =20 rc =3D daxctl_new(&ctx); if (rc) { --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997798; cv=none; d=zohomail.com; s=zohoarc; b=PfupdPMcGCIjfPSh7Xx8olJDvC2KJI7Z/9I1p6jnDHEg6mqLq+i0WcCBfeJ1IbG0ESsHbIBd/dstAPOqZi75Ec5kYOZcybzc7RSxcZ4DKSpGX3SXwpNDSnfRqNflZwYHeUZgRxGjlW0nkjafiHgq6Uzohk+czItxRDJ2I0nngYI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997798; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=duV1NJYvhbTjXRB/sB4q/N+Q39wEGYQP8q4khg4Tuts=; b=m+PpjOKCO9ibRPq8W7UUkiQYhz64czkVIvSBnIEe82P1CyyoQyh35JSWfmKi7NdTOY5zpjm8RIEx6pInNLRcOQTFbTuua6V37gmj7w6JzYiFOQO5NxH2nM8czaOA291X/0Vns8L7uwDQjohFNEUidxIuT97V7IrWucHTjJbSHfQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629997798929737.7570392938821; Thu, 26 Aug 2021 10:09:58 -0700 (PDT) Received: from localhost ([::1]:60208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIt3-0002aS-Rz for importer@patchew.org; Thu, 26 Aug 2021 13:09:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImx-000649-NA for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:39 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:53872) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImw-00006Q-7U for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:39 -0400 Received: by mail-wm1-x334.google.com with SMTP id i3so2245676wmq.3 for ; Thu, 26 Aug 2021 10:03:37 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:36 -0700 (PDT) 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=duV1NJYvhbTjXRB/sB4q/N+Q39wEGYQP8q4khg4Tuts=; b=Hzt2NczQuBGi18+bI3pwG6ksNrb/yioWNtRGe52kEYGBHtIDZ9en3BhvoCM71LWeH8 JOvjkGOL1C0Clp+oir/mgl93J9P3gqaQm8CepVQ9pu0CbACifCc5FFIoCk37ZSZsYDSx p8F5dyDjzBev2G8mujl4a4nF34ONUp4YtMaijbaZuh0IgdViF00thXkQkoUBrZ21TyTN F1KlNkq8BnIRLlSBBRsSuL1ABdnbsiy1WG6wyzlr1coinKe+M6xmzgGjvfQFiQLulZPH 0j6QrHCzCzhMaNoZLLQDFATCODaA2O+M4mPTG+WC1kQH6hzqttQ5hvfuQw1Ei7Nt0i5N iDDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=duV1NJYvhbTjXRB/sB4q/N+Q39wEGYQP8q4khg4Tuts=; b=YUTkZYxPDlfIV87XxV7XaF2Uehg6WSO096Gj8pl2O+GmfySfPJj6o2SspXFFfB3X+W T6qTy7bXaU7moayz7LukyggRUmaIzn9DwLcpuX8CfXlQNQ2qGYimc8RtfEQhE8BNvdeP NW7unrjCXjZaZnpgdFkRExHJdn37NS9Xd8aZKSG3kZJrGv+Z0B2xML3URKubwDBvNH3X RPHq3vODSD14bbg8iB31nw7MX43+KSfmX9Z/bxaMF2dabJ4eeaq/jQauNthqfAfbudh9 r0Im14G/X9bxhFHhe1e1ZrXe0DQaWq6KfSNfFnEDDjTAvXA7+ZEBjgbGVaprOg0h29BV xrOg== X-Gm-Message-State: AOAM530CYLiDdp1o5mMjHF71gacGciqwCRnKgyYeoGn4qNXix3wjlO1b ERMVVX9zKnaHatIAKVyLSgzrBWFZKOk/Gg== X-Google-Smtp-Source: ABdhPJw2ThuR8Y/Ahy9+xtD5uu9xYjmyGh86bnP9ubPjt/l9akz3aD0oCgpY0M6JmxO5FjiAtLkWQg== X-Received: by 2002:a1c:7ecb:: with SMTP id z194mr15498761wmc.182.1629997416841; Thu, 26 Aug 2021 10:03:36 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 26/37] net: Zero sockaddr_in in parse_host_port() Date: Thu, 26 Aug 2021 18:02:56 +0100 Message-Id: <20210826170307.27733-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997800224100001 Content-Type: text/plain; charset="utf-8" We don't currently zero-initialize the 'struct sockaddr_in' that parse_host_port() fills in, so any fields we don't explicitly initialize might be left as random garbage. POSIX states that implementations may define extensions in sockaddr_in, and that those extensions must not trigger if zero-initialized. So not zero initializing might result in inadvertently triggering an impdef extension. memset() the sockaddr_in before we start to fill it in. Fixes: Coverity CID 1005338 Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Message-id: 20210813150506.7768-2-peter.maydell@linaro.org --- net/net.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/net.c b/net/net.c index 76bbb7c31b4..52c99196c69 100644 --- a/net/net.c +++ b/net/net.c @@ -75,6 +75,8 @@ int parse_host_port(struct sockaddr_in *saddr, const char= *str, const char *addr, *p, *r; int port, ret =3D 0; =20 + memset(saddr, 0, sizeof(*saddr)); + substrings =3D g_strsplit(str, ":", 2); if (!substrings || !substrings[0] || !substrings[1]) { error_setg(errp, "host address '%s' doesn't contain ':' " --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629997976; cv=none; d=zohomail.com; s=zohoarc; b=NEqWBOyo+UZeGaJpx79XWM+EvTUMFytk4RtodNIYO5fh1fW4hizvva4HLG37zL2fqevULP5ThfAu4U4TzUR01GNanZ7UZBq8VgLzSzTnE6HIPweIw0zg0zKTqqgQ1TuBdDjoA0YvO4p///wTF+EDZCRqvGkFPWiCA7MYncx84AU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629997976; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7G7OytPvUukFyBCYon8vLCnjKjIk5le1XSdFjDgae8k=; b=eaDVbQgLQmUoP18yLfMJDHv5A2mS3DeMTEs7rNCDHJhxLMXySM+ooQ9OjKs1tQz6Opoze139U7X8Czv9SohEQBLyNTm+AjI9cZo9dBNs6GWyu7VN1Twlbn82dkLI7P0z6FOWnY1nBdLOdw+K7Z4OLwy75SxfTAchGjoWdS96VQI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629997976346368.8271874897239; Thu, 26 Aug 2021 10:12:56 -0700 (PDT) Received: from localhost ([::1]:40390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIvv-0008Jo-0Z for importer@patchew.org; Thu, 26 Aug 2021 13:12:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImy-000681-Nv for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:40 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:46729) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImx-00006g-1B for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:40 -0400 Received: by mail-wm1-x32a.google.com with SMTP id m25-20020a7bcb99000000b002e751bcb5dbso2632449wmi.5 for ; Thu, 26 Aug 2021 10:03:38 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:37 -0700 (PDT) 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=7G7OytPvUukFyBCYon8vLCnjKjIk5le1XSdFjDgae8k=; b=gCEnH5BnOQia1jM+VJhFBwh3DzunjGhBK0mmVtEVOG07UUnnlY1nmdAjR/YkggVIrO I5q0e1q9ZQb2uObjJOirzJaZdG2M4GH2S2UUxOP30RO8MoMUzuY5zxMJKqfgwcppQatc hJ97c0tBUAVg/1YGAFXlimsE10nj/NHoyLiYQUeKIbkzN6SKHHORU74BPnTgVBM29cri Q0xcMmcu9YpuSc5z5Sw7yCBAu3EaUUrlKKVoURpaOmHrLeoenClQTnToK5+lrghIjYyU qdNslqtdI1TVeejkd3Vvo0MmAvvks9eH9QvtXFluVbQPT+Lq7qTtzkzL7OD52RSdpee6 mbIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7G7OytPvUukFyBCYon8vLCnjKjIk5le1XSdFjDgae8k=; b=MoEMhf/DgvLa1kkCqQFYIoFMomQyPVibLIVWvzp8YAx6XTLcneynhehoI3b/AKXZ9C DIj2X47qvs6njfpSZCY0urWp9MdGKZD5VZ5P3CBr6V7v8lI8fwIlgpInjb8lMDKXQJa+ xa9EWkVQgYFqgID6MEw8RH26nMKa19OGjGBNTeuiSkDUir38R6IueEuNQre+l+0xhMzT R14O8/vCfKpiWCoN5XXX0IUeW3HX8izdvh5Cva+N/gjxEuM50gvu9QMAEy0dG6C1wUuG NTNbArnkcUu6sq10dyCjNzBeTQoewCU9suU1axid5fbCBhewtsLxQoIIxR63VcWfQpLe R8SA== X-Gm-Message-State: AOAM533iYQ8HehGuvUhOinapQ4ABO+WzfSOxCF1jvmfwim2M2Tr5FMD5 pJvuMCLpYdsS5KuFMbDrpZz0TryDEBk8pw== X-Google-Smtp-Source: ABdhPJzU/1fiLfl7zkQCeSID96ietXsvCod22JRM2hGfLr+jD69Nz62iHcXewRujlYtjBATtn07o3A== X-Received: by 2002:a1c:25c7:: with SMTP id l190mr1105053wml.118.1629997417779; Thu, 26 Aug 2021 10:03:37 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 27/37] gdbstub: Zero-initialize sockaddr structs Date: Thu, 26 Aug 2021 18:02:57 +0100 Message-Id: <20210826170307.27733-28-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629997977016100001 Content-Type: text/plain; charset="utf-8" Zero-initialize sockaddr_in and sockaddr_un structs that we're about to fill in and pass to bind() or connect(), to ensure we don't leave possible implementation-defined extension fields as uninitialized garbage. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Message-id: 20210813150506.7768-3-peter.maydell@linaro.org --- gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 52bde5bdc97..5d8e6ae3cd9 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -3218,7 +3218,7 @@ static bool gdb_accept_socket(int gdb_fd) =20 static int gdbserver_open_socket(const char *path) { - struct sockaddr_un sockaddr; + struct sockaddr_un sockaddr =3D {}; int fd, ret; =20 fd =3D socket(AF_UNIX, SOCK_STREAM, 0); @@ -3247,7 +3247,7 @@ static int gdbserver_open_socket(const char *path) =20 static bool gdb_accept_tcp(int gdb_fd) { - struct sockaddr_in sockaddr; + struct sockaddr_in sockaddr =3D {}; socklen_t len; int fd; =20 --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998088; cv=none; d=zohomail.com; s=zohoarc; b=TrXHMUTDSjxwr0vYmIaQM6i+ZutHzHw2PlBHToYnApbSzljBW9JG0HB4Z81fW5OR+LmFzysyMBXB4e3CKyi8i4DuFLzyfE6wa+QJJryrz/IA/FynCpYaNq9UTBQfcqsBU3pYa9wa72w81eWkgRr6LMFMVI6GCp2setYP1J59q78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998088; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0BjkPVSUV5NOpt5gcu1p+i8xXiaDTXmQKZV/ES6sZ4M=; b=N3muADIg+d9cUo3iAFpRiBw7ztV/OxL7oX4wdrJZXoVpyATuAXTCNbj+Oult/zHOe4ZmKJ+GL29Zom2A9XTlG10lJ3hWWNvMluJqjHqTzWYrNe7UhOp/XUp6sI4jbeh2d063MvCoGPiyRz0tDQ9WiQu7AhCX7iILWvvuzHVSTpk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998088576996.9251643740665; Thu, 26 Aug 2021 10:14:48 -0700 (PDT) Received: from localhost ([::1]:48868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIxh-0005WR-Pa for importer@patchew.org; Thu, 26 Aug 2021 13:14:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJImz-0006AI-Pv for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:42 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:52743) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImx-00007V-W0 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:41 -0400 Received: by mail-wm1-x329.google.com with SMTP id f10so2260321wml.2 for ; Thu, 26 Aug 2021 10:03:39 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:38 -0700 (PDT) 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=0BjkPVSUV5NOpt5gcu1p+i8xXiaDTXmQKZV/ES6sZ4M=; b=JrjPwr/Rt0ffFZ3LpiJ0St52SdmEicAteA0TVigkNVYezxOZ30DUsl6idN2Nz22sjM fthYCGhVxoeWB14oRrKLS5dXJjAxH5upg4pVEQneadY1ePYLKGfnZqk2RRbQToRzUnoO 76zxWkq53pOBasWTkXjgrl414BB5bao4DlGvcShFhA6NmH1vuo+HvuFQiD8KmYXLV992 c5hZd3oeWjyG359u2vLWZrilQud/gxWhjPCoXfnSUfobWdGbnL5UgpauRZW7OlXsL5bP WJEHvwVDLIgGO1ltsAZO+K2wREktbtYMOUlwfzRIwwH0g2d7RpKDn1hqXrIP1MR1QfV0 LGfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0BjkPVSUV5NOpt5gcu1p+i8xXiaDTXmQKZV/ES6sZ4M=; b=Ae9UiLpitZ0M1BzWHNkXoxgGmOaiIk2znD9v8iq9ie6s+AVYougsd6naaI9tTkv0g+ mzKO4ZvMTF9TBw1nVzj1I+2vHmS1keCkOw2YDlT9X3LUWs1OSo3VlOc1P38p2Ri1mBzo beGGWwVa1IVvVoDi42aQ0R+eo4Eyq9So5sa45tCcHd8I77xsm1l9xHe4+kOgPfpfwBS2 HSQd2/y/c4IF4GziLPo6KapqffuJUtBGxAL4NzvK1IJeOw8/sWsEUgqp4t2L8FEpmCOz Lya0BDsfr9Sz8OBVJIYnRfG7SficzzCxdlYEVxnTNaRvFQaF49/jZQ33Z1yIXGuK5aHh 5+GA== X-Gm-Message-State: AOAM532ySbik6DZ5yJziEpj+nCNGNzpPpdThVoF11+j5eUIAiDa+HB79 JB8lx/5EscGYzo3GuF5jinc07hNzOn8J9Q== X-Google-Smtp-Source: ABdhPJzqMppBSuwLadm/PMZENgSzJax1bCC6tXtdf5Lk293LfoqfM6ZBIfK1m1HymcpjhtLN7WrtXw== X-Received: by 2002:a05:600c:1d11:: with SMTP id l17mr4624035wms.58.1629997418666; Thu, 26 Aug 2021 10:03:38 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 28/37] tests/qtest/ipmi-bt-test: Zero-initialize sockaddr struct Date: Thu, 26 Aug 2021 18:02:58 +0100 Message-Id: <20210826170307.27733-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998089568100001 Content-Type: text/plain; charset="utf-8" Zero-initialize the sockaddr_in struct that we're about to fill in and pass to bind(), to ensure we don't leave possible implementation-defined extension fields as uninitialized garbage. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Reviewed-by: Corey Minyard Acked-by: Thomas Huth Message-id: 20210813150506.7768-4-peter.maydell@linaro.org --- tests/qtest/ipmi-bt-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/ipmi-bt-test.c b/tests/qtest/ipmi-bt-test.c index 8492f02a9c3..19612e9405a 100644 --- a/tests/qtest/ipmi-bt-test.c +++ b/tests/qtest/ipmi-bt-test.c @@ -378,7 +378,7 @@ static void test_enable_irq(void) */ static void open_socket(void) { - struct sockaddr_in myaddr; + struct sockaddr_in myaddr =3D {}; socklen_t addrlen; =20 myaddr.sin_family =3D AF_INET; --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629999671; cv=none; d=zohomail.com; s=zohoarc; b=Aifc6meS5uTfpIIgLB3XbN2s85XrGZ5dLFq7hwwuVkMGYOiG9BCRfN/YEDGHUuosMBko2Jrrk7KI4PVNEtYn9XNihFQBWis0BhcuPV2GGYHQnRoVUUuSdrzaUTyAQW1491CSKdrI9neSqXcBKfxwlQV1+Yn4DldoN3rhWfOWni0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629999671; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JHk5K28csa+x2X+vcfWlcE7ytViOJHrw2fgmN/di2rw=; b=cWu4gkXaUuNrixPHBCs5nSMGkwUPCNiO8DQvZGn/vxUW75tYrosTxkvFNxZ80Z6X7ZktJ4sfvOu0jPWwrF2V2fJnlLjPe2bP3FRv81bu1+HpbmihS2mrFvRz949tJRllTXYqkkr3PboImcA/m6RY6EiHrUYlYmYvWbIr236Nsj8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629999671066523.9019520769381; Thu, 26 Aug 2021 10:41:11 -0700 (PDT) Received: from localhost ([::1]:59146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJNG-0000OC-0q for importer@patchew.org; Thu, 26 Aug 2021 13:41:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIn0-0006B9-Gc for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:42 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:52744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJImy-000091-TC for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:42 -0400 Received: by mail-wm1-x32a.google.com with SMTP id f10so2260365wml.2 for ; Thu, 26 Aug 2021 10:03:40 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:39 -0700 (PDT) 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=JHk5K28csa+x2X+vcfWlcE7ytViOJHrw2fgmN/di2rw=; b=R0pZzWSeXhzSzC6fVYaQMuXpey7SPsAzjluCbpJpmMBNQCsIxCqOkWO7PUAGv4ZMdl 0CQVE0RPfHN8P0bryZV4Tn0WjUgTBisHgOfEW2vtYTRGF/fyMgVScGghLehxai5op7kt qxHNXtmyuuaeM6NivTmlxfTFKovTxYJxwvvyV84PBtg8Ie26tvkrHXTm9+YQc4EPn0F6 Vfgz1XaYEyY308LwiROw4n4wVbFjOWTN4huDDixKEk7L/ZeSj/sEtaXDGKwh307ffK7D yoYHOvl1f21NL0V7GNdvhNWJweBaWb1DfL0Hrz2N2nswxM0QSl7ygKebbcXgp6ISwjsf lHhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JHk5K28csa+x2X+vcfWlcE7ytViOJHrw2fgmN/di2rw=; b=g/IN4Z5Wf8hF2AoOfTB6jQd/wai0u30XyH9kTMcLT5GvhHPu02yEi4/VoaiM4K6AHe 0YTlcqxc+Ge2a7FxcxEfICkq7LAr4eC9SvVWFPSAS9DNYemHCWJCmiTY/he1AHQIB2IT fu1DKBv40ir5uHn+MV7OyGOsQlTxqvhivzcR06domAeGwizSvoNk6mbl52kaxOxLD1iW IqBPzGOLEkiyir/BdrsU4BFytecWinEjaOLlqFuUrdaN+jYA/tSwo5u56a7ewiZ6PX7F 92gkn5XP602WKmNGu3qwmXIB3E5KJPmkO6CEUPZJtNaTPrDABlrpyVSB3uXOqS2xp9YP /qrg== X-Gm-Message-State: AOAM530bcSt/KZk4UYqhcWn5qqmg6YxnSgEDF0yDtsW/haQ0JzQWEeGz pwaUqmB9jnU7EDHyNKEZxADCSg6XPOKubA== X-Google-Smtp-Source: ABdhPJzUtoWEMdFHZlPuYF0MCrawvf0feTt1LZG6iutqdx3xHY9FxtkjET0vSTwDqIADAGlZ2rZa+w== X-Received: by 2002:a1c:1904:: with SMTP id 4mr4627965wmz.93.1629997419526; Thu, 26 Aug 2021 10:03:39 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 29/37] tests/tcg/multiarch/linux-test: Zero-initialize sockaddr structs Date: Thu, 26 Aug 2021 18:02:59 +0100 Message-Id: <20210826170307.27733-30-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629999671482100001 Content-Type: text/plain; charset="utf-8" Zero-initialize sockaddr_in and sockaddr_un structs that we're about to fill in and pass to bind() or connect(), to ensure we don't leave possible implementation-defined extension fields as uninitialized garbage. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Message-id: 20210813150506.7768-5-peter.maydell@linaro.org --- tests/tcg/multiarch/linux-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-t= est.c index c8c6aeddeb3..019d8175ca6 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -251,7 +251,7 @@ static void test_time(void) static int server_socket(void) { int val, fd; - struct sockaddr_in sockaddr; + struct sockaddr_in sockaddr =3D {}; =20 /* server socket */ fd =3D chk_error(socket(PF_INET, SOCK_STREAM, 0)); @@ -271,7 +271,7 @@ static int server_socket(void) static int client_socket(uint16_t port) { int fd; - struct sockaddr_in sockaddr; + struct sockaddr_in sockaddr =3D {}; =20 /* server socket */ fd =3D chk_error(socket(PF_INET, SOCK_STREAM, 0)); --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998035; cv=none; d=zohomail.com; s=zohoarc; b=cvZHr5uFl6SyS/mZskdKRcUIXZZMpJXK6G0ezLiNtZeMcvoG75rLozkhoRcwdLQGtlOaClhTOT30kZOpolVt98drQ+6nC39l7qDJVmLQWoesBd2HOKLDM+JhvwGaSQ9dOGekUGBHyyW2Z04yiMrYNLrqQPbnUM+V6RluEIfJ+Gw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998035; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h47sE0DsCxPb7Mc68TeucJUfawKcRbpHrCIDY0wiKi4=; b=hSAdtSKngrjcfq1m1cAy+jyKbVQCVUa+TPjJnCmIkpbqclknnlHCX1LPWSwwjdgmH6vjm4uFO+nbs8oDIdlmAyAiqDgJS8IwjhpYRMsqfTa+TA925rAZNmLihPCEcEc5FW3cgHNjLrbb0yEuoPGTsy8r23Gwa/pAr5iWV8fFuxU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998035678260.3893785548056; Thu, 26 Aug 2021 10:13:55 -0700 (PDT) Received: from localhost ([::1]:44442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIws-0002aF-HI for importer@patchew.org; Thu, 26 Aug 2021 13:13:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIn1-0006Df-JB for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:43 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:52745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJIn0-00009P-0l for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:43 -0400 Received: by mail-wm1-x32b.google.com with SMTP id f10so2260398wml.2 for ; Thu, 26 Aug 2021 10:03:41 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:40 -0700 (PDT) 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=h47sE0DsCxPb7Mc68TeucJUfawKcRbpHrCIDY0wiKi4=; b=TRowkjsdD+qE/O9wR58WaaYWU8vQAkS+aP/O2qHV7I9qI3N4bS56UJtj2prETENhG/ LtZrGFakxc8yam57kI6sQIMhu8Ijev1z+zjuylaMzALR1EXF3cK/LbBSjsYfNU3/Hjp2 nxBsXYbIGM3TW6GpLTYXFMcyyf3QcJg3fHsIEqQKmHioJxS+BO9CR+PKZ9v8QPyfHXmL zpYE+2tfWHLhAD0FbRk3ghjnupMuimuBhOzCtKhOmeAZEL1Tgo95A/7jxan3/TKqAIUw /v134oKQe7XIexNPhDRlb8l14P8M5fHz23Gu8egpJibYMXCTh7vgPA+x+8oO3dRkIMTS cmJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h47sE0DsCxPb7Mc68TeucJUfawKcRbpHrCIDY0wiKi4=; b=h8/WVSlcQWhmPJzmI7EV8oA6Dre6QV3lVMzcQ62bMDcgxuAronrgl9c+6eCMU2TfcV DmB5klEEfbNAvhYvvPqzAoURlznMgMrw2iN2y4ejgk65BoiJK4ON1hyoaX782N+Nfmr0 Eh7amlIh/bZdDKoPj8HHS9K6OZVM+0P6GuyTDAEEsYoXJ1UdSQSvYO8FO4VGuKD8ipKH JoFamix3SwZm0lDnQgh3l6VoYwsJjgED+rh887hc5Zr2T9UERKZ0q/xTYbcE1MCh64oa YM2TbALpZ9BYys/OBNqJMMQ7icCKy39xPWDmhWrY4u9vn0L0xe/PXUyv+bLZdxY2UsO3 QP0A== X-Gm-Message-State: AOAM531ZgehAxOJaTbEwqZUgM0yoAxZkk7DSh9Zu8cBggzi01Mih11J6 W7r4M0YqMvYMpFeyFF1Ze7eySrJfe89OqA== X-Google-Smtp-Source: ABdhPJzemHc5rdkEQ3muHKfcPuAn8J5fagqvuY/VEzkbLJP7oYRPXuCOdciz6be3rl4szeMeGWm0Bg== X-Received: by 2002:a7b:c3d8:: with SMTP id t24mr15013355wmj.88.1629997420588; Thu, 26 Aug 2021 10:03:40 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 30/37] raspi: Use error_fatal for SoC realize errors, not error_abort Date: Thu, 26 Aug 2021 18:03:00 +0100 Message-Id: <20210826170307.27733-31-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998036145100001 The SoC realize can fail for legitimate reasons, because it propagates errors up from CPU realize, which in turn can be provoked by user error in setting commandline options. Use error_fatal so we report the error message to the user and exit, rather than asserting via error_abort. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20210816135842.25302-2-peter.maydell@linaro.org --- hw/arm/raspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c index b30a17871f7..0ada91c05e9 100644 --- a/hw/arm/raspi.c +++ b/hw/arm/raspi.c @@ -281,7 +281,7 @@ static void raspi_machine_init(MachineState *machine) object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(machine-= >ram)); object_property_set_int(OBJECT(&s->soc), "board-rev", board_rev, &error_abort); - qdev_realize(DEVICE(&s->soc), NULL, &error_abort); + qdev_realize(DEVICE(&s->soc), NULL, &error_fatal); =20 /* Create and plug in the SD cards */ di =3D drive_get_next(IF_SD); --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998892; cv=none; d=zohomail.com; s=zohoarc; b=HFm2mkFJAikMmuo9sznwtk5T02w6AGpYnaJso2MjJuDbF5l7rZ8ej42ijcgrV1vtikQzAIt7QQlrZ+jRh0c+lKpVAJbg422kV+rHoaTQBavSkm5B5fi/2dXD1KjsPusbR+6Hq7vwfL557fNwveVmGtjoU5FUc7j38JqDcxcSrus= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998892; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=w1lM3vqV5okUE9T6DhKfRE8omMvOKtC88cuKzp6Ad2E=; b=kgLgsa9CYw0k102eC7ztGDMlyLaWze8iRura5ditardUSYUdODPw5wqTE6UZ3pf818c8V3ze4gBBraSUeRG9hZaKpI676eFiztWhG8tUvQicsPSkU7he5JUeLHQPvAjgOlYiHhKyTi/nW5IeZCiye4dU8L/uJv3/Q20KEi4+vgs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162999889233237.44030568213077; Thu, 26 Aug 2021 10:28:12 -0700 (PDT) Received: from localhost ([::1]:33140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJAh-0007cE-62 for importer@patchew.org; Thu, 26 Aug 2021 13:28:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIn3-0006HO-RP for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:47 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:51170) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJIn0-0000A1-QF for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:45 -0400 Received: by mail-wm1-x329.google.com with SMTP id m2so2278533wmm.0 for ; Thu, 26 Aug 2021 10:03:42 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:41 -0700 (PDT) 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=w1lM3vqV5okUE9T6DhKfRE8omMvOKtC88cuKzp6Ad2E=; b=fsz46aCISqkm34s4kXMogxdq/nzEccC+7OV695llEyfY4MCneKePSRJIzwR8kLTOks axiLM3XRTnxuVY0VpZBNoWJiNjQfGPLtxXrg3xmy6bkZNtMmO5XSExZf1tdu06v3RFLu AvAW2sopAKXfCX+M3sN0yjADwyeExj9d2TaNLOro3OGNyXB2NGM8f67277EcGddJ5pTf Ra0B3m5sQeTBV4pNPKLediVmQUdLQ6atZvJi3YR5WWN7ZpuYN+nYPfcPmPedOj88QNp5 NXYvJcboOaR30MEv/pSRGfc3GDcJgP4l0MOhXSbyiXj+2cqFz3xYr0WTP5L7T2ZKB7Y+ 7+8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w1lM3vqV5okUE9T6DhKfRE8omMvOKtC88cuKzp6Ad2E=; b=rlkH/0lvRGMVP2m5DPuHDbhskKZFlTyXvEOoIe49SHbT66OzIo+mu7uxJf1y6C0DcH l0XzNO6xORaA34ndXRbMNaDOM2KBW5dEuvjx2G0ZVimyxB+GAuz+v0QzygZnEXTSwvh3 SzLJsVPASJvNL9sjPIfFrD858Vas9V5sirgJHswpnwxmC8Q1aRENytf7wSgg7qud/NtO lMZTHGdh1jJEjCwwx2BWC4Uv91/CYVtJ4kbfx6oUcXVRPrxcl+JAI3YPtMfY2G0yxS+T iXOIQ0HhZuwlG588jcA9WWI8p9HdPAxC3IqwBIKTajhNENKLsRXQF7etAXoVX6EZTkuJ Bkbw== X-Gm-Message-State: AOAM533ijZX3V6ifpRGXdN3JpOo8GbJvmBuPX2sangTpPKQeBdOtZ+B8 Q6MSMn4PJXjRTxJFi+IyD+pF/A/nzVM8yw== X-Google-Smtp-Source: ABdhPJwjMLzDRdx3H/L/4MFMbwz7PdpaG22BZtN0XpYLFc73gFM8OtcM01ZI6epvRYzOGqJdgFhbDg== X-Received: by 2002:a7b:c4cb:: with SMTP id g11mr15371306wmk.80.1629997421465; Thu, 26 Aug 2021 10:03:41 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 31/37] target/arm: Avoid assertion trying to use KVM and multiple ASes Date: Thu, 26 Aug 2021 18:03:01 +0100 Message-Id: <20210826170307.27733-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998893500100001 KVM cannot support multiple address spaces per CPU; if you try to create more than one then cpu_address_space_init() will assert. In the Arm CPU realize function, detect the configurations which would cause us to need more than one AS, and cleanly fail the realize rather than blundering on into the assertion. This turns this: $ qemu-system-aarch64 -enable-kvm -display none -cpu max -machine raspi3b qemu-system-aarch64: ../../softmmu/physmem.c:747: cpu_address_space_init:= Assertion `asidx =3D=3D 0 || !kvm_enabled()' failed. Aborted into: $ qemu-system-aarch64 -enable-kvm -display none -machine raspi3b qemu-system-aarch64: Cannot enable KVM when guest CPU has EL3 enabled and this: $ qemu-system-aarch64 -enable-kvm -display none -machine mps3-an524 qemu-system-aarch64: ../../softmmu/physmem.c:747: cpu_address_space_init:= Assertion `asidx =3D=3D 0 || !kvm_enabled()' failed. Aborted into: $ qemu-system-aarch64 -enable-kvm -display none -machine mps3-an524 qemu-system-aarch64: Cannot enable KVM when using an M-profile guest CPU Fixes: https://gitlab.com/qemu-project/qemu/-/issues/528 Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20210816135842.25302-3-peter.maydell@linaro.org --- target/arm/cpu.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index a82e39dd97f..d631c4683c4 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1422,6 +1422,29 @@ static void arm_cpu_realizefn(DeviceState *dev, Erro= r **errp) } } =20 + if (kvm_enabled()) { + /* + * Catch all the cases which might cause us to create more than one + * address space for the CPU (otherwise we will assert() later in + * cpu_address_space_init()). + */ + if (arm_feature(env, ARM_FEATURE_M)) { + error_setg(errp, + "Cannot enable KVM when using an M-profile guest CP= U"); + return; + } + if (cpu->has_el3) { + error_setg(errp, + "Cannot enable KVM when guest CPU has EL3 enabled"); + return; + } + if (cpu->tag_memory) { + error_setg(errp, + "Cannot enable KVM when guest CPUs has MTE enabled"= ); + return; + } + } + { uint64_t scale; =20 --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998789; cv=none; d=zohomail.com; s=zohoarc; b=gn+znO71T2XHilsVstJWtjfx704dIk8pa9gVvdp19MHWO5xQp73Bdkedg2fM8dN3cWNS9nOwxFFIKZSNbek2yZNqaJUOOghErZdUe9EUYqS0ydkgCFVbWZSL+IZN6iIPCJf4ed+0tR6XYNAF1P3MGVc9+EKfcOMzYzTzRO3n5Xg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998789; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oiyXNGxu9IIMHJpXStpM0zzZ7SVtpaA14aPib5MdPfI=; b=YNS8psDrADtLIqeBj9g9k1cmvaXfMspGFV5XjO2rNLzD4YIIzryRfvZehiEYsbFksw7f9uzKVVJKZhUERxgr5iOGk+7WL/ZrrlozbUQFFbnluVFuZjgOhUeJGkRl7/v5Sue0QdBR4lkHx8AGkeOg5ckdQMRvsR+8bk7GipyQ/XQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998789076815.0886976142028; Thu, 26 Aug 2021 10:26:29 -0700 (PDT) Received: from localhost ([::1]:54964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ91-0003K9-Ue for importer@patchew.org; Thu, 26 Aug 2021 13:26:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIn4-0006HQ-6o for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:47 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:51172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJIn1-0000B9-V2 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:45 -0400 Received: by mail-wm1-x32b.google.com with SMTP id m2so2278556wmm.0 for ; Thu, 26 Aug 2021 10:03:43 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:42 -0700 (PDT) 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=oiyXNGxu9IIMHJpXStpM0zzZ7SVtpaA14aPib5MdPfI=; b=ek3f95U5IrtJzZg8Tj8XGUMYsBUZzUG0GIT9vTEdmR6wPOU8kdCprOyxZkCzhVvEZi 1ScFkHXsV5wWxCmEQfjHl5MZE6VArLa97DXL1FA+kdENNpo+rUHRlZ7ShbgviW18pMZg Nqi7uJOJqtCye7POWgY0paVWuDQny9mtpwzLiMTqF7O1DzyN44LZYN6g60zx7FcL33Lw 7adkG+oNBUHBzKSc+gJJRV785MY5j36UxVqi40k2GzVZZTL3jvfDE7CLXhJnGSyOjrWx +KJr1I5kvt+Yy/K5GVx5Zsx0aCQ22FFlsMPHYQjnsPYpVkDL4TEiqghn4knHxphAnBxE NkBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oiyXNGxu9IIMHJpXStpM0zzZ7SVtpaA14aPib5MdPfI=; b=h/oLixTm4QcIU7vz1d7P6+2aWEu4iTYAV8pRNuaVA+gs5Zo0cQ3wOcmpK6FmSP//ow nUlx1AHZcTcFeSlKjG+By/gts9iAZD/pdL3URL9Upf3iwBTawVlQKT+BjBtHJBOtnbpC nAyq1UWdcUheW8pomasAi1TGFQWXy7KbQlL3lXc7370V+0jvbiMTrqb5PlKBCbLN57qc ZCHqHMo9b9iAWsWK2yAdWN+sVWznDhbcFnMysU5vpjpDteRJ4B+RAbUzHqgDDtgiGBtn dg6q0veVjTfpJNAvDKhfDnLbe+Kqg4J2BbORbrwbIKwvvkMM3CprQh50pmS1/2KCdig7 NFeg== X-Gm-Message-State: AOAM531S4eP/1JzmU4QTvXD9Ix2xhzIOkd+tpwtkzk9ifNXrOqUMdeis tHS4tKqXqCP6S0cBsFb0mjyRN22tOxQiTg== X-Google-Smtp-Source: ABdhPJwENaOgQyo01Wq2mE29T/mBdojLbLudWe1AG6PRcRUTrI9goO9I8zfZ7AYwF2acwhr3+Pcerg== X-Received: by 2002:a05:600c:299:: with SMTP id 25mr2673547wmk.107.1629997422549; Thu, 26 Aug 2021 10:03:42 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 32/37] hw/arm/virt: Delete EL3 error checksnow provided in CPU realize Date: Thu, 26 Aug 2021 18:03:02 +0100 Message-Id: <20210826170307.27733-33-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998791325100001 Now that the CPU realize function will fail cleanly if we ask for EL3 when KVM is enabled, we don't need to check for errors explicitly in the virt board code. The reported message is slightly different; it is now: qemu-system-aarch64: Cannot enable KVM when guest CPU has EL3 enabled instead of: qemu-system-aarch64: mach-virt: KVM does not support Security extensions We don't delete the MTE check because there the logic is more complex; deleting the check would work but makes the error message less helpful, as it would read: qemu-system-aarch64: MTE requested, but not supported by the guest CPU instead of: qemu-system-aarch64: mach-virt: KVM does not support providing MTE to the= guest CPU Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20210816135842.25302-4-peter.maydell@linaro.org --- hw/arm/virt.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 81eda46b0bb..86c8a4ca3d7 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1852,11 +1852,6 @@ static void machvirt_init(MachineState *machine) } =20 if (vms->secure) { - if (kvm_enabled()) { - error_report("mach-virt: KVM does not support Security extensi= ons"); - exit(1); - } - /* * The Secure view of the world is the same as the NonSecure, * but with a few extra devices. Create it as a container region --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998162; cv=none; d=zohomail.com; s=zohoarc; b=RBEay1tKhedbtDMhm/MzGVDY8IenAPFwPs8PFWJYL/VuVTt2rZguMokiqOoFK9EdwVpO8jlH7jeC8cCDWRloDqE1rwI0KSupWFW2eSX62H8UZju4S58vMWYf0Xovh842G1hvwf9cZGVJOiWGrLUBtoqkfrGT8mZo4sWRKci429k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998162; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fr5/qTsyPceG+UnhtkA8Hp2jMgS+2xvalZAPZZRCG0c=; b=DiIzWs2kvRrLDAiU3n99LhSwBSUJ37OSW+llyFfeMdjCUQqDi0M+GS5VTNjbsnLX7iEn5fY1W3VaLh9t0doBcMhxalj73iKHu4VFHWdInatB/J4Xg6uJ00q/12LNMLDjv0dL57HJJ5ZvHZw4AtG34G892vsLVswaRP2YA0NTTLg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998162227108.29850718708497; Thu, 26 Aug 2021 10:16:02 -0700 (PDT) Received: from localhost ([::1]:52968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIyt-0008F9-Dw for importer@patchew.org; Thu, 26 Aug 2021 13:16:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIn5-0006HU-5X for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:47 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:43978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJIn3-0000Cj-HY for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:46 -0400 Received: by mail-wr1-x432.google.com with SMTP id b6so6126081wrh.10 for ; Thu, 26 Aug 2021 10:03:44 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:42 -0700 (PDT) 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=Fr5/qTsyPceG+UnhtkA8Hp2jMgS+2xvalZAPZZRCG0c=; b=D4mhoU5p9enHjPx1ch/ZniNUveffVtm+Hry6JYOG02TcrA61BhMdj/76uEunjbKkVy BqGICjIgf7m5rauJapthRhD26JmTsxG1PCm+qU5Qz6fDC7N1usK1K3ZJGhrkuJv0M+Og 4XVXBX0OSgp+U4p0BAS2p5Abs6Ql4ePttjv6ZOnTWlCYfNRvB9diSZL1iR+6AKqsZk8l TuZ4bhi3kg/fVBld12fduj5kcvnrteb5eluKATQTwUswopUBuPrmZ3vpsUUcPVWUdfOy 6bfy8QNHEu4PhVqsf1e6Zaiuien3Z5+N/i0nw7a9/z+Zn8ujhZVnnAl3rl9nhMq+2jJl 9lVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fr5/qTsyPceG+UnhtkA8Hp2jMgS+2xvalZAPZZRCG0c=; b=dssd7vKC05YtsXX/hNzO7Zt8iw3LFwvgnrO+/jnk6J5ogex3VKZ74RZRpGIosbL+mp mnC1m2zeRWs8rEncOnadz2G31GIW1d80oLAA6zVMIKyL4xCzwL9yY+8up/FouzsYUs29 eb3QL8ZescsPb5Mb5HrdhaGBASxPmUUqvCE10PFUwnWyPn97SAukPLAcxNNPnHxLfnrw rhClbmNwU+x5TIJlrMIZlyTmkKU0JYwyGdALfVb4GIW8loGFzS74IPvoMDCyyKIs24SS 2ENO1q+vlE8svtGLmeo4in29sqlTnSfycb8JYJyUhchECqVeBdNAmyTvuJ4lTI2j4AJF turg== X-Gm-Message-State: AOAM530aZ06sccNZWjIUKlSOcGLiAKu8Ytmy1F0GPFYOMK2AMXFZRLks UwKoQfCAUkW9b2M9jO8brCgzm7J1CwEi0w== X-Google-Smtp-Source: ABdhPJzdGDsqm9DUFhara8xM2gY2TR5PCs50Q62b/d5dDs6sdLS0uP7dvR3+/aNpHz13LNQvH2iDWg== X-Received: by 2002:adf:c40f:: with SMTP id v15mr2060792wrf.316.1629997423445; Thu, 26 Aug 2021 10:03:43 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 33/37] target/arm: Implement HSTR.TTEE Date: Thu, 26 Aug 2021 18:03:03 +0100 Message-Id: <20210826170307.27733-34-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998162712100001 Content-Type: text/plain; charset="utf-8" In v7, the HSTR register has a TTEE bit which allows EL0/EL1 accesses to the Thumb2EE TEECR and TEEHBR registers to be trapped to the hypervisor. Implement these traps. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20210816180305.20137-2-peter.maydell@linaro.org --- target/arm/cpu.h | 2 ++ target/arm/helper.c | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 1060825c746..0cd3206041e 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1541,6 +1541,8 @@ static inline void xpsr_write(CPUARMState *env, uint3= 2_t val, uint32_t mask) #define SCR_ENSCXT (1U << 25) #define SCR_ATA (1U << 26) =20 +#define HSTR_TTEE (1 << 16) + /* Return the current FPSCR value. */ uint32_t vfp_get_fpscr(CPUARMState *env); void vfp_set_fpscr(CPUARMState *env, uint32_t val); diff --git a/target/arm/helper.c b/target/arm/helper.c index 56c520cf8e9..54ac8c54b1f 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -2446,20 +2446,34 @@ static void teecr_write(CPUARMState *env, const ARM= CPRegInfo *ri, env->teecr =3D value; } =20 +static CPAccessResult teecr_access(CPUARMState *env, const ARMCPRegInfo *r= i, + bool isread) +{ + /* + * HSTR.TTEE only exists in v7A, not v8A, but v8A doesn't have T2EE + * at all, so we don't need to check whether we're v8A. + */ + if (arm_current_el(env) < 2 && !arm_is_secure_below_el3(env) && + (env->cp15.hstr_el2 & HSTR_TTEE)) { + return CP_ACCESS_TRAP_EL2; + } + return CP_ACCESS_OK; +} + static CPAccessResult teehbr_access(CPUARMState *env, const ARMCPRegInfo *= ri, bool isread) { if (arm_current_el(env) =3D=3D 0 && (env->teecr & 1)) { return CP_ACCESS_TRAP; } - return CP_ACCESS_OK; + return teecr_access(env, ri, isread); } =20 static const ARMCPRegInfo t2ee_cp_reginfo[] =3D { { .name =3D "TEECR", .cp =3D 14, .crn =3D 0, .crm =3D 0, .opc1 =3D 6, = .opc2 =3D 0, .access =3D PL1_RW, .fieldoffset =3D offsetof(CPUARMState, teecr), .resetvalue =3D 0, - .writefn =3D teecr_write }, + .writefn =3D teecr_write, .accessfn =3D teecr_access }, { .name =3D "TEEHBR", .cp =3D 14, .crn =3D 1, .crm =3D 0, .opc1 =3D 6,= .opc2 =3D 0, .access =3D PL0_RW, .fieldoffset =3D offsetof(CPUARMState, teehbr), .accessfn =3D teehbr_access, .resetvalue =3D 0 }, --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998353; cv=none; d=zohomail.com; s=zohoarc; b=GA45skM6ufxqJji0GaNO+CH4pjJkW87iWQsjZHRilUfAGvAoqrtl7oomfjFWdQZ5DIJUSCUJfXGwnBlfkFMB+s1ANLo43FDzw2GLPQ9Kv1/eHUZ1hCML6mhKmILxEhX2htO+xUiYhh+9Uek5aN4E7/z1Ck4HGfXLupeethYiNH8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998353; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=X8kvI1tXhBduKhpPX7T3tR8UDJI3V14LEubP46mHPig=; b=nev8X2xQRX6tXQxKVQ4q0YMmh8ZpLQJZH230zos8MK4umjZZbYk2Snya27oPE71KRLwa7qFhZYQSOPr9H78PbOzl++qRJ3eburpEmShBXwT7G2IYQuUV+e3shobJGSnAk8X8xZgVDBNY3MtwslxJZvosa7jqsLeUaL0ey85yN0U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998353660676.0474121609122; Thu, 26 Aug 2021 10:19:13 -0700 (PDT) Received: from localhost ([::1]:33208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ20-0005Wf-MS for importer@patchew.org; Thu, 26 Aug 2021 13:19:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIn9-0006Js-My for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:53 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:42722) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJIn3-0000Ct-Sk for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:51 -0400 Received: by mail-wr1-x42c.google.com with SMTP id q11so6137482wrr.9 for ; Thu, 26 Aug 2021 10:03:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:44 -0700 (PDT) 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=X8kvI1tXhBduKhpPX7T3tR8UDJI3V14LEubP46mHPig=; b=urqQcifb43IbdUGc/ce//ROfrLDVhhjIGkFbfe3xA7VX/3GGsImhwiIl8LlUOVvZYu gK5t7Rg3+eNBaPY81DhFeEbjl/EsFZwpZrwynuamnKZbNPF2CKEW8uc5lg28AxItGusB Wx0HWcy+u81y2LckTSNjvVy9PW07IENmEWI/cSw2U7h4i9f5lcCSXoruK/oDnw+T3RM/ nfkWZmZLStR8qdH/9vpWPV3dJMQUQmHEzU4LlPVSNUUfiiZoyd1k8eUpviJXN8rdWvP7 EeYujR5SGANoPS423axcC6WvPMuVBINIFAAT9BvryOGjqeMH14aOlv5nyieqSC8cqstN c67g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X8kvI1tXhBduKhpPX7T3tR8UDJI3V14LEubP46mHPig=; b=KmXsIMvbrNW1pvyjfwyZ4IMWVI/e9B4QHHd0k/5RIx7GHP6jRl8w+NjIs44uiQQ/JS mG4r/vuKT4yU4oNt9Nb+Zrh0M1EcGOSsxTsrIT63EssBtp3XS6nNKMNn6RMd+yTwcoQV FF0iHt1HnWMHONLnruh+L9f1xWhstwy+ZqRDJ8YcXiAjv6nRh9blQKM8ywO0yw9/h5tM YzmGOSEABU25/DKD52dkzo85Acj5LVedvEXJA2YyB+pMi4XbM0H8galoOrSEHzJrfMg0 OtDunJg1KcOqoZg38Tc/7ECGkIv3i2zSenCVOeXMfa/ka/QqaCQIG9jDMryhCxp4WKQW JbDg== X-Gm-Message-State: AOAM530f3EkVAhoq0a3d5Pg/rGk7/P/Jd0wELMTGfsHF9NbCogqbgl8a dTaODfGztgF1nv9IKo+Z+fHQ9ktIVK4NPQ== X-Google-Smtp-Source: ABdhPJzgWzvb22G30al7mfi9jUN2+DWCQ8El9xNLATPUmrluiXyeOZDJn9jRQKbMh4Owcv4XIhTYlw== X-Received: by 2002:adf:e702:: with SMTP id c2mr5127699wrm.397.1629997424529; Thu, 26 Aug 2021 10:03:44 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 34/37] target/arm: Implement HSTR.TJDBX Date: Thu, 26 Aug 2021 18:03:04 +0100 Message-Id: <20210826170307.27733-35-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998354098100001 Content-Type: text/plain; charset="utf-8" In v7A, the HSTR register has a TJDBX bit which traps NS EL0/EL1 access to the JOSCR and JMCR trivial Jazelle registers, and also BXJ. Implement these traps. In v8A this HSTR bit doesn't exist, so don't trap for v8A CPUs. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20210816180305.20137-3-peter.maydell@linaro.org --- target/arm/cpu.h | 1 + target/arm/helper.h | 2 ++ target/arm/syndrome.h | 7 +++++++ target/arm/helper.c | 17 +++++++++++++++++ target/arm/op_helper.c | 16 ++++++++++++++++ target/arm/translate.c | 12 ++++++++++++ 6 files changed, 55 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 0cd3206041e..09760333ccd 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1542,6 +1542,7 @@ static inline void xpsr_write(CPUARMState *env, uint3= 2_t val, uint32_t mask) #define SCR_ATA (1U << 26) =20 #define HSTR_TTEE (1 << 16) +#define HSTR_TJDBX (1 << 17) =20 /* Return the current FPSCR value. */ uint32_t vfp_get_fpscr(CPUARMState *env); diff --git a/target/arm/helper.h b/target/arm/helper.h index aee8f0019b4..448a86edfdc 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -73,6 +73,8 @@ DEF_HELPER_2(v7m_vlldm, void, env, i32) =20 DEF_HELPER_2(v8m_stackcheck, void, env, i32) =20 +DEF_HELPER_FLAGS_2(check_bxj_trap, TCG_CALL_NO_WG, void, env, i32) + DEF_HELPER_4(access_check_cp_reg, void, env, ptr, i32, i32) DEF_HELPER_3(set_cp_reg, void, env, ptr, i32) DEF_HELPER_2(get_cp_reg, i32, env, ptr) diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h index 39a31260f2d..8dd88a0cb17 100644 --- a/target/arm/syndrome.h +++ b/target/arm/syndrome.h @@ -36,6 +36,7 @@ enum arm_exception_class { EC_ADVSIMDFPACCESSTRAP =3D 0x07, EC_FPIDTRAP =3D 0x08, EC_PACTRAP =3D 0x09, + EC_BXJTRAP =3D 0x0a, EC_CP14RRTTRAP =3D 0x0c, EC_BTITRAP =3D 0x0d, EC_ILLEGALSTATE =3D 0x0e, @@ -215,6 +216,12 @@ static inline uint32_t syn_btitrap(int btype) return (EC_BTITRAP << ARM_EL_EC_SHIFT) | btype; } =20 +static inline uint32_t syn_bxjtrap(int cv, int cond, int rm) +{ + return (EC_BXJTRAP << ARM_EL_EC_SHIFT) | ARM_EL_IL | + (cv << 24) | (cond << 20) | rm; +} + static inline uint32_t syn_insn_abort(int same_el, int ea, int s1ptw, int = fsc) { return (EC_INSNABORT << ARM_EL_EC_SHIFT) | (same_el << ARM_EL_EC_SHIFT) diff --git a/target/arm/helper.c b/target/arm/helper.c index 54ac8c54b1f..d2dd4aa0b80 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -7602,6 +7602,21 @@ static CPAccessResult access_jazelle(CPUARMState *en= v, const ARMCPRegInfo *ri, return CP_ACCESS_OK; } =20 +static CPAccessResult access_joscr_jmcr(CPUARMState *env, + const ARMCPRegInfo *ri, bool isrea= d) +{ + /* + * HSTR.TJDBX traps JOSCR and JMCR accesses, but it exists only + * in v7A, not in v8A. + */ + if (!arm_feature(env, ARM_FEATURE_V8) && + arm_current_el(env) < 2 && !arm_is_secure_below_el3(env) && + (env->cp15.hstr_el2 & HSTR_TJDBX)) { + return CP_ACCESS_TRAP_EL2; + } + return CP_ACCESS_OK; +} + static const ARMCPRegInfo jazelle_regs[] =3D { { .name =3D "JIDR", .cp =3D 14, .crn =3D 0, .crm =3D 0, .opc1 =3D 7, .opc2 =3D 0, @@ -7609,9 +7624,11 @@ static const ARMCPRegInfo jazelle_regs[] =3D { .type =3D ARM_CP_CONST, .resetvalue =3D 0 }, { .name =3D "JOSCR", .cp =3D 14, .crn =3D 1, .crm =3D 0, .opc1 =3D 7, .opc2 =3D 0, + .accessfn =3D access_joscr_jmcr, .access =3D PL1_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 }, { .name =3D "JMCR", .cp =3D 14, .crn =3D 2, .crm =3D 0, .opc1 =3D 7, .opc2 =3D 0, + .accessfn =3D access_joscr_jmcr, .access =3D PL1_RW, .type =3D ARM_CP_CONST, .resetvalue =3D 0 }, REGINFO_SENTINEL }; diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c index e98fd863057..70b42b55fd0 100644 --- a/target/arm/op_helper.c +++ b/target/arm/op_helper.c @@ -224,6 +224,22 @@ void HELPER(setend)(CPUARMState *env) arm_rebuild_hflags(env); } =20 +void HELPER(check_bxj_trap)(CPUARMState *env, uint32_t rm) +{ + /* + * Only called if in NS EL0 or EL1 for a BXJ for a v7A CPU; + * check if HSTR.TJDBX means we need to trap to EL2. + */ + if (env->cp15.hstr_el2 & HSTR_TJDBX) { + /* + * We know the condition code check passed, so take the IMPDEF + * choice to always report CV=3D1 COND 0xe + */ + uint32_t syn =3D syn_bxjtrap(1, 0xe, rm); + raise_exception_ra(env, EXCP_HYP_TRAP, syn, 2, GETPC()); + } +} + #ifndef CONFIG_USER_ONLY /* Function checks whether WFx (WFI/WFE) instructions are set up to be tra= pped. * The function returns the target EL (1-3) if the instruction is to be tr= apped; diff --git a/target/arm/translate.c b/target/arm/translate.c index 115aa768b6a..24b7f49d767 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -6440,6 +6440,18 @@ static bool trans_BXJ(DisasContext *s, arg_BXJ *a) if (!ENABLE_ARCH_5J || arm_dc_feature(s, ARM_FEATURE_M)) { return false; } + /* + * v7A allows BXJ to be trapped via HSTR.TJDBX. We don't waste a + * TBFLAGS bit on a basically-never-happens case, so call a helper + * function to check for the trap and raise the exception if needed + * (passing it the register number for the syndrome value). + * v8A doesn't have this HSTR bit. + */ + if (!arm_dc_feature(s, ARM_FEATURE_V8) && + arm_dc_feature(s, ARM_FEATURE_EL2) && + s->current_el < 2 && s->ns) { + gen_helper_check_bxj_trap(cpu_env, tcg_constant_i32(a->rm)); + } /* Trivial implementation equivalent to bx. */ gen_bx(s, load_reg(s, a->rm)); return true; --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998277; cv=none; d=zohomail.com; s=zohoarc; b=UqgnERDktcuTyKFBLS6opI7X5EsP2DMf/GA3NWq15UriM+9c/+agqx6kIcvxHGf8PXLsXC6f/W3ks+7o+w/IA0WVYiFj06BQWQUAAiY91X9tGp6DVyWmPHLx25WWs0/xVeC8F6g7uP4aMe/RF6DXYb+ovI2z4Y01423CUYyhCb0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998277; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=txe39M70WygZOjT/yHmjHImLKdjFIHC1BiWvrXKQ32U=; b=M1s3vzghB4D+bjZhExAK8+jhsZLbP+YnbeY1XKYC7957TvkE21nJev4INgQK908DJTSsMK9Et785zovGEQ6e0yFE/mUZ8w/TfP4LLl+nrWQNbd1kD0GR1sbwIaW2xJC0A/SK6JKr8NZXtRKKNuGJ4GIb3NJUt8/CFt4ApXd/uwQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998277042417.363015143152; Thu, 26 Aug 2021 10:17:57 -0700 (PDT) Received: from localhost ([::1]:57560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ0m-0002wi-1l for importer@patchew.org; Thu, 26 Aug 2021 13:17:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIn7-0006J6-Ik for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:51 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:56243) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJIn4-0000DU-Vn for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:49 -0400 Received: by mail-wm1-x32e.google.com with SMTP id g135so2229072wme.5 for ; Thu, 26 Aug 2021 10:03:46 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:45 -0700 (PDT) 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=txe39M70WygZOjT/yHmjHImLKdjFIHC1BiWvrXKQ32U=; b=d3oil2KCpXkflnhJqi29DasjFxanUvuWZmgA5Z02D9YiFyZOQ+9v1cfO5EZNC+WOz9 /vsxffFdGv/upWTNcdLbPG+IKubbLSYATZ3rnlKzaa+28dGB3FpPoqsOMgdx+Q+mh6K6 tl5qhnrnYV6i7U6bInkFCrkB5nKTQSkcfI6dT+9hZsJ6exRfmq7UUZR3hH2fklUq2WI9 CE1LA1eyorfHIqGV99dYZRmz6sOwOEClW6ynapNFkaXqy7KcbeOyNZmvSBGKL3E0dBCJ 8q4P4fVC44+XXW5qFi9w/RpRB8lHoLHmgeMQ0bmd3CtQERvKcfi/bSUWYHoEsiac/zs5 Mgbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=txe39M70WygZOjT/yHmjHImLKdjFIHC1BiWvrXKQ32U=; b=sX/p6EEsCaYWyjuEQm61RIivKsnq9bcyKylOcl9Lu/oRojdfZXO3x1bpWW+6Fwi+B5 cYL4h4exH4wasMwqWs0UliTnTQ0Q9ydhKIaAgq6mni/z9Yw4CsKy4tyd24NCCyqyNxWv NfUiqL6Vw/og7wfS2uf2M8HQ5MiurBKkm6rDOltcY9d6BTQ7D6D6kVaXzNASBojuIKVg 7J0H8n+jK1K+9hMaqo9M9+iN2lm30i5snguFYXRxyX5CKM9zfJQCj/KutBEp9nBNi6q8 pI/IIwJyfFQqnmFRodpO7OthJsus/7HmEf/tFqQjCUSvRNFj7Ay75ogePcioIlAs2NqI 2MUA== X-Gm-Message-State: AOAM532ELEb7bCTUTmwW2WnjiqTdTZ5Sz57nIjozL167VBsZEBWETVxh ay0gKPQGQNyUGs7sQEez5gtk/2k/A1ndFg== X-Google-Smtp-Source: ABdhPJwRlBxBCeApWpfEfA3XyMMHSoxTqnvL9VM2MYxGihkIkfrWJpbPDiDZ0FTeB8WehQE5T4mqjw== X-Received: by 2002:a1c:7402:: with SMTP id p2mr15388303wmc.111.1629997425556; Thu, 26 Aug 2021 10:03:45 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 35/37] target/arm: Do hflags rebuild in cpsr_write() Date: Thu, 26 Aug 2021 18:03:05 +0100 Message-Id: <20210826170307.27733-36-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998278296100001 Content-Type: text/plain; charset="utf-8" Currently we rely on all the callsites of cpsr_write() to rebuild the cached hflags if they change one of the CPSR bits which we use as a TB flag and cache in hflags. This is a bit awkward when we want to change the set of CPSR bits that we cache, because it means we need to re-audit all the cpsr_write() callsites to see which flags they are writing and whether they now need to rebuild the hflags. Switch instead to making cpsr_write() call arm_rebuild_hflags() itself if one of the bits being changed is a cached bit. We don't do the rebuild for the CPSRWriteRaw write type, because that kind of write is generally doing something special anyway. For the CPSRWriteRaw callsites in the KVM code and inbound migration we definitely don't want to recalculate the hflags; the callsites in boot.c and arm-powerctl.c have to do a rebuild-hflags call themselves anyway because of other CPU state changes they make. This allows us to drop explicit arm_rebuild_hflags() calls in a couple of places where the only reason we needed to call it was the CPSR write. This fixes a bug where we were incorrectly failing to rebuild hflags in the code path for a gdbstub write to CPSR, which meant that you could make QEMU assert by breaking into a running guest, altering the CPSR to change the value of, for example, CPSR.E, and then continuing. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20210817201843.3829-1-peter.maydell@linaro.org --- target/arm/cpu.h | 10 ++++++++-- linux-user/arm/signal.c | 2 -- target/arm/helper.c | 5 +++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 09760333ccd..6a987f65e41 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1398,11 +1398,17 @@ uint32_t cpsr_read(CPUARMState *env); typedef enum CPSRWriteType { CPSRWriteByInstr =3D 0, /* from guest MSR or CPS */ CPSRWriteExceptionReturn =3D 1, /* from guest exception return insn */ - CPSRWriteRaw =3D 2, /* trust values, do not switch reg ban= ks */ + CPSRWriteRaw =3D 2, + /* trust values, no reg bank switch, no hflags rebuild */ CPSRWriteByGDBStub =3D 3, /* from the GDB stub */ } CPSRWriteType; =20 -/* Set the CPSR. Note that some bits of mask must be all-set or all-clear= .*/ +/* + * Set the CPSR. Note that some bits of mask must be all-set or all-clear. + * This will do an arm_rebuild_hflags() if any of the bits in @mask + * correspond to TB flags bits cached in the hflags, unless @write_type + * is CPSRWriteRaw. + */ void cpsr_write(CPUARMState *env, uint32_t val, uint32_t mask, CPSRWriteType write_type); =20 diff --git a/linux-user/arm/signal.c b/linux-user/arm/signal.c index 32b68ee302b..1dfcfd2d57b 100644 --- a/linux-user/arm/signal.c +++ b/linux-user/arm/signal.c @@ -289,7 +289,6 @@ setup_return(CPUARMState *env, struct target_sigaction = *ka, env->regs[14] =3D retcode; env->regs[15] =3D handler & (thumb ? ~1 : ~3); cpsr_write(env, cpsr, CPSR_IT | CPSR_T | CPSR_E, CPSRWriteByInstr); - arm_rebuild_hflags(env); =20 return 0; } @@ -547,7 +546,6 @@ restore_sigcontext(CPUARMState *env, struct target_sigc= ontext *sc) __get_user(env->regs[15], &sc->arm_pc); __get_user(cpsr, &sc->arm_cpsr); cpsr_write(env, cpsr, CPSR_USER | CPSR_EXEC, CPSRWriteByInstr); - arm_rebuild_hflags(env); =20 err |=3D !valid_user_regs(env); =20 diff --git a/target/arm/helper.c b/target/arm/helper.c index d2dd4aa0b80..a7ae78146d4 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -9246,6 +9246,8 @@ void cpsr_write(CPUARMState *env, uint32_t val, uint3= 2_t mask, CPSRWriteType write_type) { uint32_t changed_daif; + bool rebuild_hflags =3D (write_type !=3D CPSRWriteRaw) && + (mask & (CPSR_M | CPSR_E | CPSR_IL)); =20 if (mask & CPSR_NZCV) { env->ZF =3D (~val) & CPSR_Z; @@ -9365,6 +9367,9 @@ void cpsr_write(CPUARMState *env, uint32_t val, uint3= 2_t mask, } mask &=3D ~CACHED_CPSR_BITS; env->uncached_cpsr =3D (env->uncached_cpsr & ~mask) | (val & mask); + if (rebuild_hflags) { + arm_rebuild_hflags(env); + } } =20 /* Sign/zero extend */ --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629999029; cv=none; d=zohomail.com; s=zohoarc; b=OBswHhHVByzfaNfMX7v6BTidd+HcYGsGSZqX7TKLBSTFuJXcsk/hzm3d8+qPt8XUspcMVC7EQc5ZFRRuFWNziGahmcptjWJYSferzhhTy5UPgJ+hgnd+rZnmVwV8UPD5jYc3v4lBrHzWQaKcCUpygtxPm/ViLo8UfIYUqeAj7CQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629999029; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Gi4ZFyDmzcI+JAkvfvygpZgorNneqYeRk7O8h/ldoXk=; b=d7qwqmOSZ5aMdllvBvLPNCcmSMNtdcyjHwmHcWp3zitiwYVntbMZZeL1221AC0n8Dj18LAtgvYjtOCvRcbAxmgB+HiwZaCNm8ur7vYa3IFvquCtF/glGmPDJpH9Jz9yxbdbbanhoFVFMbEOCml5yELrNd/JUZMG8V9JEqYl/1io= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629999029179728.5759464227921; Thu, 26 Aug 2021 10:30:29 -0700 (PDT) Received: from localhost ([::1]:39562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJCs-0003Wb-U7 for importer@patchew.org; Thu, 26 Aug 2021 13:30:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIn9-0006KL-Rt for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:53 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:38844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJIn5-0000Ex-S7 for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:51 -0400 Received: by mail-wr1-x436.google.com with SMTP id u16so6174602wrn.5 for ; Thu, 26 Aug 2021 10:03:47 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:46 -0700 (PDT) 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=Gi4ZFyDmzcI+JAkvfvygpZgorNneqYeRk7O8h/ldoXk=; b=pNXF/kDRkrhNQ/uzslr+lkf2Teu5WtPKmfrCKyM9e1oOUPYL1z/zskt+KsBjxyseKO q4NjJTGGaidaLjEu+WXTTMfWufdNYTgFgvfZVpTFbIKsoJjRC1Kcr3u3i8herUysxLCw wVEJEkmAbb9RIK0/QnqyTZCnM0kfqgATSpkk2o5KpodCDWTL4nKnhKHvx0qi+n0s1Qxl zANAw/KNGrDP+MJOnIfNnSFfvxaQo9c2xAs1B8edEWZaOpAo93nc9YwCPJBbRS5ReF7a U9blgKng8X6q3IIQRFVjdg6DhUs5WMjR3ACf69GXnhjoOHoKepNN3b0fJpyMVPzwShhG koOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Gi4ZFyDmzcI+JAkvfvygpZgorNneqYeRk7O8h/ldoXk=; b=fdN4VmWk76fmswJc8VH/vPwQOq8lIorSO0n+B/OYKq90F/xspsH07Ld0J3g6uH4IcO bJQ9ijuNN61wHTnMfxaSbSxScYEpfMagkmmmnaU0UE8UlRy0Gd6S6d0urvMBv0oaZXip nI8HjEuZOB/HyhnHyJG3Qy1jBO8ao5t/L0M0aShmoWe9Z/XXXHdCSdT6wy+oQbFtXTsA FHTtu3zWBbWtqYxYYxosZBtfFofa7cjdfds82SsEdcj/tA7QS0UWVfSVkraikzOwcNdZ LFc4RMaKutSLGrC8CE5m0AK0zAW3zWok51pVQdUOJVp07pgDvUpgpnClOpbj3kUhF3S5 xFCA== X-Gm-Message-State: AOAM531xyjhUTf1FCqZMCR8+rooXGzz6ScAOc4x/jl/Xt47Dxi9T7APr AxNHHrGI0C3DQcAPmBjONThznEcjcIh+jg== X-Google-Smtp-Source: ABdhPJxdMk9EBuFNerKpgMunCE8g3CL33ba2aEERdAl0zRDRxXIKDW7JidAq4mYlCxz5FGmMl7r9gw== X-Received: by 2002:adf:fcc5:: with SMTP id f5mr5368732wrs.114.1629997426482; Thu, 26 Aug 2021 10:03:46 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 36/37] hw/arm/xlnx-versal: Add unimplemented APU mmio Date: Thu, 26 Aug 2021 18:03:06 +0100 Message-Id: <20210826170307.27733-37-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629999030699100001 Content-Type: text/plain; charset="utf-8" From: Tong Ho Add unimplemented APU mmio region to xlnx-versal for booting bare-metal guests built with standalone bsp, which access the region from one of the following places: https://github.com/Xilinx/embeddedsw/blob/release-2020.2/lib/bsp/standalo= ne/src/arm/ARMv8/64bit/armclang/boot.S#L139 https://github.com/Xilinx/embeddedsw/blob/release-2020.2/lib/bsp/standalo= ne/src/arm/ARMv8/64bit/gcc/boot.S#L183 Acked-by: Alistair Francis Reviewed-by: Edgar E. Iglesias Signed-off-by: Tong Ho Message-id: 20210823173818.201259-2-tong.ho@xilinx.com Signed-off-by: Peter Maydell --- include/hw/arm/xlnx-versal.h | 2 ++ hw/arm/xlnx-versal.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h index 22a8fa5d11b..9b790517478 100644 --- a/include/hw/arm/xlnx-versal.h +++ b/include/hw/arm/xlnx-versal.h @@ -167,6 +167,8 @@ struct Versal { #define MM_IOU_SCNTRS_SIZE 0x10000 #define MM_FPD_CRF 0xfd1a0000U #define MM_FPD_CRF_SIZE 0x140000 +#define MM_FPD_FPD_APU 0xfd5c0000 +#define MM_FPD_FPD_APU_SIZE 0x100 =20 #define MM_PMC_SD0 0xf1040000U #define MM_PMC_SD0_SIZE 0x10000 diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c index d60eb4fb184..547a26603a3 100644 --- a/hw/arm/xlnx-versal.c +++ b/hw/arm/xlnx-versal.c @@ -378,6 +378,8 @@ static void versal_unimp(Versal *s) MM_CRL, MM_CRL_SIZE); versal_unimp_area(s, "crf", &s->mr_ps, MM_FPD_CRF, MM_FPD_CRF_SIZE); + versal_unimp_area(s, "apu", &s->mr_ps, + MM_FPD_FPD_APU, MM_FPD_FPD_APU_SIZE); versal_unimp_area(s, "crp", &s->mr_ps, MM_PMC_CRP, MM_PMC_CRP_SIZE); versal_unimp_area(s, "iou-scntr", &s->mr_ps, --=20 2.20.1 From nobody Tue May 7 03:32:34 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1629998435; cv=none; d=zohomail.com; s=zohoarc; b=jD5RjpHAdz0h+scWEEizTIkcMM5MYCi+MicVT1fAAlVkoJ/pBUq7KuXOSYabpDjlqhNSyjzfLZpFMplcZen2+Xs/UxMY0O4M6HyDH74gYcC31Xnht3Z5KI8CrvhBK+F38Hqgq3jONUQCTr4lBucxwRpssAUIPyDBpw8M7+nqGVk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629998435; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lAG2XJj76uSmzjh6rQO87dFXjpLvArf7j+9z5Kl9NHo=; b=dQeEQg5klGZ/Itw94kWbSgHIo2QvyFCfqEaOhCsRjjjMRbvFs8xGkkVPZJZA6wMBIWBIObxzuCmwhKT1AIahtPeY/ObVtaA6V4XYfI/eUmZwslWbd/81bdg8OfSslySCldpLQ4faoMbJ1pY9SG5TlOpQrbYrq1UOc63udb2dfR0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629998435568232.08650757640453; Thu, 26 Aug 2021 10:20:35 -0700 (PDT) Received: from localhost ([::1]:37790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJ3K-00007T-GV for importer@patchew.org; Thu, 26 Aug 2021 13:20:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIn9-0006JF-3o for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:51 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:38834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJIn7-0000FZ-9w for qemu-devel@nongnu.org; Thu, 26 Aug 2021 13:03:50 -0400 Received: by mail-wr1-x42b.google.com with SMTP id u16so6174657wrn.5 for ; Thu, 26 Aug 2021 10:03:48 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i21sm3632470wrb.62.2021.08.26.10.03.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 10:03:46 -0700 (PDT) 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=lAG2XJj76uSmzjh6rQO87dFXjpLvArf7j+9z5Kl9NHo=; b=fpp5uiHbBz/u/idCinI1YxoJgFDnDrxmJnCV3QvLUctR7aGkhEzfz7yNFGlyiLBISh FWOca3Cb8NbR9guI91Js2GVlIoESpdjLi2QA7i5++QK2sQ5qsZlUPkBG0dNc7DvYyh/W zq/7mK+Qu8eJiUa0pCATi+XknnAVBvTCY0jyRMnV+R09hqbr/B2Jurnv0T4pyHgtXlmS BVz26ssBt7lnApBI+nD+SbdI0TOsAcAd7ySqsvKZX9diZWAmlS85W1fXrQgCClcNXM1G UZ7JJnP1D+cXI2nJpRjyxiToFbWzACKxPuqIq0U3kW3AsMgznlYFEmCIwSq+33VpFzm6 b0TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lAG2XJj76uSmzjh6rQO87dFXjpLvArf7j+9z5Kl9NHo=; b=VIsmBpLUTiwGOOVRW+H5aZOjwVANzXMGDL4yM+Gwm8VhMwVOBA64vruvjfUW63X/tU LOwE9Rukc1y/QI30W0wH78ZUCtR+XX69FOh8/trVLSjJqJM9zC6jjyUrtU+/4+RsDvEd vHJ7xmTFe5XkKprWswCU6g527RlFjYs36iI6jKvNY4lfVW7I8xEidsABpXhUqWzLCglJ RvTtcpuf33xrbN67wTeNhWCCE45FkrGxsKrIq5zKNHybI6hErYOevUShSJx2fhELRVmj xscQA8v4aYtgtqhmT6rbX2vsMwI+uBvmWx6KoLZsTk17BpEdfNIBFlGmoMnYD2GX08j3 jM1A== X-Gm-Message-State: AOAM532N298MasKT2J8lAqeDpe086/h79XTJ9dvi0N8uzFE8+1Q1NfH4 CFo11lvw2nwxu5tOa7GltHmb06y5Q9SYaA== X-Google-Smtp-Source: ABdhPJy28dboOJLtTljsov52tk8SJliJ3lhloJ5opv0wZVdJZTzbjLX81egDdIUQSaFnYMoMPwAWtQ== X-Received: by 2002:adf:e107:: with SMTP id t7mr5258990wrz.165.1629997427468; Thu, 26 Aug 2021 10:03:47 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 37/37] hw/arm/xlnx-zynqmp: Add unimplemented APU mmio Date: Thu, 26 Aug 2021 18:03:07 +0100 Message-Id: <20210826170307.27733-38-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210826170307.27733-1-peter.maydell@linaro.org> References: <20210826170307.27733-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1629998436564100003 Content-Type: text/plain; charset="utf-8" From: Tong Ho Add unimplemented APU mmio region to xlnx-zynqmp for booting bare-metal guests built with standalone bsp, which access the region from one of the following places: https://github.com/Xilinx/embeddedsw/blob/release-2020.2/lib/bsp/standalo= ne/src/arm/ARMv8/64bit/armclang/boot.S#L139 https://github.com/Xilinx/embeddedsw/blob/release-2020.2/lib/bsp/standalo= ne/src/arm/ARMv8/64bit/gcc/boot.S#L183 Acked-by: Alistair Francis Reviewed-by: Edgar E. Iglesias Signed-off-by: Tong Ho Message-id: 20210823173818.201259-3-tong.ho@xilinx.com Signed-off-by: Peter Maydell --- include/hw/arm/xlnx-zynqmp.h | 7 +++++++ hw/arm/xlnx-zynqmp.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h index d3e2ef97f67..c84fe15996e 100644 --- a/include/hw/arm/xlnx-zynqmp.h +++ b/include/hw/arm/xlnx-zynqmp.h @@ -79,6 +79,11 @@ OBJECT_DECLARE_SIMPLE_TYPE(XlnxZynqMPState, XLNX_ZYNQMP) #define XLNX_ZYNQMP_MAX_RAM_SIZE (XLNX_ZYNQMP_MAX_LOW_RAM_SIZE + \ XLNX_ZYNQMP_MAX_HIGH_RAM_SIZE) =20 +/* + * Unimplemented mmio regions needed to boot some images. + */ +#define XLNX_ZYNQMP_NUM_UNIMP_AREAS 1 + struct XlnxZynqMPState { /*< private >*/ DeviceState parent_obj; @@ -96,6 +101,8 @@ struct XlnxZynqMPState { MemoryRegion *ddr_ram; MemoryRegion ddr_ram_low, ddr_ram_high; =20 + MemoryRegion mr_unimp[XLNX_ZYNQMP_NUM_UNIMP_AREAS]; + CadenceGEMState gem[XLNX_ZYNQMP_NUM_GEMS]; CadenceUARTState uart[XLNX_ZYNQMP_NUM_UARTS]; XlnxZynqMPCANState can[XLNX_ZYNQMP_NUM_CAN]; diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 6cfce26210d..4e5a471e30b 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -20,6 +20,7 @@ #include "qemu/module.h" #include "hw/arm/xlnx-zynqmp.h" #include "hw/intc/arm_gic_common.h" +#include "hw/misc/unimp.h" #include "hw/boards.h" #include "sysemu/kvm.h" #include "sysemu/sysemu.h" @@ -56,6 +57,9 @@ #define DPDMA_ADDR 0xfd4c0000 #define DPDMA_IRQ 116 =20 +#define APU_ADDR 0xfd5c0000 +#define APU_SIZE 0x100 + #define IPI_ADDR 0xFF300000 #define IPI_IRQ 64 =20 @@ -222,6 +226,32 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, X= lnxZynqMPState *s, qdev_realize(DEVICE(&s->rpu_cluster), NULL, &error_fatal); } =20 +static void xlnx_zynqmp_create_unimp_mmio(XlnxZynqMPState *s) +{ + static const struct UnimpInfo { + const char *name; + hwaddr base; + hwaddr size; + } unimp_areas[ARRAY_SIZE(s->mr_unimp)] =3D { + { .name =3D "apu", APU_ADDR, APU_SIZE }, + }; + unsigned int nr; + + for (nr =3D 0; nr < ARRAY_SIZE(unimp_areas); nr++) { + const struct UnimpInfo *info =3D &unimp_areas[nr]; + DeviceState *dev =3D qdev_new(TYPE_UNIMPLEMENTED_DEVICE); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); + + assert(info->name && info->base && info->size > 0); + qdev_prop_set_string(dev, "name", info->name); + qdev_prop_set_uint64(dev, "size", info->size); + object_property_add_child(OBJECT(s), info->name, OBJECT(dev)); + + sysbus_realize_and_unref(sbd, &error_fatal); + sysbus_mmio_map(sbd, 0, info->base); + } +} + static void xlnx_zynqmp_init(Object *obj) { MachineState *ms =3D MACHINE(qdev_get_machine()); @@ -596,6 +626,8 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error= **errp) sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0, RTC_ADDR); sysbus_connect_irq(SYS_BUS_DEVICE(&s->rtc), 0, gic_spi[RTC_IRQ]); =20 + xlnx_zynqmp_create_unimp_mmio(s); + for (i =3D 0; i < XLNX_ZYNQMP_NUM_GDMA_CH; i++) { if (!object_property_set_uint(OBJECT(&s->gdma[i]), "bus-width", 12= 8, errp)) { --=20 2.20.1