From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29A43C433E1 for ; Sat, 18 Jul 2020 05:18:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E96C9207FB for ; Sat, 18 Jul 2020 05:18:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E96C9207FB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=hisilicon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7A5738D0001; Sat, 18 Jul 2020 01:18:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 72FAA6B0085; Sat, 18 Jul 2020 01:18:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F6CE8D0001; Sat, 18 Jul 2020 01:18:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id 458766B0083 for ; Sat, 18 Jul 2020 01:18:21 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C1450181AC1F5 for ; Sat, 18 Jul 2020 05:18:20 +0000 (UTC) X-FDA: 77050040760.05.light54_130389826f10 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 6C66E1803E8D9 for ; Sat, 18 Jul 2020 05:17:47 +0000 (UTC) X-HE-Tag: light54_130389826f10 X-Filterd-Recvd-Size: 4294 Received: from huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Sat, 18 Jul 2020 05:17:39 +0000 (UTC) Received: from dggemi402-hub.china.huawei.com (unknown [172.30.72.55]) by Forcepoint Email with ESMTP id 82573EA0382B11CA0321; Sat, 18 Jul 2020 13:17:35 +0800 (CST) Received: from DGGEMI525-MBS.china.huawei.com ([169.254.6.52]) by dggemi402-hub.china.huawei.com ([10.3.17.135]) with mapi id 14.03.0487.000; Sat, 18 Jul 2020 13:17:28 +0800 From: "Song Bao Hua (Barry Song)" To: Jonathan Cameron , "linux-mm@kvack.org" , "linux-acpi@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "x86@kernel.org" CC: Lorenzo Pieralisi , Bjorn Helgaas , "linux-pci@vger.kernel.org" , "martin@geanix.com" , "Ingo Molnar" , "linux-ia64@vger.kernel.org" , Tony Luck , Fenghua Yu , Thomas Gleixner , Linuxarm , Dan Williams Subject: RE: [PATCH v2 5/6] ACPI: Remove side effect of partly creating a node in acpi_get_node Thread-Topic: [PATCH v2 5/6] ACPI: Remove side effect of partly creating a node in acpi_get_node Thread-Index: AQHWXGSNF+e0kQICqE2z4MI85n/Qt6kMy9pQ Date: Sat, 18 Jul 2020 05:17:27 +0000 Message-ID: References: <20200717175959.899775-1-Jonathan.Cameron@huawei.com> <20200717175959.899775-6-Jonathan.Cameron@huawei.com> In-Reply-To: <20200717175959.899775-6-Jonathan.Cameron@huawei.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.200.103] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 6C66E1803E8D9 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > -----Original Message----- > From: Jonathan Cameron > Sent: Saturday, July 18, 2020 6:00 AM > To: linux-mm@kvack.org; linux-acpi@vger.kernel.org; > linux-arm-kernel@lists.infradead.org; x86@kernel.org > Cc: Lorenzo Pieralisi ; Bjorn Helgaas > ; linux-pci@vger.kernel.org; martin@geanix.com; Ingo > Molnar ; linux-ia64@vger.kernel.org; Tony Luck > ; Fenghua Yu ; Thomas > Gleixner ; Linuxarm ; Dan > Williams ; Song Bao Hua (Barry Song) > ; Jonathan Cameron > > Subject: [PATCH v2 5/6] ACPI: Remove side effect of partly creating a nod= e in > acpi_get_node >=20 > acpi_get_node calls acpi_get_pxm to evaluate the _PXM AML method for > entries found in DSDT/SSDT. ACPI 6.3 sec 6.2.14 states > "_PXM evaluates to an integer that identifies a device as belonging to > a Proximity Domain defined in the System Resource Affinity Table (SRAT).= " >=20 > Hence a _PXM method should not result in creation of a new NUMA node. > Before this patch, _PXM could result in partial instantiation of > NUMA node, missing elements such as zone lists. A call to devm_kzalloc > for example results in a null pointer dereference. >=20 > This patch therefore replaces the acpi_map_pxm_to_node with a call > to pxm_to_node. >=20 > Signed-off-by: Jonathan Cameron Reviewed-by: Barry Song > --- > drivers/acpi/numa/srat.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c > index 8ef44ee0d76b..697a5c9e2eb5 100644 > --- a/drivers/acpi/numa/srat.c > +++ b/drivers/acpi/numa/srat.c > @@ -444,6 +444,6 @@ int acpi_get_node(acpi_handle handle) >=20 > pxm =3D acpi_get_pxm(handle); >=20 > - return acpi_map_pxm_to_node(pxm); > + return pxm_to_node(pxm); > } > EXPORT_SYMBOL(acpi_get_node); > -- > 2.19.1