* [PATCH] tools/helpers: fix PVH xenstore-stubdom console parameters
@ 2021-12-06 12:48 Juergen Gross
2021-12-06 12:56 ` Andrew Cooper
0 siblings, 1 reply; 2+ messages in thread
From: Juergen Gross @ 2021-12-06 12:48 UTC (permalink / raw)
To: xen-devel; +Cc: Juergen Gross, Ian Jackson, Wei Liu
When using a PVH mode xenstore-stubdom the frame number of the console
should be a PFN instead of a MFN.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
tools/helpers/init-xenstore-domain.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index b205a79ee6..5799ba5232 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -30,7 +30,7 @@ static char *param;
static char *name = "Xenstore";
static int memory;
static int maxmem;
-static xen_pfn_t console_mfn;
+static xen_pfn_t console_frame;
static xc_evtchn_port_or_error_t console_evtchn;
static struct option options[] = {
@@ -283,7 +283,9 @@ static int build(xc_interface *xch)
}
rv = 0;
- console_mfn = xc_dom_p2m(dom, dom->console_pfn);
+ console_frame = (dom->container_type == XC_DOM_PV_CONTAINER)
+ ? xc_dom_p2m(dom, dom->console_pfn)
+ : dom->console_pfn;
err:
if ( dom )
@@ -528,7 +530,7 @@ int main(int argc, char** argv)
do_xs_write_dir_node(xsh, fe_path, "tty", "");
snprintf(buf, 16, "%d", console_evtchn);
do_xs_write_dir_node(xsh, fe_path, "port", buf);
- snprintf(buf, 16, "%ld", console_mfn);
+ snprintf(buf, 16, "%ld", console_frame);
do_xs_write_dir_node(xsh, fe_path, "ring-ref", buf);
xs_close(xsh);
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tools/helpers: fix PVH xenstore-stubdom console parameters
2021-12-06 12:48 [PATCH] tools/helpers: fix PVH xenstore-stubdom console parameters Juergen Gross
@ 2021-12-06 12:56 ` Andrew Cooper
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2021-12-06 12:56 UTC (permalink / raw)
To: Juergen Gross, xen-devel; +Cc: Ian Jackson, Wei Liu
On 06/12/2021 12:48, Juergen Gross wrote:
> When using a PVH mode xenstore-stubdom the frame number of the console
> should be a PFN instead of a MFN.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
I tried fixing this before, but it appears that it didn't stick (for
reasons pertaining to legacy pv-grub, so perhaps not relevant any more).
What needs to go in xenstore is a gfn, so at a minimum the variable
should be named console_gfn.
With at least that change made, Reviewed-by: Andrew Cooper
<andrew.cooper3@citrix.com>
The proper fix is to alter dom->{console,store}_pfn to be gfns, because
that's what all the users actually want.
~Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-06 12:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 12:48 [PATCH] tools/helpers: fix PVH xenstore-stubdom console parameters Juergen Gross
2021-12-06 12:56 ` Andrew Cooper
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.