All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	Bjorn Helgaas <bhelgaas@google.com>
Cc: x86@kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	jailhouse-dev@googlegroups.com, linux-pci@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>
Subject: [PATCH 1/6] jailhouse: Provide detection for non-x86 systems
Date: Mon, 22 Jan 2018 07:12:45 +0100	[thread overview]
Message-ID: <5541843651e0232ac90f347f638e486d2ddda237.1516601570.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1516601570.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1516601570.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

Implement jailhouse_paravirt() via device tree probing on architectures
!= x86. Will be used by the PCI core.

CC: Rob Herring <robh+dt@kernel.org>
CC: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 Documentation/devicetree/bindings/jailhouse.txt |  8 ++++++++
 arch/x86/include/asm/jailhouse_para.h           |  2 +-
 include/linux/hypervisor.h                      | 17 +++++++++++++++--
 3 files changed, 24 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/jailhouse.txt

diff --git a/Documentation/devicetree/bindings/jailhouse.txt b/Documentation/devicetree/bindings/jailhouse.txt
new file mode 100644
index 000000000000..2901c25ff340
--- /dev/null
+++ b/Documentation/devicetree/bindings/jailhouse.txt
@@ -0,0 +1,8 @@
+Jailhouse non-root cell device tree bindings
+--------------------------------------------
+
+When running in a non-root Jailhouse cell (partition), the device tree of this
+platform shall have a top-level "hypervisor" node with the following
+properties:
+
+- compatible = "jailhouse,cell"
diff --git a/arch/x86/include/asm/jailhouse_para.h b/arch/x86/include/asm/jailhouse_para.h
index 875b54376689..b885a961a150 100644
--- a/arch/x86/include/asm/jailhouse_para.h
+++ b/arch/x86/include/asm/jailhouse_para.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL2.0 */
 
 /*
- * Jailhouse paravirt_ops implementation
+ * Jailhouse paravirt detection
  *
  * Copyright (c) Siemens AG, 2015-2017
  *
diff --git a/include/linux/hypervisor.h b/include/linux/hypervisor.h
index b19563f9a8eb..fc08b433c856 100644
--- a/include/linux/hypervisor.h
+++ b/include/linux/hypervisor.h
@@ -8,15 +8,28 @@
  */
 
 #ifdef CONFIG_X86
+
+#include <asm/jailhouse_para.h>
 #include <asm/x86_init.h>
+
 static inline void hypervisor_pin_vcpu(int cpu)
 {
 	x86_platform.hyper.pin_vcpu(cpu);
 }
-#else
+
+#else /* !CONFIG_X86 */
+
+#include <linux/of.h>
+
 static inline void hypervisor_pin_vcpu(int cpu)
 {
 }
-#endif
+
+static inline bool jailhouse_paravirt(void)
+{
+	return of_find_compatible_node(NULL, NULL, "jailhouse,cell");
+}
+
+#endif /* !CONFIG_X86 */
 
 #endif /* __LINUX_HYPEVISOR_H */
-- 
2.13.6

  parent reply	other threads:[~2018-01-22  6:13 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22  6:12 [PATCH 0/6] jailhouse: Enhance secondary Jailhouse guest support /wrt PCI Jan Kiszka
2018-01-22  6:12 ` [PATCH 1/6] jailhouse: Provide detection for non-x86 systems Jan Kiszka
2018-01-22  6:12 ` Jan Kiszka [this message]
2018-01-22  6:12 ` [PATCH 2/6] pci: Scan all functions when probing while running over Jailhouse Jan Kiszka
2018-02-22 20:57   ` Bjorn Helgaas
2018-02-27  7:25     ` Jan Kiszka
2018-02-27  7:25     ` Jan Kiszka
2018-02-23 13:23   ` Andy Shevchenko
2018-02-23 13:23   ` Andy Shevchenko
2018-02-27  7:22     ` Jan Kiszka
2018-02-27  7:22     ` Jan Kiszka
2018-02-27 15:48       ` Andy Shevchenko
2018-02-27 15:48       ` Andy Shevchenko
2018-01-22  6:12 ` Jan Kiszka
2018-01-22  6:12 ` [PATCH 3/6] x86/jailhouse: Enable PCI mmconfig access in inmates Jan Kiszka
2018-01-22  6:12 ` Jan Kiszka
2018-01-22  6:12 ` [PATCH 4/6] x86: Consolidate PCI_MMCONFIG configs Jan Kiszka
2018-01-28 17:26   ` Andy Shevchenko
2018-01-28 17:26   ` Andy Shevchenko
2018-02-27  7:19     ` Jan Kiszka
2018-02-27  7:19     ` Jan Kiszka
2018-02-27 15:47       ` Andy Shevchenko
2018-02-27 15:47       ` Andy Shevchenko
2018-01-22  6:12 ` Jan Kiszka
2018-01-22  6:12 ` [PATCH 5/6] x86/jailhouse: Allow to use PCI_MMCONFIG without ACPI Jan Kiszka
2018-01-22  6:12 ` Jan Kiszka
2018-01-22  6:12 ` [PATCH 6/6] MAINTAINERS: Add entry for Jailhouse Jan Kiszka
2018-01-22  6:12 ` Jan Kiszka

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=5541843651e0232ac90f347f638e486d2ddda237.1516601570.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=bhelgaas@google.com \
    --cc=hpa@zytor.com \
    --cc=jailhouse-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=virtualization@lists.linux-foundation.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.