Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6925111rwn; Tue, 13 Sep 2022 10:56:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR4LqSgt80xTcJ1lZiXYLBgl1H1smVurkbhiXG/ywGsep21X6vtOnqID+ydXKYrx2Da3VHVO X-Received: by 2002:a17:907:9615:b0:779:66f6:7dc7 with SMTP id gb21-20020a170907961500b0077966f67dc7mr16536891ejc.718.1663091809457; Tue, 13 Sep 2022 10:56:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663091809; cv=none; d=google.com; s=arc-20160816; b=xfI49/7jhlXluqZswVLXiuLlRJJbjKK3Kxqc90LsT6hN0dA15HVW056kMAF5IXtIiU TotK1QL++X6vzJpcJGelb6Z9grZtvSJIsVYr8bpvNzQtJRYEy4yqwFwx+h6gZuheOFIZ e5PuEUzHdGzPkHAJ/e0d8MHk6KfjRThNecRY6vJ8fVbMFLw7CTNwbdv5i55+K/haZIdi q3hymY8AnjtD5eeOmNq95Q9XvLtg79lp0Ybpu3EaiBuCJLm9j9Ty9sZ+ZkRqyjBz/JU/ 5X7V7wOyYLDDZxOdRhbs1lh9ksAaeCMF6dYTZz9A+fxldWBf70hPYPRTiiCxnKoXYBZU Bgtw== 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:feedback-id :dkim-signature:dkim-signature; bh=nRH4z7e+oXA2SkZv/m8JgJqSDk7nulXrp2QoWv1YEN4=; b=JIWKNSl5esAMLXLoLg4UtXYkq1sl+oYyHLZ8TC+BizmV8GxrA8xgmpGUwmQRbSebVw LHGn+HQfJkkRVBu6uq2x+dFoCQ7ddiNGMGcO5GJWyo3/1p5SLosIue9CkTa4MveMRBDh ZskjFGIVFRVOuyzZ+M3eHqsc9C/zJqlH+iWGnY9ysekHWknMYmzBK2jDbRy4qA+25CUy AnhWt8qn4GAP53kFtkXUG1QZd4yFH/rnILhp7g4Y+tdL9B5hSvlApckkdRkltXdk5Cxe PhY2vDVyW3sxanxs/Tdf2FiBfWxWpTKsVHEU10XlH4U2Lz/ks9xQyqp6/WWybMZv+DOt CvdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm3 header.b=XM4CuKJt; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=L9Yl22VB; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs37-20020a1709072d2500b00770d9e664f8si10653509ejc.152.2022.09.13.10.56.23; Tue, 13 Sep 2022 10:56:49 -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=@shutemov.name header.s=fm3 header.b=XM4CuKJt; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=L9Yl22VB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232663AbiIMROz (ORCPT + 99 others); Tue, 13 Sep 2022 13:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232546AbiIMROS (ORCPT ); Tue, 13 Sep 2022 13:14:18 -0400 Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40F4A101D4; Tue, 13 Sep 2022 09:02:58 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id CC1605802D8; Tue, 13 Sep 2022 12:00:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 13 Sep 2022 12:00:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1663084851; x=1663092051; bh=nR H4z7e+oXA2SkZv/m8JgJqSDk7nulXrp2QoWv1YEN4=; b=XM4CuKJtTWDLoARjMU ZEoD6wB5FqnJdSnY3AUy+IO++7ZeMKuIGV7uzlq8uSGUd+dk9chibkWCsvDK8GNY lUXAlf7MPuPfea2V80ipCokGbqWGe90/O4izA17lU44CEqmslzDymGWi8CmFigUv /1pt2fDthxiWGh3J8mgjWfumcmOTyZXvfPJoP6Id6cvvaavU+5xrsA9EhZpt5Euf aywjzWe1+3TbO7Nv8QkUYFPgV+AlIEB+1KFSYXFxjZDIPVazeJogLXHgNC4ex0Ea /IlPGW+cYL0/VjUf6NiNk6Okczw8aRTkqyNAGpU2Ezuj6KQd9nYmPgjUi1it7PhV upFg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1663084851; x=1663092051; bh=nRH4z7e+oXA2SkZv/m8JgJqSDk7n ulXrp2QoWv1YEN4=; b=L9Yl22VBFNLeetc6fSQgTPfXDMKU/Un/Nk3+eIFVPVGM jXoMC62j/pqiRCZhTsfDKXXjDf0pwGuFtuMs1+x5MjSaHS9RqdS4IdUUxa93GbGA kpWwa4xQFzg0GgHggZDoI/hD1+DFTJ8Y554qKeRFdOTrWvQf98vrayUX4L3sBVbf uF2qW1fujBLU6PEAPaHmqdw/urgqhR4LySbsxm1+RXzmoNNVO2rXx1nfscmcdinv GAoZo5+589NE8/kQ5NTX+lIcLX4szCiqfW2jXy0gAXNFnk8Eide20Iu/gvidC+XI 00H5SJY8aaxn8RExcr8e6V6nkwTTQXr4g+Y4SDFVqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedugedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdttddttddtvdenucfhrhhomhepfdfmihhr ihhllhcutedrucfuhhhuthgvmhhovhdfuceokhhirhhilhhlsehshhhuthgvmhhovhdrnh grmhgvqeenucggtffrrghtthgvrhhnpeelgffhfeetlefhveffleevfffgtefffeelfedu udfhjeduteeggfeiheefteehjeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepkhhirhhilhhl sehshhhuthgvmhhovhdrnhgrmhgv X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Sep 2022 12:00:49 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id CDFF310465E; Tue, 13 Sep 2022 19:00:46 +0300 (+03) Date: Tue, 13 Sep 2022 19:00:46 +0300 From: "Kirill A. Shutemov" To: Sean Christopherson 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: <20220913160046.rkz7uh6cpwy6wyzg@box.shutemov.name> References: <20220818132421.6xmjqduempmxnnu2@box> <20220820002700.6yflrxklmpsavdzi@box.shutemov.name> <20220831142439.65q2gi4g2d2z4ofh@box.shutemov.name> <20220908011037.ez2cdorthqxkerwk@box.shutemov.name> <20220913132821.3ch5cv3rgdxqgz3i@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 -- Kiryl Shutsemau / Kirill A. Shutemov