public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: passt-dev@passt.top
Subject: Re: [PATCH 2/5] Invoke specific qemu-system-* binaries
Date: Tue, 28 Jun 2022 15:25:15 +1000	[thread overview]
Message-ID: <YrqQuzr+kR/SwRk3@yekko> (raw)
In-Reply-To: <20220623022258.4033116-3-david@gibson.dropbear.id.au>

[-- Attachment #1: Type: text/plain, Size: 4100 bytes --]

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).
> 
> In order to still get KVM acceleration when available, we use the option
> "-M accel=kvm:tcg" to tell qemu to try using either KVM or TCG in that
> order
> 
> 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.
> 
> 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).
> 
> Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au>

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=$((4 * 1024 * 1024)) --trace-children=yes --vgdb=no --error-exitcode=1 --suppressions=test/valgrind.supp ./passt ${__opts} -f -t 10001 -u 10001 -P passt.pid"
>  	sleep 5
>  
> -	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
>  
> -	pane_run GUEST './qrap 5 kvm -m '${VMEM}' -cpu host -smp '${VCPUS} \
> +	pane_run GUEST './qrap 5 qemu-system-$(uname -m)'                  \
> +		' -M accel=kvm: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
>  
> -	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=kvm: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=1"'					     \
>  		" -device virtio-net-pci,netdev=hostnet0,x-txburst=16384"    \
>  		" -netdev socket,fd=5,id=hostnet0"
> -	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=kvm:tcg'                                          \
> +		' -m '${VMEM}' -cpu host -smp '${VCPUS}                      \
>  		' -kernel ' "/boot/vmlinuz-$(uname -r)"			     \
>  		' -initrd mbuto_2.img -nographic -serial stdio'		     \
>  		' -nodefaults'						     \

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-06-28  5:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23  2:22 [PATCH 0/5] Test fixes, batch 3 David Gibson
2022-06-23  2:22 ` [PATCH 1/5] tests: qemu-system-ppc64le isn't a thing David Gibson
2022-06-23  2:22 ` [PATCH 2/5] Invoke specific qemu-system-* binaries David Gibson
2022-06-28  5:25   ` David Gibson [this message]
2022-06-23  2:22 ` [PATCH 3/5] tests: Cache downloaded guest images David Gibson
2022-06-23  2:22 ` [PATCH 4/5] Handle the case of a DNS server on localhost David Gibson
2022-06-23  2:22 ` [PATCH 5/5] tests: Try multiple paths for aarch64 EDK2 bios image David Gibson

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=YrqQuzr+kR/SwRk3@yekko \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).