Skip to content

Commit

Permalink
Merge pull request #557 from codelabs-ch/muen-misc
Browse files Browse the repository at this point in the history
Support for Solo5 unikernel lifecycle management on Muen & ABI increase
  • Loading branch information
dinosaure authored Apr 28, 2023
2 parents a21f57e + 5f5d92c commit efa949b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions bindings/muen/muen-platform_lifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,24 @@
*/

#include "bindings.h"
#include "sinfo.h"

const struct mft *muen_manifest = NULL;

extern const struct mft1_note __solo5_mft1_note;

void trigger_exit_event()
{
const struct muen_resource_type *const
event = muen_get_resource("solo5_exit", MUEN_RES_EVENT);

if (!event) {
return;
}

__asm__ __volatile__("vmcall": : "a"(event->data.number) : "memory");
}

void platform_init(const void *arg)
{
process_bootinfo(arg);
Expand All @@ -47,6 +60,7 @@ void platform_exit(int status __attribute__((unused)),
{
const char msg[] = "Solo5: Halted\n";
platform_puts(msg, strlen(msg));
trigger_exit_event();
__asm__ __volatile__("cli; hlt");
for (;;);
}
2 changes: 1 addition & 1 deletion bindings/muen/start.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ DECLARE_ELF_INTERP
ABI1_NOTE_DECLARE_BEGIN
{
.abi_target = MUEN_ABI_TARGET,
.abi_version = 2
.abi_version = 3
}
ABI1_NOTE_DECLARE_END

Expand Down
2 changes: 1 addition & 1 deletion bindings/solo5_muen.lds
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* are unexpected input sections not named here, the result will probably not be
* correct.
*/
TEXT_START = 0x100000;
TEXT_START = 0x200000;

ENTRY(_start)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_fpu/test_fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int solo5_app_main(const struct solo5_start_info *si __attribute__((unused)))
{
puts("\n**** Solo5 standalone test_fpu ****\n\n");

float a, b, c[4];
float a, b, c[4] __attribute__((aligned(64)));

c[0] = 2.0;
c[1] = 5.0;
Expand Down

0 comments on commit efa949b

Please sign in to comment.