Re: [PATCH v6 00/27] ptrace: add PTRACE_GET_SYSCALL_INFO request

2018-12-14 Thread Paul Moore
On Thu, Dec 13, 2018 at 12:18 PM Dmitry V. Levin wrote: > PTRACE_GET_SYSCALL_INFO is a generic ptrace API that lets ptracer obtain > details of the syscall the tracee is blocked in. > > There are two reasons for a special syscall-related ptrace request. > > Firstly, with the current ptrace API

Re: [PATCH v1 9/9] mm: better document PG_reserved

2018-12-14 Thread Randy Dunlap
On 12/14/18 3:10 AM, David Hildenbrand wrote: > The usage of PG_reserved and how PG_reserved pages are to be treated is > buried deep down in different parts of the kernel. Let's shine some light > onto these details by documenting current users and expected > behavior. > > Especially, clarify on

Re: [PATCH 1/2] of: of_node_get()/of_node_put() nodes held in phandle cache

2018-12-14 Thread Frank Rowand
On 12/14/18 2:47 PM, Frank Rowand wrote: > On 12/14/18 9:15 AM, Rob Herring wrote: >> On Fri, Dec 14, 2018 at 12:43 AM wrote: >>> >>> From: Frank Rowand >>> >>> The phandle cache contains struct device_node pointers. The refcount >>> of the pointers was not incremented while in the cache,

Re: [PATCH 1/2] of: of_node_get()/of_node_put() nodes held in phandle cache

2018-12-14 Thread Frank Rowand
On 12/14/18 9:15 AM, Rob Herring wrote: > On Fri, Dec 14, 2018 at 12:43 AM wrote: >> >> From: Frank Rowand >> >> The phandle cache contains struct device_node pointers. The refcount >> of the pointers was not incremented while in the cache, allowing use >> after free error after kfree() of the

Re: [PATCH 2/2] of: __of_detach_node() - remove node from phandle cache

2018-12-14 Thread Frank Rowand
On 12/14/18 1:56 PM, Michael Bringmann wrote: > On 12/14/2018 11:20 AM, Rob Herring wrote: >> On Fri, Dec 14, 2018 at 12:43 AM wrote: >>> >>> From: Frank Rowand >>> >>> Non-overlay dynamic devicetree node removal may leave the node in >>> the phandle cache. Subsequent calls to

Re: [PATCH v03] powerpc/mobility: Fix node detach/rename problem

2018-12-14 Thread Michael Bringmann
On 12/12/2018 08:57 PM, Michael Ellerman wrote: > Frank Rowand writes: >> On 12/11/18 8:07 AM, Rob Herring wrote: >>> On Tue, Dec 11, 2018 at 7:29 AM Michael Ellerman >>> wrote: > ... diff --git a/drivers/of/base.c b/drivers/of/base.c index 09692c9b32a7..d8e4534c0686 100644 ---

Re: [PATCH 2/2] of: __of_detach_node() - remove node from phandle cache

2018-12-14 Thread Michael Bringmann
On 12/14/2018 11:20 AM, Rob Herring wrote: > On Fri, Dec 14, 2018 at 12:43 AM wrote: >> >> From: Frank Rowand >> >> Non-overlay dynamic devicetree node removal may leave the node in >> the phandle cache. Subsequent calls to of_find_node_by_phandle() >> will incorrectly find the stale entry.

Re: [PATCH] net/ibmvnic: Remove tests of member address

2018-12-14 Thread David Miller
From: Wen Yang Date: Tue, 11 Dec 2018 12:20:46 +0800 > The driver was checking for non-NULL address. > - adapter->napi[i] > > This is pointless as these will be always non-NULL, since the > 'dapter->napi' is allocated in init_napi(). > It is safe to get rid of useless checks for addresses to

[RFC 6/6] powerpc: Enable support for ibm, drc-info devtree property

2018-12-14 Thread Michael Bringmann
Enable support for new DRC device tree property "ibm,drc-info" in initial handshake between the Linux kernel and the front end processor. Signed-off-by: Michael Bringmann --- arch/powerpc/kernel/prom_init.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[RFC 5/6] powerpc/pci/hotplug: Use common drcinfo parsing

