All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Fredrik Noring" <noring@nocrew.org>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Maciej W. Rozycki" <macro@orcam.me.uk>
Subject: Re: [RFC PATCH 00/42] target/mips: Reintroduce the R5900 CPU (with more testing)
Date: Mon, 15 Feb 2021 10:24:59 +0100	[thread overview]
Message-ID: <b16dbbde-f679-f20d-2957-e5df35131f97@amsat.org> (raw)
In-Reply-To: <20210214175912.732946-1-f4bug@amsat.org>

On 2/14/21 6:58 PM, Philippe Mathieu-Daudé wrote:
> The R5900 CPU was removed some time ago (frankly I don't remember
> why). This series add it back, but to prove it works, we also add
> testing at the end.
> 
> The main motivation is to have MIPS R5900 coverage, but to be able
> to run real world r5900 binaries, I had to implement more opcodes.
> 
> 42 patches are a lot, but 3 are already queued in linux-user-for-6.0,
> and the 11 last ones are pure testing. I suppose in next versions
> I'll split the testing patches, but to show the final objective I
> included them in here.
> 
> I tagged it RFC because some parts because:
> 
> - We'd rather not add yet another target, but we need the
>   ILP32-on-64bit ABI (o32 64-bit)
> 
> - RDHWR glibc kludge for user-mode
> 
> - Avocado patches are only here to show the final test.
>   They are useful for my set of tests, but not meant to
>   be merged in mainstream.
> 
> - gitlab jobs are only here to show the tests work.
>   If the target is ever accepted, it would go in an already
>   existing job.
> 
> I'm OK to maintain 64-bit o32 and the testing out of tree, but the
> TCG opcodes are worthwhile review for mainstream.

I forgot to mention, to debug this target with gdb (the various
multimedia opcodes are not recognized by QEMU disas).

I start QEMU listening for GDB with:

$ qemu-r5900o32el -g 1234 ...

Then start Debian's gdb-multiarch via Docker:

$ docker run -it --rm -v /tmp:/tmp -u $UID --network=host \
  registry.gitlab.com/qemu-project/qemu/qemu/debian10 \
  gdb-multiarch -q \
    --ex 'set architecture mips:5900' --ex 'set endian little'
The target architecture is assumed to be mips:5900
The target is assumed to be little endian
(gdb)

Connect to QEMU on host:

(gdb) target remote 172.17.0.1:1234

Opcodes are displayed properly:

(gdb) x/20i 0x0002553c
   0x2553c:     pcpyld  a1,a1,a1
   0x25540:     li      a2,255
   0x25544:     andi    t1,a0,0x7
   0x25548:     beqz    t1,0x255fc
   0x2554c:     andi    t1,a0,0xf
   0x25550:     lw      t0,0(a0)
   0x25554:     addiu   a0,a0,4
   0x25558:     pceqb   t2,t0,zero
   0x2555c:     pceqb   t3,t0,a1
   0x25560:     or      t4,t3,t2
   0x25564:     pextlw  t4,zero,t4
   0x25568:     beqz    t4,0x255fc

One limitation is we can not access the upper halves of
the 128-bit general purpose registers :(
[Maybe we can but I don't know how...]

Regards,

Phil.


  parent reply	other threads:[~2021-02-15  9:26 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-14 17:58 [RFC PATCH 00/42] target/mips: Reintroduce the R5900 CPU (with more testing) Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 01/42] linux-user/mips64: Restore setup_frame() for o32 ABI Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 02/42] linux-user/mips64: Support o32 ABI syscalls Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 03/42] target/mips/translate: Make cpu_HI/LO registers public Philippe Mathieu-Daudé
2021-02-15 16:12   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 04/42] target/mips: Promote 128-bit multimedia registers as global ones Philippe Mathieu-Daudé
2021-02-15 16:14   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 05/42] target/mips: Rename 128-bit upper halve GPR registers Philippe Mathieu-Daudé
2021-02-15 16:15   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 06/42] target/mips: Introduce gen_load_gpr_hi() / gen_store_gpr_hi() helpers Philippe Mathieu-Daudé
2021-02-15 16:15   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 07/42] target/mips/translate: Use GPR move functions in gen_HILO1_tx79() Philippe Mathieu-Daudé
2021-02-15 16:17   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 08/42] target/mips/tx79: Move MFHI1 / MFLO1 opcodes to decodetree Philippe Mathieu-Daudé
2021-02-15 16:21   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 09/42] target/mips/tx79: Move MTHI1 / MTLO1 " Philippe Mathieu-Daudé
2021-02-15 16:23   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 10/42] target/mips/translate: Simplify PCPYH using deposit_i64() Philippe Mathieu-Daudé
2021-02-15 16:24   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 11/42] target/mips/tx79: Move PCPYH opcode to decodetree Philippe Mathieu-Daudé
2021-02-15 16:26   ` Richard Henderson
2021-03-08 10:48     ` Philippe Mathieu-Daudé
2021-03-08 11:57       ` Philippe Mathieu-Daudé
2021-03-09 14:25         ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 12/42] target/mips/tx79: Move PCPYLD / PCPYUD opcodes " Philippe Mathieu-Daudé
2021-02-15 16:28   ` Richard Henderson
2021-02-15 16:58     ` Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 13/42] target/mips: Remove 'C790 Multimedia Instructions' dead code Philippe Mathieu-Daudé
2021-02-15 16:32   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 14/42] target/mips/tx79: Salvage instructions description comment Philippe Mathieu-Daudé
2021-02-15 16:33   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 15/42] target/mips/tx79: Introduce PAND/POR/PXOR/PNOR opcodes (parallel logic) Philippe Mathieu-Daudé
2021-02-15 16:35   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 16/42] target/mips/tx79: Introduce PSUB* opcodes (Parallel Subtract) Philippe Mathieu-Daudé
2021-02-15 16:38   ` Richard Henderson
2021-03-08 18:46     ` Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 17/42] target/mips/tx79: Introduce PEXTUW (Parallel Extend Upper from Word) Philippe Mathieu-Daudé
2021-02-15 16:44   ` Richard Henderson
2021-03-08 18:40     ` Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 18/42] target/mips/tx79: Introduce PEXTU[BHW] opcodes (Parallel Extend Lower) Philippe Mathieu-Daudé
2021-02-15 18:28   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 19/42] target/mips/tx79: Introduce PCEQ* opcodes (Parallel Compare for Equal) Philippe Mathieu-Daudé
2021-02-15 20:32   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 20/42] target/mips/tx79: Introduce PCGT* (Parallel Compare for Greater Than) Philippe Mathieu-Daudé
2021-02-14 17:58 ` [RFC PATCH 21/42] target/mips/tx79: Introduce PPACW opcode (Parallel Pack to Word) Philippe Mathieu-Daudé
2021-02-15 20:38   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 22/42] target/mips/tx79: Introduce PINTEH (Parallel Interleave Even Halfword) Philippe Mathieu-Daudé
2021-02-15 20:41   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 23/42] target/mips/tx79: Introduce PEXE[HW] opcodes (Parallel Exchange Even) Philippe Mathieu-Daudé
2021-02-15 20:45   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 24/42] target/mips/tx79: Introduce PROT3W opcode (Parallel Rotate 3 Words) Philippe Mathieu-Daudé
2021-02-15 20:49   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 25/42] target/mips/tx79: Introduce LQ opcode (Load Quadword) Philippe Mathieu-Daudé
2021-02-15 20:51   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 26/42] target/mips/tx79: Introduce SQ opcode (Store Quadword) Philippe Mathieu-Daudé
2021-02-15 20:51   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 27/42] target/mips/translate: Make gen_rdhwr() public Philippe Mathieu-Daudé
2021-02-15 20:51   ` Richard Henderson
2021-02-14 17:58 ` [RFC PATCH 28/42] target/mips/tx79: Move RDHWR usermode kludge to trans_SQ() Philippe Mathieu-Daudé
2021-02-15 21:01   ` Richard Henderson
2021-02-16  7:05     ` Fredrik Noring
2021-02-16 12:21       ` Maciej W. Rozycki
2021-02-16 13:04         ` Fredrik Noring
2021-02-14 17:58 ` [RFC PATCH 29/42] linux-user/mips64: Support the n32 ABI for the R5900 Philippe Mathieu-Daudé
2021-02-15 21:02   ` Richard Henderson
2021-02-14 17:59 ` [RFC PATCH 30/42] target/mips: Reintroduce the R5900 CPU Philippe Mathieu-Daudé
2021-02-15 21:04   ` Richard Henderson
2021-02-14 17:59 ` [RFC PATCH 31/42] default-configs: Support o32 ABI with R5900 64-bit MIPS CPU Philippe Mathieu-Daudé
2021-02-15 21:05   ` Richard Henderson
2021-02-14 17:59 ` [RFC PATCH 32/42] docker: Add gentoo-mipsr5900el-cross image Philippe Mathieu-Daudé
2021-02-15 11:59   ` Daniel P. Berrangé
2021-02-15 13:45     ` Fredrik Noring
2021-02-20 20:01       ` Philippe Mathieu-Daudé
2021-03-12 15:10         ` Philippe Mathieu-Daudé
2021-03-12 17:05           ` Maciej W. Rozycki
2021-03-12 17:46             ` Philippe Mathieu-Daudé
2021-03-12 20:04               ` Maciej W. Rozycki
2021-03-13  7:02                 ` Fredrik Noring
2021-03-17 18:55                 ` Philippe Mathieu-Daudé
2021-03-17 22:21                   ` Maciej W. Rozycki
2021-03-12 18:24             ` Fredrik Noring
2021-03-12 20:05               ` Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 33/42] gitlab-ci: Pass optional EXTRA_FILES when building docker images Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 34/42] gitlab-ci: Build MIPS R5900 cross-toolchain (Gentoo based) Philippe Mathieu-Daudé
2021-02-15 11:42   ` Philippe Mathieu-Daudé
2021-02-15 11:58     ` Daniel P. Berrangé
2021-02-14 17:59 ` [RFC PATCH 35/42] tests/tcg: Add MIPS R5900 to arches filter Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 36/42] tests/tcg/mips: Test user mode DMULT for the R5900 Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 37/42] gitlab-ci: Add job to test the MIPS r5900o32el target Philippe Mathieu-Daudé
2021-02-15  5:31   ` Thomas Huth
2021-02-15  8:07     ` Philippe Mathieu-Daudé
2021-02-15  8:11       ` Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 38/42] tests/acceptance: Extract QemuBaseTest from Test Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 39/42] tests/acceptance: Make pick_default_qemu_bin() more generic Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 40/42] tests/acceptance: Introduce QemuUserTest base class Philippe Mathieu-Daudé
2021-02-14 17:59 ` [RFC PATCH 41/42] tests/acceptance: Test R5900 CPU with BusyBox from Sony PS2 Philippe Mathieu-Daudé
2021-02-15 14:28   ` Fredrik Noring
2021-02-15 14:46     ` Maciej W. Rozycki
2021-02-14 17:59 ` [RFC PATCH 42/42] gitlab-ci: Add job to run integration tests for the r5900o32el target Philippe Mathieu-Daudé
2021-02-14 18:08 ` [RFC PATCH 00/42] target/mips: Reintroduce the R5900 CPU (with more testing) Philippe Mathieu-Daudé
2021-02-15  9:24 ` Philippe Mathieu-Daudé [this message]
2021-02-21 14:04 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b16dbbde-f679-f20d-2957-e5df35131f97@amsat.org \
    --to=f4bug@amsat.org \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=alex.bennee@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=laurent@vivier.eu \
    --cc=macro@orcam.me.uk \
    --cc=noring@nocrew.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.