Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
---
docs/schemas/basictypes.rng | 2 ++
src/qemu/qemu_domain.c | 2 ++
src/util/virarch.c | 5 ++++-
src/util/virarch.h | 8 +++++++-
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index 1a18cd31b1..14a3670e5c 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -398,6 +398,8 @@
<value>ppc64</value>
<value>ppc64le</value>
<value>ppcemb</value>
+ <value>riscv32</value>
+ <value>riscv64</value>
<value>s390</value>
<value>s390x</value>
<value>sh4</value>
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index fcb37d45e6..60b4a9b412 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3249,6 +3249,8 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
case VIR_ARCH_OR32:
case VIR_ARCH_PARISC:
case VIR_ARCH_PARISC64:
+ case VIR_ARCH_RISCV32:
+ case VIR_ARCH_RISCV64:
case VIR_ARCH_PPCLE:
case VIR_ARCH_UNICORE32:
case VIR_ARCH_XTENSA:
diff --git a/src/util/virarch.c b/src/util/virarch.c
index be48bcfb89..3f5efde8e2 100644
--- a/src/util/virarch.c
+++ b/src/util/virarch.c
@@ -65,15 +65,18 @@ static const struct virArchData {
{ "ppc64le", 64, VIR_ARCH_LITTLE_ENDIAN },
{ "ppcemb", 32, VIR_ARCH_BIG_ENDIAN },
+ { "riscv32", 32, VIR_ARCH_LITTLE_ENDIAN },
+ { "riscv64", 64, VIR_ARCH_LITTLE_ENDIAN },
{ "s390", 32, VIR_ARCH_BIG_ENDIAN },
{ "s390x", 64, VIR_ARCH_BIG_ENDIAN },
{ "sh4", 32, VIR_ARCH_LITTLE_ENDIAN },
+
{ "sh4eb", 64, VIR_ARCH_BIG_ENDIAN },
{ "sparc", 32, VIR_ARCH_BIG_ENDIAN },
-
{ "sparc64", 64, VIR_ARCH_BIG_ENDIAN },
{ "unicore32", 32, VIR_ARCH_LITTLE_ENDIAN },
{ "x86_64", 64, VIR_ARCH_LITTLE_ENDIAN },
+
{ "xtensa", 32, VIR_ARCH_LITTLE_ENDIAN },
{ "xtensaeb", 32, VIR_ARCH_BIG_ENDIAN },
};
diff --git a/src/util/virarch.h b/src/util/virarch.h
index af5ff83528..a52de7f52c 100644
--- a/src/util/virarch.h
+++ b/src/util/virarch.h
@@ -55,15 +55,18 @@ typedef enum {
VIR_ARCH_PPC64LE, /* PowerPC 64 LE http://en.wikipedia.org/wiki/PowerPC */
VIR_ARCH_PPCEMB, /* PowerPC 32 BE http://en.wikipedia.org/wiki/PowerPC */
+ VIR_ARCH_RISCV32, /* RISC-V 64 LE http://en.wikipedia.org/wiki/RISC-V */
+ VIR_ARCH_RISCV64, /* RISC-V 32 BE http://en.wikipedia.org/wiki/RISC-V */
VIR_ARCH_S390, /* S390 32 BE http://en.wikipedia.org/wiki/S390 */
VIR_ARCH_S390X, /* S390 64 BE http://en.wikipedia.org/wiki/S390x */
VIR_ARCH_SH4, /* SuperH4 32 LE http://en.wikipedia.org/wiki/SuperH */
+
VIR_ARCH_SH4EB, /* SuperH4 32 BE http://en.wikipedia.org/wiki/SuperH */
VIR_ARCH_SPARC, /* Sparc 32 BE http://en.wikipedia.org/wiki/Sparc */
-
VIR_ARCH_SPARC64, /* Sparc 64 BE http://en.wikipedia.org/wiki/Sparc */
VIR_ARCH_UNICORE32, /* UniCore 32 LE http://en.wikipedia.org/wiki/Unicore*/
VIR_ARCH_X86_64, /* x86 64 LE http://en.wikipedia.org/wiki/X86 */
+
VIR_ARCH_XTENSA, /* XTensa 32 LE http://en.wikipedia.org/wiki/Xtensa#Processor_Cores */
VIR_ARCH_XTENSAEB, /* XTensa 32 BE http://en.wikipedia.org/wiki/Xtensa#Processor_Cores */
@@ -87,6 +90,9 @@ typedef enum {
(arch) == VIR_ARCH_ARMV7B ||\
(arch) == VIR_ARCH_AARCH64)
+# define ARCH_IS_RISCV(arch) ((arch) == VIR_ARCH_RISCV32 ||\
+ (arch) == VIR_ARCH_RISCV64)
+
# define ARCH_IS_S390(arch) ((arch) == VIR_ARCH_S390 ||\
(arch) == VIR_ARCH_S390X)
--
2.17.1
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
On Wed, 2018-08-22 at 11:15 +0200, Lubomir Rintel wrote: > + VIR_ARCH_RISCV32, /* RISC-V 64 LE http://en.wikipedia.org/wiki/RISC-V */ This should be 32 LE ... > + VIR_ARCH_RISCV64, /* RISC-V 32 BE http://en.wikipedia.org/wiki/RISC-V */ ... and this should be 64 LE according to the corresponding implementation. I'll take care of it before pushing. Reviewed-by: Andrea Bolognani <abologna@redhat.com> -- Andrea Bolognani / Red Hat / Virtualization -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
On Thu, 2018-08-23 at 17:30 +0200, Andrea Bolognani wrote:
> On Wed, 2018-08-22 at 11:15 +0200, Lubomir Rintel wrote:
> > + VIR_ARCH_RISCV32, /* RISC-V 64 LE http://en.wikipedia.org/wiki/RISC-V */
>
> This should be 32 LE ...
>
> > + VIR_ARCH_RISCV64, /* RISC-V 32 BE http://en.wikipedia.org/wiki/RISC-V */
>
> ... and this should be 64 LE
>
> according to the corresponding implementation.
>
> I'll take care of it before pushing.
I also had to squash in the diff below, which is necessary for
the build to succeed after commit d1a6d73ddff2 (pushed minutes
ago, so your series couldn't possibly account for that :).
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 6a3914bde2..9fae713c63 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2298,15 +2298,18 @@ static const char *preferredMachines[] =
"pseries", /* VIR_ARCH_PPC64LE */
"bamboo", /* VIR_ARCH_PPCEMB */
+ "spike_v1.10", /* VIR_ARCH_RISCV32 */
+ "spike_v1.10", /* VIR_ARCH_RISCV64 */
NULL, /* VIR_ARCH_S390 (no QEMU impl) */
"s390-ccw-virtio", /* VIR_ARCH_S390X */
"shix", /* VIR_ARCH_SH4 */
+
"shix", /* VIR_ARCH_SH4EB */
"SS-5", /* VIR_ARCH_SPARC */
-
"sun4u", /* VIR_ARCH_SPARC64 */
"puv3", /* VIR_ARCH_UNICORE32 */
"pc", /* VIR_ARCH_X86_64 */
+
"sim", /* VIR_ARCH_XTENSA */
"sim", /* VIR_ARCH_XTENSAEB */
};
--
Andrea Bolognani / Red Hat / Virtualization
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
© 2016 - 2026 Red Hat, Inc.