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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 7E862C433DB for ; Fri, 26 Feb 2021 11:19:27 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E8FAF64EDC for ; Fri, 26 Feb 2021 11:19:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8FAF64EDC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4cP9wfxLv+OX2KxyLdjrA4ZylnQnv53Y9C6rYx6jsTU=; b=LfHCxdu5QZhVdpn6Uay7cyjHE tVjw3FrxNbM9cFgvtw9wH0M5STixXiWAiYeXag0E1vOFaP6TF7KiYSkVgRwq0z7sfnOqEqc8Lu/6n ko5F/Uvqdt36bnc5C/G2kVPlMKhIz9A/rR0hUtbGRi6Q2agex+6I30k2RIKwigKJlcNoSwDqnIsNy PPRyjtIjccGfyMMkmoFoJoT9arkKSD0EF5MWKOFV3oKgpjKlYJryADMvI+G7mJGxKNhktCgwtEwdq J9Le4LT1LIqrMiFrNwbdIjEi1UqWTC4bIj9mVhH4he86GV8m6WVuaUMKFOo4zrsOj9uasYdwrowNd wHeNSk5zQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lFb8K-0008DS-5B; Fri, 26 Feb 2021 11:18:08 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lFb8H-0008Cc-1U for linux-arm-kernel@lists.infradead.org; Fri, 26 Feb 2021 11:18:06 +0000 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 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-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210226_061805_243987_0DD0DF9D X-CRM114-Status: GOOD ( 35.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux ARM , Marco Elver , Dhaval Giani , David Hildenbrand , Andrey Konovalov , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev , LKML , Christoph Hellwig , Andrey Ryabinin , Alexander Potapenko , Evgenii Stepanov , Catalin Marinas , Konrad Rzeszutek Wilk , Andrew Morton , Vincenzo Frascino , Peter Collingbourne , Linux Memory Management List , Dmitry Vyukov Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi George, On Thu, Feb 25, 2021 at 08:19:18PM -0500, George Kennedy wrote: > = > Mike, > = > To get rid of the 0x00000000BE453000 hardcoding, I added the following pa= tch > to your above patch to get the iBFT table "address" to use with > memblock_reserve(): > = > 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_count= ; ++i) { > +=A0=A0=A0 =A0=A0=A0 if (memcmp(&(acpi_gbl_root_table_list.tables[i].sign= ature), > +=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 @@ > = > =A0#include > = > +extern acpi_physical_address acpi_tb_find_table_address(char *signature); > + > =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; > = > =A0=A0=A0=A0 table =3D find_ibft(); > =A0=A0=A0=A0 if (!table) > =A0=A0=A0=A0 =A0=A0=A0 return; > = > =A0=A0=A0=A0 size =3D PAGE_ALIGN(table->header.length); > +=A0=A0=A0 address =3D acpi_tb_find_table_address(table->header.signature= ); > =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, 0x00000000BE4530= 00, > 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 > = > -=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} > = > 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 BXPC= FACP > 00000001=A0=A0=A0=A0=A0 01000013) > [=A0=A0=A0 0.054623] ACPI: FACP 0x00000000BFBF5000 000074 (v01 BOCHS BXPC= FACP > 00000001 BXPC 00000001) > [=A0=A0=A0 0.056326] ACPI: DSDT 0x00000000BFBF6000 00238D (v01 BOCHS BXPC= DSDT > 00000001 BXPC 00000001) > [=A0=A0=A0 0.058016] ACPI: FACS 0x00000000BFBFD000 000040 > [=A0=A0=A0 0.058940] ACPI: APIC 0x00000000BFBF4000 000090 (v01 BOCHS BXPC= APIC > 00000001 BXPC 00000001) > [=A0=A0=A0 0.060627] ACPI: HPET 0x00000000BFBF3000 000038 (v01 BOCHS BXPC= HPET > 00000001 BXPC 00000001) > [=A0=A0=A0 0.062304] ACPI: BGRT 0x00000000BE49B000 000038 (v01 INTEL EDK2= =A0=A0=A0=A0 > 00000002=A0=A0=A0=A0=A0 01000013) > [=A0=A0=A0 0.063987] ACPI: iBFT 0x00000000BE453000 000800 (v01 BOCHS BXPC= FACP > 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=3Dbe45= 3000 > [=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) > = > Not sure if it's the right thing to do, but added > "acpi_tb_find_table_address()" to return the physical address of a table = to > use with memblock_reserve(). > = > virt_to_phys(table) does not seem to return the physical address for the > 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. = But probably we should simply reserve all the tables during acpi_table_init() so that any table that firmware put in the normal memory will be surely reserved. = > Ran 10 successful boots with the above without failure. That's good news indeed :) > George > > = > > = -- = Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel