From nobody Mon Mar 2 10:47:11 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=1772219247; cv=none; d=zohomail.com; s=zohoarc; b=a8u1yw/B6sIBRcGwYEeeFNrkysC81z3n7I1S6rcPx6hW0y4LwqKKvfb5IaO0D+r6+Qgh0q0Zc/O2AixDKxZGmTftEfQ8r2bhA0o6cQW/9JNeJk1muHZyjpN0h0a5A0hXGy0dq1bWxBgeLQj8FZPVlMXIgxj2YI6M37PgyWMwA8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772219247; 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=LjzGrhEn0ykJAOrChlujow4EMgIqhCxyPavUws3eZDg=; b=Dd8Nz8Ow/d09CMdK+mewctSo1RkXmHay6zNrHVLSkZv21WcKF3u9C/YCf12K2lWa6YhQo7YBqsAvFT+4GURSHxheCbCcOMhAbmrN6FKi5+TLsUYPi4a8D/zz9YN5yBHoOAXE5ryFavGTKOXRutpTIBXODdkkLq/iJtr82lFQXIA= 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 1772219247375172.57003935079194; Fri, 27 Feb 2026 11:07:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vw3Ah-0003G4-54; Fri, 27 Feb 2026 14:06:43 -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 1vw3AY-0003Es-Oe for qemu-devel@nongnu.org; Fri, 27 Feb 2026 14:06:35 -0500 Received: from p-west2-cluster3-host6-snip4-4.eps.apple.com ([57.103.69.97] helo=outbound.mr.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vw3AW-0006RE-8Y for qemu-devel@nongnu.org; Fri, 27 Feb 2026 14:06:34 -0500 Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-2a-100-percent-0 (Postfix) with ESMTPS id 768E51800155; Fri, 27 Feb 2026 19:06:27 +0000 (UTC) Received: from localhost.localdomain (unknown [17.57.152.38]) by p00-icloudmta-asmtp-us-west-2a-100-percent-0 (Postfix) with ESMTPSA id 1E53818001B0; Fri, 27 Feb 2026 19:06:25 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; t=1772219188; x=1774811188; bh=LjzGrhEn0ykJAOrChlujow4EMgIqhCxyPavUws3eZDg=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=f4fW1R68Yt+08jCkuj2LELOVbDapZWkwDw2sAhhxgUJh9+AlEyVUm5jrNSvDeZhEue5JsuWjLbxE5nPn8PJyQShF0ghN9NJiJJJ3J7O1sfPbs/jfkjlczCUJ02erJd7/tAr0Tb7QDomt7MKGz12LHBHOZIqb7dzu/KMVdLqpthYRWgOuJvaIGEcBoKHo41UQtdh3/O2bwnmhbBODYMCHfpf6WqwHeNqEXfgpbepxjWnEo+VgntJLZopsmUB79x+zNfayOAe1aql6u19V0ReVhh+N7Ah2XzkeAFn3ZVCu4NgtiP6FE7+enBUkHpmGcNlZeTJbnUB2B5VMpAxCILIURA== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Mohamed Mediouni , Pedro Barbuda Subject: [PATCH 3/4] whpx: i386: enable synthetic processor features Date: Fri, 27 Feb 2026 20:06:18 +0100 Message-ID: <20260227190619.8867-4-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260227190619.8867-1-mohamed@unpredictable.fr> References: <20260227190619.8867-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: K0CYA5vu2nTuqjOGsJNdEAifx3tsW4qq X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjI3MDE2OCBTYWx0ZWRfX46fsds8AoWCe LTh1P7aSMUxUqkWqcyJrrrUSMYB4EXcpwxidmbxICUyToma2tnYWP5uQVv7MaJrTSJXvHgAYIwo Rl5v8SA2EdlNrirEeTke4lpBxXi8FtsLmbwTCYbTFFO0xEeEdnvc3NH3uGoBquNYucGB6otnrmo cGglka2yMYy7hjQLWNIX+sXAXgKU+nynbt7GrufZt3qP8HuzqoAegbL9rSmgExhTGW9SxqMnWbb SF+fZHfLUdIU+6uEEbPl2vThb1CI3XOMnd+Q9toWpFNv6QemHwvPZT08dozJymhQoES6GQggM0E 8QfqAs7leA1fzfNyPTmAm7GhXzti8MV5HU0xAlHGZzxwEwnoIaFyQ5W6phUuyY= X-Proofpoint-ORIG-GUID: K0CYA5vu2nTuqjOGsJNdEAifx3tsW4qq X-Authority-Info-Out: v=2.4 cv=N9Uk1m9B c=1 sm=1 tr=0 ts=69a1eb33 cx=c_apl:c_apl_out:c_pps a=9OgfyREA4BUYbbCgc0Y0oA==:117 a=9OgfyREA4BUYbbCgc0Y0oA==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=zrTx395S4Ej948ve6SYA:9 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-02-27_03,2026-02-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 clxscore=1030 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 suspectscore=0 mlxlogscore=852 lowpriorityscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602270168 X-JNJ: AAAAAAAB8iFCAEPAbKZgLVEkUVVYiZqkYMGYQrq4sHTiZ2Fdhu6LYC57GujvsOcy54dtRp1EaL3A8nsTGofdpt1tI4iyKIl6ktA3v9iY/UpkGCcjRz+zlwrGei232iHXvASwiW4rKU7D0obvMi09FoHjLYMuZHf/EnmPu7XWbE3C6mElEkWWhc2jrPtfV2ua8VIH/DnalwyIYwoxuVGNEqgg7+Kmy5+Yk6LKuJYBlo7TKcFYTuGY0yf0oSpc/bcLU8OndyVK9s3FXa2PMaEWSM0iLPMqdj3zS4g51Ybb5AQWSllFuN2VIRwAbZQeEqm7iq4Cnl/FBKbp4iUfKe0tus1IGScgrfsXtrWql7Vz23pze/URxWAq17OCqBNL02dFU+qcpcn5Nf3NSR/SIiWrjpud74TPlX11hvIJCKdZP+6FJ4uAAAJhdsG3gFolXHgMPwXirbE7RAvXiN4ONjKoNVCKFR6Rh0l+NbsTHSyZhHRxNrJfLkhhsEPumaE2j8K+mH8m/HoD0Ic5Nw+aA3AXgjs7ZbrwaAd2JJ8NCT/46/zAr8f1Rr4K216Ve3EGT+1e7RILadb0LjwyW2aBDuHBd5J/cmcMEFgLGDWQ0mI= 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.69.97; envelope-from=mohamed@unpredictable.fr; helo=outbound.mr.icloud.com X-Spam_score_int: -9 X-Spam_score: -1.0 X-Spam_bar: - X-Spam_report: (-1.0 / 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.706, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.401, 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: 1772219248080158500 Content-Type: text/plain; charset="utf-8" At the point in time in which we setup the partition, the vCPUs aren't available yet. So enable them by default for now like what the MSHV backend does. AccessFrequencyRegs is shared for both the LAPIC frequency reporting and th= e TSC frequency. To still benefit from the fixed TSC frequency reporting when kernel-irqchip= =3Doff, still enable AccessFrequencyRegs anyway. Signed-off-by: Mohamed Mediouni --- target/i386/whpx/whpx-all.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index ccc52d1f96..e7e0a50da6 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -2152,6 +2152,40 @@ 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.AccessPartitionReferenceCounter =3D 1; + synthetic_features.Bank0.AccessPartitionReferenceTsc =3D 1; + /* if kernel-irqchip=3Doff, HV_X64_MSR_APIC_FREQUENCY =3D 0. */ + synthetic_features.Bank0.AccessFrequencyRegs =3D 1; + synthetic_features.Bank0.AccessVpIndex =3D 1; + synthetic_features.Bank0.AccessHypercallRegs =3D 1; + synthetic_features.Bank0.TbFlushHypercalls =3D 1; + + if (whpx_irqchip_in_kernel()) { + 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; + } + + 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%08lx",= hr); + ret =3D -EINVAL; + goto error; + } + /* Register for MSR and CPUID exits */ memset(&prop, 0, sizeof(WHV_PARTITION_PROPERTY)); prop.ExtendedVmExits.X64MsrExit =3D 1; --=20 2.50.1 (Apple Git-155)