From nobody Sat Nov 15 09:08:46 2025 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=reject dis=none) header.from=unpredictable.fr ARC-Seal: i=1; a=rsa-sha256; t=1754122929; cv=none; d=zohomail.com; s=zohoarc; b=dfkSXdhBcJCxgAt5FLw/qEoNK/dkpfsy1eV5kPpRceL/8EShJo1fv3lLcc7EVCNpY1xSgfK08qvgR7gD5GAQN0YtYQRMappEkWzNILQpkifJwFP25iyW11QlotA+7QJvsMFUoI3ZGYeVrsweZ+DCK53Yvn/9xbN++j3zUUVnEfk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754122929; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=d/z0LdtJsZ0X4SZniRSWzKSzcqx6k2mthXNU/xLsNUA=; b=O44ynTS61JwEB0q5Xqy6L/DCZDmpCCjplk1b8hlq51egY1wp/+H0QXZ3w5iPSaeWU9ZulWITOYDv7B+4VaVbHR5Pe2Oc4wD2RiVMk5jmDp1uPQZn09Sx/2A7agn1HQajowPZyQjAKs0gWRIxCBA5z/SRaxXgNATaWTg11dGLT90= 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=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754122929533510.2336478088439; Sat, 2 Aug 2025 01:22:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ui7Tt-0001RP-Se; Sat, 02 Aug 2025 04:20:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ui7Rb-0006zu-Od for qemu-devel@nongnu.org; Sat, 02 Aug 2025 04:18:21 -0400 Received: from p-east3-cluster5-host9-snip4-7.eps.apple.com ([57.103.86.218] helo=outbound.qs.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ui7RT-00052W-St for qemu-devel@nongnu.org; Sat, 02 Aug 2025 04:18:15 -0400 Received: from outbound.qs.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-2d-60-percent-11 (Postfix) with ESMTPS id 0F9A1180009D; Sat, 2 Aug 2025 08:18:08 +0000 (UTC) Received: from localhost.localdomain (qs-asmtp-me-k8s.p00.prod.me.com [17.57.155.37]) by p00-icloudmta-asmtp-us-east-2d-60-percent-11 (Postfix) with ESMTPSA id A69401800148; Sat, 2 Aug 2025 08:18:04 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; bh=d/z0LdtJsZ0X4SZniRSWzKSzcqx6k2mthXNU/xLsNUA=; h=From:To:Subject:Date:Message-Id:MIME-Version:x-icloud-hme; b=ZfNDUPM4hE9jq6Elojpl+cJMCy1xTA76bNq6WqBPNWVpzoY3zExq5u2jUnC1+6dEA40QpCojHEj0yA6AgTxwWqRAYPWOdR9CfRc4tMmroSWND0qvsNqp+f2bx0k4iTa0aGOTjQQsI3Yr2cINerYg8ugOmgeG4BWou9AMyDQvLEJH8nfIzZJVAUoa+yuN3deXYx/u0gqKhr89YfIH7ji9x4Bh3/tZvTUsScuZpdMb2neQWEV65HXNg4GQmuOL3oFDPR2nwuNafXcsZcJZm0pkBeSo6v/+xXktyKhsJ4Lw1n6qn1GukOVEDhxLdLd+zZ78GDxc9mC9K/ZFFkzeIk970Q== X-Client-IP: 46.189.47.18 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Richard Henderson , Zhao Liu , Yanan Wang , qemu-arm@nongnu.org, Sunil Muthuswamy , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Igor Mammedov , Peter Maydell , Shannon Zhao , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eduardo Habkost , Marcel Apfelbaum , Mohamed Mediouni , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha Subject: [PATCH v3 01/14] hw/arm: virt: add GICv2m for the case when ITS is not available Date: Sat, 2 Aug 2025 10:17:47 +0200 Message-Id: <20250802081800.76030-2-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250802081800.76030-1-mohamed@unpredictable.fr> References: <20250802081800.76030-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: GNXtpN8KAkmSn3--0kgJB-2iKOiIxIXS X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODAyMDA3MCBTYWx0ZWRfX0jePk5N18zxH qUdxaoEfjzUB31SIUpeg3E7OypkDURsqcs7v9irrkWVkCNH1u/53Wf6ynhHIMpLXDlf2YghXUcs zxG292tghpj45x0BbzPtfiTKxRMdXfcMElmSK8/CWrrF6gT+vIhIkFF17bgFp0OPkgdtH9CE9Mm xpfi9H2h5RsBD5kl5mIzUIMwF0RZJxU79f3e3shf8Q4yJC9wYZYR0kAgMKTqLWqtwkFaziHy9Ei xp2+ECVuJjmRJ3v2Ecm3lr+ZsGN68weO/aTV2JD4NHLgYvff7QtHLVQgUiuOhNvQSNz9seTjY= X-Proofpoint-ORIG-GUID: GNXtpN8KAkmSn3--0kgJB-2iKOiIxIXS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-01_08,2025-08-01_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 clxscore=1030 mlxscore=0 malwarescore=0 suspectscore=0 spamscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506270000 definitions=main-2508020070 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=57.103.86.218; envelope-from=mohamed@unpredictable.fr; helo=outbound.qs.icloud.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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @unpredictable.fr) X-ZM-MESSAGEID: 1754122931055116600 Content-Type: text/plain; charset="utf-8" On Hypervisor.framework for macOS and WHPX for Windows, the provided enviro= nment is a GICv3 without ITS. As such, support a GICv3 w/ GICv2m for that scenario. Signed-off-by: Mohamed Mediouni --- hw/arm/virt-acpi-build.c | 4 +++- hw/arm/virt.c | 8 ++++++++ include/hw/arm/virt.h | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index b01fc4f8ef..969fa3f686 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -848,7 +848,9 @@ build_madt(GArray *table_data, BIOSLinker *linker, Virt= MachineState *vms) build_append_int_noprefix(table_data, memmap[VIRT_GIC_ITS].bas= e, 8); build_append_int_noprefix(table_data, 0, 4); /* Reserved */ } - } else { + } + + if (!vms->its && !vms->no_gicv3_with_gicv2m) { const uint16_t spi_base =3D vms->irqmap[VIRT_GIC_V2M] + ARM_SPI_BA= SE; =20 /* 5.2.12.16 GIC MSI Frame Structure */ diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ef6be3660f..5951b331f3 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -953,6 +953,8 @@ static void create_gic(VirtMachineState *vms, MemoryReg= ion *mem) =20 if (vms->gic_version !=3D VIRT_GIC_VERSION_2 && vms->its) { create_its(vms); + } else if (vms->gic_version !=3D VIRT_GIC_VERSION_2 && !vms->no_gicv3_= with_gicv2m) { + create_v2m(vms); } else if (vms->gic_version =3D=3D VIRT_GIC_VERSION_2) { create_v2m(vms); } @@ -2402,6 +2404,8 @@ static void machvirt_init(MachineState *machine) vms->ns_el2_virt_timer_irq =3D ns_el2_virt_timer_present() && !vmc->no_ns_el2_virt_timer_irq; =20 + vms->no_gicv3_with_gicv2m =3D vmc->no_gicv3_with_gicv2m; + fdt_add_timer_nodes(vms); fdt_add_cpu_nodes(vms); =20 @@ -3410,6 +3414,7 @@ static void virt_instance_init(Object *obj) vms->its =3D true; /* Allow ITS emulation if the machine version supports it */ vms->tcg_its =3D !vmc->no_tcg_its; + vms->no_gicv3_with_gicv2m =3D false; =20 /* Default disallows iommu instantiation */ vms->iommu =3D VIRT_IOMMU_NONE; @@ -3462,8 +3467,11 @@ DEFINE_VIRT_MACHINE_AS_LATEST(10, 1) =20 static void virt_machine_10_0_options(MachineClass *mc) { + VirtMachineClass *vmc =3D VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); + virt_machine_10_1_options(mc); compat_props_add(mc->compat_props, hw_compat_10_0, hw_compat_10_0_len); + vmc->no_gicv3_with_gicv2m =3D true; } DEFINE_VIRT_MACHINE(10, 0) =20 diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 365a28b082..725ec18fd2 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -131,6 +131,7 @@ struct VirtMachineClass { bool no_cpu_topology; bool no_tcg_lpa2; bool no_ns_el2_virt_timer_irq; + bool no_gicv3_with_gicv2m; bool no_nested_smmu; }; =20 @@ -178,6 +179,7 @@ struct VirtMachineState { char *oem_id; char *oem_table_id; bool ns_el2_virt_timer_irq; + bool no_gicv3_with_gicv2m; CXLState cxl_devices_state; }; =20 --=20 2.39.5 (Apple Git-154)