Adding new überApps¶
Integrating a new überApp into the micro-hypervisor requires the following integration pieces:
Create directory for überApp functionality (e.g.,
xh_newapp
) within thexmhf-uobjs
folderxh_newapp.gsm
defines key attributes of the überAppxhnewapp_main.c
is used to invoke different operations (e.g., initialize, hypercall, shutdown, etc.). Where each of these opertions has a related file (xhnewapp_hcbinit.c
)
To integrate the überApp add references in the following locations:
- Add
xh_newapp
to the list inxmhf-uobjs/UOBJLIST.in
- Add a
DEFINE XMHFGEEC_SLAB_XH_NEWAPP
toinclude/xmhf-config.h
- Add a table entry to
static xc_hypapp_info_t _xcihub_hypapp_info_table[]
corresponding to the operations your hypapp performs inxmhf-uobjs/include/xc.h
- Add
xh_newapp
to the list ofuobj-callees
inxmhf-uobjs/xc_init/sc_init.gsm
andxmhf-uobj/xc_ihub/xc_ihub.gsm
- Add
Ensure that your reconfigure prior to building (this is required to rewrite
xmhf-uobjs/UOBJLST
that is used by theMakefile
). Follow the steps in uberXMHF (pc-intel-x86_32) Veryfying and BuildingAdd a test program that exercises your überApp in
xmhf-rgapps/linux
- Create a directory for the test program (
rgapp-newapp
) that includes aMakefile
and the testprogram (rgapp-newapp.c
). - This test program will need to call
__vmcall(eax, ebx, edx, ecx)
, whereeax
is the hypercall ID,ebx
is the high order 32-bit of the physical address,edx
is the low-order 32-bit of the physical address (e.g., of an up to 4KB buffer being passed to the überApp), andecx
is variable based upon the überApp. - This test program needs to convert the data buffer being sent to the
überApps from a virtual to a physical address. Some approaches for
this (such as reading
/proc/self/pagemap
) require root permissions.
- Create a directory for the test program (
Run the test program (using permissions as required, see above).
xh_uhcalltest
is an example überApp that follows the above steps to
demonstrate a simple hypercall handling functionality. The corresponding
rich-guest application is found within xmhf-rgapps/linux/rgapp-uhcalltest
.
Note
Currently, the preferred method of adding überApps is to switch out an
existing überApp
(to preserve the memory mapping). By default the following überApps are
enabled: syscalllog
, hyperdep
, and ssteptrace
.
Thus to add a new überApp, one would replace one of the above with the
new überApp.
Note
To expand the number of überApps that can be enabled, the memory map must
be expanded. This requires changing the size within include/xmhf-config.h
by modifying definitions such as XMHFGEEC_xxx_{BASE/MAX}_IDX
;
and uxmhf-common.mk.in` by modifying exports such as UXMHF_TOTAL_xxSLABS
,
XMHF_CONFIG_LOADADDR
, XMHF_CONFIG_LOADMAXSIZE
, and XMHF_CONFIG_LOADMAXADDR
.
Note
The folloinwg are default naming conventions for üobjects within the micro-hypervisor: * xc = uberXMHF core * xh = uberXMHF hypapps * xg = uberXMHF Guest