<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/firmware, branch v1.8</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/opensbi.git/atom/firmware?h=v1.8</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/firmware?h=v1.8'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2025-12-28T15:14:03Z</updated>
<entry>
<title>lib: atomics: fix AMO test macros</title>
<updated>2025-12-28T15:14:03Z</updated>
<author>
<name>Vladimir Kondratiev</name>
<email>vladimir.kondratiev@mobileye.com</email>
</author>
<published>2025-12-28T07:33:21Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=f6fa62bd169e55f479b137da13ca83b27bb304a9'/>
<id>urn:sha1:f6fa62bd169e55f479b137da13ca83b27bb304a9</id>
<content type='text'>
The "RISC-V C API" [1] defines architecture extension test macros
says naming rule for the test macros is __riscv_&lt;ext_name&gt;, where
&lt;ext_name&gt; is all lower-case.

Three extensions dealing with atomics implementation are:
  "zaamo" consists of AMO instructions,
  "zalrsc" - LR/SC,
  "a" extension means both "zaamo" and "zalrsc"
Built-in test macros are __riscv_a, __riscv_zaamo and __riscv_zalrsc.
Alternative to the __riscv_a macro name, __riscv_atomic, is deprecated.

Use correct test macro __riscv_zaamo for the AMO variant of atomics.
It used to be __riscv_atomic that is both deprecated and incorrect
because it tests for the "a" extension; i.e. both "zaamo" and "zalrsc"
If ISA enables only zaamo but not zalrsc, code as it was would not compile.

Older toolchains may have neither __riscv_zaamo nor __riscv_zalrsc, so
query __riscv_atomic - it should be treated as both __riscv_zaamo and
__riscv_zalrsc, in all present cases __riscv_zaamo is more favorable
so take is as alternative for __riscv_zaamo

[1] https://github.com/riscv-non-isa/riscv-c-api-doc

Signed-off-by: Vladimir Kondratiev &lt;vladimir.kondratiev@mobileye.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Link: https://lore.kernel.org/r/20251228073321.1533844-1-vladimir.kondratiev@mobileye.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>firmware: Replace sole uses of REGBYTES with __SIZEOF_LONG__</title>
<updated>2025-07-22T10:24:27Z</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@jrtc27.com</email>
</author>
<published>2025-07-09T23:29:29Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=079bf6f0f93d01c8be3429d9a8a867ef84501557'/>
<id>urn:sha1:079bf6f0f93d01c8be3429d9a8a867ef84501557</id>
<content type='text'>
This code has nothing to do with the ISA's registers, it's about the
format of ELF relocations. As such, __SIZEOF_LONG__, being a language /
ABI-level property, is a more appropriate constant to use. This also
makes it easier to support CHERI, where general-purpose registers are
extended to be capabilities, not just integers, and so the register size
is not the same as the machine word size. This also happens to make it
more correct for RV64ILP32, where the registers are 64-bit integers but
the ABI is 32-bit (both for long and for the ELF format), though
properly supporting that ABI is not part of the motivation here, just a
consequence of improving the code for CHERI.

Signed-off-by: Jessica Clarke &lt;jrtc27@jrtc27.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Link: https://lore.kernel.org/r/20250709232932.37622-2-jrtc27@jrtc27.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>firmware: Rename __rel_dyn_start/end to __rela_dyn_start/end</title>
<updated>2025-07-21T11:09:49Z</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@jrtc27.com</email>
</author>
<published>2025-07-10T00:29:35Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=e10a45752fe77a1e6fc75e254947dadc3db633ec'/>
<id>urn:sha1:e10a45752fe77a1e6fc75e254947dadc3db633ec</id>
<content type='text'>
We are using and expecting the RELA format, not the REL format, and this
is the conventional linker-generated name for the start/end symbols, so
use it rather than confusing things by making it look like we're
accessing .rel.dyn, which would be in the REL format with no explicit
addend.

Signed-off-by: Jessica Clarke &lt;jrtc27@jrtc27.com&gt;
Reviewed-by: Samuel Holland &lt;samuel.holland@sifive.com&gt;
Tested-by: Samuel Holland &lt;samuel.holland@sifive.com&gt;
Link: https://lore.kernel.org/r/20250710002937.44307-1-jrtc27@jrtc27.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>firmware: payload: test: Add SBI shutdown call after test message</title>
<updated>2025-07-21T11:04:03Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2025-07-21T01:02:21Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=3876f8cd1e3c0c203a315bdc6e8ced176bb49e0a'/>
<id>urn:sha1:3876f8cd1e3c0c203a315bdc6e8ced176bb49e0a</id>
<content type='text'>
Previously, 'make run' would hang in WFI after printing the test message.
This commit adds an SBI ecall to ensure QEMU exits cleanly after the test
payload runs.

Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Link: https://lore.kernel.org/r/20250721010807.460788-1-wxjstz@126.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>firmware: Initial compiler built-in stack protector support</title>
<updated>2025-07-20T15:24:34Z</updated>
<author>
<name>Alvin Chang</name>
<email>alvinga@andestech.com</email>
</author>
<published>2025-07-03T15:19:57Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=edfbc1285dd9ac624665fe9fa5de26437d61c1eb'/>
<id>urn:sha1:edfbc1285dd9ac624665fe9fa5de26437d61c1eb</id>
<content type='text'>
Add __stack_chk_fail() and __stack_chk_guard variable which are used by
compiler built-in stack protector.

