Message ID | 20231115090735.2404866-1-chenhuacai@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2413594vqg; Wed, 15 Nov 2023 01:08:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoGpfTt6kzkQjKM1agBY7gjdajW+ybsqIVgF750bx2QAolnjdEngglmluk+jq8b++x7sdZ X-Received: by 2002:a05:6a20:e10f:b0:187:3765:1798 with SMTP id kr15-20020a056a20e10f00b0018737651798mr4863977pzb.22.1700039299415; Wed, 15 Nov 2023 01:08:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700039299; cv=none; d=google.com; s=arc-20160816; b=Hxb2X5wmZCr2e72mI0YR4FMAMUgcpEYTvoGy5JYXt2pjFmx2x4upHNlwOog2Kd/5sT EbbsiTq5UOcn/PnI6UhKF82T0ajyMGI7RrKtRiz91exmSNm1kswUNEEJJP+Eopx7Dhyc mGZVc5FNSzss0SyEnWwp/24zPRDfJzKn5FOs9CEteC9HgFZ6otmBGpdvNGr6CuvcEPSp zvnxaNj0MeZwtpjCKDVpuroZ2/5v1z2iXnapZSrdrW7g0j7oMW1lrNm0/O1SbJ1Tc/fE v4LyLvR0cHhiAhBS8tCfUGteg3fTszof70dhTn+GwDyG5FGYwpVM91+Yt4gheNNz/z2O hURQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=8jkZIgOY3g/2gPJkCbEWdfk42kiNbHgQ9wpk/XF7w0I=; fh=l0Wi35CV2/KtREk3MQ//86GDpTdLxbghSY8Ko4eJwnE=; b=GVJcqZM9mWeGjEchK3d2vIhO98NwE2xbNPE66Y816W2NdTVdebeiOdm2+4xxZxQxmq v6Lexwo/Hjq2JWhoWktT4bzO/m8P4GwEsiybQR1y3yLyC/c3AT4U1fsjPeGlwTSA5OAS wrkt7OzgEBuE/rfqrzipHyMjpAkjqF1EM/OsuRVjbXReL+ajqY98v6r/AgAR1ZsB1WHz SEQNqOIBjndf0oXffE6d6mRVfiyxIpUBpFwfQfXu8ajWjtwYI1TTl+eQNHaaknruVcOX pZkaUIcidDvd/fuqEyDBc1+k295XCXc7tS2iL9hygyIOpc4v6fDnmex2lcaYEcEL6pZf qmKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id by30-20020a056a02059e00b005849fe1d3aesi10111768pgb.458.2023.11.15.01.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 01:08:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BA3B2803D027; Wed, 15 Nov 2023 01:08:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234694AbjKOJHx (ORCPT <rfc822;heyuhang3455@gmail.com> + 28 others); Wed, 15 Nov 2023 04:07:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234680AbjKOJHw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Nov 2023 04:07:52 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDEC0114 for <linux-kernel@vger.kernel.org>; Wed, 15 Nov 2023 01:07:46 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94CFEC433C8; Wed, 15 Nov 2023 09:07:43 +0000 (UTC) From: Huacai Chen <chenhuacai@loongson.cn> To: Paolo Bonzini <pbonzini@redhat.com>, Huacai Chen <chenhuacai@kernel.org>, Tianrui Zhao <zhaotianrui@loongson.cn>, Bibo Mao <maobibo@loongson.cn> Cc: kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, Xuerui Wang <kernel@xen0n.name>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Huacai Chen <chenhuacai@loongson.cn> Subject: [PATCH] LoongArch: KVM: Fix build due to API changes Date: Wed, 15 Nov 2023 17:07:35 +0800 Message-Id: <20231115090735.2404866-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 15 Nov 2023 01:08:16 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782620408148211249 X-GMAIL-MSGID: 1782620408148211249 |
Series |
LoongArch: KVM: Fix build due to API changes
|
|
Commit Message
Huacai Chen
Nov. 15, 2023, 9:07 a.m. UTC
Commit 8569992d64b8f750e34b7858eac ("KVM: Use gfn instead of hva for
mmu_notifier_retry") replaces mmu_invalidate_retry_hva() usage with
mmu_invalidate_retry_gfn() for X86, LoongArch also need similar changes
to fix build.
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
arch/loongarch/kvm/mmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 11/15/23 01:07, Huacai Chen wrote: > Commit 8569992d64b8f750e34b7858eac ("KVM: Use gfn instead of hva for > mmu_notifier_retry") replaces mmu_invalidate_retry_hva() usage with > mmu_invalidate_retry_gfn() for X86, LoongArch also need similar changes > to fix build. > > Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Reported-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Acked-by: Randy Dunlap <rdunlap@infradead.org> Thanks. > --- > arch/loongarch/kvm/mmu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c > index 80480df5f550..9463ebecd39b 100644 > --- a/arch/loongarch/kvm/mmu.c > +++ b/arch/loongarch/kvm/mmu.c > @@ -627,7 +627,7 @@ static bool fault_supports_huge_mapping(struct kvm_memory_slot *memslot, > * > * There are several ways to safely use this helper: > * > - * - Check mmu_invalidate_retry_hva() after grabbing the mapping level, before > + * - Check mmu_invalidate_retry_gfn() after grabbing the mapping level, before > * consuming it. In this case, mmu_lock doesn't need to be held during the > * lookup, but it does need to be held while checking the MMU notifier. > * > @@ -807,7 +807,7 @@ static int kvm_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, bool write) > > /* Check if an invalidation has taken place since we got pfn */ > spin_lock(&kvm->mmu_lock); > - if (mmu_invalidate_retry_hva(kvm, mmu_seq, hva)) { > + if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) { > /* > * This can happen when mappings are changed asynchronously, but > * also synchronously if a COW is triggered by
Hi, Paolo, On Thu, Nov 16, 2023 at 3:48 AM Randy Dunlap <rdunlap@infradead.org> wrote: > > > > On 11/15/23 01:07, Huacai Chen wrote: > > Commit 8569992d64b8f750e34b7858eac ("KVM: Use gfn instead of hva for > > mmu_notifier_retry") replaces mmu_invalidate_retry_hva() usage with > > mmu_invalidate_retry_gfn() for X86, LoongArch also need similar changes > > to fix build. > > > > Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> > > Reported-by: Randy Dunlap <rdunlap@infradead.org> > Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested > Acked-by: Randy Dunlap <rdunlap@infradead.org> I think this patch should go through your kvm tree rather than the loongarch tree. Because the loongarch tree is based on 6.7 now, this patch can fix a build error for kvm tree, but will cause a build error on the loongarch tree. Huacai > > Thanks. > > > --- > > arch/loongarch/kvm/mmu.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c > > index 80480df5f550..9463ebecd39b 100644 > > --- a/arch/loongarch/kvm/mmu.c > > +++ b/arch/loongarch/kvm/mmu.c > > @@ -627,7 +627,7 @@ static bool fault_supports_huge_mapping(struct kvm_memory_slot *memslot, > > * > > * There are several ways to safely use this helper: > > * > > - * - Check mmu_invalidate_retry_hva() after grabbing the mapping level, before > > + * - Check mmu_invalidate_retry_gfn() after grabbing the mapping level, before > > * consuming it. In this case, mmu_lock doesn't need to be held during the > > * lookup, but it does need to be held while checking the MMU notifier. > > * > > @@ -807,7 +807,7 @@ static int kvm_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, bool write) > > > > /* Check if an invalidation has taken place since we got pfn */ > > spin_lock(&kvm->mmu_lock); > > - if (mmu_invalidate_retry_hva(kvm, mmu_seq, hva)) { > > + if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) { > > /* > > * This can happen when mappings are changed asynchronously, but > > * also synchronously if a COW is triggered by > > -- > ~Randy
Hi, Someone please merge this patch... Thanks. On 11/15/23 01:07, Huacai Chen wrote: > Commit 8569992d64b8f750e34b7858eac ("KVM: Use gfn instead of hva for > mmu_notifier_retry") replaces mmu_invalidate_retry_hva() usage with > mmu_invalidate_retry_gfn() for X86, LoongArch also need similar changes > to fix build. > > Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> > --- > arch/loongarch/kvm/mmu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c > index 80480df5f550..9463ebecd39b 100644 > --- a/arch/loongarch/kvm/mmu.c > +++ b/arch/loongarch/kvm/mmu.c > @@ -627,7 +627,7 @@ static bool fault_supports_huge_mapping(struct kvm_memory_slot *memslot, > * > * There are several ways to safely use this helper: > * > - * - Check mmu_invalidate_retry_hva() after grabbing the mapping level, before > + * - Check mmu_invalidate_retry_gfn() after grabbing the mapping level, before > * consuming it. In this case, mmu_lock doesn't need to be held during the > * lookup, but it does need to be held while checking the MMU notifier. > * > @@ -807,7 +807,7 @@ static int kvm_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, bool write) > > /* Check if an invalidation has taken place since we got pfn */ > spin_lock(&kvm->mmu_lock); > - if (mmu_invalidate_retry_hva(kvm, mmu_seq, hva)) { > + if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) { > /* > * This can happen when mappings are changed asynchronously, but > * also synchronously if a COW is triggered by
Hi, Randy, On Sat, Dec 16, 2023 at 1:08 PM Randy Dunlap <rdunlap@infradead.org> wrote: > > Hi, > > Someone please merge this patch... > Thanks. I prepared loongarch-kvm changes for 6.8 and the base is 6.7-rc6 [1], If I merge this patch then the loongarch-next branch will build fail. So I think this patch should be merged to Paolo's next branch in his kvm tree. [1] https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git/log/?h=loongarch-next Huacai > > > On 11/15/23 01:07, Huacai Chen wrote: > > Commit 8569992d64b8f750e34b7858eac ("KVM: Use gfn instead of hva for > > mmu_notifier_retry") replaces mmu_invalidate_retry_hva() usage with > > mmu_invalidate_retry_gfn() for X86, LoongArch also need similar changes > > to fix build. > > > > Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> > > --- > > arch/loongarch/kvm/mmu.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c > > index 80480df5f550..9463ebecd39b 100644 > > --- a/arch/loongarch/kvm/mmu.c > > +++ b/arch/loongarch/kvm/mmu.c > > @@ -627,7 +627,7 @@ static bool fault_supports_huge_mapping(struct kvm_memory_slot *memslot, > > * > > * There are several ways to safely use this helper: > > * > > - * - Check mmu_invalidate_retry_hva() after grabbing the mapping level, before > > + * - Check mmu_invalidate_retry_gfn() after grabbing the mapping level, before > > * consuming it. In this case, mmu_lock doesn't need to be held during the > > * lookup, but it does need to be held while checking the MMU notifier. > > * > > @@ -807,7 +807,7 @@ static int kvm_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, bool write) > > > > /* Check if an invalidation has taken place since we got pfn */ > > spin_lock(&kvm->mmu_lock); > > - if (mmu_invalidate_retry_hva(kvm, mmu_seq, hva)) { > > + if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) { > > /* > > * This can happen when mappings are changed asynchronously, but > > * also synchronously if a COW is triggered by > > -- > #Randy > https://people.kernel.org/tglx/notes-about-netiquette > https://subspace.kernel.org/etiquette.html
Hi all, On Fri, 15 Dec 2023 21:08:06 -0800 Randy Dunlap <rdunlap@infradead.org> wrote: > > Someone please merge this patch... I have applied it to my merge of the kvm tree today and will keep applying it until it is applied to the kvm tree ... It looks like this: From: Huacai Chen <chenhuacai@loongson.cn> To: Paolo Bonzini <pbonzini@redhat.com>, Huacai Chen <chenhuacai@kernel.org>, Tianrui Zhao <zhaotianrui@loongson.cn>, Bibo Mao <maobibo@loongson.cn> Cc: kvm@vger.kernel.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, Xuerui Wang <kernel@xen0n.name>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Huacai Chen <chenhuacai@loongson.cn> Subject: [PATCH] LoongArch: KVM: Fix build due to API changes Date: Wed, 15 Nov 2023 17:07:35 +0800 Commit 8569992d64b8f750e34b7858eac ("KVM: Use gfn instead of hva for mmu_notifier_retry") replaces mmu_invalidate_retry_hva() usage with mmu_invalidate_retry_gfn() for X86, LoongArch also need similar changes to fix build. Fixes: 8569992d64b8 ("KVM: Use gfn instead of hva for mmu_notifier_retry") Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Reported-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> --- arch/loongarch/kvm/mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c index 80480df5f550..9463ebecd39b 100644 --- a/arch/loongarch/kvm/mmu.c +++ b/arch/loongarch/kvm/mmu.c @@ -627,7 +627,7 @@ static bool fault_supports_huge_mapping(struct kvm_memory_slot *memslot, * * There are several ways to safely use this helper: * - * - Check mmu_invalidate_retry_hva() after grabbing the mapping level, before + * - Check mmu_invalidate_retry_gfn() after grabbing the mapping level, before * consuming it. In this case, mmu_lock doesn't need to be held during the * lookup, but it does need to be held while checking the MMU notifier. * @@ -807,7 +807,7 @@ static int kvm_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, bool write) /* Check if an invalidation has taken place since we got pfn */ spin_lock(&kvm->mmu_lock); - if (mmu_invalidate_retry_hva(kvm, mmu_seq, hva)) { + if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) { /* * This can happen when mappings are changed asynchronously, but * also synchronously if a COW is triggered by
Hi all, On Wed, 20 Dec 2023 14:40:24 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > On Fri, 15 Dec 2023 21:08:06 -0800 Randy Dunlap <rdunlap@infradead.org> wrote: > > > > Someone please merge this patch... > > I have applied it to my merge of the kvm tree today and will keep > applying it until it is applied to the kvm tree ... > > It looks like this: > > From: Huacai Chen <chenhuacai@loongson.cn> > To: Paolo Bonzini <pbonzini@redhat.com>, > Huacai Chen <chenhuacai@kernel.org>, > Tianrui Zhao <zhaotianrui@loongson.cn>, > Bibo Mao <maobibo@loongson.cn> > Cc: kvm@vger.kernel.org, > loongarch@lists.linux.dev, > linux-kernel@vger.kernel.org, > Xuerui Wang <kernel@xen0n.name>, > Jiaxun Yang <jiaxun.yang@flygoat.com>, > Huacai Chen <chenhuacai@loongson.cn> > Subject: [PATCH] LoongArch: KVM: Fix build due to API changes > Date: Wed, 15 Nov 2023 17:07:35 +0800 > > Commit 8569992d64b8f750e34b7858eac ("KVM: Use gfn instead of hva for > mmu_notifier_retry") replaces mmu_invalidate_retry_hva() usage with > mmu_invalidate_retry_gfn() for X86, LoongArch also need similar changes > to fix build. > > Fixes: 8569992d64b8 ("KVM: Use gfn instead of hva for mmu_notifier_retry") > Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> > Reported-by: Randy Dunlap <rdunlap@infradead.org> > Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested > Acked-by: Randy Dunlap <rdunlap@infradead.org> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> > --- > arch/loongarch/kvm/mmu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c > index 80480df5f550..9463ebecd39b 100644 > --- a/arch/loongarch/kvm/mmu.c > +++ b/arch/loongarch/kvm/mmu.c > @@ -627,7 +627,7 @@ static bool fault_supports_huge_mapping(struct kvm_memory_slot *memslot, > * > * There are several ways to safely use this helper: > * > - * - Check mmu_invalidate_retry_hva() after grabbing the mapping level, before > + * - Check mmu_invalidate_retry_gfn() after grabbing the mapping level, before > * consuming it. In this case, mmu_lock doesn't need to be held during the > * lookup, but it does need to be held while checking the MMU notifier. > * > @@ -807,7 +807,7 @@ static int kvm_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, bool write) > > /* Check if an invalidation has taken place since we got pfn */ > spin_lock(&kvm->mmu_lock); > - if (mmu_invalidate_retry_hva(kvm, mmu_seq, hva)) { > + if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) { > /* > * This can happen when mappings are changed asynchronously, but > * also synchronously if a COW is triggered by > -- > 2.39.3 > > Though my Signed-off-by is not necessary if it applied to the kvm tree. OK, so it needed to be applied to the merge commit when the loongarch tree was merged by Linus, but appears to have been forgotten. :-(
On Wed, Nov 15, 2023 at 10:14 AM Huacai Chen <chenhuacai@loongson.cn> wrote: > > Commit 8569992d64b8f750e34b7858eac ("KVM: Use gfn instead of hva for > mmu_notifier_retry") replaces mmu_invalidate_retry_hva() usage with > mmu_invalidate_retry_gfn() for X86, LoongArch also need similar changes > to fix build. > > Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Applied, thanks. Paolo > --- > arch/loongarch/kvm/mmu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c > index 80480df5f550..9463ebecd39b 100644 > --- a/arch/loongarch/kvm/mmu.c > +++ b/arch/loongarch/kvm/mmu.c > @@ -627,7 +627,7 @@ static bool fault_supports_huge_mapping(struct kvm_memory_slot *memslot, > * > * There are several ways to safely use this helper: > * > - * - Check mmu_invalidate_retry_hva() after grabbing the mapping level, before > + * - Check mmu_invalidate_retry_gfn() after grabbing the mapping level, before > * consuming it. In this case, mmu_lock doesn't need to be held during the > * lookup, but it does need to be held while checking the MMU notifier. > * > @@ -807,7 +807,7 @@ static int kvm_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, bool write) > > /* Check if an invalidation has taken place since we got pfn */ > spin_lock(&kvm->mmu_lock); > - if (mmu_invalidate_retry_hva(kvm, mmu_seq, hva)) { > + if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) { > /* > * This can happen when mappings are changed asynchronously, but > * also synchronously if a COW is triggered by > -- > 2.39.3 >
Hi, Paolo, On Sat, Jan 27, 2024 at 2:01 AM Paolo Bonzini <pbonzini@redhat.com> wrote: > > On Wed, Nov 15, 2023 at 10:14 AM Huacai Chen <chenhuacai@loongsoncn> wrote: > > > > Commit 8569992d64b8f750e34b7858eac ("KVM: Use gfn instead of hva for > > mmu_notifier_retry") replaces mmu_invalidate_retry_hva() usage with > > mmu_invalidate_retry_gfn() for X86, LoongArch also need similar changes > > to fix build. > > > > Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> > > Applied, thanks. I'm sorry that I have already sent a PR to Linus which includes this one and together with some other patches. Huacai > > Paolo > > > --- > > arch/loongarch/kvm/mmu.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c > > index 80480df5f550..9463ebecd39b 100644 > > --- a/arch/loongarch/kvm/mmu.c > > +++ b/arch/loongarch/kvm/mmu.c > > @@ -627,7 +627,7 @@ static bool fault_supports_huge_mapping(struct kvm_memory_slot *memslot, > > * > > * There are several ways to safely use this helper: > > * > > - * - Check mmu_invalidate_retry_hva() after grabbing the mapping level, before > > + * - Check mmu_invalidate_retry_gfn() after grabbing the mapping level, before > > * consuming it. In this case, mmu_lock doesn't need to be held during the > > * lookup, but it does need to be held while checking the MMU notifier. > > * > > @@ -807,7 +807,7 @@ static int kvm_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, bool write) > > > > /* Check if an invalidation has taken place since we got pfn */ > > spin_lock(&kvm->mmu_lock); > > - if (mmu_invalidate_retry_hva(kvm, mmu_seq, hva)) { > > + if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) { > > /* > > * This can happen when mappings are changed asynchronously, but > > * also synchronously if a COW is triggered by > > -- > > 2.39.3 > > >
diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c index 80480df5f550..9463ebecd39b 100644 --- a/arch/loongarch/kvm/mmu.c +++ b/arch/loongarch/kvm/mmu.c @@ -627,7 +627,7 @@ static bool fault_supports_huge_mapping(struct kvm_memory_slot *memslot, * * There are several ways to safely use this helper: * - * - Check mmu_invalidate_retry_hva() after grabbing the mapping level, before + * - Check mmu_invalidate_retry_gfn() after grabbing the mapping level, before * consuming it. In this case, mmu_lock doesn't need to be held during the * lookup, but it does need to be held while checking the MMU notifier. * @@ -807,7 +807,7 @@ static int kvm_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, bool write) /* Check if an invalidation has taken place since we got pfn */ spin_lock(&kvm->mmu_lock); - if (mmu_invalidate_retry_hva(kvm, mmu_seq, hva)) { + if (mmu_invalidate_retry_gfn(kvm, mmu_seq, gfn)) { /* * This can happen when mappings are changed asynchronously, but * also synchronously if a COW is triggered by