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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3F8DC433F5 for ; Thu, 23 Dec 2021 18:06:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 010666B0072; Thu, 23 Dec 2021 13:06:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F01C46B0073; Thu, 23 Dec 2021 13:06:24 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCAA06B0074; Thu, 23 Dec 2021 13:06:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id CEFE46B0072 for ; Thu, 23 Dec 2021 13:06:24 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8B5D98249980 for ; Thu, 23 Dec 2021 18:06:24 +0000 (UTC) X-FDA: 78949838688.10.70E05A0 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by imf05.hostedemail.com (Postfix) with ESMTP id 2575710001C for ; Thu, 23 Dec 2021 18:06:23 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id 205so5951266pfu.0 for ; Thu, 23 Dec 2021 10:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xAmKzIc+8wB6wpfnMshmg3i7fbLcnqAVF/wlNkzMihA=; b=tTF25W0YJCF52VxnCB1yX2ghBWLxGZJIFN7meLmiZtwzhBFTNeS4pdlakQJzZthEVV sLib2vBfvyhkW444CXX6MyhXs2FVrJSmeOjey8QRFwqmDwoI0MkwMyxaf45xTCz7swuh yaGi9nwJG/3GAVuVtArFcBEU9kicedJGmiVBsW7ZsGufu8H34zMzEZuJ5+H6/lkFUVog f40Y4Ji6HA1nAKyvbZErsgxVE2A//Nlu4SFhBhFcNJnt2EyxEDNQFqBtXLQT1MUqQX5+ tlBhIpZNunp3NCHf4C/ZbsZkCUoAI3H1wY+Nke7l6nQDCrTpDid2y9cBURkBmzOpyS9T g8cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xAmKzIc+8wB6wpfnMshmg3i7fbLcnqAVF/wlNkzMihA=; b=OoRRktEHAghicM3IOx197ZlJPpho2d4IatdUt851jDrREJ//f7Rv2DEyHOLOolugao bETRWhRiWLm8lD/4mANrGcCDqGpgoexHsZOO5iAjMvnPmrgdo/R8UrF3ozyMR88mWCKL A9BeKhwMApA0nbiV0xCnULAudbwk5aMoDyKWnQhVDD0w3/3Z0L3KUk2jypXaTW6s+5gb JfConddyFZEEJQwuqNNy4kzsog4or8gs18n3zlggihGQiuusDI8UA+Pf0/LniHuFauES uDFxlWz75mB20HZDhwW3MqYiDgXgMgTuFZX42BP7W4ydH1GQDfmicU1g4eXnMDNJtHar Nz3A== X-Gm-Message-State: AOAM532PoNokIuGrQe8mkZ937WR9o6dLwH2HpKvjndMG3cieFdmoLB/q +fQis7pSAwzy7Kyh+p+5MjD+Uw== X-Google-Smtp-Source: ABdhPJx8ZGtfl7eWpJl5BHdJwST1PNXKEmCce64dp3wTaCWQJvvaSUBLS2W1N1XEWNIx8vbJ5FtHxQ== X-Received: by 2002:a63:787:: with SMTP id 129mr3065930pgh.289.1640282782830; Thu, 23 Dec 2021 10:06:22 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id 22sm6830378pfv.173.2021.12.23.10.06.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Dec 2021 10:06:22 -0800 (PST) Date: Thu, 23 Dec 2021 18:06:19 +0000 From: Sean Christopherson To: Chao Peng Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, qemu-devel@nongnu.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" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Yu Zhang , "Kirill A . Shutemov" , luto@kernel.org, john.ji@intel.com, susie.li@intel.com, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com Subject: Re: [PATCH v3 kvm/queue 11/16] KVM: Add kvm_map_gfn_range Message-ID: References: <20211223123011.41044-1-chao.p.peng@linux.intel.com> <20211223123011.41044-12-chao.p.peng@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211223123011.41044-12-chao.p.peng@linux.intel.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 2575710001C X-Stat-Signature: neoy4nhfybgonqm51ai677trjokpzhqi Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=tTF25W0Y; spf=pass (imf05.hostedemail.com: domain of seanjc@google.com designates 209.85.210.182 as permitted sender) smtp.mailfrom=seanjc@google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1640282783-855293 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 Thu, Dec 23, 2021, Chao Peng wrote: > This new function establishes the mapping in KVM page tables for a > given gfn range. It can be used in the memory fallocate callback for > memfd based memory to establish the mapping for KVM secondary MMU when > the pages are allocated in the memory backend. NAK, under no circumstance should KVM install SPTEs in response to allocating memory in a file. The correct thing to do is to invalidate the gfn range associated with the newly mapped range, i.e. wipe out any shared SPTEs associated with the memslot.