* [5.9.0-rc5-20200914] Kernel crash while running LTP(mlock201)
From: Sachin Sant @ 2020-09-15 6:31 UTC (permalink / raw)
To: linux-next; +Cc: linuxppc-dev, willy
While running LTP tests (specifically mlock201) against next-20200914 tree
on a POWER9 LPAR results in following crash.
BUG: Kernel NULL pointer dereference on read at 0x00000000
Faulting instruction address: 0xc000000000454248
Oops: Kernel access of bad area, sig: 11 [#1]
LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
Modules linked in: af_packet(E) nft_ct(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) libcrc32c(E) ip6_tables(E) nft_compat(E) ip_set(E) rfkill(E) nf_tables(E) nfnetlink(E) vmx_crypto(E) uio_pdrv_genirq(E) gf128mul(E) uio(E) rtc_generic(E) crct10dif_vpmsum(E) sch_fq_codel(E) ip_tables(E) x_tables(E) ext4(E) crc16(E) mbcache(E) jbd2(E) sd_mod(E) t10_pi(E) sg(E) ibmvscsi(E) scsi_transport_srp(E) scsi_mod(E) ibmveth(E) crc32c_vpmsum(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) autofs4(E)
CPU: 11 PID: 26435 Comm: mlock201 Tainted: G E 5.9.0-rc5-next-20200914-281.gf529200-default #1
NIP: c000000000454248 LR: c000000000445a74 CTR: c000000000413150
REGS: c0000008e645b770 TRAP: 0300 Tainted: G E (5.9.0-rc5-next-20200914-281.gf529200-default)
MSR: 8000000000009033 <SF,EE,ME,IR,DR,RI,LE> CR: 28002482 XER: 20040000
CFAR: c00000000000fbb0 DAR: 0000000000000000 DSISR: 40000000 IRQMASK: 0
GPR00: c000000000445a74 c0000008e645ba00 c0000000017c4500 0000000000000000
GPR04: 0000000000000001 c0000008ea109e98 c0000008f0c40000 0000000000000000
GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000003
GPR12: c000000000413150 c00000001ec70200 0000000000000000 c000000001502038
GPR16: 00007fff9c61ffff 00007fff9c61ffff 00007fff9c61ffff c000000000cb02f8
GPR20: 00007fff9c5c0000 00007fff9c620000 c0000008e645bcd8 c0000008f0c40000
GPR24: c00c0000023c0d00 fffffffffffffe7f 0000000000000000 c0000008f0c40000
GPR28: c0000008ea109e98 0000000000000001 c0000008ea9288a8 0000000000000000
NIP [c000000000454248] PageHuge+0x8/0x60
LR [c000000000445a74] find_get_incore_page+0x114/0x160
Call Trace:
[c0000008e645ba00] [c000000000445994] find_get_incore_page+0x34/0x160 (unreliable)
[c0000008e645ba40] [c000000000412e54] mincore_page+0x24/0x160
[c0000008e645ba70] [c000000000413020] __mincore_unmapped_range+0x90/0x160
[c0000008e645bac0] [c000000000413680] mincore_pte_range+0x530/0x5d0
[c0000008e645bb40] [c000000000422a38] walk_pgd_range+0x4e8/0xae0
[c0000008e645bc30] [c0000000004230c4] __walk_page_range+0x94/0x250
[c0000008e645bcb0] [c0000000004233d8] walk_page_range+0x158/0x1e0
[c0000008e645bd40] [c00000000041386c] sys_mincore+0x14c/0x370
[c0000008e645bdc0] [c000000000033eb8] system_call_exception+0xf8/0x200
[c0000008e645be20] [c00000000000d140] system_call_common+0xf0/0x27c
Instruction dump:
e8410018 38210020 e8010010 7c0803a6 4e800020 60000000 3d400001 7d435378
4e800020 60000000 7c0802a6 60000000 <e9230000> 75290001 40820010 e9230008
---[ end trace 357eb14a3b22eab2 ]—
The function find_get_incore_page() was introduced with
3fcbe4eb49a0406e6202e8c8c3560f30965a8e79
mm: factor find_get_incore_page out of mincore_page
Thanks
-Sachin
^ permalink raw reply
* Re: [PATCH kernel] powerpc/dma: Fix dma_map_ops::get_required_mask
From: Christoph Hellwig @ 2020-09-15 6:50 UTC (permalink / raw)
To: Alexey Kardashevskiy
Cc: Oliver OHalloran, linuxppc-dev@lists.ozlabs.org,
Christoph Hellwig, Cédric Le Goater
In-Reply-To: <0a7a992f-ad2e-e76a-7bee-1ed4ed607748@ozlabs.ru>
On Wed, Sep 09, 2020 at 07:36:04PM +1000, Alexey Kardashevskiy wrote:
> I want dma_get_required_mask() to return the bigger mask always.
>
> Now it depends on (in dma_alloc_direct()):
> 1. dev->dma_ops_bypass: set via pci_set_(coherent_)dma_mask();
> 2. dev->coherent_dma_mask - the same;
> 3. dev->bus_dma_limit - usually not set at all.
>
> So until we set the mask, dma_get_required_mask() returns smaller mask.
> So aacraid and likes (which calls dma_get_required_mask() before setting
> it) will remain prone for breaks.
Well, the original intent of dma_get_required_mask is to return the
mask that the driver then uses to figure out what to set, so what aacraid
does fits that use case. Of course that idea is pretty bogus for
PCIe devices.
I suspect the right fix is to just not query dma_get_required_mask for
PCIe devices in aacraid (and other drivers that do something similar).
^ permalink raw reply
* [powerpc:merge] BUILD SUCCESS 27e2fbcd815a088d7d83c7158f76b6e95ab07c50
From: kernel test robot @ 2020-09-15 8:32 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git merge
branch HEAD: 27e2fbcd815a088d7d83c7158f76b6e95ab07c50 Automatic merge of 'master', 'next' and 'fixes' (2020-09-14 23:28)
elapsed time: 1138m
configs tested: 154
configs skipped: 2
The following configs have been built successfully.
More configs may be tested in the coming days.
gcc tested configs:
arm defconfig
arm64 allyesconfig
arm64 defconfig
arm allyesconfig
arm allmodconfig
powerpc ppc40x_defconfig
mips vocore2_defconfig
m68k amcore_defconfig
mips maltaup_xpa_defconfig
mips rbtx49xx_defconfig
powerpc currituck_defconfig
riscv rv32_defconfig
arm clps711x_defconfig
arm iop32x_defconfig
powerpc wii_defconfig
arm lpc32xx_defconfig
powerpc icon_defconfig
powerpc redwood_defconfig
arm s3c6400_defconfig
sh j2_defconfig
powerpc sbc8548_defconfig
powerpc ppc6xx_defconfig
sh rsk7201_defconfig
arm shannon_defconfig
powerpc pcm030_defconfig
parisc generic-64bit_defconfig
sh dreamcast_defconfig
arm mps2_defconfig
arm pxa3xx_defconfig
sh defconfig
m68k m5307c3_defconfig
powerpc mgcoge_defconfig
sparc defconfig
arm nhk8815_defconfig
arm vt8500_v6_v7_defconfig
ia64 defconfig
mips bcm47xx_defconfig
arc nsimosci_defconfig
m68k hp300_defconfig
powerpc obs600_defconfig
riscv alldefconfig
arm multi_v5_defconfig
powerpc tqm8541_defconfig
arm hackkit_defconfig
arm ezx_defconfig
nds32 allnoconfig
m68k mvme16x_defconfig
arm omap1_defconfig
arm multi_v4t_defconfig
powerpc mpc866_ads_defconfig
m68k alldefconfig
mips jazz_defconfig
arm zx_defconfig
mips bmips_stb_defconfig
sh r7780mp_defconfig
arm aspeed_g5_defconfig
sparc sparc64_defconfig
powerpc tqm8560_defconfig
riscv allmodconfig
arm spear3xx_defconfig
powerpc mpc8540_ads_defconfig
powerpc gamecube_defconfig
c6x alldefconfig
arm trizeps4_defconfig
arm multi_v7_defconfig
powerpc mpc885_ads_defconfig
arm milbeaut_m10v_defconfig
microblaze defconfig
ia64 allmodconfig
ia64 allyesconfig
m68k defconfig
m68k allmodconfig
m68k allyesconfig
nios2 defconfig
c6x allyesconfig
arc allyesconfig
nds32 defconfig
csky defconfig
alpha defconfig
alpha allyesconfig
nios2 allyesconfig
xtensa allyesconfig
h8300 allyesconfig
arc defconfig
sh allmodconfig
parisc defconfig
s390 allyesconfig
parisc allyesconfig
s390 defconfig
i386 allyesconfig
sparc allyesconfig
i386 defconfig
mips allyesconfig
mips allmodconfig
powerpc allyesconfig
powerpc allmodconfig
powerpc allnoconfig
x86_64 randconfig-a004-20200914
x86_64 randconfig-a006-20200914
x86_64 randconfig-a003-20200914
x86_64 randconfig-a002-20200914
x86_64 randconfig-a001-20200914
x86_64 randconfig-a005-20200914
i386 randconfig-a004-20200913
i386 randconfig-a006-20200913
i386 randconfig-a003-20200913
i386 randconfig-a001-20200913
i386 randconfig-a002-20200913
i386 randconfig-a005-20200913
i386 randconfig-a004-20200914
i386 randconfig-a006-20200914
i386 randconfig-a001-20200914
i386 randconfig-a003-20200914
i386 randconfig-a002-20200914
i386 randconfig-a005-20200914
x86_64 randconfig-a014-20200913
x86_64 randconfig-a011-20200913
x86_64 randconfig-a012-20200913
x86_64 randconfig-a016-20200913
x86_64 randconfig-a015-20200913
x86_64 randconfig-a013-20200913
i386 randconfig-a015-20200913
i386 randconfig-a014-20200913
i386 randconfig-a011-20200913
i386 randconfig-a013-20200913
i386 randconfig-a016-20200913
i386 randconfig-a012-20200913
i386 randconfig-a015-20200914
i386 randconfig-a014-20200914
i386 randconfig-a011-20200914
i386 randconfig-a013-20200914
i386 randconfig-a016-20200914
i386 randconfig-a012-20200914
riscv allyesconfig
riscv allnoconfig
riscv defconfig
x86_64 rhel
x86_64 allyesconfig
x86_64 rhel-7.6-kselftests
x86_64 defconfig
x86_64 rhel-8.3
x86_64 kexec
clang tested configs:
x86_64 randconfig-a014-20200914
x86_64 randconfig-a011-20200914
x86_64 randconfig-a016-20200914
x86_64 randconfig-a012-20200914
x86_64 randconfig-a015-20200914
x86_64 randconfig-a013-20200914
x86_64 randconfig-a006-20200913
x86_64 randconfig-a004-20200913
x86_64 randconfig-a003-20200913
x86_64 randconfig-a002-20200913
x86_64 randconfig-a005-20200913
x86_64 randconfig-a001-20200913
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* [powerpc:next-test] BUILD SUCCESS d7d40595a2568d199396c863460cecd5ae676c34
From: kernel test robot @ 2020-09-15 8:32 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test
branch HEAD: d7d40595a2568d199396c863460cecd5ae676c34 Merge coregroup support into next
elapsed time: 1137m
configs tested: 175
configs skipped: 2
The following configs have been built successfully.
More configs may be tested in the coming days.
gcc tested configs:
arm defconfig
arm64 allyesconfig
arm64 defconfig
arm allyesconfig
arm allmodconfig
m68k hp300_defconfig
sh sdk7786_defconfig
powerpc g5_defconfig
arm tegra_defconfig
openrisc simple_smp_defconfig
powerpc icon_defconfig
mips cavium_octeon_defconfig
arc axs103_smp_defconfig
m68k m5407c3_defconfig
powerpc ppc6xx_defconfig
arm pxa255-idp_defconfig
arc axs103_defconfig
m68k amcore_defconfig
mips maltaup_xpa_defconfig
mips rbtx49xx_defconfig
powerpc currituck_defconfig
riscv rv32_defconfig
arm clps711x_defconfig
arm iop32x_defconfig
powerpc wii_defconfig
arm lpc32xx_defconfig
sh r7780mp_defconfig
powerpc mvme5100_defconfig
um i386_defconfig
arc hsdk_defconfig
powerpc gamecube_defconfig
powerpc mpc836x_mds_defconfig
powerpc xes_mpc85xx_defconfig
x86_64 defconfig
powerpc eiger_defconfig
mips nlm_xlr_defconfig
arm shannon_defconfig
powerpc pcm030_defconfig
parisc generic-64bit_defconfig
sh dreamcast_defconfig
arm mps2_defconfig
powerpc mpc8540_ads_defconfig
mips pnx8335_stb225_defconfig
powerpc linkstation_defconfig
powerpc storcenter_defconfig
alpha defconfig
m68k sun3_defconfig
arm vt8500_v6_v7_defconfig
powerpc mgcoge_defconfig
ia64 defconfig
mips bcm47xx_defconfig
arc nsimosci_defconfig
arm efm32_defconfig
sh polaris_defconfig
arm stm32_defconfig
arm spear13xx_defconfig
powerpc mpc8315_rdb_defconfig
powerpc obs600_defconfig
riscv alldefconfig
arm multi_v5_defconfig
powerpc tqm8541_defconfig
arm hackkit_defconfig
nds32 allnoconfig
arm ezx_defconfig
m68k mvme16x_defconfig
arm omap1_defconfig
arm multi_v4t_defconfig
powerpc mpc866_ads_defconfig
m68k alldefconfig
mips jazz_defconfig
arm zx_defconfig
mips bmips_stb_defconfig
arm aspeed_g5_defconfig
sparc sparc64_defconfig
powerpc tqm8560_defconfig
riscv allmodconfig
arm spear3xx_defconfig
m68k m5307c3_defconfig
c6x alldefconfig
arm trizeps4_defconfig
arm multi_v7_defconfig
powerpc tqm8xx_defconfig
sh defconfig
m68k sun3x_defconfig
powerpc ppc64_defconfig
powerpc stx_gp3_defconfig
arm gemini_defconfig
mips maltasmvp_eva_defconfig
xtensa iss_defconfig
xtensa alldefconfig
ia64 allyesconfig
ia64 allmodconfig
m68k defconfig
m68k allmodconfig
m68k allyesconfig
nios2 defconfig
c6x allyesconfig
arc allyesconfig
nds32 defconfig
csky defconfig
alpha allyesconfig
nios2 allyesconfig
xtensa allyesconfig
h8300 allyesconfig
arc defconfig
sh allmodconfig
parisc defconfig
s390 allyesconfig
parisc allyesconfig
s390 defconfig
i386 allyesconfig
sparc allyesconfig
sparc defconfig
i386 defconfig
mips allyesconfig
mips allmodconfig
powerpc allyesconfig
powerpc allmodconfig
powerpc allnoconfig
x86_64 randconfig-a004-20200914
x86_64 randconfig-a006-20200914
x86_64 randconfig-a003-20200914
x86_64 randconfig-a002-20200914
x86_64 randconfig-a001-20200914
x86_64 randconfig-a005-20200914
i386 randconfig-a004-20200913
i386 randconfig-a006-20200913
i386 randconfig-a003-20200913
i386 randconfig-a001-20200913
i386 randconfig-a002-20200913
i386 randconfig-a005-20200913
i386 randconfig-a004-20200914
i386 randconfig-a006-20200914
i386 randconfig-a001-20200914
i386 randconfig-a003-20200914
i386 randconfig-a002-20200914
i386 randconfig-a005-20200914
x86_64 randconfig-a016-20200913
x86_64 randconfig-a014-20200913
x86_64 randconfig-a011-20200913
x86_64 randconfig-a012-20200913
x86_64 randconfig-a015-20200913
x86_64 randconfig-a013-20200913
i386 randconfig-a015-20200913
i386 randconfig-a014-20200913
i386 randconfig-a011-20200913
i386 randconfig-a013-20200913
i386 randconfig-a016-20200913
i386 randconfig-a012-20200913
i386 randconfig-a015-20200914
i386 randconfig-a014-20200914
i386 randconfig-a011-20200914
i386 randconfig-a013-20200914
i386 randconfig-a016-20200914
i386 randconfig-a012-20200914
riscv allyesconfig
riscv allnoconfig
riscv defconfig
x86_64 rhel
x86_64 allyesconfig
x86_64 rhel-7.6-kselftests
x86_64 rhel-8.3
x86_64 kexec
clang tested configs:
x86_64 randconfig-a014-20200914
x86_64 randconfig-a011-20200914
x86_64 randconfig-a016-20200914
x86_64 randconfig-a012-20200914
x86_64 randconfig-a015-20200914
x86_64 randconfig-a013-20200914
x86_64 randconfig-a006-20200913
x86_64 randconfig-a004-20200913
x86_64 randconfig-a003-20200913
x86_64 randconfig-a002-20200913
x86_64 randconfig-a005-20200913
x86_64 randconfig-a001-20200913
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply
* Injecting SLB miltihit crashes kernel 5.9.0-rc5
From: Michal Suchánek @ 2020-09-15 8:43 UTC (permalink / raw)
To: linuxppc-dev
Hello,
Using the SLB mutihit injection test module (which I did not write so I
do not want to post it here) to verify updates on my 5.3 frankernekernel
I found that the kernel crashes with Oops: kernel bad access.
I tested on latest upstream kernel build that I have at hand and the
result is te same (minus the message - nothing was logged and the kernel
simply rebooted).
Since the whole effort to write a real mode MCE handler was supposed to
prevent this maybe the SLB injection module should be added to the
kernel selftests?
Thanks
Michal
^ permalink raw reply
* Re: [PATCH 00/15] selftests/seccomp: Refactor change_syscall()
From: Max Filippov @ 2020-09-15 8:45 UTC (permalink / raw)
To: Kees Cook
Cc: Thadeu Lima de Souza Cascardo, Will Drewry,
open list:TENSILICA XTENSA PORT (xtensa), LKML, Andy Lutomirski,
linux-arm-kernel, linux-kselftest, linux-mips, linuxppc-dev,
Christian Brauner
In-Reply-To: <20200912110820.597135-1-keescook@chromium.org>
Hello,
On Sat, Sep 12, 2020 at 4:08 AM Kees Cook <keescook@chromium.org> wrote:
> This refactors the seccomp selftest macros used in change_syscall(),
> in an effort to remove special cases for mips, arm, arm64, and xtensa,
> which paves the way for powerpc fixes.
>
> I'm not entirely done testing, but all-arch build tests and x86_64
> selftests pass. I'll be doing arm, arm64, and i386 selftests shortly,
> but I currently don't have an easy way to check xtensa, mips, nor
> powerpc. Any help there would be appreciated!
I've built and tested this series on xtensa. I had to disable two tests:
user_notification_addfd and user_notification_addfd_rlimit because
they use memfd_create and prlimit which are not available in uClibc.
With this change I've got all 86 tests passing with the following log:
./seccomp_bpf
TAP version 13
1..86
# Starting 86 tests from 7 test cases.
# RUN TRAP.dfl ...
# OK TRAP.dfl
ok 1 TRAP.dfl
# RUN TRAP.ign ...
# OK TRAP.ign
ok 2 TRAP.ign
# RUN TRAP.handler ...
# OK TRAP.handler
ok 3 TRAP.handler
# RUN precedence.allow_ok ...
# OK precedence.allow_ok
ok 4 precedence.allow_ok
# RUN precedence.kill_is_highest ...
# OK precedence.kill_is_highest
ok 5 precedence.kill_is_highest
# RUN precedence.kill_is_highest_in_any_order ...
# OK precedence.kill_is_highest_in_any_order
ok 6 precedence.kill_is_highest_in_any_order
# RUN precedence.trap_is_second ...
# OK precedence.trap_is_second
ok 7 precedence.trap_is_second
# RUN precedence.trap_is_second_in_any_order ...
# OK precedence.trap_is_second_in_any_order
ok 8 precedence.trap_is_second_in_any_order
# RUN precedence.errno_is_third ...
# OK precedence.errno_is_third
ok 9 precedence.errno_is_third
# RUN precedence.errno_is_third_in_any_order ...
# OK precedence.errno_is_third_in_any_order
ok 10 precedence.errno_is_third_in_any_order
# RUN precedence.trace_is_fourth ...
# OK precedence.trace_is_fourth
ok 11 precedence.trace_is_fourth
# RUN precedence.trace_is_fourth_in_any_order ...
# OK precedence.trace_is_fourth_in_any_order
ok 12 precedence.trace_is_fourth_in_any_order
# RUN precedence.log_is_fifth ...
# OK precedence.log_is_fifth
ok 13 precedence.log_is_fifth
# RUN precedence.log_is_fifth_in_any_order ...
# OK precedence.log_is_fifth_in_any_order
ok 14 precedence.log_is_fifth_in_any_order
# RUN TRACE_poke.read_has_side_effects ...
# OK TRACE_poke.read_has_side_effects
ok 15 TRACE_poke.read_has_side_effects
# RUN TRACE_poke.getpid_runs_normally ...
# OK TRACE_poke.getpid_runs_normally
ok 16 TRACE_poke.getpid_runs_normally
# RUN TRACE_syscall.ptrace.negative_ENOSYS ...
# OK TRACE_syscall.ptrace.negative_ENOSYS
ok 17 TRACE_syscall.ptrace.negative_ENOSYS
# RUN TRACE_syscall.ptrace.syscall_allowed ...
# OK TRACE_syscall.ptrace.syscall_allowed
ok 18 TRACE_syscall.ptrace.syscall_allowed
# RUN TRACE_syscall.ptrace.syscall_redirected ...
# OK TRACE_syscall.ptrace.syscall_redirected
ok 19 TRACE_syscall.ptrace.syscall_redirected
# RUN TRACE_syscall.ptrace.syscall_errno ...
# OK TRACE_syscall.ptrace.syscall_errno
ok 20 TRACE_syscall.ptrace.syscall_errno
# RUN TRACE_syscall.ptrace.syscall_faked ...
# OK TRACE_syscall.ptrace.syscall_faked
ok 21 TRACE_syscall.ptrace.syscall_faked
# RUN TRACE_syscall.ptrace.skip_after ...
# OK TRACE_syscall.ptrace.skip_after
ok 22 TRACE_syscall.ptrace.skip_after
# RUN TRACE_syscall.ptrace.kill_after ...
# OK TRACE_syscall.ptrace.kill_after
ok 23 TRACE_syscall.ptrace.kill_after
# RUN TRACE_syscall.seccomp.negative_ENOSYS ...
# OK TRACE_syscall.seccomp.negative_ENOSYS
ok 24 TRACE_syscall.seccomp.negative_ENOSYS
# RUN TRACE_syscall.seccomp.syscall_allowed ...
# OK TRACE_syscall.seccomp.syscall_allowed
ok 25 TRACE_syscall.seccomp.syscall_allowed
# RUN TRACE_syscall.seccomp.syscall_redirected ...
# OK TRACE_syscall.seccomp.syscall_redirected
ok 26 TRACE_syscall.seccomp.syscall_redirected
# RUN TRACE_syscall.seccomp.syscall_errno ...
# OK TRACE_syscall.seccomp.syscall_errno
ok 27 TRACE_syscall.seccomp.syscall_errno
# RUN TRACE_syscall.seccomp.syscall_faked ...
# OK TRACE_syscall.seccomp.syscall_faked
ok 28 TRACE_syscall.seccomp.syscall_faked
# RUN TRACE_syscall.seccomp.skip_after ...
# OK TRACE_syscall.seccomp.skip_after
ok 29 TRACE_syscall.seccomp.skip_after
# RUN TRACE_syscall.seccomp.kill_after ...
# OK TRACE_syscall.seccomp.kill_after
ok 30 TRACE_syscall.seccomp.kill_after
# RUN TSYNC.siblings_fail_prctl ...
# OK TSYNC.siblings_fail_prctl
ok 31 TSYNC.siblings_fail_prctl
# RUN TSYNC.two_siblings_with_ancestor ...
# OK TSYNC.two_siblings_with_ancestor
ok 32 TSYNC.two_siblings_with_ancestor
# RUN TSYNC.two_sibling_want_nnp ...
# OK TSYNC.two_sibling_want_nnp
ok 33 TSYNC.two_sibling_want_nnp
# RUN TSYNC.two_siblings_with_no_filter ...
# OK TSYNC.two_siblings_with_no_filter
ok 34 TSYNC.two_siblings_with_no_filter
# RUN TSYNC.two_siblings_with_one_divergence ...
# OK TSYNC.two_siblings_with_one_divergence
ok 35 TSYNC.two_siblings_with_one_divergence
# RUN TSYNC.two_siblings_with_one_divergence_no_tid_in_err ...
# OK TSYNC.two_siblings_with_one_divergence_no_tid_in_err
ok 36 TSYNC.two_siblings_with_one_divergence_no_tid_in_err
# RUN TSYNC.two_siblings_not_under_filter ...
# OK TSYNC.two_siblings_not_under_filter
ok 37 TSYNC.two_siblings_not_under_filter
# RUN global.kcmp ...
# OK global.kcmp
ok 38 global.kcmp
# RUN global.mode_strict_support ...
# OK global.mode_strict_support
ok 39 global.mode_strict_support
# RUN global.mode_strict_cannot_call_prctl ...
# OK global.mode_strict_cannot_call_prctl
ok 40 global.mode_strict_cannot_call_prctl
# RUN global.no_new_privs_support ...
# OK global.no_new_privs_support
ok 41 global.no_new_privs_support
# RUN global.mode_filter_support ...
# OK global.mode_filter_support
ok 42 global.mode_filter_support
# RUN global.mode_filter_without_nnp ...
# OK global.mode_filter_without_nnp
ok 43 global.mode_filter_without_nnp
# RUN global.filter_size_limits ...
# OK global.filter_size_limits
ok 44 global.filter_size_limits
# RUN global.filter_chain_limits ...
# OK global.filter_chain_limits
ok 45 global.filter_chain_limits
# RUN global.mode_filter_cannot_move_to_strict ...
# OK global.mode_filter_cannot_move_to_strict
ok 46 global.mode_filter_cannot_move_to_strict
# RUN global.mode_filter_get_seccomp ...
# OK global.mode_filter_get_seccomp
ok 47 global.mode_filter_get_seccomp
# RUN global.ALLOW_all ...
# OK global.ALLOW_all
ok 48 global.ALLOW_all
# RUN global.empty_prog ...
# OK global.empty_prog
ok 49 global.empty_prog
# RUN global.log_all ...
# OK global.log_all
ok 50 global.log_all
# RUN global.unknown_ret_is_kill_inside ...
# OK global.unknown_ret_is_kill_inside
ok 51 global.unknown_ret_is_kill_inside
# RUN global.unknown_ret_is_kill_above_allow ...
# OK global.unknown_ret_is_kill_above_allow
ok 52 global.unknown_ret_is_kill_above_allow
# RUN global.KILL_all ...
# OK global.KILL_all
ok 53 global.KILL_all
# RUN global.KILL_one ...
# OK global.KILL_one
ok 54 global.KILL_one
# RUN global.KILL_one_arg_one ...
# OK global.KILL_one_arg_one
ok 55 global.KILL_one_arg_one
# RUN global.KILL_one_arg_six ...
# OK global.KILL_one_arg_six
ok 56 global.KILL_one_arg_six
# RUN global.KILL_thread ...
# OK global.KILL_thread
ok 57 global.KILL_thread
# RUN global.KILL_process ...
# OK global.KILL_process
ok 58 global.KILL_process
# RUN global.arg_out_of_range ...
# OK global.arg_out_of_range
ok 59 global.arg_out_of_range
# RUN global.ERRNO_valid ...
# OK global.ERRNO_valid
ok 60 global.ERRNO_valid
# RUN global.ERRNO_zero ...
# OK global.ERRNO_zero
ok 61 global.ERRNO_zero
# RUN global.ERRNO_capped ...
# OK global.ERRNO_capped
ok 62 global.ERRNO_capped
# RUN global.ERRNO_order ...
# OK global.ERRNO_order
ok 63 global.ERRNO_order
# RUN global.negative_ENOSYS ...
# OK global.negative_ENOSYS
ok 64 global.negative_ENOSYS
# RUN global.seccomp_syscall ...
# OK global.seccomp_syscall
ok 65 global.seccomp_syscall
# RUN global.seccomp_syscall_mode_lock ...
# OK global.seccomp_syscall_mode_lock
ok 66 global.seccomp_syscall_mode_lock
# RUN global.detect_seccomp_filter_flags ...
# OK global.detect_seccomp_filter_flags
ok 67 global.detect_seccomp_filter_flags
# RUN global.TSYNC_first ...
# OK global.TSYNC_first
ok 68 global.TSYNC_first
# RUN global.syscall_restart ...
# OK global.syscall_restart
ok 69 global.syscall_restart
# RUN global.filter_flag_log ...
# OK global.filter_flag_log
ok 70 global.filter_flag_log
# RUN global.get_action_avail ...
# OK global.get_action_avail
ok 71 global.get_action_avail
# RUN global.get_metadata ...
# OK global.get_metadata
ok 72 global.get_metadata
# RUN global.user_notification_basic ...
# OK global.user_notification_basic
ok 73 global.user_notification_basic
# RUN global.user_notification_with_tsync ...
# OK global.user_notification_with_tsync
ok 74 global.user_notification_with_tsync
# RUN global.user_notification_kill_in_middle ...
# OK global.user_notification_kill_in_middle
ok 75 global.user_notification_kill_in_middle
# RUN global.user_notification_signal ...
# OK global.user_notification_signal
ok 76 global.user_notification_signal
# RUN global.user_notification_closed_listener ...
# OK global.user_notification_closed_listener
ok 77 global.user_notification_closed_listener
# RUN global.user_notification_child_pid_ns ...
# OK global.user_notification_child_pid_ns
ok 78 global.user_notification_child_pid_ns
# RUN global.user_notification_sibling_pid_ns ...
# OK global.user_notification_sibling_pid_ns
ok 79 global.user_notification_sibling_pid_ns
# RUN global.user_notification_fault_recv ...
# OK global.user_notification_fault_recv
ok 80 global.user_notification_fault_recv
# RUN global.seccomp_get_notif_sizes ...
# OK global.seccomp_get_notif_sizes
ok 81 global.seccomp_get_notif_sizes
# RUN global.user_notification_continue ...
# OK global.user_notification_continue
ok 82 global.user_notification_continue
# RUN global.user_notification_filter_empty ...
# OK global.user_notification_filter_empty
ok 83 global.user_notification_filter_empty
# RUN global.user_notification_filter_empty_threaded ...
# OK global.user_notification_filter_empty_threaded
ok 84 global.user_notification_filter_empty_threaded
# RUN global.user_notification_addfd ...
# OK global.user_notification_addfd
ok 85 global.user_notification_addfd
# RUN global.user_notification_addfd_rlimit ...
# OK global.user_notification_addfd_rlimit
ok 86 global.user_notification_addfd_rlimit
# PASSED: 86 / 86 tests passed.
# Totals: pass:86 fail:0 xfail:0 xpass:0 skip:0 error:0
--
Thanks.
-- Max
^ permalink raw reply
* Re: [Intel-gfx] [trivial PATCH] treewide: Convert switch/case fallthrough; to break;
From: Jani Nikula @ 2020-09-15 9:06 UTC (permalink / raw)
To: Joe Perches, LKML, Jiri Kosina
Cc: linux-fbdev, oss-drivers, nouveau, alsa-devel, dri-devel,
linux-mips, linux-ide, dm-devel, linux-mtd, linux-i2c, sparclinux,
linux-afs, linux-rtc, linux-s390, linux-scsi, dccp, linux-rdma,
linux-atm-general, kvmarm, coreteam, intel-wired-lan,
linux-serial, linux-input, linux-mmc, Kees Cook, linux-media,
linux-pm, intel-gfx, linux-mediatek, linux-nvme, storagedev,
ceph-devel, linux-arm-kernel, Nick Desaulniers, linux-nfs,
linux-parisc, netdev, linux-usb, linux-wireless, linux-sctp,
iommu, netfilter-devel, linux-crypto, bpf, linuxppc-dev
In-Reply-To: <e6387578c75736d61b2fe70d9783d91329a97eb4.camel@perches.com>
On Wed, 09 Sep 2020, Joe Perches <joe@perches.com> wrote:
> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> index 5ac0dbf0e03d..35ac539cc2b1 100644
> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> @@ -2861,7 +2861,7 @@ static bool gen12_plane_format_mod_supported(struct drm_plane *_plane,
> case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
> if (!gen12_plane_supports_mc_ccs(dev_priv, plane->id))
> return false;
> - fallthrough;
> + break;
> case DRM_FORMAT_MOD_LINEAR:
> case I915_FORMAT_MOD_X_TILED:
> case I915_FORMAT_MOD_Y_TILED:
Acked-by: Jani Nikula <jani.nikula@intel.com>
for merging via whichever tree seems best.
BR,
Jani.
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply
* Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;
From: Miquel Raynal @ 2020-09-15 9:19 UTC (permalink / raw)
To: Joe Perches
Cc: linux-fbdev, oss-drivers, nouveau, alsa-devel, dri-devel,
linux-mips, linux-ide, dm-devel, linux-mtd, linux-i2c, sparclinux,
linux-afs, linux-rtc, linux-s390, linux-scsi, dccp, linux-rdma,
linux-atm-general, iommu, kvmarm, coreteam, intel-wired-lan,
linux-serial, linux-input, linux-mmc, Kees Cook, linux-media,
linux-pm, intel-gfx, linux-mediatek, linux-nvme, storagedev,
ceph-devel, linux-arm-kernel, Nick Desaulniers, linux-nfs,
Jiri Kosina, linux-parisc, netdev, linux-usb, linux-wireless,
LKML, linux-sctp, netfilter-devel, linux-crypto, bpf,
linuxppc-dev
In-Reply-To: <e6387578c75736d61b2fe70d9783d91329a97eb4.camel@perches.com>
Hi Joe,
For MTD:
> drivers/mtd/nand/raw/nandsim.c | 2 +-
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
^ permalink raw reply
* Re: [PATCH 00/15] selftests/seccomp: Refactor change_syscall()
From: Max Filippov @ 2020-09-15 11:12 UTC (permalink / raw)
To: Kees Cook
Cc: Thadeu Lima de Souza Cascardo, Will Drewry,
open list:TENSILICA XTENSA PORT (xtensa), LKML, Andy Lutomirski,
linux-arm-kernel, linux-kselftest, linux-mips, linuxppc-dev,
Christian Brauner
In-Reply-To: <202009141321.366935EF52@keescook>
On Mon, Sep 14, 2020 at 1:32 PM Kees Cook <keescook@chromium.org> wrote:
> On Mon, Sep 14, 2020 at 10:15:18PM +1000, Michael Ellerman wrote:
> > Kees Cook <keescook@chromium.org> writes:
> However...
>
> >
> > cheers
> >
> >
> > ./seccomp_bpf
> > TAP version 13
> > 1..86
> > # Starting 86 tests from 7 test cases.
> > # RUN global.kcmp ...
> > # OK global.kcmp
> > ok 1 global.kcmp
> > [...]
> > # RUN global.KILL_thread ...
> > TAP version 13
> > 1..86
> > # Starting 86 tests from 7 test cases.
>
> Was this a mis-paste, or has something very very bad happened here in
> global.KILL_one_arg_six finishes?
I observe similar output corruption on xtensa when I redirect test output
into a file or pipe it to 'cat'. When it goes to the terminal it looks normal.
--
Thanks.
-- Max
^ permalink raw reply
* [PATCH v1] soc: fsl: rcpm: Add ACPI support
From: kuldip dwivedi @ 2020-09-15 11:06 UTC (permalink / raw)
To: Li Yang, linuxppc-dev, linux-arm-kernel, linux-kernel
Cc: Biwen Li, Samer El-Haj-Mahmoud, Ran Wang, Paul Yang,
kuldip dwivedi, Varun Sethi, Ard Biesheuvel, tanveer, Arokia Samy
Add ACPI support in fsl RCPM driver. This is required
to support ACPI S3 state. S3 is the ACPI sleep state
that is known as "sleep" or "suspend to RAM".
It essentially turns off most power of the system but
keeps memory powered.
Signed-off-by: tanveer <tanveer.alam@puresoftware.com>
Signed-off-by: kuldip dwivedi <kuldip.dwivedi@puresoftware.com>
---
Notes:
1. Add ACPI match table
2. NXP team members are added for confirming HID changes
3. There is only one node in ACPI so no need to check for
current device explicitly
4. These changes are tested on LX2160A and LS1046A platforms
drivers/soc/fsl/rcpm.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c
index a093dbe6d2cb..e75a436fb159 100644
--- a/drivers/soc/fsl/rcpm.c
+++ b/drivers/soc/fsl/rcpm.c
@@ -2,10 +2,12 @@
//
// rcpm.c - Freescale QorIQ RCPM driver
//
-// Copyright 2019 NXP
+// Copyright 2019-2020 NXP
+// Copyright 2020 Puresoftware Ltd.
//
// Author: Ran Wang <ran.wang_1@nxp.com>
+#include <linux/acpi.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
@@ -57,8 +59,13 @@ static int rcpm_pm_prepare(struct device *dev)
rcpm->wakeup_cells + 1);
/* Wakeup source should refer to current rcpm device */
- if (ret || (np->phandle != value[0]))
- continue;
+ if (is_acpi_node(dev->fwnode)) {
+ if (ret)
+ continue;
+ } else {
+ if (ret || (np->phandle != value[0]))
+ continue;
+ }
/* Property "#fsl,rcpm-wakeup-cells" of rcpm node defines the
* number of IPPDEXPCR register cells, and "fsl,rcpm-wakeup"
@@ -139,10 +146,19 @@ static const struct of_device_id rcpm_of_match[] = {
};
MODULE_DEVICE_TABLE(of, rcpm_of_match);
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id rcpm_acpi_match[] = {
+ { "NXP0015", },
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, rcpm_acpi_match);
+#endif
+
static struct platform_driver rcpm_driver = {
.driver = {
.name = "rcpm",
.of_match_table = rcpm_of_match,
+ .acpi_match_table = ACPI_PTR(rcpm_acpi_match),
.pm = &rcpm_pm_ops,
},
.probe = rcpm_probe,
--
2.17.1
^ permalink raw reply related
* Re: [PATCH v1] soc: fsl: rcpm: Add ACPI support
From: Ard Biesheuvel @ 2020-09-15 11:10 UTC (permalink / raw)
To: kuldip dwivedi, Li Yang, linuxppc-dev, linux-arm-kernel,
linux-kernel
Cc: Biwen Li, Samer El-Haj-Mahmoud, Ran Wang, Paul Yang, Varun Sethi,
tanveer, Arokia Samy
In-Reply-To: <20200915110647.846-1-kuldip.dwivedi@puresoftware.com>
On 9/15/20 1:06 PM, kuldip dwivedi wrote:
> Add ACPI support in fsl RCPM driver. This is required
> to support ACPI S3 state. S3 is the ACPI sleep state
> that is known as "sleep" or "suspend to RAM".
> It essentially turns off most power of the system but
> keeps memory powered.
>
> Signed-off-by: tanveer <tanveer.alam@puresoftware.com>
> Signed-off-by: kuldip dwivedi <kuldip.dwivedi@puresoftware.com>
Why does the OS need to program this device? Can't this be done by firmware?
> ---
>
> Notes:
> 1. Add ACPI match table
> 2. NXP team members are added for confirming HID changes
> 3. There is only one node in ACPI so no need to check for
> current device explicitly
> 4. These changes are tested on LX2160A and LS1046A platforms
>
> drivers/soc/fsl/rcpm.c | 22 +++++++++++++++++++---
> 1 file changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c
> index a093dbe6d2cb..e75a436fb159 100644
> --- a/drivers/soc/fsl/rcpm.c
> +++ b/drivers/soc/fsl/rcpm.c
> @@ -2,10 +2,12 @@
> //
> // rcpm.c - Freescale QorIQ RCPM driver
> //
> -// Copyright 2019 NXP
> +// Copyright 2019-2020 NXP
> +// Copyright 2020 Puresoftware Ltd.
> //
> // Author: Ran Wang <ran.wang_1@nxp.com>
>
> +#include <linux/acpi.h>
> #include <linux/init.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> @@ -57,8 +59,13 @@ static int rcpm_pm_prepare(struct device *dev)
> rcpm->wakeup_cells + 1);
>
> /* Wakeup source should refer to current rcpm device */
> - if (ret || (np->phandle != value[0]))
> - continue;
> + if (is_acpi_node(dev->fwnode)) {
> + if (ret)
> + continue;
> + } else {
> + if (ret || (np->phandle != value[0]))
> + continue;
> + }
>
> /* Property "#fsl,rcpm-wakeup-cells" of rcpm node defines the
> * number of IPPDEXPCR register cells, and "fsl,rcpm-wakeup"
> @@ -139,10 +146,19 @@ static const struct of_device_id rcpm_of_match[] = {
> };
> MODULE_DEVICE_TABLE(of, rcpm_of_match);
>
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id rcpm_acpi_match[] = {
> + { "NXP0015", },
> + { }
> +};
> +MODULE_DEVICE_TABLE(acpi, rcpm_acpi_match);
> +#endif
> +
> static struct platform_driver rcpm_driver = {
> .driver = {
> .name = "rcpm",
> .of_match_table = rcpm_of_match,
> + .acpi_match_table = ACPI_PTR(rcpm_acpi_match),
> .pm = &rcpm_pm_ops,
> },
> .probe = rcpm_probe,
>
^ permalink raw reply
* Re: [5.9.0-rc5-20200914] Kernel crash while running LTP(mlock201)
From: Michael Ellerman @ 2020-09-15 11:24 UTC (permalink / raw)
To: Sachin Sant, linux-next; +Cc: linuxppc-dev, willy
In-Reply-To: <3DCED508-4DC0-42AA-9CFF-3AB260ED1E9A@linux.vnet.ibm.com>
Sachin Sant <sachinp@linux.vnet.ibm.com> writes:
> While running LTP tests (specifically mlock201) against next-20200914 tree
> on a POWER9 LPAR results in following crash.
Looks the same as:
https://lore.kernel.org/linux-mm/20200914085545.GB28738@shao2-debian/
cheers
> BUG: Kernel NULL pointer dereference on read at 0x00000000
> Faulting instruction address: 0xc000000000454248
> Oops: Kernel access of bad area, sig: 11 [#1]
> LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
> Modules linked in: af_packet(E) nft_ct(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) libcrc32c(E) ip6_tables(E) nft_compat(E) ip_set(E) rfkill(E) nf_tables(E) nfnetlink(E) vmx_crypto(E) uio_pdrv_genirq(E) gf128mul(E) uio(E) rtc_generic(E) crct10dif_vpmsum(E) sch_fq_codel(E) ip_tables(E) x_tables(E) ext4(E) crc16(E) mbcache(E) jbd2(E) sd_mod(E) t10_pi(E) sg(E) ibmvscsi(E) scsi_transport_srp(E) scsi_mod(E) ibmveth(E) crc32c_vpmsum(E) dm_mirror(E) dm_region_hash(E) dm_log(E) dm_mod(E) autofs4(E)
> CPU: 11 PID: 26435 Comm: mlock201 Tainted: G E 5.9.0-rc5-next-20200914-281.gf529200-default #1
> NIP: c000000000454248 LR: c000000000445a74 CTR: c000000000413150
> REGS: c0000008e645b770 TRAP: 0300 Tainted: G E (5.9.0-rc5-next-20200914-281.gf529200-default)
> MSR: 8000000000009033 <SF,EE,ME,IR,DR,RI,LE> CR: 28002482 XER: 20040000
> CFAR: c00000000000fbb0 DAR: 0000000000000000 DSISR: 40000000 IRQMASK: 0
> GPR00: c000000000445a74 c0000008e645ba00 c0000000017c4500 0000000000000000
> GPR04: 0000000000000001 c0000008ea109e98 c0000008f0c40000 0000000000000000
> GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000003
> GPR12: c000000000413150 c00000001ec70200 0000000000000000 c000000001502038
> GPR16: 00007fff9c61ffff 00007fff9c61ffff 00007fff9c61ffff c000000000cb02f8
> GPR20: 00007fff9c5c0000 00007fff9c620000 c0000008e645bcd8 c0000008f0c40000
> GPR24: c00c0000023c0d00 fffffffffffffe7f 0000000000000000 c0000008f0c40000
> GPR28: c0000008ea109e98 0000000000000001 c0000008ea9288a8 0000000000000000
> NIP [c000000000454248] PageHuge+0x8/0x60
> LR [c000000000445a74] find_get_incore_page+0x114/0x160
> Call Trace:
> [c0000008e645ba00] [c000000000445994] find_get_incore_page+0x34/0x160 (unreliable)
> [c0000008e645ba40] [c000000000412e54] mincore_page+0x24/0x160
> [c0000008e645ba70] [c000000000413020] __mincore_unmapped_range+0x90/0x160
> [c0000008e645bac0] [c000000000413680] mincore_pte_range+0x530/0x5d0
> [c0000008e645bb40] [c000000000422a38] walk_pgd_range+0x4e8/0xae0
> [c0000008e645bc30] [c0000000004230c4] __walk_page_range+0x94/0x250
> [c0000008e645bcb0] [c0000000004233d8] walk_page_range+0x158/0x1e0
> [c0000008e645bd40] [c00000000041386c] sys_mincore+0x14c/0x370
> [c0000008e645bdc0] [c000000000033eb8] system_call_exception+0xf8/0x200
> [c0000008e645be20] [c00000000000d140] system_call_common+0xf0/0x27c
> Instruction dump:
> e8410018 38210020 e8010010 7c0803a6 4e800020 60000000 3d400001 7d435378
> 4e800020 60000000 7c0802a6 60000000 <e9230000> 75290001 40820010 e9230008
> ---[ end trace 357eb14a3b22eab2 ]—
>
>
> The function find_get_incore_page() was introduced with
> 3fcbe4eb49a0406e6202e8c8c3560f30965a8e79
>
> mm: factor find_get_incore_page out of mincore_page
>
>
> Thanks
> -Sachin
^ permalink raw reply
* Re: [PATCH v2 1/4] mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
From: Michael Ellerman @ 2020-09-15 11:26 UTC (permalink / raw)
To: Nicholas Piggin, peterz
Cc: Jens Axboe, linux-arch, Dave Hansen, Aneesh Kumar K . V,
linux-kernel, Andy Lutomirski, linux-mm @ kvack . org, sparclinux,
Andrew Morton, linuxppc-dev, David S . Miller
In-Reply-To: <1600137586.nypnz3sbcl.astroid@bobo.none>
Nicholas Piggin <npiggin@gmail.com> writes:
> Excerpts from peterz@infradead.org's message of September 14, 2020 8:56 pm:
>> On Mon, Sep 14, 2020 at 02:52:16PM +1000, Nicholas Piggin wrote:
>>> Reading and modifying current->mm and current->active_mm and switching
>>> mm should be done with irqs off, to prevent races seeing an intermediate
>>> state.
...
>>>
>>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>>
>> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>>
>> I'm thinking we want this selected on x86 as well. Andy?
>
> Thanks for the ack. The plan was to take it through the powerpc tree,
> but if you'd want x86 to select it, maybe a topic branch? Although
> Michael will be away during the next merge window so I don't want to
> get too fancy. Would you mind doing it in a follow up merge after
> powerpc, being that it's (I think) a small change?
Or get akpm to take the series, including the x86 change.
cheers
^ permalink raw reply
* Re: [PATCH v2] powerpc/papr_scm: Fix warning triggered by perf_stats_show()
From: Michael Ellerman @ 2020-09-15 11:30 UTC (permalink / raw)
To: Vaibhav Jain, linuxppc-dev, linux-nvdimm
Cc: Santosh Sivaraj, Aneesh Kumar K . V, Oliver O'Halloran,
Vaibhav Jain, Dan Williams, Ira Weiny
In-Reply-To: <20200912081451.66225-1-vaibhav@linux.ibm.com>
Vaibhav Jain <vaibhav@linux.ibm.com> writes:
> A warning is reported by the kernel in case perf_stats_show() returns
> an error code. The warning is of the form below:
>
> papr_scm ibm,persistent-memory:ibm,pmemory@44100001:
> Failed to query performance stats, Err:-10
> dev_attr_show: perf_stats_show+0x0/0x1c0 [papr_scm] returned bad count
> fill_read_buffer: dev_attr_show+0x0/0xb0 returned bad count
>
> On investigation it looks like that the compiler is silently truncating the
> return value of drc_pmem_query_stats() from 'long' to 'int', since the
> variable used to store the return code 'rc' is an 'int'. This
> truncated value is then returned back as a 'ssize_t' back from
> perf_stats_show() to 'dev_attr_show()' which thinks of it as a large
> unsigned number and triggers this warning..
>
> To fix this we update the type of variable 'rc' from 'int' to
> 'ssize_t' that prevents the compiler from truncating the return value
> of drc_pmem_query_stats() and returning correct signed value back from
> perf_stats_show().
>
> Fixes: 2d02bf835e573 ('powerpc/papr_scm: Fetch nvdimm performance
> stats from PHYP')
Please don't word wrap the Fixes tag it breaks b4.
I've fixed it up this time.
cheers
^ permalink raw reply
* [PATCH 2/6] powerpc/64: fix irq replay pt_regs->softe value
From: Nicholas Piggin @ 2020-09-15 11:46 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20200915114650.3980244-1-npiggin@gmail.com>
Replayed interrupts get an "artificial" struct pt_regs constructed to
pass to interrupt handler functions. This did not get the softe field
set correctly, it's as though the interrupt has hit while irqs are
disabled. It should be IRQS_ENABLED.
This is possibly harmless, asynchronous handlers should not be testing
if irqs were disabled, but it might be possible for example some code
is shared with synchronous or NMI handlers, and it makes more sense if
debug output looks at this.
Fixes: 3282a3da25bd ("powerpc/64: Implement soft interrupt replay in C")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/irq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 77019699606a..3fdad9336885 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -214,7 +214,7 @@ void replay_soft_interrupts(void)
struct pt_regs regs;
ppc_save_regs(®s);
- regs.softe = IRQS_ALL_DISABLED;
+ regs.softe = IRQS_ENABLED;
again:
if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))
--
2.23.0
^ permalink raw reply related
* [PATCH 1/6] powerpc/64: fix irq replay missing preempt
From: Nicholas Piggin @ 2020-09-15 11:46 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin
Prior to commit 3282a3da25bd ("powerpc/64: Implement soft interrupt
replay in C"), replayed interrupts returned by the regular interrupt
exit code, which performs preemption in case an interrupt had set
need_resched.
This logic was missed by the conversion. Adding preempt_disable/enable
around the interrupt replay and final irq enable will reschedule if
needed.
Fixes: 3282a3da25bd ("powerpc/64: Implement soft interrupt replay in C")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/irq.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index bf21ebd36190..77019699606a 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -368,6 +368,12 @@ notrace void arch_local_irq_restore(unsigned long mask)
}
}
+ /*
+ * Disable preempt here, so that the below preempt_enable will
+ * perform resched if required (a replayed interrupt may set
+ * need_resched).
+ */
+ preempt_disable();
irq_soft_mask_set(IRQS_ALL_DISABLED);
trace_hardirqs_off();
@@ -377,6 +383,7 @@ notrace void arch_local_irq_restore(unsigned long mask)
trace_hardirqs_on();
irq_soft_mask_set(IRQS_ENABLED);
__hard_irq_enable();
+ preempt_enable();
}
EXPORT_SYMBOL(arch_local_irq_restore);
--
2.23.0
^ permalink raw reply related
* [PATCH 3/6] powerpc/64e: remove PACA_IRQ_EE_EDGE
From: Nicholas Piggin @ 2020-09-15 11:46 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20200915114650.3980244-1-npiggin@gmail.com>
This is not used anywhere.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/include/asm/hw_irq.h | 5 ++---
arch/powerpc/kernel/exceptions-64e.S | 1 -
arch/powerpc/kernel/irq.c | 23 -----------------------
3 files changed, 2 insertions(+), 27 deletions(-)
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 35060be09073..50dc35711db3 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -25,9 +25,8 @@
#define PACA_IRQ_DBELL 0x02
#define PACA_IRQ_EE 0x04
#define PACA_IRQ_DEC 0x08 /* Or FIT */
-#define PACA_IRQ_EE_EDGE 0x10 /* BookE only */
-#define PACA_IRQ_HMI 0x20
-#define PACA_IRQ_PMI 0x40
+#define PACA_IRQ_HMI 0x10
+#define PACA_IRQ_PMI 0x20
/*
* Some soft-masked interrupts must be hard masked until they are replayed
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index d9ed79415100..ca444ca82b8d 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -988,7 +988,6 @@ kernel_dbg_exc:
.endm
masked_interrupt_book3e_0x500:
- // XXX When adding support for EPR, use PACA_IRQ_EE_EDGE
masked_interrupt_book3e PACA_IRQ_EE 1
masked_interrupt_book3e_0x900:
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 3fdad9336885..736a6b56e7d6 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -181,16 +181,6 @@ notrace unsigned int __check_irq_replay(void)
return 0x500;
}
- /*
- * Check if an EPR external interrupt happened this bit is typically
- * set if we need to handle another "edge" interrupt from within the
- * MPIC "EPR" handler.
- */
- if (happened & PACA_IRQ_EE_EDGE) {
- local_paca->irq_happened &= ~PACA_IRQ_EE_EDGE;
- return 0x500;
- }
-
if (happened & PACA_IRQ_DBELL) {
local_paca->irq_happened &= ~PACA_IRQ_DBELL;
return 0x280;
@@ -270,19 +260,6 @@ void replay_soft_interrupts(void)
hard_irq_disable();
}
- /*
- * Check if an EPR external interrupt happened this bit is typically
- * set if we need to handle another "edge" interrupt from within the
- * MPIC "EPR" handler.
- */
- if (IS_ENABLED(CONFIG_PPC_BOOK3E) && (happened & PACA_IRQ_EE_EDGE)) {
- local_paca->irq_happened &= ~PACA_IRQ_EE_EDGE;
- regs.trap = 0x500;
- do_IRQ(®s);
- if (!(local_paca->irq_happened & PACA_IRQ_HARD_DIS))
- hard_irq_disable();
- }
-
if (IS_ENABLED(CONFIG_PPC_DOORBELL) && (happened & PACA_IRQ_DBELL)) {
local_paca->irq_happened &= ~PACA_IRQ_DBELL;
if (IS_ENABLED(CONFIG_PPC_BOOK3E))
--
2.23.0
^ permalink raw reply related
* [PATCH 4/6] powerpc/64e: remove 64s specific interrupt soft-mask code
From: Nicholas Piggin @ 2020-09-15 11:46 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20200915114650.3980244-1-npiggin@gmail.com>
Since the assembly soft-masking code was moved to 64e specific, there
are some 64s specific interrupt types still there. Remove them.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/exceptions-64e.S | 10 ----------
arch/powerpc/kernel/irq.c | 2 +-
2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index ca444ca82b8d..f579ce46eef2 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -1302,16 +1302,6 @@ fast_exception_return:
addi r3,r1,STACK_FRAME_OVERHEAD;
bl do_IRQ
b ret_from_except
-1: cmpwi cr0,r3,0xf00
- bne 1f
- addi r3,r1,STACK_FRAME_OVERHEAD;
- bl performance_monitor_exception
- b ret_from_except
-1: cmpwi cr0,r3,0xe60
- bne 1f
- addi r3,r1,STACK_FRAME_OVERHEAD;
- bl handle_hmi_exception
- b ret_from_except
1: cmpwi cr0,r3,0x900
bne 1f
addi r3,r1,STACK_FRAME_OVERHEAD;
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 736a6b56e7d6..b725509f9073 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -113,7 +113,7 @@ static inline notrace int decrementer_check_overflow(void)
#ifdef CONFIG_PPC_BOOK3E
/* This is called whenever we are re-enabling interrupts
- * and returns either 0 (nothing to do) or 500/900/280/a00/e80 if
+ * and returns either 0 (nothing to do) or 500/900/280 if
* there's an EE, DEC or DBELL to generate.
*
* This is called in two contexts: From arch_local_irq_restore()
--
2.23.0
^ permalink raw reply related
* [PATCH 5/6] powerpc/64: make restore_interrupts 64e only
From: Nicholas Piggin @ 2020-09-15 11:46 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20200915114650.3980244-1-npiggin@gmail.com>
This is not used by 64s.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/irq.c | 37 +++++++++++++++++++------------------
1 file changed, 19 insertions(+), 18 deletions(-)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index b725509f9073..631e6d236c97 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -191,6 +191,25 @@ notrace unsigned int __check_irq_replay(void)
return 0;
}
+
+/*
+ * This is specifically called by assembly code to re-enable interrupts
+ * if they are currently disabled. This is typically called before
+ * schedule() or do_signal() when returning to userspace. We do it
+ * in C to avoid the burden of dealing with lockdep etc...
+ *
+ * NOTE: This is called with interrupts hard disabled but not marked
+ * as such in paca->irq_happened, so we need to resync this.
+ */
+void notrace restore_interrupts(void)
+{
+ if (irqs_disabled()) {
+ local_paca->irq_happened |= PACA_IRQ_HARD_DIS;
+ local_irq_enable();
+ } else
+ __hard_irq_enable();
+}
+
#endif /* CONFIG_PPC_BOOK3E */
void replay_soft_interrupts(void)
@@ -364,24 +383,6 @@ notrace void arch_local_irq_restore(unsigned long mask)
}
EXPORT_SYMBOL(arch_local_irq_restore);
-/*
- * This is specifically called by assembly code to re-enable interrupts
- * if they are currently disabled. This is typically called before
- * schedule() or do_signal() when returning to userspace. We do it
- * in C to avoid the burden of dealing with lockdep etc...
- *
- * NOTE: This is called with interrupts hard disabled but not marked
- * as such in paca->irq_happened, so we need to resync this.
- */
-void notrace restore_interrupts(void)
-{
- if (irqs_disabled()) {
- local_paca->irq_happened |= PACA_IRQ_HARD_DIS;
- local_irq_enable();
- } else
- __hard_irq_enable();
-}
-
/*
* This is a helper to use when about to go into idle low-power
* when the latter has the side effect of re-enabling interrupts
--
2.23.0
^ permalink raw reply related
* [PATCH 6/6] powerpc/64: irq replay remove decrementer overflow check
From: Nicholas Piggin @ 2020-09-15 11:46 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20200915114650.3980244-1-npiggin@gmail.com>
This is an ad-hoc way to catch some cases of decrementer overflow. It
won't catch cases where interrupts were hard disabled before any soft
masked interrupts fired, for example. And it doesn't catch cases that
have overflowed an even number of times.
It's not clear what exactly what problem s being solved here. A lost
timer when we have an IRQ off latency of more than ~4.3 seconds could
be avoided (so long as it's also less than ~8.6s) but this is already
a hard lockup order of magnitude event, and the decrementer will wrap
again and provide a timer interrupt within the same latency magnitdue.
So the test catches some cases of lost decrementers in very exceptional
(buggy) latency event cases, reducing timer interrupt latency in that
case by up to 4.3 seconds. And for large decrementer, it's useless. It
is performed in potentially quite a hot path, reading the TB can be
a noticable overhead.
Perhaps more importantly it allows the clunky MSR[EE] vs
PACA_IRQ_HARD_DIS incoherency to be removed.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/kernel/irq.c | 50 +--------------------------------------
1 file changed, 1 insertion(+), 49 deletions(-)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 631e6d236c97..d7162f142f24 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -102,14 +102,6 @@ static inline notrace unsigned long get_irq_happened(void)
return happened;
}
-static inline notrace int decrementer_check_overflow(void)
-{
- u64 now = get_tb_or_rtc();
- u64 *next_tb = this_cpu_ptr(&decrementers_next_tb);
-
- return now >= *next_tb;
-}
-
#ifdef CONFIG_PPC_BOOK3E
/* This is called whenever we are re-enabling interrupts
@@ -142,35 +134,6 @@ notrace unsigned int __check_irq_replay(void)
trace_hardirqs_on();
trace_hardirqs_off();
- /*
- * We are always hard disabled here, but PACA_IRQ_HARD_DIS may
- * not be set, which means interrupts have only just been hard
- * disabled as part of the local_irq_restore or interrupt return
- * code. In that case, skip the decrementr check becaus it's
- * expensive to read the TB.
- *
- * HARD_DIS then gets cleared here, but it's reconciled later.
- * Either local_irq_disable will replay the interrupt and that
- * will reconcile state like other hard interrupts. Or interrupt
- * retur will replay the interrupt and in that case it sets
- * PACA_IRQ_HARD_DIS by hand (see comments in entry_64.S).
- */
- if (happened & PACA_IRQ_HARD_DIS) {
- local_paca->irq_happened &= ~PACA_IRQ_HARD_DIS;
-
- /*
- * We may have missed a decrementer interrupt if hard disabled.
- * Check the decrementer register in case we had a rollover
- * while hard disabled.
- */
- if (!(happened & PACA_IRQ_DEC)) {
- if (decrementer_check_overflow()) {
- local_paca->irq_happened |= PACA_IRQ_DEC;
- happened |= PACA_IRQ_DEC;
- }
- }
- }
-
if (happened & PACA_IRQ_DEC) {
local_paca->irq_happened &= ~PACA_IRQ_DEC;
return 0x900;
@@ -229,18 +192,6 @@ void replay_soft_interrupts(void)
if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))
WARN_ON_ONCE(mfmsr() & MSR_EE);
- if (happened & PACA_IRQ_HARD_DIS) {
- /*
- * We may have missed a decrementer interrupt if hard disabled.
- * Check the decrementer register in case we had a rollover
- * while hard disabled.
- */
- if (!(happened & PACA_IRQ_DEC)) {
- if (decrementer_check_overflow())
- happened |= PACA_IRQ_DEC;
- }
- }
-
/*
* Force the delivery of pending soft-disabled interrupts on PS3.
* Any HV call will have this side effect.
@@ -345,6 +296,7 @@ notrace void arch_local_irq_restore(unsigned long mask)
if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))
WARN_ON_ONCE(!(mfmsr() & MSR_EE));
__hard_irq_disable();
+ local_paca->irq_happened |= PACA_IRQ_HARD_DIS;
} else {
/*
* We should already be hard disabled here. We had bugs
--
2.23.0
^ permalink raw reply related
* [PATCH] powerpc/64s: move the last of the page fault handling logic to C
From: Nicholas Piggin @ 2020-09-15 11:58 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin
The page fault handling still has some complex logic particularly around
hash table handling, in asm. Implement this in C instead.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/include/asm/bug.h | 1 +
arch/powerpc/kernel/exceptions-64s.S | 131 +++++---------------------
arch/powerpc/mm/book3s64/hash_utils.c | 77 +++++++++------
arch/powerpc/mm/fault.c | 55 ++++++++++-
4 files changed, 124 insertions(+), 140 deletions(-)
diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h
index 338f36cd9934..d714d83bbc7c 100644
--- a/arch/powerpc/include/asm/bug.h
+++ b/arch/powerpc/include/asm/bug.h
@@ -112,6 +112,7 @@
struct pt_regs;
extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long);
+extern int hash__do_page_fault(struct pt_regs *, unsigned long, unsigned long);
extern void bad_page_fault(struct pt_regs *, unsigned long, int);
extern void _exception(int, struct pt_regs *, int, unsigned long);
extern void _exception_pkey(struct pt_regs *, unsigned long, int);
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index f7d748b88705..f830b893fe03 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1403,14 +1403,15 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
*
* Handling:
* - Hash MMU
- * Go to do_hash_page first to see if the HPT can be filled from an entry in
- * the Linux page table. Hash faults can hit in kernel mode in a fairly
+ * Go to do_hash_fault, which attempts to fill the HPT from an entry in the
+ * Linux page table. Hash faults can hit in kernel mode in a fairly
* arbitrary state (e.g., interrupts disabled, locks held) when accessing
* "non-bolted" regions, e.g., vmalloc space. However these should always be
- * backed by Linux page tables.
+ * backed by Linux page table entries.
*
- * If none is found, do a Linux page fault. Linux page faults can happen in
- * kernel mode due to user copy operations of course.
+ * If no entry is found the Linux page fault handler is invoked (by
+ * do_hash_fault). Linux page faults can happen in kernel mode due to user
+ * copy operations of course.
*
* - Radix MMU
* The hardware loads from the Linux page table directly, so a fault goes
@@ -1438,13 +1439,17 @@ EXC_COMMON_BEGIN(data_access_common)
GEN_COMMON data_access
ld r4,_DAR(r1)
ld r5,_DSISR(r1)
+ addi r3,r1,STACK_FRAME_OVERHEAD
BEGIN_MMU_FTR_SECTION
- ld r6,_MSR(r1)
- li r3,0x300
- b do_hash_page /* Try to handle as hpte fault */
+ bl do_hash_fault
MMU_FTR_SECTION_ELSE
- b handle_page_fault
+ bl do_page_fault
ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
+ cmpdi r3,0
+ beq+ interrupt_return
+ /* We need to restore NVGPRS */
+ REST_NVGPRS(r1)
+ b interrupt_return
GEN_KVM data_access
@@ -1539,13 +1544,17 @@ EXC_COMMON_BEGIN(instruction_access_common)
GEN_COMMON instruction_access
ld r4,_DAR(r1)
ld r5,_DSISR(r1)
+ addi r3,r1,STACK_FRAME_OVERHEAD
BEGIN_MMU_FTR_SECTION
- ld r6,_MSR(r1)
- li r3,0x400
- b do_hash_page /* Try to handle as hpte fault */
+ bl do_hash_fault
MMU_FTR_SECTION_ELSE
- b handle_page_fault
+ bl do_page_fault
ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
+ cmpdi r3,0
+ beq+ interrupt_return
+ /* We need to restore NVGPRS */
+ REST_NVGPRS(r1)
+ b interrupt_return
GEN_KVM instruction_access
@@ -3197,99 +3206,3 @@ disable_machine_check:
RFI_TO_KERNEL
1: mtlr r0
blr
-
-/*
- * Hash table stuff
- */
- .balign IFETCH_ALIGN_BYTES
-do_hash_page:
-#ifdef CONFIG_PPC_BOOK3S_64
- lis r0,(DSISR_BAD_FAULT_64S | DSISR_DABRMATCH | DSISR_KEYFAULT)@h
- ori r0,r0,DSISR_BAD_FAULT_64S@l
- and. r0,r5,r0 /* weird error? */
- bne- handle_page_fault /* if not, try to insert a HPTE */
-
- /*
- * If we are in an "NMI" (e.g., an interrupt when soft-disabled), then
- * don't call hash_page, just fail the fault. This is required to
- * prevent re-entrancy problems in the hash code, namely perf
- * interrupts hitting while something holds H_PAGE_BUSY, and taking a
- * hash fault. See the comment in hash_preload().
- */
- ld r11, PACA_THREAD_INFO(r13)
- lwz r0,TI_PREEMPT(r11)
- andis. r0,r0,NMI_MASK@h
- bne 77f
-
- /*
- * r3 contains the trap number
- * r4 contains the faulting address
- * r5 contains dsisr
- * r6 msr
- *
- * at return r3 = 0 for success, 1 for page fault, negative for error
- */
- bl __hash_page /* build HPTE if possible */
- cmpdi r3,0 /* see if __hash_page succeeded */
-
- /* Success */
- beq interrupt_return /* Return from exception on success */
-
- /* Error */
- blt- 13f
-
- /* Reload DAR/DSISR into r4/r5 for the DABR check below */
- ld r4,_DAR(r1)
- ld r5,_DSISR(r1)
-#endif /* CONFIG_PPC_BOOK3S_64 */
-
-/* Here we have a page fault that hash_page can't handle. */
-handle_page_fault:
-11: andis. r0,r5,DSISR_DABRMATCH@h
- bne- handle_dabr_fault
- addi r3,r1,STACK_FRAME_OVERHEAD
- bl do_page_fault
- cmpdi r3,0
- beq+ interrupt_return
- mr r5,r3
- addi r3,r1,STACK_FRAME_OVERHEAD
- ld r4,_DAR(r1)
- bl bad_page_fault
- b interrupt_return
-
-/* We have a data breakpoint exception - handle it */
-handle_dabr_fault:
- ld r4,_DAR(r1)
- ld r5,_DSISR(r1)
- addi r3,r1,STACK_FRAME_OVERHEAD
- bl do_break
- /*
- * do_break() may have changed the NV GPRS while handling a breakpoint.
- * If so, we need to restore them with their updated values.
- */
- REST_NVGPRS(r1)
- b interrupt_return
-
-
-#ifdef CONFIG_PPC_BOOK3S_64
-/* We have a page fault that hash_page could handle but HV refused
- * the PTE insertion
- */
-13: mr r5,r3
- addi r3,r1,STACK_FRAME_OVERHEAD
- ld r4,_DAR(r1)
- bl low_hash_fault
- b interrupt_return
-#endif
-
-/*
- * We come here as a result of a DSI at a point where we don't want
- * to call hash_page, such as when we are accessing memory (possibly
- * user memory) inside a PMU interrupt that occurred while interrupts
- * were soft-disabled. We want to invoke the exception handler for
- * the access, or panic if there isn't a handler.
- */
-77: addi r3,r1,STACK_FRAME_OVERHEAD
- li r5,SIGSEGV
- bl bad_page_fault
- b interrupt_return
diff --git a/arch/powerpc/mm/book3s64/hash_utils.c b/arch/powerpc/mm/book3s64/hash_utils.c
index 1da9dbba9217..fd7b6bb7030d 100644
--- a/arch/powerpc/mm/book3s64/hash_utils.c
+++ b/arch/powerpc/mm/book3s64/hash_utils.c
@@ -1500,16 +1500,40 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap,
}
EXPORT_SYMBOL_GPL(hash_page);
-int __hash_page(unsigned long trap, unsigned long ea, unsigned long dsisr,
- unsigned long msr)
+int do_hash_fault(struct pt_regs *regs, unsigned long ea, unsigned long dsisr)
{
unsigned long access = _PAGE_PRESENT | _PAGE_READ;
unsigned long flags = 0;
- struct mm_struct *mm = current->mm;
- unsigned int region_id = get_region_id(ea);
+ struct mm_struct *mm;
+ unsigned int region_id;
+ int err;
+
+ if (unlikely(dsisr & (DSISR_BAD_FAULT_64S | DSISR_DABRMATCH | DSISR_KEYFAULT)))
+ goto _do_page_fault;
+
+ /*
+ * If we are in an "NMI" (e.g., an interrupt when soft-disabled), then
+ * don't call hash_page, just fail the fault. This is required to
+ * prevent re-entrancy problems in the hash code, namely perf
+ * interrupts hitting while something holds H_PAGE_BUSY, and taking a
+ * hash fault. See the comment in hash_preload().
+ *
+ * We come here as a result of a DSI at a point where we don't want
+ * to call hash_page, such as when we are accessing memory (possibly
+ * user memory) inside a PMU interrupt that occurred while interrupts
+ * were soft-disabled. We want to invoke the exception handler for
+ * the access, or panic if there isn't a handler.
+ */
+ if (unlikely(in_nmi())) {
+ bad_page_fault(regs, ea, SIGSEGV);
+ return 0;
+ }
+ region_id = get_region_id(ea);
if ((region_id == VMALLOC_REGION_ID) || (region_id == IO_REGION_ID))
mm = &init_mm;
+ else
+ mm = current->mm;
if (dsisr & DSISR_NOHPTE)
flags |= HPTE_NOHPTE_UPDATE;
@@ -1525,13 +1549,31 @@ int __hash_page(unsigned long trap, unsigned long ea, unsigned long dsisr,
* 2) user space access kernel space.
*/
access |= _PAGE_PRIVILEGED;
- if ((msr & MSR_PR) || (region_id == USER_REGION_ID))
+ if (user_mode(regs) || (region_id == USER_REGION_ID))
access &= ~_PAGE_PRIVILEGED;
- if (trap == 0x400)
+ if (regs->trap == 0x400)
access |= _PAGE_EXEC;
- return hash_page_mm(mm, ea, access, trap, flags);
+ err = hash_page_mm(mm, ea, access, regs->trap, flags);
+ if (unlikely(err < 0)) {
+ // failed to instert a hash PTE due to an hypervisor error
+ if (user_mode(regs)) {
+ if (IS_ENABLED(CONFIG_PPC_SUBPAGE_PROT) && err == -2)
+ _exception(SIGSEGV, regs, SEGV_ACCERR, ea);
+ else
+ _exception(SIGBUS, regs, BUS_ADRERR, ea);
+ } else {
+ bad_page_fault(regs, ea, SIGBUS);
+ }
+ err = 0;
+
+ } else if (err) {
+_do_page_fault:
+ err = hash__do_page_fault(regs, ea, dsisr);
+ }
+
+ return err;
}
#ifdef CONFIG_PPC_MM_SLICES
@@ -1831,27 +1873,6 @@ void flush_hash_range(unsigned long number, int local)
}
}
-/*
- * low_hash_fault is called when we the low level hash code failed
- * to instert a PTE due to an hypervisor error
- */
-void low_hash_fault(struct pt_regs *regs, unsigned long address, int rc)
-{
- enum ctx_state prev_state = exception_enter();
-
- if (user_mode(regs)) {
-#ifdef CONFIG_PPC_SUBPAGE_PROT
- if (rc == -2)
- _exception(SIGSEGV, regs, SEGV_ACCERR, address);
- else
-#endif
- _exception(SIGBUS, regs, BUS_ADRERR, address);
- } else
- bad_page_fault(regs, address, SIGBUS);
-
- exception_exit(prev_state);
-}
-
long hpte_insert_repeating(unsigned long hash, unsigned long vpn,
unsigned long pa, unsigned long rflags,
unsigned long vflags, int psize, int ssize)
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 0add963a849b..ce43e401e0e0 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -405,7 +405,10 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,
if (unlikely(debugger_fault_handler(regs) || kprobe_fault))
return 0;
- if (unlikely(page_fault_is_bad(error_code))) {
+ if (unlikely(page_fault_is_bad(error_code) || (error_code & DSISR_DABRMATCH))) {
+ if (error_code & DSISR_DABRMATCH)
+ return -1;
+
if (is_user) {
_exception(SIGBUS, regs, BUS_OBJERR, address);
return 0;
@@ -548,12 +551,58 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
unsigned long error_code)
{
enum ctx_state prev_state = exception_enter();
- int rc = __do_page_fault(regs, address, error_code);
+ int err;
+
+ err = __do_page_fault(regs, address, error_code);
+
+#ifdef CONFIG_PPC_BOOK3S_64
+ /* 32 and 64e handle errors in their asm code */
+ if (unlikely(err)) {
+ if (err > 0) {
+ bad_page_fault(regs, address, err);
+ err = 0;
+ } else {
+ /*
+ * do_break() may change NV GPRS while handling the
+ * breakpoint. Return -ve to caller to do that.
+ */
+ do_break(regs, address, error_code);
+ }
+ }
+#endif
+
exception_exit(prev_state);
- return rc;
+
+ return err;
}
NOKPROBE_SYMBOL(do_page_fault);
+#ifdef CONFIG_PPC_BOOK3S_64
+/* Same as do_page_fault but interrupt entry has already run in do_hash_fault */
+int hash__do_page_fault(struct pt_regs *regs, unsigned long address,
+ unsigned long error_code)
+{
+ int err;
+
+ err = __do_page_fault(regs, address, error_code);
+ if (unlikely(err)) {
+ if (err > 0) {
+ bad_page_fault(regs, address, err);
+ err = 0;
+ } else {
+ /*
+ * do_break() may change NV GPRS while handling the
+ * breakpoint. Return -ve to caller to do that.
+ */
+ do_break(regs, address, error_code);
+ }
+ }
+
+ return err;
+}
+NOKPROBE_SYMBOL(hash__do_page_fault);
+#endif
+
/*
* bad_page_fault is called when we have a bad access from the kernel.
* It is called from the DSI and ISI handlers in head.S and from some
--
2.23.0
^ permalink raw reply related
* Re: [PATCH 00/15] selftests/seccomp: Refactor change_syscall()
From: Michael Ellerman @ 2020-09-15 12:52 UTC (permalink / raw)
To: Kees Cook
Cc: Thadeu Lima de Souza Cascardo, Will Drewry, linux-xtensa,
linux-kernel, Andy Lutomirski, Max Filippov, linux-arm-kernel,
linux-kselftest, linux-mips, linuxppc-dev, Christian Brauner
In-Reply-To: <202009141321.366935EF52@keescook>
Kees Cook <keescook@chromium.org> writes:
> On Mon, Sep 14, 2020 at 10:15:18PM +1000, Michael Ellerman wrote:
>> Kees Cook <keescook@chromium.org> writes:
>> > Hi,
>> >
>> > This refactors the seccomp selftest macros used in change_syscall(),
>> > in an effort to remove special cases for mips, arm, arm64, and xtensa,
>> > which paves the way for powerpc fixes.
>> >
>> > I'm not entirely done testing, but all-arch build tests and x86_64
>> > selftests pass. I'll be doing arm, arm64, and i386 selftests shortly,
>> > but I currently don't have an easy way to check xtensa, mips, nor
>> > powerpc. Any help there would be appreciated!
>>
>> The series builds fine for me, and all the tests pass (see below).
>>
>> Thanks for picking up those changes to deal with powerpc being oddball.
>>
>> Tested-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
>
> Awesome; thanks!
>
> However...
>
>> ./seccomp_bpf
>> TAP version 13
>> 1..86
>> # Starting 86 tests from 7 test cases.
>> # RUN global.kcmp ...
>> # OK global.kcmp
>> ok 1 global.kcmp
>> [...]
>> # RUN global.KILL_thread ...
>> TAP version 13
>> 1..86
>> # Starting 86 tests from 7 test cases.
>
> Was this a mis-paste, or has something very very bad happened here in
> global.KILL_one_arg_six finishes?
>
...
>> TAP version 13
>> 1..86
>> # Starting 86 tests from 7 test cases.
>> [...]
>> # PASSED: 86 / 86 tests passed.
>> # Totals: pass:86 fail:0 xfail:0 xpass:0 skip:0 error:0
>
> And after every user_notification test? O_O
Haha, I thought that was normal :)
It's because of redirection, I run the tests with:
find . -executable -type f -print -execdir '{}' ';' | tee test.log
If I just run it directly on the terminal everything is normal.
It'll be fork() vs libc buffering.
I can fix it with:
$ stdbuf -oL ./seccomp_bpf | tee test.log
Or the patch below.
I can send a proper patch for that tomorrow, I don't know that harness
code, but I think that's the right fix.
cheers
diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index 4f78e4805633..b1bd00ff3d94 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -971,6 +971,7 @@ void __run_test(struct __fixture_metadata *f,
ksft_print_msg(" RUN %s%s%s.%s ...\n",
f->name, variant->name[0] ? "." : "", variant->name, t->name);
+ fflush(stdout);
t->pid = fork();
if (t->pid < 0) {
ksft_print_msg("ERROR SPAWNING TEST CHILD\n");
^ permalink raw reply related
* Re: Injecting SLB miltihit crashes kernel 5.9.0-rc5
From: Michael Ellerman @ 2020-09-15 12:54 UTC (permalink / raw)
To: Michal Suchánek, linuxppc-dev, mahesh
In-Reply-To: <20200915084302.GG29778@kitsune.suse.cz>
Michal Suchánek <msuchanek@suse.de> writes:
> Hello,
>
> Using the SLB mutihit injection test module (which I did not write so I
> do not want to post it here) to verify updates on my 5.3 frankernekernel
> I found that the kernel crashes with Oops: kernel bad access.
>
> I tested on latest upstream kernel build that I have at hand and the
> result is te same (minus the message - nothing was logged and the kernel
> simply rebooted).
That's disappointing.
> Since the whole effort to write a real mode MCE handler was supposed to
> prevent this maybe the SLB injection module should be added to the
> kernel selftests?
Yes I'd like to see it upstream. I think it should be integrated into
LKDTM, which contains other dangerous things like that and is designed
for testing how the kernel handles/recovers from bad conditions.
cheers
^ permalink raw reply
* Re: [5.9.0-rc5-20200914] Kernel crash while running LTP(mlock201)
From: Matthew Wilcox @ 2020-09-15 13:09 UTC (permalink / raw)
To: Michael Ellerman; +Cc: Sachin Sant, linux-next, linuxppc-dev
In-Reply-To: <87o8m7p9jd.fsf@mpe.ellerman.id.au>
On Tue, Sep 15, 2020 at 09:24:38PM +1000, Michael Ellerman wrote:
> Sachin Sant <sachinp@linux.vnet.ibm.com> writes:
> > While running LTP tests (specifically mlock201) against next-20200914 tree
> > on a POWER9 LPAR results in following crash.
>
> Looks the same as:
>
> https://lore.kernel.org/linux-mm/20200914085545.GB28738@shao2-debian/
https://lore.kernel.org/linux-mm/20200914112738.GM6583@casper.infradead.org/
^ permalink raw reply
* [Bug 209277] New: Dead code :q
From: bugzilla-daemon @ 2020-09-15 14:09 UTC (permalink / raw)
To: linuxppc-dev
https://bugzilla.kernel.org/show_bug.cgi?id=209277
Bug ID: 209277
Summary: Dead code :q
Product: Platform Specific/Hardware
Version: 2.5
Kernel Version: 5.9-rc4
Hardware: All
OS: Linux
Tree: Mainline
Status: NEW
Severity: enhancement
Priority: P1
Component: PPC-32
Assignee: platform_ppc-32@kernel-bugs.osdl.org
Reporter: fazilyildiran@gmail.com
Regression: No
--
You are receiving this mail because:
You are watching the assignee of the bug.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox