enable riscv build

Bug #1872931 reported by Christian Ehrhardt 
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qemu (Ubuntu)
Fix Released
High
Unassigned

Bug Description

I got the from wgrant and recently qemu in Debian adopted a similar change.
Getting this into Focal would allow riscv to have that functionality (probably more for the tools than actual virtualization).

diff -Nru qemu-4.2/debian/changelog qemu-4.2/debian/changelog
--- qemu-4.2/debian/changelog 2020-02-12 14:21:56.000000000 +0000
+++ qemu-4.2/debian/changelog 2020-03-12 04:16:53.000000000 +0000
@@ -1,3 +1,9 @@
+qemu (1:4.2-3ubuntu1+riscv64.1) focal; urgency=medium
+
+ * Disable rados storage backend on riscv64, where Ceph doesn't exist yet.
+
+ -- William Grant <email address hidden> Thu, 12 Mar 2020 15:16:53 +1100
+
 qemu (1:4.2-3ubuntu1) focal; urgency=medium

   * Merge with Debian testing, remaining changes:
diff -Nru qemu-4.2/debian/control qemu-4.2/debian/control
--- qemu-4.2/debian/control 2020-02-12 14:21:56.000000000 +0000
+++ qemu-4.2/debian/control 2020-03-12 04:16:53.000000000 +0000
@@ -57,8 +57,8 @@
 # --enable-smartcard
  libcacard-dev,
  libpixman-1-dev,
-# --enable-rbd linux-*
- librados-dev [linux-any], librbd-dev [linux-any],
+# --enable-rbd amd64|arm64|armhf|i386|ppc64el|s390x
+ librados-dev [amd64 arm64 armhf i386 ppc64el s390x], librbd-dev [amd64 arm64 armhf i386 ppc64el s390x],
 # glusterfs is debian-only since ubuntu/glusterfs is in universe (MIR LP: #1274247)
 # before buster it was glusterfs-common so keep it for now for bpo
 # --enable-vnc-sasl
@@ -124,7 +124,7 @@
 Vcs-Git: https://git.launchpad.net/ubuntu/+source/qemu

 Package: qemu
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Section: oldlibs
 Depends: ${misc:Depends}
@@ -144,7 +144,7 @@
  This package can safely be removed.

 Package: qemu-system
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${misc:Depends},
  qemu-system-arm,
@@ -165,7 +165,7 @@
  QEMU supports.

 Package: qemu-block-extra
-Architecture: amd64 arm arm64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: same
 Depends: ${misc:Depends}, ${shlibs:Depends},
 Enhances: qemu-utils, qemu-system-misc,
@@ -195,7 +195,7 @@
  QEMU emulation (qemu-system-*) packages.

 Package: qemu-system-common
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Replaces: qemu-system-data (<< 1:3.1+dfsg-1~), qemu-utils (<< 1:4.2-1ubuntu1~)
 Breaks: qemu-system-data (<< 1:3.1+dfsg-1~), qemu-utils (<< 1:4.2-1ubuntu1~)
@@ -214,7 +214,7 @@
  full system emulation (qemu-system-*) packages.

 Package: qemu-system-gui
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${misc:Depends}, ${shlibs:Depends},
 Description: QEMU full system emulation binaries (user interface and audio support)
@@ -222,7 +222,7 @@
  and audio backends for full system emulation (qemu-system-*) packages.

 Package: qemu-system-misc
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
 Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
@@ -248,7 +248,7 @@
  machines on a single server.

 Package: qemu-system-arm
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
 Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
@@ -272,7 +272,7 @@
  machines on a single server.

 Package: qemu-system-mips
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
 Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
@@ -294,7 +294,7 @@
  machines on a single server.

 Package: qemu-system-ppc
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
  qemu-slof,
@@ -320,7 +320,7 @@
  machines on a single server.

 Package: qemu-system-sparc
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
 # ubuntu/openbios-sparc is in universe
@@ -344,7 +344,7 @@
  machines on a single server.

 Package: qemu-system-x86
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
  ipxe-qemu-256k-compat-efi-roms,
@@ -387,7 +387,7 @@
  For any other common KVM based activity qemu-system-x86 will be more suited.

 Package: qemu-user
-Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Recommends: qemu-user-binfmt
@@ -409,7 +409,7 @@
  qemu-user-static will register statically linked binfmt handlers instead.

 Package: qemu-user-static
-Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Built-Using: ${built-using}
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -433,7 +433,7 @@
  directly.

 Package: qemu-user-binfmt
-Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${misc:Depends}, qemu-user (= ${binary:Version}), binfmt-support
 Breaks: binfmt-support (<< 2.1.7~)
@@ -450,7 +450,7 @@
  at install and remove times.

 Package: qemu-utils
-Architecture: amd64 arm arm64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Breaks: qemu-system-common (<< 1:4.2-1ubuntu1~)
 Depends: ${shlibs:Depends}, ${misc:Depends},
@@ -510,7 +510,7 @@
  compatibility.

 Package: qemu-system-s390x
-Architecture: amd64 arm arm64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64
+Architecture: amd64 arm arm64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 2.0.0+dfsg-8~), qemu-system-data (>> ${source:Version}~),
 Recommends: qemu-utils,
diff -Nru qemu-4.2/debian/control-in qemu-4.2/debian/control-in
--- qemu-4.2/debian/control-in 2020-02-12 14:21:56.000000000 +0000
+++ qemu-4.2/debian/control-in 2020-03-12 04:16:50.000000000 +0000
@@ -61,8 +61,8 @@
 # --enable-smartcard
  libcacard-dev,
  libpixman-1-dev,
-# --enable-rbd linux-*
- librados-dev [linux-any], librbd-dev [linux-any],
+# --enable-rbd amd64|arm64|armhf|i386|ppc64el|s390x
+ librados-dev [amd64 arm64 armhf i386 ppc64el s390x], librbd-dev [amd64 arm64 armhf i386 ppc64el s390x],
 # glusterfs is debian-only since ubuntu/glusterfs is in universe (MIR LP: #1274247)
 # before buster it was glusterfs-common so keep it for now for bpo
 :debian:# --enable-glusterfs
@@ -135,7 +135,7 @@
 :ubuntu:Vcs-Git: https://git.launchpad.net/ubuntu/+source/qemu

 Package: qemu
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Section: oldlibs
 Depends: ${misc:Depends}
@@ -155,7 +155,7 @@
  This package can safely be removed.

 Package: qemu-system
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${misc:Depends},
  qemu-system-arm,
@@ -206,7 +206,7 @@
  QEMU emulation (qemu-system-*) packages.

 Package: qemu-system-common
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Replaces: qemu-system-data (<< 1:3.1+dfsg-1~), qemu-utils (<< 1:4.2-1ubuntu1~)
 Breaks: qemu-system-data (<< 1:3.1+dfsg-1~), qemu-utils (<< 1:4.2-1ubuntu1~)
@@ -225,7 +225,7 @@
  full system emulation (qemu-system-*) packages.

 Package: qemu-system-gui
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${misc:Depends}, ${shlibs:Depends},
 Description: QEMU full system emulation binaries (user interface and audio support)
@@ -233,7 +233,7 @@
  and audio backends for full system emulation (qemu-system-*) packages.

 Package: qemu-system-misc
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
 Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
@@ -259,7 +259,7 @@
  machines on a single server.

 Package: qemu-system-arm
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
 Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
@@ -283,7 +283,7 @@
  machines on a single server.

 Package: qemu-system-mips
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
 Recommends: qemu-system-gui (= ${binary:Version}), qemu-utils,
@@ -305,7 +305,7 @@
  machines on a single server.

 Package: qemu-system-ppc
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
  qemu-slof,
@@ -332,7 +332,7 @@
  machines on a single server.

 Package: qemu-system-sparc
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
 # ubuntu/openbios-sparc is in universe
@@ -357,7 +357,7 @@
  machines on a single server.

 Package: qemu-system-x86
-Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 1:2.12~), qemu-system-data (>> ${source:Version}~),
 :ubuntu: ipxe-qemu-256k-compat-efi-roms,
@@ -400,7 +400,7 @@
  For any other common KVM based activity qemu-system-x86 will be more suited.

 Package: qemu-user
-Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Recommends: qemu-user-binfmt
@@ -422,7 +422,7 @@
  qemu-user-static will register statically linked binfmt handlers instead.

 Package: qemu-user-static
-Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Built-Using: ${built-using}
 Multi-Arch: foreign
 Depends: ${shlibs:Depends}, ${misc:Depends}
@@ -446,7 +446,7 @@
  directly.

 Package: qemu-user-binfmt
-Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64 x32
+Architecture: amd64 arm arm64 armel armhf i386 ia64 mips mipsel mips64 mips64el powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64 x32
 Multi-Arch: foreign
 Depends: ${misc:Depends}, qemu-user (= ${binary:Version}), binfmt-support
 Breaks: binfmt-support (<< 2.1.7~)
@@ -525,7 +525,7 @@
  compatibility.

 :ubuntu:Package: qemu-system-s390x
