From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Desnoyers Subject: Re: [RFC PATCH v3 for 4.15 08/24] Provide cpu_opv system call Date: Mon, 20 Nov 2017 18:42:00 +0000 (UTC) Message-ID: <326295786.18485.1511203320323.JavaMail.zimbra@efficios.com> References: <20171114200414.2188-1-mathieu.desnoyers@efficios.com> <20171114200414.2188-9-mathieu.desnoyers@efficios.com> <1766414702.18278.1511194398489.JavaMail.zimbra@efficios.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Thomas Gleixner Cc: Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Andy Lutomirski , Dave Watson , linux-kernel , linux-api , Paul Turner , Andrew Morton , Russell King , Ingo Molnar , "H. Peter Anvin" , Andrew Hunter , Andi Kleen , Chris Lameter , Ben Maurer , rostedt , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon List-Id: linux-api@vger.kernel.org ----- On Nov 20, 2017, at 1:03 PM, Thomas Gleixner tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org wrote: > On Mon, 20 Nov 2017, Thomas Gleixner wrote: >> On Mon, 20 Nov 2017, Mathieu Desnoyers wrote: >> > >> + * The reason why we require all pointer offsets to be calculated by >> > >> + * user-space beforehand is because we need to use get_user_pages_fast() >> > >> + * to first pin all pages touched by each operation. This takes care of >> > > >> > > That doesnt explain it either. >> > >> > What kind of explication are you looking for here ? Perhaps being too close >> > to the implementation prevents me from understanding what is unclear from >> > your perspective. >> >> What the heck are pointer offsets? >> >> The ops have one or two pointer(s) to a lump of memory. So if a pointer >> points to the wrong lump of memory then you're screwed, but that's true for >> all pointers handed to the kernel. > > So I think you mix here the 'user space programmer guide - how to set up > the magic ops - into the kernel side documentation. The kernel side does > not care about the pointers, as long as they are valid to access. > > Again. Try to explain things at the conceptual level. Yes, I took the sentence you suggested for that reason: it removes usage details that are meant for user-space implementer, which do not belong in those comments. Thanks, Mathieu > > Thanks, > > tglx -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com