RISC-V: Hypervisor ext: support Privileged Spec 1.12
authorVineet Gupta <vineetg@rivosinc.com>
Tue, 21 Dec 2021 02:34:13 +0000 (18:34 -0800)
committerNelson Chu <nelson.chu@sifive.com>
Fri, 24 Dec 2021 07:17:52 +0000 (15:17 +0800)
commita63375ac337903d4394b2d88788353d06cf7a086
tree30b22f80ca8d3441085115169e27be536f8d63d7
parent5c3ffbc4dd9454c56598e28a25d8d0c0faf1e8bc
RISC-V: Hypervisor ext: support Privileged Spec 1.12

This is the Hypervisor Extension 1.0

 - Hypervisor Memory-Management Instructions
   HFENCE.VVMA, HFENCE.GVMA,

 - Hypervisor Virtual Machine Load and Store Instructions
   HLV.B, HLV.BU,          HSV.B,
   HLV.H, HLV.HU, HLVX.HU, HSB.H,
   HLV.W, HLV.WU, HLVX.WU, HSV.W,
   HLV.D,                  HSV.D

 - Hypervisor CSRs (some new, some address changed)
   hstatus, hedeleg, hideleg, hie, hcounteren, hgeie, htval, hip, hvip,
   htinst, hgeip, henvcfg, henvcfgh, hgatp, hcontext, htimedelta, htimedeltah,
   vsstatus, vsie, vstvec, vsscratch, vsepc, vscause, vstval, vsip, vsatp,

Note that following were added already as part of svinval extension
support:
   HINVAL.GVMA, HINVAL.VVMA

Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Reviewed-by: Nelson Chu <nelson.chu@sifive.com>
bfd/
* cpu-riscv.c (riscv_priv_specs): Added entry for 1.12.
* cpu-riscv.h (enum riscv_spec_class): Added PRIV_SPEC_CLASS_1P12.
gas/
* config/tc-riscv.c (abort_version): Updated comment.
(validate_riscv_insn): Annotate switch-break.
* testsuite/gas/riscv/h-ext-32.d: New testcase for hypervisor.
* testsuite/gas/riscv/h-ext-32.s: Likewise.
* testsuite/gas/riscv/h-ext-64.d: Likewise.
* testsuite/gas/riscv/h-ext-64.s: Likewise.
include/
* opcode/riscv-opc.h: Added encodings for hypervisor csrs and
instrcutions.
opcodes/
* riscv-opc.c (riscv_opcodes): Added hypervisor instrcutions.
bfd/cpu-riscv.c
bfd/cpu-riscv.h
gas/config/tc-riscv.c
gas/testsuite/gas/riscv/h-ext-32.d [new file with mode: 0644]
gas/testsuite/gas/riscv/h-ext-32.s [new file with mode: 0644]
gas/testsuite/gas/riscv/h-ext-64.d [new file with mode: 0644]
gas/testsuite/gas/riscv/h-ext-64.s [new file with mode: 0644]
include/opcode/riscv-opc.h
opcodes/riscv-opc.c