2018-12-14 Thread Michael Bringmann
The implementation of the pseries-specific drc info properties is currently implemented in pseries-specific and non-pseries-specific files. This patch set uses a new implementation of the device-tree parsing code for the properties. This patch refactors parsing of the pseries-specific drc-info

[RFC 4/6] powerpc/pseries: Use common drcinfo parsing

2018-12-14 Thread Michael Bringmann
The implementation of the pseries-specific drc info properties is currently implemented in pseries-specific and non-pseries-specific files. This patch set uses a new implementation of the device-tree parsing code for the properties. This patch refactors parsing of the drc-info properties out of

[RFC 3/6] pseries/drcinfo: Pseries impl of arch_find_drc_info

2018-12-14 Thread Michael Bringmann
This patch provides a common interface to parse ibm,drc-indexes, ibm,drc-names, ibm,drc-types, ibm,drc-power-domains, or ibm,drc-info. The generic interface arch_find_drc_match is provided which accepts callback functions that may be applied to examine the data for each entry. Signed-off-by:

[RFC 2/6] pseries/drcinfo: Fix bug parsing ibm,drc-info

2018-12-14 Thread Michael Bringmann
Replace use of of_prop_next_u32() in when parsing 'ibm,drc-info' structure to simplify and reduce parsing code. Signed-off-by: Michael Bringmann Fixes: 3f38000eda48 ("powerpc/firmware: Add definitions for new drc-info firmware feature" -- end of patch series applied to powerpc next) ---

[RFC 1/6] powerpc:/drc Define interface to acquire arch-specific drc info

2018-12-14 Thread Michael Bringmann
Define interface to acquire arch-specific drc info to match against hotpluggable devices. The current implementation exposes several pseries-specific dynamic memory properties in generic kernel code. This patch set provides an interface to pull that code out of the generic kernel. Signed-off-by:

[RFC 0/6] powerpc/pseries: Refactor code to centralize drcinfo parsing

2018-12-14 Thread Michael Bringmann
The implementation of the pseries-specific drc info information feature is currently implemented within and outside of the powerpc pseries code. This patch set moves the parsing code for the pseries-specific device-tree properties ibm,drc-indexes, ibm,drc-names, ibm,drc-types,

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-4.20-4 tag

2018-12-14 Thread pr-tracker-bot
The pull request you sent on Sat, 15 Dec 2018 01:26:19 +1100: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-4.20-4 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/4645453cefcebdff9db26f02cf325607357295c4 Thank you! --

Re: [PATCH] PCI/AER: only insert one element into kfifo

2018-12-14 Thread Bjorn Helgaas
On Wed, Dec 12, 2018 at 04:32:30PM +0800, Yanjiang Jin wrote: > 'commit ecae65e133f2 ("PCI/AER: Use kfifo_in_spinlocked() to > insert locked elements")' replace kfifo_put() with kfifo_in_spinlocked(). > > But as "kfifo_in(fifo, buf, n)" describes: > " * @n: number of elements to be added". > >

Re: [PATCH 2/2] of: __of_detach_node() - remove node from phandle cache

2018-12-14 Thread Rob Herring
On Fri, Dec 14, 2018 at 12:43 AM wrote: > > From: Frank Rowand > > Non-overlay dynamic devicetree node removal may leave the node in > the phandle cache. Subsequent calls to of_find_node_by_phandle() > will incorrectly find the stale entry. Remove the node from the > cache. > > Add paranoia

Re: [PATCH 1/2] of: of_node_get()/of_node_put() nodes held in phandle cache

2018-12-14 Thread Rob Herring
On Fri, Dec 14, 2018 at 12:43 AM wrote: > > From: Frank Rowand > > The phandle cache contains struct device_node pointers. The refcount > of the pointers was not incremented while in the cache, allowing use > after free error after kfree() of the node. Add the proper increment > and decrement

Re: use generic DMA mapping code in powerpc V4

2018-12-14 Thread Christoph Hellwig
On Fri, Dec 14, 2018 at 01:00:26PM +0100, Christian Zigotzky wrote: > On 12 December 2018 at 3:15PM, Christoph Hellwig wrote: > > Thanks for bisecting.  I've spent some time going over the conversion > > but can't really pinpoint it.  I have three little patches that switch > > parts of the code

Re: [PATCH 12/34] powerpc/cell: move dma direct window setup out of dma_configure

2018-12-14 Thread Christoph Hellwig
On Sat, Dec 15, 2018 at 12:29:11AM +1100, Michael Ellerman wrote: > I think the problem is that we don't want to set iommu_bypass_supported > unless cell_iommu_fixed_mapping_init() succeeds. > > Yep. This makes it work for me on cell on top of your v5. Thanks, this looks good. I've folded it

[PATCH] lkdtm: Add a tests for NULL pointer dereference

2018-12-14 Thread Christophe Leroy
Introduce lkdtm tests for NULL pointer dereference: check access or exec at NULL address. Signed-off-by: Christophe Leroy --- drivers/misc/lkdtm/core.c | 2 ++ drivers/misc/lkdtm/lkdtm.h | 2 ++ drivers/misc/lkdtm/perms.c | 18 ++ 3 files changed, 22 insertions(+) diff --git

[PATCH v2] powerpc/mm: make NULL pointer deferences explicit on bad page faults.

2018-12-14 Thread Christophe Leroy
As several other arches including x86, this patch makes it explicit that a bad page fault is a NULL pointer dereference when the fault address is lower than PAGE_SIZE In the mean time, this page makes all bad_page_fault() messages shorter so that they remain on one single line. And it prefixes

[GIT PULL] Please pull powerpc/linux.git powerpc-4.20-4 tag

2018-12-14 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Linus, Please pull some more powerpc fixes for 4.20: The following changes since commit b2fed34a628df6118b5d4e13f49a33e15f704fa9: selftests/powerpc: Adjust wild_bctr to build with old binutils (2018-11-15 23:05:17 +1100) are available in the

[PATCH] powerpc/configs: Don't enable PPC_EARLY_DEBUG in defconfigs

2018-12-14 Thread Michael Ellerman
This reverts the remains of commit b9ef7d6b11c1 ("powerpc: Update default configurations"). That commit was proceeded by a commit which added a config option to control use of BOOTX for early debug, ie. PPC_EARLY_DEBUG_BOOTX, and then the update of the defconfigs was intended to not change

Re: [PATCH 12/34] powerpc/cell: move dma direct window setup out of dma_configure

2018-12-14 Thread Michael Ellerman
Christoph Hellwig writes: > On Sun, Dec 09, 2018 at 09:23:39PM +1100, Michael Ellerman wrote: >> Christoph Hellwig writes: >> >> > Configure the dma settings at device setup time, and stop playing games >> > with get_pci_dma_ops. This prepares for using the common dma_configure >> > code later

Re: [PATCH 2/2] s390/pci: handle function enumeration after sriov enablement

2018-12-14 Thread Christoph Hellwig
On Fri, Dec 14, 2018 at 05:12:45AM -0800, Christoph Hellwig wrote: > On Thu, Dec 13, 2018 at 06:54:28PM +0100, Sebastian Ott wrote: > > Implement pcibios_sriov_{add|del}_vfs as empty functions. VF > > creation will be triggered by the hotplug code. > > And instead of having the arch suplply a

Re: [PATCH 2/2] s390/pci: handle function enumeration after sriov enablement

2018-12-14 Thread Christoph Hellwig
On Thu, Dec 13, 2018 at 06:54:28PM +0100, Sebastian Ott wrote: > Implement pcibios_sriov_{add|del}_vfs as empty functions. VF > creation will be triggered by the hotplug code. And instead of having the arch suplply a no-op arch override I think it would be better to have the config option just

Re: [PATCH 1/2] PCI: provide pcibios_sriov_add_vfs

