Re: [PATCH 2/2] KVM: MMU: handle 'map_writable' in set_spte() function

From: Avi Kivity
Date: Sun Dec 26 2010 - 07:20:58 EST


On 12/23/2010 10:09 AM, Xiao Guangrong wrote:
Move the operation of 'writable' to set_spte() to clean up code


Thanks, applied.
@@ -809,12 +806,8 @@ static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)

nr_present++;
pte_access = sp->role.access& FNAME(gpte_access)(vcpu, gpte);
- if (!(sp->spt[i]& SPTE_HOST_WRITEABLE)) {
- pte_access&= ~ACC_WRITE_MASK;
- host_writable = 0;
- } else {
- host_writable = 1;
- }
+ host_writable = !!(sp->spt[i]& SPTE_HOST_WRITEABLE);
+

Note, !! is unneeded when assigning to a boolean variable. I removed it.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/