Re: [PATCH 7/8] KVM: x86: avoid logical_map when it is invalid

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

 



2015-01-30 16:10+0100, Paolo Bonzini:
> On 30/01/2015 15:56, Radim Krčmář wrote:
> > Do you know of a difference with it?
> >   new->mode & (new->mode - 1)   |  hweight8(new->mode) != 1
> >     lea    -0x1(%rax),%edi      |    popcnt %edi,%eax
> >     test   %eax,%edi            |    cmp    $1,%eax
> 
> x & (x - 1) is really hweight8(new->mode) > 1.  So if new->mode == 0 it
> would have a different result.

(I was thinking if execution profile of those two instructions isn't
 vastly different.

 ">" in this check works too ... later it seemed like it was pushing
 lucky coincidence too far, so it ended as "!=" :)

> >> Please add a comment to kvm_irq_delivery_to_apic_fast to explain what
> >> you are doing.
> > 
> > Would naming it kvm_apic_need_slow_delivery(), or something, be enough?
> 
> Or kvm_apic_map_valid() perhaps?

Sure, thanks.
--
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