2018-12-14 Thread Christoph Hellwig
On Thu, Dec 13, 2018 at 06:54:27PM +0100, Sebastian Ott wrote: > Move VF detection and device creation code to weak functions > such that architectures can provide a different implementation. No magic weak functions please. If you really have a reason to override the implementation add a proper

Re: use generic DMA mapping code in powerpc V4

2018-12-14 Thread Christian Zigotzky
On 12 December 2018 at 3:15PM, Christoph Hellwig wrote: > Thanks for bisecting.  I've spent some time going over the conversion > but can't really pinpoint it.  I have three little patches that switch > parts of the code to the generic version.  This is on top of the > last good commmit

[PATCH v1 9/9] mm: better document PG_reserved

2018-12-14 Thread David Hildenbrand
The usage of PG_reserved and how PG_reserved pages are to be treated is buried deep down in different parts of the kernel. Let's shine some light onto these details by documenting current users and expected behavior. Especially, clarify on the "Some of them might not even exist" case. These are

[PATCH v1 8/9] ia64: perfmon: Don't mark buffer pages as PG_reserved

2018-12-14 Thread David Hildenbrand
In the old days, remap_pfn_range() required pages to be marked as PG_reserved, so they would e.g. never get swapped out. This was required for special mappings. Nowadays, this is fully handled via the VMA (VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP inside remap_pfn_range() to be precise).

[PATCH v1 7/9] arm64: kdump: No need to mark crashkernel pages manually PG_reserved

2018-12-14 Thread David Hildenbrand
The crashkernel is reserved via memblock_reserve(). memblock_free_all() will call free_low_memory_core_early(), which will go over all reserved memblocks, marking the pages as PG_reserved. So manually marking pages as PG_reserved is not necessary, they are already in the desired state (otherwise

[PATCH v1 6/9] arm64: kexec: no need to ClearPageReserved()

2018-12-14 Thread David Hildenbrand
This will be done by free_reserved_page(). Cc: Catalin Marinas Cc: Will Deacon Cc: Bhupesh Sharma Cc: James Morse Cc: Marc Zyngier Cc: Dave Kleikamp Cc: Mark Rutland Cc: Andrew Morton Cc: Michal Hocko Cc: Matthew Wilcox Acked-by: James Morse Signed-off-by: David Hildenbrand ---

[PATCH v1 5/9] m68k/mm: use __ClearPageReserved()

2018-12-14 Thread David Hildenbrand
The PG_reserved flag is cleared from memory that is part of the kernel image (and therefore marked as PG_reserved). Avoid using PG_reserved directly. Cc: Geert Uytterhoeven Cc: Andrew Morton Cc: Michal Hocko Cc: Matthew Wilcox Signed-off-by: David Hildenbrand --- arch/m68k/mm/memory.c | 2

[PATCH v1 4/9] riscv/vdso: don't clear PG_reserved

2018-12-14 Thread David Hildenbrand
The VDSO is part of the kernel image and therefore the struct pages are marked as reserved during boot. As we install a special mapping, the actual struct pages will never be exposed to MM via the page tables. We can therefore leave the pages marked as reserved. Cc: Palmer Dabbelt Cc: Albert Ou

[PATCH v1 3/9] powerpc/vdso: don't clear PG_reserved

2018-12-14 Thread David Hildenbrand
The VDSO is part of the kernel image and therefore the struct pages are marked as reserved during boot. As we install a special mapping, the actual struct pages will never be exposed to MM via the page tables. We can therefore leave the pages marked as reserved. Cc: Benjamin Herrenschmidt Cc:

[PATCH v1 2/9] s390/vdso: don't clear PG_reserved

2018-12-14 Thread David Hildenbrand
The VDSO is part of the kernel image and therefore the struct pages are marked as reserved during boot. As we install a special mapping, the actual struct pages will never be exposed to MM via the page tables. We can therefore leave the pages marked as reserved. Suggested-by: Martin Schwidefsky

[PATCH v1 1/9] agp: efficeon: no need to set PG_reserved on GATT tables

2018-12-14 Thread David Hildenbrand
The l1 GATT page table is kept in a special on-chip page with 64 entries. We allocate the l2 page table pages via get_zeroed_page() and enter them into the table. These l2 pages are modified accordingly when inserting/removing memory via efficeon_insert_memory and efficeon_remove_memory. Apart

[PATCH v1 0/9] mm: PG_reserved cleanups and documentation

2018-12-14 Thread David Hildenbrand
I was recently going over all users of PG_reserved. Short story: it is difficult and sometimes not really clear if setting/checking for PG_reserved is only a relict from the past. Easy to break things. I guess I know have a pretty good idea wh things are like that nowadays and how they evolved. I

Re: [PATCH] powerpc/prom: fix early DEBUG messages

2018-12-14 Thread Christophe Leroy
Le 14/12/2018 à 07:22, Michael Ellerman a écrit : Christophe Leroy writes: diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index fe758cedb93f..d8e56e03c9c6 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -749,7 +749,11 @@ void __init

[PATCH v2] powerpc/prom: fix early DEBUG messages

2018-12-14 Thread Christophe Leroy
This patch fixes early DEBUG messages in prom.c: - Use %px instead of %p to see the addresses - Cast memblock_phys_mem_size() with (unsigned long long) to avoid build failure when phys_addr_t is not 64 bits. Signed-off-by: Christophe Leroy --- v2: cast instead of #ifdef %llx/%x

[PATCH v2 2/5] powerpc/perf: Rearrange setting of ldbar for thread-imc

2018-12-14 Thread Anju T Sudhakar
LDBAR holds the memory address allocated for each cpu. For thread-imc the mode bit (i.e bit 1) of LDBAR is set to accumulation. Currently, ldbar is loaded with per cpu memory address and mode set to accumulation at boot time. To enable trace-imc, the mode bit of ldbar should be set to 'trace'. So

[PATCH v2 5/5] powerpc/perf: Trace imc PMU functions

2018-12-14 Thread Anju T Sudhakar
Add PMU functions to support trace-imc. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 175 1 file changed, 175 insertions(+) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 1f09265c8fb0..32ff0e449fca 100644

[PATCH v2 3/5] powerpc/perf: Add privileged access check for thread_imc

2018-12-14 Thread Anju T Sudhakar
From: Madhavan Srinivasan Add code to restrict user access to thread_imc pmu since some event report privilege level information. Fixes: f74c89bd80fb3 ('powerpc/perf: Add thread IMC PMU support') Signed-off-by: Madhavan Srinivasan Signed-off-by: Anju T Sudhakar ---

[PATCH v2 4/5] powerpc/perf: Trace imc events detection and cpuhotplug

2018-12-14 Thread Anju T Sudhakar
Patch detects trace-imc events, does memory initilizations for each online cpu, and registers cpuhotplug call-backs. Signed-off-by: Anju T Sudhakar --- arch/powerpc/perf/imc-pmu.c | 91 +++ arch/powerpc/platforms/powernv/opal-imc.c | 3 +

[PATCH v2 1/5] powerpc/include: Add data structures and macros for IMC trace mode

2018-12-14 Thread Anju T Sudhakar
Add the macros needed for IMC (In-Memory Collection Counters) trace-mode and data structure to hold the trace-imc record data. Also, add the new type "OPAL_IMC_COUNTERS_TRACE" in 'opal-api.h', since there is a new switch case added in the opal-calls for IMC. Signed-off-by: Anju T Sudhakar ---

[PATCH v2 0/5] powerpc/perf: IMC trace-mode support

2018-12-14 Thread Anju T Sudhakar
IMC (In-Memory collection counters) is a hardware monitoring facility that collects large number of hardware performance events. POWER9 support two modes for IMC which are the Accumulation mode and Trace mode. In Accumulation mode, event counts are accumulated in

Re: [PATCH] powerpc/mm: make NULL pointer deferences explicit on bad page faults.

2018-12-14 Thread Christophe Leroy
Hi Michael, Le 14/12/2018 à 01:57, Michael Ellerman a écrit : Hi Christophe, You know it's the trivial patches that are going to get lots of review comments :) I'm so happy to get comments. Christophe Leroy writes: As several other arches including x86, this patch makes it explicit that