[PATCH] xen/dom0less: Clear xenstore page

Jason Andryuk posted 1 patch 2 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20250820211242.116868-1-jason.andryuk@amd.com
xen/common/device-tree/dom0less-build.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] xen/dom0less: Clear xenstore page
Posted by Jason Andryuk 2 months, 1 week ago
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")
Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
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(+)

diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 6bb038111d..badc227031 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -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);
 
-- 
2.50.1
Re: [PATCH] xen/dom0less: Clear xenstore page
Posted by Orzel, Michal 2 months, 1 week ago

On 20/08/2025 23:12, Jason Andryuk wrote:
> 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")
> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>

~Michal
Re: [PATCH] xen/dom0less: Clear xenstore page
Posted by Juergen Gross 2 months, 1 week ago
On 20.08.25 23:12, Jason Andryuk wrote:
> 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")
> Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
> ---
> 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.

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

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen