Skip to content
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

Add Multiple OS Support #31

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

chrisguikema
Copy link
Contributor

@chrisguikema chrisguikema commented Oct 25, 2022

API change configuring each VM individually. This allows for a configuration supporting different Operating Systems, getting closer to a universal VMM.

Test with: seL4/seL4_projects_libs#81, seL4/camkes-vm#48

This commit performed a find/replace to replace Linux references with
generic VM/Kernel references, due to the VMM's ability to run other
Operating Systems.

Signed-off-by: Chris Guikema <chris.guikema@dornerworks.com>
apps/Arm/odroid_vm/vm_odroid.camkes Outdated Show resolved Hide resolved
Previously, CMake variables would apply to each VM. This commit
configures each VM based on their need.

Signed-off-by: Chris Guikema <chris.guikema@dornerworks.com>
Signed-off-by: Chris Guikema <chris.guikema@dornerworks.com>
@chrisguikema
Copy link
Contributor Author

@WellMcGarnicle any idea why the Armv7 tests are failing but the Armv8 tests are working fine? It seems like its not pulling in the changes from the camkes-vm repo

@lsf37
Copy link
Member

lsf37 commented Jan 16, 2023

@WellMcGarnicle any idea why the Armv7 tests are failing but the Armv8 tests are working fine? It seems like its not pulling in the changes from the camkes-vm repo

This might be unrelated to your PR. camkes-vm is currently broken on Armv7 and that's probably what you're seeing here. @abrandnewusername what's the ETA on fixing that problem? It's been quite a while now.

@abrandnewusername
Copy link
Contributor

@WellMcGarnicle any idea why the Armv7 tests are failing but the Armv8 tests are working fine? It seems like its not pulling in the changes from the camkes-vm repo

This might be unrelated to your PR. camkes-vm is currently broken on Armv7 and that's probably what you're seeing here. @abrandnewusername what's the ETA on fixing that problem? It's been quite a while now.

It has been fixed already.

@axel-h axel-h requested a review from wom-bat February 22, 2023 18:19
@axel-h
Copy link
Member

axel-h commented Feb 22, 2023

Can you add kernel_entry_addr in the examples, so we don't get a warning that it's not set? And if this turns out to be non-trivial, the example should have at least a comment here, that they expects the defaults to work. Rationale for my request is, that if we run into issues here where the example can't provide proper guidance, then there is a fundamental problem.

The VMM will calculate the entry address, but it should be explicitly
set by the user.

Signed-off-by: Chris Guikema <chris.guikema@dornerworks.com>
@chrisguikema
Copy link
Contributor Author

I added kernel_entry_addr to each example. I think the exynos platforms were the only ones where the offset wasn't 0x8_0000, but I may have made a mistake somewhere, so I'd appreciate it if my work got double checked.

@axel-h
Copy link
Member

axel-h commented Feb 22, 2023

We have the test passing, but It seem this does not execute anything on the hardware. Is there a way to test this, @lsf37 ?

@lsf37
Copy link
Member

lsf37 commented Feb 26, 2023

The runs Camkes VM / Test (armv7a) and Camkes VM / Test (armv8a) both include hardware runs (e.g. on tk1), so this seems to be passing hardware tests fine.

@wom-bat have your concerns been addressed, i.e. can this be merged now?

@axel-h
Copy link
Member

axel-h commented Mar 3, 2023

Is this good to be merged now? The changes are really useful.

ram_offset and initrd_max_size are not used by the VMM, so we can safely
remove them from the configuration.

Signed-off-by: Chris Guikema <chris.guikema@dornerworks.com>
@chrisguikema
Copy link
Contributor Author

@kent-mcleod will this PR get merged too?

@axel-h
Copy link
Member

axel-h commented Mar 8, 2023

I had this open request to move the types from stringto uint64_t in the new config block. As long as this is not merged, we can change the type without leaving a trace that it was different once.

Potential reasons why these should be strings are, that this allow putting more in here than just numbers, e.g. the empty string so one does not have to use -1 as a dummy. Or using "+0x1000" to indicate something is an offset rather then an absolute value (which might be nice feature for entry address, dtb and initrd location). Also, in the generated code the string show up as they are, while integers tend to become quite hard to read decimal values - unless the templates explicitly renders then as hex string.

@chrisguikema
Copy link
Contributor Author

chrisguikema commented Mar 8, 2023

Right. If we were modifying the types to avoid using strtol at runtime, I think it would be a good fix to implement. However, the templates now just take the strings and create the constant variables during compilation. To me, the ability to add the offsets is a really good usecase for keeping things as strings, when the gain for changing to uint64_t isn't really there anymore.

@kent-mcleod
Copy link
Member

@kent-mcleod will this PR get merged too?

Yea, I was just waiting to see if any tests failed running the examples using the linux_* configurations before updating the examples to use the new configuration format.

@kent-mcleod
Copy link
Member

Right. If we were modifying the types to avoid using strtol at runtime, I think it would be a good fix to implement. However, the templates now just take the strings and create the constant variables during compilation. To me, the ability to add the offsets is a really good usecase for keeping things as strings, when the gain for changing to uint64_t isn't really there anymore.

I don't quite follow what you mean about the ability to add offsets requiring strings?

@chrisguikema
Copy link
Contributor Author

By keeping the parameters as strings, you can do this:

        vm0.linux_address_config = {
            "kernel_entry_addr" : "0x40000000 + 0x80000",
        };

and the output is

const unsigned long entry_addr = 0x40000000 + 0x80000;

Not sure if you change the parameters to uint64_t you could still do that

Copy link
Member

@axel-h axel-h left a comment

Choose a reason for hiding this comment

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

Testing this on hardware with seL4/camkes-vm#93 gives errors:

  install_vm_devices@main.c:702 module name: map_frame_hack
  install_vm_devices@main.c:702 module name: init_ram
  install_vm_devices@main.c:702 module name: plat
  Loading Kernel: 'linux'
  <<seL4(CPU 0) [decodeARMFrameInvocation/2473 T0xfc59fc00 "vm0:control" @78868]: Page Flush: Overlaps kernel region.>>
  guest_write_address@guest_image.c:148 [Err seL4_IllegalOperation]:
  	seL4_ARM_Page_CleanInvalidate_Data failed
  
  [[Timeout]]
OnDemandInstall: Created device-backed memory for addr 0x2439000
  [    3.159552] eqos_get_mac_address_dtb: bad mac address at /chosen/nvidia,ether-mac: null.
  [    3.176303] NET: Registered protocol family 10
  [    3.180783] ether-mac read from DT failed -99
  [    3.187675] eqos: MDIO is not present
  [    3.187675]
  [    3.192863] Unable to handle kernel NULL pointer dereference at virtual address 00000000
  [    3.201588] sit: IPv6 over IPv4 tunneling driver
  [    3.206241] pgd = ffff8000005df000
  [    3.213499] [00000000] *pgd=00000000f7802003
  [    3.219721] NET: Registered protocol family 17
  [    3.224379] , *pud=00000000f7803003, *pmd=00000000f7804003, *pte=00e8000003881707
  [    3.231918] Internal error: Oops: 96000004 [#1] PREEMPT SMP
  [    3.237482] Modules linked in:
  [    3.240544] CPU: 0 PID: 6 Comm: kworker/u2:0 Not tainted 4.4.38L4T kernel 4.4.38 #8
  [    3.248186] Hardware name: quill (DT)
  [    3.251843] Workqueue: events_unbound 0xffff8000000a8b40
  [    3.257152] task: ffff80000686c000 ti: ffff800006870000 task.ti: ffff800006870000
  [    3.264620] pc : [<ffff8000002581b0>] lr : [<ffff8000002581ac>] pstate: 80000145
  [    3.272001] sp : ffff800006873b80
  [    3.275308] x29: ffff800006873b80 x28: ffff800000400471
  [    3.280628] x27: ffff800007d55c20 x26: ffff8000003bb6d0
  [    3.285945] x25: ffff8000005ca000 x24: 0000000000000001
  [    3.291265] x23: ffff8000064fe080 x22: ffff8000064fe090
  [    3.296584] x21: ffff80000165c000 x20: 00000000ffffff9d
  [    3.301902] x19: ffff80000165c780 x18: 0000000000000010
  [    3.307218] x17: 000000000000000e x16: 0000000000000007
  [    3.312537] x15: 0000000000000000 x14: 0ffffffffffffffe
  [    3.317857] x13: 0000000000000028 x12: 0101010101010101
  [    3.323174] x11: 7f7f7f7f7f7f7f7f x10: 00000000000005e0
  [    3.328492] x9 : ffff800006873980 x8 : ffff80000686c640
  [    3.333808] x7 : ffff800007d112e0 x6 : 0000000000000400
  [    3.339124] x5 : 0000000000000001 x4 : 0000000000000000
  [    3.344441] x3 : 0000000000000000 x2 : ffff80000053963c
  [    3.349758] x1 : 0000000000000000 x0 : 0000000000000000
  [    3.355078]
  [    3.356567] Process kworker/u2:0 (pid: 6, stack limit = 0xffff800006870020)
  [    3.363512] Call trace:
  [    3.365954] [<ffff8000002581b0>] 0xffff8000002581b0
  [    3.370821] [<ffff800000236f90>] 0xffff800000236f90
  [    3.375688] [<ffff800000235948>] 0xffff800000235948
  [    3.380556] [<ffff800000235a4c>] 0xffff800000235a4c
  [    3.385424] [<ffff800000234014>] 0xffff800000234014
  [    3.390292] [<ffff800000235490>] 0xffff800000235490
  [    3.395159] [<ffff80000023443c>] 0xffff80000023443c
  [    3.400026] [<ffff8000000a8b88>] 0xffff8000000a8b88
  [    3.404892] [<ffff8000000a188c>] 0xffff8000000a188c
  [    3.409759] [<ffff8000000a2600>] 0xffff8000000a2600
  [    3.414627] [<ffff8000000a6c54>] 0xffff8000000a6c54
  [    3.419493] [<ffff800000084790>] 0xffff800000084790
  [    3.424563] ---[ end trace f6b6e2d40bd25d63 ]---
  [    3.429535] NET: Registered protocol family 15
  [    3.460254] Unable to handle kernel paging request at virtual address ffffffffffffffd8
  [    3.468162] pgd = ffff8000005df000
  [    3.471558] [ffffffffffffffd8] *pgd=0000000000000000
  [    3.476525] Internal error: Oops: 96000004 [#2] PREEMPT SMP
  [    3.482086] Modules linked in:
  [    3.485148] CPU: 0 PID: 6 Comm: kworker/u2:0 Tainted: G      D         4.4.38L4T kernel 4.4.38 #8
  [    3.494002] Hardware name: quill (DT)
  [    3.497666] task: ffff80000686c000 ti: ffff800006870000 task.ti: ffff800006870000
  [    3.505133] pc : [<ffff8000000a70e0>] lr : [<ffff8000000a2d78>] pstate: 600001c5
  [    3.512514] sp : ffff800006873780
  [    3.515821] x29: ffff800006873780 x28: ffff800006870000
  [    3.521140] x27: ffff800007d55c20 x26: 0000000000000000
  [    3.526458] x25: 0000000000000000 x24: ffff80000052a9e8
  [    3.531779] x23: ffff80000686c420 x22: ffff80000051e280
  [    3.537100] x21: 0000000000000000 x20: ffff80000686c000
  [    3.542418] x19: 0000000000000000 x18: 0000000000000028
  [    3.547736] x17: 000000000000000e x16: 0000000000000007
  [    3.553054] x15: 0000000000000001 x14: 0000000000000007
  [    3.558375] x13: 000000000000000e x12: 0000000000000013
  [    3.563693] x11: 000000000000001a x10: ffff8000003b7ed8
  [    3.569011] x9 : ffff80000052a9e8 x8 : 0000000000004960
  [    3.574328] x7 : ffff800007d112e0 x6 : 0000000000000400
  [    3.579644] x5 : 00ffffffffffffff x4 : ffff80000686c060
  [    3.584964] x3 : 0000000000000000 x2 : 00000000b9c29b62
  [    3.590283] x1 : 0000000000000000 x0 : 0000000000000000
  [    3.595598]
  [    3.597087] Process kworker/u2:0 (pid: 6, stack limit = 0xffff800006870020)
  [    3.604035] Call trace:
  [    3.606476] [<ffff8000000a70e0>] 0xffff8000000a70e0
  [    3.611343] [<ffff800000370530>] 0xffff800000370530
  [    3.616209] [<ffff8000003708a8>] 0xffff8000003708a8
  [    3.621077] [<ffff800000093354>] 0xffff800000093354
  [    3.[6259](https://github.com/seL4/camkes-vm/actions/runs/4916139523/jobs/8779673546?pr=93#step:4:6265)45] [<ffff800000086f70>] 0xffff800000086f70
  [    3.630812] [<ffff80000008e324>] 0xffff80000008e324
  [    3.635678] [<ffff80000008e580>] 0xffff80000008e580
  [    3.640545] [<ffff80000008e5b8>] 0xffff80000008e5b8
  [    3.645412] [<ffff800000080aa4>] 0xffff800000080aa4
  [    3.650278] [<ffff800000083d40>] 0xffff800000083d40
  [    3.655145] [<ffff800000236f90>] 0xffff800000236f90
  [    3.660012] [<ffff800000235948>] 0xffff800000235948
  [    3.664878] [<ffff800000235a4c>] 0xffff800000235a4c
  [    3.669745] [<ffff800000234014>] 0xffff800000234014
  [    3.674611] [<ffff800000235490>] 0xffff800000235490
  [    3.679479] [<ffff80000023443c>] 0xffff80000023443c
  [    3.684346] [<ffff8000000a8b88>] 0xffff8000000a8b88
  [    3.689212] [<ffff8000000a188c>] 0xffff8000000a188c
  [    3.694079] [<ffff8000000a2600>] 0xffff8000000a2600
  [    3.698946] [<ffff8000000a6c54>] 0xffff8000000a6c54
  [    3.703812] [<ffff800000084790>] 0xffff800000084790
  [    3.708855] ---[ end trace f6b6e2d40bd25d65 ]---
  [    3.713463] Fixing recursive fault but reboot is needed!
  
  [[Timeout]]
  • vm_virtio_net_ping_tx2 FAILED
OnDemandInstall: Created device-backed memory for addr 0x2439000
  [    3.159458] eqos_get_mac_address_dtb: bad mac address at /chosen/nvidia,ether-mac: null.
  [    3.176385] NET: Registered protocol family 10
  [    3.180846] ether-mac read from DT failed -99
  [    3.187787] eqos: MDIO is not present
  [    3.187787]
  [    3.192975] Unable to handle kernel NULL pointer dereference at virtual address 00000000
  [    3.201703] sit: IPv6 over IPv4 tunneling driver
  [    3.206355] pgd = ffff8000005df000
  [    3.213698] [00000000] *pgd=00000000f7802003
  [    3.219940] NET: Registered protocol family 17
  [    3.224600] , *pud=00000000f7803003, *pmd=00000000f7804003, *pte=00e8000003881707
  [    3.232126] Internal error: Oops: 96000004 [#1] PREEMPT SMP
  [    3.237690] Modules linked in:
  [    3.240750] CPU: 0 PID: 6 Comm: kworker/u2:0 Not tainted 4.4.38L4T kernel 4.4.38 #8
  [    3.248391] Hardware name: quill (DT)
  [    3.252048] Workqueue: events_unbound 0xffff8000000a8b40
  [    3.257360] task: ffff80000686c000 ti: ffff800006870000 task.ti: ffff800006870000
  [    3.264829] pc : [<ffff8000002581b0>] lr : [<ffff8000002581ac>] pstate: 80000145
  [    3.272208] sp : ffff800006873b80
  [    3.275515] x29: ffff800006873b80 x28: ffff800000400471
  [    3.280837] x27: ffff800007d55c20 x26: ffff8000003bb6d0
  [    3.286155] x25: ffff8000005ca000 x24: 0000000000000001
  [    3.291474] x23: ffff8000064fe080 x22: ffff8000064fe090
  [    3.296794] x21: ffff80000165e000 x20: 00000000ffffff9d
  [    3.302112] x19: ffff80000165e780 x18: 0000000000000010
  [    3.307429] x17: 000000000000000e x16: 0000000000000007
  [    3.312748] x15: 0000000000000000 x14: 0ffffffffffffffe
  [    3.318068] x13: 0000000000000028 x12: 0101010101010101
  [    3.323384] x11: 7f7f7f7f7f7f7f7f x10: 00000000000005e0
  [    3.328703] x9 : ffff800006873980 x8 : ffff80000686c640
  [    3.334020] x7 : ffff800007d112e0 x6 : 0000000000000400
  [    3.339339] x5 : 0000000000000001 x4 : 0000000000000000
  [    3.344657] x3 : 0000000000000000 x2 : ffff80000053963c
  [    3.349975] x1 : 0000000000000000 x0 : 0000000000000000
  [    3.355293]
  [    3.356782] Process kworker/u2:0 (pid: 6, stack limit = 0xffff800006870020)
  [    3.363729] Call trace:
  [    3.366170] [<ffff8000002581b0>] 0xffff8000002581b0
  [    3.371038] [<ffff800000236f90>] 0xffff800000236f90
  [    3.375906] [<ffff800000235948>] 0xffff800000235948
  [    3.380774] [<ffff800000235a4c>] 0xffff800000235a4c
  [    3.385642] [<ffff800000234014>] 0xffff800000234014
  [    3.390509] [<ffff800000235490>] 0xffff800000235490
  [    3.395374] [<ffff80000023443c>] 0xffff80000023443c
  [    3.400241] [<ffff8000000a8b88>] 0xffff8000000a8b88
  [    3.405107] [<ffff8000000a188c>] 0xffff8000000a188c
  [    3.409973] [<ffff8000000a2600>] 0xffff8000000a2600
  [    3.414840] [<ffff8000000a6c54>] 0xffff8000000a6c54
  [    3.419706] [<ffff800000084790>] 0xffff800000084790
  [    3.424775] ---[ end trace bb19a9da89dc376a ]---
  [    3.429745] NET: Registered protocol family 15
  [    3.460596] Unable to handle kernel paging request at virtual address ffffffffffffffd8
  [    3.468504] pgd = ffff8000005df000
  [    3.471898] [ffffffffffffffd8] *pgd=0000000000000000
  [    3.476862] Internal error: Oops: 96000004 [#2] PREEMPT SMP
  [    3.482423] Modules linked in:
  [    3.485481] CPU: 0 PID: 6 Comm: kworker/u2:0 Tainted: G      D         4.4.38L4T kernel 4.4.38 #8
  [    3.494336] Hardware name: quill (DT)
  [    3.497998] task: ffff80000686c000 ti: ffff800006870000 task.ti: ffff800006870000
  [    3.505466] pc : [<ffff8000000a70e0>] lr : [<ffff8000000a2d78>] pstate: 600001c5
  [    3.512847] sp : ffff800006873780
  [    3.516154] x29: ffff800006873780 x28: ffff800006870000
  [    3.521472] x27: ffff800007d55c20 x26: 0000000000000000
  [    3.526789] x25: 0000000000000000 x24: ffff80000052a9e8
  [    3.532106] x23: ffff80000686c420 x22: ffff80000051e280
  [    3.537422] x21: 0000000000000000 x20: ffff80000686c000
  [    3.542740] x19: 0000000000000000 x18: 0000000000000028
  [    3.548056] x17: 000000000000000e x16: 0000000000000007
  [    3.553373] x15: 0000000000000001 x14: 0000000000000007
  [    3.558691] x13: 000000000000000e x12: 0000000000000013
  [    3.564010] x11: 000000000000001a x10: ffff8000003b7ed8
  [    3.569326] x9 : ffff80000052a9e8 x8 : 0000000000004820
  [    3.574642] x7 : ffff800007d112e0 x6 : 0000000000000400
  [    3.579961] x5 : 00ffffffffffffff x4 : ffff80000686c060
  [    3.585278] x3 : 0000000000000000 x2 : 00000000b9cfe522
  [    3.590595] x1 : 0000000000000000 x0 : 0000000000000000
  [    3.595912]
  [    3.597400] Process kworker/u2:0 (pid: 6, stack limit = 0xffff800006870020)
  [    3.604346] Call trace:
  [    3.606787] [<ffff8000000a70e0>] 0xffff8000000a70e0
  [    3.611654] [<ffff800000370530>] 0xffff800000370530
  [    3.616520] [<ffff8000003708a8>] 0xffff8000003708a8
  [    3.621387] [<ffff800000093354>] 0xffff800000093354
  [    3.626254] [<ffff800000086f70>] 0xffff800000086f70
  [    3.631120] [<ffff80000008e324>] 0xffff80000008e324
  [    3.635988] [<ffff80000008e580>] 0xffff80000008e580
  [    3.640854] [<ffff80000008e5b8>] 0xffff80000008e5b8
  [    3.645720] [<ffff800000080aa4>] 0xffff800000080aa4
  [    3.650586] [<ffff800000083d40>] 0xffff800000083d40
  [    3.655452] [<ffff800000236f90>] 0xffff800000236f90
  [    3.660319] [<ffff800000235948>] 0xffff800000235948
  [    3.665186] [<ffff800000235a4c>] 0xffff800000235a4c
  [    3.670053] [<ffff800000234014>] 0xffff800000234014
  [    3.674920] [<ffff800000235490>] 0xffff800000235490
  [    3.679787] [<ffff80000023443c>] 0xffff80000023443c
  [    3.684654] [<ffff8000000a8b88>] 0xffff8000000a8b88
  [    3.689520] [<ffff8000000a188c>] 0xffff8000000a188c
  [    3.694388] [<ffff8000000a2600>] 0xffff8000000a2600
  [    3.699255] [<ffff8000000a6c54>] 0xffff8000000a6c54
  [    3.704122] [<ffff800000084790>] 0xffff800000084790
  [    3.709169] ---[ end trace bb19a9da89dc376c ]---
  [    3.[7137](https://github.com/seL4/camkes-vm/actions/runs/4916139523/jobs/8779673546?pr=93#step:4:7144)77] Fixing recursive fault but reboot is needed!
  
  [[Timeout]]

@axel-h
Copy link
Member

axel-h commented Jan 24, 2024

@chrisguikema where are we with this set of PRs actually. It seems to work basically, just need to pass the CI runs or clarify what they fail temporarily until everything is merged?

@chrisguikema
Copy link
Contributor Author

Yeah the changes do seem to work, except for the cases you mentioned. I'm assuming those do work using the old setup? It would be nice to get these merged and remove all of the outdated things

@axel-h
Copy link
Member

axel-h commented Jan 27, 2024

Can you rebase this, so it's possible to build it again? I'm getting some strange errors now due to other changes. The rebase seems trivial, the conflict with init_dataport_ram.c can be resolved by simply dropping all your changes, as it takes the parameters from the context now. Then please remove the "Test with" in the first comment of this PR also, as this also also been merged.

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

Successfully merging this pull request may close these issues.

6 participants