LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2] powerpc/pci: unmap legacy INTx interrupts when a PHB is removed
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: Michael Ellerman, Cédric Le Goater
  Cc: Alexey Kardashevskiy, Oliver O'Halloran, linuxppc-dev
In-Reply-To: <20200807101854.844619-1-clg@kaod.org>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

On Fri, 7 Aug 2020 12:18:54 +0200, Cédric Le Goater wrote:
> When a passthrough IO adapter is removed from a pseries machine using
> hash MMU and the XIVE interrupt mode, the POWER hypervisor expects the
> guest OS to clear all page table entries related to the adapter. If
> some are still present, the RTAS call which isolates the PCI slot
> returns error 9001 "valid outstanding translations" and the removal of
> the IO adapter fails. This is because when the PHBs are scanned, Linux
> maps automatically the INTx interrupts in the Linux interrupt number
> space but these are never removed.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/pci: unmap legacy INTx interrupts when a PHB is removed
      https://git.kernel.org/powerpc/c/3a3181e16fbde752007759f8759d25e0ff1fc425

cheers

^ permalink raw reply

* Re: [PATCH -next] macintosh: windfarm: use for_each_child_of_node() macro
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Qinglang Miao; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20200914061411.3356-1-miaoqinglang@huawei.com>

On Mon, 14 Sep 2020 14:14:11 +0800, Qinglang Miao wrote:
> Use for_each_child_of_node() macro instead of open coding it.

Applied to powerpc/next.

[1/1] macintosh: windfarm: use for_each_child_of_node() macro
      https://git.kernel.org/powerpc/c/8f7e57e8e29c4fc788811dd4db96126272b8df91

cheers

^ permalink raw reply

* Re: [PATCH 0/5] powerpc/tau: TAU driver fixes
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	Finn Thain
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <cover.1599260540.git.fthain@telegraphics.com.au>

On Sat, 05 Sep 2020 09:02:20 +1000, Finn Thain wrote:
> This patch series fixes various bugs in the Thermal Assist Unit driver.
> It was tested on 266 MHz and 292 MHz PowerBook G3 laptops.
> 
> 
> Finn Thain (5):
>   powerpc/tau: Use appropriate temperature sample interval
>   powerpc/tau: Convert from timer to workqueue
>   powerpc/tau: Remove duplicated set_thresholds() call
>   powerpc/tau: Check processor type before enabling TAU interrupt
>   powerpc/tau: Disable TAU between measurements
> 
> [...]

Applied to powerpc/next.

[1/5] powerpc/tau: Use appropriate temperature sample interval
      https://git.kernel.org/powerpc/c/66943005cc41f48e4d05614e8f76c0ca1812f0fd
[2/5] powerpc/tau: Convert from timer to workqueue
      https://git.kernel.org/powerpc/c/b1c6a0a10bfaf36ec82fde6f621da72407fa60a1
[3/5] powerpc/tau: Remove duplicated set_thresholds() call
      https://git.kernel.org/powerpc/c/420ab2bc7544d978a5d0762ee736412fe9c796ab
[4/5] powerpc/tau: Check processor type before enabling TAU interrupt
      https://git.kernel.org/powerpc/c/5e3119e15fed5b9a9a7e528665ff098a4a8dbdbc
[5/5] powerpc/tau: Disable TAU between measurements
      https://git.kernel.org/powerpc/c/e63d6fb5637e92725cf143559672a34b706bca4f

cheers

^ permalink raw reply

* Re: [PATCH] powerpc/powernv/idle: add a basic stop 0-3 driver for POWER10
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev
  Cc: Gautham R . Shenoy, Michael Neuling, Ryan P Grimm,
	Pratik Rajesh Sampat
In-Reply-To: <20200819094700.493399-1-npiggin@gmail.com>

On Wed, 19 Aug 2020 19:47:00 +1000, Nicholas Piggin wrote:
> This driver does not restore stop > 3 state, so it limits itself
> to states which do not lose full state or TB.
> 
> The POWER10 SPRs are sufficiently different from P9 that it seems
> easier to split out the P10 code. The POWER10 deep sleep code
> (e.g., the BHRB restore) has been taken out, but it can be re-added
> when stop > 3 support is added.

Applied to powerpc/next.

[1/1] powerpc/powernv/idle: add a basic stop 0-3 driver for POWER10
      https://git.kernel.org/powerpc/c/ffd2961bb41f797eb00b58e019b707555197275e

cheers

^ permalink raw reply

* Re: [PATCH v6 0/8] powerpc/watchpoint: Bug fixes plus new feature flag
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: Ravi Bangoria, christophe.leroy, mpe
  Cc: mikey, jniethe5, pedromfc, linux-kernel, paulus, rogealve,
	naveen.n.rao, linuxppc-dev
In-Reply-To: <20200902042945.129369-1-ravi.bangoria@linux.ibm.com>

On Wed, 2 Sep 2020 09:59:37 +0530, Ravi Bangoria wrote:
> Patch #1 fixes issue for quardword instruction on p10 predecessors.
> Patch #2 fixes issue for vector instructions.
> Patch #3 fixes a bug about watchpoint not firing when created with
>          ptrace PPC_PTRACE_SETHWDEBUG and CONFIG_HAVE_HW_BREAKPOINT=N.
>          The fix uses HW_BRK_TYPE_PRIV_ALL for ptrace user which, I
>          guess, should be fine because we don't leak any kernel
>          addresses and PRIV_ALL will also help to cover scenarios when
>          kernel accesses user memory.
> Patch #4,#5 fixes infinite exception bug, again the bug happens only
>          with CONFIG_HAVE_HW_BREAKPOINT=N.
> Patch #6 fixes two places where we are missing to set hw_len.
> Patch #7 introduce new feature bit PPC_DEBUG_FEATURE_DATA_BP_ARCH_31
>          which will be set when running on ISA 3.1 compliant machine.
> Patch #8 finally adds selftest to test scenarios fixed by patch#2,#3
>          and also moves MODE_EXACT tests outside of BP_RANGE condition.
> 
> [...]

Applied to powerpc/next.

[1/8] powerpc/watchpoint: Fix quadword instruction handling on p10 predecessors
      https://git.kernel.org/powerpc/c/4759c11ed20454b7b36db4ec15f7d5aa1519af4a
[2/8] powerpc/watchpoint: Fix handling of vector instructions
      https://git.kernel.org/powerpc/c/4441eb02333a9b46a0d919aa7a6d3b137b5f2562
[3/8] powerpc/watchpoint/ptrace: Fix SETHWDEBUG when CONFIG_HAVE_HW_BREAKPOINT=N
      https://git.kernel.org/powerpc/c/9b6b7c680cc20971444d9f836e49fc98848bcd0a
[4/8] powerpc/watchpoint: Move DAWR detection logic outside of hw_breakpoint.c
      https://git.kernel.org/powerpc/c/edc8dd99b29e4d705c45e2a3a6c01b096ee056db