This patch just try to support stack-protector so the value of the stack
guard variable is simply fixed for now. It could be improved by
deriving from a random number generator, such as Zkr extension or any
platform-specific random number sources.

Introduce three configurations for the stack protector:
1. CONFIG_STACK_PROTECTOR to enable the stack protector feature by
   providing "-fstack-protector" compiler flag
2. CONFIG_STACK_PROTECTOR_STRONG to provide "-fstack-protector-strong"
3. CONFIG_STACK_PROTECTOR_ALL to provide "-fstack-protector-all"

Instead of fixing the compiler flag of stack-protector feature as
"-fstack-protector", we derive it from the introduced Kconfig
configurations. The compiler flag "stack-protector-cflags-y" is defined
as Makefile "immediately expanded variables" with ":=". Thus, the
stronger configuration of the stack protector can overwrite the
preceding one.

Signed-off-by: Alvin Chang &lt;alvinga@andestech.com&gt;
Reviewed-by: Yu-Chien Peter Lin &lt;peter.lin@sifive.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Link: https://lore.kernel.org/r/20250703151957.2545958-3-alvinga@andestech.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: Emit lr and sc instructions based on -march flags</title>
<updated>2025-03-28T13:22:05Z</updated>
<author>
<name>Chao-ying Fu</name>
<email>icebergfu@gmail.com</email>
</author>
<published>2025-02-26T01:47:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=995f226f3f335864d2fca6254af32fa7ab0162e6'/>
<id>urn:sha1:995f226f3f335864d2fca6254af32fa7ab0162e6</id>
<content type='text'>
When -march=rv64im_zalrsc_zicsr is used, provide atomic operations
and locks using lr and sc instructions only.

Signed-off-by: Chao-ying Fu &lt;cfu@mips.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Link: https://lore.kernel.org/r/20250226014727.19710-1-cfu@mips.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>firmware: fw_base.S: Fix comments for _wait_for_boot_hart</title>
<updated>2025-02-12T04:04:06Z</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2025-01-20T03:13:16Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=82da072eb4cc502c2a8a1c0b3b6e422367651d80'/>
<id>urn:sha1:82da072eb4cc502c2a8a1c0b3b6e422367651d80</id>
<content type='text'>
Due to some historical issues, the value of BOOT_STATUS_BOOT_HART_DONE
has changed and the comment message needs to be corrected.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>Makefile: enable --gc-sections</title>
<updated>2024-11-06T10:59:39Z</updated>
<author>
<name>Kele Zhang</name>
<email>zhangcola2003@gmail.com</email>
</author>
<published>2024-10-01T23:05:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=0171cfcc7010bcd75277a2c452e9702d934230f9'/>
<id>urn:sha1:0171cfcc7010bcd75277a2c452e9702d934230f9</id>
<content type='text'>
The --gc-sections option enables the linker to perform garbage
collection of unreferenced code and data, thereby reducing the binary
size.

The -ffunction-sections option will place each function into a separate
section, so it is necessary to add .text.* to the linker script.

Signed-off-by: Kele Zhang &lt;zhangcola2003@gmail.com&gt;
Signed-off-by: Yuan Tan &lt;tanyuan@tinylab.org&gt;
Signed-off-by: Zhangjin Wu &lt;falcon@tinylab.org&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: add Smdbltrp ISA extension support</title>
<updated>2024-10-25T18:30:12Z</updated>
<author>
<name>Clément Léger</name>
<email>cleger@rivosinc.com</email>
</author>
<published>2024-10-18T08:40:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=c46a937fd9071660979ff68e5c6310e62c9d1770'/>
<id>urn:sha1:c46a937fd9071660979ff68e5c6310e62c9d1770</id>
<content type='text'>
Add support for the Smdbltrp[1] ISA extension. First thing to do is
clearing MDT on entry after setting the first MTVEC (since MDT is
reset to 1). Additionally, during trap handling, clear MDT once all
critical CSRs have been saved and in return path, restore MSTATUS/H
before restoring MEPC to avoid taking another trap which would clobber
it.

Link: https://github.com/riscv/riscv-double-trap/releases/download/v0.56/riscv-double-trap.pdf [1]
Signed-off-by: Clément Léger &lt;cleger@rivosinc.com&gt;
Reviewed-by: Samuel Holland &lt;samuel.holland@sifive.com&gt;
</content>
</entry>
<entry>
<title>firmware: fw_base.S: fix multi-core boot bug.</title>
<updated>2024-09-27T05:35:37Z</updated>
<author>
<name>dong.yang</name>
<email>dong.yang@sophgo.com</email>
</author>
<published>2024-09-13T04:36:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=3e141a6950a276632439b202b220e49f3ae6969b'/>
<id>urn:sha1:3e141a6950a276632439b202b220e49f3ae6969b</id>
<content type='text'>
In a multi-core startup scenario, if both _try_lottery and
_wait_for_boot_hart use the data in the _boot_status address, when
a CPU enters OpenSBI later than boot hart set the _boot_status to
BOOT_STATUS_BOOT_HART_DONE, the CPU will modify _boot_status to 1
by amoswap.w and will never be awakened in _wait_for_boot_hart.
So let _try_lottery and _boot_status use data from two addresses.

Fixes: 8151105af5e4 ("firmware: fw_base.S: Remove _relocate_lottery")
Signed-off-by: dong.yang &lt;dong.yang@sophgo.com&gt;
Reviewed-by: Xing Xiaoguang &lt;xiaoguang.xing@sophgo.com&gt;
Reviewed-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
</feed>
