Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1376593ybg; Thu, 4 Jun 2020 08:12:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwF9jo7HfdIYltwZx10yWNEr/Iazb+3pntlFc7HLX5PAP94/ifAx58YtP2d8DEyRze7NezK X-Received: by 2002:a17:906:5590:: with SMTP id y16mr4546570ejp.228.1591283565583; Thu, 04 Jun 2020 08:12:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591283565; cv=none; d=google.com; s=arc-20160816; b=O/1Cg1qj2thktVOO8WLtsekmaGLHMg4k+PfVcMZhDJG0kZQAcb2jXD1x7kjnwiJDzF 25/XHLaVvZmdGpH4MnBph51dMhjYIO+zP6rHtgK2g4sm9kYeZrm+yd94CNoJw0xzFMF2 leJOMD1+dtVCQ+xLtm4UVwxYDoHaG0eRXFXvMkOrzszQS3ZwZzUo+ugpkTVpIB3rtdWP +SIaThy2yJRCU9IHzdV3LbuL3/zRqkEaeP7d2J15IZ3gF3blUlIs8GVKdcqGLszKm732 gFrB4OIQTi4TK0XF9/VwNjv1W3uNR20cRAsxIocNpOLv/w4frNijgmvB0WAS98TT6H18 x7Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=mG7D+jRYpSS5Y4OVIdfZqG69AgF0Bh19MVMpT/Ilvms=; b=lBX/7l6U6st+VMxYYGtspRXjpuaVg4AGN1AdUBRBHl/f43U8WRgYIPqPXV0D9X9RiJ ZDSfVyNPSKw3qtWE9yEpqB/HyM7EqP5r2rXApi3E1hdYlSGCdKqLlU14TiO7PN8O7ti5 KT+hJ4H3QgVtGNgKj4zaZiLk8CbGzXKbjFNL4vM+gxUbSg72S+AZ+o6d8upSUzr0zn5R hcrZkresk29HiqcloItbAPVSrES3MT1JS249Sx2J7Y68EmXqtQYhc+bKbHypZPWR5x2U sSXIZxV66chTw9klydwpjdvstDIV94VbiSZ5mKdJ9xSaAZbv8Ag41Z3yGyuIMMGClZ2I s4kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=DwodH1gG; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h19si1831449ejd.365.2020.06.04.08.12.22; Thu, 04 Jun 2020 08:12:45 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=DwodH1gG; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729305AbgFDPGu (ORCPT + 99 others); Thu, 4 Jun 2020 11:06:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729107AbgFDPGt (ORCPT ); Thu, 4 Jun 2020 11:06:49 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBADAC08C5C0 for ; Thu, 4 Jun 2020 08:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mG7D+jRYpSS5Y4OVIdfZqG69AgF0Bh19MVMpT/Ilvms=; b=DwodH1gGIjv40L+PhfWicphFbx L5Z7b3GpAuWb46yYc5ODv3xP+8dgv15FmsYeJFocfnSI7z+I4gPK9mheD3eUZt6qcUTA3vG+E7ztE 2AW5EznqM9mp1JesX5GoV7c1VvYvJkk2mz516slHkUVfO+DHtGJS4xZkBq4YiM9vW2uD8ZVjFCDK4 JZogr9lWJ74maHopDVAhQp0uKdnPVBrZUQenuz/5mHQ1ZkKDvh43e5oCFL9NPq5AKozm4d269Vipk ctlqUTa3Bq68LHEsMO6yea9qAjPF3yP4s1rZmRV5v9mY3eZzGi5R/RVpxQor/Y4XugO5QlyuT2/Pe SQO0YF9A==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jgrS7-0008Be-4R; Thu, 04 Jun 2020 15:06:43 +0000 Date: Thu, 4 Jun 2020 08:06:43 -0700 From: Christoph Hellwig To: David Hildenbrand Cc: Miles Chen , wsd_upstream@mediatek.com, Joerg Roedel , linux-kernel@vger.kernel.org, Chao Hao , iommu@lists.linux-foundation.org, linux-mediatek@lists.infradead.org, Yong Wu , Matthias Brugger , yingjoe.chen@mediatek.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] iommu/mediatek: Use totalram_pages to setup enable_4GB Message-ID: <20200604150643.GA29193@infradead.org> References: <20200604080120.2628-1-miles.chen@mediatek.com> <55820901-430b-14c4-9426-7a4991ca0eed@redhat.com> <1591264174.12661.17.camel@mtkswgap22> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 04, 2020 at 01:32:40PM +0200, David Hildenbrand wrote: > Just a thought: If memory hotplug is applicable as well, you might > either want to always assume data->enable_4GB, or handle memory hotplug > events from the memory notifier, when new memory gets onlined (not sure > how tricky that is). We probably want a highest_pfn_possible() or similar API instead of having drivers poking into random VM internals.