Re: [PATCH] x86/CPU/AMD: avoid printing reset reasons on Xen domU

Borislav Petkov
2025-12-19T23:14:37Z

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.