Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
kvm_host.h File Reference
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/mmu_notifier.h>
#include <linux/tracepoint.h>
#include <linux/cpumask.h>
#include <linux/irq_work.h>
#include <linux/kvm.h>
#include <linux/kvm_para.h>
#include <linux/kvm_types.h>
#include <linux/perf_event.h>
#include <asm/pvclock-abi.h>
#include <asm/desc.h>
#include <asm/mtrr.h>
#include <asm/msr-index.h>
#include <asm/asm.h>
#include <asm/kvm_emulate.h>

Go to the source code of this file.

Data Structures

struct  kvm_mmu_memory_cache
 
union  kvm_mmu_page_role
 
struct  kvm_mmu_page
 
struct  kvm_pio_request
 
struct  kvm_mmu
 
struct  kvm_pmc
 
struct  kvm_pmu
 
struct  kvm_vcpu_arch
 
struct  kvm_vcpu_arch::kvm_queued_exception
 
struct  kvm_vcpu_arch::kvm_queued_interrupt
 
struct  kvm_lpage_info
 
struct  kvm_arch_memory_slot
 
struct  kvm_apic_map
 
struct  kvm_arch
 
struct  kvm_vm_stat
 
struct  kvm_vcpu_stat
 
struct  kvm_x86_ops
 
struct  kvm_arch_async_pf
 

Macros

#define KVM_MAX_VCPUS   254
 
#define KVM_SOFT_MAX_VCPUS   160
 
#define KVM_MEMORY_SLOTS   32
 
#define KVM_PRIVATE_MEM_SLOTS   4
 
#define KVM_MEM_SLOTS_NUM   (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS)
 
#define KVM_MMIO_SIZE   16
 
#define KVM_PIO_PAGE_OFFSET   1
 
#define KVM_COALESCED_MMIO_PAGE_OFFSET   2
 
#define CR0_RESERVED_BITS
 
#define CR3_PAE_RESERVED_BITS   ((X86_CR3_PWT | X86_CR3_PCD) - 1)
 
#define CR3_NONPAE_RESERVED_BITS   ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD))
 
#define CR3_PCID_ENABLED_RESERVED_BITS   0xFFFFFF0000000000ULL
 
#define CR3_L_MODE_RESERVED_BITS
 
#define CR4_RESERVED_BITS
 
#define CR8_RESERVED_BITS   (~(unsigned long)X86_CR8_TPR)
 
#define INVALID_PAGE   (~(hpa_t)0)
 
#define VALID_PAGE(x)   ((x) != INVALID_PAGE)
 
#define UNMAPPED_GVA   (~(gpa_t)0)
 
#define KVM_NR_PAGE_SIZES   3
 
#define KVM_HPAGE_GFN_SHIFT(x)   (((x) - 1) * 9)
 
#define KVM_HPAGE_SHIFT(x)   (PAGE_SHIFT + KVM_HPAGE_GFN_SHIFT(x))
 
#define KVM_HPAGE_SIZE(x)   (1UL << KVM_HPAGE_SHIFT(x))
 
#define KVM_HPAGE_MASK(x)   (~(KVM_HPAGE_SIZE(x) - 1))
 
#define KVM_PAGES_PER_HPAGE(x)   (KVM_HPAGE_SIZE(x) / PAGE_SIZE)
 
#define SELECTOR_TI_MASK   (1 << 2)
 
#define SELECTOR_RPL_MASK   0x03
 
#define IOPL_SHIFT   12
 
#define KVM_PERMILLE_MMU_PAGES   20
 
#define KVM_MIN_ALLOC_MMU_PAGES   64
 
#define KVM_MMU_HASH_SHIFT   10
 
#define KVM_NUM_MMU_PAGES   (1 << KVM_MMU_HASH_SHIFT)
 
#define KVM_MIN_FREE_MMU_PAGES   5
 
#define KVM_REFILL_PAGES   25
 
#define KVM_MAX_CPUID_ENTRIES   80
 
#define KVM_NR_FIXED_MTRR_REGION   88
 
#define KVM_NR_VAR_MTRR   8
 
#define ASYNC_PF_PER_VCPU   64
 
#define KVM_NR_MEM_OBJS   40
 
#define KVM_NR_DB_REGS   4
 
#define DR6_BD   (1 << 13)
 
#define DR6_BS   (1 << 14)
 
#define DR6_FIXED_1   0xffff0ff0
 
#define DR6_VOLATILE   0x0000e00f
 
#define DR7_BP_EN_MASK   0x000000ff
 
#define DR7_GE   (1 << 9)
 
#define DR7_GD   (1 << 13)
 
#define DR7_FIXED_1   0x00000400
 
#define DR7_VOLATILE   0xffff23ff
 
#define KVM_APIC_CHECK_VAPIC   0
 
#define KVM_APIC_PV_EOI_PENDING   1
 
#define EMULTYPE_NO_DECODE   (1 << 0)
 
#define EMULTYPE_TRAP_UD   (1 << 1)
 
#define EMULTYPE_SKIP   (1 << 2)
 
#define EMULTYPE_RETRY   (1 << 3)
 
#define TSS_IOPB_BASE_OFFSET   0x66
 
#define TSS_BASE_SIZE   0x68
 
#define TSS_IOPB_SIZE   (65536 / 8)
 
#define TSS_REDIRECTION_SIZE   (256 / 8)
 
#define RMODE_TSS_SIZE   (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1)
 
#define HF_GIF_MASK   (1 << 0)
 
