<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/lib, branch release-1.3.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.3.x</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/lib?h=release-1.3.x'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2023-07-19T06:21:59Z</updated>
<entry>
<title>lib: utils/gpio: Fix RV32 compile error for designware GPIO driver</title>
<updated>2023-07-19T06:21:59Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-07-11T03:30:31Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/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:57Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-07-05T06:45:15Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/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:59Z</updated>
<author>
<name>Ben Dooks</name>
<email>ben.dooks@sifive.com</email>
</author>
<published>2023-03-01T12:25:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/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:24Z</updated>
<author>
<name>Heinrich Schuchardt</name>
<email>heinrich.schuchardt@canonical.com</email>
</author>
<published>2023-07-03T13:43:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/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:32Z</updated>
<author>
<name>Gianluca Guida</name>
<email>gianluca@rivosinc.com</email>
</author>
<published>2023-06-29T14:24:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/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>lib: sbi: check A2 register in ecall_dbcn_handler.</title>
<updated>2023-06-23T03:16:07Z</updated>
<author>
<name>Gianluca Guida</name>
<email>gianluca@rivosinc.com</email>
</author>
<published>2023-06-22T17:38:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/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>platform/lib: Set no-map attribute on all PMP regions</title>
<updated>2023-06-15T12:57:17Z</updated>
<author>
<name>Alexandre Ghiti</name>
<email>alexghiti@rivosinc.com</email>
</author>
<published>2023-06-14T08:20:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/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>
<entry>
<title>lib: utils/irqchip: Use scratch space to save per-HART IMSIC pointer</title>
<updated>2023-06-06T10:31:14Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-04-20T04:48:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=355796c5bc1906d749850e4215e0f7f53802ba5b'/>
<id>urn:sha1:355796c5bc1906d749850e4215e0f7f53802ba5b</id>
<content type='text'>
Instead of using a global array indexed by hartid, we should use
scratch space to save per-HART IMSIC pointer and IMSIC file number.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: utils/irqchip: Don't check hartid in imsic_update_hartid_table()</title>
<updated>2023-06-05T11:21:07Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-04-20T04:44:43Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=1df52fa7e8db2c23a921014404bd472d20ca42e8'/>
<id>urn:sha1:1df52fa7e8db2c23a921014404bd472d20ca42e8</id>
<content type='text'>
The imsic_map_hartid_to_data() already checks hartid before using
so we don't need to check in imsic_update_hartid_table().

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: utils/irqchip: Use scratch space to save per-HART PLIC pointer</title>
<updated>2023-06-05T11:20:56Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-04-19T15:59:50Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=b3594ac1d10ef6c7269c6381a1e826b73b06aca0'/>
<id>urn:sha1:b3594ac1d10ef6c7269c6381a1e826b73b06aca0</id>
<content type='text'>
Instead of using a global array indexed by hartid, we should use
scratch space to save per-HART PLIC pointer and PLIC context numbers.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reviewed-by: Andrew Jones &lt;ajones@ventanamicro.com&gt;
</content>
</entry>
</feed>
