Your message dated Thu, 12 Apr 2018 17:06:31 +0000
with message-id <e1f6fg7-0002ro...@fasolo.debian.org>
and subject line Bug#893767: fixed in qemu 1:2.12~rc3+dfsg-1
has caused the Debian Bug report #893767,
regarding qemu: Enable support for riscv64 targets
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
893767: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893767
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: qemu
Severity: wishlist
Tags: patch
X-Debbugs-CC: debian-ri...@lists.debian.org
User: debian-ri...@lists.debian.org
Usertags: riscv64

Version 2.12.0-rc0 has support for the riscv64 target, and enabling it
would help improve the progress of the riscv64 port for Debian!  Even
just having this in experimental would be a great help.

Attached is a patch that enables the riscv64 targets for
qemu-system-misc and qemu-user-static/qemu-user/qemu-binfmt.

There are also currently two additional patches not present in
2.12.0-rc0 to fix significant bugs, which I've also included. It would
be great if you would consider applying those too.

Thanks for considering it!


live well,
  vagrant

diff --git a/debian/binfmt-update-in b/debian/binfmt-update-in
index 4bd4cc1643..09810d76a6 100644
--- a/debian/binfmt-update-in
+++ b/debian/binfmt-update-in
@@ -5,7 +5,7 @@ grep -zqs ^container= /proc/1/environ && exit 0
 # == binfmt registration/deregistration ==
 if command -v update-binfmts > /dev/null ; then
 
-fmts="aarch64 alpha arm armeb cris i386 m68k microblaze mips mipsel mipsn32 
mipsn32el mips64 mips64el ppc ppc64 ppc64abi32 ppc64le s390x sh4 sh4eb sparc 
sparc32plus sparc64 x86_64"
+fmts="aarch64 alpha arm armeb cris i386 m68k microblaze mips mipsel mipsn32 
mipsn32el mips64 mips64el ppc ppc64 ppc64abi32 ppc64le s390x sh4 sh4eb sparc 
sparc32plus sparc64 x86_64 riscv64"
 
 # linux ELF_OSABI(byte7) can be 0 (traditional,SYSV) or 3 (GNU/LINUX 
extensions)
 # binfmt registration does not allow a enum, only value&mask.  So we use 
broader mask
@@ -60,6 +60,8 @@ 
sparc32plus_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\
       
x86_64_mask='\xff\xff\xff\xff\xff\xfe\xfe\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
     
ppc64le_magic='\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00'
      
ppc64le_mask='\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00'
+     
riscv64_magic='\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00'
+     
riscv64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
 
 # find which fmts needs to be filtered out, which is arch-dependent.
 # Drop support for emulating amd64 on i386, http://bugs.debian.org/604712
diff --git a/debian/rules b/debian/rules
index 8a5d8e158a..d6f5bac278 100755
--- a/debian/rules
+++ b/debian/rules
@@ -57,7 +57,7 @@ ifeq (${enable_system},enable)
 system_targets = \
  i386 x86_64 alpha aarch64 arm cris lm32 m68k microblaze microblazeel \
  mips mipsel mips64 mips64el moxie nios2 or1k ppc ppcemb ppc64 sh4 sh4eb \
- sparc sparc64 s390x tricore xtensa xtensaeb unicore32
+ sparc sparc64 s390x tricore xtensa xtensaeb unicore32 riscv64
 
 # qemu-system subpackages, from d/control
 sys_systems = arm mips ppc sparc x86
@@ -82,7 +82,7 @@ user_targets = \
  i386 x86_64 alpha aarch64 arm armeb cris hppa m68k microblaze microblazeel \
  mips mipsel mips64 mips64el mipsn32 mipsn32el nios2 or1k \
  ppc ppc64 ppc64abi32 ppc64le sh4 sh4eb sparc sparc64 sparc32plus \
- s390x tilegx
+ s390x tilegx riscv64
 
 endif  # enable_linux_user


This one is a speed improvement for system mode:
https://temp.aurel32.net/riscv64/0001-RISC-V-Add-support-for-per-page-TLB-flush.patch

From 9f959967beeac09f45662fd2a303142365f278ec Mon Sep 17 00:00:00 2001
From: Aurelien Jarno <aurel...@aurel32.net>
Date: Thu, 8 Mar 2018 22:19:04 +0100
Subject: [PATCH] RISC-V: Add support for per page TLB flush

When rs1 != 0, the content of this register contains the address of the
page to be flushed. It is faster than flushing the whole TLB. We still
ignore the ASID.

Note: it might be wrong if superpages are in used.

Signed-off-by: Aurelien Jarno <aurel...@aurel32.net>
---
 target/riscv/helper.h    | 1 +
 target/riscv/op_helper.c | 7 +++++++
 target/riscv/translate.c | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/target/riscv/helper.h b/target/riscv/helper.h
index debb22a480..3997ed1900 100644
--- a/target/riscv/helper.h
+++ b/target/riscv/helper.h
@@ -75,4 +75,5 @@ DEF_HELPER_2(sret, tl, env, tl)
 DEF_HELPER_2(mret, tl, env, tl)
 DEF_HELPER_1(wfi, void, env)
 DEF_HELPER_1(tlb_flush, void, env)
+DEF_HELPER_2(tlb_flush_page, void, env, tl)
 #endif
diff --git a/target/riscv/op_helper.c b/target/riscv/op_helper.c
index e34715df4e..11d3c70b43 100644
--- a/target/riscv/op_helper.c
+++ b/target/riscv/op_helper.c
@@ -666,4 +666,11 @@ void helper_tlb_flush(CPURISCVState *env)
     tlb_flush(cs);
 }
 
+void helper_tlb_flush_page(CPURISCVState *env, target_ulong vaddr)
+{
+    RISCVCPU *cpu = riscv_env_get_cpu(env);
+    CPUState *cs = CPU(cpu);
+    tlb_flush_page(cs, vaddr);
+}
+
 #endif /* !CONFIG_USER_ONLY */
diff --git a/target/riscv/translate.c b/target/riscv/translate.c
index 808eab7f50..2967d80b4b 100644
--- a/target/riscv/translate.c
+++ b/target/riscv/translate.c
@@ -1333,7 +1333,11 @@ static void gen_system(CPURISCVState *env, DisasContext 
*ctx, uint32_t opc,
     if ((opc == OPC_RISC_ECALL) && ((csr >> 5) == 9)) {
         /* sfence.vma */
         /* TODO: handle ASID specific fences */
-        gen_helper_tlb_flush(cpu_env);
+        if (rs1 == 0) {
+            gen_helper_tlb_flush(cpu_env);
+        } else {
+            gen_helper_tlb_flush_page(cpu_env, source1);
+        }
         return;
     }
 #endif
-- 
2.16.1


This one is a must have as otherwise FPU register get corrupted in
system mode:
https://gist.github.com/sorear/2994acbe327d8741ea0ad892c2619de9

Index: qemu/target/riscv/op_helper.c
===================================================================
--- qemu.orig/target/riscv/op_helper.c
+++ qemu/target/riscv/op_helper.c
@@ -144,6 +144,7 @@ void csr_write_helper(CPURISCVState *env
         }
 
         mstatus = (mstatus & ~mask) | (val_to_write & mask);
+        if (mstatus & MSTATUS_FS) mstatus |= MSTATUS_FS; /* FP is always dirty 
if enabled */
         int dirty = (mstatus & MSTATUS_FS) == MSTATUS_FS;
         dirty |= (mstatus & MSTATUS_XS) == MSTATUS_XS;
         mstatus = set_field(mstatus, MSTATUS_SD, dirty);

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: qemu
Source-Version: 1:2.12~rc3+dfsg-1

We believe that the bug you reported is fixed in the latest version of
qemu, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 893...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Tokarev <m...@tls.msk.ru> (supplier of updated qemu package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 12 Apr 2018 19:04:03 +0300
Source: qemu
Binary: qemu qemu-system qemu-block-extra qemu-system-common qemu-system-misc 
qemu-system-arm qemu-system-mips qemu-system-ppc qemu-system-sparc 
qemu-system-x86 qemu-user qemu-user-static qemu-user-binfmt qemu-utils 
qemu-guest-agent qemu-kvm
Architecture: source
Version: 1:2.12~rc3+dfsg-1
Distribution: unstable
Urgency: medium
Maintainer: Debian QEMU Team <pkg-qemu-de...@lists.alioth.debian.org>
Changed-By: Michael Tokarev <m...@tls.msk.ru>
Description:
 qemu       - fast processor emulator, dummy package
 qemu-block-extra - extra block backend modules for qemu-system and qemu-utils
 qemu-guest-agent - Guest-side qemu-system agent
 qemu-kvm   - QEMU Full virtualization on x86 hardware
 qemu-system - QEMU full system emulation binaries
 qemu-system-arm - QEMU full system emulation binaries (arm)
 qemu-system-common - QEMU full system emulation binaries (common files)
 qemu-system-mips - QEMU full system emulation binaries (mips)
 qemu-system-misc - QEMU full system emulation binaries (miscellaneous)
 qemu-system-ppc - QEMU full system emulation binaries (ppc)
 qemu-system-sparc - QEMU full system emulation binaries (sparc)
 qemu-system-x86 - QEMU full system emulation binaries (x86)
 qemu-user  - QEMU user mode emulation binaries
 qemu-user-binfmt - QEMU user mode binfmt registration for qemu-user
 qemu-user-static - QEMU user mode emulation binaries (static version)
 qemu-utils - QEMU utilities
Closes: 839695 851694 854959 860822 868030 872098 879193 879532 879534 879536 
882136 884806 886532 886671 887207 887392 887892 891261 891375 892041 892497 
892947 893767 894852
Changes:
 qemu (1:2.12~rc3+dfsg-1) unstable; urgency=medium
 .
   * new upstream 2.12 release (Release Candidate 3)
     Closes: #892041, CVE-2018-7550
     Closes: #884806, CVE-2017-15124
     Closes: #887392, CVE-2018-5683
     Closes: #892497, CVE-2018-7858
     Closes: #882136, CVE-2017-16845
     Closes: #886532, #892947, #891375, #887892, #860822, #851694
   * refresh local debian patches
   * d/rules: enable new system (hppa riscv32 riscv64) and
     user (aarch64_be xtensa xtensaeb riskc32 riscv64) targets
     Closes: #893767
   * fix d/source/options to match current reality
   * drop use-data-path.patch, upstream now has --firmwarepath= option
   * enable capstone disassembler library support
     (build-depend on libcapstone-dev)
   * debian/extract-config-opts: use tab for option / condition separator
   * qemu-block-extra: install only block modules
   * make `qemu' metapackage to be dummy, to remove it in a future release
   * do not suggest kmod, it is pointless
   * install /usr/bin/qemu-pr-helper to qemu-utils package
   * switch from sdl2 to gtk ui
     Closes: #839695, #886671, #879536, #879534, #879532, #879193, #894852
   * qemu-system-ppc: forgotten qemu-system-ppc64le.1 link
   * mention closing of #880582 by 2.11
   * package will built against spice 0.14, so Closes: #854959
   * check sfdisk presence in qemu-make-debian-root (Closes: #872098)
   * check mke2fs presence in qemu-make-debian-root (Closes: #887207)
   * debian/binfmt-update-in: include forgotten hppa (Closes: #891261)
   * debian/TODO: removed some old ToDo items
   * use binfmt-support --fix-binary option (Closes: #868030)
Checksums-Sha1:
 f77a07f3b320534b49e44a492aa93ffe2d4597d3 5735 qemu_2.12~rc3+dfsg-1.dsc
 b1767b8dcc008005324701715d7c1a7417f07269 8162584 qemu_2.12~rc3+dfsg.orig.tar.xz
 efd0f0bbba4c380fca866f84c541e0ae81a19f0b 70040 
qemu_2.12~rc3+dfsg-1.debian.tar.xz
 1903f5c923fd5ac881d197f0e0d0124b174f2589 15374 
qemu_2.12~rc3+dfsg-1_source.buildinfo
Checksums-Sha256:
 a8f6ef1baf2ba84c9bf4523a27f8a5dc6c3aa1239dc30501e204449b32037bbf 5735 
qemu_2.12~rc3+dfsg-1.dsc
 c9c8180421ee1b4e5891b8d9019aa2167f536e8bbd7d6f0819720f33cff065c8 8162584 
qemu_2.12~rc3+dfsg.orig.tar.xz
 a716fe21f1ee0dec4b7b6cd38b43393ccec8fe2e23767da7f0219baf8cf1e4f1 70040 
qemu_2.12~rc3+dfsg-1.debian.tar.xz
 9843f987d3d475b50328423b94545853c346a64de754727b4ebe5b10b2448fd7 15374 
qemu_2.12~rc3+dfsg-1_source.buildinfo
Files:
 770e27784eb1fbd48ada9d01a1551078 5735 otherosfs optional 
qemu_2.12~rc3+dfsg-1.dsc
 6d5676f84d4d4a6a12537b33b3267a34 8162584 otherosfs optional 
qemu_2.12~rc3+dfsg.orig.tar.xz
 a1e214cf5f354f36e8b7ba194484e304 70040 otherosfs optional 
qemu_2.12~rc3+dfsg-1.debian.tar.xz
 4ffdc270915edffe0e4ed012f739e4d8 15374 otherosfs optional 
qemu_2.12~rc3+dfsg-1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQFDBAEBCAAtFiEEe3O61ovnosKJMUsicBtPaxppPlkFAlrPjGQPHG1qdEB0bHMu
bXNrLnJ1AAoJEHAbT2saaT5ZkRsIALbmmqYA5S+H+TbHmj6EPAoxV+e7VawA9wL5
HtjsE3lNP05Qj+61TvCmDp7sqfoZJVGpoi9o8EoOJVwjOTJRiSzxxXRZTjvDgIIO
3yOHX1shy69zatdPrzpliJUrK9Rb92fw5Q75aIUO+OrMs/u4mYsmaOKIlZ1RXL6N
/AGcEzrAnkNpAioiceKOsv1Q9elTZlq44HCadBzZcRk9nEC3nc74fFexs8vtZsKv
mSov5xAsNff/UIZW2tYlqdRydyM8xH113dneZg7Y0jOHvw/qSgXu26p8Kzz7zFAU
JxYHx5gGH87HQcbXZlglYLdWJ+ZmkLsk7y3wHl2HP5WcFgR7yBw=
=YL4d
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to