Re: [RFC PATCH] skiboot machine check handler

2020-01-20 Thread Nicholas Piggin
Mahesh J Salgaonkar's on January 16, 2020 5:03 pm: > On 2019-12-11 20:01:18 Wed, Nicholas Piggin wrote: >> Provide facilities to decode machine checks into human readable >> strings, with only sufficient information required to deal with >> them sanely. >> >> The old machine check stuff was over

Re: [PATCH -next] powerpc/maple: fix comparing pointer to 0

2020-01-20 Thread Segher Boessenkool
On Mon, Jan 20, 2020 at 05:52:15PM -0800, Joe Perches wrote: > On Tue, 2020-01-21 at 09:31 +0800, Chen Zhou wrote: > > Fixes coccicheck warning: > > ./arch/powerpc/platforms/maple/setup.c:232:15-16: > > WARNING comparing pointer to 0 > > Does anyone have or use these powerpc maple boards

Re:Re: [PATCH] powerpc/sysdev: fix compile errors

2020-01-20 Thread 王文虎
发件人:Andrew Donnellan 发送日期:2020-01-21 14:13:07 收件人:wangwenhu ,Benjamin Herrenschmidt ,Paul Mackerras ,Michael Ellerman ,Kate Stewart ,Greg Kroah-Hartman ,Richard Fontana ,Thomas Gleixner ,linuxppc-dev@lists.ozlabs.org,linux-ker...@vger.kernel.org

Re: [PATCH v2 05/27] powerpc: Map & release OpenCAPI LPC memory

2020-01-20 Thread Andrew Donnellan
On 3/12/19 2:46 pm, Alastair D'Silva wrote: From: Alastair D'Silva This patch adds platform support to map & release LPC memory. Might want to explain what LPC is. Otherwise: Reviewed-by: Andrew Donnellan Signed-off-by: Alastair D'Silva --- arch/powerpc/include/asm/pnv-ocxl.h | 2

Re:Re: [PATCH] powerpc/Kconfig: Make FSL_85XX_CACHE_SRAM configurable

2020-01-20 Thread 王文虎
发件人:Scott Wood 发送日期:2020-01-21 13:49:59 收件人:"王文虎" 抄送人:wangwenhu ,Kumar Gala ,Benjamin Herrenschmidt ,Paul Mackerras ,Michael Ellerman ,linuxppc-dev@lists.ozlabs.org,linux-ker...@vger.kernel.org,triv...@kernel.org,Rai Harninder 主题:Re: [PATCH] powerpc/Kconfig: Make FSL_85XX_CACHE_SRAM

Re: [PATCH] powerpc/sysdev: fix compile errors

2020-01-20 Thread Andrew Donnellan
On 21/1/20 4:31 pm, wangwenhu wrote: From: wangwenhu Include arch/powerpc/include/asm/io.h into fsl_85xx_cache_sram.c to fix the implicit declaration compile errors when building Cache-Sram. arch/powerpc/sysdev/fsl_85xx_cache_sram.c: In function ‘instantiate_cache_sram’:

Re: [PATCH] powerpc/sysdev: fix compile errors

2020-01-20 Thread Christophe Leroy
Le 21/01/2020 à 06:31, wangwenhu a écrit : From: wangwenhu Include arch/powerpc/include/asm/io.h into fsl_85xx_cache_sram.c to fix the implicit declaration compile errors when building Cache-Sram. It is usually better to include instead of Christophe

Re: [PATCH] powerpc/Kconfig: Make FSL_85XX_CACHE_SRAM configurable

2020-01-20 Thread Scott Wood
On Tue, 2020-01-21 at 13:20 +0800, 王文虎 wrote: > From: Scott Wood > Date: 2020-01-21 11:25:25 > To: wangwenhu ,Kumar Gala , > Benjamin Herrenschmidt ,Paul Mackerras < > pau...@samba.org>,Michael Ellerman , > linuxppc-dev@lists.ozlabs.org,linux-ker...@vger.kernel.org > Cc:

Re:[PATCH] powerpc/Kconfig: Make FSL_85XX_CACHE_SRAM configurable