[5/8] powerpc/watchpoint: Fix exception handling for CONFIG_HAVE_HW_BREAKPOINT=N
      https://git.kernel.org/powerpc/c/5b905d77987de065bdd3a2906816b5f143df087b
[6/8] powerpc/watchpoint: Add hw_len wherever missing
      https://git.kernel.org/powerpc/c/58da5984d2ea6d95f3f9d9e8dd9f7e1b0dddfb3c
[7/8] powerpc/watchpoint/ptrace: Introduce PPC_DEBUG_FEATURE_DATA_BP_ARCH_31
      https://git.kernel.org/powerpc/c/fa725cc53d353110f39a9e5b9f60d6acb2c7ff49
[8/8] selftests/powerpc: Tests for kernel accessing user memory
      https://git.kernel.org/powerpc/c/ac234524056da4e0c081f682da3ea25cdaab737a

cheers

^ permalink raw reply

* Re: [PATCH v2 1/2] sched/topology: Allow archs to override cpu_smt_mask
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: Michael Ellerman, Srikar Dronamraju
  Cc: Ingo Molnar, Gautham R Shenoy, Michael Neuling, Vincent Guittot,
	Peter Zijlstra, linuxppc-dev, LKML, Valentin Schneider,
	Mel Gorman, Dietmar Eggemann
In-Reply-To: <20200807074517.27957-1-srikar@linux.vnet.ibm.com>

On Fri, 7 Aug 2020 13:15:16 +0530, Srikar Dronamraju wrote:
> cpu_smt_mask tracks topology_sibling_cpumask. This would be good for
> most architectures. One of the users of cpu_smt_mask(), would be to
> identify idle-cores. On Power9, a pair of SMT4 cores can be presented by
> the firmware as a SMT8 core for backward compatibility reasons.
> 
> Powerpc allows LPARs to be live migrated from Power8 to Power9. Do note
> Power8 had only SMT8 cores. Existing software which has been
> developed/configured for Power8 would expect to see SMT8 core.
> Maintaining the illusion of SMT8 core is a requirement to make that
> work.
> 
> [...]

Applied to powerpc/next.

[1/2] sched/topology: Allow archs to override cpu_smt_mask
      https://git.kernel.org/powerpc/c/3babbe447d76ac2919ec4d0eb3b0adfb22f5b03c
[2/2] powerpc/topology: Override cpu_smt_mask
      https://git.kernel.org/powerpc/c/f3232321db58480804f80d59aeb651a5c859a200

cheers

^ permalink raw reply

* Re: [PATCH v3] powerpc/numa: Restrict possible nodes based on platform
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: Michael Ellerman, Srikar Dronamraju
  Cc: Nathan Lynch, Tyrel Datwyler, linuxppc-dev, Bharata B Rao
In-Reply-To: <20200817055257.110873-1-srikar@linux.vnet.ibm.com>

On Mon, 17 Aug 2020 11:22:57 +0530, Srikar Dronamraju wrote:
> As per draft LoPAPR (Revision 2.9_pre7), section B.5.3 "Run Time Abstaction
> Services (RTAS) Node at
> https://openpowerfoundation.org/wp-content/uploads/2020/07/LoPAR-20200611.pdf,
> there are 2 device tree property ibm,max-associativity-domains (which
> defines the maximum number of domains that the firmware i.e PowerVM can
> support) and ibm,current-associativity-domains (which defines the maximum
> number of domains that the platform can support). Value of
> ibm,max-associativity-domains property is always greater than or equal to
> ibm,current-associativity-domains property. If the said property is not
> available, use ibm,max-associativity-domain as fallback. In this yet to be
> released LoPAPR, ibm,current-associativity-domains is mentioned in page 833
> / B.5.3 which is covered under under "Appendix B. System Binding" section
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/numa: Restrict possible nodes based on platform
      https://git.kernel.org/powerpc/c/67df77845c181166d4bc324cbb0382f7e81c7631

cheers

^ permalink raw reply

* Re: [PATCH v5 00/10] Coregroup support on Powerpc
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: Michael Ellerman, Srikar Dronamraju
  Cc: Nathan Lynch, Gautham R Shenoy, Oliver OHalloran, Michael Neuling,
	Michael Ellerman, Peter Zijlstra, Jordan Niethe, Anton Blanchard,
	LKML, Ingo Molnar, Nick Piggin, linuxppc-dev, Valentin Schneider
In-Reply-To: <20200810071834.92514-1-srikar@linux.vnet.ibm.com>

On Mon, 10 Aug 2020 12:48:24 +0530, Srikar Dronamraju wrote:
> Changelog v4->v5:
> v4: http://lore.kernel.org/lkml/20200727053230.19753-1-srikar@linux.vnet.ibm.com/t/#u
> 
> Changelog v4 ->v5:
> powerpc/smp: Optimize start_secondary
> 	Retain cache domain, no need for generalization
> 		 (Michael Ellerman, Peter Zijlstra,
> 		 Valentin Schneider, Gautham R. Shenoy)
> 
> [...]

Applied to powerpc/next.

[01/10] powerpc/smp: Fix a warning under !NEED_MULTIPLE_NODES
        https://git.kernel.org/powerpc/c/d0fd24bbd27619d7b8d4da26a19a2027931ae9fc
[02/10] powerpc/smp: Merge Power9 topology with Power topology
        https://git.kernel.org/powerpc/c/2ef0ca54d97f40f7621d595ac5479bd7fa076bfa
[03/10] powerpc/smp: Move powerpc_topology above
        https://git.kernel.org/powerpc/c/5e93f16ae48b728775496429c6db53d0bf8cdd9b
[04/10] powerpc/smp: Move topology fixups into a new function
        https://git.kernel.org/powerpc/c/3c6032a8fe99547d31b2b57715e303a67d1b0c66
[05/10] powerpc/smp: Dont assume l2-cache to be superset of sibling
        https://git.kernel.org/powerpc/c/f6606cfdfbcda00ce8a6e63c8fc13c93e73ac059
[06/10] powerpc/smp: Optimize start_secondary
        https://git.kernel.org/powerpc/c/caa8e29da59926bef099b46ab6280333d583e944
[07/10] powerpc/numa: Detect support for coregroup
        https://git.kernel.org/powerpc/c/f9f130ff2ec93c5949576bbfb168cc9530c23649
[08/10] powerpc/smp: Allocate cpumask only after searching thread group
        https://git.kernel.org/powerpc/c/6e086302816b2ced602bc99641eb0189c05f018a
[09/10] powerpc/smp: Create coregroup domain
        https://git.kernel.org/powerpc/c/72730bfc2a2b91a525f38dfc830f598bdb95f216
[10/10] powerpc/smp: Implement cpu_to_coregroup_id
        https://git.kernel.org/powerpc/c/fa35e868f9ddcbb7984fd5ab7f91aef924fa8543

cheers

^ permalink raw reply

* Re: [PATCH v6 0/3] Offline memoryless cpuless node 0
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: Michael Ellerman, Srikar Dronamraju
  Cc: Gautham R Shenoy, Michal Hocko, David Hildenbrand, linuxppc-dev,
	linux-mm, Satheesh Rajendran, Mel Gorman, Aneesh Kumar K V,
	Andrew Morton, Linus Torvalds, Christopher Lameter,
	Vlastimil Babka
In-Reply-To: <20200818081104.57888-1-srikar@linux.vnet.ibm.com>

On Tue, 18 Aug 2020 13:41:01 +0530, Srikar Dronamraju wrote:
> Changelog v5:->v6:
> - Now the fix is Powerpc specific.
> 	(David Hildenbrand, Michal Hocko, Christopher Lamater)
> - rebased to v5.8
> link v5: https://lore.kernel.org/linuxppc-dev/20200624092846.9194-1-srikar@linux.vnet.ibm.com/t/#u
> 
> Changelog v4:->v5:
> - rebased to v5.8
> link v4: http://lore.kernel.org/lkml/20200512132937.19295-1-srikar@linux.vnet.ibm.com/t/#u
> 
> [...]

Applied to powerpc/next.

[1/3] powerpc/numa: Set numa_node for all possible cpus
      https://git.kernel.org/powerpc/c/a874f1005ef5dfe53dfd8cda59a6600e89986ecd
[2/3] powerpc/numa: Prefer node id queried from vphn
      https://git.kernel.org/powerpc/c/6398eaa268168b528dd1d3d0e70e61e9c13bea23
[3/3] powerpc/numa: Offline memoryless cpuless node 0
      https://git.kernel.org/powerpc/c/e75130f20b1f48e04ccc806aea01f0a361f9cb6b

cheers

^ permalink raw reply

* Re: [PATCH v2] powerpc/papr_scm: Fix warning triggered by perf_stats_show()
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: linux-nvdimm, linuxppc-dev, Vaibhav Jain; +Cc: Aneesh Kumar K . V
In-Reply-To: <20200912081451.66225-1-vaibhav@linux.ibm.com>

On Sat, 12 Sep 2020 13:44:51 +0530, Vaibhav Jain wrote:
> 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
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/papr_scm: Fix warning triggered by perf_stats_show()
      https://git.kernel.org/powerpc/c/ca78ef2f08ccfa29b711d644964cdf9d7ace15e5

cheers

^ permalink raw reply

* Re: [PATCH -next] drivers/macintosh/smu.c: Fix undeclared symbol warning
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: Wang Wensheng, gustavoars, linuxppc-dev, benh, linux-kernel
In-Reply-To: <20200914122615.65669-1-wangwensheng4@huawei.com>

On Mon, 14 Sep 2020 12:26:15 +0000, Wang Wensheng wrote:
> Make kernel with `C=2`:
> drivers/macintosh/smu.c:1018:30: warning: symbol
> '__smu_get_sdb_partition' was not declared. Should it be static?

Applied to powerpc/next.

[1/1] drivers/macintosh/smu.c: Fix undeclared symbol warning
      https://git.kernel.org/powerpc/c/3db8715ec9dc1d32ecafc67af9fb96508c98efe5

cheers

^ permalink raw reply

* Re: [PATCH] powerpc/ps3: make two symbols static
From: Michael Ellerman @ 2020-09-17 11:27 UTC (permalink / raw)
  To: Jason Yan, geoff, mpe, paulus, linuxppc-dev, benh, linux-kernel
  Cc: Hulk Robot
In-Reply-To: <20200911020121.1464585-1-yanaijie@huawei.com>

On Fri, 11 Sep 2020 10:01:21 +0800, Jason Yan wrote:
> This addresses the following sparse warning:
> 
> arch/powerpc/platforms/ps3/spu.c:451:33: warning: symbol
> 'spu_management_ps3_ops' was not declared. Should it be static?
> arch/powerpc/platforms/ps3/spu.c:592:28: warning: symbol
> 'spu_priv1_ps3_ops' was not declared. Should it be static?

Applied to powerpc/next.

[1/1] powerpc/ps3: make two symbols static
      https://git.kernel.org/powerpc/c/bbc4f40b5322b3e0b8678619f1c613dadc811669

cheers

^ permalink raw reply

* [Bug 209297] New: powerpc: MPC10X_BRIDGE violates Kconfig dependency of PPC_INDIRECT_PCI on PCI
From: bugzilla-daemon @ 2020-09-17 11:28 UTC (permalink / raw)
  To: linuxppc-dev

https://bugzilla.kernel.org/show_bug.cgi?id=209297

            Bug ID: 209297
           Summary: powerpc: MPC10X_BRIDGE violates Kconfig dependency of
                    PPC_INDIRECT_PCI on PCI
           Product: Platform Specific/Hardware
           Version: 2.5
    Kernel Version: 5.9-rc4
          Hardware: PPC-32
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: PPC-32
          Assignee: platform_ppc-32@kernel-bugs.osdl.org
          Reporter: fazilyildiran@gmail.com
                CC: mpe@ellerman.id.au, paulus@samba.org
        Regression: No

The commit 25635c71e441 ("ppc: Use the indirect_pci.c from
arch/powerpc/sysdev")
introduced PPC_INDIRECT_PCI as a non-visible config that depends on PCI. 

Since it is non-visible, the dependency on PCI has no implications other
than leading to Kbuild build warnings if !PCI. For example, disabling PCI
and enabling LINKSTATION leads to the following Kbuild warning since
PPC_INDIRECT_PCI is selected by MPC10X_BRIDGE, which is selected by
LINKSTATION:

WARNING: unmet direct dependencies detected for PPC_INDIRECT_PCI
  Depends on [n]: PCI [=n]
  Selected by [y]:
  - MPC10X_BRIDGE [=y]

There are many other configs that select PPC_INDIRECT_PCI but they seem
to enable PCI one way or another, e.g., enabling FORCE_PCI or selecting
PPC_INDIRECT_PCI if PCI. Among them, only MPC10X_BRIDGE and MV64X60 seem
to not account for the dependency on PCI, and MV64X60 seem to be obsolete:
https://bugzilla.kernel.org/show_bug.cgi?id=209277

I am not sure about the internals of the user subsystem. However, two fix
options I see are: 1) --select FORCE_PCI-- by MPC10X_BRIDGE, 2) select
PPC_INDIRECT_PCI --if PCI-- by MPC10X_BRIDGE.

Thanks,
Necip

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply

* Re: [PATCH] powerpc/64: Make VDSO32 track COMPAT on 64-bit
From: Michael Ellerman @ 2020-09-17 11:28 UTC (permalink / raw)
  To: linuxppc-dev, Michael Ellerman; +Cc: christophe.leroy, msuchanek
In-Reply-To: <20200908125850.407939-1-mpe@ellerman.id.au>

On Tue, 8 Sep 2020 22:58:50 +1000, Michael Ellerman wrote:
> When we added the VDSO32 kconfig symbol, which controls building of
> the 32-bit VDSO, we made it depend on CPU_BIG_ENDIAN (for 64-bit).
> 
> That was because back then COMPAT was always enabled for 64-bit, so
> depending on it would have left the 32-bit VDSO always enabled, which
> we didn't want.
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/64: Make VDSO32 track COMPAT on 64-bit
      https://git.kernel.org/powerpc/c/231b232df8f67e7d37af01259c21f2a131c3911e

cheers

^ permalink raw reply

* Re: [PATCH v2] powerpc: fix EDEADLOCK redefinition error in uapi/asm/errno.h
From: Michael Ellerman @ 2020-09-17 11:55 UTC (permalink / raw)
  To: Tony Ambardar
  Cc: linux-arch, Tony Ambardar, Arnd Bergmann, linux-kernel,
	Paul Mackerras, Rosen Penev, bpf, linuxppc-dev
In-Reply-To: <20200917000757.1232850-1-Tony.Ambardar@gmail.com>

[ Cc += linux-arch & Arnd ]

Hi Tony,

This looks OK to me, but I'm always a bit nervous about changes in uapi.
I've Cc'ed linux-arch and Arnd who look after the asm-generic headers,
which this is slightly related to, just in case.

One minor comment below.

Tony Ambardar <tony.ambardar@gmail.com> writes:
> A few archs like powerpc have different errno.h values for macros
> EDEADLOCK and EDEADLK. In code including both libc and linux versions of
> errno.h, this can result in multiple definitions of EDEADLOCK in the
> include chain. Definitions to the same value (e.g. seen with mips) do
> not raise warnings, but on powerpc there are redefinitions changing the
> value, which raise warnings and errors (if using "-Werror").
>
> Guard against these redefinitions to avoid build errors like the following,
> first seen cross-compiling libbpf v5.8.9 for powerpc using GCC 8.4.0 with
> musl 1.1.24:
>
>   In file included from ../../arch/powerpc/include/uapi/asm/errno.h:5,
>                    from ../../include/linux/err.h:8,
>                    from libbpf.c:29:
>   ../../include/uapi/asm-generic/errno.h:40: error: "EDEADLOCK" redefined [-Werror]
>    #define EDEADLOCK EDEADLK
>
>   In file included from toolchain-powerpc_8540_gcc-8.4.0_musl/include/errno.h:10,
>                    from libbpf.c:26:
>   toolchain-powerpc_8540_gcc-8.4.0_musl/include/bits/errno.h:58: note: this is the location of the previous definition
>    #define EDEADLOCK       58
>
>   cc1: all warnings being treated as errors
>
> Fixes: 95f28190aa01 ("tools include arch: Grab a copy of errno.h for arch's supported by perf")
> Fixes: c3617f72036c ("UAPI: (Scripted) Disintegrate arch/powerpc/include/asm")

I suspect that's not the right commit to tag. It just moved errno.h from
arch/powerpc/include/asm to arch/powerpc/include/uapi/asm. It's content
was almost identical, and entirely identical as far as EDEADLOCK was
concerned.

Prior to that the file lived in asm-powerpc/errno.h, eg:

$ git cat-file -p b8b572e1015f^:include/asm-powerpc/errno.h

Before that it was include/asm-ppc64/errno.h, content still the same.

To go back further we'd have to look at the historical git trees, which
is probably overkill. I'm pretty sure it's always had this problem.

So we should probably drop the Fixes tags and just Cc: stable, that
means please backport it as far back as possible.

cheers


> Reported-by: Rosen Penev <rosenp@gmail.com>
> Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
> ---
> v1 -> v2:
>  * clean up commit description formatting
> ---
>  arch/powerpc/include/uapi/asm/errno.h       | 1 +
>  tools/arch/powerpc/include/uapi/asm/errno.h | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/include/uapi/asm/errno.h b/arch/powerpc/include/uapi/asm/errno.h
> index cc79856896a1..4ba87de32be0 100644
> --- a/arch/powerpc/include/uapi/asm/errno.h
> +++ b/arch/powerpc/include/uapi/asm/errno.h
> @@ -2,6 +2,7 @@
>  #ifndef _ASM_POWERPC_ERRNO_H
>  #define _ASM_POWERPC_ERRNO_H
>  
> +#undef	EDEADLOCK
>  #include <asm-generic/errno.h>
>  
>  #undef	EDEADLOCK
> diff --git a/tools/arch/powerpc/include/uapi/asm/errno.h b/tools/arch/powerpc/include/uapi/asm/errno.h
> index cc79856896a1..4ba87de32be0 100644
> --- a/tools/arch/powerpc/include/uapi/asm/errno.h
> +++ b/tools/arch/powerpc/include/uapi/asm/errno.h
> @@ -2,6 +2,7 @@
>  #ifndef _ASM_POWERPC_ERRNO_H
>  #define _ASM_POWERPC_ERRNO_H
>  
> +#undef	EDEADLOCK
>  #include <asm-generic/errno.h>
>  
>  #undef	EDEADLOCK
> -- 
> 2.25.1

^ permalink raw reply

* Re: [PATCH -next] ide: Fix symbol undeclared warnings
From: Michael Ellerman @ 2020-09-17 12:01 UTC (permalink / raw)
  To: Wang Wensheng, davem, benh, paulus, linux-ide, linuxppc-dev,
	linux-kernel
In-Reply-To: <20200916092333.77158-1-wangwensheng4@huawei.com>

Wang Wensheng <wangwensheng4@huawei.com> writes:
> Build the object file with `C=2` and get the following warnings:
> make allmodconfig ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu-
> make C=2 drivers/ide/pmac.o ARCH=powerpc64
> CROSS_COMPILE=powerpc64-linux-gnu-
>
> drivers/ide/pmac.c:228:23: warning: symbol 'mdma_timings_33' was not
> declared. Should it be static?
> drivers/ide/pmac.c:241:23: warning: symbol 'mdma_timings_33k' was not
> declared. Should it be static?
> drivers/ide/pmac.c:254:23: warning: symbol 'mdma_timings_66' was not
> declared. Should it be static?
> drivers/ide/pmac.c:272:3: warning: symbol 'kl66_udma_timings' was not
> declared. Should it be static?
> drivers/ide/pmac.c:1418:12: warning: symbol 'pmac_ide_probe' was not
> declared. Should it be static?
>
> Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
> ---
>  drivers/ide/pmac.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

TIL davem maintains IDE?

But I suspect he isn't that interested in this powerpc only driver, so
I'll grab this.

cheers


> diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
> index ea0b064b5f56..6bb2fc6755c2 100644
> --- a/drivers/ide/pmac.c
> +++ b/drivers/ide/pmac.c
> @@ -225,7 +225,7 @@ struct mdma_timings_t {
>  	int	cycleTime;
>  };
>  
> -struct mdma_timings_t mdma_timings_33[] =
> +static struct mdma_timings_t mdma_timings_33[] =
>  {
>      { 240, 240, 480 },
>      { 180, 180, 360 },
> @@ -238,7 +238,7 @@ struct mdma_timings_t mdma_timings_33[] =
>      {   0,   0,   0 }
>  };
>  
> -struct mdma_timings_t mdma_timings_33k[] =
> +static struct mdma_timings_t mdma_timings_33k[] =
>  {
>      { 240, 240, 480 },
>      { 180, 180, 360 },
> @@ -251,7 +251,7 @@ struct mdma_timings_t mdma_timings_33k[] =
>      {   0,   0,   0 }
>  };
>  
> -struct mdma_timings_t mdma_timings_66[] =
> +static struct mdma_timings_t mdma_timings_66[] =
>  {
>      { 240, 240, 480 },
>      { 180, 180, 360 },
> @@ -265,7 +265,7 @@ struct mdma_timings_t mdma_timings_66[] =
>  };
>  
>  /* KeyLargo ATA-4 Ultra DMA timings (rounded) */
> -struct {
> +static struct {
>  	int	addrSetup; /* ??? */
>  	int	rdy2pause;
>  	int	wrDataSetup;
> @@ -1415,7 +1415,7 @@ static struct pci_driver pmac_ide_pci_driver = {
>  };
>  MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match);
>  
> -int __init pmac_ide_probe(void)
> +static int __init pmac_ide_probe(void)
>  {
>  	int error;
>  
> -- 
> 2.25.0

^ permalink raw reply

* Re: [PATCH] powerpc/perf: Exclude pmc5/6 from the irrelevant PMU group constraints
From: Michael Ellerman @ 2020-09-17 12:13 UTC (permalink / raw)
  To: Athira Rajeev; +Cc: maddy, linuxppc-dev
In-Reply-To: <1600257900-2043-1-git-send-email-atrajeev@linux.vnet.ibm.com>

Athira Rajeev <atrajeev@linux.vnet.ibm.com> writes:
> PMU counter support functions enforces event constraints for group of
> events to check if all events in a group can be monitored. Incase of
> event codes using PMC5 and PMC6 ( 500fa and 600f4 respectively ),
> not all constraints are applicable, say the threshold or sample bits.
> But current code includes pmc5 and pmc6 in some group constraints (like
> IC_DC Qualifier bits) which is actually not applicable and hence results
> in those events not getting counted when scheduled along with group of
> other events. Patch fixes this by excluding PMC5/6 from constraints
> which are not relevant for it.
>
> Fixes: 7ffd948 ('powerpc/perf: factor out power8 pmu functions')
> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
> ---
>  arch/powerpc/perf/isa207-common.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/powerpc/perf/isa207-common.c b/arch/powerpc/perf/isa207-common.c
> index 964437a..186fad8 100644
> --- a/arch/powerpc/perf/isa207-common.c
> +++ b/arch/powerpc/perf/isa207-common.c
> @@ -288,6 +288,9 @@ int isa207_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp)
>  
>  		mask  |= CNST_PMC_MASK(pmc);
>  		value |= CNST_PMC_VAL(pmc);
> +
> +		if (pmc >= 5)
> +			goto ebb_bhrb;

This is fairly subtle. Can you please put a block comment above the if
explaining in a few lines what's going on.

cheers

^ permalink raw reply

* Re: [PATCH 1/3] powerpc/mce: remove nmi_enter/exit from real mode handler
From: Michal Suchánek @ 2020-09-17 12:20 UTC (permalink / raw)
  To: Ganesh Goudar; +Cc: linuxppc-dev, npiggin, mahesh
In-Reply-To: <20200916172228.83271-2-ganeshgr@linux.ibm.com>

Hello,

On Wed, Sep 16, 2020 at 10:52:26PM +0530, Ganesh Goudar wrote:
> Use of nmi_enter/exit in real mode handler causes the kernel to panic
> and reboot on injecting slb mutihit on pseries machine running in hash
> mmu mode, As these calls try to accesses memory outside RMO region in
> real mode handler where translation is disabled.
> 
> Add check to not to use these calls on pseries machine running in hash
> mmu mode.
> 
> Fixes: 116ac378bb3f ("powerpc/64s: machine check interrupt update NMI accounting")
> Signed-off-by: Ganesh Goudar <ganeshgr@linux.ibm.com>
> ---
>  arch/powerpc/kernel/mce.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c
> index ada59f6c4298..1d42fe0f5f9c 100644
> --- a/arch/powerpc/kernel/mce.c
> +++ b/arch/powerpc/kernel/mce.c
> @@ -591,10 +591,15 @@ EXPORT_SYMBOL_GPL(machine_check_print_event_info);
>  long notrace machine_check_early(struct pt_regs *regs)
>  {
>  	long handled = 0;
> -	bool nested = in_nmi();
> +	bool nested;
> +	bool is_pseries_hpt_guest;
>  	u8 ftrace_enabled = this_cpu_get_ftrace_enabled();
>  
>  	this_cpu_set_ftrace_enabled(0);
> +	is_pseries_hpt_guest = machine_is(pseries) &&
> +			       mmu_has_feature(MMU_FTR_HPTE_TABLE);
> +	/* Do not use nmi_enter/exit for pseries hpte guest */
> +	nested = is_pseries_hpt_guest ? true : in_nmi();
As pointed out already in another comment nesting is supported natively
since 69ea03b56ed2c7189ccd0b5910ad39f3cad1df21. You can simply do
nmi_enter and nmi_exit unconditionally - or only based on
is_pseries_hpt_guest.

The other question is what is the value of calling nmi_enter here at
all. It crashes in one case, we simply skip it for that case, and we are
good. Maybe we could skip it altogether?

Thanks

Michal

^ permalink raw reply

* Re: [PATCH v2 6/7] powerpc/perf: Remove unused variable 'target' in trace_imc_event_init()
From: Athira Rajeev @ 2020-09-17 12:20 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: Christophe Leroy, anju@linux.vnet.ibm.com, linuxppc-dev
In-Reply-To: <20200914211007.2285999-7-clg@kaod.org>



> On 15-Sep-2020, at 2:40 AM, Cédric Le Goater <clg@kaod.org> wrote:
> 
> This fixes a compile error with W=1.
> 
> CC      arch/powerpc/perf/imc-pmu.o
> ../arch/powerpc/perf/imc-pmu.c: In function ‘trace_imc_event_init’:
> ../arch/powerpc/perf/imc-pmu.c:1429:22: error: variable ‘target’ set but not used [-Werror=unused-but-set-variable]
>  struct task_struct *target;
>                      ^~~~~~
> 
> Cc: Anju T Sudhakar <anju@linux.vnet.ibm.com>
> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
> arch/powerpc/perf/imc-pmu.c | 3 ---
> 1 file changed, 3 deletions(-)
> 
> diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
> index 62d0b54086f8..9ed4fcccf8a9 100644
> --- a/arch/powerpc/perf/imc-pmu.c
> +++ b/arch/powerpc/perf/imc-pmu.c
> @@ -1426,8 +1426,6 @@ static void trace_imc_event_del(struct perf_event *event, int flags)
> 
> static int trace_imc_event_init(struct perf_event *event)
> {
> -	struct task_struct *target;
> -
> 	if (event->attr.type != event->pmu->type)
> 		return -ENOENT;
> 
> @@ -1458,7 +1456,6 @@ static int trace_imc_event_init(struct perf_event *event)
> 	mutex_unlock(&imc_global_refc.lock);
> 
> 	event->hw.idx = -1;
> -	target = event->hw.target;

Reviewed-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>

Thanks
Athira
> 
> 	event->pmu->task_ctx_nr = perf_hw_context;
> 	event->destroy = reset_global_refc;
> -- 
> 2.25.4
> 


^ permalink raw reply

* Re: [PATCH 2/3] powerpc/mce: Add debugfs interface to inject MCE
From: Michal Suchánek @ 2020-09-17 12:23 UTC (permalink / raw)
  To: Ganesh Goudar; +Cc: linuxppc-dev, npiggin, mahesh
In-Reply-To: <20200916172228.83271-3-ganeshgr@linux.ibm.com>

Hello,

On Wed, Sep 16, 2020 at 10:52:27PM +0530, Ganesh Goudar wrote:
> To test machine check handling, add debugfs interface to inject
> slb multihit errors.
> 
> To inject slb multihit:
>  #echo 1 > /sys/kernel/debug/powerpc/mce_error_inject/inject_slb_multihit
> 
> Signed-off-by: Ganesh Goudar <ganeshgr@linux.ibm.com>
> Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
> ---
>  arch/powerpc/Kconfig.debug             |   9 ++
>  arch/powerpc/sysdev/Makefile           |   2 +
>  arch/powerpc/sysdev/mce_error_inject.c | 148 +++++++++++++++++++++++++
>  3 files changed, 159 insertions(+)
>  create mode 100644 arch/powerpc/sysdev/mce_error_inject.c
> 
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> index b88900f4832f..61db133f2f0d 100644
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -398,3 +398,12 @@ config KASAN_SHADOW_OFFSET
>  	hex
>  	depends on KASAN
>  	default 0xe0000000
> +
> +config MCE_ERROR_INJECT
> +	bool "Enable MCE error injection through debugfs"
> +	depends on DEBUG_FS
> +	default y
> +	help
> +	  This option creates an mce_error_inject directory in the
> +	  powerpc debugfs directory that allows limited injection of
> +	  Machine Check Errors (MCEs).
> diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
> index 026b3f01a991..7fc102222b77 100644
> --- a/arch/powerpc/sysdev/Makefile
> +++ b/arch/powerpc/sysdev/Makefile
> @@ -52,3 +52,5 @@ obj-$(CONFIG_PPC_XICS)		+= xics/
>  obj-$(CONFIG_PPC_XIVE)		+= xive/
>  
>  obj-$(CONFIG_GE_FPGA)		+= ge/
> +
> +obj-$(CONFIG_MCE_ERROR_INJECT)	+= mce_error_inject.o
> diff --git a/arch/powerpc/sysdev/mce_error_inject.c b/arch/powerpc/sysdev/mce_error_inject.c
> new file mode 100644
> index 000000000000..ca4726bfa2d9
> --- /dev/null
> +++ b/arch/powerpc/sysdev/mce_error_inject.c
> @@ -0,0 +1,148 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Machine Check Exception injection code
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/slab.h>
> +#include <linux/vmalloc.h>
> +#include <linux/fs.h>
> +#include <linux/debugfs.h>
> +#include <asm/debugfs.h>
> +
> +static inline unsigned long get_slb_index(void)
> +{
> +	unsigned long index;
> +
> +	index = get_paca()->stab_rr;
> +
> +	/*
> +	 * simple round-robin replacement of slb starting at SLB_NUM_BOLTED.
> +	 */
> +	if (index < (mmu_slb_size - 1))
> +		index++;
> +	else
> +		index = SLB_NUM_BOLTED;
> +	get_paca()->stab_rr = index;
> +	return index;
> +}
> +
> +#define slb_esid_mask(ssize)	\
> +	(((ssize) == MMU_SEGSIZE_256M) ? ESID_MASK : ESID_MASK_1T)
> +
> +static inline unsigned long mk_esid_data(unsigned long ea, int ssize,
> +					 unsigned long slot)
> +{
> +	return (ea & slb_esid_mask(ssize)) | SLB_ESID_V | slot;
> +}
> +
> +#define slb_vsid_shift(ssize)	\
> +	((ssize) == MMU_SEGSIZE_256M ? SLB_VSID_SHIFT : SLB_VSID_SHIFT_1T)
> +
> +static inline unsigned long mk_vsid_data(unsigned long ea, int ssize,
> +					 unsigned long flags)
> +{
> +	return (get_kernel_vsid(ea, ssize) << slb_vsid_shift(ssize)) | flags |
> +		((unsigned long)ssize << SLB_VSID_SSIZE_SHIFT);
> +}
> +
> +static void insert_slb_entry(char *p, int ssize)
> +{
> +	unsigned long flags, entry;
> +	struct paca_struct *paca;
> +
> +	flags = SLB_VSID_KERNEL | mmu_psize_defs[MMU_PAGE_64K].sllp;
> +
> +	preempt_disable();
> +
> +	paca = get_paca();
This seems unused?
> +
> +	entry = get_slb_index();
> +	asm volatile("slbmte %0,%1" :
> +			: "r" (mk_vsid_data((unsigned long)p, ssize, flags)),
> +			  "r" (mk_esid_data((unsigned long)p, ssize, entry))
> +			: "memory");
> +
> +	entry = get_slb_index();
> +	asm volatile("slbmte %0,%1" :
> +			: "r" (mk_vsid_data((unsigned long)p, ssize, flags)),
> +			  "r" (mk_esid_data((unsigned long)p, ssize, entry))
> +			: "memory");
> +	preempt_enable();
> +	p[0] = '!';
> +}
> +
> +static void inject_vmalloc_slb_multihit(void)
> +{
> +	char *p;
> +
> +	p = vmalloc(2048);
> +	if (!p)
> +		return;
> +
> +	insert_slb_entry(p, MMU_SEGSIZE_1T);
> +	vfree(p);
> +}
> +
> +static void inject_kmalloc_slb_multihit(void)
> +{
> +	char *p;
> +
> +	p = kmalloc(2048, GFP_KERNEL);
> +	if (!p)
> +		return;
> +
> +	insert_slb_entry(p, MMU_SEGSIZE_1T);
> +	kfree(p);
> +}
> +
> +static ssize_t inject_slb_multihit(const char __user *u_buf, size_t count)
> +{
> +	char buf[32];
> +	size_t buf_size;
> +
> +	buf_size = min(count, (sizeof(buf) - 1));
> +	if (copy_from_user(buf, u_buf, buf_size))
> +		return -EFAULT;
> +	buf[buf_size] = '\0';
> +
> +	if (buf[0] != '1')
> +		return -EINVAL;
> +
> +	inject_vmalloc_slb_multihit();
> +	inject_kmalloc_slb_multihit();
This is missing the test of multihit in paca which is for some reason
special.

Thanks

Michal
> +	return count;
> +}
> +
> +static ssize_t inject_write(struct file *file, const char __user *buf,
> +			    size_t count, loff_t *ppos)
> +{
> +	static ssize_t (*func)(const char __user *, size_t);
> +
> +	func = file->f_inode->i_private;
> +	return func(buf, count);
> +}
> +
> +static const struct file_operations inject_fops = {
> +	.write		= inject_write,
> +	.llseek		= default_llseek,
> +};
> +
> +static int mce_error_inject_setup(void)
> +{
> +	struct dentry *mce_error_inject_dir;
> +
> +	mce_error_inject_dir = debugfs_create_dir("mce_error_inject",
> +						  powerpc_debugfs_root);
> +
> +	if (mmu_has_feature(MMU_FTR_HPTE_TABLE)) {
> +		(void)debugfs_create_file("inject_slb_multihit", 0200,
> +					  mce_error_inject_dir,
> +					  &inject_slb_multihit,
> +					  &inject_fops);
> +	}
> +
> +	return 0;
> +}
> +
> +device_initcall(mce_error_inject_setup);
> -- 
> 2.26.2
> 

^ permalink raw reply

* Re: [PATCH 0/3] powerpc/mce: Fix mce handler and add selftest
From: Michal Suchánek @ 2020-09-17 12:29 UTC (permalink / raw)
  To: Ganesh Goudar; +Cc: linuxppc-dev, npiggin, mahesh
In-Reply-To: <20200916172228.83271-1-ganeshgr@linux.ibm.com>

Hello,

On Wed, Sep 16, 2020 at 10:52:25PM +0530, Ganesh Goudar wrote:
> This patch series fixes mce handling for pseries, provides debugfs
> interface for mce injection and adds selftest to test mce handling
> on pseries/powernv machines running in hash mmu mode.
> debugfs interface and sleftest are added only for slb multihit
> injection, We can add other tests in future if possible.
> 
> Ganesh Goudar (3):
>   powerpc/mce: remove nmi_enter/exit from real mode handler
>   powerpc/mce: Add debugfs interface to inject MCE
>   selftest/powerpc: Add slb multihit selftest

Is the below logic sound? It does not agree with what is added here:

void machine_check_exception(struct pt_regs *regs)
{
	int recover = 0;

	/*
	 * BOOK3S_64 does not call this handler as a non-maskable interrupt
	 * (it uses its own early real-mode handler to handle the MCE proper
	 * and then raises irq_work to call this handler when interrupts are
	 * enabled).
	 *
	 * This is silly. The BOOK3S_64 should just call a different function
	 * rather than expecting semantics to magically change. Something
	 * like 'non_nmi_machine_check_exception()', perhaps?
	 */
	const bool nmi = !IS_ENABLED(CONFIG_PPC_BOOK3S_64);

	if (nmi) nmi_enter();

Thanks

Michal

^ permalink raw reply

* Re: [PATCH] powerpc/perf: Exclude pmc5/6 from the irrelevant PMU group constraints
From: Athira Rajeev @ 2020-09-17 13:01 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: maddy, linuxppc-dev
In-Reply-To: <87wo0sob28.fsf@mpe.ellerman.id.au>



> On 17-Sep-2020, at 5:43 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> 
> Athira Rajeev <atrajeev@linux.vnet.ibm.com> writes:
>> PMU counter support functions enforces event constraints for group of
>> events to check if all events in a group can be monitored. Incase of
>> event codes using PMC5 and PMC6 ( 500fa and 600f4 respectively ),
>> not all constraints are applicable, say the threshold or sample bits.
>> But current code includes pmc5 and pmc6 in some group constraints (like
>> IC_DC Qualifier bits) which is actually not applicable and hence results
>> in those events not getting counted when scheduled along with group of
>> other events. Patch fixes this by excluding PMC5/6 from constraints
>> which are not relevant for it.
>> 
>> Fixes: 7ffd948 ('powerpc/perf: factor out power8 pmu functions')
>> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
>> ---
>> arch/powerpc/perf/isa207-common.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>> 
>> diff --git a/arch/powerpc/perf/isa207-common.c b/arch/powerpc/perf/isa207-common.c
>> index 964437a..186fad8 100644
>> --- a/arch/powerpc/perf/isa207-common.c
>> +++ b/arch/powerpc/perf/isa207-common.c
>> @@ -288,6 +288,9 @@ int isa207_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp)
>> 
>> 		mask  |= CNST_PMC_MASK(pmc);
>> 		value |= CNST_PMC_VAL(pmc);
>> +
>> +		if (pmc >= 5)
>> +			goto ebb_bhrb;
> 
> This is fairly subtle. Can you please put a block comment above the if
> explaining in a few lines what's going on.

Hi Michael,

Sure, I will include a comment explaining the change in V2.

Thanks
Athira
> 
> cheers


^ permalink raw reply

* Re: [PATCH] fsl: imx-audmix : Replace seq_printf with seq_puts
From: Mark Brown @ 2020-09-17 13:04 UTC (permalink / raw)
  To: Xu Wang
  Cc: alsa-devel, linuxppc-dev, linux-kernel, timur, Xiubo.Lee,
	festevam, s.hauer, tiwai, lgirdwood, perex, nicoleotsuka,
	linux-imx, kernel, shawnguo, shengjiu.wang, linux-arm-kernel
In-Reply-To: <20200916061420.10403-1-vulab@iscas.ac.cn>

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

On Wed, Sep 16, 2020 at 06:14:20AM +0000, Xu Wang wrote:

> A multiplication for the size determination of a memory allocation
> indicated that an array data structure should be processed.
> Thus use the corresponding function "devm_kcalloc".

This looks fine but the subject says it's about seq_puts() not
kcalloc().

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply

* Re: [PATCH v6 0/8] powerpc/watchpoint: Bug fixes plus new feature flag
From: Rogerio Alves @ 2020-09-17 13:24 UTC (permalink / raw)
  To: Ravi Bangoria, mpe, christophe.leroy
  Cc: mikey, jniethe5, pedromfc, linux-kernel, paulus, rogealve,
	naveen.n.rao, linuxppc-dev
In-Reply-To: <20200902042945.129369-1-ravi.bangoria@linux.ibm.com>



On 9/2/20 1:29 AM, Ravi Bangoria wrote:
> Patch #1 fixes issue for quardword instruction on p10 predecessors.
> Patch #2 fixes issue for vector instructions.
> Patch #3 fixes a bug about watchpoint not firing when created with
>           ptrace PPC_PTRACE_SETHWDEBUG and CONFIG_HAVE_HW_BREAKPOINT=N.
>           The fix uses HW_BRK_TYPE_PRIV_ALL for ptrace user which, I
>           guess, should be fine because we don't leak any kernel
>           addresses and PRIV_ALL will also help to cover scenarios when
>           kernel accesses user memory.
> Patch #4,#5 fixes infinite exception bug, again the bug happens only
>           with CONFIG_HAVE_HW_BREAKPOINT=N.
> Patch #6 fixes two places where we are missing to set hw_len.
> Patch #7 introduce new feature bit PPC_DEBUG_FEATURE_DATA_BP_ARCH_31
>           which will be set when running on ISA 3.1 compliant machine.
> Patch #8 finally adds selftest to test scenarios fixed by patch#2,#3
>           and also moves MODE_EXACT tests outside of BP_RANGE condition.
> 
> Christophe, let me know if this series breaks something for 8xx.
> 
> v5: https://lore.kernel.org/r/20200825043617.1073634-1-ravi.bangoria@linux.ibm.com
> 
> v5->v6:
>   - Fix build faulure reported by kernel test robot
>   - patch #5. Use more compact if condition, suggested by Christophe
> 
> 
> Ravi Bangoria (8):
>    powerpc/watchpoint: Fix quarword instruction handling on p10
>      predecessors
>    powerpc/watchpoint: Fix handling of vector instructions
>    powerpc/watchpoint/ptrace: Fix SETHWDEBUG when
>      CONFIG_HAVE_HW_BREAKPOINT=N
>    powerpc/watchpoint: Move DAWR detection logic outside of
>      hw_breakpoint.c
>    powerpc/watchpoint: Fix exception handling for
>      CONFIG_HAVE_HW_BREAKPOINT=N
>    powerpc/watchpoint: Add hw_len wherever missing
>    powerpc/watchpoint/ptrace: Introduce PPC_DEBUG_FEATURE_DATA_BP_ARCH_31
>    powerpc/watchpoint/selftests: Tests for kernel accessing user memory
> 
>   Documentation/powerpc/ptrace.rst              |   1 +
>   arch/powerpc/include/asm/hw_breakpoint.h      |  12 ++
>   arch/powerpc/include/uapi/asm/ptrace.h        |   1 +
>   arch/powerpc/kernel/Makefile                  |   3 +-
>   arch/powerpc/kernel/hw_breakpoint.c           | 149 +---------------
>   .../kernel/hw_breakpoint_constraints.c        | 162 ++++++++++++++++++
>   arch/powerpc/kernel/process.c                 |  48 ++++++
>   arch/powerpc/kernel/ptrace/ptrace-noadv.c     |   9 +-
>   arch/powerpc/xmon/xmon.c                      |   1 +
>   .../selftests/powerpc/ptrace/ptrace-hwbreak.c |  48 +++++-
>   10 files changed, 282 insertions(+), 152 deletions(-)
>   create mode 100644 arch/powerpc/kernel/hw_breakpoint_constraints.c
> 

Tested this patch set for:
- SETHWDEBUG when CONFIG_HAVE_HW_BREAKPOINT=N = OK
- Fix exception handling for CONFIG_HAVE_HW_BREAKPOINT=N = OK
- Check for PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 = OK
- Fix quarword instruction handling on p10 predecessors = OK
- Fix handling of vector instructions = OK

Also tested for:
- Set second watchpoint (P10 Mambo) = OK
- Infinity loop on sc instruction = OK

^ permalink raw reply

* Re: [PATCH v6 1/8] powerpc/watchpoint: Fix quarword instruction handling on p10 predecessors
From: Rogerio Alves @ 2020-09-17 13:25 UTC (permalink / raw)
  To: Ravi Bangoria, mpe, christophe.leroy
  Cc: mikey, jniethe5, pedromfc, linux-kernel, paulus, rogealve,
	naveen.n.rao, linuxppc-dev
In-Reply-To: <20200902042945.129369-2-ravi.bangoria@linux.ibm.com>



On 9/2/20 1:29 AM, Ravi Bangoria wrote:
> On p10 predecessors, watchpoint with quarword access is compared at
> quardword length. If the watch range is doubleword or less than that
> in a first half of quarword aligned 16 bytes, and if there is any
> unaligned quadword access which will access only the 2nd half, the
> handler should consider it as extraneous and emulate/single-step it
> before continuing.
> 
> Reported-by: Pedro Miraglia Franco de Carvalho <pedromfc@linux.ibm.com>
> Fixes: 74c6881019b7 ("powerpc/watchpoint: Prepare handler to handle more than one watchpoint")
> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Tested-by: Rogerio Alves <rcardoso@linux.ibm.com>
> ---
>   arch/powerpc/include/asm/hw_breakpoint.h |  1 +
>   arch/powerpc/kernel/hw_breakpoint.c      | 12 ++++++++++--
>   2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/hw_breakpoint.h b/arch/powerpc/include/asm/hw_breakpoint.h
> index db206a7f38e2..9b68eafebf43 100644
> --- a/arch/powerpc/include/asm/hw_breakpoint.h
> +++ b/arch/powerpc/include/asm/hw_breakpoint.h
> @@ -42,6 +42,7 @@ struct arch_hw_breakpoint {
>   #else
>   #define HW_BREAKPOINT_SIZE  0x8
>   #endif
> +#define HW_BREAKPOINT_SIZE_QUADWORD	0x10
>   
>   #define DABR_MAX_LEN	8
>   #define DAWR_MAX_LEN	512
> diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
> index 1f4a1efa0074..9f7df1c37233 100644
> --- a/arch/powerpc/kernel/hw_breakpoint.c
> +++ b/arch/powerpc/kernel/hw_breakpoint.c
> @@ -520,9 +520,17 @@ static bool ea_hw_range_overlaps(unsigned long ea, int size,
>   				 struct arch_hw_breakpoint *info)
>   {
>   	unsigned long hw_start_addr, hw_end_addr;
> +	unsigned long align_size = HW_BREAKPOINT_SIZE;
>   
> -	hw_start_addr = ALIGN_DOWN(info->address, HW_BREAKPOINT_SIZE);
> -	hw_end_addr = ALIGN(info->address + info->len, HW_BREAKPOINT_SIZE);
> +	/*
> +	 * On p10 predecessors, quadword is handle differently then
> +	 * other instructions.
> +	 */
> +	if (!cpu_has_feature(CPU_FTR_ARCH_31) && size == 16)
> +		align_size = HW_BREAKPOINT_SIZE_QUADWORD;
> +
> +	hw_start_addr = ALIGN_DOWN(info->address, align_size);
> +	hw_end_addr = ALIGN(info->address + info->len, align_size);
>   
>   	return ((ea < hw_end_addr) && (ea + size > hw_start_addr));
>   }
> 

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox