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 52B53C433E0 for ; Thu, 25 Feb 2021 14:59:10 +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 C0D9D64E83 for ; Thu, 25 Feb 2021 14:59:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0D9D64E83 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=yxZWGsrn8kb/TlLRzhPO40EcCXUau2OVKxEYm9KUaIg=; b=iBarCr3ES866wo4ZTpjlYyQFB ruzr/X1llyGFtRiDS226K9UcLuMABuOwU+E71tgKYjsp3AmMUsYnH7btyNHFCfWzigjvSJPDgr4TV W4eWz+x1/W+o64SaK36KjBj+Ke9vsbWE7mIVyW0hT31+x8OgS4SFhjGBEUHlse8amRAgQqHNB6YsW FPgtpagIxE3Gpj8e+nnABU35zwcs9pW5vObt6B5qncwWRiGc7KANAvE5DGhCQVwZBn2MX8EtCMYNa 1tKqrHqLGvQuzXAJ+BEhWpHnRKhSHBwo3QVZQHxkKYuYnooPDlAAy5vh8RnGCcAoOqZYiE3cBbdmr A7S90AbJg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lFI5D-0003O6-Rn; Thu, 25 Feb 2021 14:57:39 +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 1lFI5A-0003NH-Vb for linux-arm-kernel@lists.infradead.org; Thu, 25 Feb 2021 14:57:38 +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 11PElcBD053797; Thu, 25 Feb 2021 09:57: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=mMaj3P4SrpEf4+/aFD9uJ8yy0sa8Fh7SEIG9gR0/fc4=; b=kPXWWFBO5oSOPAtgrNz5L7J9rw6mP1F9ecM/GRT4n+GL8N1FYMIj03PvLb53vcHGILlE t+rsEVxO8ALqtxvG0ybGu7D6QU7Vda7vLNjd9ng4DTURAUQqk9lg/HAh4tZ7iFyn2Vz0 jWkvGwXwKANvkq/YHdCMVd8F2ubczERvUPChY2ZJRtNBoo/LiKvZXvlUAhU3oGQ34JZs xedYVfhwGaUSg42QEsxzg8YKjxYlSAfAS4aLItrLZUr+wmQrrjgCBPPIYxoS1/CYCmkL OTQvhN5HTURH204HRrkHNCUV8KUm6/GKszGgDLxHPS8LmTLZ0KBs6O58TdBtg2S03GGH VA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 36xdpws3gg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Feb 2021 09:57:11 -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 11PEmLqW059649; Thu, 25 Feb 2021 09:57:10 -0500 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 36xdpws3fa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Feb 2021 09:57:10 -0500 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 11PEqPQp012125; Thu, 25 Feb 2021 14:57:07 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma02fra.de.ibm.com with ESMTP id 36tt28actd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Feb 2021 14:57:07 +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 11PEv5BL43319776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Feb 2021 14:57:05 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 74F36AE053; Thu, 25 Feb 2021 14:57:05 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1D106AE04D; Thu, 25 Feb 2021 14:57:03 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.51.238]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 25 Feb 2021 14:57:02 +0000 (GMT) Date: Thu, 25 Feb 2021 16:57:00 +0200 From: Mike Rapoport To: George Kennedy Subject: Re: [PATCH] mm, kasan: don't poison boot memory Message-ID: <20210225145700.GC1854360@linux.ibm.com> References: <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> <20210225085300.GB1854360@linux.ibm.com> <9973d0e2-e28b-3f8a-5f5d-9d142080d141@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <9973d0e2-e28b-3f8a-5f5d-9d142080d141@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_09:2021-02-24, 2021-02-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 suspectscore=0 malwarescore=0 impostorscore=0 bulkscore=0 adultscore=0 priorityscore=1501 mlxscore=0 clxscore=1015 phishscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102250118 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210225_095737_178816_9B1E8BF4 X-CRM114-Status: GOOD ( 43.27 ) 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 On Thu, Feb 25, 2021 at 07:38:19AM -0500, George Kennedy wrote: > On 2/25/2021 3:53 AM, Mike Rapoport wrote: > > 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. > > > > > = > > > > > [=A0=A0 30.193723] iscsi: registered transport (iser) > > > > > [=A0=A0 30.195970] iBFT detected. > > > > > [=A0=A0 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/boo= t.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 =3D 0; > > > > - > > > > - addr =3D 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 =3D NULL; > > > > + acpi_status status; > > > > + > > > > + if (acpi_disabled) > > > > + return NULL; > > > > + > > > > + for (i =3D 0; i < ARRAY_SIZE(ibft_signs) && !ibft_addr; i++) { > > > > + status =3D 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 =3D 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 <=3D (IBFT_END-1)) { > > > > - ibft_addr =3D (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 =3D 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 =3D find_ibft(); > > > > + if (!table) > > > > + return; > > > > - if (!efi_enabled(EFI_BOOT)) > > > > - find_ibft_in_mem(); > > > > - > > > > - if (ibft_addr) { > > > > - *sizep =3D PAGE_ALIGN(ibft_addr->header.length); > > > > - return (u64)virt_to_phys(ibft_addr); > > > > - } > > > > + size =3D PAGE_ALIGN(table->header.length); > > > > + memblock_reserve(virt_to_phys(table), size); > > > > - *sizep =3D 0; > > > > - return 0; > > > > + if (efi_enabled(EFI_BOOT)) > > > > + acpi_put_table(&table->header); > > > > + else > > > > + ibft_addr =3D 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 =3D 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 w= as 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 :( > No worries. Thanks for all your help. Does this patch go on top of your > previous patch or is it standalone? This is standalone. = > George > > Ok, let's try from the different angle. > > = > > diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutil= s.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 rsd= p_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 =3D &acpi_gbl_root_table_list.tables[table_index]; > > + status =3D acpi_tb_get_table(desc, &ibft); > > + if (ACPI_SUCCESS(status)) { > > + memblock_reserve(address, ibft->length); > > + acpi_tb_put_table(desc); > > + } > > + } > > + > > next_table: > > table_entry +=3D table_entry_size; > > = > > = > = -- = Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel