* ACPICA: Check whether ACPI is disabled before getting a table
@ 2017-08-21 15:34 Borislav Petkov
0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2017-08-21 15:34 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Toshi Kani, Rafael J. Wysocki, Mauro Carvalho Chehab, Tony Luck,
Len Brown, ACPI Devel Maling List, open list:EDAC-CORE,
Linux Kernel Mailing List
On Mon, Aug 21, 2017 at 03:30:47PM +0200, Rafael J. Wysocki wrote:
> Is acpi_disabled an ACPICA variable?
Doesn't look like it: it is defined in arch/x86/kernel/acpi/boot.c
> If not, this cannot go upstream. Not a big deal I guess, but somewhat
> yucky.
Uff, there's that "sync" of keeping ACPICA code and its version in the
kernel the same. Yuck.
Oh well.
^ permalink raw reply [flat|nested] 4+ messages in thread
* ACPICA: Check whether ACPI is disabled before getting a table
@ 2017-09-03 0:43 kbuild test robot
0 siblings, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2017-09-03 0:43 UTC (permalink / raw)
To: Borislav Petkov
Cc: kbuild-all, Rafael J. Wysocki, Toshi Kani, Rafael J. Wysocki,
Mauro Carvalho Chehab, Tony Luck, Len Brown,
ACPI Devel Maling List, open list:EDAC-CORE,
Linux Kernel Mailing List
Hi Borislav,
[auto build test ERROR on pm/linux-next]
[also build test ERROR on v4.13-rc7 next-20170901]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Borislav-Petkov/ACPICA-Check-whether-ACPI-is-disabled-before-getting-a-table/20170823-041359
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64
All errors (new ones prefixed by >>):
drivers/acpi/acpica/tbxface.c: In function 'acpi_get_table_header':
>> drivers/acpi/acpica/tbxface.c:254:6: error: 'acpi_disabled' undeclared (first use in this function)
if (acpi_disabled)
^~~~~~~~~~~~~
drivers/acpi/acpica/tbxface.c:254:6: note: each undeclared identifier is reported only once for each function it appears in
vim +/acpi_disabled +254 drivers/acpi/acpica/tbxface.c
229
230 /*******************************************************************************
231 *
232 * FUNCTION: acpi_get_table_header
233 *
234 * PARAMETERS: signature - ACPI signature of needed table
235 * instance - Which instance (for SSDTs)
236 * out_table_header - The pointer to the table header to fill
237 *
238 * RETURN: Status and pointer to mapped table header
239 *
240 * DESCRIPTION: Finds an ACPI table header.
241 *
242 * NOTE: Caller is responsible in unmapping the header with
243 * acpi_os_unmap_memory
244 *
245 ******************************************************************************/
246 acpi_status
247 acpi_get_table_header(char *signature,
248 u32 instance, struct acpi_table_header *out_table_header)
249 {
250 u32 i;
251 u32 j;
252 struct acpi_table_header *header;
253
> 254 if (acpi_disabled)
255 return (AE_ERROR);
256
257 /* Parameter validation */
258
259 if (!signature || !out_table_header) {
260 return (AE_BAD_PARAMETER);
261 }
262
263 /* Walk the root table list */
264
265 for (i = 0, j = 0; i < acpi_gbl_root_table_list.current_table_count;
266 i++) {
267 if (!ACPI_COMPARE_NAME
268 (&(acpi_gbl_root_table_list.tables[i].signature),
269 signature)) {
270 continue;
271 }
272
273 if (++j < instance) {
274 continue;
275 }
276
277 if (!acpi_gbl_root_table_list.tables[i].pointer) {
278 if ((acpi_gbl_root_table_list.tables[i].flags &
279 ACPI_TABLE_ORIGIN_MASK) ==
280 ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL) {
281 header =
282 acpi_os_map_memory(acpi_gbl_root_table_list.
283 tables[i].address,
284 sizeof(struct
285 acpi_table_header));
286 if (!header) {
287 return (AE_NO_MEMORY);
288 }
289
290 memcpy(out_table_header, header,
291 sizeof(struct acpi_table_header));
292 acpi_os_unmap_memory(header,
293 sizeof(struct
294 acpi_table_header));
295 } else {
296 return (AE_NOT_FOUND);
297 }
298 } else {
299 memcpy(out_table_header,
300 acpi_gbl_root_table_list.tables[i].pointer,
301 sizeof(struct acpi_table_header));
302 }
303 return (AE_OK);
304 }
305
306 return (AE_NOT_FOUND);
307 }
308
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] 4+ messages in thread* ACPICA: Check whether ACPI is disabled before getting a table
@ 2017-08-21 13:30 Rafael J. Wysocki
0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2017-08-21 13:30 UTC (permalink / raw)
To: Borislav Petkov
Cc: Rafael J. Wysocki, Toshi Kani, Rafael J. Wysocki,
Mauro Carvalho Chehab, Tony Luck, Len Brown,
ACPI Devel Maling List, open list:EDAC-CORE,
Linux Kernel Mailing List
On Mon, Aug 21, 2017 at 3:20 PM, Borislav Petkov <bp@alien8.de> wrote:
> Borislav Petkov <bp@suse.de>
>
> ... and save us the splrinking of this test around in the callers.
>
> No functionality change.
>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
> drivers/acpi/acpica/tbxface.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c
> index 010b1c43df92..881b0d5b2838 100644
> --- a/drivers/acpi/acpica/tbxface.c
> +++ b/drivers/acpi/acpica/tbxface.c
> @@ -226,6 +226,9 @@ acpi_get_table_header(char *signature,
> u32 j;
> struct acpi_table_header *header;
>
> + if (acpi_disabled)
> + return (AE_ERROR);
> +
> /* Parameter validation */
>
> if (!signature || !out_table_header) {
> --
Is acpi_disabled an ACPICA variable? If not, this cannot go upstream.
Not a big deal I guess, but somewhat yucky.
---
To unsubscribe from this list: send the line "unsubscribe linux-edac" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread* ACPICA: Check whether ACPI is disabled before getting a table
@ 2017-08-21 13:20 Borislav Petkov
0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2017-08-21 13:20 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Toshi Kani, Rafael J. Wysocki, Mauro Carvalho Chehab, Tony Luck,
Len Brown, ACPI Devel Maling List, open list:EDAC-CORE,
Linux Kernel Mailing List
Borislav Petkov <bp@suse.de>
... and save us the splrinking of this test around in the callers.
No functionality change.
Signed-off-by: Borislav Petkov <bp@suse.de>
---
drivers/acpi/acpica/tbxface.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c
index 010b1c43df92..881b0d5b2838 100644
--- a/drivers/acpi/acpica/tbxface.c
+++ b/drivers/acpi/acpica/tbxface.c
@@ -226,6 +226,9 @@ acpi_get_table_header(char *signature,
u32 j;
struct acpi_table_header *header;
+ if (acpi_disabled)
+ return (AE_ERROR);
+
/* Parameter validation */
if (!signature || !out_table_header) {
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-09-03 0:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-21 15:34 ACPICA: Check whether ACPI is disabled before getting a table Borislav Petkov
-- strict thread matches above, loose matches on Subject: below --
2017-09-03 0:43 kbuild test robot
2017-08-21 13:30 Rafael J. Wysocki
2017-08-21 13:20 Borislav Petkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox