On Friday, March 13, 2020 4:50 PM Dan Williams <[email protected]> wrote:
> On Fri, Mar 13, 2020 at 3:06 AM Dorau, Lukasz <[email protected]> wrote:
> >
> > The steps to reproduce:
> >
> > $ sudo modprobe -v nfit_test
> > insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/kernel/drivers/char/hw_random/rng-core.ko.xz
> > insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/kernel/drivers/char/tpm/tpm.ko.xz
> > insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/kernel/security/keys/trusted-keys/trusted.ko.xz
> > insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/kernel/security/keys/encrypted-keys/encrypted-keys.ko.xz
> > install /usr/bin/ndctl load-keys ; /sbin/modprobe --ignore-install libnvdimm
> $CMDLINE_OPTS
> > No TPM handle discovered.
> > failed to open file /etc/ndctl/keys/nvdimm-master.blob: No such file or 
> > directory
> > insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/kernel/drivers/nvdimm/libnvdimm.ko.xz
> > insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/kernel/drivers/acpi/nfit/nfit.ko.xz
> > insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/extra/test/nfit_test_iomap.ko.xz
> > insmod /lib/modules/5.6.0-rc1-13504-g7b27a8622f80/extra/test/nfit_test.ko.xz
> > modprobe: ERROR: could not insert 'nfit_test': Unknown symbol in module, or
> unknown parameter (see dmesg)
> >
> > $ dmesg | tail
> > [  102.769871] Key type encrypted registered
> > [  102.799289] nfit_test_iomap: loading out-of-tree module taints kernel.
> > [  102.804008] nfit_test: Unknown symbol libnvdimm_test (err -2)
> > [  102.804054] nfit_test: Unknown symbol acpi_nfit_test (err -2)
> > [  102.804118] nfit_test: Unknown symbol pmem_test (err -2)
> > [  102.804164] nfit_test: Unknown symbol dax_pmem_core_test (err -2)
> > [  102.804226] nfit_test: Unknown symbol dax_pmem_compat_test (err -2)
> > [  102.804273] nfit_test: Unknown symbol device_dax_test (err -2)
> > [  102.804308] nfit_test: Unknown symbol dax_pmem_test (err -2)
> >
> > Removing the wrong modules:
> >
> > $ sudo rmmod nfit
> > $ sudo rmmod libnvdimm
> >
> > Inserting the right modules manually:
> >
> > $ sudo insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/extra/libnvdimm.ko.xz
> > $ sudo insmod /lib/modules/5.6.0-rc1-13504-g7b27a8622f80/extra/nd_btt.ko.xz
> > $ sudo insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/extra/nd_pmem.ko.xz
> > $ sudo insmod /lib/modules/5.6.0-rc1-13504-g7b27a8622f80/extra/nfit.ko.xz
> > $ sudo insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/extra/dax_pmem_core.ko.xz
> > $ sudo insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/extra/dax_pmem.ko.xz
> > $ sudo insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/extra/device_dax.ko.xz
> > $ sudo insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/extra/dax_pmem_compat.ko.xz
> > $ sudo insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/extra/test/nfit_test.ko.xz
> >
> > The 'nfit_test' module is successfully inserted with *NO ERRORS* now:
> >
> > $ dmesg | tail
> > [  464.439504] nfit_test: mcsafe_test: disabled, skip.
> > [  464.500439] nfit_test nfit_test.0: failed to evaluate _FIT
> > [  464.507964] nfit_test nfit_test.1: Error found in NVDIMM nmem4 flags: 
> > save_fail
> restore_fail flush_fail not_armed
> > [  464.507990] nfit_test nfit_test.1: Error found in NVDIMM nmem5 flags: 
> > map_fail
> > [  464.508614] nd_pmem namespace6.0: region6 read-only, marking pmem6 read-
> only
> > [  464.508729] pmem6: detected capacity change from 0 to 33554432
> > [  464.508737] pmem7: detected capacity change from 0 to 4194304
> >
> > $ lsmod | grep nfit
> > nfit_test              49152  8
> > dax_pmem_compat        20480  1 nfit_test
> > device_dax             20480  2 nfit_test,dax_pmem_compat
> > dax_pmem               20480  1 nfit_test
> > dax_pmem_core          20480  3 dax_pmem,nfit_test,dax_pmem_compat
> > nfit                   73728  1 nfit_test
> > nd_pmem                24576  1 nfit_test
> > libnvdimm             200704  8
> dax_pmem,nfit_test,dax_pmem_core,nd_btt,nd_pmem,dax_pmem_compat,nd_blk,
> nfit
> > nfit_test_iomap        24576  6
> nfit_test,dax_pmem_core,device_dax,nd_pmem,libnvdimm,nfit
> >
> > Trying to remove and reinsert the 'nfit_test' module:
> >
> > $ sudo ndctl disable-region all
> > disabled 8 regions
> >
> > $ sudo modprobe -v -r nfit_test
> > rmmod nfit_test
> > rmmod nfit
> >
> > $ sudo modprobe -v nfit_test
> > insmod /lib/modules/5.6.0-rc1-13504-
> g7b27a8622f80/kernel/drivers/acpi/nfit/nfit.ko.xz
> > insmod /lib/modules/5.6.0-rc1-13504-g7b27a8622f80/extra/test/nfit_test.ko.xz
> > modprobe: ERROR: could not insert 'nfit_test': Unknown symbol in module, or
> unknown parameter (see dmesg)
> >
> > $ dmesg | tail
> > [  919.861636] nfit_test: Unknown symbol acpi_nfit_test (err -2)
> 
> I'm still not sure how you are managing to hit "unknown symbol"
> errors, are you re-running depmod after creating the test modules?

The above error:
   "nfit_test: Unknown symbol acpi_nfit_test (err -2)"
I have hit after having removed the 'nfit_test' module:
   $ sudo modprobe -v -r nfit_test
and having tried to reinsert it:

$ sudo modprobe -v nfit_test
insmod 
/lib/modules/5.6.0-rc1-13504-g7b27a8622f80/kernel/drivers/acpi/nfit/nfit.ko.xz
insmod /lib/modules/5.6.0-rc1-13504-g7b27a8622f80/extra/test/nfit_test.ko.xz
modprobe: ERROR: could not insert 'nfit_test': Unknown symbol in module, or 
unknown parameter (see dmesg)

because 'modprobe' has inserted the production version of the 'nfit' driver 
(kernel/drivers/acpi/nfit/nfit.ko.xz)
instead of the test one (extra/nfit.ko.xz).

Regarding 'depmod' I have run the following commands to build and install the 
kernel and the modules:
$ make
$ make M=tools/testing/nvdimm
$ sudo make M=tools/testing/nvdimm  modules_install     # ---> it runs depmod
$ sudo make modules_install     # ---> it runs depmod
$ sudo make install

--
Lukasz

_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to