[PATCH 00/11] ftrace: add support for recording function parameters and return value

2019-08-25 Thread Changbin Du
This series introduces a new ftrace feature CONFIG_FTRACE_FUNC_PROTOTYPE to record function parameters and return value. It can be enabled/disabled at runtime by a new trace option "record-funcproto". To achieve this, we need the function prototype infomation and the location of parameters. A new

[PATCH 01/11] ftrace: move recordmcount tools to scripts/ftrace

2019-08-25 Thread Changbin Du
Move ftrace tools to its own directory. We will add another tool later. Cc: John F. Reiser Signed-off-by: Changbin Du --- scripts/.gitignore | 1 - scripts/Makefile | 2 +- scripts/Makefile.build | 10 +- scripts/ftrace/.gitignore

[PATCH 02/11] ftrace: introduce new building tool funcprototype

2019-08-25 Thread Changbin Du
This is a new ftrace tool to implement CONFIG_FTRACE_FUNC_PROTOTYPE feature which allow ftrace record function parameters and return value (see later patches). Essentially funcprototype extracts only necessary information from the DWARF debug sections in the ELF object file, including function ret

[PATCH 03/11] asm-generic: add generic dwarf definition

2019-08-25 Thread Changbin Du
Add generic DWARF constant definitions. We will use it later. Signed-off-by: Changbin Du --- include/asm-generic/dwarf.h | 199 1 file changed, 199 insertions(+) create mode 100644 include/asm-generic/dwarf.h diff --git a/include/asm-generic/dwarf.h b/inclu

[PATCH 04/11] ftrace/hash: add private data field

2019-08-25 Thread Changbin Du
We will reuse ftrace_hash to lookup function prototype information. So we need an additional field to bind ftrace_func_entry to prototype information. Signed-off-by: Changbin Du --- kernel/trace/ftrace.c | 17 +++-- kernel/trace/trace.h | 6 ++ 2 files changed, 13 insertions(+)

[PATCH 05/11] ftrace: create memcache for hash entries

2019-08-25 Thread Changbin Du
When CONFIG_FTRACE_FUNC_PROTOTYPE is enabled, thousands of ftrace_func_entry instances are created. So create a dedicated memcache to enhance performance. Signed-off-by: Changbin Du --- kernel/trace/ftrace.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ke

[PATCH 06/11] ftrace: process function prototype data in vmlinux and modules

2019-08-25 Thread Changbin Du
Walk through the '__funcproto' section in vmlinux and kernel modules. For each item we add it to a new ftrace hash table ftrace_prototype_hash. When unloading a module, its items are removed from hash table. Signed-off-by: Changbin Du --- include/asm-generic/vmlinux.lds.h | 18 include/

[PATCH 07/11] ftrace: prepare arch specific interfaces for function prototype feature

2019-08-25 Thread Changbin Du
To record function parameter and return value, we need the arch specific code to pass the saved register context. It is only valid if the CONFIG_FTRACE_FUNC_PROTOTYPE feature is enabled. This patch only changes the interfaces, real implementation will be added later. Signed-off-by: Changbin Du --

[PATCH 08/11] ftrace: introduce core part of function prototype recording

2019-08-25 Thread Changbin Du
This patch introduces the core part of our new CONFIG_FTRACE_FUNC_PROTOTYPE feature. For arch which supports this feature must implement a new arch-specific interface arch_fgraph_record_params(). In this patch, we add a new trace option "record-funcproto", and by now only function graph tracer is

[PATCH 09/11] x86_64: add function prototype recording support

2019-08-25 Thread Changbin Du
This patch implements the arch_fgraph_record_params() function for x86_64 platform and deliver the return value of function to ftrace core part. Signed-off-by: Changbin Du --- arch/x86/Kconfig| 1 + arch/x86/kernel/ftrace.c| 84 +++-- arch/x86/ker

[PATCH 10/11] ftrace: add doc for new option record-funcproto

