[PATCH] arm: Kconfig: disable stellaris if Rust is enabled

Paolo Bonzini posted 1 patch 1 year, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20241022085359.186470-1-pbonzini@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>
hw/arm/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] arm: Kconfig: disable stellaris if Rust is enabled
Posted by Paolo Bonzini 1 year, 3 months ago
The stellaris board requires the pl011-luminary variant of pl011,
which is not supported by the Rust implementation.

There are at least three possibilities: 1) implement the subclass
(a bit harder in Rust since the language does not have subclasses)
2) change the ID to a property 3) split pl011-luminary to a separate
Kconfig symbol and leave the subclass as C code.

Just for the sake of starting the discussion, this RFC patch uses
the big axe and disables stellaris.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/arm/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index e7fd9338d11..d5ade150d23 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -219,12 +219,12 @@ config STELLARIS
     bool
     default y
     depends on TCG && ARM
+    depends on !HAVE_RUST # Rust does not implement pl011-luminary
     imply I2C_DEVICES
     select ARM_V7M
     select CMSDK_APB_WATCHDOG
     select I2C
-    select PL011 if !HAVE_RUST # UART
-    select X_PL011_RUST if HAVE_RUST # UART
+    select PL011 # UART
     select PL022 # SPI
     select PL061 # GPIO
     select SSD0303 # OLED display
-- 
2.46.2
Re: [PATCH] arm: Kconfig: disable stellaris if Rust is enabled
Posted by Manos Pitsidianakis 1 year, 3 months ago
Hello Paolo,

On Tue, 22 Oct 2024 at 11:54, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The stellaris board requires the pl011-luminary variant of pl011,
> which is not supported by the Rust implementation.
>
> There are at least three possibilities: 1) implement the subclass
> (a bit harder in Rust since the language does not have subclasses)
> 2) change the ID to a property 3) split pl011-luminary to a separate
> Kconfig symbol and leave the subclass as C code.
>
> Just for the sake of starting the discussion, this RFC patch uses
> the big axe and disables stellaris.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/arm/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
> index e7fd9338d11..d5ade150d23 100644
> --- a/hw/arm/Kconfig
> +++ b/hw/arm/Kconfig
> @@ -219,12 +219,12 @@ config STELLARIS
>      bool
>      default y
>      depends on TCG && ARM
> +    depends on !HAVE_RUST # Rust does not implement pl011-luminary
>      imply I2C_DEVICES
>      select ARM_V7M
>      select CMSDK_APB_WATCHDOG
>      select I2C
> -    select PL011 if !HAVE_RUST # UART
> -    select X_PL011_RUST if HAVE_RUST # UART
> +    select PL011 # UART
>      select PL022 # SPI
>      select PL061 # GPIO
>      select SSD0303 # OLED display
> --
> 2.46.2
>

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>

By the way I already have a patch that adds a -luminary version,
planning on including it with the rest of my procedural macro patches
I will send.
Re: [PATCH] arm: Kconfig: disable stellaris if Rust is enabled
Posted by Paolo Bonzini 1 year, 3 months ago
On Wed, Oct 23, 2024 at 12:28 PM Manos Pitsidianakis
<manos.pitsidianakis@linaro.org> wrote:
> By the way I already have a patch that adds a -luminary version,
> planning on including it with the rest of my procedural macro patches
> I will send.

I'll hold on this patch until I get yours then. It is not needed yet
for CI, since we don't run tests with Rust enabled.

Paolo
Re: [PATCH] arm: Kconfig: disable stellaris if Rust is enabled
Posted by Peter Maydell 1 year, 3 months ago
On Tue, 22 Oct 2024 at 09:54, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The stellaris board requires the pl011-luminary variant of pl011,
> which is not supported by the Rust implementation.
>
> There are at least three possibilities: 1) implement the subclass
> (a bit harder in Rust since the language does not have subclasses)
> 2) change the ID to a property 3) split pl011-luminary to a separate
> Kconfig symbol and leave the subclass as C code.
>
> Just for the sake of starting the discussion, this RFC patch uses
> the big axe and disables stellaris.

Reasonable enough as a starter. For the longer term, we should
figure out how we want to handle this kind of "we have a common
base QOM class that implements almost all of the behaviour
and we subclass it to implement different minor variants"
in Rust, because we use it a fair amount in the existing C code.

-- PMM