From nobody Thu Jan 8 13:13:19 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=1766966341; cv=none; d=zohomail.com; s=zohoarc; b=P9zpAjGnrIUt0TnKsrzsldTWz6c2AkWuOfx+7IluU4mMtW2XwYfibgnTxzcymYJmJ0ST/j2RI5mBQg00hJ4Blji+63TyDJgQ/DijUqY7UZ/DnS67zo9OovbNNDs0QgGVXmZ7LEcIliatOOerFWmSnPDgw5zt+WSSXzGFKMXckqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1766966341; 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=L7mT2nD+Ba0e7wIL0PqN3n0dkcKAmO0tlq8DUQcg4f8=; b=M3TUS4c3I/GiICOqBahnXOzxHwXW21KF0MKExwr5v5ik+d1fJnVQgIE0jW3q65QiC4j4NHDH6avxlfG+ebnlWGCPCkPNRxjHLknJswib0YJkTqNPm+4RAOPg1W332X5RlBFgQ2z7SRYNEJ6RxKHzhDpmayvmvu/ZzwCO/ZuGGZw= 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 1766966341206869.4655430337112; Sun, 28 Dec 2025 15:59:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1va0ek-0002p4-NL; Sun, 28 Dec 2025 18:58:39 -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 1va0ea-0002c3-RR for qemu-devel@nongnu.org; Sun, 28 Dec 2025 18:58:30 -0500 Received: from p-west1-cluster3-host1-snip4-6.eps.apple.com ([57.103.66.119] 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 1va0eZ-0007U6-5P for qemu-devel@nongnu.org; Sun, 28 Dec 2025 18:58:28 -0500 Received: from outbound.pv.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-west-1a-60-percent-5 (Postfix) with ESMTPS id 22ED91800754; Sun, 28 Dec 2025 23:58:23 +0000 (UTC) Received: from localhost.localdomain (unknown [17.56.9.36]) by p00-icloudmta-asmtp-us-west-1a-60-percent-5 (Postfix) with ESMTPSA id 2A9A11800756; Sun, 28 Dec 2025 23:58:18 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; bh=L7mT2nD+Ba0e7wIL0PqN3n0dkcKAmO0tlq8DUQcg4f8=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=GTQ8V6ndVUzUrSiGyLws8UAnMMl58UJC+Ze8/aSifDruSX84u49YTwlCWQ8r9MsUr+kmDHE3RXGhvBaW5PNtr1If/W2KMm5WdpCoJAa9HTx4CkAHubNxgRlofP80724yBKeeWxuyAxypwXgFGot5OoecuEsVLbUOnDIdcbekOr0GqCkUqnWbDYAPrXxRHkI2CExiOeQq1GK/430V6JaaBEH8SiQtxj2Uv/JuO1U84txsrnHqdAnzcJLHCgC9Y9tZfKOI0SYW7212O6A//4HK8iieGWakg+n6r93dmJ8i/bLDIIyIfV3iSiMse40K9Waq4VUdkTtDbp1SvYwOoVSwyg== mail-alias-created-date: 1752046281608 From: Mohamed Mediouni To: qemu-devel@nongnu.org, mohamed@unpredictable.fr Cc: Alexander Graf , Marcel Apfelbaum , Shannon Zhao , Eduardo Habkost , Phil Dennis-Jordan , Zhao Liu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , kvm@vger.kernel.org, Roman Bolshakov , Pedro Barbuda , qemu-arm@nongnu.org, Akihiko Odaki , Yanan Wang , Peter Xu , Igor Mammedov , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , "Michael S. Tsirkin" , Mads Ynddal , Cameron Esfahani Subject: [PATCH v12 27/28] whpx: arm64: add partition-wide reset on the reboot path Date: Mon, 29 Dec 2025 00:54:21 +0100 Message-ID: <20251228235422.30383-28-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251228235422.30383-1-mohamed@unpredictable.fr> References: <20251228235422.30383-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: KPGogu3uV69M0IsFu5oeu1r1YuBd0nfe X-Authority-Info: v=2.4 cv=CtOys34D c=1 sm=1 tr=0 ts=6951c420 cx=c_apl:c_pps a=azHRBMxVc17uSn+fyuI/eg==:117 a=azHRBMxVc17uSn+fyuI/eg==:17 a=wP3pNCr1ah4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=h5GvOLqLgfJ3vAEETv4A:9 a=NqO74GWdXPXpGKcKHaDJD/ajO6k=:19 X-Proofpoint-GUID: KPGogu3uV69M0IsFu5oeu1r1YuBd0nfe X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjI4MDIyMyBTYWx0ZWRfX9m0KKcefk9NP E+ec3UdtAYe8dx20IV2y+aQmpLPrfgqKeR0pm5jvIBTKUYk3qexQ8jh6ICBa9YXr5tRh++xtmb0 y37Ppv8YCHmW1Xm+VfQM9rf/bfRSmTAHRD+KUeW91sEwGK3FSUUIWIPVzSaZykiXF0s8t2Cfywy ItUnrwlFVBoZO6CQt3EXrlmeBDxRMYbnFcK3FvyO2Tl2DR2xugA+1VDg9J4AAOE7rS+HTWpOonE ZRppL95gVLhGuR14ENIIuVNbRc3C0BS/rvzoVFSVTgbmV9bhXmVGCQLda7e13i6M2ZB6ZJC8AiO sjarmlwJ4qjG30Xq+Cv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-28_07,2025-12-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxscore=0 mlxlogscore=883 clxscore=1030 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512280223 X-JNJ: AAAAAAABYC9Pt62b4I1ZKDRcZql1avM8R/AM7rMiTQRLB2KPV3Db7n/ZDmAlB78DDj8xUTUANSMBNi/RvyqwZmokoM3Z8vqjN5mFOwZPo64tFN6EzAZDImPS/VAE9VnqsMtwUPil+K3lwK4Uxz6uCBaUNhH7Yym4DyigERoPcZx16gmbn6QlyVS7AnNKfVt6AP7sbWW7xfXb/VmfA2PaxtA3LGErjBMZYchZO3iEhblJ9CPi+o+DJCFZFzs4M3i2e5ANbVTSBskXZX/rDzyuey30JiV8hH1dAMgKSnhDtLZ9lkwClQJNIhSwlF0/Un9BJxIQ+Rc5KDP0Nt6+FPzUe47rsiSV2mE8GqOr/7eOg11t1SB3x1WCzw9YdK3uOS1yBV0aWm0mRRwC7jlQ6q3vpuJU8cpIYENopGEinl7kW5CJz6wh/VaatnZwoj9jl6RHOv2xvSJItnhpF4iERFlO01jqtQ08bowLxefco7nxi0CVV8Ci9BjXSXVGHHhe9elUuMQSDdUgLuQWkSfXlc/jcEiWNlnxR17QW0UYaxxvAG3qAxYEtNcXvFjXcohRQ/YPsMoQQ+f7x8xIL9YZJsLO6vdBUDZDQ5di+nzqo4CBcfSFzVbfw9KkeYWi5y1cYv6jIgOZ96FH5TB7lPN/h94u7ik9G5z1RXZMSoBNW5eJOphqBLvt2AEnbULdWsTlvqI3jYWov6bkId8G3HaFMJ++JKGf4VQeHgroP47CNkchPk4Xd/qjkEO+0C/Uv9DcBODhyrtLyxVhtumASgWRIHlU5BRXl6YER+6OsuKK8jhPX5Eq7067X+1SK0b24yMuhs7K2RFbccY7UDSHLeUcdMDzZ4Y0/HI2Io+A11L7IPV6NxpY2TC5kI4FQhItkunJTW6TkjEMPMhsKYjoX1PEXlgmuBv2lIU2gkEWZuw9T9EIlfQjtmPD58mklT09EzRiEdt34cw/COJ1 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 (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.119; envelope-from=mohamed@unpredictable.fr; helo=outbound.pv.icloud.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable 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: 1766966341666158500 Content-Type: text/plain; charset="utf-8" This resets non-architectural state to allow for reboots to succeed. Signed-off-by: Mohamed Mediouni Reviewed-by: Pierrick Bouvier --- include/system/whpx-internal.h | 2 ++ target/arm/whpx/whpx-all.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/system/whpx-internal.h b/include/system/whpx-internal.h index 9e872e5f56..802fa87765 100644 --- a/include/system/whpx-internal.h +++ b/include/system/whpx-internal.h @@ -94,6 +94,8 @@ void whpx_apic_get(APICCommonState *s); (WHV_PARTITION_HANDLE Partition, UINT32 VpIndex, \ WHV_VIRTUAL_PROCESSOR_STATE_TYPE StateType, PVOID Buffer, \ UINT32 BufferSizeInBytes)) \ + X(HRESULT, WHvResetPartition, \ + (WHV_PARTITION_HANDLE Partition)) \ =20 =20 #define LIST_WINHVEMULATION_FUNCTIONS(X) \ diff --git a/target/arm/whpx/whpx-all.c b/target/arm/whpx/whpx-all.c index 2e5ece45ea..0e80ef771c 100644 --- a/target/arm/whpx/whpx-all.c +++ b/target/arm/whpx/whpx-all.c @@ -497,6 +497,8 @@ int whpx_vcpu_run(CPUState *cpu) if (arm_cpu->power_state !=3D PSCI_OFF) { whpx_psci_cpu_off(arm_cpu); } + /* Partition-wide reset, to reset state for reboots to succeed= . */ + whp_dispatch.WHvResetPartition(whpx->partition); bql_unlock(); break; case WHvRunVpExitReasonNone: --=20 2.50.1 (Apple Git-155)