Skip to content

Commit 5cdf00c

Browse files
author
Fox Snowpatch
committed
1 parent 4f37907 commit 5cdf00c

19 files changed

Lines changed: 144 additions & 139 deletions

File tree

arch/arm64/mm/init.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,6 @@ void free_initmem(void)
385385
WARN_ON(!IS_ALIGNED((unsigned long)lm_init_begin, PAGE_SIZE));
386386
WARN_ON(!IS_ALIGNED((unsigned long)lm_init_end, PAGE_SIZE));
387387

388-
/* Delete __init region from memblock.reserved. */
389-
memblock_free(lm_init_begin, lm_init_end - lm_init_begin);
390-
391388
free_reserved_area(lm_init_begin, lm_init_end,
392389
POISON_FREE_INITMEM, "unused kernel");
393390
/*

arch/powerpc/kernel/fadump.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -775,24 +775,12 @@ void __init fadump_update_elfcore_header(char *bufp)
775775

776776
static void *__init fadump_alloc_buffer(unsigned long size)
777777
{
778-
unsigned long count, i;
779-
struct page *page;
780-
void *vaddr;
781-
782-
vaddr = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO);
783-
if (!vaddr)
784-
return NULL;
785-
786-
count = PAGE_ALIGN(size) / PAGE_SIZE;
787-
page = virt_to_page(vaddr);
788-
for (i = 0; i < count; i++)
789-
mark_page_reserved(page + i);
790-
return vaddr;
778+
return alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO);
791779
}
792780

793781
static void fadump_free_buffer(unsigned long vaddr, unsigned long size)
794782
{
795-
free_reserved_area((void *)vaddr, (void *)(vaddr + size), -1, NULL);
783+
free_pages_exact((void *)vaddr, size);
796784
}
797785

798786
s32 __init fadump_setup_cpu_notes_buf(u32 num_cpus)

arch/powerpc/platforms/powernv/opal-core.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ static int __init create_opalcore(void)
303303
struct device_node *dn;
304304
struct opalcore *new;
305305
loff_t opalcore_off;
306-
struct page *page;
307306
Elf64_Phdr *phdr;
308307
Elf64_Ehdr *elf;
309308
int i, ret;
@@ -328,11 +327,6 @@ static int __init create_opalcore(void)
328327
oc_conf->opalcorebuf_sz = 0;
329328
return -ENOMEM;
330329
}
331-
count = oc_conf->opalcorebuf_sz / PAGE_SIZE;
332-
page = virt_to_page(oc_conf->opalcorebuf);
333-
for (i = 0; i < count; i++)
334-
mark_page_reserved(page + i);
335-
336330
pr_debug("opalcorebuf = 0x%llx\n", (u64)oc_conf->opalcorebuf);
337331

338332
/* Read OPAL related device-tree entries */
@@ -437,10 +431,7 @@ static void opalcore_cleanup(void)
437431

438432
/* free the buffer used for setting up OPAL core */
439433
if (oc_conf->opalcorebuf) {
440-
void *end = (void *)((u64)oc_conf->opalcorebuf +
441-
oc_conf->opalcorebuf_sz);
442-
443-
free_reserved_area(oc_conf->opalcorebuf, end, -1, NULL);
434+
free_pages_exact(oc_conf->opalcorebuf, oc_conf->opalcorebuf_sz);
444435
oc_conf->opalcorebuf = NULL;
445436
oc_conf->opalcorebuf_sz = 0;
446437
}

arch/sparc/kernel/mdesc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,12 @@ static struct mdesc_handle * __init mdesc_memblock_alloc(unsigned int mdesc_size
183183
static void __init mdesc_memblock_free(struct mdesc_handle *hp)
184184
{
185185
unsigned int alloc_size;
186-
unsigned long start;
187186

188187
BUG_ON(refcount_read(&hp->refcnt) != 0);
189188
BUG_ON(!list_empty(&hp->list));
190189

191190
alloc_size = PAGE_ALIGN(hp->handle_size);
192-
start = __pa(hp);
193-
memblock_free_late(start, alloc_size);
191+
memblock_free(hp, alloc_size);
194192
}
195193

196194
static struct mdesc_mem_ops memblock_mdesc_ops = {

arch/x86/kernel/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ int __init ima_free_kexec_buffer(void)
426426
if (!ima_kexec_buffer_size)
427427
return -ENOENT;
428428

429-
memblock_free_late(ima_kexec_buffer_phys,
429+
memblock_phys_free(ima_kexec_buffer_phys,
430430
ima_kexec_buffer_size);
431431

432432
ima_kexec_buffer_phys = 0;

arch/x86/platform/efi/memmap.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ static
3434
void __init __efi_memmap_free(u64 phys, unsigned long size, unsigned long flags)
3535
{
3636
if (flags & EFI_MEMMAP_MEMBLOCK) {
37-
if (slab_is_available())
38-
memblock_free_late(phys, size);
39-
else
40-
memblock_phys_free(phys, size);
37+
memblock_phys_free(phys, size);
4138
} else if (flags & EFI_MEMMAP_SLAB) {
4239
struct page *p = pfn_to_page(PHYS_PFN(phys));
4340
unsigned int order = get_order(size);

arch/x86/platform/efi/quirks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ void __init efi_reserve_boot_services(void)
372372
* doesn't make sense as far as the firmware is
373373
* concerned, but it does provide us with a way to tag
374374
* those regions that must not be paired with
375-
* memblock_free_late().
375+
* memblock_phys_free().
376376
*/
377377
md->attribute |= EFI_MEMORY_RUNTIME;
378378
}

drivers/firmware/efi/apple-properties.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static int __init map_properties(void)
226226
*/
227227
data->len = 0;
228228
memunmap(data);
229-
memblock_free_late(pa_data + sizeof(*data), data_len);
229+
memblock_phys_free(pa_data + sizeof(*data), data_len);
230230

231231
return ret;
232232
}

drivers/of/kexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ int __init ima_free_kexec_buffer(void)
175175
if (ret)
176176
return ret;
177177

178-
memblock_free_late(addr, size);
178+
memblock_phys_free(addr, size);
179179
return 0;
180180
}
181181
#endif

include/linux/memblock.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ void __next_mem_range_rev(u64 *idx, int nid, enum memblock_flags flags,
172172
struct memblock_type *type_b, phys_addr_t *out_start,
173173
phys_addr_t *out_end, int *out_nid);
174174

175-
void memblock_free_late(phys_addr_t base, phys_addr_t size);
176-
177175
#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
178176
static inline void __next_physmem_range(u64 *idx, struct memblock_type *type,
179177
phys_addr_t *out_start,

0 commit comments

Comments
 (0)