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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 7BA6AC388F2 for ; Thu, 22 Oct 2020 12:01:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0951B2245F for ; Thu, 22 Oct 2020 12:01:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="kT5yuwwi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2896511AbgJVMBq (ORCPT ); Thu, 22 Oct 2020 08:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503007AbgJVMBp (ORCPT ); Thu, 22 Oct 2020 08:01:45 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EA99C0613CE for ; Thu, 22 Oct 2020 05:01:45 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id l28so1903742lfp.10 for ; Thu, 22 Oct 2020 05:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9tdVLshVcb2kwPka4/LRhjHcSm9h075NEyjA4ZLCJYs=; b=kT5yuwwiXiJF2DtrWExMlv8mrMLi4ANew/WS18n4lRB+EeAfz0t5d91A/PEXNSN86X dK9ybkCXThawY/2h24j8xRthMDWaoShIJhFjaNypNhpMnE4cCtBhLRX2fLZtmMo6sAvB o4S9LmZtXuiCcNLYTafAglVOzUDsoDqc+YLN6pCbYYKlp4retHnv9iGhzOgjD7Iu7VKO Tvf6cabWLTTDKUZPlfuy1rQx3rjQY1DaQ8uu7kOHwEah5WjJJ5/cmDK0vdntQlyc4c8B rP3amoie/cJpfOZwF9dGeqmrVI6mbRFhSumVxCogR6XQm3o73dTDtaXW25SXq/V+mImd CpDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9tdVLshVcb2kwPka4/LRhjHcSm9h075NEyjA4ZLCJYs=; b=KP1lWs51b4dbV9ijT9UxKmzNMURQGGJSBV1SWjLSrxNf3VhtF4dHlnAi6fmwkQWWXH aprbI9JjKMctXtQZXEK2vb1YcQ6jN3Y406e2SMblQGdy/nsddFFgs8r8w7rm75ksh2Bf 6GGvTVAwv6yS32+DtiZWcN8RTz7yuSxndqaCHTdlr7QJPMQSEEJMJsEKO+ElF+B5RPD9 190T2RLGuO48SCWWhNeTq75rrp8Lp4eId8MlclgFkaQ28/KMVQop73OnyE4cuepkStuR dI5sZ67KF//N2CNkgYWZgqfpnzkyWoqiFYgHk1TTg1Xgp98VKR9oGmHxNK4bq09w1rOQ UPfw== X-Gm-Message-State: AOAM533d76Ho7brf+Q70JBewsd+mw24sHEhrENAigLA8CzKmqW44CX2O QnDaDduAFlQ7rY5wjV+FthKybQ== X-Google-Smtp-Source: ABdhPJylsP0EOfZL91sCKiPlZBvQTPHp1k3qJrpQ1C2jumtYhoAtSzGrCTDOaiPG8ukt2kTvSNZ+Ow== X-Received: by 2002:ac2:4545:: with SMTP id j5mr664027lfm.267.1603368103725; Thu, 22 Oct 2020 05:01:43 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id s14sm272993ljp.92.2020.10.22.05.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 05:01:43 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id AEBFC102F6D; Thu, 22 Oct 2020 15:01:42 +0300 (+03) Date: Thu, 22 Oct 2020 15:01:42 +0300 From: "Kirill A. Shutemov" To: "Edgecombe, Rick P" Cc: "peterz@infradead.org" , "jmattson@google.com" , "Christopherson, Sean J" , "vkuznets@redhat.com" , "dave.hansen@linux.intel.com" , "joro@8bytes.org" , "luto@kernel.org" , "pbonzini@redhat.com" , "wanpengli@tencent.com" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kirill.shutemov@linux.intel.com" , "keescook@chromium.org" , "rppt@kernel.org" , "linux-mm@kvack.org" , "x86@kernel.org" , "aarcange@redhat.com" , "liran.alon@oracle.com" , "wad@chromium.org" , "rientjes@google.com" , "Kleen, Andi" Subject: Re: [RFCv2 09/16] KVM: mm: Introduce VM_KVM_PROTECTED Message-ID: <20201022120142.uzephkci7pfy3kwq@box> References: <20201020061859.18385-1-kirill.shutemov@linux.intel.com> <20201020061859.18385-10-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 21, 2020 at 06:47:32PM +0000, Edgecombe, Rick P wrote: > On Tue, 2020-10-20 at 09:18 +0300, Kirill A. Shutemov wrote: > > include/linux/mm.h | 8 ++++++++ > > mm/gup.c | 20 ++++++++++++++++---- > > mm/huge_memory.c | 20 ++++++++++++++++---- > > mm/memory.c | 3 +++ > > mm/mmap.c | 3 +++ > > virt/kvm/async_pf.c | 2 +- > > virt/kvm/kvm_main.c | 9 +++++---- > > 7 files changed, 52 insertions(+), 13 deletions(-) > > There is another get_user_pages() in > paging_tmpl.h:FNAME(cmpxchg_gpte). Right, I will look into it. I wounder why I don't step onto it. > Also, did you leave off FOLL_KVM in gfn_to_page_many_atomic() on > purpose? It looks like its only used for pte prefetch which I guess is > not required. FOLL_FAST_ONLY is going to fail anyway. The caller has to handle it gracefully. -- Kirill A. Shutemov