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 AF668C433E2 for ; Wed, 13 May 2020 19:55:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 495A0206CC for ; Wed, 13 May 2020 19:55:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 495A0206CC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 24E6780036; Wed, 13 May 2020 15:55:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FFA08000B; Wed, 13 May 2020 15:55:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13D3D80036; Wed, 13 May 2020 15:55:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id ED26B8000B for ; Wed, 13 May 2020 15:55:00 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 99338180AD815 for ; Wed, 13 May 2020 19:55:00 +0000 (UTC) X-FDA: 76812749160.02.wrist53_65e7d352cb20c X-HE-Tag: wrist53_65e7d352cb20c X-Filterd-Recvd-Size: 2937 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 May 2020 19:55:00 +0000 (UTC) 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) 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: 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.