Message ID | 20231208184908.2298225-1-pbonzini@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5651509vqy; Fri, 8 Dec 2023 10:49:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGh8UD9T50K2vuuKW6+lahRmfTiWqx80mA4pmYfLW3TGqrErPmLeeY6ClChgxG3zjgnXsNi X-Received: by 2002:a17:90b:152:b0:286:db83:a092 with SMTP id em18-20020a17090b015200b00286db83a092mr503024pjb.20.1702061362861; Fri, 08 Dec 2023 10:49:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702061362; cv=none; d=google.com; s=arc-20160816; b=RWlgw6zso1WZE2ukBEmItlmfvrop0/OkJN8FSv+cdCKZGm7H4cMH1apW1YGQhP1U7D BO4UbYqdZyldSgLvkHrqBGl60UhW/ObY2NXgZ994seEy4SmGuuXDUfHAxtQYwWvq0i1j 1G26e7UAIVHP1XKE2OR+M8B6j6DL1EiEubygfhui791EPE8cGDf8dw7Nj0sFsdyS2g0b 1kYjH3lKppbT9hHx7117hkFW8fhOcuSlsz0x+IGap+eFhykwkzG579wMz5AhkQuPiF4K PgrBosSduAocpVdpw2nH7HAPQWAkZ19SZOMpgtKj1mCXpa3j3LeZh4s3twmEcRPluTbl WTGg== 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 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id bg1-20020a17090b0d8100b002791035445esi1989300pjb.76.2023.12.08.10.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 10:49:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; 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 23.128.96.38 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 9F42B81C50B7; Fri, 8 Dec 2023 10:49:20 -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 <rfc822;ezelljr.billy@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <pbonzini@redhat.com> To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Arnd Bergmann <arnd@arndb.de>, Sean Christopherson <seanjc@google.com> 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: <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 (fry.vger.email [0.0.0.0]); Fri, 08 Dec 2023 10:49:20 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784740695855972841 X-GMAIL-MSGID: 1784740695855972841 |
Series |
[v2] KVM: guest-memfd: fix unused-function warning
|
|
Commit Message
Paolo Bonzini
Dec. 8, 2023, 6:49 p.m. UTC
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(-)
Comments
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>
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, };