Skip to content

Commit

Permalink
jailhouse: Provide detection for non-x86 systems
Browse files Browse the repository at this point in the history
Implement jailhouse_paravirt() via device tree probing on architectures
!= x86. Will be used by the PCI core.

Signed-off-by: Jan Kiszka <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Juergen Gross <[email protected]>
Cc: [email protected]
Cc: Mark Rutland <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Andy Shevchenko <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Link: https://lkml.kernel.org/r/dae9fe0c6e63141c28ca90492fa5712b4c33ffb5.1520408357.git.jan.kiszka@siemens.com
  • Loading branch information
jan-kiszka authored and KAGA-KOKO committed Mar 8, 2018
1 parent 0a5169a commit 63338a3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Documentation/devicetree/bindings/jailhouse.txt
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion arch/x86/include/asm/jailhouse_para.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL2.0 */

/*
* Jailhouse paravirt_ops implementation
* Jailhouse paravirt detection
*
* Copyright (c) Siemens AG, 2015-2017
*
Expand Down
17 changes: 15 additions & 2 deletions include/linux/hypervisor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 63338a3

Please sign in to comment.