2020-01-20 Thread 王文虎
From: Scott Wood Date: 2020-01-21 11:25:25 To: wangwenhu ,Kumar Gala ,Benjamin Herrenschmidt ,Paul Mackerras ,Michael Ellerman ,linuxppc-dev@lists.ozlabs.org,linux-ker...@vger.kernel.org Cc: triv...@kernel.org,wenhu.w...@vivo.com,Rai Harninder Subject: Re: [PATCH] powerpc/Kconfig: Make

[Bug 205099] KASAN hit at raid6_pq: BUG: Unable to handle kernel data access at 0x00f0fd0d

2020-01-20 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205099 --- Comment #19 from Christophe Leroy (christophe.le...@c-s.fr) --- Can you tell exactly where it stops during the boot ? Or take a photo of the screen ? In parallele, could you try (without VMAP_STACK) increasing CONFIG_THREAD_SHIFT to 14 ? It

[PATCH] powerpc/sysdev: fix compile errors

2020-01-20 Thread wangwenhu
From: wangwenhu Include arch/powerpc/include/asm/io.h into fsl_85xx_cache_sram.c to fix the implicit declaration compile errors when building Cache-Sram. arch/powerpc/sysdev/fsl_85xx_cache_sram.c: In function ‘instantiate_cache_sram’: arch/powerpc/sysdev/fsl_85xx_cache_sram.c:97:26: error:

[PATCH v2 10/10] powerpc/configs/skiroot: Enable CONFIG_PRINTK_CALLER

2020-01-20 Thread Michael Ellerman
This adds the CPU or thread number to printk messages. This can help decipher concurrent oopses that have been interleaved. Example output, of PID1 (T1) triggering a warning: [1.581678][T1] WARNING: CPU: 0 PID: 1 at crypto/rsa-pkcs1pad.c:539 pkcs1pad_verify+0x38/0x140 [

[PATCH v2 09/10] powerpc/configs/skiroot: Enable some more hardening options

2020-01-20 Thread Michael Ellerman
Enable more hardening options. Note BUG_ON_DATA_CORRUPTION selects DEBUG_LIST and is essentially just a synonym for it. DEBUG_SG, DEBUG_NOTIFIERS, DEBUG_LIST, DEBUG_CREDENTIALS and SCHED_STACK_END_CHECK should all be low overhead and just add a few extra checks. SLAB_FREELIST_RANDOM, and

[PATCH v2 08/10] powerpc/configs/skiroot: Disable xmon default & enable reboot on panic

2020-01-20 Thread Michael Ellerman
If the skiroot kernel crashes we don't want it sitting at an xmon prompt forever. Instead it's more helpful to reboot and bring the boot loader back up, and if the crash was transient we can then boot successfully. Similarly if we panic we should reboot, with a short timeout in case someone is

[PATCH v2 07/10] powerpc/configs/skiroot: Enable security features

2020-01-20 Thread Michael Ellerman
From: Joel Stanley This turns on HARDENED_USERCOPY with HARDENED_USERCOPY_PAGESPAN, and FORTIFY_SOURCE. It also enables SECURITY_LOCKDOWN_LSM with _EARLY and LOCK_DOWN_KERNEL_FORCE_INTEGRITY options enabled. This still allows xmon to be used in read-only mode. MODULE_SIG is selected by

[PATCH v2 06/10] powerpc/configs/skiroot: Update for symbol movement only

2020-01-20 Thread Michael Ellerman
Signed-off-by: Michael Ellerman --- arch/powerpc/configs/skiroot_defconfig | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) v2: No change. diff --git a/arch/powerpc/configs/skiroot_defconfig b/arch/powerpc/configs/skiroot_defconfig index

[PATCH v2 05/10] powerpc/configs/skiroot: Drop default n CONFIG_CRYPTO_ECHAINIV

2020-01-20 Thread Michael Ellerman
It's default n so we don't need to disable it. Signed-off-by: Michael Ellerman --- arch/powerpc/configs/skiroot_defconfig | 1 - 1 file changed, 1 deletion(-) v2: No change. diff --git a/arch/powerpc/configs/skiroot_defconfig b/arch/powerpc/configs/skiroot_defconfig index

[PATCH v2 04/10] powerpc/configs/skiroot: Drop HID_LOGITECH

