Re: [PATCH] mm: convert totalram_pages, totalhigh_pages and managed_pages to atomic.

2018-11-21 Thread Guo Ren
On Mon, Oct 22, 2018 at 10:53:22PM +0530, Arun KS wrote: > Remove managed_page_count_lock spinlock and instead use atomic > variables. > > Suggested-by: Michal Hocko > Suggested-by: Vlastimil Babka > Signed-off-by: Arun KS > > --- > As discussed here, >

答复: Re: [PATCH 2/4] soc/fsl/qe: fix potential NULL pointer dereference inucc_of_parse_tdm

2018-11-21 Thread wen.yang99
Hi Christophe, thank you for your review. There are two problems in the ucc_of_parse_tdm function. 1, NULL pointer reference 2, pdev gets modified, iomap was done with a different pdev. We will submit a patch to repair it later. Thanks. 132 pdev = of_find_device_by_node(np2); .. 141

RE: [PATCHv4 0/3] dts: Add the property of IB and OB

2018-11-21 Thread Xiaowei Bao
Hi Lorenzo, Yes, these series patches can drop, thanks a lot. Best regards Xiaowei -Original Message- From: Lorenzo Pieralisi Sent: 2018年11月21日 1:31 To: Xiaowei Bao Cc: robh...@kernel.org; mark.rutl...@arm.com; catalin.mari...@arm.com; will.dea...@arm.com; bhelg...@google.com;

Re: [RFC PATCH v1 5/6] powerpc/mm: Add a framework for Kernel Userspace Access Protection

2018-11-21 Thread Russell Currey
On Wed, 2018-11-21 at 09:32 +0100, Christophe LEROY wrote: > > Le 21/11/2018 à 03:26, Russell Currey a écrit : > > On Wed, 2018-11-07 at 16:56 +, Christophe Leroy wrote: > > > This patch implements a framework for Kernel Userspace Access > > > Protection. > > > > > > Then subarches will have

Re: [PATCH] leds: powernv: add of_node_put()

2018-11-21 Thread Frank Lee
On Thu, Nov 22, 2018 at 4:45 AM Jacek Anaszewski wrote: > > Hi Yangtao, > > Thank you for the patch. > > On 11/21/2018 01:31 PM, Yangtao Li wrote: > > of_find_node_by_path() acquires a reference to the node returned by > > it and that reference needs to be dropped by its caller.bl_idle_init() > >

[for-next][PATCH 09/18] powerpc/function_graph: Simplify with function_graph_entry()

2018-11-21 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" The function_graph_entry() function does the work of calling the function graph hook function and the management of the shadow stack, simplifying the work done in the architecture dependent prepare_ftrace_return(). Have powerpc use the new code, and remove the

Re: [PATCH] powerpc/tm: Set MSR[TS] just prior to recheckpoint

2018-11-21 Thread Michael Neuling
> Do you mean in this part of code? > > SYSCALL_DEFINE0(rt_sigreturn) > { > > if (__copy_from_user(, >uc_sigmask, sizeof(set))) > goto badframe; > > ... > if (MSR_TM_SUSPENDED(mfmsr())) > tm_reclaim_current(0); I'm actually

Re: [PATCH v3] powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call

2018-11-21 Thread Michael Ellerman
Hi Dmitry, Thanks for the patch. "Dmitry V. Levin" writes: > From: Elvira Khabirova > > Arch code should use tracehook_*() helpers as documented > in include/linux/tracehook.h, > ptrace_report_syscall() is not expected to be used outside that file. > > Co-authored-by: Dmitry V. Levin > Fixes:

Re: [PATCH] leds: powernv: add of_node_put()

2018-11-21 Thread Jacek Anaszewski
Hi Yangtao, Thank you for the patch. On 11/21/2018 01:31 PM, Yangtao Li wrote: > of_find_node_by_path() acquires a reference to the node returned by > it and that reference needs to be dropped by its caller.bl_idle_init() > doesn't do that, so fix it. s/bl_idle_init/powernv_led_probe/ I

[PATCH net 0/2] ibmvnic: Fix queue and buffer accounting errors

2018-11-21 Thread Thomas Falcon
This series includes two small fixes. The first resolves a typo bug in the code to clean up unused RX buffers during device queue removal. The second ensures that device queue memory is updated to reflect new supported queue ring sizes after migration to other backing hardware. Thomas Falcon

[PATCH net 2/2] ibmvnic: Update driver queues after change in ring size support

2018-11-21 Thread Thomas Falcon
During device reset, queue memory is not being updated to accommodate changes in ring buffer sizes supported by backing hardware. Track any differences in ring buffer sizes following the reset and update queue memory when possible. Signed-off-by: Thomas Falcon ---

[PATCH net 1/2] ibmvnic: Fix RX queue buffer cleanup

2018-11-21 Thread Thomas Falcon
The wrong index is used when cleaning up RX buffer objects during release of RX queues. Update to use the correct index counter. Signed-off-by: Thomas Falcon --- drivers/net/ethernet/ibm/ibmvnic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH v2 16/15 v2] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Paul Burton
Hi Dmitry, On Wed, Nov 21, 2018 at 10:35:12PM +0300, Dmitry V. Levin wrote: > This argument is required to extend the generic ptrace API with > PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be > called from ptrace_request() along with other syscall_get_* functions > with a

[PATCH v2 16/15 v2] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Dmitry V. Levin
This argument is required to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be called from ptrace_request() along with other syscall_get_* functions with a tracee as their argument. This change partially reverts commit 5e937a9ae913

[PATCH v2] powerpc/tm: Set MSR[TS] just prior to recheckpoint

2018-11-21 Thread Breno Leitao
On a signal handler return, the user could set a context with MSR[TS] bits set, and these bits would be copied to task regs->msr. At restore_tm_sigcontexts(), after current task regs->msr[TS] bits are set, several __get_user() are called and then a recheckpoint is executed. This is a problem

Re: [PATCH] powerpc/numa: fix hot-added CPU on memory-less node

2018-11-21 Thread Laurent Vivier
On 15/11/2018 10:19, Satheesh Rajendran wrote: > On Wed, Nov 14, 2018 at 06:03:19PM +0100, Laurent Vivier wrote: >> Trying to hotplug a CPU on an empty NUMA node (without >> memory or CPU) crashes the kernel when the CPU is onlined. >> >> During the onlining process, the kernel calls

Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Dmitry V. Levin
Hi Paul, On Wed, Nov 21, 2018 at 06:40:06PM +, Paul Burton wrote: > Hi Dmitry, > > On Wed, Nov 21, 2018 at 03:44:22AM +0300, Dmitry V. Levin wrote: > > This argument is required to extend the generic ptrace API > > with PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be > >

Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Paul Burton
Hi Dmitry, On Wed, Nov 21, 2018 at 03:44:22AM +0300, Dmitry V. Levin wrote: > This argument is required to extend the generic ptrace API > with PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be > called from ptrace_request() along with other syscall_get_* functions > with a

Re: [PATCH] powerpc/tm: Set MSR[TS] just prior to recheckpoint

2018-11-21 Thread Breno Leitao
hi Michael, On 11/20/18 8:34 AM, Michael Ellerman wrote: > Hi Breno, > > Thanks for chasing this one down. > > Breno Leitao writes: > >> On a signal handler return, the user could set a context with MSR[TS] bits >> set, and these bits would be copied to task regs->msr. >> >> At

Re: [PATCH] powerpc/tm: Set MSR[TS] just prior to recheckpoint

2018-11-21 Thread Breno Leitao
hi Mikey, On 11/19/18 9:30 PM, Michael Neuling wrote: > On Mon, 2018-11-19 at 10:44 -0200, Breno Leitao wrote: >> On a signal handler return, the user could set a context with MSR[TS] bits >> set, and these bits would be copied to task regs->msr. >> >> At restore_tm_sigcontexts(), after current

Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Palmer Dabbelt
On Tue, 20 Nov 2018 16:44:22 PST (-0800), l...@altlinux.org wrote: This argument is required to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be called from ptrace_request() along with other syscall_get_* functions with a tracee as their

Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument

2018-11-21 Thread Andy Lutomirski
On Tue, Nov 20, 2018 at 4:44 PM Dmitry V. Levin wrote: > > This argument is required to extend the generic ptrace API > with PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be > called from ptrace_request() along with other syscall_get_* functions > with a tracee as their

[PATCH] leds: powernv: add of_node_put()

2018-11-21 Thread Yangtao Li
of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller.bl_idle_init() doesn't do that, so fix it. Signed-off-by: Yangtao Li --- drivers/leds/leds-powernv.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-)

Re: [RFC PATCH v1 3/6] powerpc: Add skeleton for Kernel Userspace Execution Prevention

2018-11-21 Thread Michael Ellerman
Russell Currey writes: > On Wed, 2018-11-07 at 16:56 +, Christophe Leroy wrote: >> This patch adds a skeleton for Kernel Userspace Execution Prevention. >> >> Then subarches implementing it have to define CONFIG_PPC_HAVE_KUEP >> and provide setup_kuep() function. >> >> Signed-off-by:

[PATCH v3 3/3] dpaa_eth: add ethtool coalesce control

2018-11-21 Thread Madalin Bucur
Allow ethtool control of the DPAA QMan portal interrupt coalescing settings. Signed-off-by: Madalin Bucur --- drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 71 ++ 1 file changed, 71 insertions(+) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c

[PATCH v3 2/3] soc/qman: add return value to interrupt coalesce changing APIs

2018-11-21 Thread Madalin Bucur
Check that the values received by the portal interrupt coalesce change APIs are in range. Signed-off-by: Madalin Bucur Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/qman.c | 33 ++--- include/soc/fsl/qman.h | 8 ++-- 2 files changed, 32

