summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/hypervisor.h
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2017-07-28 12:23:12 +0200
committerJuergen Gross <jgross@suse.com>2017-08-11 15:50:21 +0200
commitc138d81163d82db044dcaf1141395713f03bf0bf (patch)
tree281e040d7a5356799293187c930ec14ac12fc418 /arch/x86/include/asm/hypervisor.h
parentxen: dont fiddle with event channel masking in suspend/resume (diff)
downloadlinux-c138d81163d82db044dcaf1141395713f03bf0bf.tar.xz
linux-c138d81163d82db044dcaf1141395713f03bf0bf.zip
x86: provide an init_mem_mapping hypervisor hook
Provide a hook in hypervisor_x86 called after setting up initial memory mapping. This is needed e.g. by Xen HVM guests to map the hypervisor shared info page. Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Acked-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'arch/x86/include/asm/hypervisor.h')
-rw-r--r--arch/x86/include/asm/hypervisor.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
index 21126155a739..0ead9dbb9130 100644
--- a/arch/x86/include/asm/hypervisor.h
+++ b/arch/x86/include/asm/hypervisor.h
@@ -43,6 +43,9 @@ struct hypervisor_x86 {
/* pin current vcpu to specified physical cpu (run rarely) */
void (*pin_vcpu)(int);
+
+ /* called during init_mem_mapping() to setup early mappings. */
+ void (*init_mem_mapping)(void);
};
extern const struct hypervisor_x86 *x86_hyper;
@@ -57,8 +60,15 @@ extern const struct hypervisor_x86 x86_hyper_kvm;
extern void init_hypervisor_platform(void);
extern bool hypervisor_x2apic_available(void);
extern void hypervisor_pin_vcpu(int cpu);
+
+static inline void hypervisor_init_mem_mapping(void)
+{
+ if (x86_hyper && x86_hyper->init_mem_mapping)
+ x86_hyper->init_mem_mapping();
+}
#else
static inline void init_hypervisor_platform(void) { }
static inline bool hypervisor_x2apic_available(void) { return false; }
+static inline void hypervisor_init_mem_mapping(void) { }
#endif /* CONFIG_HYPERVISOR_GUEST */
#endif /* _ASM_X86_HYPERVISOR_H */