Re: [PATCH v2 4/4] Enabling Access bit when doing memory swapping

From: Avi Kivity
Date: Mon May 21 2012 - 04:21:36 EST


On 05/21/2012 06:54 AM, Xudong Hao wrote:
> Enabling Access bit when doing memory swapping.
>
> @@ -1243,11 +1244,11 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp,
>
> for (sptep = rmap_get_first(*rmapp, &iter); sptep;
> sptep = rmap_get_next(&iter)) {
> - BUG_ON(!(*sptep & PT_PRESENT_MASK));
> + BUG_ON(!is_shadow_present_pte(*sptep));
>
> - if (*sptep & PT_ACCESSED_MASK) {
> + if (*sptep & shadow_accessed_mask) {
> young = 1;
> - clear_bit(PT_ACCESSED_SHIFT, (unsigned long *)sptep);
> + *sptep &= ~shadow_accessed_mask;
> }
> }

As Marcelo already noted, this converts an atomic operation into a
non-atomic one.


--
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/