[PATCH 0/4] KVM: cleanups around memory barriers and irqchip_in_kernel

From: Paolo Bonzini
Date: Wed Jul 29 2015 - 09:29:57 EST


I took a look at memory barriers in KVM and there are a few that are
unjustified, underdocumented or wrong. While looking at irqchip_in_kernel
uses (to understand the memory barriers) I also noticed one case where it
is unnecessary to check for irqchip_in_kernel (patch 3).

Most of the users of irqchip_in_kernel do not need the barrier and they
could check vcpu->arch.apic instead of vcpu->kvm->arch.pic. I plan to
change that by introducing lapic_in_kernel(struct kvm_vcpu *), after
the split irqchip patches are in which will make irqchip_in_kernel more
expensive.

Paolo

Paolo Bonzini (4):
KVM: x86: remove unnecessary memory barriers for shared MSRs
KVM: document memory barriers for kvm->vcpus/kvm->online_vcpus
KVM: i8254: remove unnecessary irqchip_in_kernel check
KVM: x86: clean/fix memory barriers in irqchip_in_kernel

arch/x86/kvm/i8254.c | 2 +-
arch/x86/kvm/i8259.c | 15 +++++----------
arch/x86/kvm/irq.h | 8 ++++----
arch/x86/kvm/x86.c | 21 +++++++--------------
include/linux/kvm_host.h | 4 ++++
virt/kvm/kvm_main.c | 2 ++
6 files changed, 23 insertions(+), 29 deletions(-)

--
1.8.3.1

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