Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2546004ybf; Mon, 2 Mar 2020 10:47:47 -0800 (PST) X-Google-Smtp-Source: ADFU+vseaz//agLnfavx23kR5fJWBtMgilIF1B+F3DoALuD+tHPnOkqgP6IO7gyQRX2NMLkQ9eD3 X-Received: by 2002:a9d:2c6a:: with SMTP id f97mr416948otb.254.1583174866924; Mon, 02 Mar 2020 10:47:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583174866; cv=none; d=google.com; s=arc-20160816; b=ZSu7j03FwxUDgSp2zTBk4WFBBabiXKEGGIhj+xa4r2eDcV2eM6dP1y8QCdJv0/NzNi XMT9h9luYaSSGHbNTXX+arp6bzm4DHM86plXi4FrZufScG57Spp6TXmNllIBF/iiyFLO rAO7oJ7ztd65dHnXxUOFKhob2bW8HBEx9O+q92PZS/cjuvn4iNHuczu6nQFJqriKQcB4 Ng+xDBYSQaWSQw+teEh8vamFL32Y82MZBcVIokrA4K63FZM+eZ9Vljbp7fGPNtqkahZt /Xkg20cba2ga858Rs4ZsPffZhx3sdCpYJ59Wuy6hQ90mjl+RawLz0GgtUFhyRmwdljyj o4YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=vBxw6iPYFxi7d6O6+VLwsbrJvihuu0xp9xATfugTiyo=; b=T8MVmdRrN+w0pvbKBDELi8Ovwn+WO7jE6SZVNFt9ZBzqWagPY5yDnTXhMYav7ykNQN w+GsVnlKNgc5elcMOA7yGmZZ0qhtas4Wdo8mZhGJjCJ9JrFg68iYwko1Q6O6RjpXfEv6 djxUlUDXlOZL8rcWXDgxXENIEZsB6+mJkv7RN4dnELtUOkAvQQDKWCcJR3npEtntxycQ TFpqbtqglDXuT4w7S7GhFPKM4qILA1hnP3mbmRurdZt8a+JlQEFDczoYcL0NIsEk0sCq /TaworpYDGLIbQOIT1p/f4EpDVDyVS4lIV7Zf4jiArTmXMSV1nhPXnujCGcx83dCgsND RNqw== ARC-Authentication-Results: i=1; mx.google.com; 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 y8si7096238otq.122.2020.03.02.10.47.34; Mon, 02 Mar 2020 10:47:46 -0800 (PST) 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; 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 S1727461AbgCBSr0 (ORCPT + 99 others); Mon, 2 Mar 2020 13:47:26 -0500 Received: from ale.deltatee.com ([207.54.116.67]:56870 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbgCBSr0 (ORCPT ); Mon, 2 Mar 2020 13:47:26 -0500 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.92) (envelope-from ) id 1j8q54-0005pv-89; Mon, 02 Mar 2020 11:46:19 -0700 To: Dan Williams Cc: Linux Kernel Mailing List , Linux ARM , linux-ia64@vger.kernel.org, linuxppc-dev , linux-s390 , Linux-sh , platform-driver-x86@vger.kernel.org, Linux MM , Michal Hocko , David Hildenbrand , Andrew Morton , Christoph Hellwig , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Eric Badger , "H. Peter Anvin" , X86 ML References: <20200221182503.28317-1-logang@deltatee.com> <20200221182503.28317-5-logang@deltatee.com> From: Logan Gunthorpe Message-ID: <1be997b0-e17a-5d48-efad-a01d84d5e496@deltatee.com> Date: Mon, 2 Mar 2020 11:46:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: x86@kernel.org, hpa@zytor.com, ebadger@gigaio.com, peterz@infradead.org, luto@kernel.org, dave.hansen@linux.intel.com, bp@alien8.de, mingo@redhat.com, tglx@linutronix.de, benh@kernel.crashing.org, will@kernel.org, catalin.marinas@arm.com, hch@lst.de, akpm@linux-foundation.org, david@redhat.com, mhocko@kernel.org, linux-mm@kvack.org, platform-driver-x86@vger.kernel.org, linux-sh@vger.kernel.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-ia64@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dan.j.williams@intel.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, SURBL_BLOCKED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH v3 4/7] x86/mm: Introduce _set_memory_prot() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-02-29 3:33 p.m., Dan Williams wrote: > On Fri, Feb 21, 2020 at 10:25 AM Logan Gunthorpe wrote: >> >> For use in the 32bit arch_add_memory() to set the pgprot type of the >> memory to add. >> >> Cc: Thomas Gleixner >> Cc: Ingo Molnar >> Cc: Borislav Petkov >> Cc: "H. Peter Anvin" >> Cc: x86@kernel.org >> Cc: Dave Hansen >> Cc: Andy Lutomirski >> Cc: Peter Zijlstra >> Signed-off-by: Logan Gunthorpe >> --- >> arch/x86/include/asm/set_memory.h | 1 + >> arch/x86/mm/pat/set_memory.c | 7 +++++++ >> 2 files changed, 8 insertions(+) >> >> diff --git a/arch/x86/include/asm/set_memory.h b/arch/x86/include/asm/set_memory.h >> index 64c3dce374e5..0aca959cf9a4 100644 >> --- a/arch/x86/include/asm/set_memory.h >> +++ b/arch/x86/include/asm/set_memory.h >> @@ -34,6 +34,7 @@ >> * The caller is required to take care of these. >> */ >> >> +int _set_memory_prot(unsigned long addr, int numpages, pgprot_t prot); > > I wonder if this should be separated from the naming convention of the > other routines because this is only an internal helper for code paths > where the prot was established by an upper layer. For example, I > expect that the kernel does not want new usages to make the mistake of > calling: > > _set_memory_prot(..., pgprot_writecombine(pgprot)) > > ...instead of > > _set_memory_wc() > > I'm thinking just a double underscore rename (__set_memory_prot) and a > kerneldoc comment for that pointing people to use the direct > _set_memory_ helpers. Thanks! Will do. Note, though, that even _set_memory_wc() is an internal x86-specific function. But the extra comment and underscore still make sense. > With that you can add: > > Reviewed-by: Dan Williams >