From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752361AbdF1Uc2 (ORCPT ); Wed, 28 Jun 2017 16:32:28 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53561 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751652AbdF1UcU (ORCPT ); Wed, 28 Jun 2017 16:32:20 -0400 Date: Wed, 28 Jun 2017 22:31:20 +0200 (CEST) From: Thomas Gleixner To: Bjorn Helgaas cc: LKML , x86@kernel.org, Peter Anvin , Borislav Petkov , Peter Zijlstra , Stephane Eranian , Andi Kleen , linux-pci@vger.kernel.org Subject: Re: [patch 4/7] PCI: Provide Kconfig option for lockless config space accessors In-Reply-To: <20170627211152.GE764@bhelgaas-glaptop.roam.corp.google.com> Message-ID: References: <20170316215002.726697858@linutronix.de> <20170316215057.205961140@linutronix.de> <20170627211152.GE764@bhelgaas-glaptop.roam.corp.google.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Jun 2017, Bjorn Helgaas wrote: > On Thu, Mar 16, 2017 at 10:50:06PM +0100, Thomas Gleixner wrote: > > Provide a kernel config option which can be selected by an architecture > > when the low level PCI configuration space accessors in the architecture > > use their own serialization or can operate completely lockless. > > The arch/x86/pci/common.c comment: > > /* > * This interrupt-safe spinlock protects all accesses to PCI > * configuration space. > */ > DEFINE_RAW_SPINLOCK(pci_config_lock); > > is no longer quite correct. Yes. I updated it to: * This interrupt-safe spinlock protects all accesses to PCI configuration * space, except for the mmconfig (ECAM) based operations. > I think the raw_pci_read() and raw_pci_write() implementations are > such that we use the old locked accessors for the first 256 bytes, > even when ECAM is available. Not necessarily a problem, just an > observation. No, we actually don't after the next patch, which replaces the pci_root_ops.read/write function pointers with the lockless ECAM accessors after the end of the initialization, if none of the special quirks replaced raw_pci_ext_ops and mmconfig/ECAM is available. > I guess the uncore PMU registers are in the extended config space. Yes. Thanks, tglx