Greetings,
0day kernel testing robot got the below dmesg and the first bad commit is
https://github.com/weiny2/linux-kernel.git pks-rfc-v3
commit 77da9da46007cbe269f5657508df47f4be7786a4
Author: Ira Weiny <ira.weiny(a)intel.com>
AuthorDate: Tue Mar 31 13:50:26 2020 -0700
Commit: Ira Weiny <ira.weiny(a)intel.com>
CommitDate: Thu Oct 8 15:31:10 2020 -0700
kmap: Add stray access protection for device pages
Device managed pages may have additional protections. These protections
need to be removed prior to valid use by kernel users.
Check for special treatment of device managed pages in kmap and take
action if needed. We use kmap as an interface for generic kernel code
because under normal circumstances it would be a bug for general kernel
code to not use kmap prior to accessing kernel memory. Therefore, this
should allow any valid kernel users to seamlessly use these pages
without issues.
Because of the critical nature of kmap it must be pointed out that the
over head on regular DRAM is carefully implemented to be as fast as
possible. Furthermore the underlying MSR write required on device pages
when protected is better than a normal MSR write.
Specifically, WRMSR(MSR_IA32_PKRS) is not serializing but still
maintains ordering properties similar to WRPKRU. The current SDM
section on PKRS needs updating but should be the same as that of WRPKRU.
So to quote from the WRPKRU text:
WRPKRU will never execute speculatively. Memory accesses
affected by PKRU register will not execute (even speculatively)
until all prior executions of WRPKRU have completed execution
and updated the PKRU register.
Still this will make accessing pmem more expensive from the kernel but
the overhead is minimized and many pmem users access this memory through
user page mappings which are not affected at all.
Signed-off-by: Ira Weiny <ira.weiny(a)intel.com>
aa9b4c8b06 memremap: Add zone device access protection
77da9da460 kmap: Add stray access protection for device pages
5bc8097688 x86/pks: Add a debugfs file for allocated PKS keys
+--------------------------------------+------------+------------+------------+
| | aa9b4c8b06 | 77da9da460 | 5bc8097688 |
+--------------------------------------+------------+------------+------------+
| boot_successes | 18 | 0 | 0 |
| boot_failures | 18 | 11 | 11 |
| BUG:kernel_hang_in_test_stage | 18 | | |
| kernel_BUG_at_arch/x86/mm/physaddr.c | 0 | 11 | 11 |
| invalid_opcode:#[##] | 0 | 11 | 11 |
| EIP:__phys_addr | 0 | 11 | 11 |
| Kernel_panic-not_syncing | 0 | 11 | 11 |
+--------------------------------------+------------+------------+------------+
If you fix the issue, kindly add following tag
Reported-by: kernel test robot <lkp(a)intel.com>
[ 2.075227] pid_max: default: 4096 minimum: 301
[ 2.076342] Mount-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[ 2.077235] Mountpoint-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
Poking KASLR using RDRAND RDTSC...
[ 2.081237] ------------[ cut here ]------------
[ 2.082095] kernel BUG at arch/x86/mm/physaddr.c:80!
[ 2.082233] invalid opcode: 0000 [#1] SMP
[ 2.083026] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.9.0-rc8-00177-g77da9da46007cb
#2
[ 2.083217] EIP: __phys_addr+0x39/0x52
[ 2.083217] Code: e5 56 8d b0 00 00 00 80 53 89 c3 74 0b e8 98 50 0f 00 84 c0 74 02 0f
0b a1 90 4f 60 91 85 c0 74 1c 89 f2 c1 ea 0c 39 d0 73 02 <0f> 0b 89 d8 e8 5b 1a 00
00 85 d2 75 04 39 f0 74 02 0f 0b 89 f0 5b
[ 2.083217] EAX: 00076dfe EBX: fffbb000 ECX: fffff000 EDX: 0007ffbb
[ 2.083217] ESI: 7ffbb000 EDI: fffbc000 EBP: 90b31e54 ESP: 90b31e4c
[ 2.083217] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 EFLAGS: 00210283
[ 2.083217] CR0: 80050033 CR2: ff7ff000 CR3: 10edf000 CR4: 000406b0
[ 2.083217] Call Trace:
[ 2.083217] kmap_to_page+0x86/0xa5
[ 2.083217] kernel_init_free_pages+0x8c/0xb9
[ 2.083217] prep_new_page+0x42/0x66
[ 2.083217] get_page_from_freelist+0x1a1/0x281
[ 2.083217] __alloc_pages_nodemask+0xfa/0x1d2
[ 2.083217] alloc_page_interleave+0xe/0x68
[ 2.083217] alloc_pages_current+0x4c/0x7a
[ 2.083217] pte_alloc_one+0x10/0x44
[ 2.083217] __pte_alloc+0x11/0x66
[ 2.083217] __get_locked_pte+0xad/0xc0
[ 2.083217] ? kaslr_get_random_long+0xd7/0xf5
[ 2.083217] poking_init+0x6a/0x9f
[ 2.083217] ? cgroup1_pidlist_destroy_all+0x79/0x79
[ 2.083217] start_kernel+0x48d/0x4af
[ 2.083217] i386_start_kernel+0x43/0x45
[ 2.083217] startup_32_smp+0x164/0x170
[ 2.083217] Modules linked in:
[ 2.083231] random: get_random_bytes called from init_oops_id+0x23/0x3b with
crng_init=0
[ 2.083235] ---[ end trace 2bd92644a0630502 ]---
[ 2.085227] EIP: __phys_addr+0x39/0x52
# HH:MM RESULT GOOD BAD
GOOD_BUT_DIRTY DIRTY_NOT_BAD
git bisect start 0f144618057a9e2122db689e189a81721b815574
bbf5c979011a099af5dc76498918ed7df445635b --
git bisect good a75e7f0ce05891c0aedb8cdb0499c8f95b8bb67a # 18:20 G 10 0 0 0
Intel Next: Merge commit 33511a8244ab6794bac9d7a2def1908d87fa3306 from
ssh://git-amr-4.devtools.intel.com:29418/otc_linux_spandruv-internal.git intel-sst
git bisect bad f2249a2f4ef1d9472b47e8d1826eb79765fddaec # 18:33 B 0 1 10 0
Intel Next: Merge commit d53977293cc856253917853e9f4b0a2c66a84143 from
ssh://git@gitlab.devtools.intel.com:29418/otc-power-management-enabling-team/otc-power-kernel.git
sle_support
git bisect good b09500e14a3af2b5f3663155c132b9805863bbfa # 19:23 G 11 0 4 4
Intel Next: Merge commit 8614c2a48cdf39480d7d62697f729d4944a7d95c from
ssh://git@gitlab.devtools.intel.com:29418/debox1/linux-kernel-dev.git pmt_for_intel_next
git bisect good b94129f38f5323d6c68c64ea1493d3ef32717535 # 20:19 G 10 0 1 1
Intel Next: Merge commit 57e9a72cc38245ed91911411e7efed2580528705 from
ssh://git-ger-6.devtools.intel.com:29418/uli-linux-kernel.git uipi-intel-next
git bisect bad f347e14d8bb2248e02e052adf0d71e19515c37a2 # 20:36 B 0 9 18 0
Intel Next: Merge commit 5bc8097688dad2eb5174ac85bf2be4e9fa7582d1 from
ssh://git@gitlab.devtools.intel.com:29418/iweiny/linux-kernel.git lm-pks-pmem-for-5.10
git bisect good c8e4e846b91ae8ea1f087124b7e84fc1fd04b344 # 21:18 G 10 0 3 3
Intel Next: Merge commit 6ef07321e7693eaeabe088afcd5d9b511a64e004 from
ssh://git@gitlab.devtools.intel.com:29418/ranerica/linux-dev.git
rneri/hybrid-for-intel-next
git bisect bad 3b880a48dd2fd8b854ee6990b1bb532286f941e3 # 21:26 B 0 1 10 0
fs/fuse: Utilize new kmap_thread()
git bisect good aa9b4c8b0671dbfaee8f21446ec4854ca339e759 # 22:11 G 11 0 4 4
memremap: Add zone device access protection
git bisect bad 4d6f6979258167830c7aecb44faea350c4e56e9e # 22:22 B 0 1 10 0
fs/btrfs: Utilize new kmap_thread()
git bisect bad 364aad0b378dfd08a331aa4820628ff659425593 # 22:33 B 0 10 19 0
drivers/firmware_loader: Utilize new kmap_thread()
git bisect bad 41a635b4f7abaeaba30af75a8622d6f446645fc3 # 22:44 B 0 3 12 0
kmap: Introduce k[un]map_thread
git bisect bad 77da9da46007cbe269f5657508df47f4be7786a4 # 22:55 B 0 1 10 0
kmap: Add stray access protection for device pages
# first bad commit: [77da9da46007cbe269f5657508df47f4be7786a4] kmap: Add stray access
protection for device pages
git bisect good aa9b4c8b0671dbfaee8f21446ec4854ca339e759 # 23:38 G 32 0 14 18
memremap: Add zone device access protection
# extra tests with debug options
git bisect bad 77da9da46007cbe269f5657508df47f4be7786a4 # 23:55 B 0 3 12 0
kmap: Add stray access protection for device pages
# extra tests on head commit of weiny2/pks-rfc-v3
git bisect bad 5bc8097688dad2eb5174ac85bf2be4e9fa7582d1 # 00:29 B 0 3 12 0
x86/pks: Add a debugfs file for allocated PKS keys
# bad: [5bc8097688dad2eb5174ac85bf2be4e9fa7582d1] x86/pks: Add a debugfs file for
allocated PKS keys
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/lkp@lists.01.org