<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/lib/sbi/sbi_init.c, branch v0.7</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/opensbi.git/atom/lib/sbi/sbi_init.c?h=v0.7</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/lib/sbi/sbi_init.c?h=v0.7'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2020-03-28T08:02:52Z</updated>
<entry>
<title>include: sbi_system: Remove scratch parameter and redundant functions</title>
<updated>2020-03-28T08:02:52Z</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-03-27T06:13:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=ec0d80f5b4928ebedee8881be47f8c430db667af'/>
<id>urn:sha1:ec0d80f5b4928ebedee8881be47f8c430db667af</id>
<content type='text'>
This patch removes scratch parameter and redundant functions from
sbi_system.

Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi_scratch: Introduce sbi_scratch_last_hartid() API</title>
<updated>2020-03-28T08:02:41Z</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-03-26T13:05:38Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=dd0f21c560f7139fc0c30bea1c264d8cb09144fe'/>
<id>urn:sha1:dd0f21c560f7139fc0c30bea1c264d8cb09144fe</id>
<content type='text'>
The patch adds sbi_scratch_last_hartid() API which returns
last HART id having a scratch space. We can use this new API
to optimize places where we iterate over HART id from 0 to
SBI_HARTMASK_MAX_BITS.

Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
</content>
</entry>
<entry>
<title>include: Use more consistent name for atomic xchg() and cmpxchg()</title>
<updated>2020-03-28T08:02:38Z</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-03-26T12:40:02Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=5b6957eed75ca7842861e0f6765d0f6a64408e05'/>
<id>urn:sha1:5b6957eed75ca7842861e0f6765d0f6a64408e05</id>
<content type='text'>
We should remove the "arch_" prefix from atomic xchg() and cmpxchg()
function names to have consistent naming of all atomic functions.

Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
</content>
</entry>
<entry>
<title>lib: prevent coldboot_lottery from overflowing</title>
<updated>2020-03-26T12:02:34Z</updated>
<author>
<name>Xiang Wang</name>
<email>merle@hardenedlinux.org</email>
</author>
<published>2020-03-24T10:11:48Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=4d93586bfa9a6875f1f28c5f430b17b650a19207'/>
<id>urn:sha1:4d93586bfa9a6875f1f28c5f430b17b650a19207</id>
<content type='text'>
HSM_STOP will trigger multiple executions of sbi_init, atomic_add_return may
trigger coldboot_lottery overflow

Signed-off-by: Xiang Wang &lt;merle@hardenedlinux.org&gt;
Reviewed-by: Anup Patel &lt;anup.patel@wdc.com&gt;
</content>
</entry>
<entry>
<title>lib: Check MSIP bit after returning from WFI</title>
<updated>2020-03-21T03:51:47Z</updated>
<author>
<name>Atish Patra</name>
<email>atish.patra@wdc.com</email>
</author>
<published>2020-03-20T22:10:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=9a74a64ae08bfeda8dc366e931f5a60838d7bac0'/>
<id>urn:sha1:9a74a64ae08bfeda8dc366e931f5a60838d7bac0</id>
<content type='text'>
Commit 71d2b837c46e (lib: Move all coldboot wait APIs to sbi_init.c)
caused a regression while moving the code from sbi_hart.c to sbi_init.c.

As per original commit text, WFI can be implemented as a NOP according
to the RISC-V privilege specification. Software should ensure that
relevant interrupt pending bits are set. Otherwise, loop back to WFI.
Fix the regression by applying the original patch to sbi_init.c.

Fixes: 71d2b837c46e ("lib: Move all coldboot wait APIs to sbi_init.c")

Signed-off-by: Atish Patra &lt;atish.patra@wdc.com&gt;
Reviewed-by: Anup Patel &lt;anup.patel@wdc.com&gt;
</content>
</entry>
<entry>
<title>include: sbi_platform: Introduce HART index to HART id table</title>
<updated>2020-03-19T04:00:01Z</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-03-15T06:09:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=c51f02cf143b081c2a81717393a0e6cef2ce2521'/>
<id>urn:sha1:c51f02cf143b081c2a81717393a0e6cef2ce2521</id>
<content type='text'>
A platform can have discontinuous and/or sparse HART ids so we
cannot always assume a set of HARTs with continuous HART ids.

This patch adds support for discontinuous and sparse HART ids by
introducing HART index to HART id table. This table has platform
hart_count entries and it maps HART index to HART id.

The HART index to HART id table has only two restrictions:
1. HART index &lt; sbi_platform hart_count
2. HART id &lt; SBI_HARTMASK_MAX_BITS

Example1:
Let's say we have a platform with 2 HART ids 11 and 22, for such a
a platform:
hart_count = 2
hart_index2id[0] = 11
hart_index2id[1] = 22

Example2:
Let's say we have a platform with 5 HARTs ids 0, 1, 2, 3, and 4
but out of these HART with id 0 is not usable so for such a platform:
hart_count = 5
hart_index2id[0] = -1U
hart_index2id[1] = 1
hart_index2id[2] = 2
hart_index2id[3] = 3
hart_index2id[4] = 4
OR
hart_count = 4
hart_index2id[0] = 1
hart_index2id[1] = 2
hart_index2id[2] = 3
hart_index2id[3] = 4

With HART index to HART id table in place, the hart_disabled()
callback is now redundant so we remove it as well.

Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
</content>
</entry>
<entry>
<title>lib: Don't use sbi_platform_hart_count() API</title>
<updated>2020-03-19T03:57:51Z</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-03-14T14:13:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=75eec9dd3f04febd7df8e5ee3fb90c236e50ded3'/>
<id>urn:sha1:75eec9dd3f04febd7df8e5ee3fb90c236e50ded3</id>
<content type='text'>
We don't need to use sbi_platform_hart_count() in sbi_init and
sbi_scratch because checking sbi_platform_hart_disabled() or
return value of sbi_hartid_to_scratch() is sufficient.

Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
</content>
</entry>
<entry>
<title>lib: Handle failure of sbi_hartid_to_scratch() API</title>
<updated>2020-03-19T03:41:12Z</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-03-14T13:25:53Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=209134d8f9c6e4ec9a555a7813f7e2c004b5b2d7'/>
<id>urn:sha1:209134d8f9c6e4ec9a555a7813f7e2c004b5b2d7</id>
<content type='text'>
The sbi_hartid_to_scratch() API can fail for non-existent HARTs so
all uses of sbi_hartid_to_scratch() API should check return value.

Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
</content>
</entry>
<entry>
<title>include: Simplify HART id to scratch macro</title>
<updated>2020-03-19T03:34:29Z</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-03-14T08:50:22Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=e23d3ba936698c52c83bbeed8d844fea22ae0859'/>
<id>urn:sha1:e23d3ba936698c52c83bbeed8d844fea22ae0859</id>
<content type='text'>
This patch simplify HART id to scratch macro as follows:
1. Remove current "scratch" pointer argument because now we
   use HART id to scratch table
2. Rename sbi_hart_id_to_scratch() to sbi_hartid_to_scratch()
   to have macro name consistent with the name of callback
   in struct sbi_scratch

Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi_scratch: Introduce HART id to scratch table</title>
<updated>2020-03-19T03:32:23Z</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-03-14T04:27:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=87a7ef7659e27cdd5ef9a639cd68cf628be3d2d3'/>
<id>urn:sha1:87a7ef7659e27cdd5ef9a639cd68cf628be3d2d3</id>
<content type='text'>
Instead of calling hartid_to_scratch() callback every time when
we want sbi_scratch pointer from HART id, we create a table of
sbi_scratch pointers and use that to get sbi_scratch pointer.

As a result of HART id to scratch table, the conversion of
HART id to sbi_scratch pointer is just 2-3 instructions which
was 9 instructions previously.

Signed-off-by: Anup Patel &lt;anup.patel@wdc.com&gt;
Reviewed-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Atish Patra &lt;atish.patra@wdc.com&gt;
</content>
</entry>
</feed>
