Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2750711pxb; Sun, 28 Feb 2021 12:00:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAsQLuAGtYnLdrL1p/FR0EWBg4Qnv2UvulEgVRDXuAPZEk1ZgSx+ogt7JU364jL86KOOca X-Received: by 2002:a17:907:2d93:: with SMTP id gt19mr12687046ejc.246.1614542427435; Sun, 28 Feb 2021 12:00:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614542427; cv=none; d=google.com; s=arc-20160816; b=IqXTwfzfN0DKQrgnVAtPJnI5oIJRZTpqZGQIjJMZpOHFwME6n5khW/pPZjU7Tk3M6M JNC6iHlkUDLYCJplCYLVbXsAEO90gQcTFf3D9K5JNJALpE5dmmuULBhpIibC5idZx6ei OAUGZRarFzOO0enKCDYA9oq+MjPR5utOW07XcYnSQUzsmSHEvHqNR7j3TNOshvyXqy4+ +yyJk9QtCnph5d9J28eWGQ03ka/9WqEog8p+YzvZOLCgr2B26WWedeA3y9inWAyxGMpi s1ss5fMWS6hMGZhzG4NWcZeQSJV5n2ab1C++u3I3rwlllOZD4Avye81hJVM9TA4GUfF2 8+yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4bb935c/UZyEQhCai159ASVF1c2deNbr/2p5TWhmbJc=; b=vixyO/fVfzZnpjYYmuwC1ME2YLBDzZ0zXhdrcxUAElI55pgQcWWG7cUyCInHadzzAy HNjDA4VxO/K5Jo+AzVATHXptYTazQpJqyEffIcYOQ4dxm5KZF/G0symS2PgpJzV04rqV oY0WPomvMiuA//5FysI5SA3I4ZLI6iFgDU6rEPhULOmswwUh+ocVD+dlG1wqNSFjC7+s lGkWIwB1vuynYUJ1C1CvuXQ3Ik1quKeR6zqf9N/CtHg8EVmqBbARXxXArMh12HvQDwwG XhoZG90XSlzDRy67VH9230tSSjFrIMr0rSiQ85vELx+tCSEnoeFFuKuPvH2i+oMzwNwk MubQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YE21XdX4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d5si9789953eja.499.2021.02.28.11.59.38; Sun, 28 Feb 2021 12:00:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YE21XdX4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231400AbhB1SJu (ORCPT + 99 others); Sun, 28 Feb 2021 13:09:50 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59438 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231295AbhB1SJt (ORCPT ); Sun, 28 Feb 2021 13:09:49 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11SI4TRM141005; Sun, 28 Feb 2021 13:08:41 -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=4bb935c/UZyEQhCai159ASVF1c2deNbr/2p5TWhmbJc=; b=YE21XdX46aBFkYH+sul7Ck3aEc2l0vgnZmGUCKfZQ2CaRwZPVfLVpv+vwEFSVj1Ek63z p+y7Y8aCs0OIbCj/QQekJTEBPA15o9aCKHcGOsYDk4N045E/wAuxVQlwzOpS5nFWdVbi CKgWrKtRfQ/aVZgoXfZSdCbWjlyT2BEpSgFe0UMVIvX2soiyB5K6hOjEsZGMAozTn0fl BaXW5MdQaKY60GGZBPit4bv5p23ZiCc8qgCHswTqKg1/pfZjFEZ02/WJkLVvjkDj1LDi 1UxXog3LZMHNPzICgDfUacOFhNPsnJ0jlJLVUFb4Xim3uFTliNYOVn3cTaNVdMWWGqNY IA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 370410w9v2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 28 Feb 2021 13:08:41 -0500 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 11SI4iI1141354; Sun, 28 Feb 2021 13:08:40 -0500 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 370410w9u7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 28 Feb 2021 13:08:40 -0500 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 11SI2b3G020519; Sun, 28 Feb 2021 18:08:38 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03ams.nl.ibm.com with ESMTP id 36ydq893ed-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 28 Feb 2021 18:08:37 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 11SI8Zsh31588766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 28 Feb 2021 18:08:35 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C302BAE045; Sun, 28 Feb 2021 18:08:35 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7A0D7AE051; Sun, 28 Feb 2021 18:08:33 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.18.192]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Sun, 28 Feb 2021 18:08:33 +0000 (GMT) Date: Sun, 28 Feb 2021 20:08:31 +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: References: <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> <20210226111730.GL1854360@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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-28_07:2021-02-26,2021-02-28 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 adultscore=0 priorityscore=1501 spamscore=0 impostorscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102280156 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 26, 2021 at 11:16:06AM -0500, George Kennedy wrote: > On 2/26/2021 6:17 AM, Mike Rapoport wrote: > > Hi George, > > > > On Thu, Feb 25, 2021 at 08:19:18PM -0500, George Kennedy wrote: > > > > > > 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 :) > > Wondering if we could do something like this instead (trying to keep changes > minimal). Just do the memblock_reserve() for all the standard tables. I think something like this should work, but I'm not an ACPI expert to say if this the best way to reserve the tables. > diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c > index 0bb15ad..830f82c 100644 > --- a/drivers/acpi/acpica/tbinstal.c > +++ b/drivers/acpi/acpica/tbinstal.c > @@ -7,6 +7,7 @@ > ? * > *****************************************************************************/ > > +#include > ?#include > ?#include "accommon.h" > ?#include "actables.h" > @@ -14,6 +15,23 @@ > ?#define _COMPONENT????????? ACPI_TABLES > ?ACPI_MODULE_NAME("tbinstal") > > +void > +acpi_tb_reserve_standard_table(acpi_physical_address address, > +??? ??? ??? ?? struct acpi_table_header *header) > +{ > +??? struct acpi_table_header local_header; > + > +??? if ((ACPI_COMPARE_NAMESEG(header->signature, ACPI_SIG_FACS)) || > +??? ??? (ACPI_VALIDATE_RSDP_SIG(header->signature))) { > +??? ??? return; > +??? } > +??? /* Standard ACPI table with full common header */ > + > +??? memcpy(&local_header, header, sizeof(struct acpi_table_header)); > + > +??? memblock_reserve(address, PAGE_ALIGN(local_header.length)); > +} > + > ?/******************************************************************************* > ? * > ? * FUNCTION:??? acpi_tb_install_table_with_override > @@ -58,6 +76,9 @@ > ???? ??? ??? ??? ????? new_table_desc->flags, > ???? ??? ??? ??? ????? new_table_desc->pointer); > > +??? acpi_tb_reserve_standard_table(new_table_desc->address, > +??? ??? ??? ??? ?? new_table_desc->pointer); > + > ???? acpi_tb_print_table_header(new_table_desc->address, > ???? ??? ??? ??? ?? new_table_desc->pointer); > > 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. 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. > Ran 10 boots with the above without failure. > > George -- Sincerely yours, Mike.