Skip to content

Commit

Permalink
KVM: SVM: let init_vmcb() take struct vcpu_svm as parameter
Browse files Browse the repository at this point in the history
Change the parameter of the init_vmcb() function in the kvm-amd module from
struct vmcb to struct vcpu_svm.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Markus Rechberger <markus.rechberger@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Joerg Roedel authored and Avi Kivity committed Apr 27, 2008
1 parent 2e11384 commit e6101a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,10 @@ static void init_sys_seg(struct vmcb_seg *seg, uint32_t type)
seg->base = 0;
}

static void init_vmcb(struct vmcb *vmcb)
static void init_vmcb(struct vcpu_svm *svm)
{
struct vmcb_control_area *control = &vmcb->control;
struct vmcb_save_area *save = &vmcb->save;
struct vmcb_control_area *control = &svm->vmcb->control;
struct vmcb_save_area *save = &svm->vmcb->save;

control->intercept_cr_read = INTERCEPT_CR0_MASK |
INTERCEPT_CR3_MASK |
Expand Down Expand Up @@ -600,7 +600,7 @@ static int svm_vcpu_reset(struct kvm_vcpu *vcpu)
{
struct vcpu_svm *svm = to_svm(vcpu);

init_vmcb(svm->vmcb);
init_vmcb(svm);

if (vcpu->vcpu_id != 0) {
svm->vmcb->save.rip = 0;
Expand Down Expand Up @@ -638,7 +638,7 @@ 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;
memset(svm->db_regs, 0, sizeof(svm->db_regs));
init_vmcb(svm->vmcb);
init_vmcb(svm);

fx_init(&svm->vcpu);
svm->vcpu.fpu_active = 1;
Expand Down Expand Up @@ -1024,7 +1024,7 @@ static int shutdown_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
* so reinitialize it.
*/
clear_page(svm->vmcb);
init_vmcb(svm->vmcb);
init_vmcb(svm);

kvm_run->exit_reason = KVM_EXIT_SHUTDOWN;
return 0;
Expand Down

0 comments on commit e6101a9

Please sign in to comment.