From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: Re: [PATCH 2/5] Invoke specific qemu-system-* binaries Date: Tue, 28 Jun 2022 15:25:15 +1000 Message-ID: In-Reply-To: <20220623022258.4033116-3-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7627568677711193735==" --===============7627568677711193735== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 23, 2022 at 12:22:55PM +1000, David Gibson wrote: > A lot of tests and examples invoke qemu with the command "kvm". However, > as far as I can tell, "kvm" being aliased to the appropriate qemu system > binary is Debian specific. The binary names from qemu upstream - > qemu-system-$ARCH - also aren't universal, but they are more common (they > should be good for both Debian and Fedora at least). >=20 > In order to still get KVM acceleration when available, we use the option > "-M accel=3Dkvm:tcg" to tell qemu to try using either KVM or TCG in that > order >=20 > A number of the places we invoked "kvm" are expecting specifically an x86 > guest, and so it's also safer to explicitly invoke qemu-system-x86_64. >=20 > Some others appear to be independent of the target arch (just wanting the > same arch as the host to allow KVM acceleration). Although I suspect there > may be more subtle x86 specific options in the qemu command lines, attempt > to preserve arch independence by using $(uname -m). >=20 > Signed-off-by: David Gibson I found a problem in this patch, now that the mbuto changes have let be go further in the tests. [snip] > diff --git a/test/lib/setup b/test/lib/setup > index e57d97c..0b6d915 100755 > --- a/test/lib/setup > +++ b/test/lib/setup > @@ -58,7 +58,8 @@ setup_passt() { > pane_run PASST "valgrind --max-stackframe=3D$((4 * 1024 * 1024)) --trace-= children=3Dyes --vgdb=3Dno --error-exitcode=3D1 --suppressions=3Dtest/valgrin= d.supp ./passt ${__opts} -f -t 10001 -u 10001 -P passt.pid" > sleep 5 > =20 > - pane_run GUEST './qrap 5 kvm -m '${VMEM}' -cpu host -smp '${VCPUS} \ > + pane_run GUEST './qrap 5 qemu-system-$(uname -m)' \ > + '-m '${VMEM}' -cpu host -smp '${VCPUS} \ I forgot to specify the KVM accelerator in these changes, which makes qemu die with an error because !KVM is incompatible with -cpu host. I've fixed this locally in my tree, but I'm trying to sort out some other issues before reposting the series. > ' -kernel ' "/boot/vmlinuz-$(uname -r)" \ > ' -initrd mbuto.img -nographic -serial stdio' \ > ' -nodefaults' \ > @@ -170,7 +171,9 @@ setup_passt_in_ns() { > fi > sleep 5 > =20 > - pane_run GUEST './qrap 5 kvm -m '${VMEM}' -cpu host -smp '${VCPUS} \ > + pane_run GUEST './qrap 5 qemu-system-$(uname -m)' \ > + ' -M accel=3Dkvm:tcg' \ > + ' -m '${VMEM}' -cpu host -smp '${VCPUS} \ > ' -kernel ' "/boot/vmlinuz-$(uname -r)" \ > ' -initrd mbuto.img -nographic -serial stdio' \ > ' -nodefaults' \ > @@ -259,7 +262,9 @@ setup_two_guests() { > pane_run GUEST_2 'cp mbuto.img mbuto_2.img' > pane_status GUEST_2 > =20 > - pane_run GUEST_1 './qrap 5 kvm -m '${VMEM}' -cpu host -smp '${VCPUS} \ > + pane_run GUEST_1 './qrap 5 qemu-system-$(uname -m)' \ > + ' -M accel=3Dkvm:tcg' \ > + ' -m '${VMEM}' -cpu host -smp '${VCPUS} \ > ' -kernel ' "/boot/vmlinuz-$(uname -r)" \ > ' -initrd mbuto.img -nographic -serial stdio' \ > ' -nodefaults' \ > @@ -267,7 +272,9 @@ setup_two_guests() { > 'virtio-net.napi_tx=3D1"' \ > " -device virtio-net-pci,netdev=3Dhostnet0,x-txburst=3D16384" \ > " -netdev socket,fd=3D5,id=3Dhostnet0" > - pane_run GUEST_2 './qrap 5 kvm -m '${VMEM}' -cpu host -smp '${VCPUS} \ > + pane_run GUEST_2 './qrap 5 qemu-system-$(uname -m)' \ > + ' -M accel=3Dkvm:tcg' \ > + ' -m '${VMEM}' -cpu host -smp '${VCPUS} \ > ' -kernel ' "/boot/vmlinuz-$(uname -r)" \ > ' -initrd mbuto_2.img -nographic -serial stdio' \ > ' -nodefaults' \ --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --===============7627568677711193735== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUVCQ0FBZEZpRUVvVUx4V3U0L1dz MGRCK1h0Z3lwWTRnRXdZU0lGQW1LNmtLSUFDZ2tRZ3lwWTRnRXcKWVNLM3JRLzZBMUo5eVB2QVdk YUNyeUlKVGk1bWlZQk5WQjlrSFB5N2hmWUU4OXp2bFMvOHNKZ05mb1RoU0JmbApzVVo0di9HTGI2 NG90US9LcDl3c1c4eW9qUElyQW14K21ObkFnZjNUVkg3S2dSRHFVMUMvMElkcUw1MkJDRWZ3CitC ZWJUejdMd2F6TjJQODNKZ1VEajF0dERCMXd4MW5GRXFsY2lBME9BbFFHSjFWYXVzT2VnU3hKV1FZ TUEzZEsKSStFSHJCRDMwakszWUNlTE5WbzRaTTM2QmZOcHp2dVRhbHUvMm94MDhzK0E2UDdEa3lE VjVieit1d1pDaVBCegpSQnJxV0xPZjg1dWpzeUlCbjc2eXZ2UzRJcXFvSFFnYmNJczh6WnBBUWg0 QkNSdTFneGw1RmxJMGMvMGYvSzlCCkpWYXJrZ2NlNjZBN0VhN05iaFpVLzEvWmt1Q1p6Nkc4VHU5 dzJuYnhTOUlXSTBSajFLRW9tZzUyQW1VVVFLWm8KL2FrY1F2WitUK3lCSFFuekthcU5WVmRya25X OHNDL0F2bUlubXMvb0VnVEVsdm9uTVZpNENoZWFMNDVMTExSNQo1RjEzS2RtMng0eWRsTVJsRmdh M1pVVERwSUlNN1J2a2VudG8weVF2ZGQrTEVDUDJRU3VVc2NqV00yZVpCR1o4ClA4UXU5QXNnQWZN YlZUL1pObTArSHdTYVZ1STlVdk1HT1dxY29JZWlCZHppcTJZSGQrbUJDVDErUTdvcXpIamYKSHpV WmhoM0tmWDduRkdmclRQaWh1aWs4MlJ0c3dRSkJiNDIwbEx2RWZ3MkRwZHV6bFk0TkdjTWJwQW9H QlJFSwppc0YwV2hWblVmL1NwaGRodWx6V0RCTGMzeVBFSncydWVDT29tQ2hIMkpDNzJtZi9kTXc9 Cj1zTmR1Ci0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQo= --===============7627568677711193735==--