All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	x86@kernel.org, Peter Anvin <hpa@zytor.com>,
	Borislav Petkov <bp@alien8.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>,
	Andi Kleen <ak@linux.intel.com>
Subject: [patch 6/7] x86/pci/mmcfg: Include 32/64 bit code into shared code
Date: Thu, 16 Mar 2017 22:50:08 +0100	[thread overview]
Message-ID: <20170316215057.374990930@linutronix.de> (raw)
In-Reply-To: 20170316215002.726697858@linutronix.de

[-- Attachment #1: x86-pci-mmcfg--Include-32-64-bit-code-into-shared-code.patch --]
[-- Type: text/plain, Size: 2936 bytes --]

Preparatory patch so the shared mmconfig code can access static functions
in the 32/64bit specific mmconfig implementations.

This is useful for the upcoming implementation of mmconfig based (ECAM) PCI
configuration space access for both the legacy part (0-0xff) and the
extended part (0x100-0xfff). Being able to access the low level mmconfig
read/write functions directly avoids extra indirections.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/pci/Makefile          |    2 +-
 arch/x86/pci/mmconfig-shared.c |    6 ++++++
 arch/x86/pci/mmconfig_32.c     |   12 ++----------
 arch/x86/pci/mmconfig_64.c     |   16 ++++------------
 4 files changed, 13 insertions(+), 23 deletions(-)

--- a/arch/x86/pci/Makefile
+++ b/arch/x86/pci/Makefile
@@ -1,7 +1,7 @@
 obj-y				:= i386.o init.o
 
 obj-$(CONFIG_PCI_BIOS)		+= pcbios.o
-obj-$(CONFIG_PCI_MMCONFIG)	+= mmconfig_$(BITS).o direct.o mmconfig-shared.o
+obj-$(CONFIG_PCI_MMCONFIG)	+= direct.o mmconfig-shared.o
 obj-$(CONFIG_PCI_DIRECT)	+= direct.o
 obj-$(CONFIG_PCI_OLPC)		+= olpc.o
 obj-$(CONFIG_PCI_XEN)		+= xen.o
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -24,6 +24,12 @@
 
 #define PREFIX "PCI: "
 
+#ifdef CONFIG_X86_64
+# include "mmconfig_64.c"
+#else
+# include "mmconfig_32.c"
+#endif
+
 /* Indicate if the mmcfg resources have been placed into the resource table. */
 static bool pci_mmcfg_running_state;
 static bool pci_mmcfg_arch_init_failed;
--- a/arch/x86/pci/mmconfig_32.c
+++ b/arch/x86/pci/mmconfig_32.c
@@ -3,18 +3,10 @@
  * Copyright (C) 2004 Intel Corp.
  *
  * This code is released under the GNU General Public License version 2.
+ *
+ * Low-level direct PCI config space access via MMCONFIG, 32bit version.
  */
 
-/*
- * mmconfig.c - Low-level direct PCI config space access via MMCONFIG
- */
-
-#include <linux/pci.h>
-#include <linux/init.h>
-#include <linux/rcupdate.h>
-#include <asm/e820.h>
-#include <asm/pci_x86.h>
-
 /* Assume systems with more busses have correct MCFG */
 #define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG))
 
--- a/arch/x86/pci/mmconfig_64.c
+++ b/arch/x86/pci/mmconfig_64.c
@@ -1,20 +1,12 @@
 /*
- * mmconfig.c - Low-level direct PCI config space access via MMCONFIG
+ * Low-level direct PCI config space access via MMCONFIG
  *
  * This is an 64bit optimized version that always keeps the full mmconfig
  * space mapped. This allows lockless config space operation.
+ *
+ * This file is included into the 32/64bit shared code so the read/write
+ * accessors are directly reachable there.
  */
-
-#include <linux/pci.h>
-#include <linux/init.h>
-#include <linux/acpi.h>
-#include <linux/bitmap.h>
-#include <linux/rcupdate.h>
-#include <asm/e820.h>
-#include <asm/pci_x86.h>
-
-#define PREFIX "PCI: "
-
 static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
 {
 	struct pci_mmcfg_region *cfg = pci_mmconfig_lookup(seg, bus);

  parent reply	other threads:[~2017-03-16 23:11 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 21:50 [patch 0/7] x86/pci: Switch to lockless ECAM configuration mode Thomas Gleixner
2017-03-16 21:50 ` [patch 1/7] x86/pci: Remove duplicate defines Thomas Gleixner
2017-06-27 20:57   ` Bjorn Helgaas
2017-06-28 20:43   ` [tip:x86/platform] x86/PCI: " tip-bot for Thomas Gleixner
2017-03-16 21:50 ` [patch 2/7] x86/pci: Abort if legacy init fails Thomas Gleixner
2017-06-27 20:59   ` Bjorn Helgaas
2017-06-28 20:44   ` [tip:x86/platform] x86/PCI: " tip-bot for Thomas Gleixner
2017-03-16 21:50 ` [patch 3/7] x86/pci/ce4100: Properly lock accessor functions Thomas Gleixner
2017-03-17  0:28   ` Andi Kleen
2017-06-27 21:00   ` Bjorn Helgaas
2017-06-28 20:44   ` [tip:x86/platform] x86/PCI/ce4100: " tip-bot for Thomas Gleixner
2017-03-16 21:50 ` [patch 4/7] PCI: Provide Kconfig option for lockless config space accessors Thomas Gleixner
2017-06-27 21:11   ` Bjorn Helgaas
2017-06-28 20:31     ` Thomas Gleixner
2017-06-28 20:45   ` [tip:x86/platform] " tip-bot for Thomas Gleixner
2017-03-16 21:50 ` [patch 5/7] x86/pci: Select CONFIG_PCI_LOCKLESS_CONFIG Thomas Gleixner
2017-06-28 20:45   ` [tip:x86/platform] x86/PCI: " tip-bot for Thomas Gleixner
2017-03-16 21:50 ` Thomas Gleixner [this message]
2017-03-17  0:25   ` [patch 6/7] x86/pci/mmcfg: Include 32/64 bit code into shared code Andi Kleen
2017-03-17  8:41     ` Thomas Gleixner
2017-03-16 21:50 ` [patch 7/7] x86/pci/mmcfg: Switch to ECAM config mode if possible Thomas Gleixner
2017-03-17  0:26   ` Andi Kleen
2017-03-17  6:15     ` Thomas Gleixner
2017-06-27 21:31       ` Bjorn Helgaas
2017-06-28 20:46   ` [tip:x86/platform] x86/PCI/mmcfg: " tip-bot for Thomas Gleixner
2017-06-29  6:45   ` tip-bot for Thomas Gleixner
2017-06-29 23:26     ` Yinghai Lu
2017-06-30  3:18       ` Andi Kleen
2017-06-30 14:30         ` Thomas Gleixner
2017-06-30 17:16           ` Linus Torvalds
2017-06-30 18:30             ` Ivan Kokshaysky
2017-06-30 18:46             ` Thomas Gleixner
2017-06-13  0:25 ` [patch 0/7] x86/pci: Switch to lockless ECAM configuration mode Andi Kleen
2017-06-21 22:28   ` Thomas Gleixner
2017-06-27 20:55     ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170316215057.374990930@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --cc=helgaas@kernel.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.