@@ -1843,10 +1843,16 @@ function gstage_page_walk {
18431843 PteFlags pte_flags = pte[9:0];
18441844
18451845 # check if any reserved bits are set
1846- # Sv32 has no reserved bits, and Sv39/48/57 all have reserved bits at 60 :54
1847- if ((VA_SIZE != 32) && (pte[60 :54] != 0)) {
1846+ # Sv32 has no reserved bits, and Sv39/48/57 all have reserved bits at 58 :54
1847+ if ((VA_SIZE != 32) && (pte[58 :54] != 0)) {
18481848 raise_guest_page_fault(op, gpaddr, vaddr, tinst, effective_mode);
18491849 }
1850+ if (!implemented?(ExtensionName::Svrsw60t59b)) {
1851+ if ((PTESIZE >= 64) && pte[60:59] != 0) {
1852+ # 60:59 are reserved if Svrsw60t59b is not supported
1853+ raise_guest_page_fault(op, gpaddr, vaddr, tinst, effective_mode);
1854+ }
1855+ }
18501856 if (!implemented?(ExtensionName::Svnapot)) {
18511857 if ((PTESIZE >= 64) && pte[63] != 0) {
18521858 # N is reserved if Svnapot is not supported
@@ -2127,8 +2133,8 @@ function stage1_page_walk {
21272133 Boolean ss_page = (pte_flags.R == 0) && (pte_flags.W == 1) && (pte_flags.X == 0);
21282134
21292135 # check if any reserved bits are set
2130- # Sv32 has no reserved bits, and Sv39/48/57 all have reserved bits at 60 :54
2131- if ((VA_SIZE != 32) && (pte[60 :54] != 0)) {
2136+ # Sv32 has no reserved bits, and Sv39/48/57 all have reserved bits at 58 :54
2137+ if ((VA_SIZE != 32) && (pte[58 :54] != 0)) {
21322138 raise(page_fault_code, mode(), vaddr);
21332139 }
21342140
@@ -2156,6 +2162,13 @@ function stage1_page_walk {
21562162 }
21572163 }
21582164
2165+ if (!implemented?(ExtensionName::Svrsw60t59b)) {
2166+ if ((PTESIZE >= 64) && pte[60:59] != 0) {
2167+ # 60:59 are reserved if Svrsw60t59b is not supported
2168+ raise (page_fault_code, mode(), vaddr);
2169+ }
2170+ }
2171+
21592172 if (!implemented?(ExtensionName::Svnapot)) {
21602173 if ((PTESIZE >= 64) && (pte[63] != 0)) {
21612174 # N is reserved if Svnapot is not supported
0 commit comments