Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54094
b: refs/heads/master
c: 80b7706
h: refs/heads/master
v: v3
  • Loading branch information
Joerg Roedel authored and Avi Kivity committed May 3, 2007
1 parent ee1acfa commit 8c9c62b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b8836737d92c139be770eae3d6574e33d1224caf
refs/heads/master: 80b7706e4cbaa51d65bd6fea83bd0e59856f50e9
13 changes: 13 additions & 0 deletions trunk/drivers/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ MODULE_LICENSE("GPL");
#define KVM_EFER_LMA (1 << 10)
#define KVM_EFER_LME (1 << 8)

#define SVM_FEATURE_NPT (1 << 0)
#define SVM_FEATURE_LBRV (1 << 1)
#define SVM_DEATURE_SVML (1 << 2)

unsigned long iopm_base;
unsigned long msrpm_base;

Expand All @@ -68,6 +72,7 @@ struct svm_cpu_data {
};

static DEFINE_PER_CPU(struct svm_cpu_data *, svm_data);
static uint32_t svm_features;

struct svm_init_data {
int cpu;
Expand All @@ -82,6 +87,11 @@ static u32 msrpm_ranges[] = {0, 0xc0000000, 0xc0010000};

#define MAX_INST_SIZE 15

static inline u32 svm_has(u32 feat)
{
return svm_features & feat;
}

static unsigned get_addr_size(struct kvm_vcpu *vcpu)
{
struct vmcb_save_area *sa = &vcpu->svm->vmcb->save;
Expand Down Expand Up @@ -302,6 +312,7 @@ static void svm_hardware_enable(void *garbage)
svm_data->asid_generation = 1;
svm_data->max_asid = cpuid_ebx(SVM_CPUID_FUNC) - 1;
svm_data->next_asid = svm_data->max_asid + 1;
svm_features = cpuid_edx(SVM_CPUID_FUNC);

asm volatile ( "sgdt %0" : "=m"(gdt_descr) );
gdt = (struct desc_struct *)gdt_descr.address;
Expand Down Expand Up @@ -511,6 +522,8 @@ static void init_vmcb(struct vmcb *vmcb)
control->msrpm_base_pa = msrpm_base;
control->tsc_offset = 0;
control->int_ctl = V_INTR_MASKING_MASK;
if (svm_has(SVM_FEATURE_LBRV))
control->lbr_ctl = 1ULL;

init_seg(&save->es);
init_seg(&save->ss);
Expand Down

0 comments on commit 8c9c62b

Please sign in to comment.