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