#define HF_HIF_MASK   (1 << 1)
 
#define HF_VINTR_MASK   (1 << 2)
 
#define HF_NMI_MASK   (1 << 3)
 
#define HF_IRET_MASK   (1 << 4)
 
#define HF_GUEST_MASK   (1 << 5) /* VCPU is in guest-mode */
 
#define ____kvm_handle_fault_on_reboot(insn, cleanup_insn)
 
#define __kvm_handle_fault_on_reboot(insn)   ____kvm_handle_fault_on_reboot(insn, "")
 
#define KVM_ARCH_WANT_MMU_NOTIFIER
 

Enumerations

enum  kvm_reg {
  VCPU_REGS_RAX = 0, VCPU_REGS_RCX = 1, VCPU_REGS_RDX = 2, VCPU_REGS_RBX = 3,
  VCPU_REGS_RSP = 4, VCPU_REGS_RBP = 5, VCPU_REGS_RSI = 6, VCPU_REGS_RDI = 7,
  VCPU_REGS_RIP, NR_VCPU_REGS
}
 
enum  kvm_reg_ex {
  VCPU_EXREG_PDPTR = NR_VCPU_REGS, VCPU_EXREG_CR3, VCPU_EXREG_RFLAGS, VCPU_EXREG_CPL,
  VCPU_EXREG_SEGMENTS
}
 
enum  {
  VCPU_SREG_ES, VCPU_SREG_CS, VCPU_SREG_SS, VCPU_SREG_DS,
  VCPU_SREG_FS, VCPU_SREG_GS, VCPU_SREG_TR, VCPU_SREG_LDTR
}
 
enum  pmc_type { KVM_PMC_GP = 0, KVM_PMC_FIXED }
 
enum  emulation_result {
  EMULATE_DONE, EMULATE_DO_MMIO, EMULATE_DO_DCR, EMULATE_FAIL,
  EMULATE_AGAIN, EMULATE_DONE, EMULATE_DO_MMIO, EMULATE_FAIL
}
 
enum  { TASK_SWITCH_CALL = 0, TASK_SWITCH_IRET = 1, TASK_SWITCH_JMP = 2, TASK_SWITCH_GATE = 3 }
 

Functions

int kvm_mmu_module_init (void)
 
void kvm_mmu_module_exit (void)
 
void kvm_mmu_destroy (struct kvm_vcpu *vcpu)
 
int kvm_mmu_create (struct kvm_vcpu *vcpu)
 
int kvm_mmu_setup (struct kvm_vcpu *vcpu)
 
void kvm_mmu_set_mask_ptes (u64 user_mask, u64 accessed_mask, u64 dirty_mask, u64 nx_mask, u64 x_mask)
 
int kvm_mmu_reset_context (struct kvm_vcpu *vcpu)
 
void kvm_mmu_slot_remove_write_access (struct kvm *kvm, int slot)
 
void kvm_mmu_write_protect_pt_masked (struct kvm *kvm, struct kvm_memory_slot *slot, gfn_t gfn_offset, unsigned long mask)
 
void kvm_mmu_zap_all (struct kvm *kvm)
 
unsigned int kvm_mmu_calculate_mmu_pages (struct kvm *kvm)
 
void kvm_mmu_change_mmu_pages (struct kvm *kvm, unsigned int kvm_nr_mmu_pages)
 
int load_pdptrs (struct kvm_vcpu *vcpu, struct kvm_mmu *mmu, unsigned long cr3)
 
int emulator_write_phys (struct kvm_vcpu *vcpu, gpa_t gpa, const void *val, int bytes)
 
u8 kvm_get_guest_memory_type (struct kvm_vcpu *vcpu, gfn_t gfn)
 
u64 vcpu_tsc_khz (struct kvm_vcpu *vcpu)
 
int x86_emulate_instruction (struct kvm_vcpu *vcpu, unsigned long cr2, int emulation_type, void *insn, int insn_len)
 
void kvm_enable_efer_bits (u64)
 
int kvm_get_msr (struct kvm_vcpu *vcpu, u32 msr_index, u64 *data)
 
