Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Update to OpenSBI 0.9 (SBI 0.3) #14

Closed
JohnAZoidberg opened this issue Mar 2, 2021 · 3 comments
Closed

Update to OpenSBI 0.9 (SBI 0.3) #14

JohnAZoidberg opened this issue Mar 2, 2021 · 3 comments

Comments

@JohnAZoidberg
Copy link
Collaborator

https://github.com/riscv/opensbi/releases/tag/v0.9

It has the new ResetSystem SBI call that we need for the UEFI ResetSystem RT call.

@JohnAZoidberg JohnAZoidberg self-assigned this Mar 2, 2021
@JohnAZoidberg
Copy link
Collaborator Author

WIP branches based on the work in #7 here:

In addition to the patch mentioned here: #7 (comment)
OpenSBI needs another patch:

diff --git i/lib/sbi/sbi_domain.c w/lib/sbi/sbi_domain.c
index 195c941..4c9a956 100644
--- i/lib/sbi/sbi_domain.c
+++ w/lib/sbi/sbi_domain.c
@@ -250,19 +250,6 @@ static int sanitize_domain(const struct sbi_platform *plat,
         * be started at boot-time by sbi_domain_finalize().
         */
 
-       /*
-        * Check next mode
-        *
-        * We only allow next mode to be S-mode or U-mode.so that we can
-        * protect M-mode context and enforce checks on memory accesses.
-        */
-       if (dom->next_mode != PRV_S &&
-           dom->next_mode != PRV_U) {
-               sbi_printf("%s: %s invalid next booting stage mode 0x%lx\n",
-                          __func__, dom->name, dom->next_mode);
-               return SBI_EINVAL;
-       }
-
        /* Check next address and next mode*/
        if (!sbi_domain_check_addr(dom, dom->next_addr, dom->next_mode,
                                   SBI_DOMAIN_EXECUTE)) {

@JohnAZoidberg
Copy link
Collaborator Author

With qemu 5.2.0 all types of reset work:

Shell> help reset
Resets the system.
 
RESET [-w [string]]
RESET [-s [string]]
RESET [-c [string]]
 
  -s     - Performs a shutdown.
  -w     - Performs a warm boot.
  -c     - Performs a cold boot.
  string - Describes a reason for the reset.
 
NOTES:
  1. This command resets the system.
  2. The default is to perform a cold reset unless the -w parameter is
     specified.
  3. If a reset string is specified, it is passed into the Reset() 
     function, and the system records the reason for the system reset.

@JohnAZoidberg
Copy link
Collaborator Author

Done on riscv-virt-gh-actions branch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant