From: Andrew Jones <drjones@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "m mizuma" <m.mizuma@jp.fujitsu.com>,
"Beata Michalska" <beata.michalska@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Markus Armbruster" <armbru@redhat.com>,
"Eric Auger" <eric.auger@redhat.com>,
qemu-arm <qemu-arm@nongnu.org>,
"Igor Mammedov" <imammedo@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Dave P Martin" <Dave.Martin@arm.com>
Subject: Re: [PATCH v7 0/9] target/arm/kvm: enable SVE in guests
Date: Mon, 28 Oct 2019 07:10:27 -0400 (EDT) [thread overview]
Message-ID: <557725864.14167224.1572261027082.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAFEAcA9ZdrAgMhdfUxz0OJnM-dF9XGwR-+FeqnyJAsrntGgL_A@mail.gmail.com>
Apologies if this mail is messed up. I'm having trouble with a hotel's network and am forced to use a webui.
----- Original Message -----
> On Fri, 25 Oct 2019 at 14:52, Andrew Jones <drjones@redhat.com> wrote:
> >
> > On Fri, Oct 25, 2019 at 01:06:26PM +0100, Peter Maydell wrote:
> > > Fails 'make check' on my aarch32-compile-in-chroot-on-aarch64
> > > machine:
> >
> > Are there easy-to-follow instructions for setting this environment up
> > somewhere?
>
> It's an ancient setup, so not really. But it's just an
> Ubuntu 32-bit chroot inside an Ubuntu 64-bit host. I use
> schroot to manage it.
>
>
>
> > I guess the problem is how we're determining if KVM is available, which
> > is like this
> >
> > int main(int argc, char **argv)
> > {
> > bool kvm_available = false;
> >
> > if (!access("/dev/kvm", R_OK | W_OK)) {
> > #if defined(HOST_AARCH64)
> > kvm_available = g_str_equal(qtest_get_arch(), "aarch64");
> > #elif defined(HOST_ARM)
> > kvm_available = g_str_equal(qtest_get_arch(), "arm");
> > #endif
> > }
>
> > So we need /dev/kvm and the QEMU binary arch type (qemu-system-arm in
> > this case) needs to match the host arch type. The problem is that
> > HOST_<type> doesn't imply anything about the actual host arch type.
> > <type> comes from the configure $ARCH variable, which for 'arm'
> > comes from the $cpu variable, which for 'arm' comes from whether or
> > not the compiler defines __arm__, and cross compilers certainly do.
> > I guess we'd have the same problem in an aarch32-compile-in-chroot-on-
> > <any-other-type> environment, if a cross compiler is used for the
> > compiling. I should change the KVM available check to something that
> > uses the actual host arch type. I assume the following works, but
> > I don't know if I'm allowed to use uname() in these tests, and, if
> > not, then I don't know what the right way to get the actual host
> > type is.
>
> This all feels like it's trying to do the wrong thing, ie
> replicate the logic within QEMU that decides whether to use
> KVM or not. Some possible other approaches:
>
> * If you want to know whether you can run the qemu binary
> with -accel kvm, then just try that and see if it succeeds.
That's what's happening here, but the failure happens in qtest_init(), so
there's no way to avoid the assert.
> * Or use '-accel kvm:tcg' and make the test work so that it
> will pass for both KVM and TCG
For the KVM tests, I'd prefer we specifically test the 'host' cpu type,
which requires we specifically test with KVM. That said, we can use
the fallback along with an additional query to make sure 'host' is
ok to use.
> * Or use QMP to query what accelerators are available, assuming
> there's a QMP command for that
Looks like we can check for kvm with query-kvm.
I'll rework patch 2/9 using the fallback and kvm query to ensure
kvm can be used. I can even add a test or two that ensure 'host'
is ok to use.
Thanks,
drew
next prev parent reply other threads:[~2019-10-28 11:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 12:17 [PATCH v7 0/9] target/arm/kvm: enable SVE in guests Andrew Jones
2019-10-24 12:18 ` [PATCH v7 1/9] target/arm/monitor: Introduce qmp_query_cpu_model_expansion Andrew Jones
2019-10-24 12:18 ` [PATCH v7 2/9] tests: arm: Introduce cpu feature tests Andrew Jones
2019-10-24 13:22 ` Philippe Mathieu-Daudé
2019-10-24 12:18 ` [PATCH v7 3/9] target/arm: Allow SVE to be disabled via a CPU property Andrew Jones
2019-10-24 12:18 ` [PATCH v7 4/9] target/arm/cpu64: max cpu: Introduce sve<N> properties Andrew Jones
2019-10-24 12:18 ` [PATCH v7 5/9] target/arm/kvm64: Add kvm_arch_get/put_sve Andrew Jones
2019-10-24 12:18 ` [PATCH v7 6/9] target/arm/kvm64: max cpu: Enable SVE when available Andrew Jones
2019-10-24 12:18 ` [PATCH v7 7/9] target/arm/kvm: scratch vcpu: Preserve input kvm_vcpu_init features Andrew Jones
2019-10-24 12:18 ` [PATCH v7 8/9] target/arm/cpu64: max cpu: Support sve properties with KVM Andrew Jones
2019-10-24 12:18 ` [PATCH v7 9/9] target/arm/kvm: host cpu: Add support for sve<N> properties Andrew Jones
2019-10-24 13:42 ` [PATCH v7 0/9] target/arm/kvm: enable SVE in guests Peter Maydell
2019-10-25 12:06 ` Peter Maydell
2019-10-25 13:51 ` Andrew Jones
2019-10-25 14:06 ` Peter Maydell
2019-10-28 11:10 ` Andrew Jones [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-11-01 1:35 Zhang, Lei
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=557725864.14167224.1572261027082.JavaMail.zimbra@redhat.com \
--to=drjones@redhat.com \
--cc=Dave.Martin@arm.com \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=beata.michalska@linaro.org \
--cc=eric.auger@redhat.com \
--cc=imammedo@redhat.com \
--cc=m.mizuma@jp.fujitsu.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).