From: Anthony PERARD <anthony.perard@vates.tech>
To: Stefano Stabellini <stefano.stabellini@amd.com>
Cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org,
julien@xen.org, bertrand.marquis@arm.com, michal.orzel@amd.com,
Volodymyr_Babchuk@epam.com, Henry Wang <xin.wang2@amd.com>,
Alec Kwapis <alec.kwapis@medtronic.com>,
Jason Andryuk <jason.andryuk@amd.com>
Subject: Re: [PATCH v4 3/4] tools/init-dom0less: Avoid hardcoding GUEST_MAGIC_BASE
Date: Wed, 12 Jun 2024 12:19:03 +0000 [thread overview]
Message-ID: <ZmmSNWaOp6RYcrmU@l14> (raw)
In-Reply-To: <20240524225522.2878481-3-stefano.stabellini@amd.com>
On Fri, May 24, 2024 at 03:55:21PM -0700, Stefano Stabellini wrote:
> From: Henry Wang <xin.wang2@amd.com>
>
> Currently the GUEST_MAGIC_BASE in the init-dom0less application is
> hardcoded, which will lead to failures for 1:1 direct-mapped Dom0less
> DomUs.
>
> Since the guest magic region allocation from init-dom0less is for
> XenStore, and the XenStore page is now allocated from the hypervisor,
> instead of hardcoding the guest magic pages region, use
> xc_hvm_param_get() to get the XenStore page PFN. Rename alloc_xs_page()
> to get_xs_page() to reflect the changes.
>
> With this change, some existing code is not needed anymore, including:
> (1) The definition of the XenStore page offset.
> (2) Call to xc_domain_setmaxmem() and xc_clear_domain_page() as we
> don't need to set the max mem and clear the page anymore.
> (3) Foreign mapping of the XenStore page, setting of XenStore interface
> status and HVM_PARAM_STORE_PFN from init-dom0less, as they are set
> by the hypervisor.
>
> Take the opportunity to do some coding style improvements when possible.
>
> Reported-by: Alec Kwapis <alec.kwapis@medtronic.com>
> Signed-off-by: Henry Wang <xin.wang2@amd.com>
> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
> ---
> +static int get_xs_page(struct xc_interface_core *xch, libxl_dominfo *info,
> + uint64_t *xenstore_pfn)
> {
[...]
> + rc = xc_hvm_param_get(xch, info->domid, HVM_PARAM_STORE_PFN, xenstore_pfn);
> + if (rc < 0) {
> + printf("Failed to get HVM_PARAM_STORE_PFN\n");
Shouldn't we print error message on "stderr" instead?
> @@ -245,20 +232,11 @@ static int init_domain(struct xs_handle *xsh,
> if (!xenstore_evtchn)
> return 0;
>
> - /* Alloc xenstore page */
> - if (alloc_xs_page(xch, info, &xenstore_pfn) != 0) {
> - printf("Error on alloc magic pages\n");
> - return 1;
> - }
> -
> - intf = xenforeignmemory_map(xfh, info->domid, PROT_READ | PROT_WRITE, 1,
> - &xenstore_pfn, NULL);
> - if (!intf) {
> - printf("Error mapping xenstore page\n");
> + /* Get xenstore page */
> + if (get_xs_page(xch, info, &xenstore_pfn) != 0) {
> + printf("Error on getting xenstore page\n");
Same here.
In anycase:
Acked-by: Anthony PERARD <anthony.perard@vates.tech>
Thanks,
--
Anthony Perard | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
next prev parent reply other threads:[~2024-06-12 12:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-24 22:55 [PATCH v4 0/4] Guest XenStore page allocation for 11 Dom0less domUs Stefano Stabellini
2024-05-24 22:55 ` [PATCH v4 1/4] xen/arm/static-shmem: Static-shmem should be direct-mapped for direct-mapped domains Stefano Stabellini
2024-05-24 22:55 ` [PATCH v4 2/4] xen/arm: Alloc XenStore page for Dom0less DomUs from hypervisor Stefano Stabellini
2024-05-24 23:06 ` Julien Grall
2024-05-27 14:28 ` Oleksii K.
2024-06-19 0:37 ` Stefano Stabellini
2024-06-19 11:49 ` Julien Grall
2024-06-20 0:35 ` Stefano Stabellini
2024-05-29 7:57 ` Michal Orzel
2024-05-24 22:55 ` [PATCH v4 3/4] tools/init-dom0less: Avoid hardcoding GUEST_MAGIC_BASE Stefano Stabellini
2024-06-12 12:19 ` Anthony PERARD [this message]
2024-05-24 22:55 ` [PATCH v4 4/4] docs/features/dom0less: Update the late XenStore init protocol Stefano Stabellini
2024-05-29 8:00 ` Michal Orzel
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=ZmmSNWaOp6RYcrmU@l14 \
--to=anthony.perard@vates.tech \
--cc=Volodymyr_Babchuk@epam.com \
--cc=alec.kwapis@medtronic.com \
--cc=bertrand.marquis@arm.com \
--cc=jason.andryuk@amd.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=sstabellini@kernel.org \
--cc=stefano.stabellini@amd.com \
--cc=xen-devel@lists.xenproject.org \
--cc=xin.wang2@amd.com \
/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.