From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail179-28.suw41.mandrillapp.com (mail179-28.suw41.mandrillapp.com [198.2.179.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36AFB219A89 for ; Fri, 19 Dec 2025 16:32:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.2.179.28 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766161927; cv=none; b=lbVraaHiC48lXFUMkeaqIUcTcmbugQRq8njpBjqPoGY4DL0prrISy2d9pjm3pZQnqyCP9TP/gXov7LxqwsqVqf0Q+W+PnEX6rP/a4tOme5Wh9mQaX/OlWBcU8IiDQavLg9besw3iRPVYMfekONwZ10MLQ31HrHLNima6ORbT2/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766161927; c=relaxed/simple; bh=HHnbxlNe0vk74Y9p/lrQVTe2XtI0XUjzNBbVLkGBTzs=; h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Date: MIME-Version:Content-Type; b=uTbY++3TuU5svin3Yw1YpCQyNahgn4mxKSQR/h1fLwRSD5lXAoLa0TAfXBhw20R7I+nDfhiA9QJ8Ks3mmqGjmVxx0CXngxrUxn61pNsnaz1Ukjq2bTpT9+TvGrfiZOouSPaiThtsjhkwH1r5OFL4kakj/cHGA+YwnmolYBg+vbc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=vates.tech; spf=pass smtp.mailfrom=bounce.vates.tech; dkim=pass (2048-bit key) header.d=mandrillapp.com header.i=@mandrillapp.com header.b=kURg/2J6; dkim=pass (2048-bit key) header.d=vates.tech header.i=teddy.astie@vates.tech header.b=wlN6KXR2; arc=none smtp.client-ip=198.2.179.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=vates.tech Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bounce.vates.tech Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mandrillapp.com header.i=@mandrillapp.com header.b="kURg/2J6"; dkim=pass (2048-bit key) header.d=vates.tech header.i=teddy.astie@vates.tech header.b="wlN6KXR2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1766161924; x=1766431924; bh=OvdSDejbcaHbbKQCG9MCRtVqRVp7XVW/Zcf/5kBSYys=; h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=kURg/2J62O64Zuc3hSaASxDSIEKrBiWDc2L4+IiKdMeMT4eqWmcyCda87GykiGC8Z xgIVfQ4MLYwz25o2uz4ka3OgszO58NvFGp7gp8byMtk4MyGwsYYsSHjRe+4PA7LahS QCAREDAo621bYOhJrp96gmTb30tgvDsoGZnyZ6KmyJj7ezc+GdjUWBgcPt3dExZagB OmY25fUTC0nkELej7NI6tpI92mGHMUppizJqUv6sExdCbIch7RxOqNHtlnKb9aDI0H nQGWmik1tP1SQTLpAy7bAYp6PBhEJXZyWE68RM63UJD9SnyjcCGq5ZlZZJ9IEznbtF X5zeQfDkV0k4g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1766161924; x=1766422424; i=teddy.astie@vates.tech; bh=OvdSDejbcaHbbKQCG9MCRtVqRVp7XVW/Zcf/5kBSYys=; h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=wlN6KXR261tJCoMLkbpVEydm0ic9cFTR0G7SYWYNSEiJqZUPN708TcopOw/P0WY1w 54aEaRauafZSV8mX7coX3VUnqJGXG6Bohg1x0XiwPX+f9YdlaPo7g5w8CiG1mmeut9 KBPGECh1zjwFhQ8lhJHcz4nse01EGJ6qaOQel8G1pzRi06SOo8kqSw9ClWZk5XlCnX cLtUS/+t3JsjWv6aQWQT9+EP+7o6dsecClR7Ii80Z4GnrHOnGXnPGdoHk1UI9XLgd1 aUSxfsvIW7CWWjHPiuDna6eQ/aCsSG+8EYoWRxigDLfvAdDqtoIGzNg9QEBfmrrQje o9j5EBNhhIMWw== Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail179-28.suw41.mandrillapp.com (Mailchimp) with ESMTP id 4dXtNN00ZpzMQxZwl for ; Fri, 19 Dec 2025 16:32:04 +0000 (GMT) From: "Teddy Astie" Subject: =?utf-8?Q?Re:=20[PATCH]=20x86/CPU/AMD:=20avoid=20printing=20reset=20reasons=20on=20Xen=20domU?= Received: from [37.26.189.201] by mandrillapp.com id bd0114ab997c43ce80403f76f0939021; Fri, 19 Dec 2025 16:32:03 +0000 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1766161922383 Message-Id: To: "Ariadne Conill" , linux-kernel@vger.kernel.org Cc: mario.limonciello@amd.com, darwi@linutronix.de, sandipan.das@amd.com, kai.huang@intel.com, me@mixaill.net, yazen.ghannam@amd.com, riel@surriel.com, peterz@infradead.org, hpa@zytor.com, x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, xen-devel@lists.xenproject.org, stable@vger.kernel.org References: <20251219010131.12659-1-ariadne@ariadne.space> In-Reply-To: <20251219010131.12659-1-ariadne@ariadne.space> X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.bd0114ab997c43ce80403f76f0939021?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20251219:md Date: Fri, 19 Dec 2025 16:32:03 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Le 19/12/2025 =C3=A0 02:04, Ariadne Conill a =C3=A9crit=C2=A0: > Xen domU cannot access the given MMIO address for security reasons, > resulting in a failed hypercall in ioremap() due to permissions. > > Fixes: ab8131028710 ("x86/CPU/AMD: Print the reason for the last reset") > Signed-off-by: Ariadne Conill > Cc: xen-devel@lists.xenproject.org > Cc: stable@vger.kernel.org > --- > arch/x86/kernel/cpu/amd.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c > index a6f88ca1a6b4..99308fba4d7d 100644 > --- a/arch/x86/kernel/cpu/amd.c > +++ b/arch/x86/kernel/cpu/amd.c > @@ -29,6 +29,8 @@ > # include > #endif > > +#include > + > #include "cpu.h" > > u16 invlpgb_count_max __ro_after_init =3D 1; > @@ -1333,6 +1335,10 @@ static __init int print_s5_reset_status_mmio(void) > =09if (!cpu_feature_enabled(X86_FEATURE_ZEN)) > =09=09return 0; > > +=09/* Xen PV domU cannot access hardware directly, so bail for domU case= */ > +=09if (cpu_feature_enabled(X86_FEATURE_XENPV) && !xen_initial_domain()) > +=09=09return 0; > + > =09addr =3D ioremap(FCH_PM_BASE + FCH_PM_S5_RESET_STATUS, sizeof(value)= ); > =09if (!addr) > =09=09return 0; Such MMIO only has a meaning in a physical machine, but the feature check is bogus as being on Zen arch is not enough for ensuring this. I think this also translates in most hypervisors with odd reset codes being reported; without being specific to Xen PV (Zen CPU is unfortunately not enough to ensuring such MMIO exists). Aside that, attempting unexpected MMIO in a SEV-ES/SNP guest can cause weird problems since they may not handled MMIO-NAE and could lead the hypervisor to crash the guest instead (unexpected NPF). Teddy -- Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech