* [PATCH 1/2] target/riscv: Only unify 'riscv32/64' -> 'riscv' for host cpu in meson
2023-06-27 14:32 [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host Philippe Mathieu-Daudé
@ 2023-06-27 14:32 ` Philippe Mathieu-Daudé
2023-06-27 14:32 ` [PATCH 2/2] target/riscv: Only build KVM guest with same wordsize as host Philippe Mathieu-Daudé
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-27 14:32 UTC (permalink / raw)
To: qemu-devel
Cc: Alistair Francis, Paolo Bonzini, Weiwei Li, Palmer Dabbelt,
Marc-André Lureau, Bin Meng, Daniel P. Berrangé,
Daniel Henrique Barboza, Liu Zhiwei, Thomas Huth,
Philippe Mathieu-Daudé, qemu-riscv
We want to keep the ability to distinct between 32/64-bit host.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
meson.build | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/meson.build b/meson.build
index fc3c14a810..649de244c6 100644
--- a/meson.build
+++ b/meson.build
@@ -55,16 +55,11 @@ qapi_trace_events = []
bsd_oses = ['gnu/kfreebsd', 'freebsd', 'netbsd', 'openbsd', 'dragonfly', 'darwin']
supported_oses = ['windows', 'freebsd', 'netbsd', 'openbsd', 'darwin', 'sunos', 'linux']
-supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv', 'x86', 'x86_64',
+supported_cpus = ['ppc', 'ppc64', 's390x', 'riscv32', 'riscv64', 'x86', 'x86_64',
'arm', 'aarch64', 'loongarch64', 'mips', 'mips64', 'sparc64']
cpu = host_machine.cpu_family()
-# Unify riscv* to a single family.
-if cpu in ['riscv32', 'riscv64']
- cpu = 'riscv'
-endif
-
target_dirs = config_host['TARGET_DIRS'].split()
have_linux_user = false
have_bsd_user = false
@@ -99,6 +94,8 @@ elif cpu == 'x86'
host_arch = 'i386'
elif cpu == 'mips64'
host_arch = 'mips'
+elif cpu in ['riscv32', 'riscv64']
+ host_arch = 'riscv'
else
host_arch = cpu
endif
@@ -113,7 +110,7 @@ elif cpu in ['ppc', 'ppc64']
kvm_targets = ['ppc-softmmu', 'ppc64-softmmu']
elif cpu in ['mips', 'mips64']
kvm_targets = ['mips-softmmu', 'mipsel-softmmu', 'mips64-softmmu', 'mips64el-softmmu']
-elif cpu in ['riscv']
+elif cpu in ['riscv32', 'riscv64']
kvm_targets = ['riscv32-softmmu', 'riscv64-softmmu']
else
kvm_targets = []
--
2.38.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] target/riscv: Only build KVM guest with same wordsize as host
2023-06-27 14:32 [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host Philippe Mathieu-Daudé
2023-06-27 14:32 ` [PATCH 1/2] target/riscv: Only unify 'riscv32/64' -> 'riscv' for host cpu in meson Philippe Mathieu-Daudé
@ 2023-06-27 14:32 ` Philippe Mathieu-Daudé
2023-06-28 7:48 ` [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host Richard Henderson
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-27 14:32 UTC (permalink / raw)
To: qemu-devel
Cc: Alistair Francis, Paolo Bonzini, Weiwei Li, Palmer Dabbelt,
Marc-André Lureau, Bin Meng, Daniel P. Berrangé,
Daniel Henrique Barboza, Liu Zhiwei, Thomas Huth,
Philippe Mathieu-Daudé, qemu-riscv
Per Anup Patel in [*]:
> Currently, we only support running rv64 guest on rv64 host
> and rv32 guest on rv32 host.
>
> In the future, we might support running rv32 guest on rv64
> host but as of now we don't see a strong push for it.
Therefore, when only using the KVM accelerator it is pointless
to build qemu-system-riscv32 on a rv64 host (or qemu-system-riscv64
on a rv32 host). Restrict meson to only build the correct binary,
avoiding to waste ressources building unusable code.
[*] https://lore.kernel.org/qemu-devel/CAAhSdy2JeRHeeoEc1XKQhPO3aDz4YKeyQsPT4S8yKJcYTA+AiQ@mail.gmail.com/
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
meson.build | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index 649de244c6..a3ab614235 100644
--- a/meson.build
+++ b/meson.build
@@ -110,8 +110,10 @@ elif cpu in ['ppc', 'ppc64']
kvm_targets = ['ppc-softmmu', 'ppc64-softmmu']
elif cpu in ['mips', 'mips64']
kvm_targets = ['mips-softmmu', 'mipsel-softmmu', 'mips64-softmmu', 'mips64el-softmmu']
-elif cpu in ['riscv32', 'riscv64']
- kvm_targets = ['riscv32-softmmu', 'riscv64-softmmu']
+elif cpu in ['riscv32']
+ kvm_targets = ['riscv32-softmmu']
+elif cpu in ['riscv64']
+ kvm_targets = ['riscv64-softmmu']
else
kvm_targets = []
endif
--
2.38.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host
2023-06-27 14:32 [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host Philippe Mathieu-Daudé
2023-06-27 14:32 ` [PATCH 1/2] target/riscv: Only unify 'riscv32/64' -> 'riscv' for host cpu in meson Philippe Mathieu-Daudé
2023-06-27 14:32 ` [PATCH 2/2] target/riscv: Only build KVM guest with same wordsize as host Philippe Mathieu-Daudé
@ 2023-06-28 7:48 ` Richard Henderson
2023-06-28 7:55 ` Philippe Mathieu-Daudé
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Richard Henderson @ 2023-06-28 7:48 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel
Cc: Alistair Francis, Paolo Bonzini, Weiwei Li, Palmer Dabbelt,
Marc-André Lureau, Bin Meng, Daniel P. Berrangé,
Daniel Henrique Barboza, Liu Zhiwei, Thomas Huth, qemu-riscv
On 6/27/23 16:32, Philippe Mathieu-Daudé wrote:
> Per Anup Patel in [*]:
>
> > Currently, we only support running rv64 guest on rv64 host
> > and rv32 guest on rv32 host.
> >
> > In the future, we might support running rv32 guest on rv64
> > host but as of now we don't see a strong push for it.
>
> Therefore, when only using the KVM accelerator it is pointless
> to build qemu-system-riscv32 on a rv64 host (or qemu-system-riscv64
> on a rv32 host). Restrict meson to only build the correct binary,
> avoiding to waste ressources building unusable code.
>
> [*] https://lore.kernel.org/qemu-devel/CAAhSdy2JeRHeeoEc1XKQhPO3aDz4YKeyQsPT4S8yKJcYTA+AiQ@mail.gmail.com/
>
> Based-on: <20230626232007.8933-1-philmd@linaro.org>
> "target/riscv: Allow building without TCG (KVM-only so far)"
> https://lore.kernel.org/qemu-devel/20230626232007.8933-1-philmd@linaro.org/
>
> Philippe Mathieu-Daudé (2):
> target/riscv: Only unify 'riscv32/64' -> 'riscv' for host cpu in meson
> target/riscv: Only build KVM guest with same wordsize as host
>
> meson.build | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host
2023-06-27 14:32 [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2023-06-28 7:48 ` [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host Richard Henderson
@ 2023-06-28 7:55 ` Philippe Mathieu-Daudé
2023-07-03 2:24 ` Alistair Francis
2023-07-03 2:26 ` Alistair Francis
5 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-28 7:55 UTC (permalink / raw)
To: qemu-devel
Cc: Alistair Francis, Paolo Bonzini, Weiwei Li, Palmer Dabbelt,
Marc-André Lureau, Bin Meng, Daniel P. Berrangé,
Daniel Henrique Barboza, Liu Zhiwei, Thomas Huth, qemu-riscv
On 27/6/23 16:32, Philippe Mathieu-Daudé wrote:
> Per Anup Patel in [*]:
>
> > Currently, we only support running rv64 guest on rv64 host
> > and rv32 guest on rv32 host.
> >
> > In the future, we might support running rv32 guest on rv64
> > host but as of now we don't see a strong push for it.
>
> Therefore, when only using the KVM accelerator it is pointless
> to build qemu-system-riscv32 on a rv64 host (or qemu-system-riscv64
> on a rv32 host). Restrict meson to only build the correct binary,
> avoiding to waste ressources building unusable code.
>
> [*] https://lore.kernel.org/qemu-devel/CAAhSdy2JeRHeeoEc1XKQhPO3aDz4YKeyQsPT4S8yKJcYTA+AiQ@mail.gmail.com/
>
> Based-on: <20230626232007.8933-1-philmd@linaro.org>
> "target/riscv: Allow building without TCG (KVM-only so far)"
> https://lore.kernel.org/qemu-devel/20230626232007.8933-1-philmd@linaro.org/
Alistair: I just noticed there is no strict dependency with the
other series (aimed for 8.2), so this can get merged for 8.1.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host
2023-06-27 14:32 [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2023-06-28 7:55 ` Philippe Mathieu-Daudé
@ 2023-07-03 2:24 ` Alistair Francis
2023-07-03 2:26 ` Alistair Francis
5 siblings, 0 replies; 7+ messages in thread
From: Alistair Francis @ 2023-07-03 2:24 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Alistair Francis, Paolo Bonzini, Weiwei Li,
Palmer Dabbelt, Marc-André Lureau, Bin Meng,
Daniel P. Berrangé, Daniel Henrique Barboza, Liu Zhiwei,
Thomas Huth, qemu-riscv
On Wed, Jun 28, 2023 at 12:33 AM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> Per Anup Patel in [*]:
>
> > Currently, we only support running rv64 guest on rv64 host
> > and rv32 guest on rv32 host.
> >
> > In the future, we might support running rv32 guest on rv64
> > host but as of now we don't see a strong push for it.
>
> Therefore, when only using the KVM accelerator it is pointless
> to build qemu-system-riscv32 on a rv64 host (or qemu-system-riscv64
> on a rv32 host). Restrict meson to only build the correct binary,
> avoiding to waste ressources building unusable code.
>
> [*] https://lore.kernel.org/qemu-devel/CAAhSdy2JeRHeeoEc1XKQhPO3aDz4YKeyQsPT4S8yKJcYTA+AiQ@mail.gmail.com/
>
> Based-on: <20230626232007.8933-1-philmd@linaro.org>
> "target/riscv: Allow building without TCG (KVM-only so far)"
> https://lore.kernel.org/qemu-devel/20230626232007.8933-1-philmd@linaro.org/
>
> Philippe Mathieu-Daudé (2):
> target/riscv: Only unify 'riscv32/64' -> 'riscv' for host cpu in meson
> target/riscv: Only build KVM guest with same wordsize as host
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
>
> meson.build | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> --
> 2.38.1
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host
2023-06-27 14:32 [PATCH 0/2] target/riscv: Only build qemu-system-riscv$$ on rv$$ host Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2023-07-03 2:24 ` Alistair Francis
@ 2023-07-03 2:26 ` Alistair Francis
5 siblings, 0 replies; 7+ messages in thread
From: Alistair Francis @ 2023-07-03 2:26 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Alistair Francis, Paolo Bonzini, Weiwei Li,
Palmer Dabbelt, Marc-André Lureau, Bin Meng,
Daniel P. Berrangé, Daniel Henrique Barboza, Liu Zhiwei,
Thomas Huth, qemu-riscv
On Wed, Jun 28, 2023 at 12:33 AM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> Per Anup Patel in [*]:
>
> > Currently, we only support running rv64 guest on rv64 host
> > and rv32 guest on rv32 host.
> >
> > In the future, we might support running rv32 guest on rv64
> > host but as of now we don't see a strong push for it.
>
> Therefore, when only using the KVM accelerator it is pointless
> to build qemu-system-riscv32 on a rv64 host (or qemu-system-riscv64
> on a rv32 host). Restrict meson to only build the correct binary,
> avoiding to waste ressources building unusable code.
>
> [*] https://lore.kernel.org/qemu-devel/CAAhSdy2JeRHeeoEc1XKQhPO3aDz4YKeyQsPT4S8yKJcYTA+AiQ@mail.gmail.com/
>
> Based-on: <20230626232007.8933-1-philmd@linaro.org>
> "target/riscv: Allow building without TCG (KVM-only so far)"
> https://lore.kernel.org/qemu-devel/20230626232007.8933-1-philmd@linaro.org/
>
> Philippe Mathieu-Daudé (2):
> target/riscv: Only unify 'riscv32/64' -> 'riscv' for host cpu in meson
> target/riscv: Only build KVM guest with same wordsize as host
Thanks!
Applied to riscv-to-apply.next
Alistair
>
> meson.build | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> --
> 2.38.1
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread