0012-RISC-V-Hypervisor-ext-drop-Privileged-Spec-1.9.1.patch 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. From b44492d044099ca449a5f64175eff296b030b128 Mon Sep 17 00:00:00 2001
  2. From: "eric.tang" <eric.tang@starfivetech.com>
  3. Date: Mon, 17 Jan 2022 09:46:45 +0800
  4. Subject: [PATCH 12/14] RISC-V: Hypervisor ext: drop Privileged Spec 1.9.1
  5. This makes way for a clean 1.12 based Hypervisor Ext support.
  6. There are no known implementors of 1.9.1 H-ext. (Per Jim, kendryte k210
  7. is based on priv spec 1.9.1, but it seems unlikely that they implemented
  8. H-ext).
  9. author by Vineet Gupta <vineetg@rivosinc.com>
  10. Signed-off-by: eric.tang <eric.tang@starfivetech.com>
  11. ---
  12. gas/testsuite/gas/riscv/csr-dw-regnums.d | 10 ---------
  13. gas/testsuite/gas/riscv/csr-dw-regnums.s | 10 ---------
  14. .../gas/riscv/priv-reg-fail-read-only-01.s | 10 ---------
  15. .../gas/riscv/priv-reg-fail-version-1p10.l | 10 ---------
  16. .../gas/riscv/priv-reg-fail-version-1p11.l | 10 ---------
  17. .../gas/riscv/priv-reg-version-1p10.d | 10 ---------
  18. .../gas/riscv/priv-reg-version-1p11.d | 10 ---------
  19. .../gas/riscv/priv-reg-version-1p9p1.d | 10 ---------
  20. gas/testsuite/gas/riscv/priv-reg.s | 10 ---------
  21. include/opcode/riscv-opc.h | 22 +------------------
  22. 10 files changed, 1 insertion(+), 111 deletions(-)
  23. diff --git a/gas/testsuite/gas/riscv/csr-dw-regnums.d b/gas/testsuite/gas/riscv/csr-dw-regnums.d
  24. index de17ad81fb..ea0a445c39 100644
  25. --- a/gas/testsuite/gas/riscv/csr-dw-regnums.d
  26. +++ b/gas/testsuite/gas/riscv/csr-dw-regnums.d
  27. @@ -229,16 +229,6 @@ Contents of the .* section:
  28. DW_CFA_offset_extended_sf: r4925 \(mhpmevent29\) at cfa\+3316
  29. DW_CFA_offset_extended_sf: r4926 \(mhpmevent30\) at cfa\+3320
  30. DW_CFA_offset_extended_sf: r4927 \(mhpmevent31\) at cfa\+3324
  31. - DW_CFA_offset_extended_sf: r4608 \(hstatus\) at cfa\+2048
  32. - DW_CFA_offset_extended_sf: r4610 \(hedeleg\) at cfa\+2056
  33. - DW_CFA_offset_extended_sf: r4611 \(hideleg\) at cfa\+2060
  34. - DW_CFA_offset_extended_sf: r4612 \(hie\) at cfa\+2064
  35. - DW_CFA_offset_extended_sf: r4613 \(htvec\) at cfa\+2068
  36. - DW_CFA_offset_extended_sf: r4672 \(hscratch\) at cfa\+2304
  37. - DW_CFA_offset_extended_sf: r4673 \(hepc\) at cfa\+2308
  38. - DW_CFA_offset_extended_sf: r4674 \(hcause\) at cfa\+2312
  39. - DW_CFA_offset_extended_sf: r4675 \(hbadaddr\) at cfa\+2316
  40. - DW_CFA_offset_extended_sf: r4676 \(hip\) at cfa\+2320
  41. DW_CFA_offset_extended_sf: r4992 \(mbase\) at cfa\+3584
  42. DW_CFA_offset_extended_sf: r4993 \(mbound\) at cfa\+3588
  43. DW_CFA_offset_extended_sf: r4994 \(mibase\) at cfa\+3592
  44. diff --git a/gas/testsuite/gas/riscv/csr-dw-regnums.s b/gas/testsuite/gas/riscv/csr-dw-regnums.s
  45. index ecc8014697..549475d650 100644
  46. --- a/gas/testsuite/gas/riscv/csr-dw-regnums.s
  47. +++ b/gas/testsuite/gas/riscv/csr-dw-regnums.s
  48. @@ -220,16 +220,6 @@ _start:
  49. .cfi_offset mhpmevent30, 3320
  50. .cfi_offset mhpmevent31, 3324
  51. # dropped
  52. - .cfi_offset hstatus, 2048
  53. - .cfi_offset hedeleg, 2056
  54. - .cfi_offset hideleg, 2060
  55. - .cfi_offset hie, 2064
  56. - .cfi_offset htvec, 2068
  57. - .cfi_offset hscratch, 2304
  58. - .cfi_offset hepc, 2308
  59. - .cfi_offset hcause, 2312
  60. - .cfi_offset hbadaddr, 2316
  61. - .cfi_offset hip, 2320
  62. .cfi_offset mbase, 3584
  63. .cfi_offset mbound, 3588
  64. .cfi_offset mibase, 3592
  65. diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.s b/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.s
  66. index af0fc4e14a..aff34e9a34 100644
  67. --- a/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.s
  68. +++ b/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.s
  69. @@ -249,16 +249,6 @@
  70. csr mucounteren # 0x320 in 1.9.1, dropped in 1.10, but the value is mcountinhibit since 1.11
  71. csr dscratch # 0x7b2 in 1.10, but the value is dscratch0 since 1.11
  72. - csr hstatus # 0x200, dropped in 1.10
  73. - csr hedeleg # 0x202, dropped in 1.10
  74. - csr hideleg # 0x203, dropped in 1.10
  75. - csr hie # 0x204, dropped in 1.10
  76. - csr htvec # 0x205, dropped in 1.10
  77. - csr hscratch # 0x240, dropped in 1.10
  78. - csr hepc # 0x241, dropped in 1.10
  79. - csr hcause # 0x242, dropped in 1.10
  80. - csr hbadaddr # 0x243, dropped in 1.10
  81. - csr hip # 0x244, dropped in 1.10
  82. csr mbase # 0x380, dropped in 1.10
  83. csr mbound # 0x381, dropped in 1.10
  84. csr mibase # 0x382, dropped in 1.10
  85. diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l
  86. index fbba6e5256..5f7a8d60d7 100644
  87. --- a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l
  88. +++ b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l
  89. @@ -5,16 +5,6 @@
  90. .*Warning: invalid CSR `sptbr' for the privileged spec `1.10'
  91. .*Warning: invalid CSR `mbadaddr' for the privileged spec `1.10'
  92. .*Warning: invalid CSR `mucounteren' for the privileged spec `1.10'
  93. -.*Warning: invalid CSR `hstatus' for the privileged spec `1.10'
  94. -.*Warning: invalid CSR `hedeleg' for the privileged spec `1.10'
  95. -.*Warning: invalid CSR `hideleg' for the privileged spec `1.10'
  96. -.*Warning: invalid CSR `hie' for the privileged spec `1.10'
  97. -.*Warning: invalid CSR `htvec' for the privileged spec `1.10'
  98. -.*Warning: invalid CSR `hscratch' for the privileged spec `1.10'
  99. -.*Warning: invalid CSR `hepc' for the privileged spec `1.10'
  100. -.*Warning: invalid CSR `hcause' for the privileged spec `1.10'
  101. -.*Warning: invalid CSR `hbadaddr' for the privileged spec `1.10'
  102. -.*Warning: invalid CSR `hip' for the privileged spec `1.10'
  103. .*Warning: invalid CSR `mbase' for the privileged spec `1.10'
  104. .*Warning: invalid CSR `mbound' for the privileged spec `1.10'
  105. .*Warning: invalid CSR `mibase' for the privileged spec `1.10'
  106. diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l
  107. index 68354ce25c..888cbb211d 100644
  108. --- a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l
  109. +++ b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l
  110. @@ -4,16 +4,6 @@
  111. .*Warning: invalid CSR `sptbr' for the privileged spec `1.11'
  112. .*Warning: invalid CSR `mbadaddr' for the privileged spec `1.11'
  113. .*Warning: invalid CSR `mucounteren' for the privileged spec `1.11'
  114. -.*Warning: invalid CSR `hstatus' for the privileged spec `1.11'
  115. -.*Warning: invalid CSR `hedeleg' for the privileged spec `1.11'
  116. -.*Warning: invalid CSR `hideleg' for the privileged spec `1.11'
  117. -.*Warning: invalid CSR `hie' for the privileged spec `1.11'
  118. -.*Warning: invalid CSR `htvec' for the privileged spec `1.11'
  119. -.*Warning: invalid CSR `hscratch' for the privileged spec `1.11'
  120. -.*Warning: invalid CSR `hepc' for the privileged spec `1.11'
  121. -.*Warning: invalid CSR `hcause' for the privileged spec `1.11'
  122. -.*Warning: invalid CSR `hbadaddr' for the privileged spec `1.11'
  123. -.*Warning: invalid CSR `hip' for the privileged spec `1.11'
  124. .*Warning: invalid CSR `mbase' for the privileged spec `1.11'
  125. .*Warning: invalid CSR `mbound' for the privileged spec `1.11'
  126. .*Warning: invalid CSR `mibase' for the privileged spec `1.11'
  127. diff --git a/gas/testsuite/gas/riscv/priv-reg-version-1p10.d b/gas/testsuite/gas/riscv/priv-reg-version-1p10.d
  128. index 3ad8eebe85..caa008feaf 100644
  129. --- a/gas/testsuite/gas/riscv/priv-reg-version-1p10.d
  130. +++ b/gas/testsuite/gas/riscv/priv-reg-version-1p10.d
  131. @@ -225,16 +225,6 @@ Disassembly of section .text:
  132. [ ]+[0-9a-f]+:[ ]+18002573[ ]+csrr[ ]+a0,satp
  133. [ ]+[0-9a-f]+:[ ]+34302573[ ]+csrr[ ]+a0,mtval
  134. [ ]+[0-9a-f]+:[ ]+32002573[ ]+csrr[ ]+a0,0x320
  135. -[ ]+[0-9a-f]+:[ ]+20002573[ ]+csrr[ ]+a0,0x200
  136. -[ ]+[0-9a-f]+:[ ]+20202573[ ]+csrr[ ]+a0,0x202
  137. -[ ]+[0-9a-f]+:[ ]+20302573[ ]+csrr[ ]+a0,0x203
  138. -[ ]+[0-9a-f]+:[ ]+20402573[ ]+csrr[ ]+a0,0x204
  139. -[ ]+[0-9a-f]+:[ ]+20502573[ ]+csrr[ ]+a0,0x205
  140. -[ ]+[0-9a-f]+:[ ]+24002573[ ]+csrr[ ]+a0,0x240
  141. -[ ]+[0-9a-f]+:[ ]+24102573[ ]+csrr[ ]+a0,0x241
  142. -[ ]+[0-9a-f]+:[ ]+24202573[ ]+csrr[ ]+a0,0x242
  143. -[ ]+[0-9a-f]+:[ ]+24302573[ ]+csrr[ ]+a0,0x243
  144. -[ ]+[0-9a-f]+:[ ]+24402573[ ]+csrr[ ]+a0,0x244
  145. [ ]+[0-9a-f]+:[ ]+38002573[ ]+csrr[ ]+a0,0x380
  146. [ ]+[0-9a-f]+:[ ]+38102573[ ]+csrr[ ]+a0,0x381
  147. [ ]+[0-9a-f]+:[ ]+38202573[ ]+csrr[ ]+a0,0x382
  148. diff --git a/gas/testsuite/gas/riscv/priv-reg-version-1p11.d b/gas/testsuite/gas/riscv/priv-reg-version-1p11.d
  149. index 5824bc5e1f..d16a55e5f3 100644
  150. --- a/gas/testsuite/gas/riscv/priv-reg-version-1p11.d
  151. +++ b/gas/testsuite/gas/riscv/priv-reg-version-1p11.d
  152. @@ -225,16 +225,6 @@ Disassembly of section .text:
  153. [ ]+[0-9a-f]+:[ ]+18002573[ ]+csrr[ ]+a0,satp
  154. [ ]+[0-9a-f]+:[ ]+34302573[ ]+csrr[ ]+a0,mtval
  155. [ ]+[0-9a-f]+:[ ]+32002573[ ]+csrr[ ]+a0,mcountinhibit
  156. -[ ]+[0-9a-f]+:[ ]+20002573[ ]+csrr[ ]+a0,0x200
  157. -[ ]+[0-9a-f]+:[ ]+20202573[ ]+csrr[ ]+a0,0x202
  158. -[ ]+[0-9a-f]+:[ ]+20302573[ ]+csrr[ ]+a0,0x203
  159. -[ ]+[0-9a-f]+:[ ]+20402573[ ]+csrr[ ]+a0,0x204
  160. -[ ]+[0-9a-f]+:[ ]+20502573[ ]+csrr[ ]+a0,0x205
  161. -[ ]+[0-9a-f]+:[ ]+24002573[ ]+csrr[ ]+a0,0x240
  162. -[ ]+[0-9a-f]+:[ ]+24102573[ ]+csrr[ ]+a0,0x241
  163. -[ ]+[0-9a-f]+:[ ]+24202573[ ]+csrr[ ]+a0,0x242
  164. -[ ]+[0-9a-f]+:[ ]+24302573[ ]+csrr[ ]+a0,0x243
  165. -[ ]+[0-9a-f]+:[ ]+24402573[ ]+csrr[ ]+a0,0x244
  166. [ ]+[0-9a-f]+:[ ]+38002573[ ]+csrr[ ]+a0,0x380
  167. [ ]+[0-9a-f]+:[ ]+38102573[ ]+csrr[ ]+a0,0x381
  168. [ ]+[0-9a-f]+:[ ]+38202573[ ]+csrr[ ]+a0,0x382
  169. diff --git a/gas/testsuite/gas/riscv/priv-reg-version-1p9p1.d b/gas/testsuite/gas/riscv/priv-reg-version-1p9p1.d
  170. index 569b9587e2..f2954a4f64 100644
  171. --- a/gas/testsuite/gas/riscv/priv-reg-version-1p9p1.d
  172. +++ b/gas/testsuite/gas/riscv/priv-reg-version-1p9p1.d
  173. @@ -225,16 +225,6 @@ Disassembly of section .text:
  174. [ ]+[0-9a-f]+:[ ]+18002573[ ]+csrr[ ]+a0,sptbr
  175. [ ]+[0-9a-f]+:[ ]+34302573[ ]+csrr[ ]+a0,mbadaddr
  176. [ ]+[0-9a-f]+:[ ]+32002573[ ]+csrr[ ]+a0,mucounteren
  177. -[ ]+[0-9a-f]+:[ ]+20002573[ ]+csrr[ ]+a0,hstatus
  178. -[ ]+[0-9a-f]+:[ ]+20202573[ ]+csrr[ ]+a0,hedeleg
  179. -[ ]+[0-9a-f]+:[ ]+20302573[ ]+csrr[ ]+a0,hideleg
  180. -[ ]+[0-9a-f]+:[ ]+20402573[ ]+csrr[ ]+a0,hie
  181. -[ ]+[0-9a-f]+:[ ]+20502573[ ]+csrr[ ]+a0,htvec
  182. -[ ]+[0-9a-f]+:[ ]+24002573[ ]+csrr[ ]+a0,hscratch
  183. -[ ]+[0-9a-f]+:[ ]+24102573[ ]+csrr[ ]+a0,hepc
  184. -[ ]+[0-9a-f]+:[ ]+24202573[ ]+csrr[ ]+a0,hcause
  185. -[ ]+[0-9a-f]+:[ ]+24302573[ ]+csrr[ ]+a0,hbadaddr
  186. -[ ]+[0-9a-f]+:[ ]+24402573[ ]+csrr[ ]+a0,hip
  187. [ ]+[0-9a-f]+:[ ]+38002573[ ]+csrr[ ]+a0,mbase
  188. [ ]+[0-9a-f]+:[ ]+38102573[ ]+csrr[ ]+a0,mbound
  189. [ ]+[0-9a-f]+:[ ]+38202573[ ]+csrr[ ]+a0,mibase
  190. diff --git a/gas/testsuite/gas/riscv/priv-reg.s b/gas/testsuite/gas/riscv/priv-reg.s
  191. index c40d28862b..30972de834 100644
  192. --- a/gas/testsuite/gas/riscv/priv-reg.s
  193. +++ b/gas/testsuite/gas/riscv/priv-reg.s
  194. @@ -234,16 +234,6 @@
  195. csr mbadaddr # 0x343 in 1.9.1, but the value is mtval since 1.10
  196. csr mucounteren # 0x320 in 1.9.1, dropped in 1.10, but the value is mcountinhibit since 1.11
  197. - csr hstatus # 0x200, dropped in 1.10
  198. - csr hedeleg # 0x202, dropped in 1.10
  199. - csr hideleg # 0x203, dropped in 1.10
  200. - csr hie # 0x204, dropped in 1.10
  201. - csr htvec # 0x205, dropped in 1.10
  202. - csr hscratch # 0x240, dropped in 1.10
  203. - csr hepc # 0x241, dropped in 1.10
  204. - csr hcause # 0x242, dropped in 1.10
  205. - csr hbadaddr # 0x243, dropped in 1.10
  206. - csr hip # 0x244, dropped in 1.10
  207. csr mbase # 0x380, dropped in 1.10
  208. csr mbound # 0x381, dropped in 1.10
  209. csr mibase # 0x382, dropped in 1.10
  210. diff --git a/include/opcode/riscv-opc.h b/include/opcode/riscv-opc.h
  211. index 7ceadbf923..9a4f73054e 100644
  212. --- a/include/opcode/riscv-opc.h
  213. +++ b/include/opcode/riscv-opc.h
  214. @@ -2874,16 +2874,6 @@ funct6 VM VS2 VS1/RS1/IMM funct3 VD opcode
  215. #define CSR_MHPMEVENT29 0x33d
  216. #define CSR_MHPMEVENT30 0x33e
  217. #define CSR_MHPMEVENT31 0x33f
  218. -#define CSR_HSTATUS 0x200
  219. -#define CSR_HEDELEG 0x202
  220. -#define CSR_HIDELEG 0x203
  221. -#define CSR_HIE 0x204
  222. -#define CSR_HTVEC 0x205
  223. -#define CSR_HSCRATCH 0x240
  224. -#define CSR_HEPC 0x241
  225. -#define CSR_HCAUSE 0x242
  226. -#define CSR_HBADADDR 0x243
  227. -#define CSR_HIP 0x244
  228. #define CSR_MBASE 0x380
  229. #define CSR_MBOUND 0x381
  230. #define CSR_MIBASE 0x382
  231. @@ -3460,16 +3450,6 @@ DECLARE_CSR(mhpmevent29, CSR_MHPMEVENT29, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PR
  232. DECLARE_CSR(mhpmevent30, CSR_MHPMEVENT30, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT)
  233. DECLARE_CSR(mhpmevent31, CSR_MHPMEVENT31, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_DRAFT)
  234. /* Dropped CSRs. */
  235. -DECLARE_CSR(hstatus, CSR_HSTATUS, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  236. -DECLARE_CSR(hedeleg, CSR_HEDELEG, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  237. -DECLARE_CSR(hideleg, CSR_HIDELEG, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  238. -DECLARE_CSR(hie, CSR_HIE, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  239. -DECLARE_CSR(htvec, CSR_HTVEC, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  240. -DECLARE_CSR(hscratch, CSR_HSCRATCH, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  241. -DECLARE_CSR(hepc, CSR_HEPC, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  242. -DECLARE_CSR(hcause, CSR_HCAUSE, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  243. -DECLARE_CSR(hbadaddr, CSR_HBADADDR, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  244. -DECLARE_CSR(hip, CSR_HIP, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  245. DECLARE_CSR(mbase, CSR_MBASE, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  246. DECLARE_CSR(mbound, CSR_MBOUND, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  247. DECLARE_CSR(mibase, CSR_MIBASE, CSR_CLASS_I, PRIV_SPEC_CLASS_1P9P1, PRIV_SPEC_CLASS_1P10)
  248. @@ -3515,4 +3495,4 @@ DECLARE_CSR_ALIAS(itrigger, CSR_TDATA1, CSR_CLASS_DEBUG, PRIV_SPEC_CLASS_NONE, P
  249. DECLARE_CSR_ALIAS(etrigger, CSR_TDATA1, CSR_CLASS_DEBUG, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
  250. DECLARE_CSR_ALIAS(textra32, CSR_TDATA3, CSR_CLASS_DEBUG, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
  251. DECLARE_CSR_ALIAS(textra64, CSR_TDATA3, CSR_CLASS_DEBUG, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
  252. -#endif /* DECLARE_CSR_ALIAS */
  253. \ No newline at end of file
  254. +#endif /* DECLARE_CSR_ALIAS */
  255. --
  256. 2.33.1