<feed xmlns='http://www.w3.org/2005/Atom'>
<title>software/src/opensbi.git, branch release-1.3.x</title>
<subtitle>RISC-V Open Source Supervisor Binary Interface</subtitle>
<id>https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/atom?h=release-1.3.x</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/atom?h=release-1.3.x'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/'/>
<updated>2023-07-19T06:21:59+00:00</updated>
<entry>
<title>lib: utils/gpio: Fix RV32 compile error for designware GPIO driver</title>
<updated>2023-07-19T06:21:59+00:00</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-07-11T03:30:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/commit/?id=057eb10b6d523540012e6947d5c9f63e95244e94'/>
<id>urn:sha1:057eb10b6d523540012e6947d5c9f63e95244e94</id>
<content type='text'>
Currently, we see following compile error in the designeware GPIO driver
for RV32 systems:

lib/utils/gpio/fdt_gpio_designware.c:115:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  115 |         chip-&gt;dr = (void *)addr + (bank * 0xc);
      |                    ^
lib/utils/gpio/fdt_gpio_designware.c:116:21: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  116 |         chip-&gt;ext = (void *)addr + (bank * 4) + 0x50;

We fix the above error using an explicit type-cast to 'unsigned long'.

Fixes: 7828eebaaa77 ("gpio/desginware: add Synopsys DesignWare APB GPIO support")
Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reviewed-by: Xiang W &lt;wxjstz@126.com&gt;
</content>
</entry>
<entry>
<title>lib: utils: Fix sbi_hartid_to_scratch() usage in ACLINT drivers</title>
<updated>2023-07-09T05:34:57+00:00</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-07-05T06:45:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/commit/?id=c6a35733b74aeff612398f274ed19a74f81d1f37'/>
<id>urn:sha1:c6a35733b74aeff612398f274ed19a74f81d1f37</id>
<content type='text'>
The cold_init() functions of ACLINT drivers should skip the HART
if sbi_hartid_to_scratch() returns NULL because we might be dealing
with a HART that is disabled in the device tree.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reviewed-by: Xiang W &lt;wxjstz@126.com&gt;
</content>
</entry>
<entry>
<title>gpio/desginware: add Synopsys DesignWare APB GPIO support</title>
<updated>2023-07-07T04:34:59+00:00</updated>
<author>
<name>Ben Dooks</name>
<email>ben.dooks@sifive.com</email>
</author>
<published>2023-03-01T12:25:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/commit/?id=7828eebaaa773fd83e63471ca27be3f30a0694f6'/>
<id>urn:sha1:7828eebaaa773fd83e63471ca27be3f30a0694f6</id>
<content type='text'>
Add a driver for the Synopsys DesignWare APB GPIO IP block found in many
SoCs.

Signed-off-by: Ben Dooks &lt;ben.dooks@sifive.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi_pmu: Avoid out of bounds access</title>
<updated>2023-07-05T03:59:24+00:00</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2023-07-03T13:43:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/commit/?id=eb736a5118b8d271bd649d713b6a058882c8fb7b'/>
<id>urn:sha1:eb736a5118b8d271bd649d713b6a058882c8fb7b</id>
<content type='text'>
On a misconfigured system we could access phs-&gt;active_events[] out of
bounds. Check that num_hw_ctrs is less or equal SBI_PMU_HW_CTR_MAX.

Addresses-Coverity-ID: 1566113 ("Out-of-bounds read")
Addresses-Coverity-ID: 1566114 ("Out-of-bounds write")
Signed-off-by: Heinrich Schuchardt &lt;heinrich.schuchardt@canonical.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: fix comment indent</title>
<updated>2023-07-05T03:55:32+00:00</updated>
<author>
<name>Gianluca Guida</name>
<email>gianluca@rivosinc.com</email>
</author>
<published>2023-06-29T14:24:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/commit/?id=0907de38dbcd121d2f8b4bafaf7f9fe76092d5f1'/>
<id>urn:sha1:0907de38dbcd121d2f8b4bafaf7f9fe76092d5f1</id>
<content type='text'>
Use tabs rather than spaces.

Signed-off-by: Gianluca Guida &lt;gianluca@rivosinc.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>include: Bump-up version to 1.3</title>
<updated>2023-06-23T05:31:49+00:00</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-06-23T05:31:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/commit/?id=2552799a1df30a3dcd2321a8b75d61d06f5fb9fc'/>
<id>urn:sha1:2552799a1df30a3dcd2321a8b75d61d06f5fb9fc</id>
<content type='text'>
This patch updates OpenSBI version to 1.3 as part of
release preparation.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi: check A2 register in ecall_dbcn_handler.</title>
<updated>2023-06-23T03:16:07+00:00</updated>
<author>
<name>Gianluca Guida</name>
<email>gianluca@rivosinc.com</email>
</author>
<published>2023-06-22T17:38:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/commit/?id=8bd666a25b543ba391ae6ee81c1a2469e95c4a05'/>
<id>urn:sha1:8bd666a25b543ba391ae6ee81c1a2469e95c4a05</id>
<content type='text'>
Do not ignore register A2 (high bits of physical address) in the dbcn
handler (RV64).

Signed-off-by: Gianluca Guida &lt;gianluca@rivosinc.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: reset: Move fdt_reset_init into generic_early_init</title>
<updated>2023-06-21T05:42:42+00:00</updated>
<author>
<name>Guo Ren</name>
<email>guoren@linux.alibaba.com</email>
</author>
<published>2023-06-18T15:07:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/commit/?id=27c957a43b030523baf931a3b8ef002418fb27ad'/>
<id>urn:sha1:27c957a43b030523baf931a3b8ef002418fb27ad</id>
<content type='text'>
The fdt_reset_thead driver needs to modify the __reset_thead_csr_stub
text region for the secondary harts booting. After that, the
sbi_hart_pmp_configure may lock down the text region with M_READABLE &amp;
M_EXECUTABLE attributes in the future. Currently, the M_READABLE &amp;
M_EXECUtABLE have no effect on m-mode, the L-bit in pmpcfg csr is
useless for the current opensbi scenario. See:

Priv-isa-spec 3.7.1.2. Locking and Privilege Mode
When the L bit is clear, any M-mode access matching the PMP entry will
succeed; the R/W/X permissions apply only to S and U modes.

That's why current fdt_reset_thead could still work well after commit:
230278dcf127 ("lib: sbi: Add separate entries for firmware RX and RW
regions"). So this patch fixes up a fake bug for the M-mode permission
setting of the future.

Fixes: 230278dcf127 ("lib: sbi: Add separate entries for firmware RX and RW regions")
Link: http://lists.infradead.org/pipermail/opensbi/2023-June/005176.html
Reported-by: Jessica Clarke &lt;jrtc27@jrtc27.com&gt;
Signed-off-by: Guo Ren &lt;guoren@linux.alibaba.com&gt;
Signed-off-by: Guo Ren &lt;guoren@kernel.org&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>firmware: Fix find hart index</title>
<updated>2023-06-21T04:50:51+00:00</updated>
<author>
<name>Xiang W</name>
<email>wxjstz@126.com</email>
</author>
<published>2023-06-16T07:03:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/commit/?id=d64942f0e4fe63a248e7ba3dd7ff4dec02954134'/>
<id>urn:sha1:d64942f0e4fe63a248e7ba3dd7ff4dec02954134</id>
<content type='text'>
After the loop to find the hartid is launched, assigning -1 to
index will fail in the subsequent compare instruction bge. Fix
This.

Signed-off-by: Xiang W &lt;wxjstz@126.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>platform/lib: Set no-map attribute on all PMP regions</title>
<updated>2023-06-15T12:57:17+00:00</updated>
<author>
<name>Alexandre Ghiti</name>
<email>alexghiti@rivosinc.com</email>
</author>
<published>2023-06-14T08:20:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/riscv/software/src/opensbi.git/commit/?id=8153b2622b08802cc542f30a1fcba407a5667ab9'/>
<id>urn:sha1:8153b2622b08802cc542f30a1fcba407a5667ab9</id>
<content type='text'>
This reverts commit 6966ad0abe70 ("platform/lib: Allow the OS to map the
regions that are protected by PMP").

It was thought at the time of this commit that allowing the kernel to map
PMP protected regions was safe but it is actually not: for example, the
hibernation process will try to access any linear mapping page and then
will fault on such mapped PMP regions [1]. Another issue is that the
device tree specification [2] states that a !no-map region must be
declared as EfiBootServicesData/Code in the EFI memory map which would make
the PMP protected regions reclaimable by the kernel. And to circumvent
this, RISC-V edk2 diverges from the DT specification to declare those
regions as EfiReserved.

The no-map attribute was removed to allow the kernel to use hugepages
larger than 2MB to map the linear mapping to improve the performance but
actually a recent talk from Mike Rapoport [3] stated that the
performance benefit was marginal.

For all those reasons, let's mark all the PMP protected regions as "no-map".

[1] https://lore.kernel.org/linux-riscv/CAAYs2=gQvkhTeioMmqRDVGjdtNF_vhB+vm_1dHJxPNi75YDQ_Q@mail.gmail.com/
[2] "3.5.4 /reserved-memory and UEFI" https://github.com/devicetree-org/devicetree-specification/releases/download/v0.4-rc1/devicetree-specification-v0.4-rc1.pdf
[3] https://lwn.net/Articles/931406/

Signed-off-by: Alexandre Ghiti &lt;alexghiti@rivosinc.com&gt;
Reviewed-by: Atish Patra &lt;atishp@rivosinc.com&gt;
Reviewed-by: Xiang W &lt;wxjstz@126.com&gt;
</content>
</entry>
</feed>
