Re: [PATCH] KVM: x86: inline kvm_ioapic_handles_vector()

From: Marcelo Tosatti
Date: Mon Mar 23 2015 - 20:20:59 EST


On Thu, Mar 19, 2015 at 09:52:41PM +0100, Radim KrÄmÃÅ wrote:
> An overhead from function call is not appropriate for its size and
> frequency of execution.
>
> Suggested-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> Signed-off-by: Radim KrÄmÃÅ <rkrcmar@xxxxxxxxxx>
> ---
> I'm not very fond of that smp_rmb(): there is no real synchronization
> against update_handled_vectors(),

Yes, because the guest OS should provide synchronization (it should
shutdown interrupts before attempting to modify IOAPIC table).

The smp_wmb is necessary.

> so the only point I see is to drop
> cached value of handled_vectors, which seems like bad use of LFENCE.

test_bit has volatile on *addr, so don't see why the smp_rmb is
necessary at all.

Applied, thanks.

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