Re: [PATCH V2] tools/perf/tests: Skip perf BPF test if clang is not present

2022-05-20 Thread Athira Rajeev
> On 14-May-2022, at 12:02 AM, Ian Rogers wrote: > > On Thu, May 12, 2022 at 11:16 PM Disha Goel > wrote: >> >> >> >> -Original Message- >> From: Athira Rajeev >> To: a...@kernel.org, jo...@kernel.org >> Cc: m...@ellerman.id.au, linux-perf-us...@vger.kernel.org, >>

Re: [PATCH V2] tools/perf/tests: Fix session topology test to skip the test in guest environment

2022-05-20 Thread Athira Rajeev
> On 14-May-2022, at 12:03 AM, Ian Rogers wrote: > > On Thu, May 12, 2022 at 11:18 PM Disha Goel > wrote: >> >> >> >> -Original Message- >> From: Athira Rajeev >> To: a...@kernel.org, jo...@kernel.org >> Cc: m...@ellerman.id.au, linux-perf-us...@vger.kernel.org, >>

[powerpc:merge] BUILD SUCCESS 56b3480a475656b67f52507c635b5c7113e74f9e

2022-05-20 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git merge branch HEAD: 56b3480a475656b67f52507c635b5c7113e74f9e powerpc/ci: Drop travis configuration elapsed time: 3831m configs tested: 107 configs skipped: 4 The following configs have been built successfully. More

Re: [PATCH net-next] eth: de4x5: remove support for Generic DECchip & DIGITAL EtherWORKS PCI/EISA

2022-05-20 Thread Benjamin Herrenschmidt
On Wed, 2022-05-18 at 20:13 -0700, Jakub Kicinski wrote: > Looks like almost all changes to this driver had been tree-wide > refactoring since git era begun. There is one commit from Al > 15 years ago which could potentially be fixing a real bug. > > The driver is using virt_to_bus() and is a

Re: [PATCH 2/2] drm/tiny: Add ofdrm for Open Firmware framebuffers

2022-05-20 Thread Benjamin Herrenschmidt
On Thu, 2022-05-19 at 09:27 +0200, Thomas Zimmermann wrote: > to build without PCI to see what happens. If you bring any of the "heuristic" and palette support code in, you need PCI. I don't see any reason to take it out. > Those old Macs use BootX, right? BootX is not supported ATM, as I don't

Re: [PATCH 2/2] drm/tiny: Add ofdrm for Open Firmware framebuffers

2022-05-20 Thread Benjamin Herrenschmidt
On Thu, 2022-05-19 at 09:11 +0200, Geert Uytterhoeven wrote: > Hi Michal, > > > > On Wed, May 18, 2022 at 8:54 PM Michal Suchánek > wrote: > > > On Wed, May 18, 2022 at 08:30:06PM +0200, Thomas Zimmermann wrote: > > > --- a/drivers/gpu/drm/tiny/Kconfig > > > +++ b/drivers/gpu/drm/tiny/Kconfig

Re: [RFC Linux patch] powerpc: add documentation for HWCAPs

2022-05-20 Thread Nicholas Piggin
Excerpts from Paul E Murphy's message of May 21, 2022 12:21 am: > > > On 5/20/22 12:15 AM, Nicholas Piggin via Gcc wrote: >> This takes the arm64 file and adjusts it for powerpc. Feature >> descriptions are vaguely handwaved by me. >> --- >> >> Anybody care to expand on or correct the meaning

Re: [PATCH] powerpc: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-20 Thread Rob Herring
On Thu, May 19, 2022 at 01:35:47AM +0530, Vaibhav Jain wrote: > Presently ima_get_kexec_buffer() doesn't check if the previous kernel's > ima-kexec-buffer lies outside the addressable memory range. This can result > in a kernel panic if the new kernel is booted with 'mem=X' arg and the >

Re: [PATCH 1/5] kallsyms: pass buffer size in sprint_* APIs

2022-05-20 Thread Waiman Long
On 5/20/22 04:36, Maninder Singh wrote: As of now sprint_* APIs don't pass buffer size as an argument and use sprintf directly. To replace dangerous sprintf API to scnprintf, buffer size is required in arguments. Co-developed-by: Onkarnath Signed-off-by: Onkarnath Signed-off-by: Maninder

Re: [PATCH] kexec_file: Drop weak attribute from arch_kexec_apply_relocations[_add]

