Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4425629rwe; Mon, 17 Apr 2023 12:27:15 -0700 (PDT) X-Google-Smtp-Source: AKy350b4KiBKTm1OTcbmvTNbkz04381C1n1c7ygC8/zF4rH+RBYEDDTIMDhrCRkzcQhpiGtjhNUT X-Received: by 2002:a05:6a21:6d92:b0:ee:beff:4119 with SMTP id wl18-20020a056a216d9200b000eebeff4119mr12598962pzb.45.1681759635622; Mon, 17 Apr 2023 12:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681759635; cv=none; d=google.com; s=arc-20160816; b=zRrscB8nIPs5CqdYnQ8KvZcbG42fBGcA1jNrzXV1PmjAjqf4QrU1iAKMXGxR2l1hg+ 9nJ9SKXj9c5TwNByEzEAvaie6MzkMY33kRyBcF5mFS7heDFCigSxcwrCde1hWgwMl58H QwWe1XkuyUZ2fmq/gr4u4EoI7GPHMxx+nQN4UV32odyYcO4mRZREkNimZYrDgKLgqgz9 bLhkblQs0WqJDg8kB93Uj6yBgfoecFFXXIoBskrWM39gg/QfSOrL0n3zzQC8hRuvoomv ae7zbThtAGsZNncvo/4AkyC0dFo7ZQnLHP1h1vGWSURpOmkqg1jput/cEA0M4xc+lZbq p0+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=3ncZxqb5WFyPe1+ZpQ8PZQt8gt8+1KXsaLpvOssElGw=; b=uqHv7Sk4p0U2gGsmPvTZJ5O/XpVHTfJ8NRzhZJS9x2yWNYiMNYYUkANW8vJwL/nTf7 QjFzwl91+AdapGvOfXVLICLAKQC3/wh7sNaX1YM8dIqhxjs3HT+6xFbauOrynZJelPCv owWhZz4utiG1zOzgpclwSp6KYpBAMTNcFQ4cBINxR1TBeVijFgGDC8wx9OxrOCUzUMTx e1aChCOt2ikPMv0tnCO+YZm9KKnhk4SQ80ZpIsDeYKJBxUEMqDc3UM4TWrfrY/h+tGFz flwBRHM+lUC4fZ3sHOeQxvRcnKMxvbogaCIpBuSneB4x75dwprnu38bjmKn30/ryaRQp RlIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=ztrYx909; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020aa793c8000000b0063d2af4ed30si1599088pff.89.2023.04.17.12.27.01; Mon, 17 Apr 2023 12:27:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=ztrYx909; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230414AbjDQTQZ (ORCPT + 99 others); Mon, 17 Apr 2023 15:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230393AbjDQTQY (ORCPT ); Mon, 17 Apr 2023 15:16:24 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4690140F0 for ; Mon, 17 Apr 2023 12:16:22 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id b5-20020a253405000000b00b8f66e29f5cso9397005yba.21 for ; Mon, 17 Apr 2023 12:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681758981; x=1684350981; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=3ncZxqb5WFyPe1+ZpQ8PZQt8gt8+1KXsaLpvOssElGw=; b=ztrYx909wU0E4C4fpIxazR3iU1/doAqQTn/It7I5XO5RP/H9ZYXyuhKdBCToffXuA4 9ymN8fyVDotr5xXEsIlQKbUlszwHgxz60FNw04gzVNpruLyyx64PubrHWVLlZpqpBhvh vKWEH9YJ0YOLYMGo4iFU65zKtP7q7UZnp+uz9t4BR4N/9FBLehmWY0SIc5VhHkip24G5 K1m5AlClUhPs9NQEruZr7RLnkYdxG6AQA5cbku/1KRM6FGgQmeipGncM5ftAnohmLBxq maaJarYp0xwTDMAFLUo1WRHPRRXtnFqiq3K5A0R+O1k2UroqEOBdn4ZYqcx+PaU9ygpP MwIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681758981; x=1684350981; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3ncZxqb5WFyPe1+ZpQ8PZQt8gt8+1KXsaLpvOssElGw=; b=bUs0KWTWN9rjmZhkXB46HhpHjq42Sd4u+99QUBRpUlDimMqAlvHF7a3UsAYlN2Ny44 eRtfCZzq+kxI4s1S2rQPwyqHtOKQGk97guN/zVwuqJhX+z3INgfcY5UWRIH0AirGFCEG MHQCVQgGbwgrI46xsD64g3VVU6atWZcLtqfMhkJsiRb2kmt08O9PGuOpAg59Y16MaW5p jiEXuac8fxduPZeUJAqa0HJriiej/qVWnkuCViL8dZUga7cmKxEWt+0YtLVp753LM64x htrBy2TlnzrhGEaE2Is01yswC2c0+XOtaQiO6KkPxp4gRZNHMLOJE6RRfqVIwDle/aFq tjJA== X-Gm-Message-State: AAQBX9dkYPtmvLGLY/pYEC/x4DRks6rYh2F0dZ+HmdAMBAS40P73prrr eMdcOVOoYz9VTOVpqOtAVjMRFlmDzOc= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:e0c5:0:b0:b75:8ac3:d5d9 with SMTP id x188-20020a25e0c5000000b00b758ac3d5d9mr10290256ybg.3.1681758981543; Mon, 17 Apr 2023 12:16:21 -0700 (PDT) Date: Mon, 17 Apr 2023 12:16:20 -0700 In-Reply-To: <1ed06a62-05a1-ebe6-7ac4-5b35ba272d13@redhat.com> Mime-Version: 1.0 References: <20221202061347.1070246-1-chao.p.peng@linux.intel.com> <658018f9-581c-7786-795a-85227c712be0@redhat.com> <1ed06a62-05a1-ebe6-7ac4-5b35ba272d13@redhat.com> Message-ID: Subject: Re: Rename restrictedmem => guardedmem? (was: Re: [PATCH v10 0/9] KVM: mm: fd-based approach for supporting KVM) From: Sean Christopherson To: David Hildenbrand Cc: Chao Peng , Paolo Bonzini , Vitaly Kuznetsov , Jim Mattson , Joerg Roedel , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Kirill A . Shutemov" , dhildenb@redhat.com, Quentin Perret , tabba@google.com, Michael Roth , wei.w.wang@intel.com, Mike Rapoport , Liam Merwick , Isaku Yamahata , Jarkko Sakkinen , Ackerley Tng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 17, 2023, David Hildenbrand wrote: > On 17.04.23 18:40, Sean Christopherson wrote: > > On Mon, Apr 17, 2023, David Hildenbrand wrote: > > > On 17.04.23 17:40, Sean Christopherson wrote: > > > > I want to start referring to the code/patches by its syscall/implementation name > > > > instead of "UPM", as "UPM" is (a) very KVM centric, (b) refers to the broader effort > > > > and not just the non-KVM code, and (c) will likely be confusing for future reviewers > > > > since there's nothing in the code that mentions "UPM" in any way. > > > > > > > > But typing out restrictedmem is quite tedious, and git grep shows that "rmem" is > > > > already used to refer to "reserved memory". > > > > > > > > Renaming the syscall to "guardedmem"... > > > > > > restrictedmem, guardedmem, ... all fairly "suboptimal" if you'd ask me ... > > > > I'm definitely open to other suggestions, but I suspect it's going to be difficult > > to be more precise than something like "guarded". > > Guardedmem is just as bad as restrictedmem IMHO, sorry. > > > Restricted: what's restricted? how does the restriction manifest? secretmem > also has it's restrictions/limitations (pinning), why does that one not fall > under the same category? > > Make a stranger guess what "restrictedmem" is and I can guarantee that it > has nothing to do with the concept we're introducing here. > > > Guarded: what's guarded? From whom? For which purpose? How does the > "guarding" manifest? I completely agree that "guarded" lacks precision, but as above, I've pretty much given up hope of being super precise. I actually like "restricted", I just don't like that I can't shorten the name. Hmm, maybe that won't be a huge problem in practice. I can't say I've ever heard any use "rmem" in verbale or written communication, it's primarily just "rmem" in code that we can't use, and I don't mind having to use restrictedmem for the namespace. So maybe we can use "rmem", just not in code? Or, we could pretend we're pirates and call it arrrmem!, which is definitely going to be how I refer to it in my internal dialogue if we keep "restricted" :-) > Again, make a stranger guess what "guardedmem" is and I can guarantee that > it has nothing to do with the concept we're introducing here. > > If, at all, the guess might be "guarded storage" [1] on s390x, which, of > course, has nothing to do with the concept here. Oof, and guarded storage is even documented in Documentation/virt/kvm/api.rst. > (storage on s390x is just the dinosaur slang for memory) > > > Often, if we fail to find a good name, the concept is either unclear or not > well defined. > > So what are the characteristics we want to generalize under that new name? > We want to have an fd, that > > (a) cannot be mapped into user space (mmap) > (b) cannot be accessed using ordinary system calls (read/write) > (c) can still be managed like other fds (fallocate, future NUMA > policies?) > (d) can be consumed by some special entities that are allowed to > read/write/map. > > So the fd content is inaccessible using the ordinary POSIX syscalls. It's > only accessible by special entities (e.g., KVM). > > Most probably I am forgetting something. But maybe that will help to find a > more expressive name. Maybe :) Hidden/Concealed/etc - Too close to secretmem, suffers the "hidden from whom" problem, and depending on the use case, the memory may not actually be concealed from the user that controls the VMM. Restricted - "rmem" collides with "reserved memory" in code. Guarded - Conflicts with s390's "guarded storage", has the "from whom" problem. Inaccessible - Many of the same problems as "hidden". Unmappable - Doesn't cover things like read/write, and is wrong in the sense that the memory is still mappable, just not via mmap(). Secured - I'm not getting anywhere near this one :-)