Skip to contentSkip to conversation

xen/dom0less: Clear xenstore page

PATCH In review Jason Andryuk 3 participants 3 messages Aug 20, 2025 – Aug 22, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/dom0less: Clear xenstore page

C Xenstored was seen failing to map a domU's event channel. Enhancing Xen's error messages shows:
common/event_channel.c:427:d0v0 EVTCHNOP failure: d1, port 3267543746 error -22

Port 3267543746 is 0xc2c2c2c2 - SCRUB_PATTERN.

Xenstore expects a non-zero evtchn_port to be valid. Explicitly zero the page to avoid this.

Fixes f78895ad78c9 ("tools/xenstored: Read event channel from xenstored page")

---
Tweaked stubdom & dom0less C xenstored pipeline success:
Test CI pipeline:
https://gitlab.com/xen-project/people/jandryuk-amd/xen/-/pipelines/1994879466

Example failure:
https://gitlab.com/xen-project/people/jandryuk-amd/xen/-/jobs/11084356847

Alternatively, a fixes could be:

Fixes df2c03e2ebfe ("xen/arm: Alloc XenStore page for Dom0less DomUs from hypervisor")

If the page should have been zero from the start.

gitlab-ci uses oxenstored for most testings, so this isn't seen by default. I don't see this in local testing, so I guess I don't have SCRUB_PATTERN writing enabled?

---
 xen/common/device-tree/dom0less-build.c | 1 +
 1 file changed, 1 insertion(+)
xen/common/device-tree/dom0less-build.c +1 -0
index 6bb038111d..badc227031 100644
@@ -600,6 +600,7 @@ static int __init alloc_xenstore_page(struct domain *d)
     d->arch.hvm.params[HVM_PARAM_STORE_PFN] = gfn_x(gfn);
 #endif
     interface = map_domain_page(mfn);
+    clear_page(interface);
     interface->connection = XENSTORE_RECONNECT;
     unmap_domain_page(interface);
 
Signature · 1 line
2.50.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Jason Andryuk

C Xenstored was seen failing to map a domU's event channel. Enhancing Xen's error messages shows:
common/event_channel.c:427:d0v0 EVTCHNOP failure: d1, port 3267543746 error -22

Port 3267543746 is 0xc2c2c2c2 - SCRUB_PATTERN.

Xenstore expects a non-zero evtchn_port to be valid. Explicitly zero the page to avoid this.

Fixes f78895ad78c9 ("tools/xenstored: Read event channel from xenstored page")

---
Tweaked stubdom & dom0less C xenstored pipeline success:
Test CI pipeline:
https://gitlab.com/xen-project/people/jandryuk-amd/xen/-/pipelines/1994879466

Quoted 6 lines

Example failure:
https://gitlab.com/xen-project/people/jandryuk-amd/xen/-/jobs/11084356847

Alternatively, a fixes could be:

Fixes df2c03e2ebfe ("xen/arm: Alloc XenStore page for Dom0less DomUs from hypervisor")

If the page should have been zero from the start.

I think this one is better. Either with or without the Fixes: tag changed:

Juergen

Acked-by on v1 1/1
#2 lore raw
In reply to Jason Andryuk
Quoted 11 lines · Jason Andryuk

C Xenstored was seen failing to map a domU's event channel. Enhancing Xen's error messages shows:
common/event_channel.c:427:d0v0 EVTCHNOP failure: d1, port 3267543746 error -22

Port 3267543746 is 0xc2c2c2c2 - SCRUB_PATTERN.

Xenstore expects a non-zero evtchn_port to be valid. Explicitly zero the page to avoid this.

Fixes f78895ad78c9 ("tools/xenstored: Read event channel from xenstored page")

~Michal