2022-05-20 Thread Eric W. Biederman
Baoquan He writes: > On 05/19/22 at 12:59pm, Eric W. Biederman wrote: >> Baoquan He writes: >> >> > Hi Eric, >> > >> > On 05/18/22 at 04:59pm, Eric W. Biederman wrote: >> >> "Naveen N. Rao" writes: >> >> >> >> > Since commit d1bcae833b32f1 ("ELF: Don't generate unused section >> >> >

[PATCH v1 4/4] watchdog/pseries-wdt: initial support for PAPR H_WATCHDOG timers

2022-05-20 Thread Scott Cheloha
PAPR v2.12 defines a new hypercall, H_WATCHDOG. The hypercall permits guest control of one or more virtual watchdog timers. The timers have millisecond granularity. The guest is terminated when a timer expires. This patch adds a watchdog driver for these timers, "pseries-wdt".

[PATCH v1 3/4] powerpc/pseries: register pseries-wdt device with platform bus

2022-05-20 Thread Scott Cheloha
PAPR v2.12 defines a new hypercall, H_WATCHDOG. The hypercall permits guest control of one or more virtual watchdog timers. These timers do not conform to PowerPC device conventions. They are not affixed to any extant bus, nor do they have full representation in the device tree. As a

[PATCH v1 2/4] powerpc/pseries: add FW_FEATURE_WATCHDOG flag

2022-05-20 Thread Scott Cheloha
PAPR v2.12 specifies a new optional function set, "hcall-watchdog", for the /rtas/ibm,hypertas-functions property. The presence of this function set indicates support for the H_WATCHDOG hypercall. Check for this function set and, if present, set the new FW_FEATURE_WATCHDOG flag. Signed-off-by:

[PATCH v1 1/4] powerpc/pseries: hvcall.h: add H_WATCHDOG opcode, H_NOOP return code

2022-05-20 Thread Scott Cheloha
PAPR v2.12 defines a new hypercall, H_WATCHDOG. The hypercall permits guest control of one or more virtual watchdog timers. Add the opcode for the H_WATCHDOG hypercall to hvcall.h. While here, add a definition for H_NOOP, a possible return code for H_WATCHDOG. Signed-off-by: Scott Cheloha ---

[PATCH v1 0/4] pseries-wdt: initial support for PAPR virtual watchdog timers

2022-05-20 Thread Scott Cheloha
This series is preceded by two RFCs: RFC v1: https://lore.kernel.org/linux-watchdog/20220413165104.179144-1-chel...@linux.ibm.com/ RFC v2: https://lore.kernel.org/linux-watchdog/20220509174357.5448-1-chel...@linux.ibm.com/ Changes of note from RFC v2: - Separate platform device registration

Re: [PATCH V12 00/20] riscv: Add COMPAT mode support for 64BIT

2022-05-20 Thread Guo Ren
On Fri, May 20, 2022 at 1:50 AM Palmer Dabbelt wrote: > > On Tue, 05 Apr 2022 00:12:54 PDT (-0700), guo...@kernel.org wrote: > > From: Guo Ren > > > > Currently, most 64-bit architectures (x86, parisc, powerpc, arm64, > > s390, mips, sparc) have supported COMPAT mode. But they all have > >

Re: linux-next: changed messages in qemu boot

2022-05-20 Thread Naveen N. Rao
Stephen Rothwell wrote: Hi all, Today's linux-next bboot of the powerpc pseries_le_defconfig build produced these different kernel messages (diff from yesterday's tree): - ftrace: allocating 33658 entries in 13 pages - ftrace: allocated 13 pages with 3 groups + ftrace-powerpc: Address of

Re: [RFC Linux patch] powerpc: add documentation for HWCAPs

2022-05-20 Thread Segher Boessenkool
On Fri, May 20, 2022 at 09:21:43AM -0500, Paul E Murphy wrote: > >+PPC_FEATURE_HAS_ALTIVEC > >+Vector (aka Altivec, VSX) facility is available. > > I think "(aka Altivec, VSX)" might be more accurately stated as "(aka > Altivec)"? "Also known as AltiVec or VMX", yes. >

Re: [PATCH v1 1/4] powerpc/pseries: hvcall.h: add H_WATCHDOG opcode, H_NOOP return code

2022-05-20 Thread Guenter Roeck
On 5/20/22 10:20, Scott Cheloha wrote: PAPR v2.12 defines a new hypercall, H_WATCHDOG. The hypercall permits guest control of one or more virtual watchdog timers. Add the opcode for the H_WATCHDOG hypercall to hvcall.h. While here, add a definition for H_NOOP, a possible return code for

Re: [PATCH] net: fs_enet: sync rx dma buffer before reading

2022-05-20 Thread Jakub Kicinski
On Fri, 20 May 2022 12:54:56 + Christophe Leroy wrote: > Le 20/05/2022 à 14:35, Måns Rullgård a écrit : > > Christophe Leroy writes: > >> See original commit 070e1f01827c. It explicitely says that the cache > >> must be invalidate _AFTER_ the copy. > >> > >> The cache is initialy invalidated

[PATCH v1 4/4] watchdog/pseries-wdt: initial support for PAPR H_WATCHDOG timers

2022-05-20 Thread Scott Cheloha
PAPR v2.12 defines a new hypercall, H_WATCHDOG. The hypercall permits guest control of one or more virtual watchdog timers. The timers have millisecond granularity. The guest is terminated when a timer expires. This patch adds a watchdog driver for these timers, "pseries-wdt".

[PATCH v1 3/4] powerpc/pseries: register pseries-wdt device with platform bus

2022-05-20 Thread Scott Cheloha
PAPR v2.12 defines a new hypercall, H_WATCHDOG. The hypercall permits guest control of one or more virtual watchdog timers. These timers do not conform to PowerPC device conventions. They are not affixed to any extant bus, nor do they have full representation in the device tree. As a

[PATCH v1 2/4] powerpc/pseries: add FW_FEATURE_WATCHDOG flag

2022-05-20 Thread Scott Cheloha
PAPR v2.12 specifies a new optional function set, "hcall-watchdog", for the /rtas/ibm,hypertas-functions property. The presence of this function set indicates support for the H_WATCHDOG hypercall. Check for this function set and, if present, set the new FW_FEATURE_WATCHDOG flag. Signed-off-by:

[PATCH v1 1/4] powerpc/pseries: hvcall.h: add H_WATCHDOG opcode, H_NOOP return code

2022-05-20 Thread Scott Cheloha
PAPR v2.12 defines a new hypercall, H_WATCHDOG. The hypercall permits guest control of one or more virtual watchdog timers. Add the opcode for the H_WATCHDOG hypercall to hvcall.h. While here, add a definition for H_NOOP, a possible return code for H_WATCHDOG. Signed-off-by: Scott Cheloha ---

Re: [RFC Linux patch] powerpc: add documentation for HWCAPs

2022-05-20 Thread Peter Bergner
On 5/20/22 12:15 AM, Nicholas Piggin via Gcc wrote: > +PPC_FEATURE_HAS_ALTIVEC > +Vector (aka Altivec, VSX) facility is available. Slight typo. s/VSX/VMX/ Peter

Re: [PATCH] powerpc/64s: Don't read H_BLOCK_REMOVE characteristics in radix mode

2022-05-20 Thread Christophe Leroy
Le 20/05/2022 à 17:57, Laurent Dufour a écrit : > There is no need to read the H_BLOCK_REMOVE characteristics when running in > Radix mode because this hcall is never called. > > Signed-off-by: Laurent Dufour > --- > arch/powerpc/platforms/pseries/setup.c | 3 ++- > 1 file changed, 2

[PATCH] powerpc/64s: Don't read H_BLOCK_REMOVE characteristics in radix mode

2022-05-20 Thread Laurent Dufour
There is no need to read the H_BLOCK_REMOVE characteristics when running in Radix mode because this hcall is never called. Signed-off-by: Laurent Dufour --- arch/powerpc/platforms/pseries/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: [RFC Linux patch] powerpc: add documentation for HWCAPs

2022-05-20 Thread Paul E Murphy
On 5/20/22 12:15 AM, Nicholas Piggin via Gcc wrote: This takes the arm64 file and adjusts it for powerpc. Feature descriptions are vaguely handwaved by me. --- Anybody care to expand on or correct the meaning of these entries or bikeshed the wording of the intro? Many of them are no longer

Re: [PATCH RESEND] KVM: powerpc: remove extraneous asterisk from rm_host_ipi_action comment

2022-05-20 Thread Paolo Bonzini
Queued, thanks. Paolo

[PATCH] KVM: PPC: Kconfig: Fix indentation

2022-05-20 Thread Juerg Haefliger
The convention for indentation seems to be a single tab. Help text is further indented by an additional two whitespaces. Fix the lines that violate these rules. Signed-off-by: Juerg Haefliger --- arch/powerpc/kvm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH] powerpc/powernv: Kconfig: Replace single quotes

2022-05-20 Thread Juerg Haefliger
Replace single quotes with double quotes which seems to be the convention for strings. Signed-off-by: Juerg Haefliger --- arch/powerpc/platforms/powernv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/Kconfig

Re: [PATCH V2] tools/perf/test: Fix perf all PMU test to skip hv_24x7/hv_gpci tests on powerpc

2022-05-20 Thread Arnaldo Carvalho de Melo
Em Thu, May 19, 2022 at 11:45:07AM -0700, Ian Rogers escreveu: > On Thu, May 19, 2022 at 8:43 AM Athira Rajeev > wrote: > > > > "perf all PMU test" picks the input events from > > "perf list --raw-dump pmu" list and runs "perf stat -e" > > for each of the event in the list. In case of powerpc,

linux-next: changed messages in qemu boot

2022-05-20 Thread Stephen Rothwell
Hi all, Today's linux-next bboot of the powerpc pseries_le_defconfig build produced these different kernel messages (diff from yesterday's tree): - ftrace: allocating 33658 entries in 13 pages - ftrace: allocated 13 pages with 3 groups + ftrace-powerpc: Address of ftrace_regs_caller out of range

Re: [PATCH] net: fs_enet: sync rx dma buffer before reading

2022-05-20 Thread Christophe Leroy
Le 20/05/2022 à 14:35, Måns Rullgård a écrit : > Christophe Leroy writes: > >> Le 19/05/2022 à 21:24, Mans Rullgard a écrit : >>> The dma_sync_single_for_cpu() call must precede reading the received >>> data. Fix this. >> >> See original commit 070e1f01827c. It explicitely says that the cache

Re: [PATCH] net: fs_enet: sync rx dma buffer before reading

2022-05-20 Thread Måns Rullgård
Christophe Leroy writes: > Le 19/05/2022 à 21:24, Mans Rullgard a écrit : >> The dma_sync_single_for_cpu() call must precede reading the received >> data. Fix this. > > See original commit 070e1f01827c. It explicitely says that the cache > must be invalidate _AFTER_ the copy. > > The cache is

[PATCH] powerpc/vdso: Fix __kernel_sync_dicache sequence with coherent icache

2022-05-20 Thread Nicholas Piggin
Processors with coherent icache require the sequence sync ; icbi ; isync to entire store->execute coherency. icbi (to any address) must be executed to ensure isync flushes the pipeline. See "POWER9 Processor User's Manual, 4.6.2.2 Instruction Cache Block Invalidate (icbi)" for details.

