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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 D6C13C433E2 for ; Wed, 13 May 2020 19:49:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5D9CD206E5 for ; Wed, 13 May 2020 19:49:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="PhubPRzp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D9CD206E5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2EF3480035; Wed, 13 May 2020 15:49:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2A1218000B; Wed, 13 May 2020 15:49:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1674580035; Wed, 13 May 2020 15:49:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0091.hostedemail.com [216.40.44.91]) by kanga.kvack.org (Postfix) with ESMTP id EFB858000B for ; Wed, 13 May 2020 15:49:15 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A16938248D7C for ; Wed, 13 May 2020 19:49:15 +0000 (UTC) X-FDA: 76812734670.28.drum03_33b42574b9708 X-HE-Tag: drum03_33b42574b9708 X-Filterd-Recvd-Size: 4795 Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 May 2020 19:49:15 +0000 (UTC) Received: by mail-lf1-f65.google.com with SMTP id v5so520821lfp.13 for ; Wed, 13 May 2020 12:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YO5CZycJoj3SG3fGwN+WTopK/LhbyP0lsfj2E+DRkX4=; b=PhubPRzpkCdl9mVPHrG9Oo8C+WwrKBHaeYw/BPL1ZhM7m32uY9vOkxzag4IPR45vmN nCyuee+AoItBB8/CS6j7/cO2lxt0a4Fuet7ze1acDgZYlgBMc3l9Izqr8rAmG81U3hf8 E+jYDPSfclqu+31+e+LKbjbSmiBTvos3Qrvk0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YO5CZycJoj3SG3fGwN+WTopK/LhbyP0lsfj2E+DRkX4=; b=lEvVTCoyjexpdBhdTxVgYTPmZh9jXQlY1JmZd9Pz064v8PJIqwvbjiFcBY+5jwAmYp BKH7gXch/B3bsfxkQ58SpK1UxyySrwSLAlmiylBzozy1F+dTjjBnfc8Ymbrr7o7W/HI3 dC+/89X/d1J9WLozqL94EWVQvGpLiP1/+f2kunCdjz3GK4ug91zR5P9p55XPdx3Qj1Tm yamdwYEdMbZ046BAMCRmo1VP2+Wtypjrz8rp+ovtMGDtyg/WykTbJlYGv8FKksah/D/o Qje9zq8XsB2kZhyMPpyOBfVHAzHBS+VpkIffluOWcev0Fr9g9TN83eA8rJWsHntGTejc QA8w== X-Gm-Message-State: AOAM533bxed8oK3WBZO0MEUGyZ1bx2pQTc/guLt33DxJNCVKLOV/Jda8 KC48mFtvw0ipI7tTdNwjk60CgsLp6R0= X-Google-Smtp-Source: ABdhPJz5EYOJVZOKoLAbmp2uFkZCwIZ3JOixS4cOaInNXV5YjF5FNQUhdKjcG4DG1KSi7o66L9lhNw== X-Received: by 2002:a05:6512:2027:: with SMTP id s7mr690293lfs.39.1589399352568; Wed, 13 May 2020 12:49:12 -0700 (PDT) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id k1sm333745lfc.40.2020.05.13.12.49.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 May 2020 12:49:11 -0700 (PDT) Received: by mail-lf1-f45.google.com with SMTP id c21so575114lfb.3 for ; Wed, 13 May 2020 12:49:10 -0700 (PDT) X-Received: by 2002:ac2:58c8:: with SMTP id u8mr739476lfo.142.1589399350490; Wed, 13 May 2020 12:49:10 -0700 (PDT) MIME-Version: 1.0 References: <20200513160038.2482415-1-hch@lst.de> <20200513160038.2482415-15-hch@lst.de> <20200513194003.GA31028@lst.de> In-Reply-To: <20200513194003.GA31028@lst.de> From: Linus Torvalds Date: Wed, 13 May 2020 12:48:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 14/18] maccess: allow architectures to provide kernel probing directly To: Christoph Hellwig Cc: "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 Content-Type: text/plain; charset="UTF-8" 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:40 PM Christoph Hellwig wrote: > > We do export something like it, currently it is called > probe_kernel_address, and the last patch renames it to > get_kernel_nofault. However it is implemented as a wrapper > around probe_kernel_address / copy_from_kernel_nofault and thus > not quite as efficient and without the magic goto semantics. 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. Linus