From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753192AbbG2N3H (ORCPT ); Wed, 29 Jul 2015 09:29:07 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:34171 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750839AbbG2N3F (ORCPT ); Wed, 29 Jul 2015 09:29:05 -0400 From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: mtosatti@redhat.com, srutherford@google.com, rkrcmar@redhat.com Subject: [PATCH 0/4] KVM: cleanups around memory barriers and irqchip_in_kernel Date: Wed, 29 Jul 2015 15:28:54 +0200 Message-Id: <1438176538-26191-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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