From nobody Thu Jul 23 21:13:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=invisiblethingslab.com ARC-Seal: i=1; a=rsa-sha256; t=1784506399; cv=none; d=zohomail.com; s=zohoarc; b=Z08c2qXHAtq7mWq2iPDi/Z+Izwceo2diai6CCK+GE2cLeDMfeyfR6RwpcHVrR9U+4ymUO3qXkw2L3IBRTexcnItPIK+BDS3BDdZcKvpFPTR6Y4EE+TlarY9DFwUxqhWy2bRI8pxjhk9peIbucBad9ewcH9+RzkUlbv9UnEJXXas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784506399; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dzwiZvwfBNEyaxYoXCE94XEdZopGtEVYz3iMynT4Ijo=; b=dduAqnuv5gYNJRY3TATRY719zGV0aH3sCu1VgD2UeWFz3EHY9FLhLMG8WpgaDELDSV//bYS3/cI0pcsldRtJPj4W+gntOczhKbDDmydBE2afyBZKj7AZmejd0qXzcRoBrjHwgHhPeFfhLfKxpA9Z6PBsgl3fcjrgotm3Z+y2R0g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1784506399191678.5029962383218; Sun, 19 Jul 2026 17:13:19 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1366082.1616011 (Exim 4.92) (envelope-from ) id 1wlbcg-0000t7-NJ; Mon, 20 Jul 2026 00:12:42 +0000 Received: by outflank-mailman (output) from mailman id 1366082.1616011; Mon, 20 Jul 2026 00:12:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wlbcg-0000sz-KT; Mon, 20 Jul 2026 00:12:42 +0000 Received: by outflank-mailman (input) for mailman id 1366082; Mon, 20 Jul 2026 00:12:40 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wlbce-0000st-Ge for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 00:12:40 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wlbcc-00E5qI-W2 for xen-devel@lists.xenproject.org; Mon, 20 Jul 2026 02:12:39 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a5d67ab-2eae-0a2a0a5409dd-0a2a450b8f74-26 for ; Mon, 20 Jul 2026 02:12:38 +0200 Received: from [103.168.172.149] (helo=fout-a6-smtp.messagingengine.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a5d67f5-b7e8-0a2a450b0019-67a8ac95e293-3 for ; Mon, 20 Jul 2026 02:12:38 +0200 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id 0F1FEEC0073; Sun, 19 Jul 2026 20:12:37 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Sun, 19 Jul 2026 20:12:37 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 19 Jul 2026 20:12:35 -0400 (EDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=fm2 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:Feedback-ID:From:Message-ID:MIME-Version:Subject:To:X-ME-Proxy:X-ME-Sender" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2; t=1784506357; x=1784592757; bh=dzwiZvwfBNEyaxYoXCE94XEdZopGtEVY z3iMynT4Ijo=; b=CNYaMB2MwgmkHwSGQvD7YmJDA1mR9lTCgxIaMweWcXpvXiGU iZYglHP+Z12wEgfuRQ9pjKx/AFXiPr0KqkHjh+l7aUQMEX8DQMixk4Q6PyRHK63U YIAB3oJdpdjolIs8pgDFRzybynyT/KOdKtTUKFRr3R1dKcFulmkHKd/zaI//Kw4J Jh+Dm9V2nE8B1mXtM6RWN5k4EJimIQhsEaLITNW587NpcpjFpswTImj89oppQMa5 Vvv89DxDHschpWvGA06RIJrG6S/h9C1I10Lcbxu4PXPPPe6z48nhSV8oaPB0D7Ww 94AFExam07dIlizmnJSncXOp/BIpJypXKIrmhw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1784506357; x=1784592757; bh=dzwiZvwfBNEyaxYoXCE94XEdZopG tEVYz3iMynT4Ijo=; b=m9fgHrie98cNWN/BWIoT5qS04W6KkJkEG8N8d5Qp5wUC kv0BfJ93QZDLlauoojRVga/zolMWRGxun4oi6csKe6JYRc1B5eOJmybnbM6qr5eZ TONTmCBr5+NdWhZnwbSbIKTP/Cry/Q5GyndaodnW4qmyAYvQeH5wJyZvwCBk+BP/ I1X2PKZ4rS+r8YG2k5SbkoknPvWrD/Iqm4fWc+aiUlljdw6NyNzc1vbV4nvSO4vw Ouk8nr/myh4AG5KbTlciGIABuuCRPSwt0GDfl3mR8AZ9gnrXSMzJgH6oHW4pBSTi jlOvigS9mpzT4R6bE4s31GgcZQOudDofSWSi2HLwGg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFtuSUmutw5AO4TgaRlea4KuQJ3KVZWAf5qprd1JNS/qSFj0TirKfEsQKDKpm4dys GGwZeTypmfM4/SN592GGSNZC47zMVWS8vX3d+5FYwERfFbazUvY2CIypuK9FoIptzvt6ss QCVe7OEnx3eTKoTqFPfKV4wBPmA6yxVfpFr8Ss3bVGTpAhdvfh6CqybIVRT8fF49FLt7Oc rYc8G0ej+oY8CFeGoKwxbGiJZJioz5Zx5xlHEn8dYaL2f+gRft2kaRZ8WRhribTQa0Zg/L sLrUw466UJdtjPA/hdQC/HcLbgbEkJX9TWutsF/P8O8xoG/t/uupksPGYDu7DILhTsYOPv axVC0wsPYczDgJjFaDg6ZGNw5Lv0XTraXbhGk6aSxRe/PhG3Ac+txxbGTDqi+frHkKjaOb 6b379DZfWaWnOqrMOHdLkp+HLpX1I3bikQEH8ahA/ByVIF377GlgC8hIhR2Hd6t0+WUwSn GXF6vz94diM1zLmE02FclHJahX3RIdnaQEMbieocT2WdG2DDnvzW/Rx1Vl5s/mACkK3+dI NHCQBREzGwSeG30QQRdQRl4FwoE8QwC+YJJrrh2rwh3Jzlm5aYs0sfSZdSF/hneiXC/Scl iXPecuCceY6Zgm1yq8iolHfrDAUObKTsxRQFt5CjqSSdc4ojQM/0v0wGaNag X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Teddy Astie Subject: [PATCH] x86/domctl: restore all registers in arch_{get,set}_info_guest() Date: Mon, 20 Jul 2026 02:12:18 +0200 Message-ID: <20260720001223.2876628-1-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-purgate-ID: tlsNG-42698a/1784506358-186CA9EA-BB2D4E1C/0/0 X-purgate-type: clean X-purgate-size: 2805 X-ZohoMail-DKIM: pass (identity @invisiblethingslab.com) X-ZM-MESSAGEID: 1784506401029158500 Commit 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()") converted memcpy() of the cpu_user_regs structure to explicit copy of its fields. In the compat case, it intentionally missed few of them, named in the commit message. But the 64bit case missed also r8-r15 registers, which was not intentional. This, at least, caused Linux 6.18.x crash when resuming PVH domU. Fix it by adding missing assignments. Fixes: 9f892f84c279 ("x86/domctl: Stop using XLAT_cpu_user_regs()") Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Andrew Cooper Reviewed-by: Frediano Ziglio Reviewed-by: Jan Beulich Reviewed-by: Teddy Astie --- xen/arch/x86/domain.c | 8 ++++++++ xen/arch/x86/domctl.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 1d458f1372e5..ba7244ccc513 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1255,6 +1255,14 @@ int arch_set_info_guest( =20 if ( !compat ) { + v->arch.user_regs.r15 =3D c.nat->user_regs.r15; + v->arch.user_regs.r14 =3D c.nat->user_regs.r14; + v->arch.user_regs.r13 =3D c.nat->user_regs.r13; + v->arch.user_regs.r12 =3D c.nat->user_regs.r12; + v->arch.user_regs.r11 =3D c.nat->user_regs.r11; + v->arch.user_regs.r10 =3D c.nat->user_regs.r10; + v->arch.user_regs.r9 =3D c.nat->user_regs.r9; + v->arch.user_regs.r8 =3D c.nat->user_regs.r8; v->arch.user_regs.rbx =3D c.nat->user_regs.rbx; v->arch.user_regs.rcx =3D c.nat->user_regs.rcx; v->arch.user_regs.rdx =3D c.nat->user_regs.rdx; diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 07f712a0a40d..3ea4c650eee0 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1481,6 +1481,14 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_= context_u c) if ( !compat ) { /* Backing memory is pre-zeroed. */ + c.nat->user_regs.r15 =3D v->arch.user_regs.r15; + c.nat->user_regs.r14 =3D v->arch.user_regs.r14; + c.nat->user_regs.r13 =3D v->arch.user_regs.r13; + c.nat->user_regs.r12 =3D v->arch.user_regs.r12; + c.nat->user_regs.r11 =3D v->arch.user_regs.r11; + c.nat->user_regs.r10 =3D v->arch.user_regs.r10; + c.nat->user_regs.r9 =3D v->arch.user_regs.r9; + c.nat->user_regs.r8 =3D v->arch.user_regs.r8; c.nat->user_regs.rbx =3D v->arch.user_regs.rbx; c.nat->user_regs.rcx =3D v->arch.user_regs.rcx; c.nat->user_regs.rdx =3D v->arch.user_regs.rdx; --=20 2.54.0