2020-01-20 Thread Michael Ellerman
Commit bdd08fff4915 ("HID: logitech: Add depends on LEDS_CLASS to Logitech Kconfig entry") made HID_LOGITECH depend on LEDS_CLASS which we do not enable, meaning we are not actually enabling those drivers any more. The Kconfig help text suggests USB HID compliant Logictech devices will continue

[PATCH v2 03/10] powerpc/configs: Drop NET_VENDOR_HP which moved to staging

2020-01-20 Thread Michael Ellerman
The HP network driver moved to staging in commit 52340b82cf1a ("hp100: Move 100BaseVG AnyLAN driver to staging") meaning we don't need to disable it any more in our defconfigs. Signed-off-by: Michael Ellerman --- arch/powerpc/configs/44x/akebono_defconfig | 1 -

[PATCH v2 01/10] powerpc/configs: Drop CONFIG_QLGE which moved to staging

2020-01-20 Thread Michael Ellerman
The QLGE driver moved to staging in commit 955315b0dc8c ("qlge: Move drivers/net/ethernet/qlogic/qlge/ to drivers/staging/qlge/"), meaning our defconfigs that enable it have no effect as we don't enable CONFIG_STAGING. It sounds like the device is obsolete, so drop the driver. Signed-off-by:

[PATCH v2 02/10] powerpc/configs: NET_CADENCE became NET_VENDOR_CADENCE

2020-01-20 Thread Michael Ellerman
The NET_CADENCE symbol was renamed to NET_VENDOR_CADENCE, so we don't need to disable the former, see commit 0df5f81c481e ("net: ethernet: Add missing VENDOR to Cadence and Packet Engines symbols"). Signed-off-by: Michael Ellerman --- arch/powerpc/configs/skiroot_defconfig | 1 - 1 file

Re: [RFC PATCH 9/9] powerpc/configs/skiroot: Enable some more hardening options

2020-01-20 Thread Michael Ellerman
Joel Stanley writes: > On Thu, 16 Jan 2020 at 01:48, Michael Ellerman wrote: >> >> Enable more hardening options. >> >> Note BUG_ON_DATA_CORRUPTION selects DEBUG_LIST and is essentially just >> a synonym for it. >> >> DEBUG_SG, DEBUG_NOTIFIERS, DEBUG_LIST, DEBUG_CREDENTIALS and >>

Re: [PATCH] powerpc/pseries/vio: Fix iommu_table use-after-free refcount warning

2020-01-20 Thread Alexey Kardashevskiy
On 21/01/2020 09:10, Tyrel Datwyler wrote: > From: Tyrel Datwyler > > Commit e5afdf9dd515 ("powerpc/vfio_spapr_tce: Add reference counting to > iommu_table") missed an iommu_table allocation in the pseries vio code. > The iommu_table is allocated with kzalloc and as a result the associated >

Re: [PATCH] powerpc/Kconfig: Make FSL_85XX_CACHE_SRAM configurable

2020-01-20 Thread Scott Wood
On Mon, 2020-01-20 at 06:43 -0800, wangwenhu wrote: > From: wangwenhu > > When generating .config file with menuconfig on Freescale BOOKE > SOC, FSL_85XX_CACHE_SRAM is not configurable for the lack of > description in the Kconfig field, which makes it impossible > to support L2Cache-Sram driver.

Re: [PATCH -next] powerpc/maple: fix comparing pointer to 0

2020-01-20 Thread Joe Perches
On Tue, 2020-01-21 at 09:31 +0800, Chen Zhou wrote: > Fixes coccicheck warning: > ./arch/powerpc/platforms/maple/setup.c:232:15-16: > WARNING comparing pointer to 0 Does anyone have or use these powerpc maple boards anymore? Maybe the whole codebase should just be deleted instead. If not,

[PATCH -next] powerpc/maple: fix comparing pointer to 0

2020-01-20 Thread Chen Zhou
Fixes coccicheck warning: ./arch/powerpc/platforms/maple/setup.c:232:15-16: WARNING comparing pointer to 0 Compare pointer-typed values to NULL rather than 0. Signed-off-by: Chen Zhou --- arch/powerpc/platforms/maple/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[Bug 205099] KASAN hit at raid6_pq: BUG: Unable to handle kernel data access at 0x00f0fd0d

2020-01-20 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205099 --- Comment #18 from Erhard F. (erhar...@mailbox.org) --- (In reply to Christophe Leroy from comment #17) > Created attachment 286907 [details] > Patch to fix kasan with KASAN_VMALLOC and VMAP_STACK > > Please try the attached patch, it fixes

[PATCH] powerpc/pseries/vio: Fix iommu_table use-after-free refcount warning

2020-01-20 Thread Tyrel Datwyler
From: Tyrel Datwyler Commit e5afdf9dd515 ("powerpc/vfio_spapr_tce: Add reference counting to iommu_table") missed an iommu_table allocation in the pseries vio code. The iommu_table is allocated with kzalloc and as a result the associated kref gets a value of zero. This has the side effect that

[PATCH] powerpc/Kconfig: Make FSL_85XX_CACHE_SRAM configurable

2020-01-20 Thread wangwenhu
From: wangwenhu When generating .config file with menuconfig on Freescale BOOKE SOC, FSL_85XX_CACHE_SRAM is not configurable for the lack of description in the Kconfig field, which makes it impossible to support L2Cache-Sram driver. Add a description to make it configurable. Signed-off-by:

Re: [PATCH v2 00/10] Impveovements for random.h/archrandom.h

2020-01-20 Thread Borislav Petkov
On Mon, Jan 20, 2020 at 05:26:27PM +, Mark Brown wrote: > I think the important thing here is that *someone* takes the patches. > We've now got Ted and Borislav both saying they're OK applying the > patches, an additional proposal that Andrew takes the patches, nobody > saying anything

Re: [RFC PATCH v4 00/11] powerpc: switch VDSO to C implementation.

2020-01-20 Thread Segher Boessenkool
On Mon, Jan 20, 2020 at 06:08:23PM +0100, Christophe Leroy wrote: > Not easy I think. > > First we have the unavoidable ASM entry function that can't be dropped > because of the CR[SO] bit the set on error or clear on no error and that > can't be done in C. Yup. > In our ASM VDSO, fixed

Re: [PATCH v2 00/10] Impveovements for random.h/archrandom.h

2020-01-20 Thread Mark Brown
On Fri, Jan 10, 2020 at 12:05:59PM -0500, Theodore Y. Ts'o wrote: > On Fri, Jan 10, 2020 at 04:51:53PM +0100, Borislav Petkov wrote: > > On Fri, Jan 10, 2020 at 02:54:12PM +, Mark Brown wrote: > > > This is a resend of a series from Richard Henderson last posted back in > > > November: > > >

Re: [RFC PATCH v4 00/11] powerpc: switch VDSO to C implementation.

2020-01-20 Thread Christophe Leroy
Le 20/01/2020 à 16:19, Segher Boessenkool a écrit : On Mon, Jan 20, 2020 at 02:56:00PM +, Christophe Leroy wrote: Nice! Much better. It should be tested on more representative hardware, too, but this looks promising alright :-) mpc832x (e300c2 core) at 333 MHz: Before:

Re: [RFC PATCH v4 00/11] powerpc: switch VDSO to C implementation.

2020-01-20 Thread Segher Boessenkool
On Mon, Jan 20, 2020 at 02:56:00PM +, Christophe Leroy wrote: > >Nice! Much better. > > > >It should be tested on more representative hardware, too, but this looks > >promising alright :-) > > mpc832x (e300c2 core) at 333 MHz: > > Before: > > gettimeofday:vdso: 235 nsec/call >

Re: [RFC PATCH v4 00/11] powerpc: switch VDSO to C implementation.

2020-01-20 Thread Christophe Leroy
Hi On 01/17/2020 08:58 AM, Segher Boessenkool wrote: Hi! On Thu, Jan 16, 2020 at 05:58:24PM +, Christophe Leroy wrote: On a powerpc8xx, with current powerpc/32 ASM VDSO: gettimeofday:vdso: 907 nsec/call clock-getres-realtime:vdso: 484 nsec/call clock-gettime-realtime:vdso:

Re: [PATCH v2] selftests: vm: Fix 64-bit test builds for powerpc64le

2020-01-20 Thread Kamalesh Babulal
On 1/20/20 7:29 PM, Sandipan Das wrote: > Some tests are built only for 64-bit systems. This makes > sure that these tests are built for both big and little > endian variants of powerpc64. > > Fixes: 7549b3364201 ("selftests: vm: Build/Run 64bit tests only on 64bit > arch") > Signed-off-by:

[PATCH v2] selftests: vm: Fix 64-bit test builds for powerpc64le

2020-01-20 Thread Sandipan Das
Some tests are built only for 64-bit systems. This makes sure that these tests are built for both big and little endian variants of powerpc64. Fixes: 7549b3364201 ("selftests: vm: Build/Run 64bit tests only on 64bit arch") Signed-off-by: Sandipan Das --- Changelog: v2: - Added required

[PATCH] selftests: vm: Fix 64-bit test builds for powerpc64le

2020-01-20 Thread Sandipan Das
Some tests are built only for 64-bit systems. This makes sure that these tests are built for both big and little endian variants of powerpc64. Fixes: 7549b3364201 ("selftests: vm: Build/Run 64bit tests only on 64bit arch") Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/Makefile | 2

Re: [PATCH] ide: remove set but not used variable 'hwif'

2020-01-20 Thread David Miller
From: Wang Hai Date: Sat, 26 Oct 2019 09:57:38 +0800 > Fix the following gcc warning: > > drivers/ide/pmac.c: In function pmac_ide_setup_device: > drivers/ide/pmac.c:1027:14: warning: variable hwif set but not used > [-Wunused-but-set-variable] > > Fixes: d58b0c39e32f ("powerpc/macio: Rework

[Bug 205099] KASAN hit at raid6_pq: BUG: Unable to handle kernel data access at 0x00f0fd0d

2020-01-20 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=205099 --- Comment #17 from Christophe Leroy (christophe.le...@c-s.fr) --- Created attachment 286907 --> https://bugzilla.kernel.org/attachment.cgi?id=286907=edit Patch to fix kasan with KASAN_VMALLOC and VMAP_STACK Please try the attached patch, it

[PATCH v5 10/10] drivers/oprofile: open access for CAP_PERFMON privileged process

2020-01-20 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Providing the

[PATCH v5 09/10] drivers/perf: open access for CAP_PERFMON privileged process

2020-01-20 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Providing the

[PATCH v5 08/10] parisc/perf: open access for CAP_PERFMON privileged process

2020-01-20 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Providing the

[PATCH v5 07/10] powerpc/perf: open access for CAP_PERFMON privileged process

2020-01-20 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to the monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Providing the

[PATCH v5 06/10] trace/bpf_trace: open access for CAP_PERFMON privileged process

2020-01-20 Thread Alexey Budankov
Open access to bpf_trace monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to bpf_trace monitoring remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure bpf_trace monitoring is discouraged with respect to CAP_PERFMON

[PATCH v5 05/10] drm/i915/perf: open access for CAP_PERFMON privileged process

2020-01-20 Thread Alexey Budankov
Open access to i915_perf monitoring for CAP_PERFMON privileged processes. For backward compatibility reasons access to i915_perf subsystem remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure i915_perf monitoring is discouraged with respect to CAP_PERFMON

[PATCH v5 04/10] perf tool: extend Perf tool with CAP_PERFMON capability support

2020-01-20 Thread Alexey Budankov
Extend error messages to mention CAP_PERFMON capability as an option to substitute CAP_SYS_ADMIN capability for secure system performance monitoring and observability operations. Make perf_event_paranoid_check() and __cmd_ftrace() to be aware of CAP_PERFMON capability. Signed-off-by: Alexey

[PATCH v5 03/10] perf/core: open access to anon probes for CAP_PERFMON privileged process

2020-01-20 Thread Alexey Budankov
Open access to anon kprobes, uprobes and eBPF tracing for CAP_PERFMON privileged processes. For backward compatibility reasons access remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure monitoring is discouraged with respect to CAP_PERFMON capability. Providing

[PATCH v5 02/10] perf/core: open access to the core for CAP_PERFMON privileged process

2020-01-20 Thread Alexey Budankov
Open access to monitoring of kernel code, system, tracepoints and namespaces data for a CAP_PERFMON privileged process. For backward compatibility reasons access to perf_events subsystem remains open for CAP_SYS_ADMIN privileged processes but CAP_SYS_ADMIN usage for secure perf_events monitoring

[PATCH v5 01/10] capabilities: introduce CAP_PERFMON to kernel and user space

2020-01-20 Thread Alexey Budankov
Introduce CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for perf_events, i915_perf and other performance monitoring and observability subsystems. CAP_PERFMON

Re: [FSL P5020 P5040 PPC] Onboard SD card doesn't work anymore after the 'mmc-v5.4-2' updates

2020-01-20 Thread Ulf Hansson
On Mon, 20 Jan 2020 at 10:17, Christian Zigotzky wrote: > > Am 16.01.20 um 16:46 schrieb Ulf Hansson: > > On Thu, 16 Jan 2020 at 12:18, Christian Zigotzky > > wrote: > >> Hi All, > >> > >> We still need the attached patch for our onboard SD card interface > >> [1,2]. Could you please add this

[PATCH v5 0/10] Introduce CAP_PERFMON to secure system performance monitoring and observability

2020-01-20 Thread Alexey Budankov
Currently access to perf_events, i915_perf and other performance monitoring and observability subsystems of the kernel is open for a privileged process [1] with CAP_SYS_ADMIN capability enabled in the process effective set [2]. This patch set introduces CAP_PERFMON capability designed to secure

[PATCH 2/2] powerpc/perf: Implement a global lock to avoid races between trace, core and thread imc events.

2020-01-20 Thread Anju T Sudhakar
IMC(In-memory Collection Counters) does performance monitoring in two different modes, i.e accumulation mode(core-imc and thread-imc events), and trace mode(trace-imc events). A cpu thread can either be in accumulation-mode or trace-mode at a time and this is done via the LDBAR register in POWER

[PATCH 1/2] powerpc/powernv: Re-enable imc trace-mode in kernel

2020-01-20 Thread Anju T Sudhakar
commit <249fad734a25> ""powerpc/perf: Disable trace_imc pmu" disables IMC(In-Memory Collection) trace-mode in kernel, since frequent mode switching between accumulation mode and trace mode via the spr LDBAR in the hardware can trigger a checkstop(system crash). Patch to re-enable imc-trace mode

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-20 Thread David Hildenbrand
On 20.01.20 10:14, David Hildenbrand wrote: > On 20.01.20 08:48, Michal Hocko wrote: >> On Fri 17-01-20 08:57:51, Dan Williams wrote: >> [...] >>> Unless the user is willing to hold the device_hotplug_lock over the >>> evaluation then the result is unreliable. >> >> Do we want to hold the

[FSL P5020 P5040 PPC] Onboard SD card doesn't work anymore after the 'mmc-v5.4-2' updates

2020-01-20 Thread Christian Zigotzky
Am 16.01.20 um 16:46 schrieb Ulf Hansson: On Thu, 16 Jan 2020 at 12:18, Christian Zigotzky wrote: Hi All, We still need the attached patch for our onboard SD card interface [1,2]. Could you please add this patch to the tree? No, because according to previous discussion that isn't the correct

Re: [PATCH RFC v1] mm: is_mem_section_removable() overhaul

2020-01-20 Thread David Hildenbrand
On 20.01.20 08:48, Michal Hocko wrote: > On Fri 17-01-20 08:57:51, Dan Williams wrote: > [...] >> Unless the user is willing to hold the device_hotplug_lock over the >> evaluation then the result is unreliable. > > Do we want to hold the device_hotplug_lock from this user readable file > in the

[PATCH v17 16/24] selftests/vm/pkeys: Fix assertion in test_pkey_alloc_exhaust()

2020-01-20 Thread Sandipan Das
From: Ram Pai Some pkeys which are valid on the hardware are reserved and not available for application use. These keys cannot be allocated. test_pkey_alloc_exhaust() tries to account for these and has an assertion which validates if all available pkeys have been exahaustively allocated.

[PATCH v17 17/24] selftests/vm/pkeys: Improve checks to determine pkey support

2020-01-20 Thread Sandipan Das
From: Ram Pai For the pkeys subsystem to work, both the CPU and the kernel need to have support. So, additionally check if the kernel supports pkeys apart from the CPU feature checks. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Sandipan Das ---

[PATCH v17 20/24] selftests/vm/pkeys: Detect write violation on a mapped access-denied-key page

2020-01-20 Thread Sandipan Das
From: Ram Pai Detect write-violation on a page to which access-disabled key is associated much after the page is mapped. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Acked-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/protection_keys.c | 13

[PATCH v17 05/24] selftests/vm/pkeys: Move some definitions to arch-specific header

2020-01-20 Thread Sandipan Das
From: Thiago Jung Bauermann In preparation for multi-arch support, move definitions which have arch-specific values to x86-specific header. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Acked-by: Dave Hansen Signed-off-by: Sandipan Das ---

[PATCH v17 11/24] selftests/vm/pkeys: Fix alloc_random_pkey() to make it really random

2020-01-20 Thread Sandipan Das
From: Ram Pai alloc_random_pkey() was allocating the same pkey every time. Not all pkeys were geting tested. This fixes it. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Acked-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/protection_keys.c | 3 ++-

[PATCH v17 13/24] selftests/vm/pkeys: Introduce generic pkey abstractions

2020-01-20 Thread Sandipan Das
From: Ram Pai This introduces some generic abstractions and provides the corresponding architecture-specfic implementations for these abstractions. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das ---

[PATCH v17 07/24] selftests: vm: pkeys: Use sane types for pkey register

2020-01-20 Thread Sandipan Das
The size of the pkey register can vary across architectures. This converts the data type of all its references to u64 in preparation for multi-arch support. To keep the definition of the u64 type consistent and remove format specifier related warnings, __SANE_USERSPACE_TYPES__ is defined as

[PATCH v17 22/24] selftests/vm/pkeys: Test correct behaviour of pkey-0

2020-01-20 Thread Sandipan Das
From: Ram Pai Ensure that pkey-0 is allocated on start and that it can be attached dynamically in various modes, without failures. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/protection_keys.c | 53

[PATCH v17 23/24] selftests/vm/pkeys: Override access right definitions on powerpc

2020-01-20 Thread Sandipan Das
From: Ram Pai Some platforms hardcode the x86 values for PKEY_DISABLE_ACCESS and PKEY_DISABLE_WRITE such as those in: /usr/include/bits/mman-shared.h. This overrides the definitions with correct values for powerpc. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by:

[PATCH v17 19/24] selftests/vm/pkeys: Associate key on a mapped page and detect write violation

2020-01-20 Thread Sandipan Das
From: Ram Pai Detect write-violation on a page to which write-disabled key is associated much after the page is mapped. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Acked-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/protection_keys.c | 12

[PATCH v17 06/24] selftests/vm/pkeys: Make gcc check arguments of sigsafe_printf()

2020-01-20 Thread Sandipan Das
From: Thiago Jung Bauermann This will help us ensure we print pkey_reg_t values correctly in different architectures. Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/pkey-helpers.h | 4 1 file changed, 4 insertions(+) diff --git

[PATCH v17 08/24] selftests: vm: pkeys: Add helpers for pkey bits

2020-01-20 Thread Sandipan Das
This introduces some functions that help with setting or clearing bits of a particular pkey. This also adds an abstraction for getting a pkey's bit position in the pkey register as this may vary across architectures. Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/pkey-helpers.h|

[PATCH v17 09/24] selftests/vm/pkeys: Fix pkey_disable_clear()

2020-01-20 Thread Sandipan Das
From: Ram Pai Currently, pkey_disable_clear() sets the specified bits instead clearing them. This has been dead code up to now because its only callers i.e. pkey_access/write_allow() are also unused. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Acked-by: Dave Hansen

[PATCH v17 14/24] selftests/vm/pkeys: Introduce powerpc support

2020-01-20 Thread Sandipan Das
From: Ram Pai This makes use of the abstractions added earlier and introduces support for powerpc. For powerpc, after receiving the SIGSEGV, the signal handler must explicitly restore access permissions for the faulting pkey to allow the test to continue. As this makes use of

[PATCH v17 24/24] selftests: vm: pkeys: Use the correct page size on powerpc

2020-01-20 Thread Sandipan Das
Both 4K and 64K pages are supported on powerpc. Parts of the selftest code perform alignment computations based on the PAGE_SIZE macro which is currently hardcoded to 64K for powerpc. This causes some test failures on kernels configured with 4K page size. In some cases, we need to enforce

[PATCH v17 15/24] selftests/vm/pkeys: Fix number of reserved powerpc pkeys

2020-01-20 Thread Sandipan Das
From: "Desnes A. Nunes do Rosario" The number of reserved pkeys in a PowerNV environment is different from that on PowerVM or KVM. Tested on PowerVM and PowerNV environments. Signed-off-by: "Desnes A. Nunes do Rosario" Signed-off-by: Ram Pai Signed-off-by: Sandipan Das ---

[PATCH v17 10/24] selftests/vm/pkeys: Fix assertion in pkey_disable_set/clear()

2020-01-20 Thread Sandipan Das
From: Ram Pai In some cases, a pkey's bits need not necessarily change in a way that the value of the pkey register increases when performing a pkey_disable_set() or decreases when performing a pkey_disable_clear(). For example, on powerpc, if a pkey's current state is PKEY_DISABLE_ACCESS and

[PATCH v17 21/24] selftests/vm/pkeys: Introduce a sub-page allocator

2020-01-20 Thread Sandipan Das
From: Ram Pai This introduces a new allocator that allocates 4K hardware pages to back 64K linux pages. This allocator is available only on powerpc. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Signed-off-by: Sandipan Das ---

[PATCH v17 18/24] selftests/vm/pkeys: Associate key on a mapped page and detect access violation

2020-01-20 Thread Sandipan Das
From: Ram Pai Detect access-violation on a page to which access-disabled key is associated much after the page is mapped. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Acked-by: Dave Hansen Signed-off: Sandipan Das --- tools/testing/selftests/vm/protection_keys.c | 19

[PATCH v17 03/24] selftests/vm/pkeys: Rename all references to pkru to a generic name

2020-01-20 Thread Sandipan Das
From: Ram Pai This renames PKRU references to "pkey_reg" or "pkey" based on the usage. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Reviewed-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/pkey-helpers.h|

[PATCH v17 12/24] selftests: vm: pkeys: Use the correct huge page size

2020-01-20 Thread Sandipan Das
The huge page size can vary across architectures. This will ensure that the correct huge page size is used when accessing the hugetlb controls under sysfs. Instead of using a hardcoded page size (i.e. 2MB), this now uses the HPAGE_SIZE macro which is arch-specific. Signed-off-by: Sandipan Das

[PATCH v17 04/24] selftests/vm/pkeys: Move generic definitions to header file

2020-01-20 Thread Sandipan Das
From: Ram Pai Moved all the generic definition and helper functions to the header file. cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Acked-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/pkey-helpers.h| 35

[PATCH v17 02/24] selftests: vm: pkeys: Fix multilib builds for x86

2020-01-20 Thread Sandipan Das
This ensures that both 32-bit and 64-bit binaries are generated when this is built on a x86_64 system. Most of the changes have been borrowed from tools/testing/selftests/x86/Makefile. Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/Makefile | 49 + 1 file

[PATCH v17 01/24] selftests/x86/pkeys: Move selftests to arch-neutral directory

2020-01-20 Thread Sandipan Das
From: Ram Pai cc: Dave Hansen cc: Florian Weimer Signed-off-by: Ram Pai Signed-off-by: Thiago Jung Bauermann Acked-by: Ingo Molnar Acked-by: Dave Hansen Signed-off-by: Sandipan Das --- tools/testing/selftests/vm/.gitignore | 1 + tools/testing/selftests/vm/Makefile

[PATCH v16 00/23] selftests, powerpc, x86: Memory Protection Keys

2020-01-20 Thread Sandipan Das
Memory protection keys enables an application to protect its address space from inadvertent access by its own code. This feature is now enabled on powerpc and has been available since 4.16-rc1. The patches move the selftests to arch neutral directory and enhance their test coverage. Tested on

Re: [PATCH v6 1/5] powerpc/mm: Implement set_memory() routines

2020-01-20 Thread Christophe Leroy
Le 24/12/2019 à 06:55, Russell Currey a écrit : The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX, and are generally useful primitives to have. This implementation is designed to be completely generic across powerpc's many MMUs. It's possible that this could be