Skip to contentSkip to conversation

Replacing memset(<addr>, 0, PAGESIZE) with clear_page (<addr>) in drivers/kvm/svm.c

KJPATCH Applied Shani Moideen 2 participants 2 messages Jun 11, 2007 KVM

lore
Share & tools
lore
#0 lore raw

Hi,
Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in drivers/kvm/svm.c.

----

thanks.

drivers/kvm/svm.c +2 -2
index fa17d6d..14839dc 100644
@@ -579,7 +579,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));
@@ -955,7 +955,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;
Signature · 7 lines
Shani 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Applied
#1 lore raw
Quoted 3 lines · Shani Moideen

Hi,
Replacing memset(<addr>,0,PAGE_SIZE) with clear_page() in drivers/kvm/svm.c.

Applied, thanks.

Signature · 8 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/