Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2534526rdb; Fri, 8 Dec 2023 10:49:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IE8j5tZiRh3yU46+4zjaLQlwYjyKXAYzgBZDUW0MFShoNR5IrJuDFgi/3Q7r7gSXNGorSkf X-Received: by 2002:a17:902:d203:b0:1d0:910e:5028 with SMTP id t3-20020a170902d20300b001d0910e5028mr503898ply.47.1702061366100; Fri, 08 Dec 2023 10:49:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702061366; cv=none; d=google.com; s=arc-20160816; b=qZyZbBbJokFxLWMlnXE1mcbuWl5j+heHiNtbxxGTep50x1mLTT2U9wS+WtbkYrN6u5 xnnoGOZheEusXjKDDh5RuJAgHoVmeUIy/Dtt6UU8zdsEFDUOw+O2gnFghv9c67gY69vy 6bO0EaZ6zJxO/Wfap/0OaqMW6ofBeooatNuKggi2lfyrsYnAn7W+mQbxViTvgG71DwmX fDYgtYNMXjGtYHTswvVRklb8Br3tQ6V2VvKnaRdOlOWsGaz9GMrumfUTq5+AtVGMZIzm 7KQRj/Vu6FcX1iCCzIXgzrGNI9j2ammt5ykvQKQdQXILsZCQxrBRI/j0JOgAvov+T6Fj nJJg== 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:dkim-signature; bh=1U4FyBTNgaTu3ym4pmdpXt8ICQFx8oOPzOCvbI3KWnc=; fh=SiT8mHDfCFsEm6PFDmUI8YWm8PqKUKYI5k7Pc69HuDw=; b=z9H7xYRl5SS6XZmCG+f25uONeBCkWVUwk7nr8K0UiVS1l9rHyxb8MxgW2hIeTJBZ9K 8GGrahF0XQeJ7C+fJobWd/wX1EBfKID8ppw6P3yvhAQ8upk4nw77TITeAeFZsjg0+nht juiL7L2w16XhOKrkqixcZ7peSgYtdh478XabrEJGdOVHv+v7/jsErUcrf7gcwic9lcyD 8hjhGEanSgia16ZmtwDITgU7kUXexmowcK70QzSvYa03Hr6KSfIEHkxsGDJVKelLaGyz 7GjXOuItTxTuod8Em1Mk5tP8Q0qBPltJn6jomTniYQet/GvUxV+ZicjCBxHdCEfi4JYi 5jCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q7m8XMyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id h9-20020a170902b94900b001b973681493si1954760pls.16.2023.12.08.10.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 10:49:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Q7m8XMyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D16FF81C9AFE; Fri, 8 Dec 2023 10:49:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233820AbjLHStJ (ORCPT + 99 others); Fri, 8 Dec 2023 13:49:09 -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-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 08 Dec 2023 10:49:24 -0800 (PST) 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 Suggested-by: Sean Christopherson Signed-off-by: Paolo Bonzini --- 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