Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp271110pxb; Thu, 25 Feb 2021 01:57:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJydz18SZXO8xdVW/GCItaTePsDEzZ1MuveW/I/qUeUyh4HoOoFPNv7pAPEyGHpSRdivh86/ X-Received: by 2002:a17:906:3916:: with SMTP id f22mr1909266eje.328.1614247074412; Thu, 25 Feb 2021 01:57:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614247074; cv=none; d=google.com; s=arc-20160816; b=GpfGHX9YRCOUtF44El+pUU+l6qNi8n5P8xEDaalJrGRRPgKJgc9MuQJNGp5uO+LrNI QhJxr8Ocza917hvk033ezI3moc8xh32jdwLVWyPzuizJBTY3P/2nz3gw8hUahkMGZ5sC F2Ii7YKD0JKbMW7AneoTaRpHP4954vrf3SELGZG2eToHZiWAJaVwMqqPIbw/WeF9/1vF OTxrGyWbsSfXQ/0bdL9jSLfLutieaEsQ07WVTaEQdu0aUxoQ/R47pdoSSiLB0QMlLKob 9HSbRT3YLjt4Do3kv4gzmGEk2IjIPPlWy2EzBYhtKFek6NZU0SlaqMUw2h169z7a52n+ uV1w== 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=h+Bg1KAb2M3NX3MNkh6cvynOcax+Mj6ebzjJBOaspRU=; b=SdE+7ZW4cCaqXNBsq0Q0E+69H9DBcOj0Al5U23nYOl/TaltWHCzdcIt97IQlAl9jSW BvaeUIzu9ubKYnvDy9LPcDURl+QO3AQnK1JomTpvBsdru5QqOomtnI50cc1xFf8b0EN4 YwLssXj5ayHCyu5Ev/k2LKifXzOtOqG79MFTHGK8VsH0zFe1tzbqv3zdFaINpM06dSrz zHMgkm1zLQsRn5PmYzAKH0oOjSaY1P6fhWz2ybHwIpvlZiki4Pp6TcCGrbxnMll/6zXC VO66/6dY1XVoLOpBCjhR+4spKjWi+rij1ithJ8nr2KGNf88jCTo9mh7z6r1JmkZu7EQ0 qYug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=j2PrgI5x; 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 j16si2900065edv.27.2021.02.25.01.57.32; Thu, 25 Feb 2021 01:57:54 -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=j2PrgI5x; 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 S234802AbhBYIy2 (ORCPT + 99 others); Thu, 25 Feb 2021 03:54:28 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:19848 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233906AbhBYIyZ (ORCPT ); Thu, 25 Feb 2021 03:54:25 -0500 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 11P8XKh7013629; Thu, 25 Feb 2021 03:53:11 -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=h+Bg1KAb2M3NX3MNkh6cvynOcax+Mj6ebzjJBOaspRU=; b=j2PrgI5xpGXEhkRZleg1bBeofB8RuM5Lqbkd24QyOk2tGuZuT/rI4cD+CJwscJNT8rdp NrqGb0MPkW0/jtikHAJoTru+LrAXaUIp0JD6rcyruLqb8qMlNV0w5bUtSh1pJWnHd1Qt auweF4qxTIaVXef28/JKFQXPm2UzK1oLqMvBrGNOL7yHgS74Bf5U0OxlzDg5gy5aLRVS Yr4JXC8TWXp89zgtgtaOaoQhisX1GW1m7G0mPrYgk3JJHE+rQ2E4/p37VHQNvM/bCLLL L+Jc7m/UmCDOsqN8wL7efVtsFXvBSnVoOHbi7HSZnk41/1uWZoEaXz7XMZ8lTDAfx6H3 UA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 36x0qrkupd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Feb 2021 03:53:10 -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 11P8rAmb089588; Thu, 25 Feb 2021 03:53:10 -0500 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 36x0qrkunc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Feb 2021 03:53:10 -0500 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 11P8mveG018466; Thu, 25 Feb 2021 08:53:07 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06ams.nl.ibm.com with ESMTP id 36tsph49cp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Feb 2021 08:53:07 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 11P8qqHB36569356 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Feb 2021 08:52:52 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5529F11C058; Thu, 25 Feb 2021 08:53:05 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 987D311C054; Thu, 25 Feb 2021 08:53:02 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.51.238]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 25 Feb 2021 08:53:02 +0000 (GMT) Date: Thu, 25 Feb 2021 10:53:00 +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: <20210225085300.GB1854360@linux.ibm.com> References: <20210223103321.GD1741768@linux.ibm.com> <3ef9892f-d657-207f-d4cf-111f98dcb55c@oracle.com> <20210223154758.GF1741768@linux.ibm.com> <3a56ba38-ce91-63a6-b57c-f1726aa1b76e@oracle.com> <20210223200914.GH1741768@linux.ibm.com> <20210223213237.GI1741768@linux.ibm.com> <450a9895-a2b4-d11b-97ca-1bd33d5308d4@oracle.com> <20210224103754.GA1854360@linux.ibm.com> <9b7251d1-7b90-db4f-fa5e-80165e1cbb4b@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9b7251d1-7b90-db4f-fa5e-80165e1cbb4b@oracle.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-02-25_04:2021-02-24,2021-02-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 malwarescore=0 priorityscore=1501 spamscore=0 clxscore=1015 phishscore=0 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102250071 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi George, > On 2/24/2021 5:37 AM, Mike Rapoport wrote: > > On Tue, Feb 23, 2021 at 04:46:28PM -0500, George Kennedy wrote: > > > Mike, > > > > > > Still no luck. > > > > > > [?? 30.193723] iscsi: registered transport (iser) > > > [?? 30.195970] iBFT detected. > > > [?? 30.196571] BUG: unable to handle page fault for address: ffffffffff240004 > > Hmm, we cannot set ibft_addr to early pointer to the ACPI table. > > Let's try something more disruptive and move the reservation back to > > iscsi_ibft_find.c. > > > > diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c > > index 7bdc0239a943..c118dd54a747 100644 > > --- a/arch/x86/kernel/acpi/boot.c > > +++ b/arch/x86/kernel/acpi/boot.c > > @@ -1551,6 +1551,7 @@ void __init acpi_boot_table_init(void) > > if (acpi_disabled) > > return; > > +#if 0 > > /* > > * Initialize the ACPI boot-time table parser. > > */ > > @@ -1558,6 +1559,7 @@ void __init acpi_boot_table_init(void) > > disable_acpi(); > > return; > > } > > +#endif > > acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); > > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c > > index d883176ef2ce..c615ce96c9a2 100644 > > --- a/arch/x86/kernel/setup.c > > +++ b/arch/x86/kernel/setup.c > > @@ -570,16 +570,6 @@ void __init reserve_standard_io_resources(void) > > } > > -static __init void reserve_ibft_region(void) > > -{ > > - unsigned long addr, size = 0; > > - > > - addr = find_ibft_region(&size); > > - > > - if (size) > > - memblock_reserve(addr, size); > > -} > > - > > static bool __init snb_gfx_workaround_needed(void) > > { > > #ifdef CONFIG_PCI > > @@ -1032,6 +1022,12 @@ void __init setup_arch(char **cmdline_p) > > */ > > find_smp_config(); > > + /* > > + * Initialize the ACPI boot-time table parser. > > + */ > > + if (acpi_table_init()) > > + disable_acpi(); > > + > > reserve_ibft_region(); > > early_alloc_pgt_buf(); > > diff --git a/drivers/firmware/iscsi_ibft_find.c b/drivers/firmware/iscsi_ibft_find.c > > index 64bb94523281..01be513843d6 100644 > > --- a/drivers/firmware/iscsi_ibft_find.c > > +++ b/drivers/firmware/iscsi_ibft_find.c > > @@ -47,7 +47,25 @@ static const struct { > > #define VGA_MEM 0xA0000 /* VGA buffer */ > > #define VGA_SIZE 0x20000 /* 128kB */ > > -static int __init find_ibft_in_mem(void) > > +static void __init *acpi_find_ibft_region(void) > > +{ > > + int i; > > + struct acpi_table_header *table = NULL; > > + acpi_status status; > > + > > + if (acpi_disabled) > > + return NULL; > > + > > + for (i = 0; i < ARRAY_SIZE(ibft_signs) && !ibft_addr; i++) { > > + status = acpi_get_table(ibft_signs[i].sign, 0, &table); > > + if (ACPI_SUCCESS(status)) > > + return table; > > + } > > + > > + return NULL; > > +} > > + > > +static void __init *find_ibft_in_mem(void) > > { > > unsigned long pos; > > unsigned int len = 0; > > @@ -70,35 +88,44 @@ static int __init find_ibft_in_mem(void) > > /* if the length of the table extends past 1M, > > * the table cannot be valid. */ > > if (pos + len <= (IBFT_END-1)) { > > - ibft_addr = (struct acpi_table_ibft *)virt; > > pr_info("iBFT found at 0x%lx.\n", pos); > > - goto done; > > + return virt; > > } > > } > > } > > } > > -done: > > - return len; > > + > > + return NULL; > > } > > + > > +static void __init *find_ibft(void) > > +{ > > + /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will > > + * only use ACPI for this */ > > + if (!efi_enabled(EFI_BOOT)) > > + return find_ibft_in_mem(); > > + else > > + return acpi_find_ibft_region(); > > +} > > + > > /* > > * Routine used to find the iSCSI Boot Format Table. The logical > > * kernel address is set in the ibft_addr global variable. > > */ > > -unsigned long __init find_ibft_region(unsigned long *sizep) > > +void __init reserve_ibft_region(void) > > { > > - ibft_addr = NULL; > > + struct acpi_table_ibft *table; > > + unsigned long size; > > - /* iBFT 1.03 section 1.4.3.1 mandates that UEFI machines will > > - * only use ACPI for this */ > > + table = find_ibft(); > > + if (!table) > > + return; > > - if (!efi_enabled(EFI_BOOT)) > > - find_ibft_in_mem(); > > - > > - if (ibft_addr) { > > - *sizep = PAGE_ALIGN(ibft_addr->header.length); > > - return (u64)virt_to_phys(ibft_addr); > > - } > > + size = PAGE_ALIGN(table->header.length); > > + memblock_reserve(virt_to_phys(table), size); > > - *sizep = 0; > > - return 0; > > + if (efi_enabled(EFI_BOOT)) > > + acpi_put_table(&table->header); > > + else > > + ibft_addr = table; > > } > > diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h > > index b7b45ca82bea..da813c891990 100644 > > --- a/include/linux/iscsi_ibft.h > > +++ b/include/linux/iscsi_ibft.h > > @@ -26,13 +26,9 @@ extern struct acpi_table_ibft *ibft_addr; > > * mapped address is set in the ibft_addr variable. > > */ > > #ifdef CONFIG_ISCSI_IBFT_FIND > > -unsigned long find_ibft_region(unsigned long *sizep); > > +void reserve_ibft_region(void); > > #else > > -static inline unsigned long find_ibft_region(unsigned long *sizep) > > -{ > > - *sizep = 0; > > - return 0; > > -} > > +static inline void reserve_ibft_region(void) {} > > #endif > > #endif /* ISCSI_IBFT_H */ > > Still no luck Mike, > > We're back to the original problem where the only thing that worked was to > run "SetPageReserved(page)" before calling "kmap(page)". The page is being > "freed" before ibft_init() is called as a result of the recent buddy page > freeing changes. I keep missing some little details each time :( Ok, let's try from the different angle. diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 4b9b329a5a92..ec43e1447336 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c @@ -7,6 +7,8 @@ * *****************************************************************************/ +#include + #include #include "accommon.h" #include "actables.h" @@ -339,6 +341,21 @@ acpi_tb_parse_root_table(acpi_physical_address rsdp_address) acpi_tb_parse_fadt(); } + if (ACPI_SUCCESS(status) && + ACPI_COMPARE_NAMESEG(&acpi_gbl_root_table_list. + tables[table_index].signature, + ACPI_SIG_IBFT)) { + struct acpi_table_header *ibft; + struct acpi_table_desc *desc; + + desc = &acpi_gbl_root_table_list.tables[table_index]; + status = acpi_tb_get_table(desc, &ibft); + if (ACPI_SUCCESS(status)) { + memblock_reserve(address, ibft->length); + acpi_tb_put_table(desc); + } + } + next_table: table_entry += table_entry_size; -- Sincerely yours, Mike.