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

[Draft] cc rebase #1310

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open

[Draft] cc rebase #1310

wants to merge 24 commits into from

Commits on Jun 11, 2024

  1. 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.
    123abcpp committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    17037a2 View commit details
    Browse the repository at this point in the history
  2. cc: update makefile for cc

    Now cc_all and cc_debug can compile with cc feature.
    123abcpp committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    d26ec53 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    68ecdcd View commit details
    Browse the repository at this point in the history
  4. 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.
    123abcpp committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    5cfb079 View commit details
    Browse the repository at this point in the history
  5. 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.
    123abcpp committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    e4a73cf View commit details
    Browse the repository at this point in the history
  6. cc: hcall update

    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.
    123abcpp committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    76c9149 View commit details
    Browse the repository at this point in the history
  7. 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.
    123abcpp committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    01c6e28 View commit details
    Browse the repository at this point in the history
  8. cc: Add sharestring struct

    Instead of using cstring for passing parameters in call, in cc,
    sharestring is used to allocate string in shared memory directly.
    123abcpp committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    99d0c45 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    48bc685 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    be755a1 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9d9fa18 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    ea82841 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    931db1b View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    2917893 View commit details
    Browse the repository at this point in the history
  15. cc: refactor aucall

    123abcpp committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    fa06cae View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    0f2adb9 View commit details
    Browse the repository at this point in the history
  17. cc: task refactor

    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.
    123abcpp committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    375f662 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    e22bf6c View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    7b2abf5 View commit details
    Browse the repository at this point in the history
  20. 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()
    123abcpp committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    acd9508 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    4800736 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    f810288 View commit details
    Browse the repository at this point in the history
  23. cc: add unidentical mapping

    Now CCMode::NormalEmu can be set in the config to enable unidentical
    mapping. Private memory is mapped 30gb higher on the host.
    123abcpp committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    e123fc2 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    e763c76 View commit details
    Browse the repository at this point in the history