Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154625038
D54857.id170346.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
815 B
Referenced Files
None
Subscribers
None
D54857.id170346.diff
View Options
diff --git a/sys/riscv/include/cpufunc.h b/sys/riscv/include/cpufunc.h
--- a/sys/riscv/include/cpufunc.h
+++ b/sys/riscv/include/cpufunc.h
@@ -119,6 +119,12 @@
: "memory");
}
+static __inline void
+hfence_gvma(void)
+{
+ __asm __volatile("hfence.gvma" ::: "memory");
+}
+
#define rdcycle() csr_read64(cycle)
#define rdtime() csr_read64(time)
#define rdinstret() csr_read64(instret)
diff --git a/sys/riscv/vmm/vmm_riscv.c b/sys/riscv/vmm/vmm_riscv.c
--- a/sys/riscv/vmm/vmm_riscv.c
+++ b/sys/riscv/vmm/vmm_riscv.c
@@ -625,7 +625,7 @@
* have been modified, it may be necessary to execute an HFENCE.GVMA
* instruction (see Section 5.3.2) before or after writing hgatp.
*/
- __asm __volatile("hfence.gvma" ::: "memory");
+ hfence_gvma();
csr_write(hgatp, pmap->pm_satp);
if (has_sstc)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 30, 2:06 AM (12 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32430378
Default Alt Text
D54857.id170346.diff (815 B)
Attached To
Mode
D54857: riscv: Add macro for hfence.gvma instruction
Attached
Detach File
Event Timeline
Log In to Comment