[PATCH v3 0/3] dpaa_eth: add ethtool coalesce control

2018-11-21 Thread Madalin Bucur
Add control of the DPAA portal interrupt coalescing settings from ethtool. changes from v2: read ithresh from HW, set previous values on failure changes from v1: added range checking for the QMan APIs Madalin Bucur (3): soc: fsl: qbman: read ithresh from HW soc/qman: add return value to

[PATCH v3 1/3] soc: fsl: qbman: read ithresh from HW

2018-11-21 Thread Madalin Bucur
Read the DQRR interrupt threshold directly from the hardware. Signed-off-by: Madalin Bucur Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/qman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index

Re: [PATCH 2/4] soc/fsl/qe: fix potential NULL pointer dereference in ucc_of_parse_tdm

2018-11-21 Thread Christophe LEROY
Le 21/11/2018 à 08:41, Wen Yang a écrit : This patch fixes a possible null pointer dereference in ucc_of_parse_tdm, detected by the semantic patch deref_null.cocci, with the following warning: ./drivers/soc/fsl/qe/qe_tdm.c:177:21-24: ERROR: pdev is NULL but dereferenced. The following code

Re: [PATCH net] net/ibmnvic: Fix deadlock problem in reset

2018-11-21 Thread Abdul Haleem
On Mon, 2018-11-19 at 15:59 -0600, Juliet Kim wrote: > This patch changes to use rtnl_lock only during a reset to avoid > deadlock that could occur when a thread operating close is holding > rtnl_lock and waiting for reset_lock acquired by another thread, > which is waiting for rtnl_lock in order

[PATCH 2/4] soc/fsl/qe: fix potential NULL pointer dereference in ucc_of_parse_tdm

2018-11-21 Thread Wen Yang
This patch fixes a possible null pointer dereference in ucc_of_parse_tdm, detected by the semantic patch deref_null.cocci, with the following warning: ./drivers/soc/fsl/qe/qe_tdm.c:177:21-24: ERROR: pdev is NULL but dereferenced. The following code has potential null pointer references:

[PATCH v2] powerpc/mm: add exec protection on powerpc 603

2018-11-21 Thread Christophe Leroy
The 603 doesn't have a HASH table, TLB misses are handled by software. It is then possible to generate page fault when _PAGE_EXEC is not set like in nohash/32. There is one "reserved" PTE bit available, this patch uses it for _PAGE_EXEC. In order to support it, set_pte_filter() and

[PATCH v3] powerpc/mm: dump block address translation on book3s/32

2018-11-21 Thread Christophe Leroy
This patch adds a debugfs file to dump block address translation: ~# cat /sys/kernel/debug/block_address_translation ---[ Instruction Block Address Translations ]--- 0: - 1: - 2: 0xc000-0xcfff 0x Kernel EXEC coherent 3: 0xd000-0xdfff 0x1000 Kernel EXEC

[PATCH V4 3/3] powerpc/mm/iommu: Allow large IOMMU page size only for hugetlb backing

2018-11-21 Thread Aneesh Kumar K.V
THP pages can get split during different code paths. An incremented reference count do imply we will not split the compound page. But the pmd entry can be converted to level 4 pte entries. Keep the code simpler by allowing large IOMMU page size only if the guest ram is backed by hugetlb pages.

[PATCH V4 2/3] powerpc/mm/iommu: Allow migration of cma allocated pages during mm_iommu_get

2018-11-21 Thread Aneesh Kumar K.V
Current code doesn't do page migration if the page allocated is a compound page. With HugeTLB migration support, we can end up allocating hugetlb pages from CMA region. Also THP pages can be allocated from CMA region. This patch updates the code to handle compound pages correctly. This use the

[PATCH V4 1/3] mm: Add get_user_pages_cma_migrate

2018-11-21 Thread Aneesh Kumar K.V
This helper does a get_user_pages_fast and if it find pages in the CMA area it will try to migrate them before taking page reference. This makes sure that we don't keep non-movable pages (due to page reference count) in the CMA area. Not able to move pages out of CMA area result in CMA allocation

[PATCH V4 0/3] * mm/kvm/vfio/ppc64: Migrate compound pages out of CMA region

2018-11-21 Thread Aneesh Kumar K.V
ppc64 use CMA area for the allocation of guest page table (hash page table). We won't be able to start guest if we fail to allocate hash page table. We have observed hash table allocation failure because we failed to migrate pages out of CMA region because they were pinned. This happen when we

Re: [RFC PATCH v1 5/6] powerpc/mm: Add a framework for Kernel Userspace Access Protection

2018-11-21 Thread Christophe LEROY
Le 21/11/2018 à 03:26, Russell Currey a écrit : On Wed, 2018-11-07 at 16:56 +, Christophe Leroy wrote: This patch implements a framework for Kernel Userspace Access Protection. Then subarches will have to possibility to provide their own implementation by providing setup_kuap(), and