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 A16BEC433E0 for ; Fri, 26 Feb 2021 11:18:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 03FEA64EDC for ; Fri, 26 Feb 2021 11:18:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03FEA64EDC 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 6FED56B0005; Fri, 26 Feb 2021 06:18:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B1106B0006; Fri, 26 Feb 2021 06:18:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 577E56B006C; Fri, 26 Feb 2021 06:18:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0092.hostedemail.com [216.40.44.92]) by kanga.kvack.org (Postfix) with ESMTP id 3FE296B0005 for ; Fri, 26 Feb 2021 06:18:04 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 08FA6D216 for ; Fri, 26 Feb 2021 11:18:04 +0000 (UTC) X-FDA: 77860169688.26.4FE24A7 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf05.hostedemail.com (Postfix) with ESMTP id 3A9D0E0011E2 for ; Fri, 26 Feb 2021 11:18:01 +0000 (UTC) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11QB3jwR080096; Fri, 26 Feb 2021 06:17:39 -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=yhvr1Xkbh7XOwtOWAyA3QzMCb183Bb/rbHDxBvE6E48=; b=EbjwnvBb1pWi3H4bcvxNzG/xF/xasyvZmO06exVMexdK/s5wvrKoHlSou/GlIBDVT37v hkeYUYUi2cN26n0ZAyy/OOAMpDnCjDdUbGYfGyBEXRm1eXDuN/69ECD0qiqzeqveIYfX mgjda5KWd7MDnOaCruTQ24KM9Nzz4Ar4Oedptv1EOG/bbo2aBzbr5yYOqEilJXD+nmyl jIM/vdEa2Ydwtz89c8NkmYH81RHNffV56XDR7OawyRpGJ7Sl7eecujQCdyyTn4mry6Vx KVf0fx8zaBawUggQI6o5Z6d9Em1PpLL+q9Dgsat7SaVefGYT9Ko3W3yfrvnPW4qJnuZd LA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 36xphuq02m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Feb 2021 06:17:39 -0500 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 11QB41fZ082178; Fri, 26 Feb 2021 06:17:39 -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 36xphuq01k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Feb 2021 06:17:39 -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 11QBGZHP032136; Fri, 26 Feb 2021 11:17:36 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04ams.nl.ibm.com with ESMTP id 36tt28d7bu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Feb 2021 11:17:36 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 11QBHYHX35913984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Feb 2021 11:17:34 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 547BFAE04D; Fri, 26 Feb 2021 11:17:34 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 26B05AE056; Fri, 26 Feb 2021 11:17:32 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.51.238]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 26 Feb 2021 11:17:32 +0000 (GMT) Date: Fri, 26 Feb 2021 13:17:30 +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 Subject: Re: [PATCH] mm, kasan: don't poison boot memory Message-ID: <20210226111730.GL1854360@linux.ibm.com> References: <450a9895-a2b4-d11b-97ca-1bd33d5308d4@oracle.com> <20210224103754.GA1854360@linux.ibm.com> <9b7251d1-7b90-db4f-fa5e-80165e1cbb4b@oracle.com> <20210225085300.GB1854360@linux.ibm.com> <9973d0e2-e28b-3f8a-5f5d-9d142080d141@oracle.com> <20210225145700.GC1854360@linux.ibm.com> <20210225160706.GD1854360@linux.ibm.com> <6000e7fd-bf8b-b9b0-066d-23661da8a51d@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-02-26_02:2021-02-24,2021-02-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 priorityscore=1501 phishscore=0 spamscore=0 bulkscore=0 mlxscore=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102260085 X-Stat-Signature: foacbfjrbu9ktjb5ncu5118xq3puri7a X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 3A9D0E0011E2 Received-SPF: none (linux.ibm.com>: No applicable sender policy available) receiver=imf05; identity=mailfrom; envelope-from=""; helo=mx0a-001b2d01.pphosted.com; client-ip=148.163.156.1 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614338281-767865 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 Thu, Feb 25, 2021 at 08:19:18PM -0500, George Kennedy wrote: >=20 > Mike, >=20 > To get rid of the 0x00000000BE453000 hardcoding, I added the following = patch > to your above patch to get the iBFT table "address" to use with > memblock_reserve(): >=20 > diff --git a/drivers/acpi/acpica/tbfind.c b/drivers/acpi/acpica/tbfind.= c > index 56d81e4..4bc7bf3 100644 > --- a/drivers/acpi/acpica/tbfind.c > +++ b/drivers/acpi/acpica/tbfind.c > @@ -120,3 +120,34 @@ > =A0=A0=A0=A0 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); > =A0=A0=A0=A0 return_ACPI_STATUS(status); > =A0} > + > +acpi_physical_address > +acpi_tb_find_table_address(char *signature) > +{ > +=A0=A0=A0 acpi_physical_address address =3D 0; > +=A0=A0=A0 struct acpi_table_desc *table_desc; > +=A0=A0=A0 int i; > + > +=A0=A0=A0 ACPI_FUNCTION_TRACE(tb_find_table_address); > + > +printk(KERN_ERR "XXX acpi_tb_find_table_address: signature=3D%s\n", > signature); > + > +=A0=A0=A0 (void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES); > +=A0=A0=A0 for (i =3D 0; i < acpi_gbl_root_table_list.current_table_cou= nt; ++i) { > +=A0=A0=A0 =A0=A0=A0 if (memcmp(&(acpi_gbl_root_table_list.tables[i].si= gnature), > +=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0 signature, ACPI_NAMESEG_SIZE)) { > + > +=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 /* Not the requested table */ > + > +=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 continue; > +=A0=A0=A0 =A0=A0=A0 } > + > +=A0=A0=A0 =A0=A0=A0 /* Table with matching signature has been found */ > +=A0=A0=A0 =A0=A0=A0 table_desc =3D &acpi_gbl_root_table_list.tables[i]= ; > +=A0=A0=A0 =A0=A0=A0 address =3D table_desc->address; > +=A0=A0=A0 } > + > +=A0=A0=A0 (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); > +printk(KERN_ERR "XXX acpi_tb_find_table_address(EXIT): address=3D%llx\= n", > address); > +=A0=A0=A0 return address; > +} > diff --git a/drivers/firmware/iscsi_ibft_find.c > b/drivers/firmware/iscsi_ibft_find.c > index 95fc1a6..0de70b4 100644 > --- a/drivers/firmware/iscsi_ibft_find.c > +++ b/drivers/firmware/iscsi_ibft_find.c > @@ -28,6 +28,8 @@ >=20 > =A0#include >=20 > +extern acpi_physical_address acpi_tb_find_table_address(char *signatur= e); > + > =A0/* > =A0 * Physical location of iSCSI Boot Format Table. > =A0 */ > @@ -116,24 +118,32 @@ void __init reserve_ibft_region(void) > =A0{ > =A0=A0=A0=A0 struct acpi_table_ibft *table; > =A0=A0=A0=A0 unsigned long size; > +=A0=A0=A0 acpi_physical_address address; >=20 > =A0=A0=A0=A0 table =3D find_ibft(); > =A0=A0=A0=A0 if (!table) > =A0=A0=A0=A0 =A0=A0=A0 return; >=20 > =A0=A0=A0=A0 size =3D PAGE_ALIGN(table->header.length); > +=A0=A0=A0 address =3D acpi_tb_find_table_address(table->header.signatu= re); > =A0#if 0 > =A0printk(KERN_ERR "XXX reserve_ibft_region: table=3D%llx, > virt_to_phys(table)=3D%llx, size=3D%lx\n", > =A0=A0=A0=A0 (u64)table, virt_to_phys(table), size); > =A0=A0=A0=A0 memblock_reserve(virt_to_phys(table), size); > =A0#else > -printk(KERN_ERR "XXX reserve_ibft_region: table=3D%llx, 0x00000000BE45= 3000, > size=3D%lx\n", > -=A0=A0=A0 (u64)table, size); > -=A0=A0=A0 memblock_reserve(0x00000000BE453000, size); > +printk(KERN_ERR "XXX reserve_ibft_region: table=3D%llx, address=3D%llx= , > size=3D%lx\n", > +=A0=A0=A0 (u64)table, address, size); > +=A0=A0=A0 if (address) > +=A0=A0=A0 =A0=A0=A0 memblock_reserve(address, size); > +=A0=A0=A0 else > +=A0=A0=A0 =A0=A0=A0 printk(KERN_ERR "%s: Can't find table address\n", = __func__); > =A0#endif >=20 > -=A0=A0=A0 if (efi_enabled(EFI_BOOT)) > +=A0=A0=A0 if (efi_enabled(EFI_BOOT)) { > +printk(KERN_ERR "XXX reserve_ibft_region: calling acpi_put_table(%llx)= \n", > (u64)&table->header); > =A0=A0=A0=A0 =A0=A0=A0 acpi_put_table(&table->header); > -=A0=A0=A0 else > +=A0=A0=A0 } else { > =A0=A0=A0=A0 =A0=A0=A0 ibft_addr =3D table; > +printk(KERN_ERR "XXX reserve_ibft_region: ibft_addr=3D%llx\n", > (u64)ibft_addr); > +=A0=A0=A0 } > =A0} >=20 > Debug from the above: > [=A0=A0=A0 0.050646] ACPI: Early table checksum verification disabled > [=A0=A0=A0 0.051778] ACPI: RSDP 0x00000000BFBFA014 000024 (v02 BOCHS ) > [=A0=A0=A0 0.052922] ACPI: XSDT 0x00000000BFBF90E8 00004C (v01 BOCHS BX= PCFACP > 00000001=A0=A0=A0=A0=A0 01000013) > [=A0=A0=A0 0.054623] ACPI: FACP 0x00000000BFBF5000 000074 (v01 BOCHS BX= PCFACP > 00000001 BXPC 00000001) > [=A0=A0=A0 0.056326] ACPI: DSDT 0x00000000BFBF6000 00238D (v01 BOCHS BX= PCDSDT > 00000001 BXPC 00000001) > [=A0=A0=A0 0.058016] ACPI: FACS 0x00000000BFBFD000 000040 > [=A0=A0=A0 0.058940] ACPI: APIC 0x00000000BFBF4000 000090 (v01 BOCHS BX= PCAPIC > 00000001 BXPC 00000001) > [=A0=A0=A0 0.060627] ACPI: HPET 0x00000000BFBF3000 000038 (v01 BOCHS BX= PCHPET > 00000001 BXPC 00000001) > [=A0=A0=A0 0.062304] ACPI: BGRT 0x00000000BE49B000 000038 (v01 INTEL ED= K2=A0=A0=A0=A0 > 00000002=A0=A0=A0=A0=A0 01000013) > [=A0=A0=A0 0.063987] ACPI: iBFT 0x00000000BE453000 000800 (v01 BOCHS BX= PCFACP > 00000000=A0=A0=A0=A0=A0 00000000) > [=A0=A0=A0 0.065683] XXX acpi_tb_find_table_address: signature=3DiBFT > [=A0=A0=A0 0.066754] XXX acpi_tb_find_table_address(EXIT): address=3Dbe= 453000 > [=A0=A0=A0 0.067959] XXX reserve_ibft_region: table=3Dffffffffff240000, > address=3Dbe453000, size=3D1000 > [=A0=A0=A0 0.069534] XXX reserve_ibft_region: calling > acpi_put_table(ffffffffff240000) >=20 > Not sure if it's the right thing to do, but added > "acpi_tb_find_table_address()" to return the physical address of a tabl= e to > use with memblock_reserve(). >=20 > virt_to_phys(table) does not seem to return the physical address for th= e > iBFT table (it would be nice if struct acpi_table_header also had a > "address" element for the physical address of the table). virt_to_phys() does not work that early because then it is mapped with early_memremap() which uses different virtual to physical scheme. I'd say that acpi_tb_find_table_address() makes sense if we'd like to reserve ACPI tables outside of drivers/acpi.=20 But probably we should simply reserve all the tables during acpi_table_init() so that any table that firmware put in the normal memor= y will be surely reserved. =20 > Ran 10 successful boots with the above without failure. That's good news indeed :) > George > >=20 > >=20 --=20 Sincerely yours, Mike.