Skip to content

Commit 76c2dcb

Browse files
committed
rustsbi: H ext should be enabled by rv64,x-h=true
1 parent 4b4e24f commit 76c2dcb

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@ test run_test_kernel ... ok
9595
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.31s
9696
```
9797

98+
## Notes
99+
100+
1. How to enable hypervisor H extension on QEMU?
101+
102+
You should use these following line of parameters:
103+
104+
```rust
105+
command.args(&["-cpu", "rv64,x-h=true"]);
106+
```
107+
108+
... to enable H extension on QEMU software.
109+
98110
## License
99111

100112
This project is licensed under Mulan PSL v2.

rustsbi-qemu/src/main.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ extern "C" fn rust_main(hartid: usize, opqaue: usize) -> ! {
8181
unsafe {
8282
// enable wake by ipi
8383
riscv::register::mstatus::set_mie();
84-
// enable H extension
85-
asm!(
86-
"csrr {val}, misa", "li {h}, 0x80", "or {val}, {val}, {h}", "csrw misa, {val}",
87-
val = lateout(reg) _, h = lateout(reg) _
88-
);
8984
}
9085
if hartid == 0 {
9186
// print hart csr configuration

0 commit comments

Comments
 (0)