diff mbox series

[kvm-unit-tests,v1,1/1] s390x: firq: fix running in PV

Message ID 20220203161834.52472-1-imbrenda@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests,v1,1/1] s390x: firq: fix running in PV | expand

Commit Message

Claudio Imbrenda Feb. 3, 2022, 4:18 p.m. UTC
If using the qemu CPU type, Protected Virtualization is not available,
and the test will fail to start when run in PV. If specifying the host
CPU type, the test will fail to start with TCG because the host CPU
type requires KVM. In both cases the test will show up as failed.

This patch adds a copy of the firq test definitions for KVM, using the
host CPU type, and specifying that KVM is to be used. The existing
firq tests are then fixed by specifying that TCG is to be used.

When running the tests normally, both variants will be run. If an
accelerator is specified explicitly when running the tests, only one
variant will run and the other will be skipped (and not fail).

Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Fixes: 8b98745d ("s390x: firq: floating interrupt test")
---
 s390x/unittests.cfg | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

Comments

David Hildenbrand Feb. 3, 2022, 4:27 p.m. UTC | #1
On 03.02.22 17:18, Claudio Imbrenda wrote:
> If using the qemu CPU type, Protected Virtualization is not available,
> and the test will fail to start when run in PV. If specifying the host
> CPU type, the test will fail to start with TCG because the host CPU
> type requires KVM. In both cases the test will show up as failed.
> 
> This patch adds a copy of the firq test definitions for KVM, using the
> host CPU type, and specifying that KVM is to be used. The existing
> firq tests are then fixed by specifying that TCG is to be used.
> 
> When running the tests normally, both variants will be run. If an
> accelerator is specified explicitly when running the tests, only one
> variant will run and the other will be skipped (and not fail).
> 
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> Fixes: 8b98745d ("s390x: firq: floating interrupt test")

If only I would have hardware to run PV and it would be easy to setup
for development purposes .... :)

Acked-by: David Hildenbrand <david@redhat.com>
Janosch Frank Feb. 4, 2022, 12:11 p.m. UTC | #2
On 2/3/22 17:18, Claudio Imbrenda wrote:
> If using the qemu CPU type, Protected Virtualization is not available,
> and the test will fail to start when run in PV. If specifying the host
> CPU type, the test will fail to start with TCG because the host CPU
> type requires KVM. In both cases the test will show up as failed.
> 
> This patch adds a copy of the firq test definitions for KVM, using the
> host CPU type, and specifying that KVM is to be used. The existing
> firq tests are then fixed by specifying that TCG is to be used.
> 
> When running the tests normally, both variants will be run. If an
> accelerator is specified explicitly when running the tests, only one
> variant will run and the other will be skipped (and not fail).
> 
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> Fixes: 8b98745d ("s390x: firq: floating interrupt test")
> ---

That would indeed explain what went wrong :)
Acked-by: Janosch Frank <frankja@linux.ibm.com>

>   s390x/unittests.cfg | 18 ++++++++++++++++--
>   1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg
> index 054560c2..1600e714 100644
> --- a/s390x/unittests.cfg
> +++ b/s390x/unittests.cfg
> @@ -113,12 +113,26 @@ file = mvpg-sie.elf
>   [spec_ex-sie]
>   file = spec_ex-sie.elf
>   
> -[firq-linear-cpu-ids]
> +[firq-linear-cpu-ids-kvm]
> +file = firq.elf
> +timeout = 20
> +extra_params = -smp 1,maxcpus=3 -device host-s390x-cpu,core-id=1 -device host-s390x-cpu,core-id=2
> +accel = kvm
> +
> +[firq-nonlinear-cpu-ids-kvm]
> +file = firq.elf
> +timeout = 20
> +extra_params = -smp 1,maxcpus=3 -device host-s390x-cpu,core-id=2 -device host-s390x-cpu,core-id=1
> +accel = kvm
> +
> +[firq-linear-cpu-ids-tcg]
>   file = firq.elf
>   timeout = 20
>   extra_params = -smp 1,maxcpus=3 -cpu qemu -device qemu-s390x-cpu,core-id=1 -device qemu-s390x-cpu,core-id=2
> +accel = tcg
>   
> -[firq-nonlinear-cpu-ids]
> +[firq-nonlinear-cpu-ids-tcg]
>   file = firq.elf
>   timeout = 20
>   extra_params = -smp 1,maxcpus=3 -cpu qemu -device qemu-s390x-cpu,core-id=2 -device qemu-s390x-cpu,core-id=1
> +accel = tcg
>
diff mbox series

Patch

diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg
index 054560c2..1600e714 100644
--- a/s390x/unittests.cfg
+++ b/s390x/unittests.cfg
@@ -113,12 +113,26 @@  file = mvpg-sie.elf
 [spec_ex-sie]
 file = spec_ex-sie.elf
 
-[firq-linear-cpu-ids]
+[firq-linear-cpu-ids-kvm]
+file = firq.elf
+timeout = 20
+extra_params = -smp 1,maxcpus=3 -device host-s390x-cpu,core-id=1 -device host-s390x-cpu,core-id=2
+accel = kvm
+
+[firq-nonlinear-cpu-ids-kvm]
+file = firq.elf
+timeout = 20
+extra_params = -smp 1,maxcpus=3 -device host-s390x-cpu,core-id=2 -device host-s390x-cpu,core-id=1
+accel = kvm
+
+[firq-linear-cpu-ids-tcg]
 file = firq.elf
 timeout = 20
 extra_params = -smp 1,maxcpus=3 -cpu qemu -device qemu-s390x-cpu,core-id=1 -device qemu-s390x-cpu,core-id=2
+accel = tcg
 
-[firq-nonlinear-cpu-ids]
+[firq-nonlinear-cpu-ids-tcg]
 file = firq.elf
 timeout = 20
 extra_params = -smp 1,maxcpus=3 -cpu qemu -device qemu-s390x-cpu,core-id=2 -device qemu-s390x-cpu,core-id=1
+accel = tcg