All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 00/35] target/mips: add missing Octeon user-mode support
@ 2026-05-11 18:22 James Hilliard
  2026-05-11 18:22 ` [PATCH v6 01/35] linux-user/mips: implement sysmips(MIPS_FLUSH_CACHE) James Hilliard
                   ` (34 more replies)
  0 siblings, 35 replies; 52+ messages in thread
From: James Hilliard @ 2026-05-11 18:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Laurent Vivier, Helge Deller, Pierrick Bouvier,
	Philippe Mathieu-Daudé, Aurelien Jarno, Jiaxun Yang,
	Aleksandar Rikalo, Huacai Chen, James Hilliard, Richard Henderson

This series updates MIPS linux-user unaligned-access behavior and fills
in missing Octeon user-mode instruction support used by existing Octeon
binaries.

The first patches model the Linux/MIPS sysmips ABI pieces needed by
linux-user, including MIPS_FLUSH_CACHE, MIPS_ATOMIC_SET, and the
MIPS_FIXADE policy used to control unaligned scalar access fixups.
User-mode unaligned scalar accesses default to software fixups and
sysmips(MIPS_FIXADE) can toggle SIGBUS/BUS_ADRALN behavior.

The Octeon patches add integer, indexed memory, atomic, fixed-point
QMAC, multiplier, COP2 crypto, CHORD, LLM, and CvmCount RDHWR support.
The series also adds a small mips64/mips64el TCG guest test covering
representative Octeon integer, fixed-point, multiplier, RDHWR, and COP2
selector paths. The final patch corrects the Octeon68XX CP1 feature
bits and FCR defaults.

Changes since v1:
- Split BADDU/DMUL destination fixes into a separate patch.
- Split the SEQ/SNE decode refactoring into a separate patch.
- Moved Octeon multiplier state to uint64_t arrays and updated VMState.
- Switched Octeon helper ABIs to i64/uint64_t where applicable.
- Moved COP2 selector decode/support logic into octeon_translate.c.
- Added in-tree TCG tests for mips64 and mips64el linux-user.
- Used switch ranges and g_assert_not_reached() for SHA3/ZUC shared
  selector handling.
- Dropped Octeon prefixes from generic Camellia helper routines.
- Replaced the reflected GFM 64-bit carryless multiply loop with
  crypto/clmul.h.
- Moved the Octeon68XX CP1 CPU-model correction to the end of the
  series.
- Added migration coverage for Octeon COP2 crypto and LLM sparse state.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
Changes in v6:
- Added Octeon QMAC/QMACS fixed-point accumulator support and smoke
  coverage.
- Added Octeon RDHWR $31/CvmCount support and smoke coverage.
- Clarified MTM0/VMM0 deterministic handling of architecturally
  unpredictable multiplier lanes.
- Fixed MTP0 to zero P1 per the CN71XX register-state table and added
  smoke coverage.
- Fixed VMM0 to apply the full MTM0-style multiplier-state reset and
  added smoke coverage for MPL1.
- Cleaned up internal VMUL, LA*, COP2 payload/state, and COP2 selector
  naming to better match hardware register/selector terminology.
- Renamed the MIPS_FIXADE TB flag, HSH register word-packing helpers,
  and sparse LLM backing fields to match ABI and hardware terminology.
- Link to v5: https://lore.kernel.org/qemu-devel/20260510-mips-octeon-missing-insns-v2-v5-0-d5d2668d15ab@gmail.com

Changes in v5:
- Added Richard Henderson's Reviewed-by tags for LBX, LHUX, LWUX, SAA,
  and SAAD, plus Acked-by tags for ZCB and ZCBT.
- Dropped the separate Octeon+ feature bit; QEMU has a single Octeon CPU
  model today, so SAA/SAAD stay under the existing Octeon feature bucket.
- Folded ZCBT into the ZCB decodetree entry with a selector comment.
- Link to v4: https://lore.kernel.org/qemu-devel/20260509-mips-octeon-missing-insns-v2-v4-0-d669dcd05c2f@gmail.com

Changes in v4:
- Added Richard Henderson's Reviewed-by tags to the reviewed sysmips and
  Octeon translator cleanup patches.
- Kept the Octeon3 MPL3-MPL5/P3-P5 high-lane multiplier state
  documented by Cavium SDK/toolchain sources.
- Documented the Octeon3 two-source MTM/MTP forms and preserved the rt
  high-lane operands while legacy one-source encodings use rt == $zero.
- Simplified SAA/SAAD translation to use the i64 TCG atomic add path for
  both word and doubleword sizes.
- Marked SAA/SAAD as Octeon+ instructions and gated them behind a
  separate Octeon+ feature bit.
- Simplified LA* translation to use i64 TCG atomic helpers for word and
  doubleword operations, with MO_SL selecting word result sign-extension.
- Link to v3: https://lore.kernel.org/qemu-devel/20260508-mips-octeon-missing-insns-v2-v3-0-bcbec96357d9@gmail.com

Changes in v3:
- Rebased on current qemu.git master.
- Split sysmips support into separate MIPS_FLUSH_CACHE, MIPS_ATOMIC_SET,
  and MIPS_FIXADE patches.
- Made MIPS_ATOMIC_SET always use the MIPS separate error-result register
  path for successful returns.
- Removed redundant Octeon MIPS64 checks and target-long guards from the
  translator paths.
- Removed zero-register fast paths where gen_store_gpr() already handles
  discarded writes.
- Reworked SEQ/SNE decode and LA* translator helpers as requested.
- Split the Octeon arithmetic/memory patch into narrower state, indexed
  load, SAA/SAAD, ZCB, multiplier, and test patches.
- Switched Octeon multiplier limb accumulation to uadd64_overflow().
- Link to v2: https://lore.kernel.org/qemu-devel/20260421-mips-octeon-missing-insns-v2-v2-0-a0791df188c9@gmail.com

To: qemu-devel@nongnu.org
Cc: Laurent Vivier <laurent@vivier.eu>
Cc: Helge Deller <deller@gmx.de>
Cc: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Aleksandar Rikalo <arikalo@gmail.com>
Cc: Huacai Chen <chenhuacai@kernel.org>

---
James Hilliard (35):
      linux-user/mips: implement sysmips(MIPS_FLUSH_CACHE)
      linux-user/mips: implement sysmips(MIPS_ATOMIC_SET)
      linux-user/mips, target/mips: honor MIPS_FIXADE for unaligned accesses
      target/mips: fix Octeon arithmetic destination handling
      target/mips: split Octeon SEQ/SNE decode
      target/mips: drop Octeon zero-register fast paths
      target/mips: add Octeon multiplier state
      target/mips: add Octeon LBX instruction
      target/mips: add Octeon LHUX instruction
      target/mips: add Octeon LWUX instruction
      target/mips: add Octeon SAA instruction
      target/mips: add Octeon SAAD instruction
      target/mips: add Octeon ZCB instruction
      target/mips: add Octeon ZCBT instruction
      target/mips: add Octeon MTM0 instruction
      target/mips: add Octeon MTP0 instruction
      target/mips: add Octeon MTP1 instruction
      target/mips: add Octeon MTP2 instruction
      target/mips: add Octeon MTM1 instruction
      target/mips: add Octeon MTM2 instruction
      target/mips: add Octeon VMULU instruction
      target/mips: add Octeon VMM0 instruction
      target/mips: add Octeon V3MULU instruction
      target/mips: add Octeon QMAC instructions
      tests/tcg/mips: add Octeon instruction smoke test
      target/mips: add Octeon LA* atomic instructions
      target/mips: add Octeon COP2 crypto core support
      target/mips: add Octeon SMS4 crypto support
      target/mips: add Octeon SHA3 crypto support
      target/mips: add Octeon ZUC crypto support
      target/mips: add Octeon Camellia crypto support
      target/mips: add Octeon CHORD and LLM COP2 support
      target/mips: add Octeon CvmCount RDHWR support
      tests/tcg/mips: cover Octeon QMAC and CvmCount
      target/mips: expose Octeon68XX floating-point support

 MAINTAINERS                                   |    2 +
 linux-user/mips/cpu_loop.c                    |    5 +
 linux-user/mips/target_syscall.h              |    3 +
 linux-user/mips64/target_syscall.h            |    3 +
 linux-user/syscall.c                          |   56 +
 target/mips/cpu-defs.c.inc                    |   10 +-
 target/mips/cpu.c                             |   75 +-
 target/mips/cpu.h                             |  257 +++
 target/mips/helper.h                          |    9 +
 target/mips/internal.h                        |    3 +
 target/mips/system/machine.c                  |  142 ++
 target/mips/tcg/meson.build                   |    1 +
 target/mips/tcg/octeon.decode                 |   51 +-
 target/mips/tcg/octeon_crypto.c               | 2479 +++++++++++++++++++++++++
 target/mips/tcg/octeon_translate.c            |  569 +++++-
 target/mips/tcg/op_helper.c                   |  176 +-
 target/mips/tcg/translate.c                   |   34 +-
 target/mips/tcg/translate.h                   |    1 +
 tests/tcg/mips/Makefile.target                |   11 +
 tests/tcg/mips/user/isa/octeon/octeon-insns.c |  332 ++++
 tests/tcg/mips64/Makefile.target              |   20 +
 tests/tcg/mips64el/Makefile.target            |    8 +
 22 files changed, 4188 insertions(+), 59 deletions(-)
---
base-commit: 5e61afe211e82a9af15a8794a0bd29bb574e953b
change-id: 20260420-mips-octeon-missing-insns-v2-5e693770cf2c

Best regards,
--  
James Hilliard <james.hilliard1@gmail.com>



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