2019-08-25 Thread Changbin Du
Just add the doc for our new feature. Signed-off-by: Changbin Du --- Documentation/trace/ftrace.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst index f60079259669..c68fbbedb8bd 100644 --- a/Documentation/trace/ftrace.r

[PATCH 11/11] MAINTAINERS: make scripts/ftrace/ maintained

2019-08-25 Thread Changbin Du
Make scripts/ftrace/ maintained and I would like to help with reviewing related patches. Signed-off-by: Changbin Du --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9cbcf167bdd0..ca012ea260d7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1629

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-25 Thread Anshuman Khandual
On 08/09/2019 05:14 PM, Mark Rutland wrote: > On Fri, Aug 09, 2019 at 03:16:33AM -0700, Matthew Wilcox wrote: >> On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote: >>> Should alloc_gigantic_page() be made available as an interface for general >>> use in the kernel. The test modul

Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers

2019-08-25 Thread Anshuman Khandual
On 08/09/2019 07:22 PM, Matthew Wilcox wrote: > On Fri, Aug 09, 2019 at 04:05:07PM +0530, Anshuman Khandual wrote: >> On 08/09/2019 03:46 PM, Matthew Wilcox wrote: >>> On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote: Should alloc_gigantic_page() be made available as an int

Re: [PATCH v2] powerpc/powernv: Add ultravisor message log interface

2019-08-25 Thread Michael Ellerman
Claudio Carvalho writes: > On 8/23/19 9:48 AM, Michael Ellerman wrote: >> Claudio Carvalho writes: >>> Ultravisor (UV) provides an in-memory console which follows the OPAL >>> in-memory console structure. >>> >>> This patch extends the OPAL msglog code to also initialize the UV memory >>> console

Re: [powerpc]WARN : arch/powerpc/platforms/powernv/smp.c:160

2019-08-25 Thread Michael Ellerman
Sachin Sant writes: > linux-next is currently broken on POWER8 non virtualized. Kernel > fails to reach login prompt with following kernel warning > repeatedly shown during boot. I don't see it on my test systems. The backtrace makes it look like you're doing CPU hot_un_plug during boot, which s

RE: [PATCH v4 2/3] arm64: dts: ls1028a: Add PCIe controller DT nodes

2019-08-25 Thread Z.q. Hou
Hi Xiaowei, > -Original Message- > From: Xiaowei Bao > Sent: 2019年8月23日 16:27 > To: robh...@kernel.org; mark.rutl...@arm.com; shawn...@kernel.org; > Leo Li ; M.h. Lian ; > Mingkai Hu ; Roy Zang ; > lorenzo.pieral...@arm.com; linux-...@vger.kernel.org; > devicet...@vger.kernel.org; linux-k

RE: [PATCH v4 1/3] dt-bindings: pci: layerscape-pci: add compatible strings "fsl,ls1028a-pcie"

2019-08-25 Thread Xiaowei Bao
> -Original Message- > From: Lorenzo Pieralisi > Sent: 2019年8月23日 22:05 > To: Xiaowei Bao > Cc: robh...@kernel.org; mark.rutl...@arm.com; shawn...@kernel.org; Leo > Li ; M.h. Lian ; Mingkai Hu > ; Roy Zang ; > linux-...@vger.kernel.org; devicet...@vger.kernel.org; > linux-ker...@vger.ke

[PATCH kernel] KVM: PPC: Fix incorrect guest-to-user-translation error handling

2019-08-25 Thread Alexey Kardashevskiy
H_PUT_TCE_INDIRECT handlers receive a page with up to 512 TCEs from a guest. Although we verify correctness of TCEs before we do anything with the existing tables, there is a small window when a check in kvmppc_tce_validate might pass and right after that the guest alters the page with TCEs which c

Re: [PATCH] powerpc/mm: tell if a bad page fault on data is read or write.

