1. 25 Oct, 2016 18 commits
    • Charlie Jacobsen's avatar
      Simple printk, adapted from Linux's vsprintf. · 41e1d4fd
      Charlie Jacobsen authored
      Updated liblcd and the microkernel. Doesn't support
      all escapes, like %p.
      
      Updated documentation. Stack protection should be turned off.
      41e1d4fd
    • Charlie Jacobsen's avatar
      Two simple IPC tests are passing. Still getting mysterious hang. · c667fea5
      Charlie Jacobsen authored
      Working on moving Linux's mm into lcd's.
      
      I gave up trying to debug the hang. Confirmed the pages for the lcd's
      vm are the ones I expect. Turned on red zones. All tests are passing.
      Hang happens after insmod/rmmod of the lcd module about 10 - 20 times, it
      varies. Sometimes one core just silently dies / doesn't even respond to
      an NMI. Sometimes the ethernet driver complains (this could be an
      unrelated bug that was fixed upstream).
      
      Few things in this commit:
      
        1
      =====
      
      Updated documentation in Documentation/lcd-domains/.
      
        2
      =====
      
      Baby version of lib kernel, inside arch/x86/lcd-domains/liblcd.c.
      Unfortunately due to the recursive make, this needs to be textually
      included inside the modules destined for lcd's, for now.
      
        3
      =====
      
      Added new test modules and modified directory structure and
      build system. See documentation in Documentation/lcd-domains.
      
        4
      =====
      
      A few tweaks to the nmi handler to print a backtrace. May remove that in
      the future, as it's probably not safe to do inside an nmi handler (but if
      we're in that error state, we might be desperate to know what's happening ...).
      
        5
      =====
      
      Changed interrupt handling in arch-dependent code. The KVM code we were using
      is probably wrong for 64-bit - it doesn't properly switch stacks, etc., which
      is super important for 64-bit and may be impossible to emulate in
      software. I think this could be stale code inside KVM, but not sure. Dune
      doesn't use it. KVM doesn't ack external interrutps on vm exit, so I think
      this interrupt emulation code is always skipped (at least for non-nested
      VMs).
      
      Instead, we're not ack'ing interrupts on exit, and letting the native code
      do the right thing, like Dune.
      
      I was thinking this might be the source of the bad hang (stack
      overflow, e.g.), but not true.
      
      Conflicts:
      	include/linux/sched.h
      	kernel/watchdog.c
      	virt/lcd-domains/lcd-cspace-tests2.c
      Resolved-by: Vikram Narayanan's avatarVikram Narayanan <vikram186@gmail.com>
      c667fea5
    • 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
         entry
      -- 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)
      c4fc774c
    • Charles Jacobsen's avatar
    • Charlie Jacobsen's avatar
      Simple renaming lcd => lcd-domains. · f34be85a
      Charlie Jacobsen authored
      Updated Kbuild, Kconfig, Makefiles.
      f34be85a
    • Charlie Jacobsen's avatar
      c2d928c2
    • 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
      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
    • 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
    • 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
      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
    • Weibin Sun's avatar
      external interrupts · 421ee805
      Weibin Sun authored
      421ee805
    • Weibin Sun's avatar
      Makefile · 5587ecd4
      Weibin Sun authored
      5587ecd4
    • Weibin Sun's avatar
      assmebling code in progress · 2b327008
      Weibin Sun authored
      2b327008
    • Weibin Sun's avatar
      LCD placeholder, build and config stuff · e7e51a6f
      Weibin Sun authored
      e7e51a6f