target/riscv: Only build qemu-system-riscv$$ on rv$$ host
cover target/riscv: Only build qemu-system-riscv$$ on rv$$ host
Per Anup Patel in [*]:
Quoted 5 lines
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.
Based-on: <[email protected]> "target/riscv: Allow building without TCG (KVM-only so far)"
https://lore.kernel.org/qemu-devel/[email protected]/
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(-)
Signature · 1 line
2.38.1
PATCH 1/2 target/riscv: Only unify 'riscv32/64' -> 'riscv' for host cpu in meson
We want to keep the ability to distinct between 32/64-bit host.
--- meson.build | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
meson.build +4 -7
@@ -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 = []
Signature · 1 line
2.38.1
PATCH 2/2 target/riscv: Only build KVM guest with same wordsize as host
In reply to Philippe Mathieu-DaudéPer Anup Patel in [*]:
Quoted 5 lines
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.
--- meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
meson.build +4 -2
@@ -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
Signature · 1 line
2.38.1
Quoted 19 lines · Philippe Mathieu-Daudé
Per Anup Patel in [*]:
Quoted 5 lines
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.
Based-on: <[email protected]> "target/riscv: Allow building without TCG (KVM-only so far)"
https://lore.kernel.org/qemu-devel/[email protected]/
Quoted 7 lines
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 hostmeson.build | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
r~
Quoted 13 lines · Philippe Mathieu-Daudé
Per Anup Patel in [*]:
Quoted 5 lines
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.
Quoted 5 lines
Based-on: <[email protected]> "target/riscv: Allow building without TCG (KVM-only so far)"
https://lore.kernel.org/qemu-devel/[email protected]/
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.
Quoted 16 lines · Philippe Mathieu-Daudé
Per Anup Patel in [*]:
Quoted 5 lines
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.
Quoted 7 lines
Based-on: <[email protected]> "target/riscv: Allow building without TCG (KVM-only so far)"
https://lore.kernel.org/qemu-devel/[email protected]/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
Alistair
Quoted 8 lines
meson.build | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)--
2.38.1
Alistair Francis
AppliedQuoted 16 lines · Philippe Mathieu-Daudé
Per Anup Patel in [*]:
Quoted 5 lines
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.
Quoted 7 lines
Based-on: <[email protected]> "target/riscv: Allow building without TCG (KVM-only so far)"
https://lore.kernel.org/qemu-devel/[email protected]/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
Quoted 8 lines
meson.build | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)--
2.38.1