end of thread, other threads:[~2026-05-14 14:37 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 18:22 [PATCH v6 00/35] target/mips: add missing Octeon user-mode support James Hilliard
2026-05-11 18:22 ` [PATCH v6 01/35] linux-user/mips: implement sysmips(MIPS_FLUSH_CACHE) James Hilliard
2026-05-11 18:22 ` [PATCH v6 02/35] linux-user/mips: implement sysmips(MIPS_ATOMIC_SET) James Hilliard
2026-05-11 18:22 ` [PATCH v6 03/35] linux-user/mips, target/mips: honor MIPS_FIXADE for unaligned accesses James Hilliard
2026-05-14 14:36   ` Philippe Mathieu-Daudé
2026-05-11 18:22 ` [PATCH v6 04/35] target/mips: fix Octeon arithmetic destination handling James Hilliard
2026-05-14 10:30   ` Philippe Mathieu-Daudé
2026-05-11 18:22 ` [PATCH v6 05/35] target/mips: split Octeon SEQ/SNE decode James Hilliard
2026-05-11 18:22 ` [PATCH v6 06/35] target/mips: drop Octeon zero-register fast paths James Hilliard
2026-05-14 10:31   ` Philippe Mathieu-Daudé
2026-05-11 18:22 ` [PATCH v6 07/35] target/mips: add Octeon multiplier state James Hilliard
2026-05-11 18:31   ` Richard Henderson
2026-05-14 10:27   ` Philippe Mathieu-Daudé
2026-05-11 18:22 ` [PATCH v6 08/35] target/mips: add Octeon LBX instruction James Hilliard
2026-05-14  9:49   ` Philippe Mathieu-Daudé
2026-05-11 18:22 ` [PATCH v6 09/35] target/mips: add Octeon LHUX instruction James Hilliard
2026-05-14  9:50   ` Philippe Mathieu-Daudé
2026-05-11 18:22 ` [PATCH v6 10/35] target/mips: add Octeon LWUX instruction James Hilliard
2026-05-14  9:50   ` Philippe Mathieu-Daudé
2026-05-11 18:22 ` [PATCH v6 11/35] target/mips: add Octeon SAA instruction James Hilliard
2026-05-14 10:08   ` Philippe Mathieu-Daudé
2026-05-11 18:22 ` [PATCH v6 12/35] target/mips: add Octeon SAAD instruction James Hilliard
2026-05-14 10:08   ` Philippe Mathieu-Daudé
2026-05-11 18:22 ` [PATCH v6 13/35] target/mips: add Octeon ZCB instruction James Hilliard
2026-05-14 10:25   ` Philippe Mathieu-Daudé
2026-05-11 18:22 ` [PATCH v6 14/35] target/mips: add Octeon ZCBT instruction James Hilliard
2026-05-14 10:03   ` Philippe Mathieu-Daudé
2026-05-11 18:22 ` [PATCH v6 15/35] target/mips: add Octeon MTM0 instruction James Hilliard
2026-05-11 18:40   ` Richard Henderson
2026-05-11 20:12     ` James Hilliard
2026-05-11 18:22 ` [PATCH v6 16/35] target/mips: add Octeon MTP0 instruction James Hilliard
2026-05-11 18:46   ` Richard Henderson
2026-05-11 20:19     ` James Hilliard
2026-05-11 18:22 ` [PATCH v6 17/35] target/mips: add Octeon MTP1 instruction James Hilliard
2026-05-11 18:22 ` [PATCH v6 18/35] target/mips: add Octeon MTP2 instruction James Hilliard
2026-05-11 18:22 ` [PATCH v6 19/35] target/mips: add Octeon MTM1 instruction James Hilliard
2026-05-11 18:22 ` [PATCH v6 20/35] target/mips: add Octeon MTM2 instruction James Hilliard
2026-05-11 18:22 ` [PATCH v6 21/35] target/mips: add Octeon VMULU instruction James Hilliard
2026-05-11 18:22 ` [PATCH v6 22/35] target/mips: add Octeon VMM0 instruction James Hilliard
2026-05-11 18:22 ` [PATCH v6 23/35] target/mips: add Octeon V3MULU instruction James Hilliard
2026-05-11 18:22 ` [PATCH v6 24/35] target/mips: add Octeon QMAC instructions James Hilliard
2026-05-11 18:22 ` [PATCH v6 25/35] tests/tcg/mips: add Octeon instruction smoke test James Hilliard
2026-05-11 18:22 ` [PATCH v6 26/35] target/mips: add Octeon LA* atomic instructions James Hilliard
2026-05-11 18:22 ` [PATCH v6 27/35] target/mips: add Octeon COP2 crypto core support James Hilliard
2026-05-11 18:22 ` [PATCH v6 28/35] target/mips: add Octeon SMS4 crypto support James Hilliard
2026-05-11 18:23 ` [PATCH v6 29/35] target/mips: add Octeon SHA3 " James Hilliard
2026-05-11 18:23 ` [PATCH v6 30/35] target/mips: add Octeon ZUC " James Hilliard
2026-05-11 18:23 ` [PATCH v6 31/35] target/mips: add Octeon Camellia " James Hilliard
2026-05-11 18:23 ` [PATCH v6 32/35] target/mips: add Octeon CHORD and LLM COP2 support James Hilliard
2026-05-11 18:23 ` [PATCH v6 33/35] target/mips: add Octeon CvmCount RDHWR support James Hilliard
2026-05-11 18:23 ` [PATCH v6 34/35] tests/tcg/mips: cover Octeon QMAC and CvmCount James Hilliard
2026-05-11 18:23 ` [PATCH v6 35/35] target/mips: expose Octeon68XX floating-point support James Hilliard

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.