Page MenuHomeFreeBSD

riscv: Add macro for hfence.gvma instruction
ClosedPublic

Authored by doonbsd_gmail.com on Jan 24 2026, 9:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 2, 8:18 PM
Unknown Object (File)
Mon, Mar 2, 5:36 PM
Unknown Object (File)
Sun, Feb 22, 11:24 AM
Unknown Object (File)
Sat, Feb 21, 5:22 PM
Unknown Object (File)
Sat, Feb 21, 5:22 PM
Unknown Object (File)
Sat, Feb 21, 4:25 AM
Unknown Object (File)
Sat, Feb 21, 4:25 AM
Unknown Object (File)
Sat, Feb 21, 2:57 AM

Details

Summary

Add an inline function hfence_gvma() for hfence.gvma instruction.

Signed-off-by: Doongar Singh <doonbsd@gmail.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added inline comments.
sys/riscv/include/atomic.h
41 ↗(On Diff #170325)

Let's put it in riscv/include/cpufunc.h instead? atomic.h isn't really the right place for this, it's more similar to sfence_vma() etc..

Moved hfence_gvma from atomic.h to cpufunc.h and changed it to an inline function.

This revision is now accepted and ready to land.Jan 25 2026, 4:03 PM

riscv: Add an inline function hfence_gvma() for hfence.gvma instruction.

This revision now requires review to proceed.Jan 25 2026, 4:54 PM

Hold on. I just found one style problem. There must be a empty line after start curly brace when the function has single line body.

I send an updated patch.

Hold on. I just found one style problem. There must be a empty line after start curly brace when the function has single line body.

I send an updated patch.

That style(9) rule was dropped years ago

So, this can't be merged now? Shall I drop that change and update new diff?

So, this can't be merged now? Shall I drop that change and update new diff?

No, it's ok as-is. Indeed, style(9) doesn't require the blank line, but most of the other wrappers in this file have one so we might as well stay consistent.

So, this can't be merged now? Shall I drop that change and update new diff?

No, it's ok as-is. Indeed, style(9) doesn't require the blank line, but most of the other wrappers in this file have one so we might as well stay consistent.

Ok. The status has changed to "Needs Review" after I updated the patch. Can please you accept it?

This revision is now accepted and ready to land.Jan 26 2026, 4:08 PM
This revision was automatically updated to reflect the committed changes.