Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752852AbdLNUXf (ORCPT ); Thu, 14 Dec 2017 15:23:35 -0500 Received: from mga18.intel.com ([134.134.136.126]:41785 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752103AbdLNUXd (ORCPT ); Thu, 14 Dec 2017 15:23:33 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,401,1508828400"; d="scan'208";a="186766781" Date: Thu, 14 Dec 2017 19:08:54 -0800 From: "Raj, Ashok" To: Bob Liu Cc: Lu Baolu , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Alex Williamson , Joerg Roedel , David Woodhouse , Rik van Riel , Michal Hocko , Dave Jiang , Kees Cook , linux-mm@kvack.org, x86@kernel.org, linux-kernel@vger.kernel.org, Dave Hansen , iommu@lists.linux-foundation.org, Vegard Nossum , Andy Lutomirski , Huang Ying , Matthew Wilcox , Andrew Morton , "Paul E . McKenney" , "Kirill A . Shutemov" , Ashok Raj Subject: Re: [PATCH 1/2] mm: Add kernel MMU notifier to manage IOTLB/DEVTLB Message-ID: <20171215030854.GA69597@otc-nc-03> References: <1513213366-22594-1-git-send-email-baolu.lu@linux.intel.com> <1513213366-22594-2-git-send-email-baolu.lu@linux.intel.com> <5A31F232.90901@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1162 Lines: 34 Hi Bob On Thu, Dec 14, 2017 at 02:07:38PM +0800, Bob Liu wrote: > On 2017/12/14 11:38, Lu Baolu wrote: > >>>> We already have an existing MMU notifiers for userspace updates, > >>>> however we lack the same thing for kernel page table updates. To > >> Sorry, I didn't get which situation need this notification. > >> Could you please describe the full scenario? > > > > Okay. > > > > 1. When an SVM capable driver calls intel_svm_bind_mm() with > > SVM_FLAG_SUPERVISOR_MODE set in the @flags, the kernel > > memory page mappings will be shared between CPUs and > > the DMA remapping agent (a.k.a. IOMMU). The page table > > entries will also be cached in both IOTLB (located in IOMMU) > > and the DEVTLB (located in device). > > > > But who/what kind of real device has the requirement to access a kernel VA? > Looks like SVM_FLAG_SUPERVISOR_MODE is used by nobody? That's right, there is no inkernel user at the moment, but we certainly see them coming. Maybe not the best example :-), but I'm told Lustre and some of the modern NIC's also can benefit from SVM in kernel use. Not a hypothetical use case certainly! Cheers, Ashok