Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753132AbdLMOwM (ORCPT ); Wed, 13 Dec 2017 09:52:12 -0500 Received: from mail-sn1nam01on0053.outbound.protection.outlook.com ([104.47.32.53]:11449 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752175AbdLMOwI (ORCPT ); Wed, 13 Dec 2017 09:52:08 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Vadim.Lomovtsev@cavium.com; Date: Wed, 13 Dec 2017 06:52:01 -0800 From: Vadim Lomovtsev To: "Moore, Robert" Cc: "Wysocki, Rafael J" , "lenb@kernel.org" , "linux-acpi@vger.kernel.org" , "devel@acpica.org" , "linux-kernel@vger.kernel.org" , "vadim.lomovtsev@cavium.com" , "Schmauss, Erik" Subject: Re: [PATCH] acpi: acpica: add acpi status check prior walking through namespace Message-ID: <20171213145201.GA6692@localhost.localdomain> References: <1513094360-1414-1-git-send-email-Vadim.Lomovtsev@caviumnetworks.com> <1513094360-1414-2-git-send-email-Vadim.Lomovtsev@caviumnetworks.com> <94F2FBAB4432B54E8AACC7DFDE6C92E3B74FBD84@ORSMSX110.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <94F2FBAB4432B54E8AACC7DFDE6C92E3B74FBD84@ORSMSX110.amr.corp.intel.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: YTOPR0101CA0040.CANPRD01.PROD.OUTLOOK.COM (52.132.42.17) To DM5PR07MB3002.namprd07.prod.outlook.com (10.172.87.140) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 794b2c1d-54ad-46fa-3848-08d54239147e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307);SRVR: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DFgJgwTziB9TzRt/w1PG0XddqDx2wR2niLYxF1X5I+Iwsxgf/5W4qJlafO2b37NIo0KGrfM0yv8TV+nk06xfy4qMz+IQhzRPmdRN+lDgQ0WQcQv27ceQQtzQu+FZqflrvQXbI0qPY98qZzjSiItC5+2L5B1/SdxLSu1YU1aAyoIrsdx6tSiixekQ75Pf1w6Eoh0sCghZQVPTe6jBlDkveTafHQilPCjKFuhE1PfA/lY8npQXeAuihqpGt0EZi8FPKTpLBzRGw0F1VKdUofDT9KdFTxjggsXpeSFI+vq39wrekX8bcSnq/uGCyQF2f8Cwnacbm3kkYPSwMHEiLhA7Hhma2z0ivGdfMIfQCqMJ+q1SEwVxTsPipMlLncbHhIh0qgKY1EZAdE1C1HBML/xdZ6KQtURG0T3P9QIiY7bMi/CqagapFh/EGvbBJ2nlNhVgmFTpSAZoZHdohgWCGShyuDuZLtx0q1vs+IMew7rHIuSBn44xNiGL/ai0I= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(3231023)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(6072148)(201708071742011);SRVR:DM5PR07MB3002;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM5PR07MB3002; X-Microsoft-Exchange-Diagnostics: 1;DM5PR07MB3002;4:W0xS5WpTwFWipp7Hl1Qwvv7TWpXNUBECS+J0Fm3eLxqpL/609V80j1T+aI260IBBLKpU8P+S2wGM9addQ9RccC/eZ0sQFKeP+MTE3+IRf22JSZnpulYLNBguoGyMSvzka4MATEKFPemT2qsAHjvsliuEvXlSgMB3cJPBalGHBb4kwoGU0RNlofXG1CP5/xzrs2l9oXKLH8tiNIrDf8gw92PGtD3PuWey+EeE5cOl3artHRwfWLyvb77QvaaQz2tRltW3Ffqr6H23NGTG/V5isbowZucM4WiYqW1hHeDG3vlq0+OilyTvcwtbh2jsihTdM8aIGPiYdMwM7ifOUCQPOh5R4adeKqeIOY/QSAmQkOY= X-Forefront-PRVS: 052017CAF1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(979002)(6069001)(376002)(346002)(366004)(189003)(199004)(24454002)(13464003)(83506002)(97736004)(6916009)(33656002)(2950100002)(42882006)(23726003)(2906002)(6116002)(55016002)(6666003)(52116002)(1076002)(7696005)(106356001)(25786009)(4326008)(575784001)(3846002)(5660300001)(6246003)(9686003)(229853002)(105586002)(54906003)(16586007)(58126008)(72206003)(316002)(53936002)(47776003)(8936002)(305945005)(81156014)(50466002)(8676002)(33896004)(7736002)(59450400001)(81166006)(478600001)(66066001)(61506002)(68736007)(16526018)(386003)(76176011)(53546011)(6506007)(18370500001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR07MB3002;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR07MB3002;23:Wlxamw9kd1sB523uRoBon6dnfiovYZFGpV1m5mnob?= =?us-ascii?Q?G/jTukdXt41RHF3pdryn7OqBSmCgHWgm2OHqtHHzrZPWkiKPrqHsWdNiTUR0?= =?us-ascii?Q?8lqYtpa5/I2u6Vy0zk9wjJI9B2lAVyTH6G+F/9Egzm+sM3aCzsYbCVkAzkC2?= =?us-ascii?Q?4ubbex2PMtLF7+/lpRe2KsAM0ZxQPK6a0EZfmEF6OtQPBhljRMyUnLZtY2NB?= =?us-ascii?Q?PC66Mz1pWUl0mze0tklsfFbvGK8Oq9YB1UD5VroFqmnbXnM0yl/kw7jCJVYV?= =?us-ascii?Q?pfwT0+dSTLO3zTd7vRVV2tcBrzG8xnYKdxc6h8KmLkfx0NO8TdJ0qTO+fBkS?= =?us-ascii?Q?klmohClDxeiTHmbvaNGavqnN136dFOf4YAoDzobOjU1KBeO1n7Y2/zmX6Udr?= =?us-ascii?Q?exzuswbwBXWsxNftp9b0beEDz19S2GnupZE9m2l78+d7azmDa+jeqw4HiFE2?= =?us-ascii?Q?H4nibU3HGX1MRsTugwSGUbdxgwIZRwMcYChDQCoCoq1AE0lIRbbLWYTp5oC1?= =?us-ascii?Q?nt9zv7OepyNMxivooeX93Sx92vB4/e9f1bOGv/zVyH0HjEotYYBWbZkHSnBS?= =?us-ascii?Q?3sDUp+YfeI1PSn3kRWgLGVAq3qObMJGuWiX7rChRgRsFlMkbynNrOa9Qql8b?= =?us-ascii?Q?4rLINVtc5GRnrpa3s+VfU/LoMWw6ET3JTszLJyXiqyyARlicyj3KJQ+jkKB5?= =?us-ascii?Q?RE42y4yFDOz7ikipoSZYlzdZggZfjnuazywAgZZYwm82/JiARlwBgtZ1X42P?= =?us-ascii?Q?tp2/7ftxU6Q5i2qI/dITURToJd+qxmc1hTfpHN3JtGEe29IRqiOypEAelnFD?= =?us-ascii?Q?2+KIHlFLn0bM7IA89CKQoeT4ObVf4Q778j5yG3yFcKlynS3ViH/C6kVPiF0K?= =?us-ascii?Q?uqlTw4YrZ9JyoNSgAruzuSpns25+g+6glJ0gJFIXE1a7few7G2akh8TwTKTv?= =?us-ascii?Q?mzc3QVRSl7PJZfgnBltCwXu0BnT/zpa9HOmw6yZEV9vU548MsNHaECqdWAS4?= =?us-ascii?Q?aZfyUvksiR/M93HkpFMqg/MNi5byt0EjNRcUZ4VgdWFjztJgVojYj8V27lpR?= =?us-ascii?Q?CyCmgrWkNkpyTD8u0Cn5G7bJjLtPP4Vb33opuZSE8Ln0/gajtublgIQzF9h8?= =?us-ascii?Q?wRnJljfP8qzIts7WcdSv2t1c2ph+qUt8zsqC/FVTkBDaGBZYqYqenSaGTADs?= =?us-ascii?Q?C8S1EMYUuDRHmUgXxYjnJNbhDscEY64mjlZYyqdtBeDaAd4CroqbSpa/UdEY?= =?us-ascii?Q?zX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ncPenbRTEUCULKun+D/sIi3w9IJzMOzFShn9GNXOyjcQmloWAOW8C17DrFdnWSm76A0k7UF3habLP4uodYESo4FE6HwaXdgy938ypMbw67Clc4eyjP3u SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 14:52:05.7178 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 794b2c1d-54ad-46fa-3848-08d54239147e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3002 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2421 Lines: 66 On Tue, Dec 12, 2017 at 09:52:21PM +0000, Moore, Robert wrote: > Another way to look at this is that the kernel should not be calling ACPI interfaces if ACPI is disabled. Yes, I agree. So in this case the ltp_acpi test case has to be updated with such checking before calling ACPI interfaces. However, it seems that such calls was put there intentionally, without ACPI state check, as part of kernel testing strategy. WBR, Vadim > > > -----Original Message----- > > From: Vadim Lomovtsev [mailto:Vadim.Lomovtsev@caviumnetworks.com] > > Sent: Tuesday, December 12, 2017 7:59 AM > > To: Moore, Robert ; Zheng, Lv > > ; Wysocki, Rafael J ; > > lenb@kernel.org; linux-acpi@vger.kernel.org; devel@acpica.org; linux- > > kernel@vger.kernel.org > > Cc: vadim.lomovtsev@cavium.com > > Subject: [PATCH] acpi: acpica: add acpi status check prior walking > > through namespace > > > > From: Vadim Lomovtsev > > > > While having kernel built with ACPI support enabled and booted over FDT, > > the ltp_acpi test from LTP suite causes kernel crash while calling > > acpi_ns_walk_namespace(). The acpi_get_devices is high level wrapper for > > it, so we need to protect kernel from crashes by adding acpi status > > check before walking through namespace which is not loaded because of > > acpi is disabled. > > > > Signed-off-by: Vadim Lomovtsev > > --- > > drivers/acpi/acpica/nsxfeval.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/acpi/acpica/nsxfeval.c > > b/drivers/acpi/acpica/nsxfeval.c index 783f4c8..e0eb9ae 100644 > > --- a/drivers/acpi/acpica/nsxfeval.c > > +++ b/drivers/acpi/acpica/nsxfeval.c > > @@ -52,6 +52,8 @@ > > #define _COMPONENT ACPI_NAMESPACE > > ACPI_MODULE_NAME("nsxfeval") > > > > +extern int acpi_disabled; > > + > > /* Local prototypes */ > > static void acpi_ns_resolve_references(struct acpi_evaluate_info > > *info); > > > > @@ -812,6 +814,11 @@ static void acpi_ns_resolve_references(struct > > acpi_evaluate_info *info) > > > > ACPI_FUNCTION_TRACE(acpi_get_devices); > > > > + /* check if ACPI disabled to prevent kernel crash later */ > > + if (acpi_disabled) { > > + return_ACPI_STATUS(AE_NOT_CONFIGURED); > > + } > > + > > /* Parameter validation */ > > > > if (!user_function) { > > -- > > 1.8.3.1 >