All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] target/arm: disable-tcg and without-default-devices fixes
@ 2023-05-05 12:35 Fabiano Rosas
  2023-05-05 12:35 ` [PATCH v2 1/3] target/arm: Select SEMIHOSTING when using TCG Fabiano Rosas
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Fabiano Rosas @ 2023-05-05 12:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Peter Maydell, Philippe Mathieu-Daudé,
	Richard Henderson, Alex Bennée, Paolo Bonzini

Since v1:

Used the 'select if TCG' pattern for both build issues.

We don't want to use imply for semihosting because we'd need to
unpoison* CONFIG_SEMIHOSTING and include CONFIG_DEVICES from helper.c
when building with '--enable-tcg --without-default-devices'.

*- I see the config at build/config-poison.h but the compiler does not
   complain about the usage. It just gets ignored. Any idea why?

CI run: https://gitlab.com/farosas/qemu/-/pipelines/857704454

v1:
https://lore.kernel.org/r/20230503193833.29047-1-farosas@suse.de

Here's the fix for the cdrom test failure that we discussed in the
list, plus 2 fixes for the ---without-default-devices build.

When I moved the boards CONFIGs from default.mak to Kconfig, it became
possible (due to --without-default-devices) to disable the CONFIGs for
all the boards that require ARM_V7M. That breaks the build because
ARM_V7M is required to be always set.

Fabiano Rosas (3):
  target/arm: Select SEMIHOSTING when using TCG
  target/arm: Select CONFIG_ARM_V7M when TCG is enabled
  tests/qtest: Don't run cdrom tests if no accelerator is present

 target/arm/Kconfig       | 9 ++-------
 tests/qtest/cdrom-test.c | 5 +++++
 2 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.35.3



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/3] target/arm: Select SEMIHOSTING when using TCG
  2023-05-05 12:35 [PATCH v2 0/3] target/arm: disable-tcg and without-default-devices fixes Fabiano Rosas
@ 2023-05-05 12:35 ` Fabiano Rosas
  2023-05-05 12:35 ` [PATCH v2 2/3] target/arm: Select CONFIG_ARM_V7M when TCG is enabled Fabiano Rosas
  2023-05-05 12:35 ` [PATCH v2 3/3] tests/qtest: Don't run cdrom tests if no accelerator is present Fabiano Rosas
  2 siblings, 0 replies; 5+ messages in thread
From: Fabiano Rosas @ 2023-05-05 12:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Peter Maydell, Philippe Mathieu-Daudé,
	Richard Henderson, Alex Bennée, Paolo Bonzini

Semihosting has been made a 'default y' entry in Kconfig, which does
not work because when building --without-default-devices, the
semihosting code would not be available.

Make semihosting unconditional when TCG is present.

Fixes: 29d9efca16 ("arm/Kconfig: Do not build TCG-only boards on a KVM-only build")
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 target/arm/Kconfig | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/target/arm/Kconfig b/target/arm/Kconfig
index 39f05b6420..3fffdcb61b 100644
--- a/target/arm/Kconfig
+++ b/target/arm/Kconfig
@@ -1,13 +1,7 @@
 config ARM
     bool
+    select ARM_COMPATIBLE_SEMIHOSTING if TCG
 
 config AARCH64
     bool
     select ARM
-
-# This config exists just so we can make SEMIHOSTING default when TCG
-# is selected without also changing it for other architectures.
-config ARM_SEMIHOSTING
-    bool
-    default y if TCG && ARM
-    select ARM_COMPATIBLE_SEMIHOSTING
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/3] target/arm: Select CONFIG_ARM_V7M when TCG is enabled
  2023-05-05 12:35 [PATCH v2 0/3] target/arm: disable-tcg and without-default-devices fixes Fabiano Rosas
  2023-05-05 12:35 ` [PATCH v2 1/3] target/arm: Select SEMIHOSTING when using TCG Fabiano Rosas
@ 2023-05-05 12:35 ` Fabiano Rosas
  2023-05-05 12:35 ` [PATCH v2 3/3] tests/qtest: Don't run cdrom tests if no accelerator is present Fabiano Rosas
  2 siblings, 0 replies; 5+ messages in thread
From: Fabiano Rosas @ 2023-05-05 12:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Peter Maydell, Philippe Mathieu-Daudé,
	Richard Henderson, Alex Bennée, Paolo Bonzini

We cannot allow this config to be disabled at the moment as not all of
the relevant code is protected by it.

Commit 29d9efca16 ("arm/Kconfig: Do not build TCG-only boards on a
KVM-only build") moved the CONFIGs of several boards to Kconfig, so it
is now possible that nothing selects ARM_V7M (e.g. when doing a
--without-default-devices build).

Return the CONFIG_ARM_V7M entry to a state where it is always selected
whenever TCG is available.

Fixes: 29d9efca16 ("arm/Kconfig: Do not build TCG-only boards on a KVM-only build")
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 target/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/arm/Kconfig b/target/arm/Kconfig
index 3fffdcb61b..5947366f6e 100644
--- a/target/arm/Kconfig
+++ b/target/arm/Kconfig
@@ -1,6 +1,7 @@
 config ARM
     bool
     select ARM_COMPATIBLE_SEMIHOSTING if TCG
+    select ARM_V7M if TCG
 
 config AARCH64
     bool
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 3/3] tests/qtest: Don't run cdrom tests if no accelerator is present
  2023-05-05 12:35 [PATCH v2 0/3] target/arm: disable-tcg and without-default-devices fixes Fabiano Rosas
  2023-05-05 12:35 ` [PATCH v2 1/3] target/arm: Select SEMIHOSTING when using TCG Fabiano Rosas
  2023-05-05 12:35 ` [PATCH v2 2/3] target/arm: Select CONFIG_ARM_V7M when TCG is enabled Fabiano Rosas
@ 2023-05-05 12:35 ` Fabiano Rosas
  2023-05-05 14:31   ` Thomas Huth
  2 siblings, 1 reply; 5+ messages in thread
From: Fabiano Rosas @ 2023-05-05 12:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-arm, Peter Maydell, Philippe Mathieu-Daudé,
	Richard Henderson, Alex Bennée, Paolo Bonzini, John Snow,
	Thomas Huth, Laurent Vivier

On a build configured with: --disable-tcg --enable-xen it is possible
to produce a QEMU binary with no TCG nor KVM support. Skip the test if
that's the case.

Fixes: 0c1ae3ff9d ("tests/qtest: Fix tests when no KVM or TCG are present")
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
 tests/qtest/cdrom-test.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c
index 26a2400181..09655e6ff0 100644
--- a/tests/qtest/cdrom-test.c
+++ b/tests/qtest/cdrom-test.c
@@ -205,6 +205,11 @@ int main(int argc, char **argv)
 
     g_test_init(&argc, &argv, NULL);
 
+    if (!qtest_has_accel("tcg") && !qtest_has_accel("kvm")) {
+        g_test_skip("No KVM or TCG accelerator available");
+        return 0;
+    }
+
     if (exec_genisoimg(genisocheck)) {
         /* genisoimage not available - so can't run tests */
         return g_test_run();
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 3/3] tests/qtest: Don't run cdrom tests if no accelerator is present
  2023-05-05 12:35 ` [PATCH v2 3/3] tests/qtest: Don't run cdrom tests if no accelerator is present Fabiano Rosas
@ 2023-05-05 14:31   ` Thomas Huth
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2023-05-05 14:31 UTC (permalink / raw)
  To: Fabiano Rosas, qemu-devel
  Cc: qemu-arm, Peter Maydell, Philippe Mathieu-Daudé,
	Richard Henderson, Alex Bennée, Paolo Bonzini, John Snow,
	Laurent Vivier

On 05/05/2023 14.35, Fabiano Rosas wrote:
> On a build configured with: --disable-tcg --enable-xen it is possible
> to produce a QEMU binary with no TCG nor KVM support. Skip the test if
> that's the case.
> 
> Fixes: 0c1ae3ff9d ("tests/qtest: Fix tests when no KVM or TCG are present")
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
>   tests/qtest/cdrom-test.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c
> index 26a2400181..09655e6ff0 100644
> --- a/tests/qtest/cdrom-test.c
> +++ b/tests/qtest/cdrom-test.c
> @@ -205,6 +205,11 @@ int main(int argc, char **argv)
>   
>       g_test_init(&argc, &argv, NULL);
>   
> +    if (!qtest_has_accel("tcg") && !qtest_has_accel("kvm")) {
> +        g_test_skip("No KVM or TCG accelerator available");
> +        return 0;
> +    }

You only nee to skip the test if running with x86 or s390x, all other 
targets use only "-accel qtest" IIRC, so those shoul be fine.

  Thomas



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-05 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-05 12:35 [PATCH v2 0/3] target/arm: disable-tcg and without-default-devices fixes Fabiano Rosas
2023-05-05 12:35 ` [PATCH v2 1/3] target/arm: Select SEMIHOSTING when using TCG Fabiano Rosas
2023-05-05 12:35 ` [PATCH v2 2/3] target/arm: Select CONFIG_ARM_V7M when TCG is enabled Fabiano Rosas
2023-05-05 12:35 ` [PATCH v2 3/3] tests/qtest: Don't run cdrom tests if no accelerator is present Fabiano Rosas
2023-05-05 14:31   ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.