lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231211030518.2722714-1-guanjun@linux.alibaba.com>
Date:   Mon, 11 Dec 2023 11:05:18 +0800
From:   'Guanjun' <guanjun@...ux.alibaba.com>
To:     dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
        kirill.shutemov@...ux.intel.com, yu.c.zhang@...ux.intel.com,
        tabba@...gle.com, xiaoyao.li@...el.com
Cc:     pbonzini@...hat.com, x86@...nel.org, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 1/1] KVM: Move kvm_gmem_migrate_folio inside CONFIG_MIGRATION

From: Guanjun <guanjun@...ux.alibaba.com>

'kvm_gmem_migrate_folio' is only used when CONFIG_MIGRATION
is defined, And it will triggers the compiler warning about
'kvm_gmem_migrate_folio' defined but not used when CONFIG_MIGRATION
isn't defined.

The compiler complained like that:
arch/x86/kvm/../../../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,
      |            ^~~~~~~~~~~~~~~~~~~~~~

Fixes: a7800aa80ea4 (KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory)
Signed-off-by: Guanjun <guanjun@...ux.alibaba.com>
---
 virt/kvm/guest_memfd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
index 16d58806e913..62bb8a1a47d1 100644
--- a/virt/kvm/guest_memfd.c
+++ b/virt/kvm/guest_memfd.c
@@ -259,6 +259,7 @@ void kvm_gmem_init(struct module *module)
 	kvm_gmem_fops.owner = module;
 }
 
+#ifdef CONFIG_MIGRATION
 static int kvm_gmem_migrate_folio(struct address_space *mapping,
 				  struct folio *dst, struct folio *src,
 				  enum migrate_mode mode)
@@ -266,6 +267,7 @@ static int kvm_gmem_migrate_folio(struct address_space *mapping,
 	WARN_ON_ONCE(1);
 	return -EINVAL;
 }
+#endif
 
 static int kvm_gmem_error_folio(struct address_space *mapping,
 		struct folio *folio)
-- 
2.39.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