* [PATCH v2] KVM: guest-memfd: fix unused-function warning
@ 2023-12-08 18:49 Paolo Bonzini
2023-12-08 19:04 ` Sean Christopherson
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2023-12-08 18:49 UTC (permalink / raw)
To: linux-kernel, kvm; +Cc: Arnd Bergmann, Sean Christopherson
With migration disabled, one function becomes unused:
virt/kvm/guest_memfd.c:262:12: error: 'kvm_gmem_migrate_folio' defined but not used [-Werror=unused-function]
262 | static int kvm_gmem_migrate_folio(struct address_space *mapping,
| ^~~~~~~~~~~~~~~~~~~~~~
Remove the #ifdef around the reference so that fallback_migrate_folio()
is never used. The gmem implementation of the hook is trivial; since
the gmem mapping is unmovable, the pages should not be migrated anyway.
Fixes: a7800aa80ea4 ("KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
virt/kvm/guest_memfd.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
index b99272396119..c2e2371720a9 100644
--- a/virt/kvm/guest_memfd.c
+++ b/virt/kvm/guest_memfd.c
@@ -300,9 +300,7 @@ static int kvm_gmem_error_page(struct address_space *mapping, struct page *page)
static const struct address_space_operations kvm_gmem_aops = {
.dirty_folio = noop_dirty_folio,
-#ifdef CONFIG_MIGRATION
.migrate_folio = kvm_gmem_migrate_folio,
-#endif
.error_remove_page = kvm_gmem_error_page,
};
--
2.39.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] KVM: guest-memfd: fix unused-function warning
2023-12-08 18:49 [PATCH v2] KVM: guest-memfd: fix unused-function warning Paolo Bonzini
@ 2023-12-08 19:04 ` Sean Christopherson
0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2023-12-08 19:04 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: linux-kernel, kvm, Arnd Bergmann
On Fri, Dec 08, 2023, Paolo Bonzini wrote:
> With migration disabled, one function becomes unused:
>
> virt/kvm/guest_memfd.c:262:12: error: 'kvm_gmem_migrate_folio' defined but not used [-Werror=unused-function]
> 262 | static int kvm_gmem_migrate_folio(struct address_space *mapping,
> | ^~~~~~~~~~~~~~~~~~~~~~
>
> Remove the #ifdef around the reference so that fallback_migrate_folio()
> is never used. The gmem implementation of the hook is trivial; since
> the gmem mapping is unmovable, the pages should not be migrated anyway.
>
> Fixes: a7800aa80ea4 ("KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory")
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Suggested-by: Sean Christopherson <seanjc@google.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
Reviewed-by: Sean Christopherson <seanjc@google.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-08 19:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08 18:49 [PATCH v2] KVM: guest-memfd: fix unused-function warning Paolo Bonzini
2023-12-08 19:04 ` Sean Christopherson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox