diff options
-rw-r--r-- | arch/x86/kernel/setup.c | 14 | ||||
-rw-r--r-- | drivers/firmware/iscsi_ibft_find.c | 11 | ||||
-rw-r--r-- | include/linux/iscsi_ibft.h | 8 |
3 files changed, 26 insertions, 7 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index d76e18570c60..580e6b3dbdb8 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -608,6 +608,16 @@ static int __init setup_elfcorehdr(char *arg) | |||
608 | early_param("elfcorehdr", setup_elfcorehdr); | 608 | early_param("elfcorehdr", setup_elfcorehdr); |
609 | #endif | 609 | #endif |
610 | 610 | ||
611 | static __init void reserve_ibft_region(void) | ||
612 | { | ||
613 | unsigned long addr, size = 0; | ||
614 | |||
615 | addr = find_ibft_region(&size); | ||
616 | |||
617 | if (size) | ||
618 | reserve_early_overlap_ok(addr, addr + size, "ibft"); | ||
619 | } | ||
620 | |||
611 | #ifdef CONFIG_X86_RESERVE_LOW_64K | 621 | #ifdef CONFIG_X86_RESERVE_LOW_64K |
612 | static int __init dmi_low_memory_corruption(const struct dmi_system_id *d) | 622 | static int __init dmi_low_memory_corruption(const struct dmi_system_id *d) |
613 | { | 623 | { |
@@ -910,6 +920,8 @@ void __init setup_arch(char **cmdline_p) | |||
910 | */ | 920 | */ |
911 | find_smp_config(); | 921 | find_smp_config(); |
912 | 922 | ||
923 | reserve_ibft_region(); | ||
924 | |||
913 | reserve_trampoline_memory(); | 925 | reserve_trampoline_memory(); |
914 | 926 | ||
915 | #ifdef CONFIG_ACPI_SLEEP | 927 | #ifdef CONFIG_ACPI_SLEEP |
@@ -977,8 +989,6 @@ void __init setup_arch(char **cmdline_p) | |||
977 | 989 | ||
978 | dma32_reserve_bootmem(); | 990 | dma32_reserve_bootmem(); |
979 | 991 | ||
980 | reserve_ibft_region(); | ||
981 | |||
982 | #ifdef CONFIG_KVM_CLOCK | 992 | #ifdef CONFIG_KVM_CLOCK |
983 | kvmclock_init(); | 993 | kvmclock_init(); |
984 | #endif | 994 | #endif |
diff --git a/drivers/firmware/iscsi_ibft_find.c b/drivers/firmware/iscsi_ibft_find.c index dfb15c06c88f..8f5d9e258829 100644 --- a/drivers/firmware/iscsi_ibft_find.c +++ b/drivers/firmware/iscsi_ibft_find.c | |||
@@ -52,7 +52,7 @@ EXPORT_SYMBOL_GPL(ibft_addr); | |||
52 | * Routine used to find the iSCSI Boot Format Table. The logical | 52 | * Routine used to find the iSCSI Boot Format Table. The logical |
53 | * kernel address is set in the ibft_addr global variable. | 53 | * kernel address is set in the ibft_addr global variable. |
54 | */ | 54 | */ |
55 | void __init reserve_ibft_region(void) | 55 | unsigned long __init find_ibft_region(unsigned long *sizep) |
56 | { | 56 | { |
57 | unsigned long pos; | 57 | unsigned long pos; |
58 | unsigned int len = 0; | 58 | unsigned int len = 0; |
@@ -78,6 +78,11 @@ void __init reserve_ibft_region(void) | |||
78 | } | 78 | } |
79 | } | 79 | } |
80 | } | 80 | } |
81 | if (ibft_addr) | 81 | if (ibft_addr) { |
82 | reserve_bootmem(pos, PAGE_ALIGN(len), BOOTMEM_DEFAULT); | 82 | *sizep = PAGE_ALIGN(len); |
83 | return pos; | ||
84 | } | ||
85 | |||
86 | *sizep = 0; | ||
87 | return 0; | ||
83 | } | 88 | } |
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h index 6092487e2950..d2e4042f8f5e 100644 --- a/include/linux/iscsi_ibft.h +++ b/include/linux/iscsi_ibft.h | |||
@@ -42,9 +42,13 @@ extern struct ibft_table_header *ibft_addr; | |||
42 | * mapped address is set in the ibft_addr variable. | 42 | * mapped address is set in the ibft_addr variable. |
43 | */ | 43 | */ |
44 | #ifdef CONFIG_ISCSI_IBFT_FIND | 44 | #ifdef CONFIG_ISCSI_IBFT_FIND |
45 | extern void __init reserve_ibft_region(void); | 45 | unsigned long find_ibft_region(unsigned long *sizep); |
46 | #else | 46 | #else |
47 | static inline void reserve_ibft_region(void) { } | 47 | static inline unsigned long find_ibft_region(unsigned long *sizep) |
48 | { | ||
49 | *sizep = 0; | ||
50 | return 0; | ||
51 | } | ||
48 | #endif | 52 | #endif |
49 | 53 | ||
50 | #endif /* ISCSI_IBFT_H */ | 54 | #endif /* ISCSI_IBFT_H */ |