Skip to content

Update uVisor to v0.27.0 #3817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 24, 2017
Merged

Update uVisor to v0.27.0 #3817

merged 2 commits into from
Feb 24, 2017

Conversation

AlessandroA
Copy link
Contributor

Description

This PR updates the uVisor binaries/API files to v0.27.0.

Changelog:

  • Re-factored vMPU drivers (internal changes).
  • Updated docs.
  • Fixed a couple of bugs around vMPU initialization.

Status

Ready for code review and CI.

Migrations

This PR only affects people actively using uVisor on a supported platform. Users are affected only if they run with uVisor enabled.

There is a single API change involving the uvisor_ctx pointer:

  • Previously, this pointer was maintained automatically by uVisor, and it was automatically declared in the translation unit that configures a secure box as YourBoxContextType * uvisor_ctx.
  • Instead, now we provide a void * __uvisor_ctx pointer that the users need to cast themselves to their context type. This ensures that users are aware of the type of uvisor_ctx and, most of all, can use it in more than one translation unit.

For a quick fix, just add this line to your existing code:

#define uvisor_ctx ((YourBoxContextType *) __uvisor_ctx)

@Patater @0xc0170 @sg-

The core_cmSecureAccess.h file contains secure-access APIs that are a
good candidate for a proposal to CMSIS. At the moment we maintain these
APIs ourselves in ARMmbed/uvisor, and will push updates to
ARMmbed/mbed-os when running our usual importer script.
* Updated docs
* Re-factored vMPU drivers
* Non-backwards-compatible API change: uvisor_ctx is now called
  __uvisor_ctx and requires the user to explicitly cast it to their own
  private context structure.
  This only affects applications with uVisor enabled.
* Use "public box" instead of main box for box 0.
@AlessandroA AlessandroA changed the title Update uvisor Update uVisor to v0.27.0 Feb 21, 2017
Copy link
Contributor

@Patater Patater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 21, 2017

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1669

Example Build failed!

@bridadan
Copy link
Contributor

@AlessandroA uvisor examples failed to build!

http://mbed-ci-master-2.austin.arm.com:8081/job/examples_build_matrix/513/target=K64F,toolchain=GCC_ARM/console

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 22, 2017

@AlessandroA uvisor examples failed to build!

I was told that this is known and should be fixed soon (waiting for confirmation from Alessandro).

@Patater
Copy link
Contributor

Patater commented Feb 22, 2017

@bridadan

Thanks! This is due to the aforementioned API change. We have PRs outstanding to make the examples compatible with both the old and the new API.

ARMmbed/mbed-os-example-uvisor#23
ARMmbed/mbed-os-example-uvisor-thread#36
ARMmbed/mbed-os-example-uvisor-number-store#23

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 23, 2017

One remaining ARMmbed/mbed-os-example-uvisor#23, and we can restart the CI.

@sg-
Copy link
Contributor

sg- commented Feb 23, 2017

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1691

Example Build failed!

@adbridge
Copy link
Contributor

/morph test-nightly

@bridadan
Copy link
Contributor

I see that there was a patch landed on mbed-os-example-uvisor-thread: ARMmbed/mbed-os-example-uvisor-thread#37

However, mbed-os-example-number-store also failed and I don't see a patch landed against that repo:

10:49:06 Compiling mbed-os-example-uvisor-number-store for K64F, GCC_ARM
10:49:07 c:\jenkins\workspace\bm_wrap\1761\.env\lib\site-packages\fuzzywuzzy\fuzz.py:35: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
10:49:07   warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
10:49:29 c:\jenkins\workspace\bm_wrap\1761\.env\lib\site-packages\fuzzywuzzy\fuzz.py:35: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
10:49:29   warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
10:49:29 c:\jenkins\workspace\bm_wrap\1761\.env\lib\site-packages\fuzzywuzzy\fuzz.py:35: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
10:49:29   warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
10:49:29 c:\jenkins\workspace\bm_wrap\1761\.env\lib\site-packages\fuzzywuzzy\fuzz.py:35: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
10:49:29   warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
10:49:29 c:\jenkins\workspace\bm_wrap\1761\.env\lib\site-packages\fuzzywuzzy\fuzz.py:35: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
10:49:29   warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
10:49:29 [ERROR] .\source\client_b.cpp: In function 'uint32_t get_a_number()':
10:49:29 .\source\client_b.cpp:44:22: error: 'my_box_context' was not declared in this scope
10:49:29  #define uvisor_ctx ((my_box_context *) __uvisor_ctx)
10:49:29                       ^
10:49:29 .\source\client_b.cpp:50:13: note: in expansion of macro 'uvisor_ctx'
10:49:29      return (uvisor_ctx->number -= 300UL);
10:49:29              ^
10:49:29 .\source\client_b.cpp:44:38: error: expected primary-expression before ')' token
10:49:29  #define uvisor_ctx ((my_box_context *) __uvisor_ctx)
10:49:29                                       ^
10:49:29 .\source\client_b.cpp:50:13: note: in expansion of macro 'uvisor_ctx'
10:49:29      return (uvisor_ctx->number -= 300UL);
10:49:29              ^
10:49:29 .\source\client_b.cpp:51:1: warning: control reaches end of non-void function [-Wreturn-type]
10:49:29  }
10:49:29  ^
10:49:29 
10:49:29 [mbed] WARNING: Could not find mbed program in current path "C:\Jenkins\workspace\bm_wrap\1761\examples\mbed-os-example-uvisor-number-store".
10:49:29 [mbed] WARNING: You can fix this by calling "mbed new ." in the root of your program.
10:49:29 ---
10:49:29 [mbed] ERROR: "python" returned error code 1.
10:49:29 [mbed] ERROR: Command "python -u C:\Jenkins\workspace\bm_wrap\1761\examples\mbed-os-example-uvisor-number-store\mbed-os\tools\make.py -t GCC_ARM -m K64F --source . --build .\BUILD\K64F\GCC_ARM --silent" in "C:\Jenkins\workspace\bm_wrap\1761\examples\mbed-os-example-uvisor-number-store"

If you can get a patch merged in approximately 10 minutes you won't have to rerun CI on this PR!
cc @AlessandroA @adbridge @Patater

@mbed-bot
Copy link

Result: ABORTED

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1694

Example Build failed!

@bridadan
Copy link
Contributor

Y'all acted fast but unfortunately not quite fast enough! I killed it to save some time, I'll restart it now.

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1696

Test failed!

@bridadan
Copy link
Contributor

🤦‍♂️ There was a very sporadic failure on one of the tests. The test took about 3 seconds longer than it normally does, it was about to signal a success, and then the test runner forced it to timeout. Very frustrating!

Rerunning...

/morph test-nightly

@bridadan
Copy link
Contributor

/morph test-nightly

1 similar comment
@bridadan
Copy link
Contributor

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1590

Example Build failed!

@bridadan
Copy link
Contributor

I couldn't reproduce the failure here.

/morph test-nightly

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1591

All builds and test passed!

@sg- sg- merged commit 262234d into ARMmbed:master Feb 24, 2017
@theotherjimmy
Copy link
Contributor

                                                               `      
                                                               `   `` 
                                                               `   `` 
                                                               `   `` 
                                                               `   `` 
                                                               `   `` 
         `                          `...                       ` - `` 
        .+:.`                      -+sys/`                     ` . `` 
        .oo++/-.`                 `+oyhhy/:///-`               `.-`-- 
        -oooooo++/:-..``          .+oyyso++oooo+`              `      
        -ossssssssoooo++//:::-----/ossooossyyyyo:.             `      
        -osssyyyyyyyyyyyysssssssssssso++syyhyyyyoo`            `      
        -oossyyyyyyyyyyyyyyyyyyhhhhhyoo+syyhyhyyos-            `      
        .+oossssssssysysssyyyyyyyyyyyssosyyyyyys+o.            `      
        .+ooooooooooooooooooooossyyssssssssyssso/:             `      
        `++++++++////::--...````:ysssyyyyyssoo+/`              `.`    
        `///::::-.``            -yyyshhhhhso++/.               .-     
         ::-.``                 -ssssyhhys/-..`                .      
         ..                     .///++o+/:..                   `      
                              `.-:::::::::-..`                 `      
                             ..---:::::::::-..`                `      
                           `..------:::::::--..``              `      
                          ``....---:::::/::--..```             `      
                          `````...---:::::--.`````             `      
                          `````...---:::::--.`` ``             `      
                          `````...---:::::--.`` ``             `      
                          `````...---:::::--.`` ``             `      
                          `````...---:::::--.`````             `      
                           ````...---:::::--.`````             `      
                          `````...---:::::--.````              `      
                          ````....---:::::--.````              `      
                          ````....---:::::--.````              `      
                          ````...----::::---.````              `    ` 
                          ````...-----:::---..```              `    ` 
                          ````...----::::---..```              `    ` 
                          ```....-----:::---..```              `    ` 
                          ```....-----:::---..```              `    ` 
                          ```....------:----..```              `  `.` 
                          ``.....-----------..```              ```.-` 
                          ``.....-----------..```              `..`-` 
                          ......------------..````             `...-` 
                          -:--.--------:----....-.             ``-.-` 
                           `.-:////+++++++++/:-.`              ``..-` 
                                 ```.....```                   `...-` 
                                                               .....` 
                                                               -:--/- 
                                                               -:--:: 
                                                               .````  

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

Successfully merging this pull request may close these issues.

8 participants