From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C310321CC4F for ; Mon, 1 Dec 2025 17:36:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764610607; cv=none; b=Z64KLDzxCdnk0yq/ibwOgdoBFnvNNoriM5vvEbJJowyC2XfkSgbY3UQjeUZrWC0kz9GKonG/PMQQyymOB4VhxehFYGA8VbP5pHQ469exAUD/7f1dXkTOxuWEiJpSiEXxhfxybd2wMdbHMN+/sIKDD8mpnCcZPudC22ZetgWNqw8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764610607; c=relaxed/simple; bh=OYq063x/kWzolRkbiS0sRgj7g8DeK/P7vo8HUfxzrvM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=L7BZRUi2wTiGVNe6CXHeQj6hBuSiH/GWvZ5SAMZUg4Gy5Ci0+N+YDRhirno4WW6stFaV+BWm8i+oK16r7CSlfcRP8clLqTCgSibCIdHbztYzTf/1C7K/Q5p/fucLMewC2wCqF2LyqxBvspTNNitwzJhnpUv8CJX3OtgeNsfVIKw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=qU5Q7CCJ; arc=none smtp.client-ip=209.85.214.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qU5Q7CCJ" Received: by mail-pl1-f193.google.com with SMTP id d9443c01a7336-29558061c68so54684145ad.0 for ; Mon, 01 Dec 2025 09:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1764610605; x=1765215405; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=yOls94FUtGD6Qyq6JZRmBlpF7rbm3X6QAjMJEPTNkM0=; b=qU5Q7CCJFHR6Jip8eTXb1OUvXcoRmd1DbEL1PGCQvTCDbLeEGCiDNz3pSnVoCq7o8u IT1dUJKU3caUQMDZkEqaP8VBe5eRpybch7bzM7t+hyF06xeMbOSxlyftw6BXByKdWXWb mUdsx05QI/LBYGVSg+Ry35Stuw96LBIX6G+oXvuOpzN/eegg7QHZxEuMmpW1J+vzClT5 nLJLi7j5E/a0tc1o0CpEqKKSobbmvFOZy1ktvcrgD66v9+g+8CCOTB++dbQ2xICoFLzJ A34r8/YorzDjFme4V7QrBJTPSi0Osj5QFSkZPivL1W9givcHR+sx5AExhOXfkEW+lO01 DaoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764610605; x=1765215405; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yOls94FUtGD6Qyq6JZRmBlpF7rbm3X6QAjMJEPTNkM0=; b=YxBdlMmqtFnrIcPyiu9enY12sJFOrxFYLKHbYO0vQXm6NFhJOaXxMw5V90epv/bZRY 2nCxzMMp7n5tQwEJPWvAlakeXnlP7XXs4SDLZsnHrqdagJUZ5RHP+MEt0Ekjpf4CwCfY AYiJ/b88BZLNn/cnbpoDEcqhpC/PkcanbPPuErpZTJ5G/uCjkroJzWLk/v91uMMSMwwg Mp2gV9ZB8/6k9QcjVQcUcJVjVl2+AtHCQz8EfjNINXvFeMywko9xRrWxkWo3mAY/Qh0n dAsG7HKPUDx270GDLlxbqxsTh/oRTtR0A3mbNIGBOr0hAnZT1XuBCf8j9rW5QugG5svm 2AHQ== X-Forwarded-Encrypted: i=1; AJvYcCXiJGpxG1BMlKQGLuc8Ye0s05VZLBKyvJp8xRp6Wng47upmVJDP3c29YNa5DSDR41Th+3aYMPogx3QkqEg=@vger.kernel.org X-Gm-Message-State: AOJu0Yxjl6r/djApRmiCLgWMAIPikIERKVXsc4wwvuCa5dCNNBIUxYfo hxssW6rwI8rBthmdqkwlWGUYpf6xAJBJY+HXggrSaNTO1dYM7sFzhJ0zlMDlU0uDtw== X-Gm-Gg: ASbGncvaF98RIKpqqPL3kYEfSzlcjaD7r2aGZ0AIaATs+Mh9AmJXPF5PhQJF2T6cYLj Jh8h0eWGEB5jQcfvLOXRom3knFjN1wqKg0TfmU+jCw9yz572iv2KJwNyYC/a479e++BXgMUYa3V P6Q3c/yF+8Cy+awiV6EAb00w62J6WsbagvlZUiVQUTnQn983CFbfO7ouysBME6IVliaimIogqa6 rvYcvTMgk1KB70+yk+ZCIaVp3ltwlja5BYd2NUBb06QOEXMleSuq1ucgIAaFLwvCCpRvVuKHcKV Uuc3Fi1t9tYmsIORLUJoBRwtnBA5iVX/ThyLqAL4c5Ms93Q6ktTDSqA8CKe3HUC2EiuWN1ut5Cy B8xp9IB6J3Dx4jyjY6CryQ30oJKMH9uJo8yFeueCbGQO1MXT84mD8GuNkkO1VfFTGYA3Mm5wNCW RxspB9TrbGi3FP4rsmgXr5SFer8RJbO6VvQlDVuvxUzqTjAOQ= X-Google-Smtp-Source: AGHT+IHxNL4zVA4YwR2Gk5dBAeB2uwQdYit3oH3bwVFcnVNWz9JhOvi5wb83c3kF4oupUBwnEmP3sQ== X-Received: by 2002:a17:90b:4b03:b0:340:29a1:1b0c with SMTP id 98e67ed59e1d1-34733e6c8aamr43027950a91.7.1764610604811; Mon, 01 Dec 2025 09:36:44 -0800 (PST) Received: from google.com (28.29.230.35.bc.googleusercontent.com. [35.230.29.28]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3476a54705csm17545241a91.2.2025.12.01.09.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Dec 2025 09:36:43 -0800 (PST) Date: Mon, 1 Dec 2025 17:36:39 +0000 From: David Matlack To: Zhu Yanjun Cc: Alex Williamson , Adithya Jayachandran , Alex Mastro , Alistair Popple , Andrew Morton , Bjorn Helgaas , Chris Li , David Rientjes , Jacob Pan , Jason Gunthorpe , Jason Gunthorpe , Josh Hilke , Kevin Tian , kvm@vger.kernel.org, Leon Romanovsky , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-pci@vger.kernel.org, Lukas Wunner , Mike Rapoport , Parav Pandit , Pasha Tatashin , Philipp Stanner , Pratyush Yadav , Saeed Mahameed , Samiullah Khawaja , Shuah Khan , Tomita Moeko , Vipin Sharma , William Tu , Yi Liu , Yunxiang Li Subject: Re: [PATCH 00/21] vfio/pci: Base support to preserve a VFIO device file across Live Update Message-ID: References: <20251126193608.2678510-1-dmatlack@google.com> <46bbdad1-486d-4cb1-915f-577b00de827f@linux.dev> <4998497c-87e8-4849-8442-b7281c627884@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On 2025-12-01 05:32 PM, David Matlack wrote: > On 2025-12-01 09:16 AM, Zhu Yanjun wrote: > > > > 在 2025/12/1 9:10, David Matlack 写道: > > > On Mon, Dec 1, 2025 at 7:49 AM Zhu Yanjun wrote: > > > > 在 2025/11/27 20:56, Zhu Yanjun 写道: > > > > > Hi, David > > > > > > > > > > ERROR: modpost: "liveupdate_register_file_handler" [drivers/vfio/pci/ > > > > > vfio-pci-core.ko] undefined! > > > > > > > > > > ERROR: modpost: "vfio_pci_ops" [drivers/vfio/pci/vfio-pci-core.ko] > > > > > undefined! > > > > > ERROR: modpost: "liveupdate_enabled" [drivers/vfio/pci/vfio-pci-core.ko] > > > > > undefined! > > > > > ERROR: modpost: "liveupdate_unregister_file_handler" [drivers/vfio/pci/ > > > > > vfio-pci-core.ko] undefined! > > > > > ERROR: modpost: "vfio_device_fops" [drivers/vfio/pci/vfio-pci-core.ko] > > > > > undefined! > > > > > ERROR: modpost: "vfio_pci_is_intel_display" [drivers/vfio/pci/vfio-pci- > > > > > core.ko] undefined! > > > > > ERROR: modpost: "vfio_pci_liveupdate_init" [drivers/vfio/pci/vfio- > > > > > pci.ko] undefined! > > > > > ERROR: modpost: "vfio_pci_liveupdate_cleanup" [drivers/vfio/pci/vfio- > > > > > pci.ko] undefined! > > > > > make[4]: *** [scripts/Makefile.modpost:147: Module.symvers] Error 1 > > > > > make[3]: *** [Makefile:1960: modpost] Error 2 > > > > > > > > > > After I git clone the source code from the link https://github.com/ > > > > > dmatlack/linux/tree/liveupdate/vfio/cdev/v1, > > > > > > > > > > I found the above errors when I built the source code. > > > > > > > > > > Perhaps the above errors can be solved by EXPORT_SYMBOL. > > > > > > > > > > But I am not sure if a better solution can solve the above problems or not. > > > > I reviewed this patch series in detail. If I’m understanding it > > > > correctly, there appears to be a cyclic dependency issue. Specifically, > > > > some functions in kernel module A depend on kernel module B, while at > > > > the same time certain functions in module B depend on module A. > > > > > > > > I’m not entirely sure whether this constitutes a real problem or if it’s > > > > intentional design. > > > Thanks for your report. Can you share the .config file you used to > > > generate these errors? > > > > > > IIRC, I used FC 42 default config. Perhaps you can make tests with it. If > > this problem can not be reproduced, I will share my config with you. > > > > What does "FC 42 default config" mean? > > Either way I was able to reproduce the errors you posted above by > changing CONFIG_VFIO_PCI{_CORE} from "y" to "m". > > To unblock building and testing this series you can change these configs > from "m" to "y", or the following patch (which fixed things for me): Oops, sorry, something went wrong when I posted that diff. Here's the correct diff: diff --git a/drivers/vfio/pci/Makefile b/drivers/vfio/pci/Makefile index 929df22c079b..c2cca16e99a8 100644 --- a/drivers/vfio/pci/Makefile +++ b/drivers/vfio/pci/Makefile @@ -2,11 +2,11 @@ vfio-pci-core-y := vfio_pci_core.o vfio_pci_intrs.o vfio_pci_rdwr.o vfio_pci_config.o vfio-pci-core-$(CONFIG_VFIO_PCI_ZDEV_KVM) += vfio_pci_zdev.o -vfio-pci-core-$(CONFIG_LIVEUPDATE) += vfio_pci_liveupdate.o obj-$(CONFIG_VFIO_PCI_CORE) += vfio-pci-core.o vfio-pci-y := vfio_pci.o vfio-pci-$(CONFIG_VFIO_PCI_IGD) += vfio_pci_igd.o +vfio-pci-$(CONFIG_LIVEUPDATE) += vfio_pci_liveupdate.o obj-$(CONFIG_VFIO_PCI) += vfio-pci.o obj-$(CONFIG_MLX5_VFIO_PCI) += mlx5/ diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c index c5b5eb509474..b9805861763a 100644 --- a/drivers/vfio/vfio_main.c +++ b/drivers/vfio/vfio_main.c @@ -1386,6 +1386,7 @@ const struct file_operations vfio_device_fops = { .show_fdinfo = vfio_device_show_fdinfo, #endif }; +EXPORT_SYMBOL_GPL(vfio_device_fops); /** * vfio_file_is_valid - True if the file is valid vfio file diff --git a/kernel/liveupdate/luo_core.c b/kernel/liveupdate/luo_core.c index 69298d82f404..c7a0c9c3b6a8 100644 --- a/kernel/liveupdate/luo_core.c +++ b/kernel/liveupdate/luo_core.c @@ -256,6 +256,7 @@ bool liveupdate_enabled(void) { return luo_global.enabled; } +EXPORT_SYMBOL_GPL(liveupdate_enabled); /** * DOC: LUO ioctl Interface diff --git a/kernel/liveupdate/luo_file.c b/kernel/liveupdate/luo_file.c index fca3806dae28..9baa88966f04 100644 --- a/kernel/liveupdate/luo_file.c +++ b/kernel/liveupdate/luo_file.c @@ -868,6 +868,7 @@ int liveupdate_register_file_handler(struct liveupdate_file_handler *fh) luo_session_resume(); return err; } +EXPORT_SYMBOL_GPL(liveupdate_register_file_handler); /** * liveupdate_unregister_file_handler - Unregister a liveupdate file handler @@ -913,3 +914,4 @@ int liveupdate_unregister_file_handler(struct liveupdate_file_handler *fh) liveupdate_test_register(fh); return err; } +EXPORT_SYMBOL_GPL(liveupdate_unregister_file_handler);