int kvm_set_msr (struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
 
int kvm_fast_pio_out (struct kvm_vcpu *vcpu, int size, unsigned short port)
 
void kvm_emulate_cpuid (struct kvm_vcpu *vcpu)
 
int kvm_emulate_halt (struct kvm_vcpu *vcpu)
 
int kvm_emulate_wbinvd (struct kvm_vcpu *vcpu)
 
void kvm_get_segment (struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg)
 
int kvm_load_segment_descriptor (struct kvm_vcpu *vcpu, u16 selector, int seg)
 
int kvm_task_switch (struct kvm_vcpu *vcpu, u16 tss_selector, int idt_index, int reason, bool has_error_code, u32 error_code)
 
int kvm_set_cr0 (struct kvm_vcpu *vcpu, unsigned long cr0)
 
int kvm_set_cr3 (struct kvm_vcpu *vcpu, unsigned long cr3)
 
int kvm_set_cr4 (struct kvm_vcpu *vcpu, unsigned long cr4)
 
int kvm_set_cr8 (struct kvm_vcpu *vcpu, unsigned long cr8)
 
int kvm_set_dr (struct kvm_vcpu *vcpu, int dr, unsigned long val)
 
int kvm_get_dr (struct kvm_vcpu *vcpu, int dr, unsigned long *val)
 
unsigned long kvm_get_cr8 (struct kvm_vcpu *vcpu)
 
void kvm_lmsw (struct kvm_vcpu *vcpu, unsigned long msw)
 
void kvm_get_cs_db_l_bits (struct kvm_vcpu *vcpu, int *db, int *l)
 
int kvm_set_xcr (struct kvm_vcpu *vcpu, u32 index, u64 xcr)
 
int kvm_get_msr_common (struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
 
int kvm_set_msr_common (struct kvm_vcpu *vcpu, u32 msr, u64 data)
 
unsigned long kvm_get_rflags (struct kvm_vcpu *vcpu)
 
void kvm_set_rflags (struct kvm_vcpu *vcpu, unsigned long rflags)
 
bool kvm_rdpmc (struct kvm_vcpu *vcpu)
 
void kvm_queue_exception (struct kvm_vcpu *vcpu, unsigned nr)
 
void kvm_queue_exception_e (struct kvm_vcpu *vcpu, unsigned nr, u32 error_code)
 
void kvm_requeue_exception (struct kvm_vcpu *vcpu, unsigned nr)
 
void kvm_requeue_exception_e (struct kvm_vcpu *vcpu, unsigned nr, u32 error_code)
 
void kvm_inject_page_fault (struct kvm_vcpu *vcpu, struct x86_exception *fault)
 
int kvm_read_guest_page_mmu (struct kvm_vcpu *vcpu, struct kvm_mmu *mmu, gfn_t gfn, void *data, int offset, int len, u32 access)
 
void kvm_propagate_fault (struct kvm_vcpu *vcpu, struct x86_exception *fault)
 
bool kvm_require_cpl (struct kvm_vcpu *vcpu, int required_cpl)
 
int kvm_pic_set_irq (struct kvm_pic *pic, int irq, int irq_source_id, int level)
 
void kvm_pic_clear_all (struct kvm_pic *pic, int irq_source_id)
 
void kvm_inject_nmi (struct kvm_vcpu *vcpu)
 
int fx_init (struct kvm_vcpu *vcpu)
 
void kvm_mmu_flush_tlb (struct kvm_vcpu *vcpu)
 
void kvm_mmu_pte_write (struct kvm_vcpu *vcpu, gpa_t gpa, const u8 *new, int bytes)
 
int kvm_mmu_unprotect_page (struct kvm *kvm, gfn_t gfn)
 
int kvm_mmu_unprotect_page_virt (struct kvm_vcpu *vcpu, gva_t gva)
 
void __kvm_mmu_free_some_pages (struct kvm_vcpu *vcpu)
 
int kvm_mmu_load (struct kvm_vcpu *vcpu)
 
void kvm_mmu_unload (struct kvm_vcpu *vcpu)
 
void kvm_mmu_sync_roots (struct kvm_vcpu *vcpu)
 
gpa_t translate_nested_gpa (struct kvm_vcpu *vcpu, gpa_t gpa, u32 access)
 
gpa_t kvm_mmu_gva_to_gpa_read (struct kvm_vcpu *vcpu, gva_t gva, struct x86_exception *exception)
 
gpa_t kvm_mmu_gva_to_gpa_fetch (struct kvm_vcpu *vcpu, gva_t gva, struct x86_exception *exception)
 
gpa_t kvm_mmu_gva_to_gpa_write (struct kvm_vcpu *vcpu, gva_t gva, struct x86_exception *exception)
 
gpa_t kvm_mmu_gva_to_gpa_system (struct kvm_vcpu *vcpu, gva_t gva, struct x86_exception *exception)
 
int kvm_emulate_hypercall (struct kvm_vcpu *vcpu)
 
int kvm_mmu_page_fault (struct kvm_vcpu *vcpu, gva_t gva, u32 error_code, void *insn, int insn_len)
 
void kvm_mmu_invlpg (struct kvm_vcpu *vcpu, gva_t gva)
 
void kvm_enable_tdp (void)
 
void kvm_disable_tdp (void)
 
int complete_pio (struct kvm_vcpu *vcpu)
 
bool kvm_check_iopl (struct kvm_vcpu *vcpu)
 
asmlinkage void kvm_spurious_fault (void)
 
int kvm_unmap_hva (struct kvm *kvm, unsigned long hva)
 
int kvm_unmap_hva_range (struct kvm *kvm, unsigned long start, unsigned long end)
 
int kvm_age_hva (struct kvm *kvm, unsigned long hva)
 
int kvm_test_age_hva (struct kvm *kvm, unsigned long hva)
 
void kvm_set_spte_hva (struct kvm *kvm, unsigned long hva, pte_t pte)
 
int cpuid_maxphyaddr (struct kvm_vcpu *vcpu)
 
int kvm_cpu_has_interrupt (struct kvm_vcpu *vcpu)
 
int kvm_arch_interrupt_allowed (struct kvm_vcpu *vcpu)
 
int kvm_cpu_get_interrupt (struct kvm_vcpu *v)
 
void kvm_define_shared_msr (unsigned index, u32 msr)
 
void kvm_set_shared_msr (unsigned index, u64 val, u64 mask)
 
bool kvm_is_linear_rip (struct kvm_vcpu *vcpu, unsigned long linear_rip)
 
void kvm_arch_async_page_not_present (struct kvm_vcpu *vcpu, struct kvm_async_pf *work)
 
void kvm_arch_async_page_present (struct kvm_vcpu *vcpu, struct kvm_async_pf *work)
 
void kvm_arch_async_page_ready (struct kvm_vcpu *vcpu, struct kvm_async_pf *work)
 
bool kvm_arch_can_inject_async_page_present (struct kvm_vcpu *vcpu)
 
bool kvm_find_async_pf_gfn (struct kvm_vcpu *vcpu, gfn_t gfn)
 
void kvm_complete_insn_gp (struct kvm_vcpu *vcpu, int err)
 
int kvm_is_in_guest (void)
 
void kvm_pmu_init (struct kvm_vcpu *vcpu)
 
void kvm_pmu_destroy (struct kvm_vcpu *vcpu)
 
void kvm_pmu_reset (struct kvm_vcpu *vcpu)
 
void kvm_pmu_cpuid_update (struct kvm_vcpu *vcpu)
 
bool kvm_pmu_msr (struct kvm_vcpu *vcpu, u32 msr)
 
int kvm_pmu_get_msr (struct kvm_vcpu *vcpu, u32 msr, u64 *data)
 
int kvm_pmu_set_msr (struct kvm_vcpu *vcpu, u32 msr, u64 data)
 
int kvm_pmu_read_pmc (struct kvm_vcpu *vcpu, unsigned pmc, u64 *data)
 
void kvm_handle_pmu_event (struct kvm_vcpu *vcpu)
 
void kvm_deliver_pmi (struct kvm_vcpu *vcpu)
 

Variables

raw_spinlock_t kvm_lock
 
struct list_head vm_list
 
struct kvm_x86_opskvm_x86_ops
 
bool tdp_enabled
 
bool kvm_has_tsc_control
 
u32 kvm_min_guest_tsc_khz
 
u32 kvm_max_guest_tsc_khz
 
bool kvm_rebooting
 

Macro Definition Documentation

#define ____kvm_handle_fault_on_reboot (   insn,
  cleanup_insn 
)
Value:
"666: " insn "\n\t" \
"668: \n\t" \
".pushsection .fixup, \"ax\" \n" \
"667: \n\t" \
cleanup_insn "\n\t" \
"cmpb $0, kvm_rebooting \n\t" \
"jne 668b \n\t" \
__ASM_SIZE(push) " $666b \n\t" \
"call kvm_spurious_fault \n\t" \
".popsection \n\t" \
_ASM_EXTABLE(666b, 667b)

Definition at line 955 of file kvm_host.h.

#define __kvm_handle_fault_on_reboot (   insn)    ____kvm_handle_fault_on_reboot(insn, "")

Definition at line 968 of file kvm_host.h.

#define ASYNC_PF_PER_VCPU   64

Definition at line 93 of file kvm_host.h.

#define CR0_RESERVED_BITS
Value:

Definition at line 44 of file kvm_host.h.

#define CR3_L_MODE_RESERVED_BITS
Value:
0xFFFFFF0000000000ULL)

Definition at line 52 of file kvm_host.h.

#define CR3_NONPAE_RESERVED_BITS   ((PAGE_SIZE-1) & ~(X86_CR3_PWT | X86_CR3_PCD))

Definition at line 50 of file kvm_host.h.

#define CR3_PAE_RESERVED_BITS   ((X86_CR3_PWT | X86_CR3_PCD) - 1)

Definition at line 49 of file kvm_host.h.

#define CR3_PCID_ENABLED_RESERVED_BITS   0xFFFFFF0000000000ULL

Definition at line 51 of file kvm_host.h.

#define CR4_RESERVED_BITS
#define CR8_RESERVED_BITS   (~(unsigned long)X86_CR8_TPR)

Definition at line 61 of file kvm_host.h.

#define DR6_BD   (1 << 13)

Definition at line 150 of file kvm_host.h.

#define DR6_BS   (1 << 14)

Definition at line 151 of file kvm_host.h.

#define DR6_FIXED_1   0xffff0ff0

Definition at line 152 of file kvm_host.h.

#define DR6_VOLATILE   0x0000e00f

Definition at line 153 of file kvm_host.h.

#define DR7_BP_EN_MASK   0x000000ff

Definition at line 155 of file kvm_host.h.

#define DR7_FIXED_1   0x00000400

Definition at line 158 of file kvm_host.h.

#define DR7_GD   (1 << 13)

Definition at line 157 of file kvm_host.h.

#define DR7_GE   (1 << 9)

Definition at line 156 of file kvm_host.h.

#define DR7_VOLATILE   0xffff23ff

Definition at line 159 of file kvm_host.h.

#define EMULTYPE_NO_DECODE   (1 << 0)

Definition at line 773 of file kvm_host.h.

#define EMULTYPE_RETRY   (1 << 3)

Definition at line 776 of file kvm_host.h.

#define EMULTYPE_SKIP   (1 << 2)

Definition at line 775 of file kvm_host.h.

#define EMULTYPE_TRAP_UD   (1 << 1)

Definition at line 774 of file kvm_host.h.

#define HF_GIF_MASK   (1 << 0)

Definition at line 940 of file kvm_host.h.

#define HF_GUEST_MASK   (1 << 5) /* VCPU is in guest-mode */

Definition at line 945 of file kvm_host.h.

#define HF_HIF_MASK   (1 << 1)

Definition at line 941 of file kvm_host.h.

#define HF_IRET_MASK   (1 << 4)

Definition at line 944 of file kvm_host.h.

#define HF_NMI_MASK   (1 << 3)

Definition at line 943 of file kvm_host.h.

#define HF_VINTR_MASK   (1 << 2)

Definition at line 942 of file kvm_host.h.

