From nobody Tue Dec 16 16:39:04 2025 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 465DBC4167B for ; Fri, 8 Dec 2023 18:49:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574626AbjLHStK (ORCPT ); Fri, 8 Dec 2023 13:49:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbjLHStI (ORCPT ); Fri, 8 Dec 2023 13:49:08 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6612E0 for ; Fri, 8 Dec 2023 10:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702061353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1U4FyBTNgaTu3ym4pmdpXt8ICQFx8oOPzOCvbI3KWnc=; b=Q7m8XMyhnN3VM7cpNK8sb1gGYFNN1K+ClDKO1FnDL9WqSMNwb6vuTOm0aGvlxFMdH1UNND Of/RvjPnHL3hgRzRQ5bl+AjAiPmiGQozJH6+bYBZ4Errf/2jkq0tBcsGrQnIA8t6lf1vQx GCgTrOdfKmGvcdrKjpQBvyApybi3olw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-eVXvRh78Mjm_x0I8g51vlQ-1; Fri, 08 Dec 2023 13:49:09 -0500 X-MC-Unique: eVXvRh78Mjm_x0I8g51vlQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 51FB3832D1B; Fri, 8 Dec 2023 18:49:09 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD93E40C6EB9; Fri, 8 Dec 2023 18:49:08 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Arnd Bergmann , Sean Christopherson Subject: [PATCH v2] KVM: guest-memfd: fix unused-function warning Date: Fri, 8 Dec 2023 13:49:08 -0500 Message-Id: <20231208184908.2298225-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" With migration disabled, one function becomes unused: virt/kvm/guest_memfd.c:262:12: error: 'kvm_gmem_migrate_folio' defined but = not used [-Werror=3Dunused-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-spe= cific backing memory") Reported-by: Arnd Bergmann Suggested-by: Sean Christopherson Signed-off-by: Paolo Bonzini Reviewed-by: Sean Christopherson --- 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 *ma= pping, struct page *page) =20 static const struct address_space_operations kvm_gmem_aops =3D { .dirty_folio =3D noop_dirty_folio, -#ifdef CONFIG_MIGRATION .migrate_folio =3D kvm_gmem_migrate_folio, -#endif .error_remove_page =3D kvm_gmem_error_page, }; =20 --=20 2.39.1