<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/include/sbi/sbi_domain.h, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/opensbi.git/atom/include/sbi/sbi_domain.h?h=master</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/include/sbi/sbi_domain.h?h=master'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2026-03-09T06:41:24Z</updated>
<entry>
<title>include: sbi: Fix illegal shift in sbi_domain.h</title>
<updated>2026-03-09T06:41:24Z</updated>
<author>
<name>Marcos Oduardo</name>
<email>marcos.oduardo@gmail.com</email>
</author>
<published>2026-02-22T23:51:50Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=3baca10015393359ec46a2500c8ebe7daa9672c6'/>
<id>urn:sha1:3baca10015393359ec46a2500c8ebe7daa9672c6</id>
<content type='text'>
In sbi_domain.h, when checking if a memory region is a subset of
another, an undefined behavior arithmetic operation was caught
when sanitizing with UBSan (shift exponent __riscv_xlen).

This patch adds a check to handle the case where the region order
is __riscv_xlen, avoiding the illegal shift and ensuring the operation
remains defined.

Please let me know if there’s any other most suitable solution for
this bug.

Signed-off-by: Marcos Oduardo &lt;marcos.oduardo@gmail.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Link: https://lore.kernel.org/r/20260222235219.276432-1-marcos.oduardo@gmail.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi_domain: make is_region_subset public</title>
<updated>2025-12-21T15:03:20Z</updated>
<author>
<name>Bo Gan</name>
<email>ganboing@gmail.com</email>
</author>
<published>2025-12-18T10:42:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=ed1deab09ef6284d018fbf37ab397dcd4b9f82b8'/>
<id>urn:sha1:ed1deab09ef6284d018fbf37ab397dcd4b9f82b8</id>
<content type='text'>
The helper function is renamed as sbi_domain_memregion_is_subset,
and made public in header file.

Also add a convenient helper of sbi_domain_for_each_memregion_idx.

Signed-off-by: Bo Gan &lt;ganboing@gmail.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Link: https://lore.kernel.org/r/20251218104243.562667-4-ganboing@gmail.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi_domain: add sbi_domain_get_oldpmp_flags</title>
<updated>2025-12-21T15:03:18Z</updated>
<author>
<name>Bo Gan</name>
<email>ganboing@gmail.com</email>
</author>
<published>2025-12-18T10:42:38Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=2c1bf5bb73194ca035bcd5ab3fbc6653de3162e1'/>
<id>urn:sha1:2c1bf5bb73194ca035bcd5ab3fbc6653de3162e1</id>
<content type='text'>
Factor out logic in `sbi_hart_oldpmp_configure` into function
`sbi_domain_get_oldpmp_flags`, analogous to `sbi_domain_get_smepmp_flags`.
Platform specific hart-protection implementation can now leverage it.

Signed-off-by: Bo Gan &lt;ganboing@gmail.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Link: https://lore.kernel.org/r/20251218104243.562667-3-ganboing@gmail.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi_domain: ensure consistent firmware PMP entries</title>
<updated>2025-11-02T11:05:19Z</updated>
<author>
<name>Yu-Chien Peter Lin</name>
<email>peter.lin@sifive.com</email>
</author>
<published>2025-10-08T08:44:42Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=631efeeb4913f278b8f5e5920b8c233ac250ff28'/>
<id>urn:sha1:631efeeb4913f278b8f5e5920b8c233ac250ff28</id>
<content type='text'>
During domain context switches, all PMP entries are reconfigured
which can clear firmware access permissions, causing M-mode access
faults under SmePMP.

Sort domain regions to place firmware regions first, ensuring
consistent firmware PMP entries so they won't be revoked during
domain context switches.

