machine_specific_memory_setup(raw);
- if ( pv_shim )
- pv_shim_fixup_e820(&e820);
+ if ( cpu_has_hypervisor )
+ hypervisor_e820_fixup(&e820);
printk("%s RAM map:\n", str);
print_e820_memory_map(e820.map, e820.nr_map);
pv_console_init();
}
+static void __init e820_fixup(struct e820map *e820)
+{
+ if ( pv_shim )
+ pv_shim_fixup_e820(e820);
+}
+
static const struct hypervisor_ops ops = {
.name = "Xen",
.setup = setup,
.ap_setup = ap_setup,
.resume = resume,
+ .e820_fixup = e820_fixup,
};
const struct hypervisor_ops *__init xg_probe(void)
#ifndef __X86_HYPERVISOR_H__
#define __X86_HYPERVISOR_H__
+#include <asm/e820.h>
+
struct hypervisor_ops {
/* Name of the hypervisor */
const char *name;
int (*ap_setup)(void);
/* Resume from suspension */
void (*resume)(void);
+ /* Fix up e820 map */
+ void (*e820_fixup)(struct e820map *e820);
};
#ifdef CONFIG_GUEST
void hypervisor_setup(void);
int hypervisor_ap_setup(void);
void hypervisor_resume(void);
+void hypervisor_e820_fixup(struct e820map *e820);
#else
static inline void hypervisor_setup(void) { ASSERT_UNREACHABLE(); }
static inline int hypervisor_ap_setup(void) { return 0; }
static inline void hypervisor_resume(void) { ASSERT_UNREACHABLE(); }
+static inline void hypervisor_e820_fixup(struct e820map *e820) {}
#endif /* CONFIG_GUEST */