Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Qian Cai
> On Jan 28, 2020, at 1:13 AM, Christophe Leroy wrote: > > ppc32 an indecent / legacy platform ? Are you kidying ? > > Powerquicc II PRO for instance is fully supported by the manufacturer and > widely used in many small networking devices. Of course I forgot about embedded devices. The

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Qian Cai
> On Jan 28, 2020, at 2:03 AM, Anshuman Khandual > wrote: > > 'allyesconfig' makes 'DEBUG_VM = y' which in turn will enable > 'DEBUG_VM_PGTABLE = y' > on platforms that subscribe ARCH_HAS_DEBUG_VM_PGTABLE. Isn’t that only for compiling testing? Who is booting such a beast and make sure

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Anshuman Khandual
On 01/28/2020 12:06 PM, Qian Cai wrote: > > >> On Jan 28, 2020, at 1:17 AM, Christophe Leroy >> wrote: >> >> It is 'default y' so there is no much risk that it is forgotten, at least >> all test suites run with 'allyes_defconfig' will trigger the test, so I >> think it is really a good

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Qian Cai
> On Jan 28, 2020, at 1:17 AM, Christophe Leroy wrote: > > It is 'default y' so there is no much risk that it is forgotten, at least all > test suites run with 'allyes_defconfig' will trigger the test, so I think it > is really a good feature. This thing depends on DEBUG_VM which I don’t

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Christophe Leroy
Le 28/01/2020 à 06:48, Qian Cai a écrit : On Jan 27, 2020, at 11:58 PM, Anshuman Khandual wrote: As I had mentioned before, the test attempts to formalize page table helper semantics as expected from generic MM code paths and intend to catch deviations when enabled on a given

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

2020-01-27 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of least

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

2020-01-27 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of least

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Christophe Leroy
Le 28/01/2020 à 04:33, Qian Cai a écrit : On Jan 27, 2020, at 10:06 PM, Anshuman Khandual wrote: On 01/28/2020 07:41 AM, Qian Cai wrote: On Jan 27, 2020, at 8:28 PM, Anshuman Khandual wrote: This adds tests which will validate architecture page table helpers and other accessors

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

2020-01-27 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of least

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

2020-01-27 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of least

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

2020-01-27 Thread Alexey Budankov
Open access to bpf_trace monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of

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

2020-01-27 Thread Alexey Budankov
Open access to i915_perf monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of

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

2020-01-27 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. CAP_PERFMON implements

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

2020-01-27 Thread Alexey Budankov
Open access to monitoring via kprobes and uprobes and eBPF tracing for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. perf

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

2020-01-27 Thread Alexey Budankov
Open access to monitoring of kernel code, cpus, tracepoints and namespaces data for a CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more

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

2020-01-27 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 performance monitoring and observability subsystems. CAP_PERFMON hardens system security and

[PATCH v6 00/10] Introduce CAP_PERFMON to secure system performance monitoring and observability

2020-01-27 Thread Alexey Budankov
Currently access to perf_events, i915_perf and other performance monitoring and observability subsystems of the kernel is open only 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

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Qian Cai
> On Jan 27, 2020, at 11:58 PM, Anshuman Khandual > wrote: > > As I had mentioned before, the test attempts to formalize page table helper > semantics > as expected from generic MM code paths and intend to catch deviations when > enabled on > a given platform. How else should we test

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Anshuman Khandual
On 01/28/2020 09:03 AM, Qian Cai wrote: > > >> On Jan 27, 2020, at 10:06 PM, Anshuman Khandual >> wrote: >> >> >> >> On 01/28/2020 07:41 AM, Qian Cai wrote: >>> >>> On Jan 27, 2020, at 8:28 PM, Anshuman Khandual wrote: This adds tests which will validate architecture

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Qian Cai
> On Jan 27, 2020, at 10:06 PM, Anshuman Khandual > wrote: > > > > On 01/28/2020 07:41 AM, Qian Cai wrote: >> >> >>> On Jan 27, 2020, at 8:28 PM, Anshuman Khandual >>> wrote: >>> >>> This adds tests which will validate architecture page table helpers and >>> other accessors in their

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Anshuman Khandual
On 01/28/2020 07:41 AM, Qian Cai wrote: > > >> On Jan 27, 2020, at 8:28 PM, Anshuman Khandual >> wrote: >> >> This adds tests which will validate architecture page table helpers and >> other accessors in their compliance with expected generic MM semantics. >> This will help various

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Qian Cai
> On Jan 27, 2020, at 8:28 PM, Anshuman Khandual > wrote: > > This adds tests which will validate architecture page table helpers and > other accessors in their compliance with expected generic MM semantics. > This will help various architectures in validating changes to existing > page

[PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-27 Thread Anshuman Khandual
This adds tests which will validate architecture page table helpers and other accessors in their compliance with expected generic MM semantics. This will help various architectures in validating changes to existing page table helpers or addition of new ones. This test covers basic page table

Re: [PATCH] powerpc/64: system call implement the bulk of the logic in C fix

2020-01-27 Thread Nicholas Piggin
Michal Suchánek's on January 28, 2020 4:08 am: > On Tue, Jan 28, 2020 at 12:17:12AM +1000, Nicholas Piggin wrote: >> This incremental patch fixes several soft-mask debug and unsafe >> smp_processor_id messages due to tracing and false positives in >> "unreconciled" code. >> >> It also fixes a bug

[PATCH] powerpc/64: system call implement the bulk of the logic in C fix 2 (tabort_syscall)

2020-01-27 Thread Nicholas Piggin
Another incremental patch which fixes silly tabort_syscall bug that causes kernel crashes when making system calls in transactional state. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/entry_64.S | 9 +++-- arch/powerpc/kernel/syscall_64.c | 4 ++-- 2 files changed, 5

[PATCH v2] powerpc/32s: reorder Linux PTE bits to better match Hash PTE bits.

2020-01-27 Thread Christophe Leroy
Reorder Linux PTE bits to (almost) match Hash PTE bits. RW Kernel : PP = 00 RO Kernel : PP = 00 RW User : PP = 01 RO User : PP = 11 So naturally, we should have _PAGE_USER = 0x001 _PAGE_RW = 0x002 Today 0x001 and 0x002 and _PAGE_PRESENT and _PAGE_HASHPTE which both are software only bits.

Re: [PATCH] powerpc/64: system call implement the bulk of the logic in C fix

2020-01-27 Thread Michal Suchánek
On Tue, Jan 28, 2020 at 12:17:12AM +1000, Nicholas Piggin wrote: > This incremental patch fixes several soft-mask debug and unsafe > smp_processor_id messages due to tracing and false positives in > "unreconciled" code. > > It also fixes a bug with syscall tracing functions that set registers >

Re: [PATCH] of: Add OF_DMA_DEFAULT_COHERENT & select it on powerpc

2020-01-27 Thread Frank Rowand
+ Frank (me) On 1/26/20 5:52 AM, Michael Ellerman wrote: > There's an OF helper called of_dma_is_coherent(), which checks if a > device has a "dma-coherent" property to see if the device is coherent > for DMA. > > But on some platforms devices are coherent by default, and on some > platforms

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

2020-01-27 Thread Dave Hansen
On 1/27/20 2:11 AM, Sandipan Das wrote: > Hi Dave, > > On 23/01/20 12:15 am, Dave Hansen wrote: >> Still doesn't build for me: >> > I have this patch that hopefully fixes this. My understanding was > that the vm tests are supposed to be generic but this has quite a > bit of x86-specific

[RFC] per-CPU usage in perf core-book3s

2020-01-27 Thread Sebastian Andrzej Siewior
I've been looking at usage of per-CPU variable cpu_hw_events in arch/powerpc/perf/core-book3s.c. power_pmu_enable() and power_pmu_disable() (pmu::pmu_enable() and pmu::pmu_disable()) are accessing the variable and the callbacks are invoked always with disabled interrupts. power_pmu_event_init()

[PATCH] powerpc/64: system call implement the bulk of the logic in C fix

2020-01-27 Thread Nicholas Piggin
This incremental patch fixes several soft-mask debug and unsafe smp_processor_id messages due to tracing and false positives in "unreconciled" code. It also fixes a bug with syscall tracing functions that set registers (e.g., PTRACE_SETREG) not setting GPRs properly. There was a bug reported

RE: [PATCH] bus: fsl-mc: add api to retrieve mc version

2020-01-27 Thread Laurentiu Tudor
> -Original Message- > From: Andrei Botila > Sent: Monday, January 27, 2020 1:16 PM > > Add a new api that returns Management Complex firmware version > and make the required structure public. The api's first user will be > the caam driver for setting prediction resistance bits. > >

[PATCH] bus: fsl-mc: add api to retrieve mc version

2020-01-27 Thread Andrei Botila
Add a new api that returns Management Complex firmware version and make the required structure public. The api's first user will be the caam driver for setting prediction resistance bits. Signed-off-by: Andrei Botila --- drivers/bus/fsl-mc/fsl-mc-bus.c | 33 +

[PATCH] powerpc/32s: Fix CPU wake-up from sleep mode

2020-01-27 Thread Christophe Leroy
Commit f7354ccac844 ("powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU") broke the CPU wake-up from sleep mode (i.e. when _TLF_SLEEPING is set) by delaying the tovirt(r2, r2). This is because r2 is not restored by fast_exception_return. It used to work (by chance ?) because CPU wake-up

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

2020-01-27 Thread Sandipan Das
Hi Dave, On 23/01/20 12:15 am, Dave Hansen wrote: > Still doesn't build for me: > I have this patch that hopefully fixes this. My understanding was that the vm tests are supposed to be generic but this has quite a bit of x86-specific conditional code which complicates things even though it is

Re: [PATCH v4 7/9] parisc/perf: open access for CAP_SYS_PERFMON privileged process

2020-01-27 Thread Helge Deller
On 18.12.19 10:29, Alexey Budankov wrote: > > Open access to monitoring for CAP_SYS_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