#define INVALID_PAGE   (~(hpa_t)0)

Definition at line 65 of file kvm_host.h.

#define IOPL_SHIFT   12

Definition at line 81 of file kvm_host.h.

#define KVM_APIC_CHECK_VAPIC   0

Definition at line 162 of file kvm_host.h.

#define KVM_APIC_PV_EOI_PENDING   1

Definition at line 169 of file kvm_host.h.

#define KVM_ARCH_WANT_MMU_NOTIFIER

Definition at line 971 of file kvm_host.h.

#define KVM_COALESCED_MMIO_PAGE_OFFSET   2

Definition at line 42 of file kvm_host.h.

#define KVM_HPAGE_GFN_SHIFT (   x)    (((x) - 1) * 9)

Definition at line 72 of file kvm_host.h.

#define KVM_HPAGE_MASK (   x)    (~(KVM_HPAGE_SIZE(x) - 1))

Definition at line 75 of file kvm_host.h.

#define KVM_HPAGE_SHIFT (   x)    (PAGE_SHIFT + KVM_HPAGE_GFN_SHIFT(x))

Definition at line 73 of file kvm_host.h.

#define KVM_HPAGE_SIZE (   x)    (1UL << KVM_HPAGE_SHIFT(x))

Definition at line 74 of file kvm_host.h.

#define KVM_MAX_CPUID_ENTRIES   80

Definition at line 89 of file kvm_host.h.

#define KVM_MAX_VCPUS   254

Definition at line 32 of file kvm_host.h.

#define KVM_MEM_SLOTS_NUM   (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS)

Definition at line 37 of file kvm_host.h.

#define KVM_MEMORY_SLOTS   32

Definition at line 34 of file kvm_host.h.

#define KVM_MIN_ALLOC_MMU_PAGES   64

Definition at line 84 of file kvm_host.h.

#define KVM_MIN_FREE_MMU_PAGES   5

Definition at line 87 of file kvm_host.h.

#define KVM_MMIO_SIZE   16

Definition at line 39 of file kvm_host.h.

#define KVM_MMU_HASH_SHIFT   10

Definition at line 85 of file kvm_host.h.

#define KVM_NR_DB_REGS   4

Definition at line 148 of file kvm_host.h.

#define KVM_NR_FIXED_MTRR_REGION   88

Definition at line 90 of file kvm_host.h.

#define KVM_NR_MEM_OBJS   40

Definition at line 146 of file kvm_host.h.

#define KVM_NR_PAGE_SIZES   3

Definition at line 71 of file kvm_host.h.

#define KVM_NR_VAR_MTRR   8

Definition at line 91 of file kvm_host.h.

#define KVM_NUM_MMU_PAGES   (1 << KVM_MMU_HASH_SHIFT)

Definition at line 86 of file kvm_host.h.

#define KVM_PAGES_PER_HPAGE (   x)    (KVM_HPAGE_SIZE(x) / PAGE_SIZE)

Definition at line 76 of file kvm_host.h.

#define KVM_PERMILLE_MMU_PAGES   20

Definition at line 83 of file kvm_host.h.

#define KVM_PIO_PAGE_OFFSET   1

Definition at line 41 of file kvm_host.h.

#define KVM_PRIVATE_MEM_SLOTS   4

Definition at line 36 of file kvm_host.h.

#define KVM_REFILL_PAGES   25

Definition at line 88 of file kvm_host.h.

#define KVM_SOFT_MAX_VCPUS   160

Definition at line 33 of file kvm_host.h.

#define RMODE_TSS_SIZE   (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1)

Definition at line 930 of file kvm_host.h.

#define SELECTOR_RPL_MASK   0x03

Definition at line 79 of file kvm_host.h.

#define SELECTOR_TI_MASK   (1 << 2)

Definition at line 78 of file kvm_host.h.

#define TSS_BASE_SIZE   0x68

Definition at line 927 of file kvm_host.h.

#define TSS_IOPB_BASE_OFFSET   0x66

Definition at line 926 of file kvm_host.h.

#define TSS_IOPB_SIZE   (65536 / 8)

Definition at line 928 of file kvm_host.h.

#define TSS_REDIRECTION_SIZE   (256 / 8)

Definition at line 929 of file kvm_host.h.

#define UNMAPPED_GVA   (~(gpa_t)0)

Definition at line 68 of file kvm_host.h.

#define VALID_PAGE (   x)    ((x) != INVALID_PAGE)

Definition at line 66 of file kvm_host.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
VCPU_SREG_ES 
VCPU_SREG_CS 
VCPU_SREG_SS 
VCPU_SREG_DS 
VCPU_SREG_FS 
VCPU_SREG_GS 
VCPU_SREG_TR 
VCPU_SREG_LDTR 

Definition at line 133 of file kvm_host.h.

anonymous enum
Enumerator:
TASK_SWITCH_CALL 
TASK_SWITCH_IRET 
TASK_SWITCH_JMP 
TASK_SWITCH_GATE 

Definition at line 933 of file kvm_host.h.

Enumerator:
EMULATE_DONE 
EMULATE_DO_MMIO 
EMULATE_DO_DCR 
EMULATE_FAIL 
EMULATE_AGAIN 
EMULATE_DONE 
EMULATE_DO_MMIO 
EMULATE_FAIL 

Definition at line 767 of file kvm_host.h.

