Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 343545
b: refs/heads/master
c: 42897d8
h: refs/heads/master
i:
  343543: e052b94
v: v3
  • Loading branch information
Marcelo Tosatti committed Nov 28, 2012
1 parent 20def15 commit 3f5eccd
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 4 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: d828199e84447795c6669ff0e6c6d55eb9beeff6
refs/heads/master: 42897d866b120547777ae1fd316680ec53356d9c
5 changes: 5 additions & 0 deletions trunk/arch/ia64/kvm/kvm-ia64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,11 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
return 0;
}

int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
{
return 0;
}

int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
{
return -EINVAL;
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/powerpc/kvm/powerpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
return vcpu;
}

int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
{
return 0;
}

void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
{
/* Make sure we're not using the vcpu anymore */
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/s390/kvm/kvm-s390.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu)
atomic_set_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags);
}

int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
{
return 0;
}

int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
{
atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH |
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,6 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)
svm->vmcb_pa = page_to_pfn(page) << PAGE_SHIFT;
svm->asid_generation = 0;
init_vmcb(svm);
kvm_write_tsc(&svm->vcpu, 0);

err = fx_init(&svm->vcpu);
if (err)
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3896,8 +3896,6 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
vmcs_writel(CR0_GUEST_HOST_MASK, ~0UL);
set_cr4_guest_host_mask(vmx);

kvm_write_tsc(&vmx->vcpu, 0);

return 0;
}

Expand Down
13 changes: 13 additions & 0 deletions trunk/arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -6320,6 +6320,19 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
return r;
}

int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
{
int r;

r = vcpu_load(vcpu);
if (r)
return r;
kvm_write_tsc(vcpu, 0);
vcpu_put(vcpu);

return r;
}

void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
{
int r;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu);
struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id);
int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu);
int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu);
void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu);

int kvm_arch_hardware_enable(void *garbage);
Expand Down
1 change: 1 addition & 0 deletions trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,7 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, u32 id)
atomic_inc(&kvm->online_vcpus);

mutex_unlock(&kvm->lock);
kvm_arch_vcpu_postcreate(vcpu);
return r;

unlock_vcpu_destroy:
Expand Down

0 comments on commit 3f5eccd

Please sign in to comment.