Skip to content

Commit

Permalink
KVM: SVM: Replace memset(<addr>, 0, PAGESIZE) with clear_page(<addr>)
Browse files Browse the repository at this point in the history
Signed-off-by: Shani Moideen <shani.moideen@wipro.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Shani Moideen authored and Avi Kivity committed Jul 16, 2007
1 parent d9e368d commit 129ee91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
goto out2;

vcpu->svm->vmcb = page_address(page);
memset(vcpu->svm->vmcb, 0, PAGE_SIZE);
clear_page(vcpu->svm->vmcb);
vcpu->svm->vmcb_pa = page_to_pfn(page) << PAGE_SHIFT;
vcpu->svm->asid_generation = 0;
memset(vcpu->svm->db_regs, 0, sizeof(vcpu->svm->db_regs));
Expand Down Expand Up @@ -957,7 +957,7 @@ static int shutdown_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
* VMCB is undefined after a SHUTDOWN intercept
* so reinitialize it.
*/
memset(vcpu->svm->vmcb, 0, PAGE_SIZE);
clear_page(vcpu->svm->vmcb);
init_vmcb(vcpu->svm->vmcb);

kvm_run->exit_reason = KVM_EXIT_SHUTDOWN;
Expand Down

0 comments on commit 129ee91

Please sign in to comment.