enum kvm_reg
Enumerator:
VCPU_REGS_RAX 
VCPU_REGS_RCX 
VCPU_REGS_RDX 
VCPU_REGS_RBX 
VCPU_REGS_RSP 
VCPU_REGS_RBP 
VCPU_REGS_RSI 
VCPU_REGS_RDI 
VCPU_REGS_RIP 
NR_VCPU_REGS 

Definition at line 102 of file kvm_host.h.

enum kvm_reg_ex
Enumerator:
VCPU_EXREG_PDPTR 
VCPU_EXREG_CR3 
VCPU_EXREG_RFLAGS 
VCPU_EXREG_CPL 
VCPU_EXREG_SEGMENTS 

Definition at line 125 of file kvm_host.h.

enum pmc_type
Enumerator:
KVM_PMC_GP 
KVM_PMC_FIXED 

Definition at line 297 of file kvm_host.h.

Function Documentation

void __kvm_mmu_free_some_pages ( struct kvm_vcpu vcpu)

Definition at line 4046 of file mmu.c.

int complete_pio ( struct kvm_vcpu vcpu)
int cpuid_maxphyaddr ( struct kvm_vcpu vcpu)

Definition at line 609 of file cpuid.c.

int emulator_write_phys ( struct kvm_vcpu vcpu,
gpa_t  gpa,
const void val,
int  bytes 
)

Definition at line 3716 of file x86.c.

int fx_init ( struct kvm_vcpu vcpu)

Definition at line 5965 of file x86.c.

int kvm_age_hva ( struct kvm kvm,
unsigned long  hva 
)

Definition at line 929 of file book3s_64_mmu_hv.c.

void kvm_arch_async_page_not_present ( struct kvm_vcpu vcpu,
struct kvm_async_pf *  work 
)

Definition at line 6666 of file x86.c.

void kvm_arch_async_page_present ( struct kvm_vcpu vcpu,
struct kvm_async_pf *  work 
)

Definition at line 6688 of file x86.c.

void kvm_arch_async_page_ready ( struct kvm_vcpu vcpu,
struct kvm_async_pf *  work 
)

Definition at line 6579 of file x86.c.

bool kvm_arch_can_inject_async_page_present ( struct kvm_vcpu vcpu)

Definition at line 6712 of file x86.c.

int kvm_arch_interrupt_allowed ( struct kvm_vcpu vcpu)

Definition at line 6544 of file x86.c.

bool kvm_check_iopl ( struct kvm_vcpu vcpu)
void kvm_complete_insn_gp ( struct kvm_vcpu vcpu,
int  err 
)

Definition at line 335 of file x86.c.

int kvm_cpu_get_interrupt ( struct kvm_vcpu v)

Definition at line 65 of file irq.c.

int kvm_cpu_has_interrupt ( struct kvm_vcpu vcpu)

Definition at line 44 of file irq.c.

void kvm_define_shared_msr ( unsigned  index,
u32  msr 
)

Definition at line 205 of file x86.c.

void kvm_deliver_pmi ( struct kvm_vcpu vcpu)

Definition at line 89 of file pmu.c.

void kvm_disable_tdp ( void  )

Definition at line 4120 of file mmu.c.

void kvm_emulate_cpuid ( struct kvm_vcpu vcpu)

Definition at line 663 of file cpuid.c.

int kvm_emulate_halt ( struct kvm_vcpu vcpu)

Definition at line 448 of file kvm-ia64.c.

int kvm_emulate_hypercall ( struct kvm_vcpu vcpu)

Definition at line 5018 of file x86.c.

int kvm_emulate_wbinvd ( struct kvm_vcpu vcpu)

Definition at line 4070 of file x86.c.

void kvm_enable_efer_bits ( u64  )

Definition at line 877 of file x86.c.

void kvm_enable_tdp ( void  )

Definition at line 4114 of file mmu.c.

int kvm_fast_pio_out ( struct kvm_vcpu vcpu,
int  size,
unsigned short  port 
)

Definition at line 4651 of file x86.c.

bool kvm_find_async_pf_gfn ( struct kvm_vcpu vcpu,
gfn_t  gfn 
)

Definition at line 6631 of file x86.c.

unsigned long kvm_get_cr8 ( struct kvm_vcpu vcpu)

Definition at line 686 of file x86.c.

void kvm_get_cs_db_l_bits ( struct kvm_vcpu vcpu,
int db,
int l 
)

Definition at line 5692 of file x86.c.

int kvm_get_dr ( struct kvm_vcpu vcpu,
int  dr,
unsigned long val 
)

Definition at line 778 of file x86.c.

u8 kvm_get_guest_memory_type ( struct kvm_vcpu vcpu,
gfn_t  gfn 
)

Definition at line 2287 of file mmu.c.

int kvm_get_msr ( struct kvm_vcpu vcpu,
u32  msr_index,
u64 data 
)

Definition at line 1796 of file x86.c.

int kvm_get_msr_common ( struct kvm_vcpu vcpu,
u32  msr,
u64 pdata 
)

Definition at line 1923 of file x86.c.

unsigned long kvm_get_rflags ( struct kvm_vcpu vcpu)

Definition at line 6558 of file x86.c.

void kvm_get_segment ( struct kvm_vcpu vcpu,
struct kvm_segment var,
int  seg 
)

Definition at line 3537 of file x86.c.

void kvm_handle_pmu_event ( struct kvm_vcpu vcpu)

Definition at line 519 of file pmu.c.

void kvm_inject_nmi ( struct kvm_vcpu vcpu)

Definition at line 360 of file x86.c.

void kvm_inject_page_fault ( struct kvm_vcpu vcpu,
struct x86_exception fault 
)

Definition at line 344 of file x86.c.

int kvm_is_in_guest ( void  )

Definition at line 4817 of file x86.c.

bool kvm_is_linear_rip ( struct kvm_vcpu vcpu,
unsigned long  linear_rip 
)

Definition at line 6549 of file x86.c.

void kvm_lmsw ( struct kvm_vcpu vcpu,
unsigned long  msw 
)

Definition at line 541 of file x86.c.

int kvm_load_segment_descriptor ( struct kvm_vcpu vcpu,
u16  selector,
int  seg 
)
unsigned int kvm_mmu_calculate_mmu_pages ( struct kvm kvm)

Definition at line 4320 of file mmu.c.

void kvm_mmu_change_mmu_pages ( struct kvm kvm,
unsigned int  kvm_nr_mmu_pages 
)

Definition at line 2138 of file mmu.c.

int kvm_mmu_create ( struct kvm_vcpu vcpu)

Definition at line 4156 of file mmu.c.

void kvm_mmu_destroy ( struct kvm_vcpu vcpu)

Definition at line 4358 of file mmu.c.

void kvm_mmu_flush_tlb ( struct kvm_vcpu vcpu)

Definition at line 3374 of file mmu.c.

gpa_t kvm_mmu_gva_to_gpa_fetch ( struct kvm_vcpu vcpu,
gva_t  gva,
struct x86_exception exception 
)

Definition at line 3564 of file x86.c.

gpa_t kvm_mmu_gva_to_gpa_read ( struct kvm_vcpu vcpu,
gva_t  gva,
struct x86_exception exception 
)

Definition at line 3557 of file x86.c.

gpa_t kvm_mmu_gva_to_gpa_system ( struct kvm_vcpu vcpu,
gva_t  gva,
struct x86_exception exception 
)

Definition at line 3581 of file x86.c.

gpa_t kvm_mmu_gva_to_gpa_write ( struct kvm_vcpu vcpu,
gva_t  gva,
struct x86_exception exception 
)

Definition at line 3572 of file x86.c.

void kvm_mmu_invlpg ( struct kvm_vcpu vcpu,
gva_t  gva 
)

Definition at line 4106 of file mmu.c.

int kvm_mmu_load ( struct kvm_vcpu vcpu)

Definition at line 3786 of file mmu.c.

void kvm_mmu_module_exit ( void  )

Definition at line 4367 of file mmu.c.

int kvm_mmu_module_init ( void  )

Definition at line 4291 of file mmu.c.

int kvm_mmu_page_fault ( struct kvm_vcpu vcpu,
gva_t  gva,
u32  error_code,
void insn,
int  insn_len 
)

Definition at line 4070 of file mmu.c.

void kvm_mmu_pte_write ( struct kvm_vcpu vcpu,
gpa_t  gpa,
const u8 new,
int  bytes 
)

Definition at line 3961 of file mmu.c.

int kvm_mmu_reset_context ( struct kvm_vcpu vcpu)

Definition at line 3779 of file mmu.c.

void kvm_mmu_set_mask_ptes ( u64  user_mask,
u64  accessed_mask,
u64  dirty_mask,
u64  nx_mask,
u64  x_mask 
)

Definition at line 238 of file mmu.c.

int kvm_mmu_setup ( struct kvm_vcpu vcpu)

Definition at line 4168 of file mmu.c.

void kvm_mmu_slot_remove_write_access ( struct kvm kvm,
int  slot 
)

Definition at line 4176 of file mmu.c.

void kvm_mmu_sync_roots ( struct kvm_vcpu vcpu)

Definition at line 3110 of file mmu.c.

void kvm_mmu_unload ( struct kvm_vcpu vcpu)

Definition at line 3806 of file mmu.c.

int kvm_mmu_unprotect_page ( struct kvm kvm,
gfn_t  gfn 
)

Definition at line 2163 of file mmu.c.

int kvm_mmu_unprotect_page_virt ( struct kvm_vcpu vcpu,
gva_t  gva 
)

Definition at line 4030 of file mmu.c.

void kvm_mmu_write_protect_pt_masked ( struct kvm kvm,
struct kvm_memory_slot slot,
gfn_t  gfn_offset,
unsigned long  mask 
)

kvm_mmu_write_protect_pt_masked - write protect selected PT level pages : kvm instance : slot to protect : start of the BITS_PER_LONG pages we care about : indicates which pages we should protect

Used when we do not need to care about huge page mappings: e.g. during dirty logging we do not have any such mappings.

Definition at line 1174 of file mmu.c.

void kvm_mmu_zap_all ( struct kvm kvm)

Definition at line 4200 of file mmu.c.

void kvm_pic_clear_all ( struct kvm_pic pic,
int  irq_source_id 
)

Definition at line 209 of file i8259.c.

int kvm_pic_set_irq ( struct kvm_pic pic,
int  irq,
int  irq_source_id,
int  level 
)

Definition at line 191 of file i8259.c.

void kvm_pmu_cpuid_update ( struct kvm_vcpu vcpu)

Definition at line 434 of file pmu.c.

void kvm_pmu_destroy ( struct kvm_vcpu vcpu)

Definition at line 514 of file pmu.c.

int kvm_pmu_get_msr ( struct kvm_vcpu vcpu,
u32  msr,
u64 data 
)

Definition at line 332 of file pmu.c.

void kvm_pmu_init ( struct kvm_vcpu vcpu)

