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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 5629FC433DB for ; Tue, 2 Mar 2021 09:57:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 75BDF64F0D for ; Tue, 2 Mar 2021 09:57:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75BDF64F0D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C3CD78D00F5; Tue, 2 Mar 2021 04:57:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BEE038D0063; Tue, 2 Mar 2021 04:57:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ADBDD8D00F5; Tue, 2 Mar 2021 04:57:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id 99C0C8D0063 for ; Tue, 2 Mar 2021 04:57:47 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6368A180ACF62 for ; Tue, 2 Mar 2021 09:57:47 +0000 (UTC) X-FDA: 77874482574.11.1197B5E Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf15.hostedemail.com (Postfix) with ESMTP id D6615A0009DE for ; Tue, 2 Mar 2021 09:57:46 +0000 (UTC) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1229aYR1184438; Tue, 2 Mar 2021 04:57:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=pp1; bh=yKyKNplrnfGIMREBrT/v98LCI1geLYbB+er4Q6fkd9Q=; b=Jn5lxbK+UhDFunwJyfZ4umAH5vGgxd6IDwt+sEN0mKoA2rO257d89naH37/rhSBWL6yy IoBv5QXi2tI/Qkxmsc71Wx0lAkaEb+anjQGUoghaOXrFzjsGm45NFE1OR/DxE+avxeoR 4i5M8StT1YH1b9k2MUdw3TC9hzaZD5FeeP4hSJuRohOKhHIcxmH0EJqVulwIg6kz6sXU Hzd3G4po0+dCiGSDz3duSqyOvu6THoZt93A7f1WOFrj3UlGtZDvGeZ5k6EZrSR5Zv+Fb 2VtgPSmgdNp7XkDKO8IqvIP5TxlomLA1HZdZm6OeEEvZGVSHkhSlxL+YbwZ7fYobI+Ay 8w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 371gvtn1hy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 Mar 2021 04:57:18 -0500 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1229aqv3185978; Tue, 2 Mar 2021 04:57:17 -0500 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 371gvtn1gq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 Mar 2021 04:57:17 -0500 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 1229vECn024285; Tue, 2 Mar 2021 09:57:15 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma04ams.nl.ibm.com with ESMTP id 3712fmgpx4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 Mar 2021 09:57:15 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1229vDsg54526246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 Mar 2021 09:57:13 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E643AE053; Tue, 2 Mar 2021 09:57:13 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 88387AE04D; Tue, 2 Mar 2021 09:57:10 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.23.212]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 2 Mar 2021 09:57:10 +0000 (GMT) Date: Tue, 2 Mar 2021 11:57:08 +0200 From: Mike Rapoport To: George Kennedy Cc: David Hildenbrand , Andrey Konovalov , Andrew Morton , Catalin Marinas , Vincenzo Frascino , Dmitry Vyukov , Konrad Rzeszutek Wilk , Will Deacon , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Peter Collingbourne , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , Christoph Hellwig , kasan-dev , Linux ARM , Linux Memory Management List , LKML , Dhaval Giani , robert.moore@intel.com, erik.kaneda@intel.com, rafael.j.wysocki@intel.com, lenb@kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH] mm, kasan: don't poison boot memory Message-ID: References: <20210225145700.GC1854360@linux.ibm.com> <20210225160706.GD1854360@linux.ibm.com> <6000e7fd-bf8b-b9b0-066d-23661da8a51d@oracle.com> <20210226111730.GL1854360@linux.ibm.com> <083c2bfd-12dd-f3c3-5004-fb1e3fb6493c@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-02_03:2021-03-01,2021-03-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 priorityscore=1501 clxscore=1011 lowpriorityscore=0 impostorscore=0 bulkscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103020078 X-Stat-Signature: ewdzkriiaswatbtbr6nkz6q3x66hb6fy X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: D6615A0009DE Received-SPF: none (linux.ibm.com>: No applicable sender policy available) receiver=imf15; identity=mailfrom; envelope-from=""; helo=mx0b-001b2d01.pphosted.com; client-ip=148.163.158.5 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614679066-185328 Content-Transfer-Encoding: quoted-printable 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: Hi George, On Mon, Mar 01, 2021 at 08:20:45PM -0500, George Kennedy wrote: > > > > >=20 > > > > There should be no harm in doing the memblock_reserve() for all > > > > the standard > > > > tables, right? > > > It should be ok to memblock_reserve() all the tables very early as > > > long as > > > we don't run out of static entries in memblock.reserved. > > >=20 > > > We just need to make sure the tables are reserved before memblock > > > allocations are possible, so we'd still need to move > > > acpi_table_init() in > > > x86::setup_arch() before e820__memblock_setup(). > > > Not sure how early ACPI is initialized on arm64. > >=20 > > Thanks Mike. Will try to move the memblock_reserves() before > > e820__memblock_setup(). >=20 > Hi Mike, >=20 > Moved acpi_table_init() in x86::setup_arch() before e820__memblock_setu= p() > as you suggested. >=20 > Ran 10 boots with the following without error. I'd suggest to send it as a formal patch to see what x86 and ACPI folks have to say about this. =20 > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c > index 740f3bdb..3b1dd24 100644 > --- a/arch/x86/kernel/setup.c > +++ b/arch/x86/kernel/setup.c > @@ -1047,6 +1047,7 @@ void __init setup_arch(char **cmdline_p) > =A0=A0=A0=A0 cleanup_highmap(); >=20 > =A0=A0=A0=A0 memblock_set_current_limit(ISA_END_ADDRESS); > +=A0=A0=A0 acpi_boot_table_init(); > =A0=A0=A0=A0 e820__memblock_setup(); >=20 > =A0=A0=A0=A0 /* > @@ -1140,8 +1141,6 @@ void __init setup_arch(char **cmdline_p) > =A0=A0=A0=A0 /* > =A0=A0=A0=A0 =A0* Parse the ACPI tables for possible boot-time SMP conf= iguration. > =A0=A0=A0=A0 =A0*/ > -=A0=A0=A0 acpi_boot_table_init(); > - > =A0=A0=A0=A0 early_acpi_boot_init(); >=20 > =A0=A0=A0=A0 initmem_init(); > diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbins= tal.c > index 0bb15ad..7830109 100644 > --- a/drivers/acpi/acpica/tbinstal.c > +++ b/drivers/acpi/acpica/tbinstal.c > @@ -7,6 +7,7 @@ > =A0 * > ***********************************************************************= ******/ >=20 > +#include > =A0#include > =A0#include "accommon.h" > =A0#include "actables.h" > @@ -16,6 +17,33 @@ >=20 > =A0/*******************************************************************= ************ > =A0 * > + * FUNCTION:=A0=A0=A0 acpi_tb_reserve_standard_table > + * > + * PARAMETERS:=A0 address=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 - Table = physical address > + *=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 header=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 - Table header > + * > + * RETURN:=A0=A0=A0=A0=A0 None > + * > + * DESCRIPTION: To avoid an acpi table page from being "stolen" by the > buddy > + *=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 allocator run memblock_reser= ve() on all the standard acpi > tables. > + * > + *********************************************************************= *********/ > +void > +acpi_tb_reserve_standard_table(acpi_physical_address address, > +=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0 struct acpi_table_header *header) > +{ > +=A0=A0=A0 if ((ACPI_COMPARE_NAMESEG(header->signature, ACPI_SIG_FACS))= || > +=A0=A0=A0 =A0=A0=A0 (ACPI_VALIDATE_RSDP_SIG(header->signature))) > +=A0=A0=A0 =A0=A0=A0 return; > + Why these should be excluded? > +=A0=A0=A0 if (header->length > PAGE_SIZE) /* same check as in acpi_map= () */ > +=A0=A0=A0 =A0=A0=A0 return; I don't think this is required, I believe acpi_map() has this check becau= se kmap() cannot handle multiple pages. > + > +=A0=A0=A0 memblock_reserve(address, PAGE_ALIGN(header->length)); > +} > + > +/*********************************************************************= ********** > + * > =A0 * FUNCTION:=A0=A0=A0 acpi_tb_install_table_with_override > =A0 * > =A0 * PARAMETERS:=A0 new_table_desc=A0=A0=A0=A0=A0=A0=A0=A0=A0 - New ta= ble descriptor to install > @@ -58,6 +86,9 @@ > =A0=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0 new_table_de= sc->flags, > =A0=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0 new_table_de= sc->pointer); >=20 > +=A0=A0=A0 acpi_tb_reserve_standard_table(new_table_desc->address, > +=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0 new_table_desc->pointer= ); > + > =A0=A0=A0=A0 acpi_tb_print_table_header(new_table_desc->address, > =A0=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0 new_table_desc->point= er); >=20 > George --=20 Sincerely yours, Mike.