From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
Jan Beulich <JBeulich@suse.com>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH] tests/resource: Fix HVM guest in !SHADOW builds
Date: Fri, 1 Mar 2024 12:49:46 +0100 [thread overview]
Message-ID: <ZeHA2usyM2aOISxq@macbook> (raw)
In-Reply-To: <20240229205354.2574207-1-andrew.cooper3@citrix.com>
On Thu, Feb 29, 2024 at 08:53:54PM +0000, Andrew Cooper wrote:
> Right now, test-resource always creates HVM Shadow guests. But if Xen has
> SHADOW compiled out, running the test yields:
>
> $./test-resource
> XENMEM_acquire_resource tests
> Test x86 PV
> Created d1
> Test grant table
> Test x86 PVH
> Skip: 95 - Operation not supported
>
> and doesn't really test HVM guests, but doesn't fail either.
>
> There's nothing paging-mode-specific about this test, so default to HAP if
> possible and provide a more specific message if neither HAP or Shadow are
> available.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
One comment below.
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>
> ---
> tools/tests/resource/test-resource.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/tools/tests/resource/test-resource.c b/tools/tests/resource/test-resource.c
> index 7ae88ea34807..2796053588d3 100644
> --- a/tools/tests/resource/test-resource.c
> +++ b/tools/tests/resource/test-resource.c
> @@ -20,6 +20,8 @@ static xc_interface *xch;
> static xenforeignmemory_handle *fh;
> static xengnttab_handle *gh;
>
> +static xc_physinfo_t physinfo;
> +
> static void test_gnttab(uint32_t domid, unsigned int nr_frames,
> unsigned long gfn)
> {
> @@ -172,6 +174,23 @@ static void test_domain_configurations(void)
>
> printf("Test %s\n", t->name);
>
> +#if defined(__x86_64__) || defined(__i386__)
> + /*
> + * On x86, use HAP guests if possible, but skip if neither HAP nor
> + * SHADOW is available.
> + */
> + if ( t->create.flags & XEN_DOMCTL_CDF_hvm )
> + {
> + if ( physinfo.capabilities & XEN_SYSCTL_PHYSCAP_hap )
> + t->create.flags |= XEN_DOMCTL_CDF_hap;
> + else if ( !(physinfo.capabilities & XEN_SYSCTL_PHYSCAP_shadow) )
> + {
> + printf(" Skip: Neither HAP or SHADOW available\n");
> + continue;
> + }
> + }
Provided that you are already checking, might also be worth to keep in
mind that at some point we might want to also check for
XEN_SYSCTL_PHYSCAP_{hvm,pv} and skip those tests if the requested domain
type is not available.
Thanks, Roger.
next prev parent reply other threads:[~2024-03-01 11:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 20:53 [PATCH] tests/resource: Fix HVM guest in !SHADOW builds Andrew Cooper
2024-03-01 11:49 ` Roger Pau Monné [this message]
2024-03-01 12:07 ` Andrew Cooper
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=ZeHA2usyM2aOISxq@macbook \
--to=roger.pau@citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--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.