1. 25 Oct, 2016 40 commits
    • Charlie Jacobsen's avatar
    • Charlie Jacobsen's avatar
    • Sarah Spall's avatar
      moved definitions of ast constructors into h file, so cpp file is empty for... · 6505b646
      Sarah Spall authored
      moved definitions of ast constructors into h file, so cpp file is empty for now. switching to a true visitor pattern for code generator. visitor.h declares visitor interface, header_generator, declares header generator visitor, and header_generator.cpp, is not yet filled out
    • Charlie Jacobsen's avatar
      Patched modprobe (and rest of init tools suite) now in repo. · 7cac6387
      Charlie Jacobsen authored
      Found under tools/module-init-tools. These are not (for now)
      automatically built and installed when the kernel is built.
      To build and install, enter the module-init-tools directory,
      and do the following:
         [ 1 ] aclocal -I m4 && automake --add-missing --copy && autoconf
         [ 2 ] ./configure --prefix=/ --program-prefx=lcd-
         [ 3 ] make
         [ 4 ] (sudo) make install
      This will install the patched /sbin/lcd-modprobe and /sbin/lcd-insmod,
      as well as the other init tools that were left untouched. The
      user mode helper will use lcd-modprobe to load the module.
      The man pages won't install on emulab (since /share is read only).
      You can specify a different man dir via configure if you wish.
      After installation, you should then be able to successfully run a
      kernel module inside of an lcd, via lcd_create_as_module.
      The only changes to init tools are in modprobe.c and insmod.c; only
      the changes in modprobe.c are of interest (lcd-insmod is not currently
      used/needed). Instead of doing the Linux init_module system call,
      lcd-modprobe does an ioctl call to the LCD driver (hence, the LCD driver
      must be loaded), with the bytes of the module, its size, and command
      line options.
    • Charlie Jacobsen's avatar
      Basic lcd module create, run, and destroy. · e0193fa4
      Charlie Jacobsen authored
      This code is ugly, but it's working.
      Tested with basic module, and appears to be working
      properly. I will soon incorporate the patched
      modprobe into the kernel tree, and then this code
      will be usable by everyone.
      The ipc code is still unimplemented. The only
      hypercall handled is yield. Also note that other
      exit conditions (e.g. external interrupt) have not
      been fully tested.
      -- kernel code calls lcd_create_as_module with
         the module's name
      -- lcd_create_as_module loads the module using
         request_lcd_module (request_lcd_module calls
         the patched modprobe to load the module, and
         the patched modprobe calls back into the lcd
         driver via the ioctrl interface to load the
      -- lcd_create_as_module then finds the loaded
         module, spawns a kernel thread and passes off
         the module to it
      -- the kernel thread initializes the lcd and
         maps the module inside it, then suspends itself
      -- lcd_run_as_module wakes up the kernel thread
         and tells it to run
      -- lcd_delete_as_module stops the kernel thread
         and deletes the module from the host kernel
      File-by-file details:
      -- lcd was not running in 64-bit mode, and my
         checks had one subtle bug
      -- fixed %cr3 load to properly load vmcs first
      -- fixed set program counter to use guest virtual
         rather than guest physical address
      -- added struct lcd to task_struct
      -- lcd pointer set to null when task_struct is
      -- made init_module and delete_module system calls
         callable from kernel code
      -- available in module.h via do_sys_init_module and
      -- simply moved the majority of the guts of the
         system calls into a non-system call, exported
      -- take an extra flag, for_lcd; when set, the init
         code skips over running (and deallocating) the
         module's init code, and the delete code skips
         over running the module exit
      -- system calls from user code set for_lcd = 0; this
         ensures existing code still works
      -- changed __request_module to __do_request_module; takes
         one extra argument, for_lcd
      -- __request_module   ==>  __do_request_module with for_lcd = 0
      -- request_lcd_module ==>  __do_request_module with for_lcd = 1
      -- call_modprobe conditionally uses lcd_modprobe_path, the path
         to a patched modprobe accessible via sysfs
      -- added lcd status enum; see source code doc
      -- three routines for creating/running/destroying
         lcd's that use modules; see source code doc
      -- added interface defns for patched modprobe to call into
         lcd driver for module init; lcd driver loads
         module (via slightly refactored module.c code) on behalf
         of modprobe
      -- implementation of routines for modules inside lcd's
      -- implementation of module init / delete for lcd's
         (uses patched module.c code)
      -- added test module for lcd module code
      -- test runs automatically when lcd module is inserted
    • Sarah Spall's avatar
      just added syntax support for typedef · e2ddc9fa
      Sarah Spall authored
    • Sarah Spall's avatar
      changed to support new 'verbatim' section rather than c include, and changed... · e775c983
      Sarah Spall authored
      changed to support new 'verbatim' section rather than c include, and changed makefile in an attempt to figure out why modified h file wasn't being used, now delete .gch file
    • Anton Burtsev's avatar
      Create LCD code inside LCD API layer · ea133a9d
      Anton Burtsev authored
       -- Still need an actual function to load the module into LCD
    • Anton Burtsev's avatar
    • Anton Burtsev's avatar
    • Sarah Spall's avatar
      modified ast structures, and changed to match google c++ style conventions, by... · 3b7f2791
      Sarah Spall authored
      modified ast structures, and changed to match google c++ style conventions, by necessity changed peg file as well
    • Anton Burtsev's avatar
      Getting close to local cspaces · 08bb2d4f
      Anton Burtsev authored
    • Anton Burtsev's avatar
      More client-server code · feba5441
      Anton Burtsev authored
    • Sarah Spall's avatar
      added supported types to peg file · 3d1d609c
      Sarah Spall authored
    • Anton Burtsev's avatar
    • Anton Burtsev's avatar
      IDL-like generated code (checkpoint) · 13a4545c
      Anton Burtsev authored
    • Sarah Spall's avatar
      modified make clean · 8558cfde
      Sarah Spall authored
    • Sarah Spall's avatar
      adding tests to repo · 0343f967
      Sarah Spall authored
    • Sarah Spall's avatar
    • Anton Burtsev's avatar
    • Charles Jacobsen's avatar
      Simple blob successfully runs and returns in vmx. · c4fc774c
      Charles Jacobsen authored
      In the process of debugging, major corrections and
      debug checks implemented (this is a big squash):
      -- coded up entry checks documented in Intel SDM
         V3 chp 26 (this should help later if settings
         are changed, make it less risky to experiment
         and give more confidence)
      -- fixed host tr base addr bug (the worst bug! caused
         system to hang and then crash, since the tss
         was erroneous...)
      -- fixed vmx_entry to properly set host rsp before
      -- setting host sysenter and idt info
      -- fixed cs ar bytes bug
      -- fixed gdt limit bug
      -- fixed tr type bug
      -- extra settings added to cr0 and cr4, but may
         not be needed ... (debug fix attempt)
      -- lstar mstar autoload, may not be needed ...
         (debug fix attempt)
    • Sarah Spall's avatar
      changed README and removed auto gen file · 37b45a8f
      Sarah Spall authored
    • Sarah Spall's avatar
      commiting grammar file with bug fixes, although trying to match anything but... · 135eb8b1
      Sarah Spall authored
      commiting grammar file with bug fixes, although trying to match anything but whitespace causes infinte loop, added destructors to lcd_ast.h, and commented out line that called getReason on exception, causing segfault
    • Anton Burtsev's avatar
      First API call: create sync endpoint · 75c72eaa
      Anton Burtsev authored
    • Anton Burtsev's avatar
      LCD API client and server code · fc2675ff
      Anton Burtsev authored
        -- LCD export an API to its domains that is accessible via
        capability invocations (well, syscalls if you like)
        -- Kernel runs a thread that implement this API, e.g. serves
        capability invocations
    • Anton Burtsev's avatar
      Call/reply but there some issues · cde8b5ed
      Anton Burtsev authored
    • Anton Burtsev's avatar
      Simple, list-based capability allocator · 75340d2a
      Anton Burtsev authored
        -- I've split capability allocation and cspaces, this makes much more
           sense -- complex domains can implement custom allocation policies,
           simple domains go with a static set of caps
        -- This is a list-based (zone like) allocator
    • Anton Burtsev's avatar
      Working on the LCD API library · c7c672e4
      Anton Burtsev authored
      -- There will be a thread in the kernel serving API calls from LCD
      domains, like lcd_create_sync_endpoint()...
    • Anton Burtsev's avatar
    • Anton Burtsev's avatar
      Remove Jithu's ping-pong code · a43d719a
      Anton Burtsev authored
    • Anton Burtsev's avatar
      Both ping and pong · e9285940
      Anton Burtsev authored
    • Anton Burtsev's avatar
      Basic ping pong · 65fc6485
      Anton Burtsev authored
    • Anton Burtsev's avatar
    • Anton Burtsev's avatar
      Kicked out Muktesh's code, wrote my own stub · 6085bcd5
      Anton Burtsev authored
      -- Mine is primitive but works, Muktesh will have to come
         back and rewrite
      -- Cspace is an array, only insert and lookup are supported
    • Anton Burtsev's avatar
    • Sarah Spall's avatar
      committing new main file · b7ddc26c
      Sarah Spall authored
    • Sarah Spall's avatar
    • Sarah Spall's avatar
      committing to remove old files · 4f2b47d0
      Sarah Spall authored
    • Charles Jacobsen's avatar
      Fixed build errors, all tests passing. · 78569fe2
      Charles Jacobsen authored
      Fixed (another) nasty casting bug in the
      code that initializes the ept pointer. I
      was using the old way of casting, and overlooking
      that I was storing a host virtual pointer
      inside a host physical pointer. This caused
      invept to fail (invept checks if the eptp is
      I also fixed invept and invvpid to print an
      error message (like vmload and vmclear), rather
      than generate an invalid opcode exception. It's
      easier to debug and understand the problem.
      In the future, we could more carefully parse the
      error returned.
    • Anton Burtsev's avatar
      Fix undefined symbol · d1f239ac
      Anton Burtsev authored