1. 25 Oct, 2016 40 commits
    • Sarah Spall's avatar
      removing probably generated file · 58282b09
      Sarah Spall authored
      58282b09
    • Sarah Spall's avatar
      Adding vembyr, needed to generator parser, as well as a starting grammar based... · ecc3b58a
      Sarah Spall authored
      Adding vembyr, needed to generator parser, as well as a starting grammar based on Barrelfish's flounder, and other supporting files. Waited until code compiled to commit
      ecc3b58a
    • Charlie Jacobsen's avatar
      Added header doc to lcd-vmx.h and lcd_vmx_destroy. · 4cdb5e83
      Charlie Jacobsen authored
      lcd_destroy => lcd_vmx_destroy. Pretty much a straight
      copy over, but removed some unneeded code.
      4cdb5e83
    • Charles Jacobsen's avatar
      Fixed vmcs configuration bugs (small macro bugs in vmx.h). · aad218b5
      Charles Jacobsen authored
      Debug controls macros for vm exit and vm entry were
      wrong (I wonder if the kvm guys know, it's in the stable
      linux build).
      
      I had to enable exiting on load / save to %cr3 for it
      to run on emulab machines.
      
      Tweaked vmx control debugging code, cleaned up
      logic in adjust_vmx_controls, much simpler.
      aad218b5
    • Charles Jacobsen's avatar
      Added vmx configuration debugging. · 8c3624a5
      Charles Jacobsen authored
      -- vmx_print_controls
      -- updated setup_vmcs_config to use it
      8c3624a5
    • Charles Jacobsen's avatar
      Fixed bugs in lcd_vmx_create and dependencies. Clean build. · 4d27a893
      Charles Jacobsen authored
      Conditional compilation on number of autoload msr's.
      
      Untested.
      4d27a893
    • Charlie Jacobsen's avatar
      Added vmcs read / write routines. · 0de48e3b
      Charlie Jacobsen authored
      Straight copy over from old code.
      0de48e3b
    • Charlie Jacobsen's avatar
    • Charlie Jacobsen's avatar
      Finished lcd_vmx_create and its dependencies (untested). · 7607ec9a
      Charlie Jacobsen authored
      vmx_setup_vmcs ==> vmx_setup_vmcs_guest_settings and
      vmx_setup_vmcs_host.
      
      vmx_setup_vmcs_guest_settings
      -- execution control (e.g., interrupt handling)
      -- ept pointer
      -- %cr0 and %cr4 access control
      
      vmx_setup_vmcs_guest_regs
      -- initial %cr0, %cr4
      -- segmentation--bases, limits, selectors
      -- guest EFER (long mode enabled, no syscall/sysret)
      -- initial activity and interrupt state
      
      vmx_setup_vmcs_host
      -- control and segmentation regs
      -- host EFER
      -- no saving of syscall/sysret msrs since these are
         disabled in guest
      -- no page attribute table
      7607ec9a
    • Charlie Jacobsen's avatar
      About half way done with vmcs initialization code. · acbb9533
      Charlie Jacobsen authored
      lcd_create --> lcd_vmx_create, with a lot of code
      re-factored or removed for now, to keep it simple
      (no gdt, idt, isr, paging bitmap, address space
      init, etc.).
      -- basic ept initialization
      -- vmcs loading on a cpu
         -- re-factored __vmx_setup_cpu to use built-in
            segment descriptor access functions in desc.h
         -- removed host sys_enter storage, since this
            msr is disabled right now anyway
         -- more doc to understand vmcs load process
      acbb9533
    • Charles Jacobsen's avatar
      Finished tweaking build setup (will test modprobe next). · cfee63b6
      Charles Jacobsen authored
      Some simple renaming
      -- LCD => LCD_DOMAINS
      -- core.c => lcd-domains.c
      -- new LCD_VMX_INTEL configuration
      
      Adjusted virt/lcd/Kconfig to reflect LCD_DOMAINS dependency
      on LCD_VMX_INTEL.
      cfee63b6
    • Charles Jacobsen's avatar
      Successful build with lcd_vmx_init and lcd_vmx_exit. · 62e4ac37
      Charles Jacobsen authored
      Added straight copy from old code of lcd_vmx_exit.
      
      Shifted lcd_vmx_init and lcd_vmx_exit to
      arch/x86/include/asm/lcd-vmx.h. Ideally, if we want
      this to be arch-independent, probably want to change
      header to asm/lcd.h, and routines to lcd_arch_init
      and lcd_arch_exit, or something similar.
      62e4ac37
    • Charles Jacobsen's avatar
      Fixed build system for lcd, and most compiler errors. · 7c05c7a0
      Charles Jacobsen authored
      Two components to the lcd build now:
      -- arch/x86/lcd/Makefile: for building x86 lcd code
      -- virt/lcd/Makefile: for building arch-indep lcd code
      
      Modified the build system just slightly for a cleaner
      build:
      -- virt/ directory treated like ipc/, usr/, etc. directories
      -- added Kconfig and Makefile to virt/, mirroring drivers/
      -- updated top-level Makefile to include virt/ as vmlinux
         directory / dependency, so build system will recur into
         virt/
      -- updated arch/x86/Kconfig to include virt/Kconfig, so it
         will be included as a menu item
      -- updated arch/x86/Kbuild to include arch/x86/lcd/
      
      Removed old capabilities code in cap/.
      
      Removed lcd syscall.
      
      Temporarily turned off build for drivers/lcd.
      
      Fixed most bugs in lcd-vmx (still need to do lcd_vmx_exit).
      -- minor naming issues in lcd-vmx.h
      -- straight copy over of vmx_disable_intercepts_for_msr,
         but with more doc
      -- removed VMX_EPT_INDIVIDUAL_ADDR macro from vmx.h (where
         did this come from? it's not documented in the intel manual,
         nor is it used in kvm)
      7c05c7a0
    • Charlie Jacobsen's avatar
      Tweaking the build set up. · 70f48063
      Charlie Jacobsen authored
      The main makefile will now go in virt/lcd. The
      lcd-vmx.h header will be in the standard include
      path, and I can reference the x86-dependent code
      from there, so it should all just work (build not
      tested yet, will do so soon).
      
      Small change to lcd-vmx.c: Made sure I freed
      msr bitmap page on failure.
      70f48063
    • Charlie Jacobsen's avatar
      Finished lcd_vmx_init and its dependencies. · 18122896
      Charlie Jacobsen authored
      Added a few missing macros to arch/x86/include/vmx.h,
      and RESERVED masks for easily determining which bits
      in a vmx control are reserved (needed in adjust_vmx_controls).
      
      Re-factored setup_vmcs_config and adjust_vmx_controls.
      setup_vmcs_config does pretty much the same thing, but it
      fails immediately if a control isn't available --
      adjust_vmx_controls confirms that the exact desired
      controls are available, and sets the reserved bits to
      1 or 0 as needed. Cleaner comments and organization.
      Re-factored the vmx basic settings to
      vmcs_config_basic_settings.
      
      Removed some of the vmx feature check code that was in
      the original lcd_vmx_init, as setup_vmcs_config now does
      that.
      
      Essentially a straight copy over of:
      
      -- __vmx_enable
      -- vmx_enable
      -- vmx_disable
      -- vmx_free_vmxon_areas
      -- __vmxon
      -- __vmxoff
      
      The only difference is I shifted tbl and cache
      invalidation to vmx_enable (originally in __vmx_enable)
      and added some comments.
      
      Straight copy over of
      -- vmx_alloc_vmcs
      -- vmx_free_vmcs
      -- invvpid, invept code, with slight renaming
      18122896
    • Charlie Jacobsen's avatar
      Starting a fresh lcd-vmx arch-dependent interface. · 8a6ad472
      Charlie Jacobsen authored
      Arch-dependent code will go in arch/x86/lcd, and the
      header(s) will reside in arch/x86/include/asm.
      
      For now, I have only moved some of the arch-dependent
      junk that was in include/lcd/lcd.h into
      arch/x86/include/asm/lcd-vmx.h.
      8a6ad472
    • Charlie Jacobsen's avatar
      Completed re-factoring of address space code (untested). · 922c8135
      Charlie Jacobsen authored
      Completed lcd_setup_addr_space (replaced
      vmx_create_initial_page_table). lcd_setup_addr_space
      allocates and maps the guest physical and virtual
      memory needed for the lcd when it first enters.
      
      The code should be easily extendable for a different
      address space layout. Guest virtual and ept mapping
      code is now fairly symmetric and easier to understand.
      
      Comment headers for ept and gva functions.
      
      Next up: seeing if I can build, and get it to run.
      Then I'll merge with the main branch (lcd).
      922c8135
    • Charlie Jacobsen's avatar
      Re-factored guest virtual address space setup code. · 2170318e
      Charlie Jacobsen authored
      A lot of changes here (:gulp:).
      
      ept_map_gpa_to_hva
      -- renamed to: lcd_ept_gpa_to_hva
      -- cleaned it up
      
      Bitmap no longer in lcd; declared as local var
      inside lcd_setup_guest_virtual.
      
      alloc_pt_item
      -- renamed / refactored to: lcd_gv_alloc_paging_mem_page
      -- new code allocs host physical page for paging mem,
         and allocates chunk of guest physical address space
         (by setting bit in bitmap, as before)
      
      map_gva_to_gpa
      -- renamed / refactored to: lcd_gv_walk
      -- break apart each level in guest virtual page
         walk into separate functions, to make it more
         readable
      -- serves purpose similar to lcd_ept_walk, but
         returns a pte in the guest virtual page table
      
      lcd_setup_guest_virtual
      -- takes care of guest virtual mapping that
         the old vmx_setup_initial_page_table did
      
      Code not tested or built yet.
      2170318e
    • Charlie Jacobsen's avatar
      Updated memory layout and re-factored addr space init. · 5270acc4
      Charlie Jacobsen authored
      New memory layout in lcd_defs.h, with macros.
      -- no idt, tss, or interrupt service routines
      
      Started re-factoring lcd address space initialization.
      vmx_setup_initial_page_table will soon be replaced by
      lcd_setup_addr_space.
      -- lcd_setup_initial_ept for alloc'ing and mapping
         host physical memory
      -- re-factored some of the ept code to make the interface
         cleaner
      -- need to think about locking the ept, where it should
         be done
      -- soon will have lcd_setup_initial_virt, or something
         similar, for initializing guest virtual page tables.
      
      Copied map_gva_to_gpa routine to new tools/lcd/liblcd/vm.c.
      This is where liblcd will go. liblcd will contain utilities
      an lcd can call.
      5270acc4
    • Anton Burtsev's avatar
      Export putname (fix module build) · b404082a
      Anton Burtsev authored
      
      
      Conflicts:
      	fs/namei.c
      Resolved-by: Vikram Narayanan's avatarVikram Narayanan <vikram186@gmail.com>
      b404082a
    • Anton Burtsev's avatar
      Clean up user-level includes, build inskern4lcd tool · 2d55c00d
      Anton Burtsev authored
      It took me a while to figure out a suggested layout for Linux
      user-visible headers. I ended up with this:
      
        ./include/lcd/lcd.h -- includes #include <uapi/linux/lcd.h>
        ./include/uapi/linux/lcd.h -- this file will be installed to
            /usr/linux/lcd.h
      
      Note on installing user-visible header files
      
       1) Add header-y += lcd.h line to include/uapi/linux/Kbuild
      
       2) Install sanitized header files into ./usr/include
      
          sudo make install_headers
      
       3) Copy ./usr/include to /usr/include
      
          sudo find usr/include \( -name .install -o -name ..install.cmd \) -delete
          sudo cp -rv usr/include/* /usr/include
      2d55c00d
    • Anton Burtsev's avatar
      ioctl interface to LCD · 552bd976
      Anton Burtsev authored
      552bd976
    • Anton Burtsev's avatar
      c5748e0c
    • Anton Burtsev's avatar
      Remove obsolete Makefile from ./virt/lcd · 4f665123
      Anton Burtsev authored
        -- The makefile is now in ./arch/x86/lcd
      4f665123
    • Anton Burtsev's avatar
      Wasn't able to link a module due to a name collision · 6c0118e0
      Anton Burtsev authored
        - Renamed target lcd.ko to lcd-domains.ko
      6c0118e0
    • Anton Burtsev's avatar
      d242a850
    • Anton Burtsev's avatar
      ea3949b7
    • Charlie Jacobsen's avatar
      FIXED INDENTATION TO USE TABS INSTEAD OF SPACES. · 4b722aaf
      Charlie Jacobsen authored
      Per Linux coding style spec. Updated files in
      arch/x86/lcd, drivers/lcd, include/lcd.
      4b722aaf
    • Anton Burtsev's avatar
      Working on ioctl interface for LCD · 3cbf87c0
      Anton Burtsev authored
        -- A skeleton for the IOCTL interface
        -- Public include file <linux/lcd-domains.h>
        -- Moved module load/unload from arch/x86/lcd into drivers/lcd
        -- Build crashes for modules (built-in works)
      3cbf87c0
    • Anton Burtsev's avatar
      Stop tracking .config and insmod4lcd · 7b8e46a5
      Anton Burtsev authored
      7b8e46a5
    • Anton Burtsev's avatar
      Stop tracking .config · 35db8c8d
      Anton Burtsev authored
      35db8c8d
    • Anton Burtsev's avatar
      Trying to make printk work from PV kernel · f17d9268
      Anton Burtsev authored
      f17d9268
    • Anton Burtsev's avatar
    • Anton Burtsev's avatar
      Move ./drivers/lcd/tools into ./tools/lcd/ · c6302b75
      Anton Burtsev authored
      c6302b75
    • Anton Burtsev's avatar
      0d9c6b0a
    • Anton Burtsev's avatar
      Move things around · 0ec257ef
      Anton Burtsev authored
      Not ideal. Some problems:
      
        - The arch dependent and independent parts are not completely
          separated.
      
        - The module builds in arch/x86/lcd and this is a bit strange
      
        - I can't build with LCD buildin, but build works if I build it
          as a module
      
        - There is still a bunch of old warrnings from Weibin's code
      0ec257ef
    • Anton Burtsev's avatar
      Early attempt to add LCD_GUEST arch · bea9baec
      Anton Burtsev authored
      bea9baec
    • Charles Jacobsen's avatar
      MOVED ARCH-INDEPENDENT CODE TO VIRT/LCD. · 07f42b10
      Charles Jacobsen authored
      Capability code in xcap/ moved to virt/lcd.
      
      Arch-independent code in arch/x86/lcd moved
      to virt/lcd (including tools and guest directories).
      07f42b10
    • Jithu Joseph's avatar
      Sample guest code for snd/rcv · 9c17f0ca
      Jithu Joseph authored
      9c17f0ca
    • Muktesh Khole's avatar
      Adding Documentation for capability module · ad6d773f
      Muktesh Khole authored
      ad6d773f