All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Stuebner <heiko@sntech.de>
To: linux-riscv@lists.infradead.org, palmer@dabbelt.com
Cc: christoph.muellner@vrull.eu, prabhakar.csengg@gmail.com,
	conor@kernel.org, philipp.tomsich@vrull.eu,
	ajones@ventanamicro.com, heiko@sntech.de,
	emil.renner.berthing@canonical.com, jszhang@kernel.org,
	Heiko Stuebner <heiko.stuebner@vrull.eu>,
	Conor Dooley <conor.dooley@microchip.com>
Subject: [PATCH v4 05/12] RISC-V: add auipc elements to parse_asm header
Date: Wed,  7 Dec 2022 19:08:14 +0100	[thread overview]
Message-ID: <20221207180821.2479987-6-heiko@sntech.de> (raw)
In-Reply-To: <20221207180821.2479987-1-heiko@sntech.de>

From: Heiko Stuebner <heiko.stuebner@vrull.eu>

Instruction parsing should not be done in individual code, but instead
supported by central

Right now kgdb and kprobes parse instructions and at least kprobes (and
the upcoming auipc+jalr alternative fixer-function) need the auipc
instruction.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
---
 arch/riscv/include/asm/parse_asm.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/riscv/include/asm/parse_asm.h b/arch/riscv/include/asm/parse_asm.h
index e8303250f598..28742eb19034 100644
--- a/arch/riscv/include/asm/parse_asm.h
+++ b/arch/riscv/include/asm/parse_asm.h
@@ -118,6 +118,7 @@
 #define RVC_C2_RD_OPOFF		7
 
 /* parts of opcode for RVG*/
+#define RVG_OPCODE_AUIPC	0x17
 #define RVG_OPCODE_BRANCH	0x63
 #define RVG_OPCODE_JALR		0x67
 #define RVG_OPCODE_JAL		0x6f
@@ -149,6 +150,7 @@
 #define RVG_FUNCT12_EBREAK	0x1
 #define RVG_FUNCT12_SRET	0x102
 
+#define RVG_MATCH_AUIPC		(RVG_OPCODE_AUIPC)
 #define RVG_MATCH_JALR		(RV_ENCODE_FUNCT3(JALR) | RVG_OPCODE_JALR)
 #define RVG_MATCH_JAL		(RVG_OPCODE_JAL)
 #define RVG_MATCH_BEQ		(RV_ENCODE_FUNCT3(BEQ) | RVG_OPCODE_BRANCH)
@@ -167,6 +169,7 @@
 #define RVC_MATCH_C_JALR	(RVC_ENCODE_FUNCT4(C_JALR) | RVC_OPCODE_C2)
 #define RVC_MATCH_C_EBREAK	(RVC_ENCODE_FUNCT4(C_EBREAK) | RVC_OPCODE_C2)
 
+#define RVG_MASK_AUIPC		(RV_INSN_OPCODE_MASK)
 #define RVG_MASK_JALR		(RV_INSN_FUNCT3_MASK | RV_INSN_OPCODE_MASK)
 #define RVG_MASK_JAL		(RV_INSN_OPCODE_MASK)
 #define RVC_MASK_C_JALR		(RVC_INSN_FUNCT4_MASK | RVC_INSN_J_RS2_MASK | RVC_INSN_OPCODE_MASK)
-- 
2.35.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2022-12-07 18:08 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 18:08 [PATCH v4 00/12] Allow calls in alternatives Heiko Stuebner
2022-12-07 18:08 ` [PATCH v4 01/12] RISC-V: fix funct4 definition for c.jalr in parse_asm.h Heiko Stuebner
2022-12-10 12:34   ` Lad, Prabhakar
2022-12-07 18:08 ` [PATCH v4 02/12] RISC-V: add prefix to all constants/macros " Heiko Stuebner
2022-12-10 12:45   ` Lad, Prabhakar
2022-12-07 18:08 ` [PATCH v4 03/12] RISC-V: detach funct-values from their offset Heiko Stuebner
2022-12-10 22:16   ` Lad, Prabhakar
2022-12-07 18:08 ` [PATCH v4 04/12] RISC-V: add ebreak instructions to definitions Heiko Stuebner
2022-12-10 23:08   ` Lad, Prabhakar
2022-12-07 18:08 ` Heiko Stuebner [this message]
2022-12-10 23:28   ` [PATCH v4 05/12] RISC-V: add auipc elements to parse_asm header Lad, Prabhakar
2022-12-07 18:08 ` [PATCH v4 06/12] RISC-V: Move riscv_insn_is_* macros into a common header Heiko Stuebner
2022-12-11 17:32   ` Lad, Prabhakar
2022-12-07 18:08 ` [PATCH v4 07/12] RISC-V: rename parse_asm.h to insn.h Heiko Stuebner
2022-12-11 17:33   ` Lad, Prabhakar
2022-12-07 18:08 ` [PATCH v4 08/12] RISC-V: kprobes: use central defined funct3 constants Heiko Stuebner
2022-12-11 17:34   ` Lad, Prabhakar
2022-12-07 18:08 ` [PATCH v4 09/12] RISC-V: add U-type imm parsing to insn.h header Heiko Stuebner
2022-12-11 17:36   ` Lad, Prabhakar
2022-12-07 18:08 ` [PATCH v4 10/12] RISC-V: add rd reg " Heiko Stuebner
2022-12-11 17:41   ` Lad, Prabhakar
2022-12-07 18:08 ` [PATCH v4 11/12] RISC-V: add helpers for handling immediates in U-type and I-type pairs Heiko Stuebner
2022-12-07 20:07   ` Conor Dooley
2022-12-07 22:43     ` Heiko Stuebner
2022-12-08 14:38   ` Andrew Jones
2022-12-22 13:46     ` Heiko Stübner
2022-12-11 20:45   ` Lad, Prabhakar
2022-12-07 18:08 ` [PATCH v4 12/12] RISC-V: fix auipc-jalr addresses in patched alternatives Heiko Stuebner
2022-12-07 20:48   ` Conor Dooley
2022-12-07 22:00     ` Jessica Clarke
2022-12-07 22:04       ` Conor Dooley
2022-12-07 22:37     ` Heiko Stuebner
2022-12-08  5:03       ` Conor.Dooley
2022-12-08 14:47   ` Andrew Jones
2022-12-11 20:49   ` Lad, Prabhakar

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=20221207180821.2479987-6-heiko@sntech.de \
    --to=heiko@sntech.de \
    --cc=ajones@ventanamicro.com \
    --cc=christoph.muellner@vrull.eu \
    --cc=conor.dooley@microchip.com \
    --cc=conor@kernel.org \
    --cc=emil.renner.berthing@canonical.com \
    --cc=heiko.stuebner@vrull.eu \
    --cc=jszhang@kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=prabhakar.csengg@gmail.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.