From nobody Mon Apr 13 10:22:51 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=1772907632; cv=none; d=zohomail.com; s=zohoarc; b=XFbh8uslmHhd84sLZ8fQ/yaLmMfv5toJSTLCqWfe8dr0A3SrODv2v6bZX/Q4n7FGauwrv0M3l3ky5kuxVHmIGgVINlx9PC5L/aucFpAxrjaqix4grO2pGelXDR6s8l/1WnXAbZ5i5NYFv0RzBAiJzs4DkVV6BBLD49lLGvjkqJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772907632; 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=rK6/RxrpYBwJeZsqHscQwDSrvNy3tiDTtCWW5H3KBO4=; b=A0YI2JIxSFUhLC6o8NPYATibiaTDF9jlVwtKpkzko04ppczoLHkD5jvv2qupa76bYc6EwyM0Bislv8W67u+sjJI5dWY/IYYx9EGUe4+aNtiEt4v+B8GuymxEWJAoCk3mB0p2AEvAxx+xaYhmmSplnTCmvvKMQuwZQ2ptWNDSCaA= 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 177290763203933.140158590820874; Sat, 7 Mar 2026 10:20:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vywFj-0005Px-HL; Sat, 07 Mar 2026 13:19:53 -0500 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 1vywFR-0005N7-J7 for qemu-devel@nongnu.org; Sat, 07 Mar 2026 13:19:34 -0500 Received: from qs-2004l-snip4-11.eps.apple.com ([57.103.84.123] 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 1vywFI-0005Qd-E5 for qemu-devel@nongnu.org; Sat, 07 Mar 2026 13:19:27 -0500 Received: from outbound.qs.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-2d-100-percent-4 (Postfix) with ESMTPS id 4A23118000AE; Sat, 7 Mar 2026 18:19:15 +0000 (UTC) Received: from localhost.localdomain (unknown [17.57.155.37]) by p00-icloudmta-asmtp-us-east-2d-100-percent-4 (Postfix) with ESMTPSA id 09B181800096; Sat, 7 Mar 2026 18:19:12 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1772907558; x=1775499558; bh=rK6/RxrpYBwJeZsqHscQwDSrvNy3tiDTtCWW5H3KBO4=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=KXiTUoHfGnWyKb8f5fbYkeR7Ktw3irlhveCIRZ0BJQ0JjukpqjVjL7Pb40uQk+uEE5RAq19GcJ9RIk+nYishMFn31r/0F/lFC73YWkjlN3BLPBzkfxPjVDxg+VuokZjKzslI7vB/ByCprJRjyW+Tea/22ASB6k+6hjBHcZAKqrNI9WfVt15vH/ye41rkQrL+IK9LLbkmu/Zf6HNx/dgnJQHMPQMGwrgW0QAVUDSg1jGVKjlMRAZMg40dMqUuTYyqoh9fpJUXH6YIWVDKDbQB/l33qV5pAnQMCEROaOZOe6zBa/GMcca1T1ek1U1Aw9c2BYlNYg0/RIub29lTDJz96Q== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Wei Liu , Roman Bolshakov , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Zhao Liu , Peter Maydell , Mohamed Mediouni , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , qemu-arm@nongnu.org, Phil Dennis-Jordan , Pedro Barbuda Subject: [PATCH v6 8/9] whpx: arm64: enable enlightenments if asked for Date: Sat, 7 Mar 2026 19:18:55 +0100 Message-ID: <20260307181856.2209-9-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260307181856.2209-1-mohamed@unpredictable.fr> References: <20260307181856.2209-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzA3MDE3NCBTYWx0ZWRfX3OOkRlVOXY4s Qe3l1nTbfAQnmkVB/mFlsPcEpqMKrBB/011kDAtZqPR26N5ygpKfFuwUY7pK3r4NyS7wBWl7A6z m7OkoNVGTQqf5uHzGhRj5YyhlkEv7KnQ2BvjNySqOPF+MP3BAZ9iJF4HKx1+xpqLuVRSySdL/g/ fFjj1OvxFxE2tq0/e9WI/E8axyyaSLUrp3G5PcdHW4WvJJgxmEg54qi09hpigi0KCEHNf4DxLLP N4/MXsg0/Xr7o2EdYjbmnqcuy+0I/uRYDAq3JVl4FrnUtdo3BqlqhVLrme23M96QpmRav07+PMN 7sAQiGuK89/V2Sb8aaBk90FE+cKNeo7Wk88r/g8/aY1/zNws5u6BTa63MI56Pw= X-Proofpoint-GUID: kb4JzcWPMPmiO_iUXIvfjpV78X49HfB2 X-Authority-Info-Out: v=2.4 cv=EJcLElZC c=1 sm=1 tr=0 ts=69ac6c24 cx=c_apl:c_pps:t_out a=bsP7O+dXZ5uKcj+dsLqiMw==:117 a=bsP7O+dXZ5uKcj+dsLqiMw==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=rOdoSoqhRWX9tc6y9DEA:9 X-Proofpoint-ORIG-GUID: kb4JzcWPMPmiO_iUXIvfjpV78X49HfB2 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-07_06,2026-03-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 clxscore=1030 mlxlogscore=796 bulkscore=0 adultscore=0 lowpriorityscore=0 mlxscore=0 phishscore=0 suspectscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2603070174 X-JNJ: AAAAAAABHbi0kqZzPXPjghaZST9kY3NuY719gz5SE5Z3xTNA0RImqQgiq264A/KTDb7AevafLvQcyM4Cd25Riqt7sMayPw+ihgHUfCdulGq5OMcR6wgHl1auDWcwKtgJM3lca4EqHKB+0z+ESlmSJMAF5I8gN44OngZXhW3luTXPXYIjSGU8NpuOqRdJXlPwPAJ0L7/cqqc2nFUAkTfj/TJwUQzD/WCrnRdcHjLLFCBbFJcN/bKi1tCr7wRQJQZHEdtqvIl5FefNvjKmTRviVwIhNvZhAHxZOwXUiAULp9+V2iZLaaYjswo6IxM2RYmqvKxhLenS90Zy21H9L9/QOsar5xN10kKFmCpF26LMam1GNzFvHbvsOF8e5xAfUCENtdzwnOuYcfeW4Wlb8hI/Uqbg9k4TIAGfNHzTwcAzEjIGuSWLdrqi8QTDeTul/ARswvf5fxjw4KVmCHX0cuGpm0bgd003HffR8qSWT4/d6dxVd+Y4ulQl92hgNifGqPkJdBULVjcfU3AAUdIqKoDVca+U9kKBAiAI8kSUQhU8eKOd0W0c4CqgPOM/JZ0KPbwr40HEBU4rgmSYV79BJBoCRz5rC9/M4IV0h0bF7SeUl60nVBXYFTycdE2rcJPbX1fPkV9Zx7367A8up04WxmO/o8ciz0mHtMOXIhRNrTglu3lMhw6XIZgA0zUzoUomnyBopR2fuoe24HCrVurv5oH0djLent8owE5CBySvPZFioicMvafvyZAPjhaGS+55Bt0EOQqVKn/SGMnjmgXPo3KHuZQ25cms4FsXEZg= 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.84.123; envelope-from=mohamed@unpredictable.fr; helo=outbound.qs.icloud.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: 1772907633859158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mohamed Mediouni --- target/arm/whpx/whpx-all.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/target/arm/whpx/whpx-all.c b/target/arm/whpx/whpx-all.c index c5b108166a..513551bec1 100644 --- a/target/arm/whpx/whpx-all.c +++ b/target/arm/whpx/whpx-all.c @@ -940,6 +940,43 @@ int whpx_accel_init(AccelState *as, MachineState *ms) goto error; } =20 + /* Enable synthetic processor features */ + WHV_SYNTHETIC_PROCESSOR_FEATURES_BANKS synthetic_features; + memset(&synthetic_features, 0, sizeof(WHV_SYNTHETIC_PROCESSOR_FEATURES= _BANKS)); + synthetic_features.BanksCount =3D 1; + + synthetic_features.Bank0.HypervisorPresent =3D 1; + synthetic_features.Bank0.Hv1 =3D 1; + synthetic_features.Bank0.AccessVpRunTimeReg =3D 1; + synthetic_features.Bank0.AccessPartitionReferenceCounter =3D 1; + synthetic_features.Bank0.AccessPartitionReferenceTsc =3D 1; + synthetic_features.Bank0.AccessHypercallRegs =3D 1; + synthetic_features.Bank0.AccessVpIndex =3D 1; + synthetic_features.Bank0.AccessHypercallRegs =3D 1; + synthetic_features.Bank0.TbFlushHypercalls =3D 1; + synthetic_features.Bank0.AccessSynicRegs =3D 1; + synthetic_features.Bank0.AccessSyntheticTimerRegs =3D 1; + synthetic_features.Bank0.AccessIntrCtrlRegs =3D 1; + synthetic_features.Bank0.SyntheticClusterIpi =3D 1; + synthetic_features.Bank0.DirectSyntheticTimers =3D 1; + + /* + * On ARM64, have enlightenments off by default + * as they're not needed for performance. + */ + if (whpx->hyperv_enlightenments_required) { + hr =3D whp_dispatch.WHvSetPartitionProperty( + whpx->partition, + WHvPartitionPropertyCodeSyntheticProcessorFeaturesBanks, + &synthetic_features, + sizeof(WHV_SYNTHETIC_PROCESSOR_FEATURES_BANKS)); + if (FAILED(hr)) { + error_report("WHPX: Failed to set synthetic features, hr=3D%08= lx", hr); + ret =3D -EINVAL; + goto error; + } + } + hr =3D whp_dispatch.WHvSetupPartition(whpx->partition); if (FAILED(hr)) { error_report("WHPX: Failed to setup partition, hr=3D%08lx", hr); --=20 2.50.1 (Apple Git-155)