qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v5 00/10] tcg mips64 and mips r6 improvements
@ 2016-12-01 13:51 Jin Guojie
  2016-12-01 13:52 ` [Qemu-devel] [PATCH v5 01/10] tcg-mips: Move bswap code to a subroutine Jin Guojie
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: Jin Guojie @ 2016-12-01 13:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jin Guojie, Aurelien Jarno, James Hogan, Richard Henderson

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 3550 bytes --]

Changes in v5:
  * Update against master(v2.8.0-rc2)
  * Fix a bug: 64-bit big-endian guests hang on mips64 little-endian
      hosts, and vice versa. This bug was first introduced in v2 patch,
      due to obvious misuse of ret/arg registers in tcg_out_bswap64().

        tcg_out_opc_reg(s, OPC_DSBH, ret, 0, arg);
      - tcg_out_opc_reg(s, OPC_DSHD, ret, 0, arg);
      + tcg_out_opc_reg(s, OPC_DSHD, ret, 0, ret);

  * Fix a style problem: checkpatch.pl forbids 'extern' to be used in .c.

      ERROR: externs should be avoided in .c files
      #28: FILE: tcg/mips/tcg-target.inc.c:39:
      +extern int link_error(void);

      Simply comment the type identifier to pass the check.

  * Tested successfully on following machines:
  
    | HOST        | qemu-system | Debian ISO  |
    |-----------------------------------------|
    | mips 32 le  |    i386     |    i386     |
    | mips 32 le  |    x86_64   |    i386     |
    | mips 32 le  |    x86_64   |    amd64    |
    | mips 64 le  |    i386     |    i386     |
    | mips 64 le  |    x86_64   |    i386     |
    | mips 64 le  |    x86_64   |    amd64    |
    | mips 64 le  |  mips 64 be |  mips 64 be |
    |-----------------------------------------|
    | mips 32 be  |    i386     |     i386    |
    | mips 32 be  |    x86_64   |     i386    |
    | mips 32 be  |    x86_64   |     amd64   |
    | mips 64 be  |    i386     |     i386    |
    | mips 64 be  |    x86_64   |     i386    |
    | mips 64 be  |    x86_64   |     amd64   |
    | mips n32 be |    386      |     i386    |
    | mips n32 be |    x86_64   |     i386    |
    | mips n32 be |    x86_64   |     amd64   |

    (No plan to test MIPS R6 in this patch.)

  Summary of changes from v4:

  | tcg-mips: Support 64-bit opcodes       | Fix tcg_out_bswap64() |
  | tcg-mips: Adjust qemu_ld/st for mips64 | Fix a style problem   |


Changes in v4:
  * tcg_out_qemu_ld_slow_path: always sign-extend 32-bit loads.
    Provide a better solution than patch11 in v3.
    Fix the blocking bug when emulating i386 kernel on mips64el.
  * Redefine LO_OFF/HI_OFF as v2.
    On mips64 host, they are defined as link_error, to ensure that
    all paths that lead to the use of the symbol are eliminated by
    the compiler.

Changes in v3:
  * Update against master(v2.8.0-rc1)
  * Tested on Loongson as mips32r2(el) and mips64r2(el) hosts.
    Loongson only implements little-endian mips32/mips64 ISA.
  * Fully work for 32-bit and 64-bit guests.
    Fix two bugs:segmentation fault on mips64el with 32-bit guests,
                  blocking when emulating i386 kernel on mips64el.
  * Fix some minor style problems.
  * PATCH v2 12~16 are not examined due to the lack of R6 machine. 

Jin Guojie (10):
  tcg-mips: Move bswap code to a subroutine
  tcg-mips: Add mips64 opcodes
  tcg-mips: Support 64-bit opcodes
  tcg-mips: Add bswap32u and bswap64
  tcg-mips: Adjust move functions for mips64
  tcg-mips: Adjust load/store functions for mips64
  tcg-mips: Adjust prologue for mips64
  tcg-mips: Add tcg unwind info
  tcg-mips: Adjust calling conventions for mips64
  tcg-mips: Adjust qemu_ld/st for mips64

Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: James Hogan <james.hogan@imgtec.com>
Tested-by: YunQiang Su <wzssyqa@gmail.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Jin Guojie <jinguojie@loongson.cn>

 tcg/mips/tcg-target.h     |   60 ++-
 tcg/mips/tcg-target.inc.c | 1170 +++++++++++++++++++++++++++++++++++----------
 2 files changed, 977 insertions(+), 253 deletions(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH v5 00/10] tcg mips64 and mips r6 improvements
@ 2016-12-02  7:30 YunQiang Su
  0 siblings, 0 replies; 18+ messages in thread
From: YunQiang Su @ 2016-12-02  7:30 UTC (permalink / raw)
  To: jinguojie, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1461 bytes --]

I tested this patch set on MIPS EB.

1) MIPS r2:

(HOST)          (qemu-system)                   (Debian ISO)
64eb      ->     i386                      ->           i386
64eb      ->     x86_64                 ->           i386
64eb      ->     x86_64                 ->           amd64
n32eb    ->     i386                      ->           i386
n32eb    ->     x86_64                 ->           i386
n32eb    ->     x86_64                 ->           amd64
32eb      ->     i386                      ->           i386
32eb      ->     x86_64                 ->           i386
32eb      ->     x86_64                 ->           amd64

2) On r2 CPU,  with disable
          use_movnz_instructions
          use_mips32_instructions
          use_mips32r2_instructions
    See the attached file.

(HOST)          (qemu-system)                   (Debian ISO)
64eb      ->     i386                      ->           i386
64eb      ->     x86_64                 ->           i386
64eb      ->     x86_64                 ->           amd64
n32eb    ->     i386                      ->           i386
n32eb    ->     x86_64                 ->           i386
n32eb    ->     x86_64                 ->           amd64
32eb      ->     i386                      ->           i386
32eb      ->     x86_64                 ->           i386
32eb      ->     x86_64                 ->           amd64

If needed, I can also help to test other cases.


-- 
YunQiang Su

[-- Attachment #2: disable-movnz_mips32_mips32r2.diff --]
[-- Type: text/plain, Size: 2256 bytes --]

diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h
index d352c97..d467dde 100644
--- a/tcg/mips/tcg-target.h
+++ b/tcg/mips/tcg-target.h
@@ -90,21 +90,24 @@ typedef enum {
 #if (defined(__mips_isa_rev) && (__mips_isa_rev >= 1)) || \
     defined(_MIPS_ARCH_LOONGSON2E) || defined(_MIPS_ARCH_LOONGSON2F) || \
     defined(_MIPS_ARCH_MIPS4)
-#define use_movnz_instructions  1
+//#define use_movnz_instructions  1
+extern bool use_movnz_instructions;
 #else
 extern bool use_movnz_instructions;
 #endif
 
 /* MIPS32 instruction set detection */
 #if defined(__mips_isa_rev) && (__mips_isa_rev >= 1)
-#define use_mips32_instructions  1
+//#define use_mips32_instructions  1
+extern bool use_mips32_instructions;
 #else
 extern bool use_mips32_instructions;
 #endif
 
 /* MIPS32R2 instruction set detection */
 #if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
-#define use_mips32r2_instructions  1
+//#define use_mips32r2_instructions  1
+extern bool use_mips32r2_instructions;
 #else
 extern bool use_mips32r2_instructions;
 #endif
diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c
index e6479e4..ab86b3b 100644
--- a/tcg/mips/tcg-target.inc.c
+++ b/tcg/mips/tcg-target.inc.c
@@ -2309,7 +2309,8 @@ static void tcg_target_detect_isa(void)
                  "movz $zero, $zero, $zero\n"
                  ".set pop\n"
                  : : : );
-    use_movnz_instructions = !got_sigill;
+    //use_movnz_instructions = !got_sigill;
+    use_movnz_instructions = 0;
 #endif
 
     /* Probe for MIPS32 instructions. As no subsetting is allowed
@@ -2322,7 +2323,8 @@ static void tcg_target_detect_isa(void)
                  "mul $zero, $zero\n"
                  ".set pop\n"
                  : : : );
-    use_mips32_instructions = !got_sigill;
+    //use_mips32_instructions = !got_sigill;
+    use_mips32_instructions = 0;
 #endif
 
     /* Probe for MIPS32r2 instructions if MIPS32 instructions are
@@ -2336,7 +2338,8 @@ static void tcg_target_detect_isa(void)
                      "seb $zero, $zero\n"
                      ".set pop\n"
                      : : : );
-        use_mips32r2_instructions = !got_sigill;
+        //use_mips32r2_instructions = !got_sigill;
+        use_mips32r2_instructions = 0;
     }
 #endif
 

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-12-05 15:55 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-01 13:51 [Qemu-devel] [PATCH v5 00/10] tcg mips64 and mips r6 improvements Jin Guojie
2016-12-01 13:52 ` [Qemu-devel] [PATCH v5 01/10] tcg-mips: Move bswap code to a subroutine Jin Guojie
2016-12-01 13:52 ` [Qemu-devel] [PATCH v5 02/10] tcg-mips: Add mips64 opcodes Jin Guojie
2016-12-01 13:52 ` [Qemu-devel] [PATCH v5 03/10] tcg-mips: Support 64-bit opcodes Jin Guojie
2016-12-01 13:52 ` [Qemu-devel] [PATCH v5 04/10] tcg-mips: Add bswap32u and bswap64 Jin Guojie
2016-12-01 13:52 ` [Qemu-devel] [PATCH v5 05/10] tcg-mips: Adjust move functions for mips64 Jin Guojie
2016-12-01 13:52 ` [Qemu-devel] [PATCH v5 06/10] tcg-mips: Adjust load/store " Jin Guojie
2016-12-01 13:52 ` [Qemu-devel] [PATCH v5 07/10] tcg-mips: Adjust prologue " Jin Guojie
2016-12-01 13:52 ` [Qemu-devel] [PATCH v5 08/10] tcg-mips: Add tcg unwind info Jin Guojie
2016-12-01 13:52 ` [Qemu-devel] [PATCH v5 09/10] tcg-mips: Adjust calling conventions for mips64 Jin Guojie
2016-12-01 13:52 ` [Qemu-devel] [PATCH v5 10/10] tcg-mips: Adjust qemu_ld/st " Jin Guojie
2016-12-01 15:52 ` [Qemu-devel] [PATCH v5 00/10] tcg mips64 and mips r6 improvements Richard Henderson
2016-12-05  9:41   ` Jin Guojie
2016-12-05 15:55     ` Richard Henderson
2016-12-02 11:16 ` James Hogan
2016-12-02 15:11   ` James Hogan
2016-12-02 15:52 ` Aurelien Jarno
  -- strict thread matches above, loose matches on Subject: below --
2016-12-02  7:30 YunQiang Su

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).