Skip to content

Commit 9098986

Browse files
Jason Andryukjgross1
authored andcommitted
xenbus: Allow PVH dom0 a non-local xenstore
Make xenbus_init() allow a non-local xenstore for a PVH dom0 - it is currently forced to XS_LOCAL. With Hyperlaunch booting dom0 and a xenstore stubdom, dom0 can be handled as a regular XS_HVM following the late init path. Ideally we'd drop the use of xen_initial_domain() and just check for the event channel instead. However, ARM has a xen,enhanced no-xenstore mode, where the event channel and PFN would both be 0. Retain the xen_initial_domain() check, and use that for an additional check when the event channel is 0. Check the full 64bit HVM_PARAM_STORE_EVTCHN value to catch the off chance that high bits are set for the 32bit event channel. Signed-off-by: Jason Andryuk <jason.andryuk@amd.com> Change-Id: I5506da42e4c6b8e85079fefb2f193c8de17c7437 Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Juergen Gross <jgross@suse.com> Message-ID: <20250506204456.5220-1-jason.andryuk@amd.com>
1 parent cd9c058 commit 9098986

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/xen/xenbus/xenbus_probe.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -966,9 +966,15 @@ static int __init xenbus_init(void)
966966
if (xen_pv_domain())
967967
xen_store_domain_type = XS_PV;
968968
if (xen_hvm_domain())
969+
{
969970
xen_store_domain_type = XS_HVM;
970-
if (xen_hvm_domain() && xen_initial_domain())
971-
xen_store_domain_type = XS_LOCAL;
971+
err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v);
972+
if (err)
973+
goto out_error;
974+
xen_store_evtchn = (int)v;
975+
if (!v && xen_initial_domain())
976+
xen_store_domain_type = XS_LOCAL;
977+
}
972978
if (xen_pv_domain() && !xen_start_info->store_evtchn)
973979
xen_store_domain_type = XS_LOCAL;
974980
if (xen_pv_domain() && xen_start_info->store_evtchn)
@@ -987,10 +993,6 @@ static int __init xenbus_init(void)
987993
xen_store_interface = gfn_to_virt(xen_store_gfn);
988994
break;
989995
case XS_HVM:
990-
err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v);
991-
if (err)
992-
goto out_error;
993-
xen_store_evtchn = (int)v;
994996
err = hvm_get_parameter(HVM_PARAM_STORE_PFN, &v);
995997
if (err)
996998
goto out_error;

0 commit comments

Comments
 (0)