From nobody Sat Nov 15 11:14:11 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=1753433818; cv=none; d=zohomail.com; s=zohoarc; b=IIBwl4yGqzAY5/gepCn/4UCopYB0F4BSNphMnZ4aG3vXif/n6Yik7ogqceT+zt1xAfgc8J0onZNaDPbiXbQzHy1GUkE/YChBP9lE0x/5+1nIVoud7siC8Soir5ZcAiNcBZ9bgc7fvxuU7X1SJOe26Z/RtmTCLWe/BcChQFVM3RY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753433818; 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=DekRPyqD95GZgQR0lU+JTQs/LwEyYeukO06spM11U3Q=; b=RTFVeuKifWek4CxHOeDMaQzGtqVe4bsYvSUWGgB5PWV1r78JC2f8vizButtEXAe+N1hlTdCW/Q6kBSzNbitWoWnHi5YZ5/OjTCpYKre3DTyjItesJldCxzdb6CnnFVljTNPwnJEwuXI0GHdMYYVWSVo48GylM2mBbVo9X2Xvmck= 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 1753433818242937.3746386894608; Fri, 25 Jul 2025 01:56:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ufEDr-0007d4-U4; Fri, 25 Jul 2025 04:56:11 -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 1ufEDp-0007Yf-LK for qemu-devel@nongnu.org; Fri, 25 Jul 2025 04:56:09 -0400 Received: from p-west3-cluster2-host4-snip4-10.eps.apple.com ([57.103.74.83] helo=outbound.ms.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ufEDn-0001u8-OL for qemu-devel@nongnu.org; Fri, 25 Jul 2025 04:56:09 -0400 Received: from outbound.ms.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-3a-20-percent-0 (Postfix) with ESMTPS id A5C11180021B; Fri, 25 Jul 2025 08:56:00 +0000 (UTC) Received: from localhost.localdomain (ms-asmtp-me-k8s.p00.prod.me.com [17.57.154.37]) by p00-icloudmta-asmtp-us-west-3a-20-percent-0 (Postfix) with ESMTPSA id 7B9311800094; Fri, 25 Jul 2025 08:55:57 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; bh=DekRPyqD95GZgQR0lU+JTQs/LwEyYeukO06spM11U3Q=; h=From:To:Subject:Date:Message-Id:MIME-Version:x-icloud-hme; b=Thln2EomONlKzHqNB+G2GRJQPfuddeDNrcgE4LcU1mKm0X6sek9P+IkaaMoO9fabpggM+kYTwvUg76XtXnhrfaC5+GXIfOE9jZv46QpSEO2GOMp4VRBa8clTOmcWrIxwhILB8cMqgmNEzr36thnyMPpbtdwhIBV1GZUSCzHYTV7A3bDUg2Q8WBWcVFzocCJlmOPWQ15Z5apvlW87d5nwWyMQ2T8gdNof0qcBWa/0GAVwxyoC34zF9e9KzM3DZr8lnFYT+pXrHKQrFLZABS0gCZAC61jSHGqcaUY+gtUxhHsbksRTLbPu4pLwKkxMAK21JKdfrc7E+bx1zvfPdMA+9A== X-Client-IP: 46.189.47.18 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mads Ynddal , qemu-arm@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , Ani Sinha , Igor Mammedov , Cameron Esfahani , Phil Dennis-Jordan , Peter Maydell , Alexander Graf , Shannon Zhao , Roman Bolshakov , Mohamed Mediouni Subject: [PATCH v2 3/9] target/arm: hvf: instantiate GIC early Date: Fri, 25 Jul 2025 10:55:39 +0200 Message-Id: <20250725085545.93619-4-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250725085545.93619-1-mohamed@unpredictable.fr> References: <20250725085545.93619-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: uQqfgiQS5rkAUghiTINqXPCd_W7IXyu4 X-Proofpoint-ORIG-GUID: uQqfgiQS5rkAUghiTINqXPCd_W7IXyu4 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzI1MDA3NSBTYWx0ZWRfX4uky9Uno6ecS IJZoEpAMfKDpQyRyUz2Md8B6eMVzbU1wglWGEqJLdiF6DoIQamOYAgYo7CK5lNJKOXYFjhUAuAf NUCaI9TV70rEkLt4Ii1Kv76v+fx4b7wKQ4i+ZwcvfkSLrPG7FV6jRByqFKv/4jabWOWWXXOK+0f Dn3zEZqLo5M6JCir5WqNdajyo3TUiqTV3iE7fMW2rMJxCLaDY+qRAbGyPviYf45uJlOgAISK9xS AAxAlXMyF7zquCyR4DnpLLO03j0tdlSaNscieBqCDCsKY8h+WlMMdKUzPcb3j++9xyAlmZGbk= 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-07-25_02,2025-07-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 spamscore=0 mlxlogscore=616 malwarescore=0 phishscore=0 bulkscore=0 mlxscore=0 clxscore=1030 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506270000 definitions=main-2507250075 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.74.83; envelope-from=mohamed@unpredictable.fr; helo=outbound.ms.icloud.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: 1753433819475116600 Content-Type: text/plain; charset="utf-8" While figuring out a better spot for it, put it in hv_arch_vm_create(). Signed-off-by: Mohamed Mediouni --- target/arm/hvf/hvf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index edfd29de75..bb31df90b8 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1001,6 +1001,21 @@ hv_return_t hvf_arch_vm_create(MachineState *ms, uin= t32_t pa_range) chosen_ipa_bit_size =3D pa_range; =20 ret =3D hv_vm_create(config); + if (hvf_irqchip_in_kernel()) { + /* + * Instantiate GIC. + * This must be done prior to the creation of any vCPU + * but past hv_vm_create() + */ + hv_gic_config_t cfg =3D hv_gic_config_create(); + hv_gic_config_set_distributor_base(cfg, 0x08000000); + hv_gic_config_set_redistributor_base(cfg, 0x080A0000); + hv_return_t err =3D hv_gic_create(cfg); + if (err !=3D HV_SUCCESS) { + error_report("error creating platform VGIC"); + goto cleanup; + } + } =20 cleanup: os_release(config); --=20 2.39.5 (Apple Git-154)