<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/lib, branch release-1.5.x</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/opensbi.git/atom/lib?h=release-1.5.x</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/lib?h=release-1.5.x'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2024-08-02T03:23:22Z</updated>
<entry>
<title>lib: sbi: check result of pmp_get() in is_pmp_entry_mapped()</title>
<updated>2024-08-02T03:23:22Z</updated>
<author>
<name>Carlos López</name>
<email>carlos.lopezr4096@gmail.com</email>
</author>
<published>2024-08-01T12:58:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=43cace6c3671e5172d0df0a8963e552bb04b7b20'/>
<id>urn:sha1:43cace6c3671e5172d0df0a8963e552bb04b7b20</id>
<content type='text'>
pmp_get() may return an error if the given entry, given by the caller
of is_pmp_entry_mapped(), is invalid. This results in the output
parameters for pmp_get() being uninitialized. To avoid using garbage
values, check the result and return early if necessary.

This issue is not being hit because at the moment
is_pmp_entry_mapped() is only being called from a single site with a
valid hardcoded value.

Signed-off-by: Carlos López &lt;carlos.lopezr4096@gmail.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: fwft: fix incorrect size passed to sbi_zalloc()</title>
<updated>2024-08-02T03:23:20Z</updated>
<author>
<name>Carlos López</name>
<email>carlos.lopezr4096@gmail.com</email>
</author>
<published>2024-08-01T12:48:11Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=cb0f4757fc2904cbf579e34feba891a5878625c5'/>
<id>urn:sha1:cb0f4757fc2904cbf579e34feba891a5878625c5</id>
<content type='text'>
The fwt_hart_state struct inciludes a flexible array member, so its
allocation size will be that of the struct itself, plus that of each
of the members in the array. When calculating this size, instead of
taking the size of the struct, the size of a pointer to it was taken,
which is incorrect. Luckily, this happenned to not produce memory
corruption because the size of the non-flexible members of the struct
is the same as the size of a pointer.

Signed-off-by: Carlos López &lt;carlos.lopezr4096@gmail.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: dbtr: fix potential NULL pointer dereferences</title>
<updated>2024-08-02T03:23:19Z</updated>
<author>
<name>Carlos López</name>
<email>carlos.lopezr4096@gmail.com</email>
</author>
<published>2024-08-01T12:27:42Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=baf6a75e3f967aa8b65a20963bd9ae21975ba75a'/>
<id>urn:sha1:baf6a75e3f967aa8b65a20963bd9ae21975ba75a</id>
<content type='text'>
In several dbtr functions, we first check that the dbtr trigger is not
NULL and that its state is what we expect. However, it only makes
sense to perform the second check if the dbtr trigger is not NULL.
Othwerwise we will dereference a NULL pointer. Thus, change the
condition so that it shortcuts to the first check if necessary.

Signed-off-by: Carlos López &lt;carlos.lopezr4096@gmail.com&gt;
Reviewed-By: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi_hsm: Save/restore menvcfg only when it exists</title>
<updated>2024-07-29T06:04:18Z</updated>
<author>
<name>Samuel Holland</name>
<email>samuel.holland@sifive.com</email>
</author>
<published>2024-07-10T14:26:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=65a3938fadc537af178c84a349ade31ec6a70846'/>
<id>urn:sha1:65a3938fadc537af178c84a349ade31ec6a70846</id>
<content type='text'>
Attempting to access the menvcfg CSR raises an illegal instruction
exception on hardware which implements Sm1p11 or older.

Fixes: e9ee9678ba50 ("lib: sbi: fwft: add support for SBI_FWFT_PTE_AD_HW_UPDATING")
Signed-off-by: Samuel Holland &lt;samuel.holland@sifive.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: check incoming dbtr shmem address</title>
<updated>2024-06-28T03:06:46Z</updated>
<author>
<name>Sergey Matyukevich</name>
<email>geomatsi@gmail.com</email>
</author>
<published>2024-06-27T12:04:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=23b7badeee3caa1445784273ba5dc8dbcbba7c34'/>
<id>urn:sha1:23b7badeee3caa1445784273ba5dc8dbcbba7c34</id>
<content type='text'>
Current Debug Trigger SBI extension proposal suggests to activate
shmem area and obtain its physical address from S-mode software
in the following way:

: If both `shmem_phys_lo` and `shmem_phys_hi` parameters are not
: all-ones bitwise then `shmem_phys_lo` specifies the lower XLEN
: bits and `shmem_phys_hi` specifies the upper XLEN bits of the
: shared memory physical base address. The `shmem_phys_lo` MUST
: be `(XLEN / 8)` byte aligned and the size of shared memory is
: assumed to be `trig_max * (XLEN / 2)` bytes.

