Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp251856ybk; Sat, 9 May 2020 01:45:23 -0700 (PDT) X-Google-Smtp-Source: APiQypJHKYkfuuIRGccmtbDBw7RiwnlUqYvROGusSbEtD21az1GU1pI1vs8CbA8Nf9t1J+E1+374 X-Received: by 2002:a17:906:1ec3:: with SMTP id m3mr5413139ejj.88.1589013923338; Sat, 09 May 2020 01:45:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589013923; cv=none; d=google.com; s=arc-20160816; b=UA7Vie/zbssYTIXRYeMX8zJhVMQ/Cm5CuQ61cb5IbQfgKl2k4wBKWjYdYdrhHFHkpW WVEwFa0c1uZKKCCAjdX+Y9L7A+KLmB7JWLiNm9VXyvElz+WwsQJHqptSF8DNslLqhmUy o6r4IWwFIrkgqiXmWiKgurpwV982L/3rqLEiSu5Gf23OlaouBMma7YK5HQNCkM4FBeAE h3WKSLHdwEIlcFz+EeP2ufST8KVa6NaMAeArM6/pfBx3qV9YwXjDc5CFkkH7/dzG5KPY 5vM4/2kgsHr9v+81jT+Tx5J2Oek3usdNea8dhoIwCBF+yQHOqJvnsv9Rade5X3czJNYl CJdw== 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:message-id :mime-version:in-reply-to:references:cc:to:subject:from:date :dkim-signature; bh=MM0pGuoQz+m2i7SaYQltsjhcG+vuQhDEB07kHe3ONp0=; b=tA+1AM6zCUhUTqY2Ys/DAV4ESL5dyvw36XwVr0dPLkE9DMTxIA/s3tOrf+M6u04edy XmtggSyXvTuq2sG60wnc3EFpKOC1sDmQlSGbrWRbjxWRYNFICoTsgQMe9W0Aw2U8kVVJ /lAfc3Ci4fiYdNxlNB5aclt5weY444lnbIBRfhzdxGSQkHLg+j87rwmOck5/t4+Rl+ls 6sHXPjnBQnMARW7cC5FLI6NYCVGONgdaouce+nPeymSTRWU66Zi+mtp+aTkqMgwUEWhI UE6ftvpNtIQsJKXg4lIKeZ3CQzkodc4o8Vxmk6sHvZFYK+P+8FjCOCVVEZaCoDGkbCih 5ZWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kcvLKoGH; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o18si2280220ejr.273.2020.05.09.01.45.00; Sat, 09 May 2020 01:45:23 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=kcvLKoGH; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727815AbgEIInh (ORCPT + 99 others); Sat, 9 May 2020 04:43:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726063AbgEIInh (ORCPT ); Sat, 9 May 2020 04:43:37 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D708AC061A0C for ; Sat, 9 May 2020 01:43:36 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id f15so1777646plr.3 for ; Sat, 09 May 2020 01:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=MM0pGuoQz+m2i7SaYQltsjhcG+vuQhDEB07kHe3ONp0=; b=kcvLKoGHrq9a+5FfTP8I/NSRlRWu8KC1v695rjWAb9PcXDvN9fvLTi2oFBnMQCjBOY EPu3A2k0S9rM8sVRt4AllKRGzkMHa+mCg07kNipoGXPLoIxr1zaKy3OPelFzOOmwND7+ cgkpVRemAhJ+yVySh/spOAaQ5wnLx3cu0pfxBJXEAP3lXJPmIXNN+mJf1OtqtiHIfG7S tXDRZBpYBb5eY7ddn+nJ/QeJl3ZniXG4JIaqkvaRwTvEcD3UFG+JGxjLmBFn9rzxPHlj TqFHybaSAf2rwWCCo8B7A4jeFE8p5+QkzdYbyT/6RuaJA8ed/2SRuqa7RBk6ZKovLbLK JJDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=MM0pGuoQz+m2i7SaYQltsjhcG+vuQhDEB07kHe3ONp0=; b=KFmch7KBx8Dl1qysFsOwVqnF+t5YXTR1jU4w1bU3IJE+G+f8R7QieugYcc9mnEieCk 4OexisEA9isBojnSEqz4AJIMuZwxRPZc35zqy/5idqvE7iwxp8hRajGpLXJKd9rse6+r dDtNPVAnUCf3u70Z1SLh698mNAGNQRsiBTbacG/S5iP3y0NNAQJ0YfjXeV5iHKVd64CB kLIareKxsM1CuOentobEjDSCq1AkQNmAJzJacSzYT9hRDxRT4pWphxppV8BYmNo5zZ1n JDrJbWo+233D+jYeTGecLqDIxGuHJNPJXvSLyExxPtdAdroTt8TExD6aFU/BHUVyJwfQ 5SPQ== X-Gm-Message-State: AGi0PuZ1r8dSvdqEnvlvGgMNjRwB0SFhC4ZQDdLD85AV3Mahum4G5OaD Lc0lHBTKTcBVZ3eyTwWN8kU= X-Received: by 2002:a17:90a:f40f:: with SMTP id ch15mr6228382pjb.178.1589013816321; Sat, 09 May 2020 01:43:36 -0700 (PDT) Received: from localhost (61-68-214-199.tpgi.com.au. [61.68.214.199]) by smtp.gmail.com with ESMTPSA id v9sm4218268pju.3.2020.05.09.01.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 01:43:35 -0700 (PDT) Date: Sat, 09 May 2020 18:43:30 +1000 From: Nicholas Piggin Subject: Re: ioremap() called early from pnv_pci_init_ioda_phb() To: Qian Cai , Oliver O'Halloran Cc: LKML , linuxppc-dev References: In-Reply-To: MIME-Version: 1.0 Message-Id: <1589013519.0fzm2px5cz.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Excerpts from Oliver O'Halloran's message of May 9, 2020 6:11 pm: > On Sat, May 9, 2020 at 12:41 AM Qian Cai wrote: >> >> Booting POWER9 PowerNV has this message, >> >> "ioremap() called early from pnv_pci_init_ioda_phb+0x420/0xdfc. Use earl= y_ioremap() instead=E2=80=9D >> >> but use the patch below will result in leaks because it will never call = early_iounmap() anywhere. However, it looks me it was by design that phb->r= egs mapping would be there forever where it would be used in pnv_ioda_get_i= nval_reg(), so is just that check_early_ioremap_leak() initcall too strong? >=20 > The warning there is junk. The PHBs are setup at boot and never torn > down so we're not "leaking" the mapping. It's supposed to be there for > the lifetime of the kernel. >=20 > That said, we could probably move the PCI setup to a point later in > boot where the normal ioremap can be be used. We would have to check > for initcalls which depend on the PHBs being setup and delay those too > though. I think it helps to unify code a bit more and take special cases out of=20 ioremap to have all these early calls use early_ioremap. We actually do want to move these later if possible too, on radix they=20 use memblock for page tables, and on hash they don't even set up proper=20 kernel page tables but just bolt PTEs into the hash table. Thanks, Nick