Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6919596rwn; Tue, 13 Sep 2022 10:51:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR7rhafEOMAledxK7qjFjZfyAr/91/4NRmVMlhNMPenCKcjuh6t76Wb35A4LnsOPlZz/jwsV X-Received: by 2002:a17:902:b085:b0:178:3af4:31b2 with SMTP id p5-20020a170902b08500b001783af431b2mr8454583plr.122.1663091464629; Tue, 13 Sep 2022 10:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663091464; cv=none; d=google.com; s=arc-20160816; b=v4mpP5xjSWh+vjn+iyhcObEZhxckuhIzbuaSSBROJe65kIiiVa/sJKa0BsBfgLdZnJ 5NNF0pb4L7DiGMi/WYOR3dgV+Ie9869tOI6dJwhY8uAYtemGoF9SbqDuOUtZiRBOb+C1 zYHmricHEQbLWIGcUiG+EeCDjX3++YGxQikP5hAY7ndEEBBPMlQswYs8BMdnSeMmuPMc PwtFMU4CTVJBDdsx9UFAjGOLG/WmFgc42V7zu6ld5MpEybBydauWkxFgitvS4e8fVmjG afmY5p/tmsOUkZ7E5P7UPxoYVkyOfcDmqFNy5/4+tVb+bVRH1gJmQUxAVFOAOK1so85A uM4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4GTld6ZU8MtCcyeBG9nWMSKRKMoB2xn8bpkZwXHEw2s=; b=plK7eZUQZXGBhGAR1TXzaKFJbulDf7Y3N7O/1UrHNFMXbOFWHjjNRzwBvY81IPDdks KMyKzJGdbGetVNbI7B/5ZcshYTdsWjoX1lEn3TAzVFuR5C0OkmtHtFlIvLvigu8/jqi5 TbloqGQPYf4yWu2yExwg1NVLJBMitu8XRlmt7S9oFaIvxwEqhlrVQtel7v4n3BWd3Nss TPOEclVlGc8S3sfOcg9kiRx6ykHvufc43mlnZPIaXoPCQo+gj9roeEQ5hDdtab48DQTS NY2TQ0I6c4dnPcOiQ0Up3wNsut0L7lowIIMTrBcxwf9clHJr8MSSpxPnMPZUqFmIwFLY Frmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=DihabYGa; 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 k14-20020aa788ce000000b00537fd74ca6bsi13140698pff.54.2022.09.13.10.50.51; Tue, 13 Sep 2022 10:51:04 -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=20210112 header.b=DihabYGa; 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 S232946AbiIMRZs (ORCPT + 99 others); Tue, 13 Sep 2022 13:25:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232680AbiIMRZS (ORCPT ); Tue, 13 Sep 2022 13:25:18 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBBCB9E2E2 for ; Tue, 13 Sep 2022 09:12:09 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id w20so245049ply.12 for ; Tue, 13 Sep 2022 09:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=4GTld6ZU8MtCcyeBG9nWMSKRKMoB2xn8bpkZwXHEw2s=; b=DihabYGaFpN/XoOHm1MSaQi2kRH2os0yj0QoILo7SPAJF8OpMSQjLf1+pqVt7GZRjd D81sKZU5Oq0vtGEgr0Plm1UVQOezX4s/yuWlGktjKnB/6aqUWru04VRRHhXjgMf9lgKo FR9C6O8IdbFGuxPJakYZ4BdDTShUXISvdElPZULkotAb3nTa0x7V27hT49l5H57ZEuzT Y2ncOVkRrhHKP66UtZI06AJkG7HRBc21aMZ2rHU6LkxtwqHKRvYMVYVLxRX743DN2L19 qdr5gZklkks6Bi/hi2Z1rhwNsdKW/awWh0sDR0Rahs+8lcIfTne4V8e5TEE/NSU59M4J aEIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=4GTld6ZU8MtCcyeBG9nWMSKRKMoB2xn8bpkZwXHEw2s=; b=gS2tLz1SCEnkXToiwQCV7Uu935Pri30Dfj6POGyztr0oD4SAI0VTFjcaIbOMm1p0ho 4v5ljadDbcwBQkZA+pPfBBC/8BM/kdHG11vdLod5OVx90+BQCeib77oDVMGbqqeN4am3 no2pNJP4RINYaksf8EmPABYzGmocPqOcqF0zktRYy2ekMC0GV/kqC4oE/ZmmhBXrZ+Z3 Gd6+I/XXj1cztp5XMicGCHBoDiBszaj0S3WcfDUgvcmTIsWRTKFTi60atgltjADRSJga RZkoxKJ4VthR+PPcm+iwmRxmYJ78bgAnR7MAshXqQAhqOwbOPC3cdBKBnUORpUSrBn4s F/dA== X-Gm-Message-State: ACgBeo05um1tJc53AWTZB3gom3XYaHcEG5i+9FTAVCWdO+RXn0r7kvkM N9D3X50If5Sqp1g0A3scuODzXw== X-Received: by 2002:a17:902:ce12:b0:172:9512:595d with SMTP id k18-20020a170902ce1200b001729512595dmr33361116plg.101.1663085528936; Tue, 13 Sep 2022 09:12:08 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id ij24-20020a170902ab5800b001783f964fe3sm3191697plb.113.2022.09.13.09.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 09:12:07 -0700 (PDT) Date: Tue, 13 Sep 2022 16:12:04 +0000 From: Sean Christopherson To: "Kirill A. Shutemov" Cc: "Kirill A . Shutemov" , Hugh Dickins , Chao Peng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, linux-kselftest@vger.kernel.org, Paolo Bonzini , Jonathan Corbet , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , mhocko@suse.com, Muchun Song , "Gupta, Pankaj" , Elena Reshetova Subject: Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory Message-ID: References: <20220818132421.6xmjqduempmxnnu2@box> <20220820002700.6yflrxklmpsavdzi@box.shutemov.name> <20220831142439.65q2gi4g2d2z4ofh@box.shutemov.name> <20220908011037.ez2cdorthqxkerwk@box.shutemov.name> <20220913132821.3ch5cv3rgdxqgz3i@box.shutemov.name> <20220913160046.rkz7uh6cpwy6wyzg@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220913160046.rkz7uh6cpwy6wyzg@box.shutemov.name> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 Tue, Sep 13, 2022, Kirill A. Shutemov wrote: > On Tue, Sep 13, 2022 at 02:53:25PM +0000, Sean Christopherson wrote: > > > > Switching topics, what actually prevents mmapp() on the shim? I tried to follow, > > > > but I don't know these areas well enough. > > > > > > It has no f_op->mmap, so mmap() will fail with -ENODEV. See do_mmap(). > > > (I did not read the switch statement correctly at first. Note there are > > > two 'fallthrough' there.) > > > > Ah, validate_mmap_request(). Thought not implementing ->mmap() was the key, but > > couldn't find the actual check. > > validate_mmap_request() is in mm/nommu.c which is not relevant for real > computers. > > I was talking about this check: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/mmap.c#n1495 Hence the comment about 'fallthrough'. Thanks again!