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 v2 1/6] jailhouse: Provide detection for non-x86 systems
Date: Wed, 28 Feb 2018 07:34:46 +0100 [thread overview]
Message-ID: <558f5cbae432ae029e2d8ee9b0ef44d837318625.1519799691.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1519799691.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1519799691.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
next prev parent reply other threads:[~2018-02-28 6:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 6:34 [PATCH v2 0/6] jailhouse: Enhance secondary Jailhouse guest support /wrt PCI Jan Kiszka
2018-02-28 6:34 ` Jan Kiszka [this message]
2018-02-28 6:34 ` [PATCH v2 2/6] PCI: Scan all functions when running over Jailhouse Jan Kiszka
2018-02-28 8:44 ` Thomas Gleixner
2018-02-28 10:01 ` Jan Kiszka
2018-02-28 6:34 ` [PATCH v2 3/6] x86/jailhouse: Enable PCI mmconfig access in inmates Jan Kiszka
2018-02-28 6:34 ` [PATCH v2 4/6] x86: Consolidate PCI_MMCONFIG configs Jan Kiszka
2018-02-28 15:45 ` Andy Shevchenko
2018-02-28 18:22 ` Bjorn Helgaas
2018-02-28 6:34 ` [PATCH v2 5/6] x86/jailhouse: Allow to use PCI_MMCONFIG without ACPI Jan Kiszka
2018-02-28 6:34 ` [PATCH v2 6/6] MAINTAINERS: Add entry for Jailhouse 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=558f5cbae432ae029e2d8ee9b0ef44d837318625.1519799691.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).