Hi -

This patchset adds a 2LS for VMMs and uses it to replace a large chunk
of vmrunkernel.  Guest physical cores are mapped to uthreads.

Now, a VMM is just like any other app, and it happens to have its own
custom scheduler.  It's scheduler and support utilities are all in
user/vmm.

One cool feature of this is that the VMM can act like any other
multithreaded program: it can run on as many cores as you'd like,
including as an SCP on core 0.  Right now, it's hardcoded to be an MCP
that yields unused cores.  We can change that later.

Other notable changes:
- vcore_request() (the "ghetto incremental interface") is now
  vcore_request_more(), and there is an absolute vcore_request_total()
- There is a per-vcore timer tick, in virtual time, that a 2LS can use
  in it's sched_entry().
- Fixed two brutal bugs
- Lots of other parlib helper changes.

The VMM 2LS is actually a little primitive, but anything else we do
with it will at least use this framework.  I'll have more changes
later, but figured I'd get these patches out there.

Barret


The following changes since commit
5fa9f64d90ae46c25fedd00626048cb5729ad297:

  Don't look at the block after calling qbypass (2016-04-28 15:48:48
  -0400)

are available in the git repository at:

  [email protected]:brho/akaros.git vmm

for you to fetch changes up to 141d9431ef3e22e2d95aa8d3090ad111c188866c:

  VMM: Use safe MSR accessors (2016-04-28 17:18:29 -0400)

----------------------------------------------------------------
View this online at:
https://github.com/brho/akaros/compare/5fa9f64d90ae...141d9431ef3e

----------------------------------------------------------------
Barret Rhoden (33):
      Mark parlib 2LS functions as noreturn
      Add a helper for yielding from 2LSs
      Add a helper for stopping current_uthread
      Fix bitmask last-byte accounting
      Demacro-ify the user BITMASK helpers
      Provide vcore timer ticks for 2LSs
      Rename vcore_request() -> vcore_request_more()
      Refactor vcore_request_more()
      Allow requesting a total number of vcores
      Replace uses of the "ghetto incremental interface"
      Remove the return value from vcore_request_more()
      Remove vcore32.h
      Move pop_user_ctx implementations to a .c file
      Check notif_pending early in pop_user_ctx()
      Add a notif_pending comment to proc_notify()
      Add a helper to get a context's SP
      Add a helper to sleep a uthread forever
      Make user/vmm depend on benchutil
      VMM: Add struct virtual_machine, use it in MMIO
      VMM: Fix gpa address lookup
      VMM: Remove the stack
      VMM: Push globals into struct virtual_machine
      Add a parlib debug_print helper
      Use a lock when printing trap info
      Add a parlib control variable for yielding
      Add a test for file-backed mmap page faults
      Add a helper for blocking a uthread from VC ctx
      Add a 2LS for VMMs
      Remove struct vmctl (XCC)
      x86: Fix write_msr() casting
      VMM: Fix MSR emulation (XCC)
      Rename safe_read_msr() -> read_msr_safe()
      VMM: Use safe MSR accessors

 Makefile                                      |   2 +-
 kern/arch/riscv/trap.h                        |  22 +
 kern/arch/x86/bitmask.h                       |   6 +-
 kern/arch/x86/msr.c                           |   4 +-
 kern/arch/x86/ros/vmx.h                       |   9 +-
 kern/arch/x86/trap64.h                        |  15 +
 kern/arch/x86/uaccess.h                       |   4 +-
 kern/arch/x86/vmm/vmm.c                       |  36 +-
 kern/arch/x86/x86.h                           |  10 +-
 kern/drivers/dev/cons.c                       |   1 -
 kern/include/ros/vmm.h                        |  26 --
 kern/include/trap.h                           |   1 +
 kern/src/monitor.c                            |   1 +
 kern/src/process.c                            |   9 +
 kern/src/trap.c                               |  17 +
 tests/Makefile                                |   2 +-
 tests/lock_test.c                             |   6 +-
 tests/mcp_halt.c                              |   2 +-
 tests/mhello.c                                |   8 +-
 tests/old/condvar_test.c                      |   2 +-
 tests/old/eth_audio.c                         |   2 +-
 tests/old/manycore_test.c                     |   2 +-
 tests/old/mproctests.c                        |  33 +-
 tests/old/msr_cycling_vcores.c                |   4 +-
 tests/old/msr_dumb_while.c                    |   2 +-
 tests/old/msr_get_cores.c                     |   6 +-
 tests/old/msr_get_singlecore.c                |  13 +-
 tests/old/syscall.c                           |   6 +-
 tests/pthread_barrier_test.c                  |   2 +-
 tests/pthread_test.c                          |   2 +-
 tests/vmm/vmrunkernel.c                       | 491
 ++-------------------- user/benchutil/include/benchutil/vcore_tick.h
 |  43 ++ user/benchutil/vcore_tick.c                   | 152 +++++++
 user/parlib/include/parlib/parlib.h           |   1 +
 user/parlib/include/parlib/riscv/vcore.h      |   1 +
 user/parlib/include/parlib/ros_debug.h        |   7 +
 user/parlib/include/parlib/uthread.h          |   9 +-
 user/parlib/include/parlib/vcore.h            |   6 +-
 user/parlib/include/parlib/x86/bitmask.h      | 129 +++---
 user/parlib/include/parlib/x86/vcore.h        | 138 ++++++-
 user/parlib/include/parlib/x86/vcore32.h      | 357 ----------------
 user/parlib/include/parlib/x86/vcore64.h      | 391 ------------------
 user/parlib/parlib.c                          |   1 +
 user/parlib/thread0_sched.c                   |  41 +-
 user/parlib/uthread.c                         |  59 ++-
 user/parlib/vcore.c                           | 200 +++++----
 user/parlib/x86/vcore.c                       | 280 +++++++++++++
 user/pthread/pthread.c                        |  18 +-
 user/utest/mmap_pf.c                          |  75 ++++
 user/utest/pvcalarm.c                         |   2 +-
 user/vmm/apic.c                               |   4 +-
 user/vmm/decode.c                             |  16 -
 user/vmm/include/vmm/sched.h                  |  67 ++-
 user/vmm/include/vmm/virtio_mmio.h            |   5 +-
 user/vmm/include/vmm/vmm.h                    |  40 ++
 user/vmm/sched.c                              | 565
 ++++++++++++++++++++++++++
 user/vmm/virtio-mmio.c                        |  23 +-
 user/vmm/vmexit.c                             | 158 +++++++ 58 files
 changed, 1971 insertions(+), 1563 deletions(-) create mode 100644
 user/benchutil/include/benchutil/vcore_tick.h create mode 100644
 user/benchutil/vcore_tick.c delete mode 100644
 user/parlib/include/parlib/x86/vcore32.h delete mode 100644
 user/parlib/include/parlib/x86/vcore64.h create mode 100644
 user/utest/mmap_pf.c create mode 100644 user/vmm/sched.c
 create mode 100644 user/vmm/vmexit.c

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to