<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/arch/riscv/include/asm/parse_asm.h, branch master</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://www.git.shady.money/linux/atom?h=master</id>
<link rel='self' href='https://www.git.shady.money/linux/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/linux/'/>
<updated>2022-12-29T14:59:47Z</updated>
<entry>
<title>RISC-V: rename parse_asm.h to insn.h</title>
<updated>2022-12-29T14:59:47Z</updated>
<author>
<name>Heiko Stuebner</name>
<email>heiko.stuebner@vrull.eu</email>
</author>
<published>2022-12-23T22:13:27Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/linux/commit/?id=c9c1af3f186a2bdb828792658bb32b518edba692'/>
<id>urn:sha1:c9c1af3f186a2bdb828792658bb32b518edba692</id>
<content type='text'>
The current parse_asm header should become a more centralized place
for everything concerning parsing and constructing instructions.

We already have a header insn-def.h similar to aarch64, so rename
parse_asm.h to insn.h (again similar to aarch64) to show that it's
meant for more than simple instruction parsing.

Reviewed-by: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Reviewed-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Signed-off-by: Heiko Stuebner &lt;heiko.stuebner@vrull.eu&gt;
Link: https://lore.kernel.org/r/20221223221332.4127602-8-heiko@sntech.de
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: Move riscv_insn_is_* macros into a common header</title>
<updated>2022-12-29T14:59:46Z</updated>
<author>
<name>Heiko Stuebner</name>
<email>heiko.stuebner@vrull.eu</email>
</author>
<published>2022-12-23T22:13:26Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/linux/commit/?id=ec5f908775160d4d635f99cbad9a5ea138894038'/>
<id>urn:sha1:ec5f908775160d4d635f99cbad9a5ea138894038</id>
<content type='text'>
Right now the riscv kernel has (at least) two independent sets
of functions to check if an encoded instruction is of a specific
type. One in kgdb and one kprobes simulate-insn code.

More parts of the kernel will probably need this in the future,
so instead of allowing this duplication to go on further,
move macros that do the function declaration in a common header,
similar to at least aarch64.

Reviewed-by: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Reviewed-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Signed-off-by: Heiko Stuebner &lt;heiko.stuebner@vrull.eu&gt;
Link: https://lore.kernel.org/r/20221223221332.4127602-7-heiko@sntech.de
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: add auipc elements to parse_asm header</title>
<updated>2022-12-29T14:59:45Z</updated>
<author>
<name>Heiko Stuebner</name>
<email>heiko.stuebner@vrull.eu</email>
</author>
<published>2022-12-23T22:13:25Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/linux/commit/?id=cde4a69302a4a57374a9daa463c493ff45038c99'/>
<id>urn:sha1:cde4a69302a4a57374a9daa463c493ff45038c99</id>
<content type='text'>
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 &lt;conor.dooley@microchip.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Reviewed-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Signed-off-by: Heiko Stuebner &lt;heiko.stuebner@vrull.eu&gt;
Link: https://lore.kernel.org/r/20221223221332.4127602-6-heiko@sntech.de
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: add ebreak instructions to definitions</title>
<updated>2022-12-29T14:59:44Z</updated>
<author>
<name>Heiko Stuebner</name>
<email>heiko.stuebner@vrull.eu</email>
</author>
<published>2022-12-23T22:13:24Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/linux/commit/?id=2621cac76f84c39a0e828f644bb04767efe50981'/>
<id>urn:sha1:2621cac76f84c39a0e828f644bb04767efe50981</id>
<content type='text'>
kprobes need to match ebreak instructions, so add the necessary
data to enable us to centralize that functionality.

Reviewed-by: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Reviewed-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Signed-off-by: Heiko Stuebner &lt;heiko.stuebner@vrull.eu&gt;
Link: https://lore.kernel.org/r/20221223221332.4127602-5-heiko@sntech.de
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: detach funct-values from their offset</title>
<updated>2022-12-29T14:59:43Z</updated>
<author>
<name>Heiko Stuebner</name>
<email>heiko.stuebner@vrull.eu</email>
</author>
<published>2022-12-23T22:13:23Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/linux/commit/?id=33e41480b233eb3ae8e3b523062a1916693ac267'/>
<id>urn:sha1:33e41480b233eb3ae8e3b523062a1916693ac267</id>
<content type='text'>
Rather than defining funct3, funct4, etc values pre-shifted to their
target-position in an instruction, define the values themselves and
only shift them where needed.

This allows using these funct-values in other places as well, for example
when decoding functions.

At the same time also reduces the use of magic numbers, one would need
a spec manual to understand.

Reviewed-by: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Reviewed-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Signed-off-by: Heiko Stuebner &lt;heiko.stuebner@vrull.eu&gt;
Link: https://lore.kernel.org/r/20221223221332.4127602-4-heiko@sntech.de
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: add prefix to all constants/macros in parse_asm.h</title>
<updated>2022-12-29T14:59:42Z</updated>
<author>
<name>Heiko Stuebner</name>
<email>heiko.stuebner@vrull.eu</email>
</author>
<published>2022-12-23T22:13:22Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/linux/commit/?id=bf0cc402d7cd4277ece55dd0ace6be43916f713b'/>
<id>urn:sha1:bf0cc402d7cd4277ece55dd0ace6be43916f713b</id>
<content type='text'>
Some of the constants and macros already have suitable RV_, RVG_ or
RVC_ prefixes.

Extend this to the rest of the file as well, as we want to use these
things in a broader scope soon.

Reviewed-by: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Reviewed-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Signed-off-by: Heiko Stuebner &lt;heiko.stuebner@vrull.eu&gt;
Link: https://lore.kernel.org/r/20221223221332.4127602-3-heiko@sntech.de
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
</content>
</entry>
<entry>
<title>RISC-V: fix funct4 definition for c.jalr in parse_asm.h</title>
<updated>2022-12-29T14:59:41Z</updated>
<author>
<name>Heiko Stuebner</name>
<email>heiko.stuebner@vrull.eu</email>
</author>
<published>2022-12-23T22:13:21Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/linux/commit/?id=a3775634f6da23f5511d0282d7e792cf606e5f3b'/>
<id>urn:sha1:a3775634f6da23f5511d0282d7e792cf606e5f3b</id>
<content type='text'>
The opcode definition for c.jalr is
    c.jalr c_rs1_n0  1..0=2 15..13=4 12=1 6..2=0

This means funct4 consisting of bit [15:12] is 1001b, so the value is 0x9.

Fixes: edde5584c7ab ("riscv: Add SW single-step support for KDB")
Reported-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Reviewed-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Signed-off-by: Heiko Stuebner &lt;heiko.stuebner@vrull.eu&gt;
Link: https://lore.kernel.org/r/20221223221332.4127602-2-heiko@sntech.de
Signed-off-by: Palmer Dabbelt &lt;palmer@rivosinc.com&gt;
</content>
</entry>
<entry>
<title>riscv: Add SW single-step support for KDB</title>
<updated>2020-05-18T18:38:12Z</updated>
<author>
<name>Vincent Chen</name>
<email>vincent.chen@sifive.com</email>
</author>
<published>2020-04-16T02:38:08Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/linux/commit/?id=edde5584c7ab5d18b87f092fe6fe8a72590e7100'/>
<id>urn:sha1:edde5584c7ab5d18b87f092fe6fe8a72590e7100</id>
<content type='text'>
In KGDB, the GDB in the host is responsible for the single-step operation
of the software. In other words, KGDB does not need to derive the next pc
address when performing a software single-step operation. KGDB just inserts
the break instruction at the indicated address according to the GDB
instructions. This approach does not work in KDB because the GDB does not
involve the KDB process. Therefore, this patch provides KDB a software
single-step mechanism to use.

Signed-off-by: Vincent Chen &lt;vincent.chen@sifive.com&gt;
Signed-off-by: Palmer Dabbelt &lt;palmerdabbelt@google.com&gt;
</content>
</entry>
</feed>