-:ubuntu:Architecture: amd64 arm arm64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc powerpcspe ppc64 ppc64el s390x sparc sparc64
+:ubuntu:Architecture: amd64 arm arm64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc powerpcspe ppc64 ppc64el riscv64 s390x sparc sparc64
 :ubuntu:Multi-Arch: foreign
 :ubuntu:Depends: ${shlibs:Depends}, ${misc:Depends}, qemu-system-common (>> 2.0.0+dfsg-8~), qemu-system-data (>> ${source:Version}~),
 :ubuntu:Recommends: qemu-utils,

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Combined with the recent Debian changes into preliminary changeset, but still discussing if that needs an Feature Freeze exception (or not need to be in 20.04 at all and could be 20.10).

   * enable riscv build (LP: #1872931)
     - enable support for riscv64 hosts
     - only enable librbd on architectures where it is built
     - ceph: do not list librados-dev as we only use librbd-dev and the latter depends on the former
     - seccomp grew up, no need in versioned build-dep
     - enable seccomp only on architectures where it can be built

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

[11:23] <cpaelzer> wgrant: does enabling rsicv have a general FFe?
[11:23] <cpaelzer> or do we need such processing for every change (I'd hope not)
[11:54] <wgrant> It hasn't been suggested to me that an FFe was required for changes that were limited to riscv64.
[11:55] <cpaelzer> I thought enabling another arch usually would fall under that category
[11:55] <cpaelzer> wgrant: what is the immediate use case for this in 20.04 - will people really use it as a host?
[11:56] <wgrant> cpaelzer: qemu-utils
[11:57] <wgrant> qemu-img, etc.
[11:57] <wgrant> And unblocking libvirt and its rdeps
[11:57] <wgrant> libvirt is the fifth most common missing build dependency at present
[11:57] <cpaelzer> xnox: to get a third opinion - do you happen to know if we'd need an FFe (or wait for 20.10) with that?
[12:06] <xnox> cpaelzer: hwe exception. We have standing exception for hardware enablement.
[12:06] <cpaelzer> xnox: I know that for SRUs, are you saying this applies to FFe as well then?
[12:07] <xnox> cpaelzer: we need qemu-utils to build images. Ideally sooner than later.
[12:07] <cpaelzer> well, ok under that banner I can work
[12:07] <cpaelzer> thank you
[12:07] <xnox> cpaelzer: also applies to ffe.

Changed in qemu (Ubuntu):
status: New → In Progress
importance: Undecided → High
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Last build has thrown a build error:

In file included from /<<PKGBUILDDIR>>/hw/s390x/s390-virtio-ccw.c:47:
/<<PKGBUILDDIR>>/linux-headers/linux/kvm.h:14:10: fatal error: asm/kvm.h: No such file or directory
   14 | #include <asm/kvm.h>
      | ^~~~~~~~~~~
compilation terminated.
make[2]: *** [/<<PKGBUILDDIR>>/rules.mak:69: hw/s390x/s390-virtio-ccw.o] Error 1

That actually should only build on s390x or on arch-indep.
Oh no that isn't the rom, that is the actual emulator.

Well, s390x isn't enabled in Debian therefore they don't see it yet.

 75 # qemu-system subpackages, from d/control
 76 ifeq ($(VENDOR),UBUNTU)
 77 sys_systems = arm mips ppc sparc x86 s390x
 78 else
 79 sys_systems = arm mips ppc sparc x86
 80 endif

From https://launchpadlibrarian.net/474741304/buildlog_ubuntu-focal-riscv64.qemu_1%3A4.2-3ubuntu6~ppa1_BUILDING.txt.gz

But I tried and this isn't just the s390x system build it seems to be even the s390x tcg build runs into this. Maybe our kernel headers differ?

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

qemu src has in ./linux-headers/linux/kvm.h
  #include <linux/types.h>
  #include <linux/ioctl.h>
  #include <asm/kvm.h>

So does /usr/include/linux/kvm.h on Focal BTW.

There are two ways to resolve this:
- via system includes by /usr/include/x86_64-linux-gnu/asm/kvm.h
- via internal includes in qemu by ./linux-headers/asm-s390/kvm.h

The latter does not exist for riscv and also it is a "<>" include so it should use the systems headers anyway right?

$ dpkg -S /usr/include/x86_64-linux-gnu/asm/kvm.h
linux-libc-dev:amd64: /usr/include/x86_64-linux-gnu/asm/kvm.h

In the build log I see
Get:8 http://ftpmaster.internal/ubuntu focal-proposed/main riscv64 linux-libc-dev riscv64 5.4.0-24.28 [1037 kB]

That is from https://launchpad.net/ubuntu/focal/riscv64/linux-libc-dev/5.4.0-24.28
But that seems to not contain the kvm.h header:
  wget http://launchpadlibrarian.net/474114728/linux-libc-dev_5.4.0-24.28_riscv64.deb
  dpkg -x linux-libc-dev_5.4.0-24.28_riscv64.deb linux-libc-dev-riscv
  cd linux-libc-dev-riscv
  find . -name 'kvm.h'
  ... not existing in there ...

This is blocked on getting a kernels riscv kvm.h into place.
I'll ask wgrant if that is known/in-progress (or also quite likely if I'm just riscv-confused)

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Comparing the two arches -dev packages this is what is missing:
Some of them might be intentional but kvm.h breaks this.

< /usr/include/arch-gnu/asm/a.out.h
9,10d7
< /usr/include/arch-gnu/asm/boot.h
< /usr/include/arch-gnu/asm/bootparam.h
13,14c10
< /usr/include/arch-gnu/asm/debugreg.h
< /usr/include/arch-gnu/asm/e820.h
---
> /usr/include/arch-gnu/asm/elf.h
17,18c13
< /usr/include/arch-gnu/asm/hw_breakpoint.h
< /usr/include/arch-gnu/asm/hwcap2.h
---
> /usr/include/arch-gnu/asm/hwcap.h
22,27d16
< /usr/include/arch-gnu/asm/ist.h
< /usr/include/arch-gnu/asm/kvm.h
< /usr/include/arch-gnu/asm/kvm_para.h
< /usr/include/arch-gnu/asm/kvm_perf.h
< /usr/include/arch-gnu/asm/ldt.h
< /usr/include/arch-gnu/asm/mce.h
30,31d18
< /usr/include/arch-gnu/asm/msr.h
< /usr/include/arch-gnu/asm/mtrr.h
36,41d22
< /usr/include/arch-gnu/asm/posix_types_32.h
< /usr/include/arch-gnu/asm/posix_types_64.h
< /usr/include/arch-gnu/asm/posix_types_x32.h
< /usr/include/arch-gnu/asm/prctl.h
< /usr/include/arch-gnu/asm/processor-flags.h
< /usr/include/arch-gnu/asm/ptrace-abi.h
48d28
< /usr/include/arch-gnu/asm/sigcontext32.h
55d34
< /usr/include/arch-gnu/asm/svm.h
62,67d40
< /usr/include/arch-gnu/asm/unistd_32.h
< /usr/include/arch-gnu/asm/unistd_64.h
< /usr/include/arch-gnu/asm/unistd_x32.h
< /usr/include/arch-gnu/asm/vm86.h
< /usr/include/arch-gnu/asm/vmx.h
< /usr/include/arch-gnu/asm/vsyscall.h
135d107
< /usr/include/linux/a.out.h
405,406d376
< /usr/include/linux/kvm.h
< /usr/include/linux/kvm_para.h

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

[09:22] <wgrant> cpaelzer: Ugh, I wonder if Linux 5.4 added partial KVM headers
[09:22] <wgrant> My previous builds were against 5.3

I compared riscv headers in the last 5.3 in Focal
https://launchpad.net/ubuntu/+source/linux/5.3.0-25.27

But at least the official build had no riscv build yet
https://launchpad.net/ubuntu/eoan/+package/linux-libc-dev

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Revision history for this message
William Grant (wgrant) wrote :

Disabling virglrenderer on only some host archs is a bit more complicated. I've opted to ignore the virglrenderer test failures on riscv64, reenabled virglrenderer in qemu, and uploaded virglrenderer/qemu/libvirt to focal-proposed.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI: This was uploaded to focal-unapproved by Wgrant

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Together with Wgrant we cancelled the old upload and replaced it with one that also fixes bug 1872945

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qemu - 1:4.2-3ubuntu6

---------------
qemu (1:4.2-3ubuntu6) focal; urgency=medium

  [ Christian Ehrhardt ]
  * enable riscv build (LP: #1872931)
    [ changes picked from Debian ]
    - enable support for riscv64 hosts
    - only enable librbd on architectures where it is built
    - ceph: do not list librados-dev as we only use librbd-dev and the latter
      depends on the former
    - seccomp grew up, no need in versioned build-dep
    - enable seccomp only on architectures where it can be built
  * d/p/ubuntu/lp-1872931-*: fix build on non KVM platforms
  * d/p/ubuntu/lp-1872945-*: fix riscv emulation errors that e.g. hung ssh
    and clobbered doubles (LP: #1872945)

  [ William Grant ]
  * d/control-in: disable rbd support unavailable on riscv (LP: 1872931)

 -- Christian Ehrhardt <email address hidden> Wed, 15 Apr 2020 14:27:15 +0200

Changed in qemu (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.