Signed-off-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/20251008084444.3525615-7-peter.lin@sifive.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi_domain: add SBI_DOMAIN_MEMREGION_FW memregion flag</title>
<updated>2025-11-02T10:56:19Z</updated>
<author>
<name>Yu-Chien Peter Lin</name>
<email>peter.lin@sifive.com</email>
</author>
<published>2025-10-08T08:44:41Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=b34caeef815f2e3b54a13e69c8d163bc218712b9'/>
<id>urn:sha1:b34caeef815f2e3b54a13e69c8d163bc218712b9</id>
<content type='text'>
Add a new memregion flag, SBI_DOMAIN_MEMREGION_FW and mark the
OpenSBI code and data regions.

Signed-off-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/20251008084444.3525615-6-peter.lin@sifive.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi_hart: move sbi_hart_get_smepmp_flags() to sbi_domain</title>
<updated>2025-11-02T10:25:57Z</updated>
<author>
<name>Yu-Chien Peter Lin</name>
<email>peter.lin@sifive.com</email>
</author>
<published>2025-10-08T08:44:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=32c1d38dcf1a184b100bba2e26047939c32ec625'/>
<id>urn:sha1:32c1d38dcf1a184b100bba2e26047939c32ec625</id>
<content type='text'>
Move sbi_hart_get_smepmp_flags() from sbi_hart.c to sbi_domain.c and
rename it to sbi_domain_get_smepmp_flags() to better reflect its
purpose of converting domain memory region flags to PMP configuration.

Also removes unused parameters (scratch and dom).

Signed-off-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/20251008084444.3525615-2-peter.lin@sifive.com
Signed-off-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Fix non-root domain startup</title>
<updated>2025-02-19T11:41:39Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2025-02-11T15:36:23Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=1f64fef919fc5739df6c3395a9abd256dc88cb24'/>
<id>urn:sha1:1f64fef919fc5739df6c3395a9abd256dc88cb24</id>
<content type='text'>
Currently, the sbi_sse_init() in cold boot path is called after
sbi_domain_finalize() so boot HART of non-root domains will start
before SSE cold boot init which can cause warm boot of such HARTs
to crash in sbi_sse_init().

To address the above issue, factor-out the non-root domain startup
from sbi_domain_finalize() function as a separate sbi_domain_startup()
function  which can be called after sbi_sse_init() in cold boot path.

Fixes: 93f7d819fdeb ("lib: sbi: sse: allow adding new events")
Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi_domain: Use domain data support for per-domain hart context</title>
<updated>2024-10-25T17:30:10Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2024-09-23T08:16:12Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=f609fd85846ac35e2780df50ba0ad801622e13d8'/>
<id>urn:sha1:f609fd85846ac35e2780df50ba0ad801622e13d8</id>
<content type='text'>
The per-domain hartindex_to_context_table[] is yet another per-domain
data required for implementing hart entry into (or exit from) domain.

Use the recently added domain data support for per-domain hart context
so that a dedicated hartindex_to_context_table[] in struct sbi_domain
is not needed.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reviewed-by: Yu Chien Peter Lin &lt;peterlin@andestech.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Introduce domain data</title>
<updated>2024-10-25T17:30:07Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2024-09-23T04:30:51Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=81d79913a0c23d7acc38ade7e8d8e3d48a388a3f'/>
<id>urn:sha1:81d79913a0c23d7acc38ade7e8d8e3d48a388a3f</id>
<content type='text'>
Different parts of OpenSBI require their own per-domain data so
introduce domain data (or sbi_domain_data) which can be registered
by any part of OpenSBI. Using the domain data, the domain framework
will create a data pointer for every domain which can be used to
maintain some per-domain state.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reviewed-by: Yu Chien Peter Lin &lt;peterlin@andestech.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi_domain: Make sbi_domain_root_add_memregion() as local function</title>
<updated>2024-10-25T17:30:00Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2024-09-20T10:48:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=36c1e4064ff234563e9b0f7ee1e59db2ca1f96e7'/>
<id>urn:sha1:36c1e4064ff234563e9b0f7ee1e59db2ca1f96e7</id>
<content type='text'>
The sbi_domain_root_add_memregion() is only used within sbi_domain
implementation so rename and make it a local function.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reviewed-by: Samuel Holland &lt;samuel.holland@sifive.com&gt;
</content>
</entry>
</feed>
