diff options
-rw-r--r-- | arch/x86/xen/setup.c | 23 | ||||
-rw-r--r-- | arch/x86/xen/xen-ops.h | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 87251b4c2e30..99ef82cc4edc 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -573,6 +573,29 @@ static unsigned long __init xen_count_remap_pages(unsigned long max_pfn) | |||
573 | return extra; | 573 | return extra; |
574 | } | 574 | } |
575 | 575 | ||
576 | bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size) | ||
577 | { | ||
578 | struct e820entry *entry; | ||
579 | unsigned mapcnt; | ||
580 | phys_addr_t end; | ||
581 | |||
582 | if (!size) | ||
583 | return false; | ||
584 | |||
585 | end = start + size; | ||
586 | entry = xen_e820_map; | ||
587 | |||
588 | for (mapcnt = 0; mapcnt < xen_e820_map_entries; mapcnt++) { | ||
589 | if (entry->type == E820_RAM && entry->addr <= start && | ||
590 | (entry->addr + entry->size) >= end) | ||
591 | return false; | ||
592 | |||
593 | entry++; | ||
594 | } | ||
595 | |||
596 | return true; | ||
597 | } | ||
598 | |||
576 | /* | 599 | /* |
577 | * Reserve Xen mfn_list. | 600 | * Reserve Xen mfn_list. |
578 | * See comment above "struct start_info" in <xen/interface/xen.h> | 601 | * See comment above "struct start_info" in <xen/interface/xen.h> |
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 2292721b1d10..a4cbb76642d8 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h | |||
@@ -39,6 +39,7 @@ void xen_reserve_top(void); | |||
39 | void xen_mm_pin_all(void); | 39 | void xen_mm_pin_all(void); |
40 | void xen_mm_unpin_all(void); | 40 | void xen_mm_unpin_all(void); |
41 | 41 | ||
42 | bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size); | ||
42 | unsigned long __ref xen_chk_extra_mem(unsigned long pfn); | 43 | unsigned long __ref xen_chk_extra_mem(unsigned long pfn); |
43 | void __init xen_inv_extra_mem(void); | 44 | void __init xen_inv_extra_mem(void); |
44 | void __init xen_remap_memory(void); | 45 | void __init xen_remap_memory(void); |