On Fri, Mar 13, 2020 at 3:06 AM Dorau, Lukasz <[email protected]> wrote:
>
> On Thursday, March 12, 2020 6:09 PM Dan Williams <[email protected]> 
> wrote:
> >
> > If you force loaded a module with unresolved symbols all bets are off,
> > lets get "make TESTS=libndctl check" running cleanly before trying to
> > debug this report.
>
> My experiments with "make TESTS=libndctl check" I have described in the 
> separate thread "nfit_test: issue #2":
> https://lists.01.org/hyperkitty/list/[email protected]/thread/QDFPRM5C3UQJKPQ6OKA6PO57Z55S67RF/
>
> I have *NOT* force loaded a module with unresolved symbols. I have loaded the 
> 'nfit_test' module manually (using 'insmod') without any errors.
> I have repeated those steps below for the latest
> git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git
> kernel from the ' libnvdimm-for-next' branch and the oops occurred again:
>
> [ 1559.560169] BUG: kernel NULL pointer dereference, address: 0000000000000018
> [ 1559.560177] #PF: supervisor read access in kernel mode
> [ 1559.560180] #PF: error_code(0x0000) - not-present page
> [ 1559.560182] PGD 80000003886b7067 P4D 80000003886b7067 PUD 3f53af067 PMD 0
> [ 1559.560190] Oops: 0000 [#1] PREEMPT SMP PTI
> [ 1559.560196] CPU: 0 PID: 79767 Comm: pmempool Tainted: G           O      
> 5.6.0-rc1-13504-g7b27a8622f80 #1
> [ 1559.560199] Hardware name: System manufacturer System Product Name/RAMPAGE 
> IV EXTREME, BIOS 4701 11/18/2013
> [ 1559.560207] RIP: 0010:dev_dax_huge_fault+0x2b3/0x570 [device_dax]
>
> 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?
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to