| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2006-2008, Michael Ellerman, IBM Corporation. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or |
|---|
| 5 | | - * modify it under the terms of the GNU General Public License |
|---|
| 6 | | - * as published by the Free Software Foundation; version 2 of the |
|---|
| 7 | | - * License. |
|---|
| 8 | | - * |
|---|
| 9 | 4 | */ |
|---|
| 10 | 5 | |
|---|
| 11 | 6 | #include <linux/slab.h> |
|---|
| 12 | 7 | #include <linux/kernel.h> |
|---|
| 13 | 8 | #include <linux/kmemleak.h> |
|---|
| 14 | 9 | #include <linux/bitmap.h> |
|---|
| 15 | | -#include <linux/bootmem.h> |
|---|
| 10 | +#include <linux/memblock.h> |
|---|
| 16 | 11 | #include <asm/msi_bitmap.h> |
|---|
| 17 | 12 | #include <asm/setup.h> |
|---|
| 18 | 13 | |
|---|
| .. | .. |
|---|
| 128 | 123 | if (bmp->bitmap_from_slab) |
|---|
| 129 | 124 | bmp->bitmap = kzalloc(size, GFP_KERNEL); |
|---|
| 130 | 125 | else { |
|---|
| 131 | | - bmp->bitmap = memblock_virt_alloc(size, 0); |
|---|
| 126 | + bmp->bitmap = memblock_alloc(size, SMP_CACHE_BYTES); |
|---|
| 127 | + if (!bmp->bitmap) |
|---|
| 128 | + panic("%s: Failed to allocate %u bytes\n", __func__, |
|---|
| 129 | + size); |
|---|
| 132 | 130 | /* the bitmap won't be freed from memblock allocator */ |
|---|
| 133 | 131 | kmemleak_not_leak(bmp->bitmap); |
|---|
| 134 | 132 | } |
|---|