akaros/kern/arch/x86/ros/vmm.h
<<
>>
Prefs
   1/* Copyright (c) 2015 Google Inc.
   2 * Barret Rhoden <brho@cs.berkeley.edu>
   3 * See LICENSE for details.
   4 *
   5 * x86 VMM kernel headers */
   6
   7#pragma once
   8
   9#include <ros/arch/vmx.h>
  10
  11/* Initialization data provided by the userspace part of the VMM when setting
  12 * up a guest physical core (vmx vcpu). */
  13struct vmm_gpcore_init {
  14        void                            *posted_irq_desc;
  15        void                            *vapic_addr;
  16        void                            *apic_addr;
  17        uintptr_t                       fsbase;
  18        uintptr_t                       gsbase;
  19};
  20
  21/* Intel VM Trap Injection Fields */
  22#define VM_TRAP_VALID               (1 << 31)
  23#define VM_TRAP_ERROR_CODE          (1 << 11)
  24#define VM_TRAP_HARDWARE            (3 << 8)
  25/* End Intel VM Trap Injection Fields */
  26
  27static inline bool vmm_user_handles_cpuid(uint32_t eax, uint32_t ecx)
  28{
  29        switch (eax) {
  30        case 0x0b:
  31                return true;
  32        }
  33        return false;
  34}
  35