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=-9.2 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 autolearn=unavailable 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 E31E2C11F66 for ; Tue, 29 Jun 2021 13:15:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B3D5961D5D for ; Tue, 29 Jun 2021 13:15:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3D5961D5D 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=SArRkYWaB6V6NqfX5c1rC36pjq9KxpWtdi4V0qUumc0=; b=hopeDskGNIxdA6 T85TqdRb/Ynj3Gv9jbDyVtv1Hq80jZG0LdKSXqJRcxMvm/QLXLGlELH5B+rHUjgxxl0JkTnnOTyF/ SW3BxguafygiB5e8mXWM8q51QejA2zcthfrGziM2AZEYfJfv9oW2tSb14ez9YPz2hgS0HS/ra57/S fq0VPXpmb3qTPEGxDnexTjmrP6wWw0OF1cpBaX/iefeQxjZKNrugXgw0Jhh6nieiIGrU+ZIdWVip+ G93Fio80A3erRwhSnTL0NmZ2RN+DruAdTMIR8IgCd4nLYwOy4aOYAVt2unXrltAWN8VFG+r/TmKnf TrfXWvOgXNV5ZBeAKbww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyDXU-00Axhh-2R; Tue, 29 Jun 2021 13:12:32 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyDCP-00AsvV-Rh for linux-arm-kernel@lists.infradead.org; Tue, 29 Jun 2021 12:50:47 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15TCXShT141620; Tue, 29 Jun 2021 08:50:32 -0400 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 : in-reply-to; s=pp1; bh=CnbDDy1qBRTR6I8xPAryzlZwyz6haJ4TUbW322uchuY=; b=BT3HZMmm2+n8amin9lx3oRJCDnWvZnB4DEwGs8vkeNStDIOrEBcghhWkwIm0Yg+nRnEX gvKRL1Yd5Z+bOrCMChODJVewQzMGBGphBhGETFbcpTIyBGr8CbOl02O8TRKzVuSO49sy Ij0ZnGtdKxnuFgb2bsvAN8fQiQzd7VvKn+ZPeGQ7WGB39feM61rxMY9hyz4GSIIYFOb9 DsEycz/GqGaIHSNBEvv3+0k8wR9+B9IgyDOyV4QJZ6yA2h54QsE789dN3CQoTSIaNXvO rwj3/WP7CJx+U/T8xIda/agautIckqX2uZwlvxZuyYzzjO9yJFKhYgubekpX28Ortcse oA== Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 39g2ng26qh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Jun 2021 08:50:32 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 15TCllAA013222; Tue, 29 Jun 2021 12:50:30 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04ams.nl.ibm.com with ESMTP id 39duv8h9q5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Jun 2021 12:50:30 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15TCoRqA32244068 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 29 Jun 2021 12:50:27 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AEB8EA409A; Tue, 29 Jun 2021 12:50:23 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A130DA4094; Tue, 29 Jun 2021 12:50:22 +0000 (GMT) Received: from linux.ibm.com (unknown [9.145.56.105]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 29 Jun 2021 12:50:22 +0000 (GMT) Date: Tue, 29 Jun 2021 15:50:20 +0300 From: Mike Rapoport To: Tony Lindgren Cc: Mike Rapoport , linux-arm-kernel@lists.infradead.org, Andrew Morton , Kefeng Wang , Russell King , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-omap@vger.kernel.org, regressions@lists.linux.dev Subject: Re: [PATCH v2 3/3] arm: extend pfn_valid to take into accound freed memory map alignment Message-ID: References: <20210519141436.11961-1-rppt@kernel.org> <20210519141436.11961-4-rppt@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: v7hCJL7vrjg3_7YU6HWRhdA8vxTcIx80 X-Proofpoint-GUID: v7hCJL7vrjg3_7YU6HWRhdA8vxTcIx80 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-29_06:2021-06-28, 2021-06-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=815 spamscore=0 priorityscore=1501 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106290085 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210629_055046_270583_CF4F318F X-CRM114-Status: GOOD ( 30.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 29, 2021 at 02:52:39PM +0300, Tony Lindgren wrote: > * Mike Rapoport [210629 10:51]: > > As it seems, the new version of pfn_valid() decides that last pages are not > > valid because of the overflow in memblock_overlaps_region(). As the result, > > __sync_icache_dcache() skips flushing these pages. > > > > The patch below should fix this. I've left the prints for now, hopefully > > they will not appear anymore. > > Yes this allows the system to boot for me :) > > I'm still seeing these three prints though: > > ... > smp: Brought up 1 node, 2 CPUs > SMP: Total of 2 processors activated (3994.41 BogoMIPS). > CPU: All CPU(s) started in SVC mode. > pfn_valid(__pageblock_pfn_to_page+0x14/0xa8): pfn: afe00: is_map: 0 overlaps: 1 > pfn_valid(__pageblock_pfn_to_page+0x28/0xa8): pfn: affff: is_map: 0 overlaps: 1 > pfn_valid(__pageblock_pfn_to_page+0x38/0xa8): pfn: afe00: is_map: 0 overlaps: 1 These pfns do have memory map despite they are stolen in arm_memblock_steal(): memblock_free: [0xaff00000-0xafffffff] arm_memblock_steal+0x50/0x70 memblock_remove: [0xaff00000-0xafffffff] arm_memblock_steal+0x5c/0x70 ... memblock_free: [0xafe00000-0xafefffff] arm_memblock_steal+0x50/0x70 memblock_remove: [0xafe00000-0xafefffff] arm_memblock_steal+0x5c/0x70 But the struct pages there are never initialized. I'll resend v3 of the entire set with an addition patch to take care of that as well. > devtmpfs: initialized > ... > > Regards, > > Tony > > > > diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c > > index 6162a070a410..7ba22d23eca4 100644 > > --- a/arch/arm/mm/init.c > > +++ b/arch/arm/mm/init.c > > @@ -126,10 +126,16 @@ int pfn_valid(unsigned long pfn) > > { > > phys_addr_t addr = __pfn_to_phys(pfn); > > unsigned long pageblock_size = PAGE_SIZE * pageblock_nr_pages; > > + bool overlaps = memblock_overlaps_region(&memblock.memory, > > + ALIGN_DOWN(addr, pageblock_size), > > + pageblock_size - 1); > > > > if (__phys_to_pfn(addr) != pfn) > > return 0; > > > > + if (memblock_is_map_memory(addr) != overlaps) > > + pr_info("%s(%pS): pfn: %lx: is_map: %d overlaps: %d\n", __func__, (void *)_RET_IP_, pfn, memblock_is_map_memory(addr), overlaps); > > + > > /* > > * If address less than pageblock_size bytes away from a present > > * memory chunk there still will be a memory map entry for it > > @@ -137,7 +143,7 @@ int pfn_valid(unsigned long pfn) > > */ > > if (memblock_overlaps_region(&memblock.memory, > > ALIGN_DOWN(addr, pageblock_size), > > - pageblock_size)) > > + pageblock_size - 1)) > > return 1; > > > > return 0; > > > > -- > > Sincerely yours, > > Mike. -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel