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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0CE6C25B0E for ; Wed, 10 Aug 2022 08:24:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbiHJIYn (ORCPT ); Wed, 10 Aug 2022 04:24:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231219AbiHJIYl (ORCPT ); Wed, 10 Aug 2022 04:24:41 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4721885F88; Wed, 10 Aug 2022 01:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660119880; x=1691655880; h=date:from:to:cc:subject:message-id:reply-to:references: mime-version:in-reply-to; bh=6kT9mTMxRWS6E11jw9PH26Anrkm3qIMlLthMQe7yaTk=; b=A7UeecBqYGcs818PljT93xy7yN1I2Hi5FEH2T4fJYUXeHBAvSV2hAUeT V4kOGW7cqdLNQGRqAE35GoDPubqecUgDgeo3tvEnL/VsnybJAPHJhFG7g CDGEQ2uCQtpCja9UOh0kL0/L1jc49///IAFQma+JN52Xk+US5sxjeLiZf vLyzwrbDHKDC8sd0pImoKZ/QAVMcZ/yLzTg4lXSEc0KqkaLrMlkPZb/+A YjlKv73oklEKEeKz0iDgI7CIXtho+lUjcTppRypanTTJ0AOmW5dRSfC8y Acvtk/7HG6P6X0gh0DwN5G2xxOvyTGRApzwRJM/PEeFpG0ZkcayhPCMwF g==; X-IronPort-AV: E=McAfee;i="6400,9594,10434"; a="289784598" X-IronPort-AV: E=Sophos;i="5.93,226,1654585200"; d="scan'208";a="289784598" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2022 01:24:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,226,1654585200"; d="scan'208";a="601738890" Received: from chaop.bj.intel.com (HELO localhost) ([10.240.193.75]) by orsmga007.jf.intel.com with ESMTP; 10 Aug 2022 01:24:29 -0700 Date: Wed, 10 Aug 2022 16:19:43 +0800 From: Chao Peng To: Isaku Yamahata Cc: 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 , Sean Christopherson , 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 , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Kirill A . Shutemov" , 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 Subject: Re: [PATCH v7 07/14] KVM: Use gfn instead of hva for mmu_notifier_retry Message-ID: <20220810081943.GB862421@chaop.bj.intel.com> Reply-To: Chao Peng References: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> <20220706082016.2603916-8-chao.p.peng@linux.intel.com> <20220804071044.GA4091749@ls.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220804071044.GA4091749@ls.amr.corp.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 04, 2022 at 12:10:44AM -0700, Isaku Yamahata wrote: > On Wed, Jul 06, 2022 at 04:20:09PM +0800, > Chao Peng wrote: > > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > > index 0bdb6044e316..e9153b54e2a4 100644 > > --- a/include/linux/kvm_host.h > > +++ b/include/linux/kvm_host.h > > @@ -1362,10 +1362,8 @@ void kvm_mmu_free_memory_cache(struct kvm_mmu_memory_cache *mc); > > void *kvm_mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc); > > #endif > > > > -void kvm_inc_notifier_count(struct kvm *kvm, unsigned long start, > > - unsigned long end); > > -void kvm_dec_notifier_count(struct kvm *kvm, unsigned long start, > > - unsigned long end); > > +void kvm_inc_notifier_count(struct kvm *kvm, gfn_t start, gfn_t end); > > +void kvm_dec_notifier_count(struct kvm *kvm, gfn_t start, gfn_t end); > > > > long kvm_arch_dev_ioctl(struct file *filp, > > unsigned int ioctl, unsigned long arg); > > The corresponding changes in kvm_main.c are missing. Exactly! Actually it's in the next patch while it should indeed in this patch. Chao > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index b2c79bef61bd..0184e327f6f5 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -711,8 +711,7 @@ static void kvm_mmu_notifier_change_pte(struct mmu_notifier *mn, > kvm_handle_hva_range(mn, address, address + 1, pte, kvm_set_spte_gfn); > } > > -void kvm_inc_notifier_count(struct kvm *kvm, unsigned long start, > - unsigned long end) > +void kvm_inc_notifier_count(struct kvm *kvm, gfn_t start, gfn_t end) > { > /* > * The count increase must become visible at unlock time as no > @@ -786,8 +785,7 @@ static int kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn, > return 0; > } > > -void kvm_dec_notifier_count(struct kvm *kvm, unsigned long start, > - unsigned long end) > +void kvm_dec_notifier_count(struct kvm *kvm, gfn_t start, gfn_t end) > { > /* > * This sequence increase will notify the kvm page fault that > > > -- > Isaku Yamahata