From nobody Tue Apr 7 05:45:10 2026 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=1773666794; cv=none; d=zohomail.com; s=zohoarc; b=lWy67EqlPCi6azWmlbkBZYGSNvkrTjOwCgo8wRkEVfBmPVjS5MIWamtriGq7PcLdIYw6IAq9C8W7bHXGte4z3G8GJ9yZn5EtUfb0gLbN4nLHo7xN+GbtTH1Bv/IrAGvSAyaGI01xlUZUcR4UAjDCdFNXdHHYxkwzPFXrPqlw5fc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773666794; h=Content-Type: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=Fo1o/cu6r3sIIJlTVFeCxPWsi9b9dqXO1uur361++0o=; b=Cq7yl1NWRhURwScEoFZLToRUrOPofbmd3Hjwx44hep69MpnaJxqZ3kCC2jQFYB5CdLfp4WjTbMNb9YB746bOUVYYIsJpubN3l5Oi8J3I7DKakmjNM9Y4wMbFRp73/NmxL8fQk8PDhLOq8q/4+alqjecqiM9/aL4TK8RscZ5PCeM= 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 1773666794806608.2841274602979; Mon, 16 Mar 2026 06:13:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w27fh-0000zR-9O; Mon, 16 Mar 2026 09:07:49 -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 1w27fe-0000xj-T3 for qemu-devel@nongnu.org; Mon, 16 Mar 2026 09:07:46 -0400 Received: from p-west1-cluster5-host10-snip4-8.eps.apple.com ([57.103.66.209] helo=outbound.pv.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w27fd-0003ex-5z for qemu-devel@nongnu.org; Mon, 16 Mar 2026 09:07:46 -0400 Received: from outbound.pv.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-1a-100-percent-3 (Postfix) with ESMTPS id D7D6A1800356; Mon, 16 Mar 2026 13:07:42 +0000 (UTC) Received: from localhost.localdomain (unknown [17.56.9.36]) by p00-icloudmta-asmtp-us-west-1a-100-percent-3 (Postfix) with ESMTPSA id 106DD1803655; Mon, 16 Mar 2026 13:07:19 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1773666463; x=1776258463; bh=Fo1o/cu6r3sIIJlTVFeCxPWsi9b9dqXO1uur361++0o=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:x-icloud-hme; b=LKRJZen0/evik70Pr5PnLOhKHBaPtTye3cmPj0UKbtTPwpelX/6twz92jTkMJVXeMRmltRg9HxEm7Sqao1dvmnoWqFtoMOjcRLXizVRYuKQb/EpyPnnmL5re/L853wBLfhE/7Pom7lB16h5V87A0QBexX5JuWQ0ZTx2brALQJ+4Dj81G5Eb8FX4fwF7Gg2KiSQqbf4/1ss4K4TTFZJtzvb2uHzqliT2sbe1QAGgggc/uhrJaysMJ3bj9FJC5r2jq2INj+bjaAYtKbO9Q5HF7HpucTMk1Ydxs54VPMXYUapB/O6730zqeJbXk7VNntK7siWo8ez3bzvtYzHkUtB3l3Q== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Yanan Wang , Zhao Liu , qemu-arm@nongnu.org, Peter Maydell , Roman Bolshakov , Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Eduardo Habkost , Phil Dennis-Jordan , Mohamed Mediouni Subject: [PATCH v20 12/15] hvf: arm: disable SME when nested virt is active Date: Mon, 16 Mar 2026 14:06:39 +0100 Message-ID: <20260316130642.13246-13-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260316130642.13246-1-mohamed@unpredictable.fr> References: <20260316130642.13246-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: d_uOSsh85yQ1Dv4wNvwjLXH5jidNl5Sx X-Authority-Info-Out: v=2.4 cv=B620EetM c=1 sm=1 tr=0 ts=69b8009f cx=c_apl:c_pps:t_out a=azHRBMxVc17uSn+fyuI/eg==:117 a=azHRBMxVc17uSn+fyuI/eg==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=KKAkSRfTAAAA:8 a=x7Faj_LQiP2RIwM6i0UA:9 a=NqO74GWdXPXpGKcKHaDJD/ajO6k=:19 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzE2MDA5NyBTYWx0ZWRfX9SnJUhrPrFpC 69PSq+PwjKorRTa7CPn8FzzUWkeDQflrGdLl3hbWk9sE9v5u1UMA/7Ac/BHW5Thkia2qArxlT/d 3YnzssRQo3/NOhoVqLT2Vz0lxNq1mI73fY50zP1p3Pyb5ykZ6DT33Zuw8AEwMgxG8GRFjc7YioT w4bIIbzSZT+3u0fL5vJQUp9ym9lBSeGuJNSRC20u21kdWUm92URR4tCWgCW9+LVtUHgvt9SpIvD 5UzvVQaAT7qfmNILOI7uPrnQmcr53xNNj1bRcLMEGrsYLx2snJxiKfsr9bU+DNqsc4e22dn8I7t Q+/r3B8CQGBB01worfbwur0NzdnDZTQVmPxlVgsqoRmQpY2l329pbbNR/mcICo= X-Proofpoint-ORIG-GUID: d_uOSsh85yQ1Dv4wNvwjLXH5jidNl5Sx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-16_04,2026-03-16_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=907 phishscore=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 clxscore=1030 bulkscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2603160097 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.66.209; envelope-from=mohamed@unpredictable.fr; helo=outbound.pv.icloud.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 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_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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: 1773666796613154100 Currently, Apple doesn't support the nested virtualisation + SME combinatio= n. Signed-off-by: Mohamed Mediouni Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/hvf/hvf.c | 5 +++++ target/arm/hvf_arm.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index dc9d3a24ce..88d4732fbf 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1206,6 +1206,11 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPU= Features *ahcf) FIELD_DP64_IDREG(&host_isar, ID_AA64DFR0, PMUVER, 0x1); } =20 + if (hvf_nested_virt_enabled()) { + /* SME is not implemented with nested virt on the Apple side */ + FIELD_DP64_IDREG(&host_isar, ID_AA64PFR1, SME, 0); + } + ahcf->isar =3D host_isar; =20 /* diff --git a/target/arm/hvf_arm.h b/target/arm/hvf_arm.h index 8029d48caf..59e19f6e84 100644 --- a/target/arm/hvf_arm.h +++ b/target/arm/hvf_arm.h @@ -11,6 +11,7 @@ #ifndef QEMU_HVF_ARM_H #define QEMU_HVF_ARM_H =20 +#include "system/hvf.h" #include "target/arm/cpu-qom.h" =20 /** @@ -35,6 +36,10 @@ void hvf_arm_set_cpu_features_from_host(ARMCPU *cpu); if (__builtin_available(macOS 15.2, *)) { size_t svl_bytes; hv_return_t result =3D hv_sme_config_get_max_svl_bytes(&svl_by= tes); + /* Nested virt not supported together with SME right now. */ + if (hvf_nested_virt_enabled()) { + return false; + } if (result =3D=3D HV_UNSUPPORTED) { return false; } --=20 2.50.1 (Apple Git-155)