Re: [PATCH net-next] eth: de4x5: remove support for Generic DECchip & DIGITAL EtherWORKS PCI/EISA

2022-05-20 Thread Arnd Bergmann
On Thu, May 19, 2022 at 4:13 AM Jakub Kicinski wrote: > > Looks like almost all changes to this driver had been tree-wide > refactoring since git era begun. There is one commit from Al > 15 years ago which could potentially be fixing a real bug. > > The driver is using virt_to_bus() and is a real

Re: [PATCH 11/12] powerpc: wiiu: don't enforce flat memory

2022-05-20 Thread Pali Rohár
+ linux-mm Do you know what are requirements for kernel to support non-contiguous memory support and what is needed to enable it for 32-bit powerpc? Currently powerpc arch code does not support "memblock.memory.cnt > 1" except for WII which seems like a hack... See below. On Friday 20 May 2022

Re: [PATCH] powerpc/vdso: Fix incorrect CFI in gettimeofday.S

2022-05-20 Thread Naveen N. Rao
Alan Modra wrote: On Tue, May 17, 2022 at 10:32:09PM +1000, Michael Ellerman wrote: "Naveen N. Rao" writes: > Michael Ellerman wrote: >> >> diff --git a/arch/powerpc/kernel/vdso/gettimeofday.S b/arch/powerpc/kernel/vdso/gettimeofday.S >> index eb9c81e1c218..0aee255e9cbb 100644 >> ---

Re: [RFC Linux patch] powerpc: add documentation for HWCAPs

2022-05-20 Thread Nicholas Piggin
Excerpts from Michael Ellerman's message of May 20, 2022 7:21 pm: > Nicholas Piggin via Libc-alpha writes: >> This takes the arm64 file and adjusts it for powerpc. Feature >> descriptions are vaguely handwaved by me. >> --- > > Thanks for attempting to document this. It was mainly copy and

Re: [PATCH 24/30] panic: Refactor the panic path

2022-05-20 Thread Guilherme G. Piccoli
On 19/05/2022 20:45, Baoquan He wrote: > [...] >> I really appreciate the summary skill you have, to convert complex >> problems in very clear and concise ideas. Thanks for that, very useful! >> I agree with what was summarized above. > > I want to say the similar words to Petr's reviewing

Re: [PATCH] powerpc: check previous kernel's ima-kexec-buffer against memory bounds

2022-05-20 Thread Michael Ellerman
Vaibhav Jain writes: > > [PATCH] powerpc: check previous kernel's ima-kexec-buffer against memory > bounds This isn't a powerpc patch, the subject should start with "of:". > Presently ima_get_kexec_buffer() doesn't check if the previous kernel's > ima-kexec-buffer lies outside the addressable

Re: [PATCH] kexec_file: Drop weak attribute from arch_kexec_apply_relocations[_add]

2022-05-20 Thread Baoquan He
On 05/19/22 at 12:59pm, Eric W. Biederman wrote: > Baoquan He writes: > > > Hi Eric, > > > > On 05/18/22 at 04:59pm, Eric W. Biederman wrote: > >> "Naveen N. Rao" writes: > >> > >> > Since commit d1bcae833b32f1 ("ELF: Don't generate unused section > >> > symbols") [1], binutils (v2.36+)

Re: [PATCH 11/12] powerpc: wiiu: don't enforce flat memory

2022-05-20 Thread Ash Logan
On 20/5/22 18:04, Pali Rohár wrote: > On Friday 20 May 2022 13:41:04 Ash Logan wrote: >> On 14/5/22 08:43, Pali Rohár wrote: >>> On Wednesday 02 March 2022 15:44:05 Ash Logan wrote: pgtable_32.c:mapin_ram loops over each valid memory range, which means non-contiguous memory just works.

Re: [PATCH net-next] eth: de4x5: remove support for Generic DECchip & DIGITAL EtherWORKS PCI/EISA

2022-05-20 Thread Michael Ellerman
Jakub Kicinski writes: > Looks like almost all changes to this driver had been tree-wide > refactoring since git era begun. There is one commit from Al > 15 years ago which could potentially be fixing a real bug. > > The driver is using virt_to_bus() and is a real magnet for pointless > cleanups.

Re: [PATCH] powerpc: Fix all occurences of "the the"

2022-05-20 Thread Michael Ellerman
Brian W Hart writes: > On Thu, May 19, 2022 at 12:26:29AM +1000, Michael Ellerman wrote: >> Rather than waiting for the bots to fix these one-by-one, fix all >> occurences of "the the" throughout arch/powerpc. ... >> diff --git a/arch/powerpc/platforms/chrp/setup.c >>

Re: [PATCH] powerpc/powernv/pci: Drop VF MPS fixup

2022-05-20 Thread Michael Ellerman
"Oliver O'Halloran" writes: > On Thu, May 19, 2022 at 10:38 PM Michael Ellerman wrote: >> Christophe Leroy writes: >> > Le 02/09/2020 à 05:51, Oliver O'Halloran a écrit : >> >> The MPS field in the VF config space is marked as reserved in current >> >> versions of the SR-IOV spec. In other

[PATCH V3] tools/perf/test: Fix perf all PMU test to skip hv_24x7/hv_gpci tests on powerpc

2022-05-20 Thread Athira Rajeev
"perf all PMU test" picks the input events from "perf list --raw-dump pmu" list and runs "perf stat -e" for each of the event in the list. In case of powerpc, the PowerVM environment supports events from hv_24x7 and hv_gpci PMU which is of example format like below: -

Re: [RFC Linux patch] powerpc: add documentation for HWCAPs

2022-05-20 Thread Michael Ellerman
Nicholas Piggin via Libc-alpha writes: > This takes the arm64 file and adjusts it for powerpc. Feature > descriptions are vaguely handwaved by me. > --- Thanks for attempting to document this. > Anybody care to expand on or correct the meaning of these entries or > bikeshed the wording of the

[PATCH V2 35/35] selftest/powerpc/pmu: Add test for hardware cache events

2022-05-20 Thread Athira Rajeev
From: Kajol Jain The testcase checks if the transalation of a generic hardware cache event is done properly via perf interface. The hardware cache events has type as PERF_TYPE_HW_CACHE and each event points to raw event code id. Testcase checks different combination of cache level, cache event

[PATCH V2 34/35] selftest/powerpc/pmu: Add selftest for group constraint check for MMCRA thresh_sel field

2022-05-20 Thread Athira Rajeev
From: Kajol Jain Thresh select bits in the event code is used to program thresh_sel field in Monitor Mode Control Register A (MMCRA: 45-47). When scheduling events as a group, all events in that group should match value in these bits. Otherwise event open for the sibling events will fail.

[PATCH V2 33/35] selftest/powerpc/pmu: Add selftest for group constraint check for MMCRA thresh_ctl field

2022-05-20 Thread Athira Rajeev
From: Kajol Jain Thresh control bits in the event code is used to program thresh_ctl field in Monitor Mode Control Register A (MMCRA: 48-55). When scheduling events as a group, all events in that group should match value in these bits. Otherwise event open for the sibling events will fail.

[PATCH V2 32/35] selftest/powerpc/pmu: Add selftest for group constraint for unit and pmc field in p9

2022-05-20 Thread Athira Rajeev
From: Kajol Jain Unit and pmu bits in the event code is used to program unit and pmc fields in Monitor Mode Control Register 1 (MMCR1). For power9 platform, incase unit field value is within 6 to 9, one of the event in the group should use PMC4. Otherwise event_open should fail for that group.

[PATCH V2 31/35] selftest/powerpc/pmu: Add selftest for group constraint check for MMCRA thresh_cmp field

2022-05-20 Thread Athira Rajeev
From: Kajol Jain Thresh compare bits for a event is used to program thresh compare field in Monitor Mode Control Register A (MMCRA: 9-18 bits for power9 and MMCRA: 8-18 bits for power10). When scheduling events as a group, all events in that group should match value in thresh compare bits.

[PATCH V2 30/35] selftest/powerpc/pmu: Add selftest for group constraint check for MMCR1 cache bits

2022-05-20 Thread Athira Rajeev
From: Kajol Jain Data and instruction cache qualifier bits in the event code is used to program cache select field in Monitor Mode Control Register 1 (MMCR1: 16-17). When scheduling events as a group, all events in that group should match value in these bits. Otherwise event open for the sibling

[PATCH V2 29/35] selftest/powerpc/pmu: Add selftest for group constraint check for MMCR0 l2l3_sel bits

2022-05-20 Thread Athira Rajeev
From: Kajol Jain In power10, L2L3 select bits in the event code is used to program l2l3_sel field in Monitor Mode Control Register 0 (MMCR0: 56-60). When scheduling events as a group, all events in that group should match value in these bits. Otherwise event open for the sibling events will

[PATCH V2 28/35] selftest/powerpc/pmu: Add selftest for PERF_TYPE_HARDWARE events valid check

2022-05-20 Thread Athira Rajeev
Testcase to ensure that using invalid event in generic event for PERF_TYPE_HARDWARE will fail. Invalid generic events in power10 are: - PERF_COUNT_HW_BUS_CYCLES - PERF_COUNT_HW_STALLED_CYCLES_FRONTEND - PERF_COUNT_HW_STALLED_CYCLES_BACKEND - PERF_COUNT_HW_REF_CPU_CYCLES Invalid generic events in

[PATCH V2 27/35] selftest/powerpc/pmu: Add selftest for event alternatives for power10

2022-05-20 Thread Athira Rajeev
Platform specific PMU supports alternative event for some of the event codes. During perf_event_open, it any event group doesn't match constraint check criteria, further lookup is done to find alternative event. Code checks to see if it is possible to schedule event as group using alternative

[PATCH V2 26/35] selftest/powerpc/pmu: Add selftest for event alternatives for power9

2022-05-20 Thread Athira Rajeev
Platform specific PMU supports alternative event for some of the event codes. During perf_event_open, it any event group doesn't match constraint check criteria, further lookup is done to find alternative event. Code checks to see if it is possible to schedule event as group using alternative

[PATCH V2 25/35] selftest/powerpc/pmu: Add selftest for blacklist events check in power9

2022-05-20 Thread Athira Rajeev
Some of the events are blacklisted in power9. The list of blacklisted events are noted in power9-events-list.h When trying to do event open for any of these blacklisted event will cause a failure. Testcase ensures that using blacklisted events will cause event_open to fail in power9. This test is

[PATCH V2 24/35] selftest/powerpc/pmu: Add selftest for reserved bit check for MMCRA thresh_ctl field

2022-05-20 Thread Athira Rajeev
Testcase for reserved bits in Monitor Mode Control Register A (MMCRA) thresh_ctl bits. For MMCRA[48:51]/[52:55]) Threshold Start/Stop, 0b/0b is reserved. Signed-off-by: Athira Rajeev --- .../powerpc/pmu/event_code_tests/Makefile | 2 +-

[PATCH V2 23/35] selftest/powerpc/pmu: Add selftest for checking invalid bits in event code

2022-05-20 Thread Athira Rajeev
Some of the bits in the event code is reserved for specific platforms. Event code bits 52-59 are reserved in power9, whereas in power10, these are used for programming Monitor Mode Control Register 3 (MMCR3). Bit 9 in event code is reserved in power9, whereas it is used for programming

[PATCH V2 22/35] selftest/powerpc/pmu: Add selftest for group constraint check MMCRA sample bits

2022-05-20 Thread Athira Rajeev
Events with different "sample" field values which is used to program Monitor Mode Control Register A (MMCRA) in a group will fail to schedule. Testcase uses event with load only sampling mode as group leader and event with store only sampling as sibling event. So that it can check that using

[PATCH V2 21/35] selftest/powerpc/pmu: Add selftest for group constraint for MMCRA Sampling Mode field

2022-05-20 Thread Athira Rajeev
Testcase for reserved bits in Monitor Mode Control Register A (MMCRA) Random Sampling Mode (SM) value. As per Instruction Set Architecture (ISA), the values 0x5, 0x9, 0xD, 0x19, 0x1D, 0x1A, 0x1E are reserved for sampling mode field. Test that having these reserved bit values should cause

[PATCH V2 20/35] selftest/powerpc/pmu: Add selftest for group constraint check for radix_scope_qual field

2022-05-20 Thread Athira Rajeev
Testcase for group constraint check for radix_scope_qual field which is used to program Monitor Mode Control Register (MMCR1) bit 18. All events in the group should match radix_scope_qual bit, otherwise event_open for the group should fail. Testcase uses "0x14242"

[PATCH V2 19/35] selftest/powerpc/pmu: Add selftest for group constraint check when using same PMC

2022-05-20 Thread Athira Rajeev
Testcase for group constraint check when using events with same PMC. Multiple events in a group asking for same PMC should fail. Testcase uses "0x22C040" on PMC2 as leader and also subling which is expected to fail. Using PMC1 for sibling event should pass the test. Signed-off-by: Athira Rajeev

[PATCH V2 18/35] selftest/powerpc/pmu: Add selftest to check constraint for number of counters in use.

2022-05-20 Thread Athira Rajeev
Testcase for group constraint check for number of counters in use. The number of programmable counters is from PMC1 to PMC4. Testcase uses four events with PMC1 to PMC4 and 5th event without any PMC which is expected to fail since it is exceeding the number of counters in use. Signed-off-by:

[PATCH V2 17/35] selftest/powerpc/pmu: Add selftest to check PMC5/6 is excluded from some constraint checks

2022-05-20 Thread Athira Rajeev
Events using Performance Monitor Counter 5 (PMC5) and Performance Monitor Counter 6 (PMC6) should be excluded from constraint check when scheduled along with group of events. Example, combination of PMC5, PMC6, and an event with cache bit will succeed to schedule though first two events doesn't

[PATCH V2 16/35] selftest/powerpc/pmu: Add selftest for group constraint check for PMC5 and PMC6

2022-05-20 Thread Athira Rajeev
Events using Performance Monitor Counter 5 (PMC5) and Performance Monitor Counter 6 (PMC6) can't have other fields in event code like cache bits, thresholding or marked bit. PMC5 and PMC6 only supports base events: ie 500fa and 600f4. Other combinations should fail. Testcase tries setting other

[PATCH V2 15/35] selftest/powerpc/pmu: Add support for perf event code tests

2022-05-20 Thread Athira Rajeev
Add new folder for enabling perf event code tests which includes checking for group constraints, valid/invalid events, also checks for event excludes, alternatives so on. A new folder "event_code_tests", is created under "selftests/powerpc/pmu". Also updates the corresponding Makefiles in

[PATCH V2 14/35] selftest/powerpc/pmu: Add interface test for bhrb disable field for non-branch samples

2022-05-20 Thread Athira Rajeev
From: Kajol Jain The testcase uses "instructions" event to generate the samples and fetch Monitor Mode Control Register A (MMCRA) when overflow. Branch History Rolling Buffer(bhrb) disable bit is part of MMCRA which need to be verified by perf interface. Incase sample is not of branch type, bhrb

[PATCH V2 13/35] selftest/powerpc/pmu: Add selftest for mmcr1 pmcxsel/unit/cache fields

2022-05-20 Thread Athira Rajeev
The testcase uses event code "0x21c040" to verify the settings for different fields in Monitor Mode Control Register 1 (MMCR1). The fields include PMCxSEL, PMCXCOMB PMCxUNIT, cache. Checks if these fields are translated correctly via perf interface to MMCR1 Signed-off-by: Athira Rajeev ---

[PATCH V2 12/35] selftest/powerpc/pmu: Add selftest for checking valid and invalid bhrb filter maps

2022-05-20 Thread Athira Rajeev
For PERF_SAMPLE_BRANCH_STACK sample type, different branch_sample_type, ie branch filters are supported. All the branch filters are not supported in powerpc. Example, power10 platform supports any, ind_call and cond branch filters. Whereas, it is different in power9. Testcase checks event open for

[PATCH V2 11/35] selftest/powerpc/pmu: Add selftest to check PERF_SAMPLE_REGS_INTR option will not crash on any platforms

2022-05-20 Thread Athira Rajeev
With sampling, --intr-regs option is used for capturing interrupt regs. When --intr-regs option is used, PMU code uses is_sier_available() function which uses PMU flags in the code. In environment where platform specific PMU is not registered, PMU flags is not defined. A fix was added in kernel to

[PATCH V2 10/35] selftest/powerpc/pmu: Add selftest to check branch stack enablement will not crash on any platforms

2022-05-20 Thread Athira Rajeev
While enabling branch stack for an event, BHRB (Branch History Rolling Buffer) filter is set using bhrb_filter_map() callback. This callback is not defined for cases like generic_compat_pmu or in case where there is no PMU registered. A fix was added in kernel to address a crash issue observed

[PATCH V2 09/35] selftest/powerpc/pmu: Refactor the platform check and add macros to find array size/PVR

2022-05-20 Thread Athira Rajeev
The platform check for selftest support "check_pvr_for_sampling_tests" is specific to sampling tests which includes PVR check, presence of PMU and extended regs support. Extended regs support is needed for sampling tests which tests whether PMU registers are programmed correctly. There could be

[PATCH V2 08/35] selftest/powerpc/pmu: Add interface test for bhrb disable field

2022-05-20 Thread Athira Rajeev
From: Kajol Jain The testcase uses "instructions" event to generate the samples and fetch Monitor Mode Control Register A (MMCRA) when overflow. Branch History Rolling Buffer(bhrb) disable bit is part of MMCRA which need to be verified by perf interface. Testcase checks if the bhrb disable bit

[PATCH V2 07/35] selftest/powerpc/pmu: Add interface test for mmcra_ifm field for conditional branch type

2022-05-20 Thread Athira Rajeev
From: Kajol Jain The testcase uses "instructions" event to check if the Instruction filtering mode(IFM) bits are programmed correctly for conditional branch type. Testcase checks if IFM bits is programmed correctly to Monitor Mode Control Register A (MMCRA) via perf interface for ISA v3.1

[PATCH V2 06/35] selftest/powerpc/pmu: Add interface test for mmcra_ifm field for any branch type

2022-05-20 Thread Athira Rajeev
From: Kajol Jain The testcase uses "instructions" event to check if the Instruction filtering mode(IFM) bits are programmed correctly for type any branch. Testcase checks if IFM bits is programmed correctly to Monitor Mode Control Register A (MMCRA) via perf interface. Signed-off-by: Kajol Jain

[PATCH V2 05/35] selftest/powerpc/pmu: Add interface test for mmcra_ifm field of indirect call type

2022-05-20 Thread Athira Rajeev
From: Kajol Jain The testcase uses "instructions" event to check if the Instruction filtering mode(IFM) bits are programmed correctly for indirect branch type. Testcase checks if IFM bits are programmed correctly to Monitor Mode Control Register A (MMCRA) via perf interface for ISA v3.1

[PATCH V2 04/35] selftest/powerpc/pmu: Add support for branch sampling in get_intr_regs function

2022-05-20 Thread Athira Rajeev
From: Kajol Jain Add support for sample type as PERF_SAMPLE_BRANCH_STACK in sampling tests. This change is a precursor/helper for sampling testcases, that test branck stack feature in perf interface. Signed-off-by: Kajol Jain --- .../powerpc/pmu/sampling_tests/misc.c | 21

[PATCH V2 03/35] selftest/powerpc/pmu: Add interface test for mmcra_thresh_cmp fields

2022-05-20 Thread Athira Rajeev
From: Kajol Jain The testcase uses event code 0x35340401e0 for load only sampling, to verify the settings of thresh compare field in Monitor Mode Control Register A (MMCRA: 9-18 bits for power9 and MMCRA: 8-18 bits for power10). Testcase checks if the thresh compare field is programmed correctly

[PATCH V2 02/35] testing/selftests/powerpc: Add support to fetch "platform" and "base platform" from auxv to detect platform.

2022-05-20 Thread Athira Rajeev
The /proc/self/auxv contains information about "platform" on any system. Also "base platform" which is an indication about platform string corresponding to the real PVR. When systems are booted in compat mode, say, power10 booted in power9 mode, "platform" will point to power9 whereas base

[PATCH V2 01/35] selftest/powerpc/pmu: Add mask/shift bits for extracting threshold compare field

2022-05-20 Thread Athira Rajeev
From: Kajol Jain In power10, threshold compare field is not part of the raw event code and provided via event attribute config1. Hence add the mask and shift bits based on event attribute config1, to extract the threshold compare value for power10 Also add a new function called

[PATCH V2 00/35] Add group constraints and event code test as part of selftest

2022-05-20 Thread Athira Rajeev
Patch series extends the perf interface selftests to cover scenarios for event code checking, group constraints, and also thresholding/branch related interface tests in sampling area. In this series, patches 1 to 14 adds additional tests under "powerpc/sampling_tests". These adds support for

