From nobody Sun Apr 12 00:55:16 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=1772538248; cv=none; d=zohomail.com; s=zohoarc; b=KgPN6kefzI8K7oxa16A66elV8vLMg95J6miR6Nz98YU37zdlcsU5kdng7bkeCVzNi4/jlBk7r4yEJD9aGqKliViIC6S1Ao7ha+wuvGTRDZcAW2XK3HjMi1J+SrUtovX/tSBubkn39CCTbH0guyrmhrRWzk8SaSXqE0HBGd+n/l0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772538248; 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=OW8S3KLD8zFsAuvhuwhxPEOWPDp1M7oc2dpZI+SomHI=; b=WbU7BCLgU/TqWV9mw7c98jeGM/Ev0t4i/wuix4zV4tgo1vjhkOxamwhQ2ejJ6dxu9yQXOfZUP+zJSlgm+KPnz4nU1cEbZXedzE0LsN3LRee5mgz5Ry7UBebAjppdyHSZkktvWlS7bhQdSVbT4cwj+7rPLTNrrAFZQSx3HYkc6Lk= 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 1772538248126732.3653362548872; Tue, 3 Mar 2026 03:44:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vxO8d-000586-DM; Tue, 03 Mar 2026 06:42:07 -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 1vxO8T-000511-57 for qemu-devel@nongnu.org; Tue, 03 Mar 2026 06:41:58 -0500 Received: from p-west1-cluster6-host12-snip4-7.eps.apple.com ([57.103.67.20] 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 1vxO8R-0001Zu-GL for qemu-devel@nongnu.org; Tue, 03 Mar 2026 06:41:56 -0500 Received: from outbound.pv.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-1a-20-percent-3 (Postfix) with ESMTPS id F3CA01800394; Tue, 3 Mar 2026 11:41:51 +0000 (UTC) Received: from localhost.localdomain (unknown [17.56.9.36]) by p00-icloudmta-asmtp-us-west-1a-20-percent-3 (Postfix) with ESMTPSA id 9689E18001A4; Tue, 3 Mar 2026 11:41:49 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1772538113; x=1775130113; bh=OW8S3KLD8zFsAuvhuwhxPEOWPDp1M7oc2dpZI+SomHI=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=dZukHbEl/NKiaddu2CmgMLKZT320rwPc5aUuyiN6gvX0kSjF5bY7hZysTNX3Tya364Imx2XGzLS2G6meT2ggZQKjhx+3sEIp/nZwYZCFWDwUv5YWZ1TbbAgV3b3JoFuPEWU3cmWUFY2BvCd6GRvRcwcI1fBJLCFE+Qj2mp9b4RRQZZVglAOstXXKmFG6CmCxg/7EpZQ/feXR3A/BWwksi0EB7zw/21ux56AzDaYUJf59C2evDDeocsZ60tYTR+58vUT5B/4OkCCOZnvTng+qbDqfG/FIIY6Lxvng+t5r2PfDauCEIzdUfBzMRKkYoPDt7X1BmHnoRjcVt2ypVJfYow== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Pedro Barbuda , qemu-arm@nongnu.org, Wei Liu , Phil Dennis-Jordan , Roman Bolshakov , Cameron Esfahani , Peter Maydell Subject: [PATCH v2 5/6] whpx: arm64: enable enlightenments if asked for Date: Tue, 3 Mar 2026 12:41:34 +0100 Message-ID: <20260303114135.15390-6-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260303114135.15390-1-mohamed@unpredictable.fr> References: <20260303114135.15390-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: sR0TYWbTkNr5mkpU_bIqLVMMw57vtP6T X-Authority-Info-Out: v=2.4 cv=cbXfb3DM c=1 sm=1 tr=0 ts=69a6c900 cx=c_apl:c_pps:t_out a=azHRBMxVc17uSn+fyuI/eg==:117 a=azHRBMxVc17uSn+fyuI/eg==:17 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=rOdoSoqhRWX9tc6y9DEA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzAzMDA5MSBTYWx0ZWRfXxbv1S8RniUI3 vA4mVG1WZGmIR3eHCxwra9fN9hQPzTa9VNogtAv4pe/ZveD8xch9Jj03CIzMW7Kb4rs2CsXuzWg hUnjCK2ni6baS7+10j+kdE07Dlq8lvXfA0CVl2FlLRbbgFezrw+Do830Y+mUSm1If5xVMlbAKLL djqfPHwfLErHZwoyL+V7n++lmRMrmYEcUPTwqychc3rdKwRe/goN8lRfEgMxUX1e3U13J+h85n1 vCGtB2huxxvkNU4hG8pnYXtMbnjAV2Y1fO5amtL2iXh8XklhqK1NCZCQY4M+IlOFsmG7FGsHmKE s87/qQQr2WUtYDJLACBsx8giyiLfRIO5v7p9S7Uu0FcY5lBgog9Oloxo1fN92w= X-Proofpoint-GUID: sR0TYWbTkNr5mkpU_bIqLVMMw57vtP6T X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-02_05,2026-03-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0 mlxlogscore=685 mlxscore=0 clxscore=1030 phishscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2603030091 X-JNJ: AAAAAAABkacgR1d09a4ToUGSnuHbZs1Qu6KEk87AEaAikjGWvbs/AJag9stJKunSNKoiDQOQbKbJQYQMnZKZUQT2pQFE7SJQe6v5cJ9lj3XVIZHXuhXWWmJEyWXgU3dXR9m/bhsVreVOMNcVTqTfocQjkd52AB+NGfsGOz1ZS+i/YchR9MCAtuR7sOkRdhC/RvIzh6+GLPeruF/VuSug2sOJb9vYB53ejBDcCUuxw8dJnbdFqFIYJAWF7qA1TesNHQZk0iMXJaeB2PNsqzQ1oQor26iRZL4uqThPfegJTHuzO46g5TTguATNJQgHAFTWya7UR1mrQQ3YwMlTkrR97VRmFokiS1ZyTppuR7U1O4zbFHPEt1x6a4wNmBDR6/w1LoCDNakJrPGtkvUkgS0Z/n+44LzvJzpN/Gro2+gb8uMgPLeIu5iAKeek9E31KRqfI9taJ/ZqliuhOmRrX+pO/f3M+YTJZTHY8lccfsOWBtSh/bVMfG/bCHarIdPozXQsdWUZOQgyfPYtRoy+zED8nDvgaK1FUVs1TJJHMmUMB6IYWUyyTL20Fpi3J+M8C4NCDUlDfRC1qAsuxFwY18OXFQWOIakg9ruu1Q5bvqbdGvlG9OYerAGmzw1qRXOd+BCLZAGWly3Lswi2XEM5q0thnUa5EaB9Cio4hcjB8NHxwtd2LUFokTYbHQr5JyVUstI0Von2XQPBWJFVE8ua1wvo4KMYM8Tr 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.67.20; envelope-from=mohamed@unpredictable.fr; helo=outbound.pv.icloud.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 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.968, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.495, 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: 1772538249870139100 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 bb94eac7bf..9983d59a38 100644 --- a/target/arm/whpx/whpx-all.c +++ b/target/arm/whpx/whpx-all.c @@ -947,6 +947,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=20 + * 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)