From: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
To: "Moore, Robert" <robert.moore@intel.com>
Cc: "Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
"lenb@kernel.org" <lenb@kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"devel@acpica.org" <devel@acpica.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"vadim.lomovtsev@cavium.com" <vadim.lomovtsev@cavium.com>,
"Schmauss, Erik" <erik.schmauss@intel.com>
Subject: Re: [PATCH] acpi: acpica: add acpi status check prior walking through namespace
Date: Wed, 13 Dec 2017 06:52:01 -0800 [thread overview]
Message-ID: <20171213145201.GA6692@localhost.localdomain> (raw)
In-Reply-To: <94F2FBAB4432B54E8AACC7DFDE6C92E3B74FBD84@ORSMSX110.amr.corp.intel.com>
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 <robert.moore@intel.com>; Zheng, Lv
> > <lv.zheng@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>;
> > 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 <vadim.lomovtsev@cavium.com>
> >
> > 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 <vadim.lomovtsev@cavium.com>
> > ---
> > 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
>
next prev parent reply other threads:[~2017-12-13 14:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-12 15:59 [BUG] acpica: ltp_acpi test case causes kernel crash at acpi_ns_walk_namespace Vadim Lomovtsev
2017-12-12 15:59 ` [PATCH] acpi: acpica: add acpi status check prior walking through namespace Vadim Lomovtsev
2017-12-12 21:52 ` Moore, Robert
2017-12-13 14:52 ` Vadim Lomovtsev [this message]
2017-12-13 16:48 ` Rafael J. Wysocki
2017-12-14 9:36 ` Vadim Lomovtsev
2017-12-12 23:45 ` [BUG] acpica: ltp_acpi test case causes kernel crash at acpi_ns_walk_namespace Rafael J. Wysocki
2017-12-13 14:55 ` Vadim Lomovtsev
2017-12-13 16:52 ` Rafael J. Wysocki
2017-12-14 9:34 ` Vadim Lomovtsev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171213145201.GA6692@localhost.localdomain \
--to=vadim.lomovtsev@caviumnetworks.com \
--cc=devel@acpica.org \
--cc=erik.schmauss@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=robert.moore@intel.com \
--cc=vadim.lomovtsev@cavium.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox