Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202305
b: refs/heads/master
c: 10ab25c
h: refs/heads/master
i:
  202303: 8dc147c
v: v3
  • Loading branch information
Jan Kiszka authored and Avi Kivity committed Aug 1, 2010
1 parent 0dac10c commit 32568f6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6dc696d4ddf2181eefee361e1d24a49351aef1f6
refs/heads/master: 10ab25cd6bf7ee4e5a55d81f203f7dc1a855c27e
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ int kvm_pic_set_irq(void *opaque, int irq, int level);

void kvm_inject_nmi(struct kvm_vcpu *vcpu);

void fx_init(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,
Expand Down
7 changes: 6 additions & 1 deletion trunk/arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,13 +904,18 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)
svm->asid_generation = 0;
init_vmcb(svm);

fx_init(&svm->vcpu);
err = fx_init(&svm->vcpu);
if (err)
goto free_page4;

svm->vcpu.arch.apic_base = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
if (kvm_vcpu_is_bsp(&svm->vcpu))
svm->vcpu.arch.apic_base |= MSR_IA32_APICBASE_BSP;

return &svm->vcpu;

free_page4:
__free_page(hsave_page);
free_page3:
__free_pages(nested_msrpm_pages, MSRPM_ALLOC_ORDER);
free_page2:
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2659,7 +2659,9 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu)
msr |= MSR_IA32_APICBASE_BSP;
kvm_set_apic_base(&vmx->vcpu, msr);

fx_init(&vmx->vcpu);
ret = fx_init(&vmx->vcpu);
if (ret != 0)
goto out;

seg_setup(VCPU_SREG_CS);
/*
Expand Down
11 changes: 9 additions & 2 deletions trunk/arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -5114,12 +5114,19 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
return 0;
}

void fx_init(struct kvm_vcpu *vcpu)
int fx_init(struct kvm_vcpu *vcpu)
{
fpu_alloc(&vcpu->arch.guest_fpu);
int err;

err = fpu_alloc(&vcpu->arch.guest_fpu);
if (err)
return err;

fpu_finit(&vcpu->arch.guest_fpu);

vcpu->arch.cr0 |= X86_CR0_ET;

return 0;
}
EXPORT_SYMBOL_GPL(fx_init);

Expand Down

0 comments on commit 32568f6

Please sign in to comment.