Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2870412ybi; Mon, 1 Jul 2019 21:14:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxnA1xrb2jLlwtWiMFob3g9CVWx87r2O8N4gUXmT2sO2+RvPRLae4InCj0KqV7uyYMc2+t X-Received: by 2002:a65:534c:: with SMTP id w12mr16113519pgr.51.1562040862308; Mon, 01 Jul 2019 21:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562040862; cv=none; d=google.com; s=arc-20160816; b=NphMbDv3qVP5MW8JNfW/3wskbC43CfcB2iNfzxz2ZEIkkbLz+riCzH2vK9fm1EdmX6 MDq6km+BftEk0r0bgWnXculAVSSK+GIP4fnQb+oEEo2zFGrSyYa/NlXni3jVn/hsNA9H 4SHJWlc8INOd/mkDnbp6dpyzSHuiG8UcasR7SfgIHzM/CjsHocF2v2GCYvGqUDlXeuL2 u296XDHlaXqQXkFjX3KFhKfQApIxcV47x1qbCCI7HkLZl4NSrwnkoWJa7hPhRZf7umJW M6HoflwDlFzMUxYmIizBsS0+4rOKcb/dTdWxKrooKW/ePUigpMxByeJ61ROwink+tC95 1d8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=M6+IFkGyXR9MyOVq05gNBUTwyK1bYAze/nQ/+nF11mU=; b=QonPcysHvByffFf7YDPEC+51L56j8J0cGJP7KEFR1ikT217TCNPjfzWh4aPdrUsvIl GnQ+sgDup9l/62Jc2ZsBOw/SD6i0xNWtQyL8kDxyn/9SO3/Kg+aRpxraD0j2oz2vntPf 0tCct1rvOdagFokMM7C3nClNX1Xm0UEfsE4xz3tSof/dmtDdqYwvY/h8RKp5nIa1TS69 V53spwDETpH4D/cq98hvbK1rJUFCbkEFufzjP3/bAuT/gaz49yKtZj75fDz9JLkC6uxq 6BKGpOVzRZJIe1m6/5XLrYrfrtZEv8QeMLuI5Mn0ciNLVFlUnaiwFOElkYRoZnV3t+nO WEAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@d-silva.org header.s=201810a header.b=bDHRQdKU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si13815082pfj.93.2019.07.01.21.14.07; Mon, 01 Jul 2019 21:14:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@d-silva.org header.s=201810a header.b=bDHRQdKU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725812AbfGBENs (ORCPT + 99 others); Tue, 2 Jul 2019 00:13:48 -0400 Received: from ushosting.nmnhosting.com ([66.55.73.32]:54194 "EHLO ushosting.nmnhosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725648AbfGBENr (ORCPT ); Tue, 2 Jul 2019 00:13:47 -0400 Received: from mail2.nmnhosting.com (unknown [202.169.106.97]) by ushosting.nmnhosting.com (Postfix) with ESMTPS id 7EC042DC009C; Tue, 2 Jul 2019 00:13:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=d-silva.org; s=201810a; t=1562040826; bh=gOEG661SveNiRUPN4YMnmMb923gb3S61Z9MG7QJfB3A=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=bDHRQdKUivQd0Z9H/c1TnPWau75xz43TVHbwOKn+JVuDU9sbeEYEAJnkGuZ16BW5Z tIpz0lRWdV0z7o4K4qAoePqu2rvAvVBoIMraIxyQkSw1JmxzVePCcJ2ovqgdsCN5FP f52/dPn/UgaFcen+hbl+zNyjof+c8ZXTdwvCnlrx6Z2IIjDVFEtl7pebobZiwXkHw2 OgN6oBobxWQa4kpJCf9nNkao7jSSZLFj4dXaO0CRRjuD1PSSs/TTMt81tDo8mw4urZ azwP/bYvmBFXcn1cBpYK41rexObSU/csVCrygxEBCC4/qVa5QThohe1oVHDj1iOr9o M/3fNMusHv9He8Rm2xmjVcYmo10f3etlIXVh8Ny63kQ41DRKPOypMmC4f3BoVziny1 mLhITM6P2L+/MTXJlDawc3qws6rCIn+Hh7lGvKEtF4kKm7OefNrxDEqZicDD0J/h0g ywonyQE7d9Pw4fCJmmDTqEloUDNpAdBMxq6KtbvekBfoRQNTGVsd25+b9YebxlxWcN G+vtLZ7mh8uhwU5USgEQLufzY7ujxc3u/Kv6jg/cu47fGAGjXg/mTkuFkHT4OTyDh9 b6XZmUuh3k0cZDCj4tSdgV13oIxCWJRDnF28/3T9YcjkIN4yT/6rqMoj9ndpD7GNEY 4DPLhPZw4sTeT1KYgYNvv9jY= Received: from adsilva.ozlabs.ibm.com (static-82-10.transact.net.au [122.99.82.10] (may be forged)) (authenticated bits=0) by mail2.nmnhosting.com (8.15.2/8.15.2) with ESMTPSA id x624DPBD084759 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Tue, 2 Jul 2019 14:13:41 +1000 (AEST) (envelope-from alastair@d-silva.org) Message-ID: <7f0ac9250e6fe6318aaf0685be56b121a978ce1b.camel@d-silva.org> Subject: Re: [PATCH v2 1/3] mm: Trigger bug on if a section is not found in __section_nr From: "Alastair D'Silva" To: Michal Hocko Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Andrew Morton , Pavel Tatashin , Oscar Salvador , Mike Rapoport , Baoquan He , Wei Yang , Logan Gunthorpe , linux-kernel@vger.kernel.org, linux-mm@kvack.org Date: Tue, 02 Jul 2019 14:13:25 +1000 In-Reply-To: <20190701104658.GA6549@dhcp22.suse.cz> References: <20190626061124.16013-1-alastair@au1.ibm.com> <20190626061124.16013-2-alastair@au1.ibm.com> <20190626062113.GF17798@dhcp22.suse.cz> <20190626065751.GK17798@dhcp22.suse.cz> <20190627080724.GK17798@dhcp22.suse.cz> <833b9675bc363342827cb8f7c76ebb911f7f960d.camel@d-silva.org> <20190701104658.GA6549@dhcp22.suse.cz> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.2 (3.32.2-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail2.nmnhosting.com [10.0.1.20]); Tue, 02 Jul 2019 14:13:42 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-07-01 at 12:46 +0200, Michal Hocko wrote: > On Fri 28-06-19 10:46:28, Alastair D'Silva wrote: > [...] > > Given that there is already a VM_BUG_ON in the code, how do you > > feel > > about broadening the scope from 'VM_BUG_ON(!root)' to > > 'VM_BUG_ON(!root > > > > (root_nr == NR_SECTION_ROOTS))'? > > As far as I understand the existing VM_BUG_ON will hit when the > mem_section tree gets corrupted. This is a different situation to an > incorrect section given so I wouldn't really mix those two. And I > still > do not see much point to protect from unexpected input parameter as > this > is internal function as already pointed out. > Hi Michael, I was able to hit this problem as the system firmware had assigned the prototype pmem device an address range above the 128TB limit that we originally supported. This has since been lifted to 2PB with patch 4ffe713b7587b14695c9bec26a000fc88ef54895. As it stands, we cannot move this range lower as the high bits are dictated by the location the card is connected. Since the physical address of the memory is not controlled by the kernel, I believe we should catch (or at least make it easy to debug) the sitution where external firmware allocates physical addresses beyond that which the kernel supports. -- Alastair D'Silva mob: 0423 762 819 skype: alastair_dsilva Twitter: @EvilDeece blog: http://alastair.d-silva.org