blob: fc08b433c856d38cb374398da7078e305fc85564 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Juergen Gross47ae4b02016-08-29 08:48:43 +02002#ifndef __LINUX_HYPEVISOR_H
3#define __LINUX_HYPEVISOR_H
4
5/*
6 * Generic Hypervisor support
7 * Juergen Gross <jgross@suse.com>
8 */
9
Juergen Grossf72e38e2017-11-09 14:27:35 +010010#ifdef CONFIG_X86
Jan Kiszka63338a32018-03-07 08:39:12 +010011
12#include <asm/jailhouse_para.h>
Juergen Grossf72e38e2017-11-09 14:27:35 +010013#include <asm/x86_init.h>
Jan Kiszka63338a32018-03-07 08:39:12 +010014
Juergen Grossf72e38e2017-11-09 14:27:35 +010015static inline void hypervisor_pin_vcpu(int cpu)
16{
17 x86_platform.hyper.pin_vcpu(cpu);
18}
Jan Kiszka63338a32018-03-07 08:39:12 +010019
20#else /* !CONFIG_X86 */
21
22#include <linux/of.h>
23
Juergen Gross47ae4b02016-08-29 08:48:43 +020024static inline void hypervisor_pin_vcpu(int cpu)
25{
26}
Jan Kiszka63338a32018-03-07 08:39:12 +010027
28static inline bool jailhouse_paravirt(void)
29{
30 return of_find_compatible_node(NULL, NULL, "jailhouse,cell");
31}
32
33#endif /* !CONFIG_X86 */
Juergen Gross47ae4b02016-08-29 08:48:43 +020034
35#endif /* __LINUX_HYPEVISOR_H */