[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251027131249.GAaP9v0Rs0C2WZvbfR@renoirsky.local>
Date: Sat, 20 Dec 2025 00:14:02 +0100
From: Borislav Petkov <bp@...en8.de>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Andrew Cooper <andrew.cooper3@...rix.com>,
Ariadne Conill <ariadne@...adne.space>,
linux-kernel@...r.kernel.org, mario.limonciello@....com,
darwi@...utronix.de, sandipan.das@....com, kai.huang@...el.com,
me@...aill.net, yazen.ghannam@....com, riel@...riel.com,
peterz@...radead.org, hpa@...or.com, x86@...nel.org,
tglx@...utronix.de, mingo@...hat.com, dave.hansen@...ux.intel.com,
xen-devel@...ts.xenproject.org, stable@...r.kernel.org
Subject: Re: [PATCH] x86/CPU/AMD: avoid printing reset reasons on Xen domU
On Fri, Dec 19, 2025 at 09:36:45AM -0800, Sean Christopherson wrote:
> @@ -301,6 +303,20 @@ __ioremap_caller(resource_size_t phys_addr, unsigned long size,
> if (ioremap_page_range(vaddr, vaddr + size, phys_addr, prot))
> goto err_free_area;
>
> + /*
> + * Verify the range was actually mapped when running as a Xen PV DomU
> + * guest. Xen PV doesn't emulate a virtual chipset/motherboard, and
> + * disallows DomU from mapping host physical addresses that the domain
> + * doesn't own. Unfortunately, the PTE APIs assume success, and so
> + * Xen's rejection of the mapping is ignored.
> + */
> + if (xen_pv_domain() && !xen_initial_domain()) {
> + int level;
> +
> + if (!lookup_address(vaddr, &level))
> + goto err_free_area;
> + }
This activates my ancient allergies caused by the sprinkling "if (XEN)"
randomly across the kernel tree. If this is a PV guest there probably
should be a PV ioremap variant which hides all that gunk away...
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists