Building x86 uberapp

@amitvasudevan,
Thanks! I have rebuild the hypervisor using --disable-drt --disable-dmap. However, I am still experiencing errors booting. See output serial log: x86_startup_disable-drt-dmap.txt (18.6 KB)

Ok, I just tried booting uberXMHF from the branch in the aforementioned PR (as is with no added changes) with the default configure options (--enable-debug-serial=0x3f8) and was able to boot successfully. My machine is a Dell Optiplex 9020 with Intel Core i7-4770 and 4GB of memory. I have attached the serial log for the successful boot below:

uxmhf-x86-drtdmap-bootup.log (65.1 KB)

Can you try booting uberXMHF built from the branch in the PR and compare?

I’m still having my original error when I build using the default config. x86_startup.log (47.9 KB)

Doing a diff of our serial outputs, it seems that around line 109 (mine), 120 (yours) that there is a difference in the TXT.ERRORCODE=. Mine has a value of

80000000
  processor error 0

while yours is just 0

----- update -------

We also have different values for rdsp.checksum. I have 30 while you have 20
rdsp.rsdtaddress, rdsp.xsdtaddress, gp_s1_scaniommu len=, rsdt.length, rsdt.checksum, gp_s1_scaniommu: dmar table addr=, gp_s2_sdminitdevmap: numentries_sysdev_mmioregions=, bytesgp_s2_setupgdt: setup TSS CPU idx={1,3,5,7}

It seems that I experience an error somewhere around the gp_s5_setupcpustate[3]: Setup VMX state, as I never see these outputs:

gp_s5_setupcpustate[2]: TR loaded
slab_main[2]: IDT loaded

========= more updates ==============

As I look closer, it looks like this is a loop that goes through all of the processors.
It appears that my log succeeds for cpu=2 and then fails when attempting to run gp_s5_* for cpu=4.

I’m curious if this is because my CPU doesn’t support hyper-threading, and only has 4 cores (thus no CPU=4)?

Ok, I think I know what the issue is. Stay tuned for a PR…

Aight @Cap. Please find the PR here: überXMHF(pc-intel-x86_32): add support for non linear CPU id mappings setup by some BIOSes

Can you give it a whirl and see where you land up with the default configure options (i.e., with DRT and DMAP enabled)?

Thanks!

@amitvasudevan,

Thanks! I tried this new PR. I am making additional progress. But it seems that my boot is stalling after setting up the VMX state on each CPU. Looking at your log, I don’t ever get an XC_INIT[5]: got control: ESP=0ae1cf28

Log attached: x86_startup_pr.log (26.7 KB)

Ok, I have pushed another changeset to the PR. This adds a configure option --with-debug-serial-maxcpus that allows you to specify the number of CPUs (cores) on your platform when debugging is turned on.

Please rebuild the micro-hypervisor using configure --enable-debug-serial=0x3f8 --with-debug-serial-maxcpus=4 and give it a whirl again.

Thanks!

1 Like

I think that this has solved my loading the hypervisor issues. I now just need to debug a grub related issue when grub is invoked the second time.

@amitvasudevan, thanks for all of the help debugging to ensure the hypervisor was booting. I can boot the hypervisor and run the existing hypapps (e.g., syscalllog).

I did some initial steps to port uhcalltest from rpi3 to x86 git branch. However, I am halting when I attempt to boot my modified hypervisor. newhypapp_halting.log (20.6 KB)

This looks like you have not defined your uberapp (uhcalltest) properly within the micro-hypervisor. Can you post your uxmhf/UOBJLIST.in?

do you mean /uxmhf/xmhf-uobjs/UOBJLIST.in?
https://github.com/slab14/uberxmhf/blob/feature-x86-newuhcalltest/uxmhf/xmhf-uobjs/UOBJLIST.in

Ahh yes indeed :slight_smile:

Ok as a first step, I would recommend replacing an existing extension (starting with xh_ prefix) within UOBJLIST.in instead of adding a new one. This will help us get the shortest path towards getting your new extension in the mix.

So, perhaps replace xh_hyperdep with xh_uhcalltest

Here is what I had attempted to do to register a new hypapp:

  • added XMHFGEEC_SLAB_XH_app to include/xmhf-config.h
  • added xh_app to /uxmhf/xmhf-uobjs/UOBJLIST.in

I will replace an existing app and try that.

Well after you replace an existing app within UOBJLIST.in you will need to take the following steps:

  1. replace XMHFGEEC_SLAB_XH_HYPERDEP with XMHFGEEC_SLAB_XH_UHCALLTEST within include/xmhf-config.h; keep the numbering as is (13 in this case)

  2. replace XMHFGEEC_SLAB_XH_HYPERDEP with XMHFGEEC_SLAB_XH_UHCALLTEST in the static xc_hypapp_info_t _xcihub_hypapp_info_table[] definition within xmhf-uobjs/include/xc.h

  3. add xh_uhcalltest.hwithin xmhf-uobjs/include/; use xmhf-uobjs/include/xh_hyperdep.h as a reference and adapt and change definitions to have the UHCALLTEST/uhcalltest prefix where appropriate. Ensure you use non-conflicting hypercall ids (e.g., 0xC0, 0xC1 should be changed to something else so that if we use hyperdep and uhcalltest they wont conflict)

  4. use xmhf-uobjs/xh_hyperdep/* as a template for your uhcalltest extension. Ensure you edit the .gsm file and change uobj-name, uobj-callees and uobj-uapicallees based on whether your extension calls other uobjs or provides APIs for other uobjs.

That should be it

@amitvasudevan, thanks!

I’m currently running into a build issue. for target '_uobjs_configureandgenerateuobjinfo'.
build.log (6.6 KB)

Can you post the full build log?

Can you post contents of your UOBJLIST file and the output of ls -l within uxmhf-uobjs?

UOBJLIST:

	"uobj-list": 	"	
						geec_sentinel
						geec_prime
						xc_init
						xc_exhub
						xc_ihub
						xc_nwlog
						uapi_gcpustate
						uapi_hcpustate
						uapi_slabmempgtbl
						uapi_sysdata
						uapi_iotbl
						uapi_uhmpgtbl
						xh_syscalllog
						xh_uhcalltest
						xh_ssteptrace
						xg_richguest
                                        "
}

ls -l xmhf-ubojs:

drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 geec_prime
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 geec_sentinel
drwxrwxr-x 2 slab slab 4096 Nov 13 13:13 include
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 uapi_gcpustate
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 uapi_hcpustate
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 uapi_iotbl
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 uapi_slabmempgtbl
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 uapi_sysdata
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 uapi_uhmpgtbl
-rw-rw-r-- 1 slab slab  344 Nov 13 14:34 UOBJLIST
-rw-rw-r-- 1 slab slab  343 Nov 13 14:34 UOBJLIST.in
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 xc_exhub
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 xc_ihub
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 xc_init
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 xc_nwlog
drwxrwxr-x 2 slab slab 4096 Nov 13 14:39 xg_richguest
drwxrwxr-x 2 slab slab 4096 Apr  8  2020 xh_aprvexec
drwxrwxr-x 3 slab slab 4096 Nov 13 14:33 xh_hyperdep
drwxrwxr-x 2 slab slab 4096 Nov 13 14:39 xh_ssteptrace
drwxrwxr-x 3 slab slab 4096 Nov 13 14:39 xh_syscalllog
drwxrwxr-x 2 slab slab 4096 Nov 13 14:39 xh_uhcalltest