Definition at line 475 of file pmu.c.

bool kvm_pmu_msr ( struct kvm_vcpu vcpu,
u32  msr 
)

Definition at line 311 of file pmu.c.

int kvm_pmu_read_pmc ( struct kvm_vcpu vcpu,
unsigned  pmc,
u64 data 
)

Definition at line 412 of file pmu.c.

void kvm_pmu_reset ( struct kvm_vcpu vcpu)

Definition at line 495 of file pmu.c.

int kvm_pmu_set_msr ( struct kvm_vcpu vcpu,
u32  msr,
u64  data 
)

Definition at line 363 of file pmu.c.

void kvm_propagate_fault ( struct kvm_vcpu vcpu,
struct x86_exception fault 
)

Definition at line 352 of file x86.c.

void kvm_queue_exception ( struct kvm_vcpu vcpu,
unsigned  nr 
)

Definition at line 323 of file x86.c.

void kvm_queue_exception_e ( struct kvm_vcpu vcpu,
unsigned  nr,
u32  error_code 
)

Definition at line 367 of file x86.c.

bool kvm_rdpmc ( struct kvm_vcpu vcpu)

Definition at line 788 of file x86.c.

int kvm_read_guest_page_mmu ( struct kvm_vcpu vcpu,
struct kvm_mmu mmu,
gfn_t  gfn,
void data,
int  offset,
int  len,
u32  access 
)

Definition at line 397 of file x86.c.

void kvm_requeue_exception ( struct kvm_vcpu vcpu,
unsigned  nr 
)

Definition at line 329 of file x86.c.

void kvm_requeue_exception_e ( struct kvm_vcpu vcpu,
unsigned  nr,
u32  error_code 
)

Definition at line 373 of file x86.c.

bool kvm_require_cpl ( struct kvm_vcpu vcpu,
int  required_cpl 
)

Definition at line 383 of file x86.c.

int kvm_set_cr0 ( struct kvm_vcpu vcpu,
unsigned long  cr0 
)

Definition at line 487 of file x86.c.

int kvm_set_cr3 ( struct kvm_vcpu vcpu,
unsigned long  cr3 
)

Definition at line 627 of file x86.c.

int kvm_set_cr4 ( struct kvm_vcpu vcpu,
unsigned long  cr4 
)

Definition at line 578 of file x86.c.

int kvm_set_cr8 ( struct kvm_vcpu vcpu,
unsigned long  cr8 
)

Definition at line 674 of file x86.c.

int kvm_set_dr ( struct kvm_vcpu vcpu,
int  dr,
unsigned long  val 
)

Definition at line 739 of file x86.c.

int kvm_set_msr ( struct kvm_vcpu vcpu,
u32  msr_index,
u64  data 
)

Definition at line 889 of file x86.c.

int kvm_set_msr_common ( struct kvm_vcpu vcpu,
u32  msr,
u64  data 
)

Definition at line 1575 of file x86.c.

void kvm_set_rflags ( struct kvm_vcpu vcpu,
unsigned long  rflags 
)

Definition at line 6569 of file x86.c.

void kvm_set_shared_msr ( unsigned  index,
u64  val,
u64  mask 
)

Definition at line 223 of file x86.c.

void kvm_set_spte_hva ( struct kvm kvm,
unsigned long  hva,
pte_t  pte 
)

Definition at line 974 of file book3s_64_mmu_hv.c.

int kvm_set_xcr ( struct kvm_vcpu vcpu,
u32  index,
u64  xcr 
)

Definition at line 568 of file x86.c.

asmlinkage void kvm_spurious_fault ( void  )

Definition at line 2549 of file kvm_main.c.

int kvm_task_switch ( struct kvm_vcpu vcpu,
u16  tss_selector,
int  idt_index,
int  reason,
bool  has_error_code,
u32  error_code 
)

Definition at line 5756 of file x86.c.

int kvm_test_age_hva ( struct kvm kvm,
unsigned long  hva 
)

Definition at line 967 of file book3s_64_mmu_hv.c.

int kvm_unmap_hva ( struct kvm kvm,
unsigned long  hva 
)

Definition at line 866 of file book3s_64_mmu_hv.c.

int kvm_unmap_hva_range ( struct kvm kvm,
unsigned long  start,
unsigned long  end 
)

Definition at line 873 of file book3s_64_mmu_hv.c.

int load_pdptrs ( struct kvm_vcpu vcpu,
struct kvm_mmu mmu,
unsigned long  cr3 
)

Definition at line 425 of file x86.c.

gpa_t translate_nested_gpa ( struct kvm_vcpu vcpu,
gpa_t  gpa,
u32  access 
)

Definition at line 3543 of file x86.c.

u64 vcpu_tsc_khz ( struct kvm_vcpu vcpu)
int x86_emulate_instruction ( struct kvm_vcpu vcpu,
unsigned long  cr2,
int  emulation_type,
void insn,
int  insn_len 
)

Definition at line 4553 of file x86.c.

Variable Documentation

bool kvm_has_tsc_control

Definition at line 95 of file x86.c.

raw_spinlock_t kvm_lock
u32 kvm_max_guest_tsc_khz

Definition at line 97 of file x86.c.

u32 kvm_min_guest_tsc_khz
bool kvm_rebooting

Definition at line 98 of file kvm_main.c.

Definition at line 89 of file x86.c.

bool tdp_enabled

Definition at line 51 of file mmu.c.

struct list_head vm_list