-
Notifications
You must be signed in to change notification settings - Fork 47
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
[Draft] cc rebase #1310
base: main
Are you sure you want to change the base?
[Draft] cc rebase #1310
Commits on Jun 11, 2024
-
cc: start of CC(Confidential Computing) support
This series of changes aim to create a common base for running different CC architectures, and the updates will involve: 1)private and shared memory isolation. 2)hypercalls update for using shared memory. 3)vm initialization flow update. 4)use one more vcpu to handle io and scheduling inside kernel.
Configuration menu - View commit details
-
Copy full SHA for 17037a2 - Browse repository at this point
Copy the full SHA 17037a2View commit details -
Now cc_all and cc_debug can compile with cc feature.
Configuration menu - View commit details
-
Copy full SHA for d26ec53 - Browse repository at this point
Copy the full SHA d26ec53View commit details -
Configuration menu - View commit details
-
Copy full SHA for 68ecdcd - Browse repository at this point
Copy the full SHA 68ecdcdView commit details -
cc: memory isolation implementation
In normal vm, there is the common heap and an additional IO heap if enabled EnableIOBuf config. In cc, there are 4 heaps: 1)shared heap: qkernel stores in it the shared data(IObuffer, sharedspace etc.), then qvisor uses it after vm is launched. 2)IO heap: considered as shared heap here, used if enabled EnableIOBuf config. 3)guest private heap: qvisor stores necessary data during initialization (initial pagetable, gdt, kernel etc.) then qkernel uses it as the default heap. 4)host init heap: an additional heap is used by the qvisor for storing data before launching vm. It will not be used after vm launched.
Configuration menu - View commit details
-
Copy full SHA for 5cfb079 - Browse repository at this point
Copy the full SHA 5cfb079View commit details -
cc: update initialization flow for qvisor and qkernel
Now qvisor will switch to different vm creation flow based on the CCMode config. If any cc mode is enabled, sharedspace will be initialized after vm is launched. Additionally, map the host initial heap to kvm if cc is compiled but not enabled.
Configuration menu - View commit details
-
Copy full SHA for e4a73cf - Browse repository at this point
Copy the full SHA e4a73cfView commit details -
Instead of setting registers to pass parameters, in cc mode, a sharapara page is used. This method only works when feature cc is compiled and CCMode config is not None.
Configuration menu - View commit details
-
Copy full SHA for 76c9149 - Browse repository at this point
Copy the full SHA 76c9149View commit details -
cc: copy executable into private memory
Add a data structure p2pmap in the mappable which stores the mapping of private and shared memory, writeback if map shared and not readonly when unmapping the data. Besides, need to sync updates when fsync and writing with fd.
Configuration menu - View commit details
-
Copy full SHA for 01c6e28 - Browse repository at this point
Copy the full SHA 01c6e28View commit details -
Instead of using cstring for passing parameters in call, in cc, sharestring is used to allocate string in shared memory directly.
Configuration menu - View commit details
-
Copy full SHA for 99d0c45 - Browse repository at this point
Copy the full SHA 99d0c45View commit details -
Configuration menu - View commit details
-
Copy full SHA for 48bc685 - Browse repository at this point
Copy the full SHA 48bc685View commit details -
Configuration menu - View commit details
-
Copy full SHA for be755a1 - Browse repository at this point
Copy the full SHA be755a1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9d9fa18 - Browse repository at this point
Copy the full SHA 9d9fa18View commit details -
Configuration menu - View commit details
-
Copy full SHA for ea82841 - Browse repository at this point
Copy the full SHA ea82841View commit details -
Configuration menu - View commit details
-
Copy full SHA for 931db1b - Browse repository at this point
Copy the full SHA 931db1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2917893 - Browse repository at this point
Copy the full SHA 2917893View commit details -
Configuration menu - View commit details
-
Copy full SHA for fa06cae - Browse repository at this point
Copy the full SHA fa06caeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f2adb9 - Browse repository at this point
Copy the full SHA 0f2adb9View commit details -
Add a struct taskWrapper, has minimal host required data(ready, queueid and taskAddr), which should be allocated in the shared memory and read by the host.
Configuration menu - View commit details
-
Copy full SHA for 375f662 - Browse repository at this point
Copy the full SHA 375f662View commit details -
Configuration menu - View commit details
-
Copy full SHA for e22bf6c - Browse repository at this point
Copy the full SHA e22bf6cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b2abf5 - Browse repository at this point
Copy the full SHA 7b2abf5View commit details -
cc: move timer related struct into shared memory
1)Store Timer in shared heap, since the value of the btree in timestore is a reference 2)Make timekeepr shared, the timekeeper is initialized and stored in the sharespace, and cloned when the guest creates a TimeKeeperClock. The internal timekeeper is used by host. ProcessOnce() ->TIMER_STORE.Trigger() -> get the timer by GetFirst() then timer.Fire() ->Timeout() -> Now() 3)In the same Timeout function, the listener of the Timer is triggered to update the vdso, the update by host is banned now. 4)Store FdWaitInfo in shared heap, it may be set by the kernel and check by host in ProcessOnce() -> FD_NOTIFIER.HostEpollWait() -> FdNotify()
Configuration menu - View commit details
-
Copy full SHA for acd9508 - Browse repository at this point
Copy the full SHA acd9508View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4800736 - Browse repository at this point
Copy the full SHA 4800736View commit details -
Configuration menu - View commit details
-
Copy full SHA for f810288 - Browse repository at this point
Copy the full SHA f810288View commit details -
Now CCMode::NormalEmu can be set in the config to enable unidentical mapping. Private memory is mapped 30gb higher on the host.
Configuration menu - View commit details
-
Copy full SHA for e123fc2 - Browse repository at this point
Copy the full SHA e123fc2View commit details -
Configuration menu - View commit details
-
Copy full SHA for e763c76 - Browse repository at this point
Copy the full SHA e763c76View commit details