Skip to content

Commit

Permalink
Merge pull request #104 from smartobjectoriented/67-re-working-arm64-…
Browse files Browse the repository at this point in the history
…vt-code-base

67 re working arm64 vt code base

This is an exceptional merge with a major rework of the AVZ hypervisor and capsule (ex-ME) management.
It still needs some consequent changes but the current SO3 environment is not concerned so far.
I know there is still a minor issue with the vuart frontend/backend when dealing with several capsules at the same time.
  • Loading branch information
daniel-rossier authored Feb 5, 2025
2 parents bbb5ecc + d24d3c7 commit 29ad889
Show file tree
Hide file tree
Showing 176 changed files with 4,867 additions and 9,967 deletions.
11 changes: 5 additions & 6 deletions so3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,9 @@ OBJDUMP = $(CROSS_COMPILE)objdump

gccincdir := $(shell $(CC) -print-file-name=include)

SO3INCLUDE := -I.include -I. \
$(if $(KBUILD_SRC), -I./include) \
-include include/generated/autoconf.h

KBUILD_CPPFLAGS := -D__KERNEL__ -D__SO3__

KBUILD_CPPFLAGS += -I$(saved-output)include -I$(srctree)/include -I$(srctree)/include/net
KBUILD_CPPFLAGS += -I$(saved-output)include -I$(srctree)/include -I$(srctree)/include/net -I$(srctree)/avz/include
KBUILD_CPPFLAGS += -fno-builtin -ffreestanding -nostdinc -isystem $(gccincdir)

KBUILD_CFLAGS := -g -O0 -fno-common -Wall -Wstrict-prototypes $(KBUILD_CPPFLAGS)
Expand Down Expand Up @@ -343,7 +339,7 @@ export MAKE AWK GENKSYMS INSTALLKERNEL PERL UTS_MACHINE
export CPP AR NM STRIP OBJCOPY OBJDUMP
export TARGET

export KBUILD_CPPFLAGS NOSTDINC_FLAGS SO3INCLUDE OBJCOPYFLAGS LDFLAGS
export KBUILD_CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
export KBUILD_ARFLAGS

Expand Down Expand Up @@ -375,6 +371,8 @@ all: $(BIN) dtbs

objs-y := arch/$(SRCARCH) kernel mm fs ipc devices apps net

objs-$(CONFIG_AVZ) += avz

ifeq ($(CONFIG_AVZ),)

objs-$(CONFIG_SOO) += soo
Expand Down Expand Up @@ -407,6 +405,7 @@ KBUILD_CFLAGS_KERNEL += -I$(srctree)/arch/$(SRCARCH)/include/ -I$(srctree)/arch/
KBUILD_AFLAGS_KERNEL += -I$(srctree)/arch/$(SRCARCH)/include/ -I$(srctree)/arch/$(SRCARCH)/$(TARGET)/include/

ifdef CONFIG_SOO
KBUILD_CPPFLAGS += -Isoo/include
KBUILD_CFLAGS_KERNEL += -Isoo/include
KBUILD_AFLAGS_KERNEL += -Isoo/include
endif
Expand Down
3 changes: 3 additions & 0 deletions so3/apps/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ menu "SO3 Applications"
config APP_SAMPLE
bool "Sample application with thread environment"

config APP_REFSO3
bool "Simple example of a SO3 container"

endmenu
2 changes: 2 additions & 0 deletions so3/apps/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

obj-$(CONFIG_APP_REFSO3) += refso3/

obj-$(CONFIG_APP_SAMPLE) += sample.o

File renamed without changes.
100 changes: 2 additions & 98 deletions so3/soo/me/refso3/callbacks.c → so3/apps/refso3/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,47 +40,7 @@ static LIST_HEAD(known_soo_list);

/* Reference to the shared content helpful during synergy with other MEs */
sh_refso3_t *sh_refso3;

/**
* PRE-ACTIVATE
*
* Should receive local information through args
*/
void cb_pre_activate(soo_domcall_arg_t *args) {

DBG(">> ME %d: cb_pre_activate...\n", ME_domID());

#if 0 /* To be implemented... */
logmsg("[soo:me:SOO.refSO3] ME %d: cb_pre_activate..\n", ME_domID());
#endif

}

/**
* PRE-PROPAGATE
*
* The callback is executed in first stage to give a chance to a resident ME to stay or disappear, for example.
*/
void cb_pre_propagate(soo_domcall_arg_t *args) {

pre_propagate_args_t *pre_propagate_args = (pre_propagate_args_t *) &args->u.pre_propagate_args;

DBG(">> ME %d: cb_pre_propagate...\n", ME_domID());

pre_propagate_args->propagate_status = PROPAGATE_STATUS_YES;
}

/**
* Kill domcall - if another ME tries to kill us.
*/
void cb_kill_me(soo_domcall_arg_t *args) {

DBG(">> ME %d: cb_kill_me...\n", ME_domID());

/* Do we accept to be killed? yes... */
set_ME_state(ME_state_killed);
}


/**
* PRE_SUSPEND
*
Expand All @@ -90,60 +50,7 @@ void cb_kill_me(soo_domcall_arg_t *args) {
void cb_pre_suspend(soo_domcall_arg_t *args) {
DBG(">> ME %d: cb_pre_suspend...\n", ME_domID());
}

/**
* COOPERATE
*
* This callback is executed when an arriving ME (initiator) decides to cooperate with a residing ME (target).
*/
void cb_cooperate(soo_domcall_arg_t *args) {
cooperate_args_t *cooperate_args = (cooperate_args_t *) &args->u.cooperate_args;
agency_ctl_args_t agency_ctl_args;

lprintk("[soo:me:SOO.refSO3] ME %d: cb_cooperate...\n", ME_domID());

switch (cooperate_args->role) {
case COOPERATE_INITIATOR:

if (cooperate_args->alone)
return ;

/* Collaboration ... */

/* Update the list of hosts */
sh_refso3->me_common.soohost_nr = concat_hosts(&visits, (uint8_t *) sh_refso3->me_common.soohosts);

agency_ctl_args.u.cooperate_args.pfn = phys_to_pfn(virt_to_phys_pt((addr_t) sh_refso3));
agency_ctl_args.u.cooperate_args.slotID = ME_domID(); /* Will be copied in initiator_cooperate_args */

/* This pattern enables the cooperation with the target ME */

agency_ctl_args.cmd = AG_COOPERATE;
agency_ctl_args.slotID = cooperate_args->u.target_coop.slotID;

/* Perform the cooperate in the target ME */
args->__agency_ctl(&agency_ctl_args);
#if 0
set_ME_state(ME_state_killed);
#endif
break;

case COOPERATE_TARGET:
DBG("Cooperate: Target %d\n", ME_domID());
#if 1
/* Destroy us */
set_ME_state(ME_state_terminated);
#endif

break;

default:
lprintk("Cooperate: Bad role %d\n", cooperate_args->role);
BUG();
}

}


/**
* PRE_RESUME
*
Expand Down Expand Up @@ -193,9 +100,6 @@ void callbacks_init(void) {
/* Initialize the shared content page used to exchange information between other MEs */
memset(sh_refso3, 0, PAGE_SIZE);

/* Set the SPAD capabilities (currently not used) */
memset(&get_ME_desc()->spad, 0, sizeof(spad_t));

}


7 changes: 1 addition & 6 deletions so3/soo/me/refso3/refso3.c → so3/apps/refso3/refso3.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
#include <soo/soo.h>
#include <soo/console.h>
#include <soo/debug.h>
#include <soo/debug/dbgvar.h>
#include <soo/debug/logbool.h>
#include <soo/evtchn.h>

#include <me/refso3.h>
Expand All @@ -54,10 +52,7 @@
*
*/
void *app_thread_main(void *args) {

/* The ME can cooperate with the others. */
spad_enable_cooperate();


sh_refso3->cur_letter = 'A';

while (1) {
Expand Down
82 changes: 0 additions & 82 deletions so3/arch/arm32/domain.c

This file was deleted.

Loading

0 comments on commit 29ad889

Please sign in to comment.