<feed xmlns='http://www.w3.org/2005/Atom'>
<title>starfive-tech/opensbi.git/lib/sbi/sbi_ecall.c, branch debug</title>
<subtitle>StarFive Tech OpenSBI for VisionFive (JH7110) boards (mirror)</subtitle>
<id>https://git.radix-linux.su/starfive-tech/opensbi.git/atom?h=debug</id>
<link rel='self' href='https://git.radix-linux.su/starfive-tech/opensbi.git/atom?h=debug'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/opensbi.git/'/>
<updated>2021-01-07T04:23:14+00:00</updated>
<entry>
<title>lib: sbi: Replace args with trap registers in ecall handler</title>
<updated>2021-01-07T04:23:14+00:00</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-12-28T12:55:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/opensbi.git/commit/?id=80bc5065bb67f9d118b83f64cbe96f2e3e1bc0c6'/>
<id>urn:sha1:80bc5065bb67f9d118b83f64cbe96f2e3e1bc0c6</id>
<content type='text'>
We had added args pointer in ecall handler to ensure that ecall
handler only implements functionality and does not deal with
SBI calling convention. This also helped us to keep SBI calling
convention related code in one place at sbi_ecall_handler().

The Keystone Enclavce project needs access to the trap regsiters
in their ecall handler so that they can context switch enclaves
in custom SBI calls. To help the Keystone Enclave project, we
replace the args pointer in ecall handler parameter with a const
pointer to trap registers.

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: Implement System Reset (SRST) SBI extension</title>
<updated>2020-12-01T11:41:11+00:00</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-11-24T08:50:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/opensbi.git/commit/?id=548d03e577490f74af8b57706655e5d81c9b94a1'/>
<id>urn:sha1:548d03e577490f74af8b57706655e5d81c9b94a1</id>
<content type='text'>
The SBI SRST extension has been accepted and merged in the latest
SBI v0.3-draft specification.
(Refer, https://github.com/riscv/riscv-sbi-doc)

It allows to S-mode software to request system shutdown, cold reboot,
and warm reboot.

This patch implements SBI SRST extension as a replacement of the
legacy sbi_shutdown() call of SBI v0.1 specification.

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: Don't return any invalid error from SBI ecall</title>
<updated>2020-06-20T05:06:13+00:00</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-06-10T13:09:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/opensbi.git/commit/?id=2314101989684585f942b50a827aac4886825ba1'/>
<id>urn:sha1:2314101989684585f942b50a827aac4886825ba1</id>
<content type='text'>
We should only return valid error codes from SBI ecalls as
defined by the RISC-V SBI spec.

To achieve this:
1. We use SBI_Exxxx defines for OpenSBI internal errors with
   error values starting from -1000
2. We use SBI_ERR_xxxx defines for errors defined by SBI spec
3. We map some of the SBI_Exxxx defines to SBI_ERR_xxxx defines
   which are semantically same
4. We throw a error print and force return error code to
   SBI_ERR_FAILED in sbi_ecall_handler() if we see an invalid
   error code being returned to S-mode

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: Allow overriding SBI implementation ID</title>
<updated>2020-04-19T11:30:05+00:00</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-04-17T09:40:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/opensbi.git/commit/?id=66d018499cf928e0c8c8a15e0a896e7f80ad5f99'/>
<id>urn:sha1:66d018499cf928e0c8c8a15e0a896e7f80ad5f99</id>
<content type='text'>
Ideally, the SBI implementation ID for OpenSBI should always be
0x1 (as mentioned in SBI v0.2 spec) but external firmware (such
as EDK2) which use OpenSBI as library might want to override the
SBI implementation ID with their custom implementation ID.

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_ecall: Remove mcause, scratch and hartid parameters</title>
<updated>2020-03-28T08:02:20+00:00</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-03-19T16:25:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/opensbi.git/commit/?id=7487116b41e6c06d3903b600a2231d2a68d0c4a4'/>
<id>urn:sha1:7487116b41e6c06d3903b600a2231d2a68d0c4a4</id>
<content type='text'>
We remove mcause, scratch and hartid parameters from various
functions for ecall handling because we can always get current
HART id and current scratch pointer using just one CSR access.

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_trap: Remove scratch parameter from sbi_trap_redirect()</title>
<updated>2020-03-28T08:02:04+00:00</updated>
<author>
<name>Anup Patel</name>
<email>anup.patel@wdc.com</email>
</author>
<published>2020-03-19T14:03:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/opensbi.git/commit/?id=cb78a482314e8e3c7f423bb13fc50bbd50c59b13'/>
<id>urn:sha1:cb78a482314e8e3c7f423bb13fc50bbd50c59b13</id>
<content type='text'>
The scratch parameter of sbi_trap_redirect() is not used hence we
remove it.

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: Fix sbi_ecall_register_extension to prevent extension IDs overlap</title>
<updated>2020-03-19T04:46:17+00:00</updated>
<author>
<name>Xiang Wang</name>
<email>merle@hardenedlinux.org</email>
</author>
<published>2020-03-19T03:15:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/opensbi.git/commit/?id=a0c88ddb31ec5ce43f1dd8759a918ea590429176'/>
<id>urn:sha1:a0c88ddb31ec5ce43f1dd8759a918ea590429176</id>
<content type='text'>
The original code does not prevent the following scenarios:
&gt; sbi_ecall_register_extension(ext1); /* extension id (70-80) */
&gt; sbi_ecall_register_extension(ext2); /* extension id (50-100) */

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: sbi: Fix coding style issues</title>
<updated>2020-03-10T04:57:28+00:00</updated>
<author>
<name>Bin Meng</name>
<email>bmeng.cn@gmail.com</email>
</author>
<published>2020-03-09T03:52:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/opensbi.git/commit/?id=650c0e525ce60e80b6756aa8cc4eeae5b20ccbd8'/>
<id>urn:sha1:650c0e525ce60e80b6756aa8cc4eeae5b20ccbd8</id>
<content type='text'>
This fixes various coding style issues found in the SBI codes.
No functional changes.

Signed-off-by: Bin Meng &lt;bmeng.cn@gmail.com&gt;
Reviewed-by: Anup Patel &lt;anup.patel@wdc.com&gt;
</content>
</entry>
<entry>
<title>lib: Implement Hart State Management (HSM) SBI extension</title>
<updated>2020-02-24T12:43:23+00:00</updated>
<author>
<name>Atish Patra</name>
<email>atish.patra@wdc.com</email>
</author>
<published>2020-02-12T01:32:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/opensbi.git/commit/?id=e3f69fc1e934ce7815d9cde2d13dd2038a2894a6'/>
<id>urn:sha1:e3f69fc1e934ce7815d9cde2d13dd2038a2894a6</id>
<content type='text'>
This patch adds support HSM extension. The specification is available
at https://github.com/riscv/riscv-sbi-doc.

It allows to implement hart hotplug and fixed ordered hart booting in
supervisor.

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>lib: Initialize out value in SBI calls</title>
<updated>2020-02-13T04:27:22+00:00</updated>
<author>
<name>Atish Patra</name>
<email>atish.patra@wdc.com</email>
</author>
<published>2020-02-12T01:39:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/starfive-tech/opensbi.git/commit/?id=1a8ca08cc037c65c605e7e2f98b8c01606eaca3b'/>
<id>urn:sha1:1a8ca08cc037c65c605e7e2f98b8c01606eaca3b</id>
<content type='text'>
As per the SBI specification, the return value in sbiret is undefined
if not explicitly described in the function. However, supervisor may
check this value by mistake and get a garbage value.

Initialize it to zero to avoid nasty supervisor bugs.

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