Message ID | 20200107205959.7575-9-logang@deltatee.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=d5pa=24=kvack.org=owner-linux-mm@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE563139A for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 7 Jan 2020 21:00:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9570F214D8 for <patchwork-linux-mm@patchwork.kernel.org>; Tue, 7 Jan 2020 21:00:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9570F214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=deltatee.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 426628E000E; Tue, 7 Jan 2020 16:00:18 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 38B518E0006; Tue, 7 Jan 2020 16:00:18 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B66D8E000F; Tue, 7 Jan 2020 16:00:18 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id DB7938E0006 for <linux-mm@kvack.org>; Tue, 7 Jan 2020 16:00:17 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 96B2E4995E5 for <linux-mm@kvack.org>; Tue, 7 Jan 2020 21:00:17 +0000 (UTC) X-FDA: 76352056074.01.title17_76e76ce777d50 X-Spam-Summary: 2,0,0,f87000726b857107,d41d8cd98f00b204,gunthorp@deltatee.com,:linux-kernel@vger.kernel.org:linux-arm-kernel@lists.infradead.org:linux-ia64@vger.kernel.org:linuxppc-dev@lists.ozlabs.org:linux-s390@vger.kernel.org:linux-sh@vger.kernel.org:platform-driver-x86@vger.kernel.org::dan.j.williams@intel.com:mhocko@kernel.org:david@redhat.com:akpm@linux-foundation.org:hch@lst.de:catalin.marinas@arm.com:will@kernel.org:benh@kernel.crashing.org:tglx@linutronix.de:mingo@redhat.com:bp@alien8.de:dave.hansen@linux.intel.com:luto@kernel.org:peterz@infradead.org:ebadger@gigaio.com:logang@deltatee.com:jgg@ziepe.ca,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2705:3138:3139:3140:3141:3142:3352:3865:3867:3868:3872:4250:4321:5007:6117:6261:6737:6742:7809:7903:7974:10004:11026:11473:11658:11914:12043:12048:12296:12297:12438:12517:12519:12555:12895:12986:13069:13149:13161:13229:13230:13311: 13357:13 X-HE-Tag: title17_76e76ce777d50 X-Filterd-Recvd-Size: 4289 Received: from ale.deltatee.com (ale.deltatee.com [207.54.116.67]) by imf50.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Tue, 7 Jan 2020 21:00:16 +0000 (UTC) Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <gunthorp@deltatee.com>) id 1iovxO-0007vy-Fh; Tue, 07 Jan 2020 14:00:09 -0700 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.92) (envelope-from <gunthorp@deltatee.com>) id 1iovxJ-0001zP-94; Tue, 07 Jan 2020 14:00:01 -0700 From: Logan Gunthorpe <logang@deltatee.com> To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-mm@kvack.org, Dan Williams <dan.j.williams@intel.com>, Michal Hocko <mhocko@kernel.org>, David Hildenbrand <david@redhat.com>, Andrew Morton <akpm@linux-foundation.org> Cc: Christoph Hellwig <hch@lst.de>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, Andy Lutomirski <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Eric Badger <ebadger@gigaio.com>, Logan Gunthorpe <logang@deltatee.com>, Jason Gunthorpe <jgg@ziepe.ca> Date: Tue, 7 Jan 2020 13:59:59 -0700 Message-Id: <20200107205959.7575-9-logang@deltatee.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200107205959.7575-1-logang@deltatee.com> References: <20200107205959.7575-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-mm@kvack.org, dan.j.williams@intel.com, akpm@linux-foundation.org, hch@lst.de, catalin.marinas@arm.com, benh@kernel.crashing.org, tglx@linutronix.de, david@redhat.com, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, mhocko@kernel.org, will@kernel.org, luto@kernel.org, peterz@infradead.org, ebadger@gigaio.com, logang@deltatee.com, jgg@ziepe.ca X-SA-Exim-Mail-From: gunthorp@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=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_NO_TEXT autolearn=ham autolearn_force=no version=3.4.2 Subject: [PATCH v2 8/8] mm/memremap: Set caching mode for PCI P2PDMA memory to WC 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) Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Allow setting caching mode in arch_add_memory() for P2PDMA
|
expand
|
diff --git a/mm/memremap.c b/mm/memremap.c index 45ab4ef0643d..d36ff688b768 100644 --- a/mm/memremap.c +++ b/mm/memremap.c @@ -187,7 +187,10 @@ void *memremap_pages(struct dev_pagemap *pgmap, int nid) } break; case MEMORY_DEVICE_DEVDAX: + need_devmap_managed = false; + break; case MEMORY_DEVICE_PCI_P2PDMA: + modifiers.pgprot = pgprot_writecombine(modifiers.pgprot); need_devmap_managed = false; break; default:
PCI BAR IO memory should never be mapped as WB, however prior to this the PAT bits were set WB and it was typically overridden by MTRR registers set by the firmware. Set PCI P2PDMA memory to be WC (writecombining) as the only current user (the NVMe CMB) was originally mapped WC before the P2PDMA code replaced the mapping with devm_memremap_pages(). Future use-cases may need to generalize this by adding flags to select the caching type, as some P2PDMA cases will not want WC. However, those use-cases are not upstream yet and this can be changed when they arrive. Cc: Dan Williams <dan.j.williams@intel.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Jason Gunthorpe <jgg@ziepe.ca> Signed-off-by: Logan Gunthorpe <logang@deltatee.com> --- mm/memremap.c | 3 +++ 1 file changed, 3 insertions(+)