[PATCH 4/5] kallsyms: pass buffer size argument in *lookup* APIs

2022-05-20 Thread Maninder Singh
Although *lookup* APIs are safe, but better to pass size as an argument rather than using define KSYM_NAME_LEN. Because it can cause issue if called with lesser array size. Co-developed-by: Onkarnath Signed-off-by: Onkarnath Signed-off-by: Maninder Singh --- arch/hexagon/kernel/traps.c

[PATCH 5/5] kallsyms: remove unsed API lookup_symbol_attrs

2022-05-20 Thread Maninder Singh
with commit '7878c231dae0 ("slab: remove /proc/slab_allocators")' lookup_symbol_attrs usage is removed. Thus removing redundant API. Signed-off-by: Maninder Singh --- include/linux/kallsyms.h | 6 -- include/linux/module.h | 6 -- kernel/kallsyms.c| 28

[PATCH V3 2/2] docs: ABI: sysfs-bus-event_source-devices: Document sysfs caps entry for PMU

2022-05-20 Thread Athira Rajeev
Details is added about "caps" attribute group in the ABI documentation. This is used to expose some of the PMU attributes in "caps" directory under : /sys/bus/event_source/devices//. The dev/caps will contain information about features that platform specific PMU supports. Signed-off-by: Athira

[PATCH V3 1/2] powerpc/perf: Add support for caps under sysfs in powerpc

2022-05-20 Thread Athira Rajeev
Add caps support under "/sys/bus/event_source/devices//" for powerpc. This directory can be used to expose some of the specific features that powerpc PMU supports to the user. Example: pmu_name. The name of PMU registered will depend on platform, say power9 or power10 or it could be Generic Compat

[PATCH 3/5] arch:hexagon/powerpc: use KSYM_NAME_LEN as array size

2022-05-20 Thread Maninder Singh
kallsyms_lookup which in turn calls for kallsyms_lookup_buildid() writes on index "KSYM_NAME_LEN - 1". Thus array size should be KSYM_NAME_LEN. for powerpc and hexagon it was defined as "128" directly. and commit '61968dbc2d5d' changed define value to 512, So both were missed to update with new

[PATCH 1/5] kallsyms: pass buffer size in sprint_* APIs

2022-05-20 Thread Maninder Singh
As of now sprint_* APIs don't pass buffer size as an argument and use sprintf directly. To replace dangerous sprintf API to scnprintf, buffer size is required in arguments. Co-developed-by: Onkarnath Signed-off-by: Onkarnath Signed-off-by: Maninder Singh --- arch/s390/lib/test_unwind.c|

[PATCH 2/5] kallsyms: replace sprintf with scnprintf

2022-05-20 Thread Maninder Singh
replace sprintf API with scnprintf which prevents buffer overflow. Co-developed-by: Onkarnath Signed-off-by: Onkarnath Signed-off-by: Maninder Singh --- kernel/kallsyms.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c

[PATCH 0/5] kallsyms: make kallsym APIs more safe with scnprintf

2022-05-20 Thread Maninder Singh
kallsyms functionality depends on KSYM_NAME_LEN directly. but if user passed array length lesser than it, sprintf can cause issues of buffer overflow attack. So changing *sprint* and *lookup* APIs in this patch set to have buffer size as an argument and replacing sprintf with scnprintf. patch 1

Re: [PATCH 11/12] powerpc: wiiu: don't enforce flat memory

2022-05-20 Thread Pali Rohár
On Friday 20 May 2022 13:41:04 Ash Logan wrote: > On 14/5/22 08:43, Pali Rohár wrote: > > On Wednesday 02 March 2022 15:44:05 Ash Logan wrote: > >> pgtable_32.c:mapin_ram loops over each valid memory range, which means > >> non-contiguous memory just works. > > > > Hello! Does it mean that

Re: [PATCH V2] tools/perf/test: Fix perf all PMU test to skip hv_24x7/hv_gpci tests on powerpc

2022-05-20 Thread Athira Rajeev
> On 20-May-2022, at 12:15 AM, Ian Rogers wrote: > > On Thu, May 19, 2022 at 8:43 AM Athira Rajeev > wrote: >> >> "perf all PMU test" picks the input events from >> "perf list --raw-dump pmu" list and runs "perf stat -e" >> for each of the event in the list. In case of powerpc, the >>

Re: [PATCH 2/2] drm/tiny: Add ofdrm for Open Firmware framebuffers

2022-05-20 Thread Javier Martinez Canillas
Hello Thomas, On 5/18/22 20:30, Thomas Zimmermann wrote: > > +config DRM_OFDRM > + tristate "Open Firmware display driver" > + depends on DRM && MMU && PPC Shouldn't depend on OF? I mean, is a DRM driver for Open Firmware after all :) I know that the old drivers/video/fbdev/offb.c

Re: [PATCH V2 1/2] powerpc/perf: Add support for caps under sysfs in powerpc

2022-05-20 Thread Athira Rajeev
> On 20-May-2022, at 3:06 AM, Ian Rogers wrote: > > On Thu, May 19, 2022 at 4:29 AM Athira Rajeev > wrote: >> >>> On 19-May-2022, at 10:12 AM, Ian Rogers wrote: >>> >>> On Wed, May 18, 2022 at 1:55 AM Athira Rajeev >>> wrote: Add caps support under