public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Otavio Pontes <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: bhelgaas@google.com, andy.shevchenko@gmail.com, mingo@kernel.org,
	hpa@zytor.com, otavio.pontes@intel.com, jan.kiszka@siemens.com,
	linux-kernel@vger.kernel.org, tglx@linutronix.de
Subject: [tip:x86/platform] x86/jailhouse: Enable PCI mmconfig access in inmates
Date: Thu, 8 Mar 2018 03:35:01 -0800	[thread overview]
Message-ID: <tip-6fa4a94e150be25d02547d51f03b4bc34aaec32f@git.kernel.org> (raw)
In-Reply-To: <2ee9e4401fa22377b3965893a558120f169be82b.1520408357.git.jan.kiszka@siemens.com>

Commit-ID:  6fa4a94e150be25d02547d51f03b4bc34aaec32f
Gitweb:     https://git.kernel.org/tip/6fa4a94e150be25d02547d51f03b4bc34aaec32f
Author:     Otavio Pontes <otavio.pontes@intel.com>
AuthorDate: Wed, 7 Mar 2018 08:39:14 +0100
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 8 Mar 2018 12:30:38 +0100

x86/jailhouse: Enable PCI mmconfig access in inmates

Use the PCI mmconfig base address exported by jailhouse in boot parameters
in order to access the memory mapped PCI configuration space.

[Jan: rebased, fixed !CONFIG_PCI_MMCONFIG, used pcibios_last_bus]

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: jailhouse-dev@googlegroups.com
Cc: linux-pci@vger.kernel.org
Cc: virtualization@lists.linux-foundation.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lkml.kernel.org/r/2ee9e4401fa22377b3965893a558120f169be82b.1520408357.git.jan.kiszka@siemens.com

---
 arch/x86/include/asm/pci_x86.h | 2 ++
 arch/x86/kernel/jailhouse.c    | 8 ++++++++
 arch/x86/pci/mmconfig-shared.c | 4 ++--
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
index eb66fa9cd0fc..959d618dbb17 100644
--- a/arch/x86/include/asm/pci_x86.h
+++ b/arch/x86/include/asm/pci_x86.h
@@ -151,6 +151,8 @@ extern int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end,
 			       phys_addr_t addr);
 extern int pci_mmconfig_delete(u16 seg, u8 start, u8 end);
 extern struct pci_mmcfg_region *pci_mmconfig_lookup(int segment, int bus);
+extern struct pci_mmcfg_region *__init pci_mmconfig_add(int segment, int start,
+							int end, u64 addr);
 
 extern struct list_head pci_mmcfg_list;
 
diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c
index b68fd895235a..fa183a131edc 100644
--- a/arch/x86/kernel/jailhouse.c
+++ b/arch/x86/kernel/jailhouse.c
@@ -124,6 +124,14 @@ static int __init jailhouse_pci_arch_init(void)
 	if (pcibios_last_bus < 0)
 		pcibios_last_bus = 0xff;
 
+#ifdef CONFIG_PCI_MMCONFIG
+	if (setup_data.pci_mmconfig_base) {
+		pci_mmconfig_add(0, 0, pcibios_last_bus,
+				 setup_data.pci_mmconfig_base);
+		pci_mmcfg_arch_init();
+	}
+#endif
+
 	return 0;
 }
 
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index 0b40482578b8..7389db538c30 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -94,8 +94,8 @@ static struct pci_mmcfg_region *pci_mmconfig_alloc(int segment, int start,
 	return new;
 }
 
-static struct pci_mmcfg_region *__init pci_mmconfig_add(int segment, int start,
-							int end, u64 addr)
+struct pci_mmcfg_region *__init pci_mmconfig_add(int segment, int start,
+						 int end, u64 addr)
 {
 	struct pci_mmcfg_region *new;
 

  reply	other threads:[~2018-03-08 11:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07  7:39 [PATCH v5 0/7] jailhouse: Enhance secondary Jailhouse guest support /wrt PCI Jan Kiszka
2018-03-07  7:39 ` [PATCH v5 1/7] jailhouse: Provide detection for non-x86 systems Jan Kiszka
2018-03-08 11:33   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2018-03-07  7:39 ` [PATCH v5 2/7] PCI: Scan all functions when running over Jailhouse Jan Kiszka
2018-03-08 11:34   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2018-03-07  7:39 ` [PATCH v5 3/7] x86/jailhouse: Enable PCI mmconfig access in inmates Jan Kiszka
2018-03-08 11:35   ` tip-bot for Otavio Pontes [this message]
2018-03-07  7:39 ` [PATCH v5 4/7] x86: Align x86_64 PCI_MMCONFIG with 32-bit variant Jan Kiszka
2018-03-08 11:35   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2018-03-07  7:39 ` [PATCH v5 5/7] x86: Consolidate PCI_MMCONFIG configs Jan Kiszka
2018-03-08 11:36   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2018-03-07  7:39 ` [PATCH v5 6/7] x86/jailhouse: Allow to use PCI_MMCONFIG without ACPI Jan Kiszka
2018-03-08 11:36   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2018-03-07  7:39 ` [PATCH v5 7/7] MAINTAINERS: Add entry for Jailhouse Jan Kiszka
2018-03-08 11:36   ` [tip:x86/platform] " tip-bot for Jan Kiszka
2018-03-19 19:48 ` [PATCH v5 0/7] jailhouse: Enhance secondary Jailhouse guest support /wrt PCI Bjorn Helgaas
2018-03-19 19:50   ` Thomas Gleixner

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=tip-6fa4a94e150be25d02547d51f03b4bc34aaec32f@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=hpa@zytor.com \
    --cc=jan.kiszka@siemens.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=otavio.pontes@intel.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox