From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 467C7C433E0 for ; Wed, 13 May 2020 19:55:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D66D3206CC for ; Wed, 13 May 2020 19:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733135AbgEMTzA (ORCPT ); Wed, 13 May 2020 15:55:00 -0400 Received: from verein.lst.de ([213.95.11.211]:48422 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732218AbgEMTzA (ORCPT ); Wed, 13 May 2020 15:55:00 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 2D25668B05; Wed, 13 May 2020 21:54:57 +0200 (CEST) Date: Wed, 13 May 2020 21:54:56 +0200 From: Christoph Hellwig To: Linus Torvalds Cc: Christoph Hellwig , the arch/x86 maintainers , Alexei Starovoitov , Daniel Borkmann , Masami Hiramatsu , Andrew Morton , linux-parisc@vger.kernel.org, linux-um , Netdev , bpf@vger.kernel.org, Linux-MM , Linux Kernel Mailing List Subject: Re: [PATCH 14/18] maccess: allow architectures to provide kernel probing directly Message-ID: <20200513195456.GA31096@lst.de> References: <20200513160038.2482415-1-hch@lst.de> <20200513160038.2482415-15-hch@lst.de> <20200513194003.GA31028@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Wed, May 13, 2020 at 12:48:54PM -0700, Linus Torvalds wrote: > Looking at the current users of "probe_kernel_read()", it looks like > it's almost mostly things that just want a single byte or word. > > It's not 100% that: we definitely do several things that want the > "copy" semantics vs the "get" semantics: on the x86 side we have > CALL_INSN_SIZE and MAX_INSN_SIZE, and the ldttss_desc. > > But the bulk of them do seem to be a single value. > > I don't know if performance really matters here, but to me the whole > "most users seem to want to read a single value" is what makes me > think that maybe that should be the primary model, rather than have > the copy model be the primary one and then we implement the single > value case (badly) with a copy. > > It probably doesn't matter that much. I certainly wouldn't hold this > series up over it - it can be a future thing. I can make the get_kernel_nofault implementation suck a little less :) Note that the arch helper (we could call it unsafe_get_kernel_nofault) we still need to have a pagefault_disable / pagefault_enable pair around the calls. So maybe keep the get_kernel_nofault interface as-is (without the goto label), and prepare the arch helpers for being used similar to unsafe_get_user once all architectures are converted. And I can throw in a few patches to convert callers from the copy semantics to the get semantics. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYxT2-0004wv-Ac for linux-um@lists.infradead.org; Wed, 13 May 2020 19:55:01 +0000 Date: Wed, 13 May 2020 21:54:56 +0200 From: Christoph Hellwig Subject: Re: [PATCH 14/18] maccess: allow architectures to provide kernel probing directly Message-ID: <20200513195456.GA31096@lst.de> References: <20200513160038.2482415-1-hch@lst.de> <20200513160038.2482415-15-hch@lst.de> <20200513194003.GA31028@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Linus Torvalds Cc: linux-parisc@vger.kernel.org, Daniel Borkmann , Netdev , the arch/x86 maintainers , linux-um , Alexei Starovoitov , Linux Kernel Mailing List , Linux-MM , bpf@vger.kernel.org, Masami Hiramatsu , Andrew Morton , Christoph Hellwig On Wed, May 13, 2020 at 12:48:54PM -0700, Linus Torvalds wrote: > Looking at the current users of "probe_kernel_read()", it looks like > it's almost mostly things that just want a single byte or word. > > It's not 100% that: we definitely do several things that want the > "copy" semantics vs the "get" semantics: on the x86 side we have > CALL_INSN_SIZE and MAX_INSN_SIZE, and the ldttss_desc. > > But the bulk of them do seem to be a single value. > > I don't know if performance really matters here, but to me the whole > "most users seem to want to read a single value" is what makes me > think that maybe that should be the primary model, rather than have > the copy model be the primary one and then we implement the single > value case (badly) with a copy. > > It probably doesn't matter that much. I certainly wouldn't hold this > series up over it - it can be a future thing. I can make the get_kernel_nofault implementation suck a little less :) Note that the arch helper (we could call it unsafe_get_kernel_nofault) we still need to have a pagefault_disable / pagefault_enable pair around the calls. So maybe keep the get_kernel_nofault interface as-is (without the goto label), and prepare the arch helpers for being used similar to unsafe_get_user once all architectures are converted. And I can throw in a few patches to convert callers from the copy semantics to the get semantics. _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um