From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex =?utf-8?Q?Benn=C3=A9e?= Subject: Re: [PATCH] arm/run: don't enable KVM if system can't do it Date: Thu, 02 Jul 2015 14:17:18 +0100 Message-ID: <87r3oqsnq9.fsf@linaro.org> References: <1435835131-11437-1-git-send-email-alex.bennee@linaro.org> <20150702115152.GD4243@hawk.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, mttcg@greensocs.com, mark.burton@greensocs.com, fred.konrad@greensocs.com To: Andrew Jones Return-path: Received: from mail-wi0-f177.google.com ([209.85.212.177]:36943 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbbGBNRX (ORCPT ); Thu, 2 Jul 2015 09:17:23 -0400 Received: by wicgi11 with SMTP id gi11so73539160wic.0 for ; Thu, 02 Jul 2015 06:17:21 -0700 (PDT) In-reply-to: <20150702115152.GD4243@hawk.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: Andrew Jones writes: > On Thu, Jul 02, 2015 at 12:05:31PM +0100, Alex Benn=C3=A9e wrote: >> As ARM (and no doubt other systems) can also run tests in pure TCG m= ode >> we might as well not bother enabling accel=3Dkvm if we aren't on a r= eal >> ARM based system. This prevents us seeing ugly warning messages when >> testing TCG. > > First, > YAY! We're getting contributions to kvm-unit-tests/arm! :-) well so far I've been noodling about looking at it for KVM Guest Debug testing. I've a hideous branch on github that attempts to test exercise the debug register trapping code. However that falls down as I really need to find an easy way of attaching GDB to the qemu-gdb stub while the test is running. However with the TCG multi-thread work coming up I certainly see the need to exercise QEMU in a way that the internal TCG test code might have trouble with. > >>=20 >> Signed-off-by: Alex Benn=C3=A9e >> --- >> arm/run | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >>=20 >> diff --git a/arm/run b/arm/run >> index 662a856..2bdb4be 100755 >> --- a/arm/run >> +++ b/arm/run >> @@ -33,7 +33,13 @@ if $qemu $M -chardev testdev,id=3Did -initrd . 2>= &1 \ >> exit 2 >> fi >> =20 >> -M=3D'-machine virt,accel=3Dkvm:tcg' >> +host=3D`uname -m | sed -e 's/arm.*/arm/'` >> +if [ "${host}" =3D "arm" ] || [ "${host}" =3D "aarch64" ]; then >> + M=3D'-machine virt,accel=3Dkvm:tcg' >> +else >> + M=3D'-machine virt,accel=3Dtcg' >> +fi > > I think this is a good idea, although I had actually left that warnin= g > on purpose. Originally, the plan was for these unit tests to be kvm > specific. If they could be developed with the aid of tcg, and even us= ed > to test tcg, then fine, but running them on tcg should always complai= n, > in order to make sure that the test output clearly showed that it had > not been running on kvm. Developing unit tests for tcg is also a good > idea though, and there's really no reason not to share this framework= =2E > > So, for this patch I'd prefer we do a few things differently; > > 1) we should be able to integrate this new condition with the > "arm64 must use '-cpu host' with kvm" condition that is lower down= =2E > And, let's just make this $HOST variable one that ./configure > prepares, allowing that arm64 condition to s/$(arch)/$HOST/ and > avoiding the need to duplicate the sed -e 's/arm.*/arm/' Yeah makes sense. > > 2) we might as well do something like > > M=3D'-machine virt' > if using-kvm > M+=3D',accel=3Dkvm' > else > M+=3D',accel=3Dtcg' > fi > > now, since we don't want to use the accel fallback feature anymore > > 3) outputting which one we're using might still be nice, otherwise > one must inspect the qemu command line in the logs to find out > > 4) I recently mentioned[*] it might be nice to add a '-force-tcg' typ= e > of arm/run command line option, allowing tcg to be used even if > it's possible to use kvm. Adding that at the same time would be > nice. Would it also be useful for other arches? Does run-tests.sh pass=20 > > 5) we use tabs for indentation in arm/run, and only bother with the > variable's {}, if necessary My shell quoting was rusty. I think $(host) was calling the host comman= d for some reason. > > 6) we should post patches with [kvm-unit-tests PATCH] to avoid > confusion with other kvm postings. (I screwed that up on my > last two postings...). /me ponders if he can just config git for that. I'll patch the readme ;-) > > Thanks! > drew > > [*] https://lists.gnu.org/archive/html/qemu-devel/2015-06/msg07514.ht= ml > >> + >> chr_testdev=3D'-device virtio-serial-device' >> chr_testdev+=3D' -device virtconsole,chardev=3Dctd -chardev testdev= ,id=3Dctd' >> =20 >> --=20 >> 2.4.5 >>=20 >> -- >> To unsubscribe from this list: send the line "unsubscribe kvm" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html --=20 Alex Benn=C3=A9e