On Wed, Nov 21, 2012 at 1:15 PM, Marc Zyngier <marc.zyngier@xxxxxxx> wrote: > The irq_cfg accessors are not properly masking top bits when > compressing/expanding the value. > > Signed-off-by: Marc Zyngier <marc.zyngier@xxxxxxx> > --- > arch/arm/kvm/vgic.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/kvm/vgic.c b/arch/arm/kvm/vgic.c > index d89607a..e1d25b4 100644 > --- a/arch/arm/kvm/vgic.c > +++ b/arch/arm/kvm/vgic.c > @@ -368,7 +368,7 @@ static u32 vgic_cfg_expand(u16 val) > int i; > > for (i = 0; i < 16; i++) > - res |= (val >> i) << (2 * i + 1); > + res |= ((val >> i) & 1) << (2 * i + 1); > > return res; > } > @@ -379,7 +379,7 @@ static u16 vgic_cfg_compress(u32 val) > int i; > > for (i = 0; i < 16; i++) > - res |= (val >> (i * 2 + 1)) << i; > + res |= ((val >> (i * 2 + 1)) & 1) << i; > > return res; > } > -- > 1.7.12 > incredible, nice catch! Applied. _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm