paravirt: add a hook for once the allocator is ready
Add a hook so that the paravirt backend knows when the allocator is ready. This is useful for the obvious reason that the allocator is available, but the other side-effect of having the bootmem allocator available is that each page now has an associated "struct page". Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
This commit is contained in:
parent
fdb4c338c8
commit
6996d3b63f
|
@ -601,6 +601,8 @@ void __init setup_arch(char **cmdline_p)
|
||||||
* NOTE: at this point the bootmem allocator is fully available.
|
* NOTE: at this point the bootmem allocator is fully available.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
paravirt_post_allocator_init();
|
||||||
|
|
||||||
dmi_scan_machine();
|
dmi_scan_machine();
|
||||||
|
|
||||||
#ifdef CONFIG_X86_GENERICARCH
|
#ifdef CONFIG_X86_GENERICARCH
|
||||||
|
|
|
@ -52,6 +52,8 @@ struct paravirt_ops
|
||||||
/* Basic arch-specific setup */
|
/* Basic arch-specific setup */
|
||||||
void (*arch_setup)(void);
|
void (*arch_setup)(void);
|
||||||
char *(*memory_setup)(void);
|
char *(*memory_setup)(void);
|
||||||
|
void (*post_allocator_init)(void);
|
||||||
|
|
||||||
void (*init_IRQ)(void);
|
void (*init_IRQ)(void);
|
||||||
void (*time_init)(void);
|
void (*time_init)(void);
|
||||||
|
|
||||||
|
@ -669,6 +671,12 @@ static inline void setup_secondary_clock(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static inline void paravirt_post_allocator_init(void)
|
||||||
|
{
|
||||||
|
if (paravirt_ops.post_allocator_init)
|
||||||
|
(*paravirt_ops.post_allocator_init)();
|
||||||
|
}
|
||||||
|
|
||||||
static inline void paravirt_pagetable_setup_start(pgd_t *base)
|
static inline void paravirt_pagetable_setup_start(pgd_t *base)
|
||||||
{
|
{
|
||||||
if (paravirt_ops.pagetable_setup_start)
|
if (paravirt_ops.pagetable_setup_start)
|
||||||
|
|
|
@ -81,6 +81,10 @@ void __init add_memory_region(unsigned long long start,
|
||||||
|
|
||||||
extern unsigned long init_pg_tables_end;
|
extern unsigned long init_pg_tables_end;
|
||||||
|
|
||||||
|
#ifndef CONFIG_PARAVIRT
|
||||||
|
#define paravirt_post_allocator_init() do {} while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
#endif /* __KERNEL__ */
|
||||||
|
|
Loading…
Reference in New Issue