Re: [PATCH v2 9/9] KVM: MMU: Avoid access/dirty update loop if all is well

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/16/2012 08:07 PM, Avi Kivity wrote:

> +	/*
> +	 * On a write fault, fold the dirty bit into accessed_dirty by shifting it one
> +	 * place right.
> +	 *
> +	 * On a read fault, do nothing.
> +	 */
> +	accessed_dirty &= pte >> (write_fault >> ilog2(PFERR_WRITE_MASK));

It is too trick: it depends on DIRTY_SHIFT = ACCESSED_SHIFT + 1. How about change it
to:
  accessed_dirty &= pte >> (!!write_fault >> (DIRTY_SHIFT - ACCESSED_SHIFT)) ?


Otherwise looks good to me.

Reviewed-by: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux