All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 00/11] tcg mips64 and mips r6 improvements
@ 2016-11-25  3:31 Jin Guojie
  2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 01/11] tcg-mips: Move bswap code to a subroutine Jin Guojie
                   ` (12 more replies)
  0 siblings, 13 replies; 21+ messages in thread
From: Jin Guojie @ 2016-11-25  3:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jin Guojie, Aurelien Jarno, James Hogan, Richard Henderson

Changes since v2:
  * 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. 

To be tested:
  * big-endian mips32 and mips64 hosts.
    I have tried running qemu-system-mips on an X86. The speed is awful. 
    The compilation of qemu did not complete over a night until I gave up.
    A better way is needed to do this test.
  * MIPS R6.
    
Summary of changes on v2 patch:

  | tcg-mips: Always use tcg_debug_assert      | merged previously   |
  | tcg-mips: Move bswap code to a subroutine  | no change           |
  | tcg-mips: Add mips64 opcodes               | no change           |
  | tcg-mips: Support 64-bit opcodes           | no change           |
  | tcg-mips: Add bswap32u and bswap64         | no change           |
  | tcg-mips: Adjust move functions for mips64 | no change           |
  | tcg-mips: Adjust load/store functions for  | no change           |
  | tcg-mips: Adjust prologue for mips64       | no change           |
  | tcg-mips: Add tcg unwind info              | fix a style problem |
  | tcg-mips: Adjust calling conventions for   | no change           |
  | tcg-mips: Adjust qemu_ld/st for mips64                           | 
  |   (1) tcg_out_qemu_st_slow_path:fix the crash on mips64el with  |
  |       i386 guest, when executing seabios                         | 
  |   (2) tlb_load:simplify ifdefs                                  |
  | tcg-mips: Adjust condition functions for mips64 (newly added)    | 
  |   fix the blocking when emulating i386 kernel on mips64el        |

Jin Guojie (11):
  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
  tcg-mips: Adjust condition functions for mips64

Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: James Hogan <james.hogan@imgtec.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 | 1156 +++++++++++++++++++++++++++++++++++----------
 2 files changed, 965 insertions(+), 251 deletions(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: [Qemu-devel] [PATCH v3 10/11] tcg-mips: Adjust qemu_ld/st for mips64
@ 2016-11-28  6:59 Jin Guojie
  2016-11-28 14:20 ` Richard Henderson
  0 siblings, 1 reply; 21+ messages in thread
From: Jin Guojie @ 2016-11-28  6:59 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: Aurelien Jarno, James Hogan

In Richard's v2 patch (shown as below), the compilation on mips64 host is disabled.

-#define LO_OFF    (MIPS_BE * 4)
-#define HI_OFF    (4 - LO_OFF)
+#if TCG_TARGET_REG_BITS == 32
+# define LO_OFF  (MIPS_BE * 4)
+# define HI_OFF  (4 - LO_OFF)
+#else
+extern int link_error(void);
+# define LO_OFF  link_error()
+# define HI_OFF  link_error()
+#endif

When I compiled this patch on Loongson as mips64el, a link error occured:

  LINK    i386-softmmu/qemu-system-i386
tcg/tcg.o: In function `tcg_out_tlb_load':
tcg-target.inc.c:1252: undefined reference to `link_error'

To pass the compilation, I removed the link_error() and redefined LO_OFF/HI_OFF. 
It works OK on little-endian mips o32/n64 host. I have no big-endian mips machine,
so the bug on big-endian is not discovered.

Frankly speaking, I didn't take n32 into consideration until you pointed out that.
I feel that n32 is rarely used in current and future market. I can not even find an n32 
debian distribution in Aurelien's qemu image collection.
How about leave n32 as a TODO feature?

Jin Guojie

------------------ Original ------------------
From:  "Richard Henderson";<rth@twiddle.net>;
Date:  Nov 25, 2016
To:  "Jin Guojie"<jinguojie@loongson.cn>; "qemu-devel"<qemu-devel@nongnu.org>; 
Cc:  "Aurelien Jarno"<aurelien@aurel32.net>; "James Hogan"<james.hogan@imgtec.com>; 
Subject:  Re: [PATCH v3 10/11] tcg-mips: Adjust qemu_ld/st for mips64



On 11/25/2016 04:31 AM, Jin Guojie wrote:
> -#define LO_OFF    (MIPS_BE * 4)
> -#define HI_OFF    (4 - LO_OFF)
> +# define LO_OFF  (MIPS_BE * sizeof(long))
> +# define HI_OFF  (sizeof(long) - LO_OFF)

For n32, sizeof(long) == 4, and for n64, sizeof(long) == 8.  So in the end this 
change must be wrong for big-endian.

Surely using link_error, as my patch did, to assert at compile-time that these 
values were never used for TCG_TARGET_REGS == 64 is better.


r~

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

end of thread, other threads:[~2016-11-30 19:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-25  3:31 [Qemu-devel] [PATCH v3 00/11] tcg mips64 and mips r6 improvements Jin Guojie
2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 01/11] tcg-mips: Move bswap code to a subroutine Jin Guojie
2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 02/11] tcg-mips: Add mips64 opcodes Jin Guojie
2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 03/11] tcg-mips: Support 64-bit opcodes Jin Guojie
2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 04/11] tcg-mips: Add bswap32u and bswap64 Jin Guojie
2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 05/11] tcg-mips: Adjust move functions for mips64 Jin Guojie
2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 06/11] tcg-mips: Adjust load/store " Jin Guojie
2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 07/11] tcg-mips: Adjust prologue " Jin Guojie
2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 08/11] tcg-mips: Add tcg unwind info Jin Guojie
2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 09/11] tcg-mips: Adjust calling conventions for mips64 Jin Guojie
2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 10/11] tcg-mips: Adjust qemu_ld/st " Jin Guojie
2016-11-25 11:55   ` Richard Henderson
2016-11-25  3:31 ` [Qemu-devel] [PATCH v3 11/11] tcg-mips: Adjust condition functions " Jin Guojie
2016-11-25 12:06   ` Richard Henderson
2016-11-25 14:25     ` Aurelien Jarno
2016-11-25 14:21 ` [Qemu-devel] [PATCH v3 00/11] tcg mips64 and mips r6 improvements Aurelien Jarno
2016-11-30 17:19 ` Aurelien Jarno
2016-11-30 18:33   ` =?gb18030?B?SmluIEd1b2ppZQ==?=
2016-11-30 19:39     ` Aurelien Jarno
2016-11-28  6:59 [Qemu-devel] [PATCH v3 10/11] tcg-mips: Adjust qemu_ld/st for mips64 Jin Guojie
2016-11-28 14:20 ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.