Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
svm.c File Reference
#include <linux/kvm_host.h>
#include "irq.h"
#include "mmu.h"
#include "kvm_cache_regs.h"
#include "x86.h"
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/kernel.h>
#include <linux/vmalloc.h>
#include <linux/highmem.h>
#include <linux/sched.h>
#include <linux/ftrace_event.h>
#include <linux/slab.h>
#include <asm/perf_event.h>
#include <asm/tlbflush.h>
#include <asm/desc.h>
#include <asm/kvm_para.h>
#include <asm/virtext.h>
#include "trace.h"

Go to the source code of this file.

Data Structures

struct  nested_state
 
struct  vcpu_svm
 
struct  svm_direct_access_msrs
 
struct  kvm_ldttss_desc
 
struct  svm_cpu_data
 
struct  svm_init_data
 
struct  __x86_intercept
 

Macros

#define __ex(x)   __kvm_handle_fault_on_reboot(x)
 
#define IOPM_ALLOC_ORDER   2
 
#define MSRPM_ALLOC_ORDER   1
 
#define SEG_TYPE_LDT   2
 
#define SEG_TYPE_BUSY_TSS16   3
 
#define SVM_FEATURE_NPT   (1 << 0)
 
#define SVM_FEATURE_LBRV   (1 << 1)
 
#define SVM_FEATURE_SVML   (1 << 2)
 
#define SVM_FEATURE_NRIP   (1 << 3)
 
#define SVM_FEATURE_TSC_RATE   (1 << 4)
 
#define SVM_FEATURE_VMCB_CLEAN   (1 << 5)
 
#define SVM_FEATURE_FLUSH_ASID   (1 << 6)
 
#define SVM_FEATURE_DECODE_ASSIST   (1 << 7)
 
#define SVM_FEATURE_PAUSE_FILTER   (1 << 10)
 
#define NESTED_EXIT_HOST   0 /* Exit handled on host level */
 
#define NESTED_EXIT_DONE   1 /* Exit caused nested vmexit */
 
#define NESTED_EXIT_CONTINUE   2 /* Further checks needed */
 
#define DEBUGCTL_RESERVED_BITS   (~(0x3fULL))
 
#define TSC_RATIO_RSVD   0xffffff0000000000ULL
 
#define TSC_RATIO_MIN   0x0000000000000001ULL
 
#define TSC_RATIO_MAX   0x000000ffffffffffULL
 
#define NR_HOST_SAVE_USER_MSRS   ARRAY_SIZE(host_save_user_msrs)
 
#define MSRPM_OFFSETS   16
 
#define TSC_RATIO_DEFAULT   0x0100000000ULL
 
#define MSR_INVALID   0xffffffffU
 
#define VMCB_ALWAYS_DIRTY_MASK   ((1U << VMCB_INTR) | (1U << VMCB_CR2))
 
#define NUM_MSR_MAPS   ARRAY_SIZE(msrpm_ranges)
 
#define MSRS_RANGE_SIZE   2048
 
#define MSRS_IN_RANGE   (MSRS_RANGE_SIZE * 8 / 2)
 
#define MAX_INST_SIZE   15
 
#define CR_VALID   (1ULL << 63)
 
#define PRE_EX(exit)
 
#define POST_EX(exit)
 
#define POST_MEM(exit)
 

Enumerations

enum  {
  VMCB_INTERCEPTS, VMCB_PERM_MAP, VMCB_ASID, VMCB_INTR,
  VMCB_NPT, VMCB_CR, VMCB_DR, VMCB_DT,
  VMCB_SEG, VMCB_CR2, VMCB_LBR, VMCB_DIRTY_MAX
}
 

Functions

 MODULE_AUTHOR ("Qumranet")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DEVICE_TABLE (x86cpu, svm_cpu_id)
 
 module_param (npt, int, S_IRUGO)
 
 module_param (nested, int, S_IRUGO)
 
struct kvm_ldttss_desc __attribute__ ((packed))
 
bool check_selective_cr0_intercepted (struct vcpu_svm *svm, unsigned long val)
 
u64 svm_read_l1_tsc (struct kvm_vcpu *vcpu)
 

Variables

u16 limit0
 
u16 base0
 
unsigned base1
 
unsigned type
 
unsigned dpl
 
unsigned p
 
unsigned limit1
 
unsigned zero0
 
unsigned g
 
unsigned base2
 
u32 base3
 
u32 zero1
 
struct svm_cpu_data __attribute__
 

Macro Definition Documentation

#define __ex (   x)    __kvm_handle_fault_on_reboot(x)

Definition at line 41 of file svm.c.

#define CR_VALID   (1ULL << 63)

Definition at line 2895 of file svm.c.

#define DEBUGCTL_RESERVED_BITS   (~(0x3fULL))

Definition at line 72 of file svm.c.

#define IOPM_ALLOC_ORDER   2

Definition at line 52 of file svm.c.

#define MAX_INST_SIZE   15

Definition at line 430 of file svm.c.

#define MSR_INVALID   0xffffffffU

Definition at line 164 of file svm.c.

#define MSRPM_ALLOC_ORDER   1

Definition at line 53 of file svm.c.

#define MSRPM_OFFSETS   16

Definition at line 118 of file svm.c.

#define MSRS_IN_RANGE   (MSRS_RANGE_SIZE * 8 / 2)

Definition at line 407 of file svm.c.

#define MSRS_RANGE_SIZE   2048

Definition at line 406 of file svm.c.

#define NESTED_EXIT_CONTINUE   2 /* Further checks needed */

Definition at line 70 of file svm.c.

#define NESTED_EXIT_DONE   1 /* Exit caused nested vmexit */

Definition at line 69 of file svm.c.

#define NESTED_EXIT_HOST   0 /* Exit handled on host level */

Definition at line 68 of file svm.c.

#define NR_HOST_SAVE_USER_MSRS   ARRAY_SIZE(host_save_user_msrs)

Definition at line 88 of file svm.c.

#define NUM_MSR_MAPS   ARRAY_SIZE(msrpm_ranges)

Definition at line 405 of file svm.c.

#define POST_EX (   exit)
Value:
{ .exit_code = (exit), \

Definition at line 4045 of file svm.c.

#define POST_MEM (   exit)
Value:
{ .exit_code = (exit), \

Definition at line 4047 of file svm.c.

#define PRE_EX (   exit)
Value:
{ .exit_code = (exit), \
.stage = X86_ICPT_PRE_EXCEPT, }

Definition at line 4043 of file svm.c.

#define SEG_TYPE_BUSY_TSS16   3

Definition at line 56 of file svm.c.

#define SEG_TYPE_LDT   2

Definition at line 55 of file svm.c.

#define SVM_FEATURE_DECODE_ASSIST   (1 << 7)

Definition at line 65 of file svm.c.

#define SVM_FEATURE_FLUSH_ASID   (1 << 6)

Definition at line 64 of file svm.c.

#define SVM_FEATURE_LBRV   (1 << 1)

Definition at line 59 of file svm.c.

#define SVM_FEATURE_NPT   (1 << 0)

Definition at line 58 of file svm.c.

#define SVM_FEATURE_NRIP   (1 << 3)

Definition at line 61 of file svm.c.

#define SVM_FEATURE_PAUSE_FILTER   (1 << 10)

Definition at line 66 of file svm.c.

#define SVM_FEATURE_SVML   (1 << 2)

Definition at line 60 of file svm.c.

#define SVM_FEATURE_TSC_RATE   (1 << 4)

Definition at line 62 of file svm.c.

#define SVM_FEATURE_VMCB_CLEAN   (1 << 5)

Definition at line 63 of file svm.c.

#define TSC_RATIO_DEFAULT   0x0100000000ULL

Definition at line 162 of file svm.c.

#define TSC_RATIO_MAX   0x000000ffffffffffULL

Definition at line 76 of file svm.c.

#define TSC_RATIO_MIN   0x0000000000000001ULL

Definition at line 75 of file svm.c.

#define TSC_RATIO_RSVD   0xffffff0000000000ULL

Definition at line 74 of file svm.c.

#define VMCB_ALWAYS_DIRTY_MASK   ((1U << VMCB_INTR) | (1U << VMCB_CR2))

Definition at line 229 of file svm.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
VMCB_INTERCEPTS 
VMCB_PERM_MAP 
VMCB_ASID 
VMCB_INTR 
VMCB_NPT 
VMCB_CR 
VMCB_DR 
VMCB_DT 
VMCB_SEG 
VMCB_CR2 
VMCB_LBR 
VMCB_DIRTY_MAX 

Definition at line 212 of file svm.c.

Function Documentation

struct kvm_ldttss_desc __attribute__ ( (packed)  )
read

Definition at line 171 of file esd_usb2.c.

bool check_selective_cr0_intercepted ( struct vcpu_svm svm,
unsigned long  val 
)

Definition at line 2872 of file svm.c.

MODULE_AUTHOR ( "Qumranet"  )
MODULE_DEVICE_TABLE ( x86cpu  ,
svm_cpu_id   
)
MODULE_LICENSE ( "GPL"  )
module_param ( npt  ,
int  ,
S_IRUGO   
)
module_param ( nested  ,
int  ,
S_IRUGO   
)
u64 svm_read_l1_tsc ( struct kvm_vcpu vcpu)

Definition at line 3011 of file svm.c.

Variable Documentation

u16 base0

Definition at line 385 of file svm.c.

unsigned base1

Definition at line 386 of file svm.c.

unsigned base2

Definition at line 387 of file svm.c.

u32 base3

Definition at line 388 of file svm.c.

unsigned dpl

Definition at line 386 of file svm.c.

unsigned g

Definition at line 387 of file svm.c.

u16 limit0

Definition at line 384 of file svm.c.

unsigned limit1

Definition at line 387 of file svm.c.

unsigned p

Definition at line 386 of file svm.c.

unsigned type

Definition at line 386 of file svm.c.

unsigned zero0

Definition at line 387 of file svm.c.

u32 zero1

Definition at line 389 of file svm.c.