For more details see the current version of the proposal:
- https://lists.riscv.org/g/tech-debug/message/1302

On the other hand, on RV32, the M-mode can only access the first 4GB of
the physical address space because M-mode does not have MMU to access
full 34-bit physical address space. Similarly, on RV64, the M-mode can
only access memory addressed by 64 bits.

This commit checks shmem address in function sbi_dbtr_setup_shmem
to make sure that shmem_phys_hi part of the valid address is zero.
Besides, the macro DBTR_SHMEM_MAKE_PHYS is updated to take into
account only low XLEN part.

Signed-off-by: Sergey Matyukevich &lt;geomatsi@gmail.com&gt;
Reviewed-by: Himanshu Chauhan &lt;hchauhan@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi: fwft: return SBI_EINVAL rather than SBI_ERR_INVALID_PARAM</title>
<updated>2024-06-26T12:44:49Z</updated>
<author>
<name>Clément Léger</name>
<email>cleger@rivosinc.com</email>
</author>
<published>2024-06-24T10:29:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=caae2f7d455c78c509782e1eb8d47dfdd874b903'/>
<id>urn:sha1:caae2f7d455c78c509782e1eb8d47dfdd874b903</id>
<content type='text'>
Error code returned by the ecall handles should use the defines from
sbi_ecall_interface.h rather than sbi_error.h.

Signed-off-by: Clément Léger &lt;cleger@rivosinc.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: fwft: check feature value to be exactly 1 or 0</title>
<updated>2024-06-26T12:43:54Z</updated>
<author>
<name>Clément Léger</name>
<email>cleger@rivosinc.com</email>
</author>
<published>2024-06-24T10:29:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=e8717d126401435896b0e96c18e187f0b2431d5e'/>
<id>urn:sha1:e8717d126401435896b0e96c18e187f0b2431d5e</id>
<content type='text'>
As stated by the spec and pointed out by Andrew Jones, the value passed
for MISALIGNED_EXC_DELEG and PTE_AD_HW_UPDATING should be either 0 or 1.
Add check for these values and return SBI_EINVAL if not.

Signed-off-by: Clément Léger &lt;cleger@rivosinc.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: implement SBI FWFT extension</title>
<updated>2024-06-19T12:45:28Z</updated>
<author>
<name>Clément Léger</name>
<email>cleger@rivosinc.com</email>
</author>
<published>2024-06-19T09:42:42Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=ecef14d5732f837cbfa4a8cefa8fed7953e7abfb'/>
<id>urn:sha1:ecef14d5732f837cbfa4a8cefa8fed7953e7abfb</id>
<content type='text'>
The SBI FWFT extension defines a set of function that can be called
to control the configuration of some platform features (misaligned
trap delegation, etc). This patch implements sbi_fwft_set() and
sbi_fwft_get() as defined in the specification [1].

Link: https://lists.riscv.org/g/tech-prs/message/924 [1]
Signed-off-by: Clément Léger &lt;cleger@rivosinc.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: fwft: add support for SBI_FWFT_PTE_AD_HW_UPDATING</title>
<updated>2024-06-19T12:41:26Z</updated>
<author>
<name>Clément Léger</name>
<email>cleger@rivosinc.com</email>
</author>
<published>2024-06-19T09:42:41Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=e9ee9678ba509f42a93c8de518710c225c0499f5'/>
<id>urn:sha1:e9ee9678ba509f42a93c8de518710c225c0499f5</id>
<content type='text'>
Add support for SBI_FWFT_PTE_AD_HW_UPDATING based on SVADU presence.

Signed-off-by: Clément Léger &lt;cleger@rivosinc.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: fwft: add support for SBI_FWFT_MISALIGNED_EXC_DELEG</title>
<updated>2024-06-19T12:40:36Z</updated>
<author>
<name>Clément Léger</name>
<email>cleger@rivosinc.com</email>
</author>
<published>2024-06-19T09:42:40Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=c97a1d58918bcdbbb5dbabaf869b09be2b877577'/>
<id>urn:sha1:c97a1d58918bcdbbb5dbabaf869b09be2b877577</id>
<content type='text'>
Add support for SBI_FWFT_MISALIGNED_EXC_DELEG withing FWFT support. This
support allows to delegate misaligned accesses traps.

Signed-off-by: Clément Léger &lt;cleger@rivosinc.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
</feed>
