]>
x86/boot: Improve paging mode diagnostics in create_dom0()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 25 Jun 2025 09:00:25 +0000 (10:00 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 25 Jun 2025 16:54:41 +0000 (17:54 +0100)
commit2654ff974a43c16f677dcd63303b09f527285fbf
tree6852a43825ff2f7d5eb0ba4799f9f6a857a5d050
parentda21488aed9bf055f24610aa46787a490d44bb98
x86/boot: Improve paging mode diagnostics in create_dom0()

I was presented with this:

  (XEN) NX (Execute Disable) protection active
  (XEN) d0 has maximum 416 PIRQs
  (XEN)
  (XEN) ****************************************
  (XEN) Panic on CPU 0:
  (XEN) Error creating d0: -95
  (XEN) ****************************************

which is less than helpful.  It turns out to be the -EOPNOTSUPP from
shadow_domain_init().

The real bug here is create_dom0() unconditionally assuming the presence of
SHADOW_PAGING.  Rework it to panic() rather than choosing a dom0_cfg which is
guaranteed to fail.  This results in:

  (XEN) NX (Execute Disable) protection active
  (XEN)
  (XEN) ****************************************
  (XEN) Panic on CPU 0:
  (XEN) Neither HAP nor Shadow available for PVH domain
  (XEN) ****************************************

which is rather more helpful.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/setup.c