[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210132225.yt1ATBM7-lkp@intel.com>
Date: Thu, 13 Oct 2022 23:00:00 +0800
From: kernel test robot <lkp@...el.com>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [ardb:efi-zboot-direct 7/35] arch/x86/platform/efi/memmap.c:32:13:
warning: no previous prototype for '__efi_memmap_free'
tree: git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git efi-zboot-direct
head: c4954c4853a50dbfefd1beb56d466ab612164ae2
commit: 79950822a283bfcfe394813e805ad0e382535274 [7/35] efi: memmap: Move manipulation routines into x86 arch tree
config: x86_64-rhel-8.3-func
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id=79950822a283bfcfe394813e805ad0e382535274
git remote add ardb git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git
git fetch --no-tags ardb efi-zboot-direct
git checkout 79950822a283bfcfe394813e805ad0e382535274
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/platform/efi/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> arch/x86/platform/efi/memmap.c:32:13: warning: no previous prototype for '__efi_memmap_free' [-Wmissing-prototypes]
32 | void __init __efi_memmap_free(u64 phys, unsigned long size, unsigned long flags)
| ^~~~~~~~~~~~~~~~~
>> arch/x86/platform/efi/memmap.c:57:12: warning: no previous prototype for 'efi_memmap_alloc' [-Wmissing-prototypes]
57 | int __init efi_memmap_alloc(unsigned int num_entries,
| ^~~~~~~~~~~~~~~~
>> arch/x86/platform/efi/memmap.c:92:12: warning: no previous prototype for 'efi_memmap_install' [-Wmissing-prototypes]
92 | int __init efi_memmap_install(struct efi_memory_map_data *data)
| ^~~~~~~~~~~~~~~~~~
>> arch/x86/platform/efi/memmap.c:107:12: warning: no previous prototype for 'efi_memmap_split_count' [-Wmissing-prototypes]
107 | int __init efi_memmap_split_count(efi_memory_desc_t *md, struct range *range)
| ^~~~~~~~~~~~~~~~~~~~~~
>> arch/x86/platform/efi/memmap.c:147:13: warning: no previous prototype for 'efi_memmap_insert' [-Wmissing-prototypes]
147 | void __init efi_memmap_insert(struct efi_memory_map *old_memmap, void *buf,
| ^~~~~~~~~~~~~~~~~
vim +/__efi_memmap_free +32 arch/x86/platform/efi/memmap.c
31
> 32 void __init __efi_memmap_free(u64 phys, unsigned long size, unsigned long flags)
33 {
34 if (flags & EFI_MEMMAP_MEMBLOCK) {
35 if (slab_is_available())
36 memblock_free_late(phys, size);
37 else
38 memblock_phys_free(phys, size);
39 } else if (flags & EFI_MEMMAP_SLAB) {
40 struct page *p = pfn_to_page(PHYS_PFN(phys));
41 unsigned int order = get_order(size);
42
43 free_pages((unsigned long) page_address(p), order);
44 }
45 }
46
47 /**
48 * efi_memmap_alloc - Allocate memory for the EFI memory map
49 * @num_entries: Number of entries in the allocated map.
50 * @data: efi memmap installation parameters
51 *
52 * Depending on whether mm_init() has already been invoked or not,
53 * either memblock or "normal" page allocation is used.
54 *
55 * Returns zero on success, a negative error code on failure.
56 */
> 57 int __init efi_memmap_alloc(unsigned int num_entries,
58 struct efi_memory_map_data *data)
59 {
60 /* Expect allocation parameters are zero initialized */
61 WARN_ON(data->phys_map || data->size);
62
63 data->size = num_entries * efi.memmap.desc_size;
64 data->desc_version = efi.memmap.desc_version;
65 data->desc_size = efi.memmap.desc_size;
66 data->flags &= ~(EFI_MEMMAP_SLAB | EFI_MEMMAP_MEMBLOCK);
67 data->flags |= efi.memmap.flags & EFI_MEMMAP_LATE;
68
69 if (slab_is_available()) {
70 data->flags |= EFI_MEMMAP_SLAB;
71 data->phys_map = __efi_memmap_alloc_late(data->size);
72 } else {
73 data->flags |= EFI_MEMMAP_MEMBLOCK;
74 data->phys_map = __efi_memmap_alloc_early(data->size);
75 }
76
77 if (!data->phys_map)
78 return -ENOMEM;
79 return 0;
80 }
81
82 /**
83 * efi_memmap_install - Install a new EFI memory map in efi.memmap
84 * @ctx: map allocation parameters (address, size, flags)
85 *
86 * Unlike efi_memmap_init_*(), this function does not allow the caller
87 * to switch from early to late mappings. It simply uses the existing
88 * mapping function and installs the new memmap.
89 *
90 * Returns zero on success, a negative error code on failure.
91 */
> 92 int __init efi_memmap_install(struct efi_memory_map_data *data)
93 {
94 efi_memmap_unmap();
95
96 return __efi_memmap_init(data);
97 }
98
99 /**
100 * efi_memmap_split_count - Count number of additional EFI memmap entries
101 * @md: EFI memory descriptor to split
102 * @range: Address range (start, end) to split around
103 *
104 * Returns the number of additional EFI memmap entries required to
105 * accommodate @range.
106 */
> 107 int __init efi_memmap_split_count(efi_memory_desc_t *md, struct range *range)
108 {
109 u64 m_start, m_end;
110 u64 start, end;
111 int count = 0;
112
113 start = md->phys_addr;
114 end = start + (md->num_pages << EFI_PAGE_SHIFT) - 1;
115
116 /* modifying range */
117 m_start = range->start;
118 m_end = range->end;
119
120 if (m_start <= start) {
121 /* split into 2 parts */
122 if (start < m_end && m_end < end)
123 count++;
124 }
125
126 if (start < m_start && m_start < end) {
127 /* split into 3 parts */
128 if (m_end < end)
129 count += 2;
130 /* split into 2 parts */
131 if (end <= m_end)
132 count++;
133 }
134
135 return count;
136 }
137
138 /**
139 * efi_memmap_insert - Insert a memory region in an EFI memmap
140 * @old_memmap: The existing EFI memory map structure
141 * @buf: Address of buffer to store new map
142 * @mem: Memory map entry to insert
143 *
144 * It is suggested that you call efi_memmap_split_count() first
145 * to see how large @buf needs to be.
146 */
> 147 void __init efi_memmap_insert(struct efi_memory_map *old_memmap, void *buf,
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (168992 bytes)
Powered by blists - more mailing lists