From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>, Ian Jackson <iwj@xenproject.org>,
Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v3 2/2] tools: set event channel HVM parameters in libxenguest
Date: Wed, 8 Dec 2021 09:47:45 +0100 [thread overview]
Message-ID: <20211208084745.31082-3-jgross@suse.com> (raw)
In-Reply-To: <20211208084745.31082-1-jgross@suse.com>
The HVM parameters for pre-allocated event channels should be set in
libxenguest, like it is done for PV guests and for the pre-allocated
ring pages.
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- replacement for former patch 2 (Andrew Cooper)
---
tools/libs/guest/xg_dom_x86.c | 6 ++++++
tools/libs/light/libxl_dom.c | 15 ++++++---------
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index b6e75afba2..9328fbf804 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -1866,6 +1866,12 @@ static int bootlate_hvm(struct xc_dom_image *dom)
munmap(hvm_info_page, PAGE_SIZE);
}
+ if ( xc_hvm_param_set(xch, domid, HVM_PARAM_CONSOLE_EVTCHN,
+ dom->console_evtchn) ||
+ xc_hvm_param_set(xch, domid, HVM_PARAM_STORE_EVTCHN,
+ dom->xenstore_evtchn) )
+ return -1;
+
return 0;
}
diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
index fe9f760f71..c9c24666cd 100644
--- a/tools/libs/light/libxl_dom.c
+++ b/tools/libs/light/libxl_dom.c
@@ -723,9 +723,8 @@ out:
static int hvm_build_set_params(xc_interface *handle, uint32_t domid,
libxl_domain_build_info *info,
- int store_evtchn, unsigned long *store_mfn,
- int console_evtchn, unsigned long *console_mfn,
- domid_t store_domid, domid_t console_domid)
+ unsigned long *store_mfn,
+ unsigned long *console_mfn)
{
struct hvm_info_table *va_hvm;
uint8_t *va_map, sum;
@@ -752,8 +751,6 @@ static int hvm_build_set_params(xc_interface *handle, uint32_t domid,
xc_hvm_param_get(handle, domid, HVM_PARAM_STORE_PFN, &str_mfn);
xc_hvm_param_get(handle, domid, HVM_PARAM_CONSOLE_PFN, &cons_mfn);
- xc_hvm_param_set(handle, domid, HVM_PARAM_STORE_EVTCHN, store_evtchn);
- xc_hvm_param_set(handle, domid, HVM_PARAM_CONSOLE_EVTCHN, console_evtchn);
*store_mfn = str_mfn;
*console_mfn = cons_mfn;
@@ -1123,7 +1120,9 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
dom->vga_hole_size = device_model ? LIBXL_VGA_HOLE_SIZE : 0;
dom->device_model = device_model;
dom->max_vcpus = info->max_vcpus;
+ dom->console_evtchn = state->console_port;
dom->console_domid = state->console_domid;
+ dom->xenstore_evtchn = state->store_port;
dom->xenstore_domid = state->store_domid;
rc = libxl__domain_device_construct_rdm(gc, d_config,
@@ -1169,10 +1168,8 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
if (rc != 0)
goto out;
- rc = hvm_build_set_params(ctx->xch, domid, info, state->store_port,
- &state->store_mfn, state->console_port,
- &state->console_mfn, state->store_domid,
- state->console_domid);
+ rc = hvm_build_set_params(ctx->xch, domid, info, &state->store_mfn,
+ &state->console_mfn);
if (rc != 0) {
LOG(ERROR, "hvm build set params failed");
goto out;
--
2.26.2
next prev parent reply other threads:[~2021-12-08 8:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 8:47 [PATCH v3 0/2] tools/helpers: PVH xenstore-stubdom console fixes Juergen Gross
2021-12-08 8:47 ` [PATCH v3 1/2] tools/helpers: fix PVH xenstore-stubdom console parameters Juergen Gross
2021-12-08 8:47 ` Juergen Gross [this message]
2021-12-08 13:43 ` [PATCH v3 2/2] tools: set event channel HVM parameters in libxenguest Andrew Cooper
2021-12-08 14:22 ` Juergen Gross
2021-12-08 15:54 ` Andrew Cooper
2021-12-08 15:57 ` Juergen Gross
2021-12-08 16:02 ` Andrew Cooper
2021-12-08 16:34 ` Anthony PERARD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211208084745.31082-3-jgross@suse.com \
--to=jgross@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=iwj@xenproject.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.