- 25 Oct, 2016 40 commits
-
-
Sarah Spall authored
can now generate a header file from the simple interface and message idl format, fixed bugs with char * in grammar
-
Charlie Jacobsen authored
Set up new header files, under include/lcd-domains/ -- lcd-domains.h: main include, contains struct lcd -- ipc.h: struct lcd_ipc_regs, for message registers Updated virt/lcd/lcd-domains.c to use new headers. Updated arch-dep code to use new struct lcd_ipc_regs. struct lcd_arch contains a pointer to the allocated page for stack / ipc registers. struct lcd (arch-indep) contains a pointer to the same memory (so that the arch-indep code can access the ipc regs directly if it wishes). Message registers should be accessed through arch-dep macros (to be implemented next) for portability and speed (some of the message registers will be implemented using machine regs, so the message registers in struct lcd_ipc_regs are `shadows'). Message register design based on seL4. See seL4 manual, 4.1.
-
Charlie Jacobsen authored
-
Charlie Jacobsen authored
Stack / ipc registers buffer initialized and mapped in guest physical.
-
Charlie Jacobsen authored
lcd_arch_ept_map_gpa_to_hpa -- simple routine combining effects of ept walk and set -- part of arch-dep public interface Added mapping code to gdt init and tss init, and some documentation for those routines. Starting code for stack initialization (should be simple).
-
Charlie Jacobsen authored
vmx_pack_desc -- load base, limit, type, etc. into a segment descriptor vmx_init_gdt -- loads base, limit, etc. for code, data, and tss segment descriptors in gdt
-
Charlie Jacobsen authored
Address space layout includes tss, gdt, ipc registers, and small stack. See lcd-domains-arch.h. -- a tss may be required (not sure) while running in non-root, even though a stack switch does not occur -- a gdt may also be required (even though all info is written in the hidden part of the segment registers); again, not sure 4 KBs is reserved for an IDT if it is needed (not mapped or allocated). GDT layout given in lcd-domains-arch.h. (GDT build code to be implemented / copied over next.) LDT is not used (so no need to load access rights, etc.). It is marked as unusable. Fixed segment register limit fields. These must be 32 bits and are always byte granularity. The granularity field in the access rights bits is confusing (see Intel SDM V3 26.3.1.2).
-
Charlie Jacobsen authored
vmx_free_ept -- frees all memory associated with extended page tables (paging structures and mapped physical mem) vmx_free_ept_dir_level -- frees all memory associated with an epte at a level in the hierarchy -- uses shallow recursion to make the code more readable Simple updates to some of the EPT macros.
-
Charlie Jacobsen authored
lcd_arch_epte_t type for arch abstraction. lcd_arch_ept_walk -- simple lookup of ept entry -- optionally allocate ept data structures along the way lcd_arch_ept_set -- set the host physical address in the (final level) ept entry, along with default flags lcd_arch_ept_hpa -- returns host physical address stored in an ept entry Remaining old code will be put in arch-indep code.
-
Charlie Jacobsen authored
-
Charlie Jacobsen authored
This is necessary for e.g. the emulab machines (loads / stores to cr3 are not allowed in non-root, so must be handled by hypervisor). Code simply copies values between fields in lcd data structure.
-
Charlie Jacobsen authored
Removed the `auto' memory alloc and map from the original handler. The new handler is simple for now; it just reads the guest virtual and physical addresses involved in the fault. The arch-indepent code will be responsible for deciding what to do.
-
Charlie Jacobsen authored
vmx_handle_external_intr -- pretty much a straight copy over of the old code, but with comments -- one big difference: interrupts are assumed to be enabled when this routine is called (I can't see how kvm is allowing the handling of external interrupts because it disables them when it enters vmx non-root. See the kvm code in x86.c:vcpu_enter_guest.)
-
Charlie Jacobsen authored
lcd_arch_run: -- disables kernel preemption while lcd is running -- simple switch on vmx exit conditions vmx_handle_exception_nmi -- for nmi's and exceptions generated by lcd vmx_handle_hard_exception -- for `hardware exceptions': page faults, traps, machine checks
-
Sarah Spall authored
-
Sarah Spall authored
-
Charlie Jacobsen authored
-
Charlie Jacobsen authored
-- LCD_VMX_INTEL => LCD_INTEL -- Moved LCD_INTEL config to arch/x86/Kconfig
-
Charlie Jacobsen authored
-- Moved some vmx-specific data structures into implementation file. -- lcd_vmx_* => lcd_arch_* -- updated virt/lcd/lcd-domains.c
-
Charlie Jacobsen authored
-
Charlie Jacobsen authored
-
Charlie Jacobsen authored
-
Sarah Spall authored
-
Sarah Spall authored
-
Charlie Jacobsen authored
Pretty much straight copy over of lcd_run => vmx_enter. More comments. Removed re-load of user %ds and %es since we are running in 64-bit.
-
Sarah Spall authored
-
Sarah Spall authored
-
Sarah Spall authored
-
Sarah Spall authored
-
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
-
Charlie Jacobsen authored
lcd_destroy => lcd_vmx_destroy. Pretty much a straight copy over, but removed some unneeded code.
-
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.
-
Charles Jacobsen authored
-- vmx_print_controls -- updated setup_vmcs_config to use it
-
Charles Jacobsen authored
Conditional compilation on number of autoload msr's. Untested.
-
Charlie Jacobsen authored
Straight copy over from old code.
-
Charlie Jacobsen authored
-
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
-
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
-
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.
-
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.
-