2019-08-25 Thread Santosh Sivaraj
Christophe Leroy writes: > DSISR has a bit to tell if the fault is due to a read or a write. > > Display it. > > Signed-off-by: Christophe Leroy Reviewed-by: Santosh Sivaraj > --- > arch/powerpc/mm/fault.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/po

Re: [PATCH v2 4/8] powerpc/vdso32: inline __get_datapage()

2019-08-25 Thread Santosh Sivaraj
Hi Christophe, Christophe Leroy writes: > __get_datapage() is only a few instructions to retrieve the > address of the page where the kernel stores data to the VDSO. > > By inlining this function into its users, a bl/blr pair and > a mflr/mtlr pair is avoided, plus a few reg moves. > > The impro

[PATCH kernel v2 1/4] powerpc/powernv/ioda: Split out TCE invalidation from TCE updates

2019-08-25 Thread Alexey Kardashevskiy
At the moment updates in a TCE table are made by iommu_table_ops::exchange which update one TCE and invalidates an entry in the PHB/NPU TCE cache via set of registers called "TCE Kill" (hence the naming). Writing a TCE is a simple xchg() but invalidating the TCE cache is a relatively expensive OPAL

[PATCH kernel v2 0/4] powerpc/powernv/kvm: Invalidate multiple TCEs at once

2019-08-25 Thread Alexey Kardashevskiy
So far TCE cache updates (IOMMU translation cache on POWER8/9 PHB/NPU units) were barely noticeable; however with 100+GB guests we now see RCU stall warnings in guests because we spend too much time in the host system firmware which does actual TCE cache updates, hence this patchset. This is a r

[PATCH kernel v2 2/4] KVM: PPC: Invalidate multiple TCEs at once

2019-08-25 Thread Alexey Kardashevskiy
Invalidating a TCE cache entry for each updated TCE is quite expensive. This makes use of the new iommu_table_ops::xchg_no_kill()/tce_kill() callbacks to bring down the time spent in mapping a huge guest DMA window; roughly 20s to 10s for each guest's 100GB of DMA space. Signed-off-by: Alexey Kard

[PATCH kernel v2 3/4] vfio/spapr_tce: Invalidate multiple TCEs at once

2019-08-25 Thread Alexey Kardashevskiy
Invalidating a TCE cache entry for each updated TCE is quite expensive. This makes use of the new iommu_table_ops::xchg_no_kill()/tce_kill() callbacks to bring down the time spent in mapping a huge guest DMA window. Signed-off-by: Alexey Kardashevskiy --- drivers/vfio/vfio_iommu_spapr_tce.c | 18

[PATCH kernel v2 4/4] powerpc/powernv/ioda: Remove obsolete iommu_table_ops::exchange callbacks

2019-08-25 Thread Alexey Kardashevskiy
As now we have xchg_no_kill/tce_kill, these are not used anymore so remove them. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/iommu.h | 10 - arch/powerpc/kernel/iommu.c | 26 +--- arch/powerpc/platforms/powernv/pci-ioda.c | 50 -

[PATCH v4 2/2] powerpc/powernv: Add new opal message type

2019-08-25 Thread Vasant Hegde
We have OPAL_MSG_PRD message type to pass prd related messages from OPAL to `opal-prd`. It can handle messages upto 64 bytes. We have a requirement to send bigger than 64 bytes of data from OPAL to `opal-prd`. Lets add new message type (OPAL_MSG_PRD2) to pass bigger data. Cc: Jeremy Kerr Signed-o

[PATCH v4 1/2] powerpc/powernv: Enhance opal message read interface

2019-08-25 Thread Vasant Hegde
Use "opal-msg-size" device tree property to allocate memory for "opal_msg". Cc: Mahesh Salgaonkar Cc: Jeremy Kerr Signed-off-by: Vasant Hegde --- arch/powerpc/platforms/powernv/opal.c | 32 ++- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/arch/powerpc