[PATCH 2/4] scripts: sign-file: add firmware-signing option

2017-05-25 Thread AKASHI Takahiro
This new option (-f) allows us to create a signature file (*.p7s) for firmware binary. Signed-off-by: AKASHI Takahiro Cc: Luis R. Rodriguez --- scripts/sign-file.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/sign-file.c b/scripts/sign-file.c index

[PATCH 1/4] firmware: add firmware signing

2017-05-25 Thread AKASHI Takahiro
ns on the firmware_class API, extensions to enable this are expected however in the future. Cc: Rusty Russell Cc: David Howells Cc: Ming Lei Cc: Seth Forshee Cc: Kyle McMartin Cc: David Woodhouse Signed-off-by: Luis R. Rodriguez [akashi:migrated to driver data APIs] Signed-off-by: AKASHI Tak

[PATCH 0/4] firmware: signature verification

2017-05-25 Thread AKASHI Takahiro
, the patch is available: https://git.linaro.org/people/takahiro.akashi/linux-aarch64.git firmware/signature AKASHI Takahiro (4): firmware: add firmware signing scripts: sign-file: add firmware-signing option test: firmwware: add signature test

Re: [PATCH] kexec/kdump: Minor Documentation updates for arm64 and Image

2017-05-18 Thread AKASHI Takahiro
On Thu, May 18, 2017 at 01:59:14PM +0800, Dave Young wrote: > Add Takahiro and Pratyush, they should be able to review the arm64 part. > > On 05/18/17 at 11:03am, Bharat Bhushan wrote: > > This patch have minor updates in Documentation for arm64i as > > relocatable kernel. > > Also this patch upda

Re: [PATCH v6 3/5] test: add new driver_data load tester

2017-05-17 Thread AKASHI Takahiro
On Fri, May 12, 2017 at 05:59:23PM +0200, Luis R. Rodriguez wrote: > On Fri, May 12, 2017 at 09:28:47AM +0900, AKASHI Takahiro wrote: > > On Thu, May 11, 2017 at 11:32:30AM -0700, Luis R. Rodriguez wrote: > > > On Thu, May 11, 2017 at 11:26 AM, Luis R. Rodriguez > > >

Re: [PATCH v6 3/5] test: add new driver_data load tester

2017-05-11 Thread AKASHI Takahiro
On Thu, May 11, 2017 at 11:32:30AM -0700, Luis R. Rodriguez wrote: > On Thu, May 11, 2017 at 11:26 AM, Luis R. Rodriguez wrote: > > > > It would seems to make sense to me to only need to verify files when read > > for the first time, once its cache I don't see why we would re-verify them ? > > To

Re: [PATCH v6 3/5] test: add new driver_data load tester

2017-05-11 Thread AKASHI Takahiro
On Thu, May 11, 2017 at 08:26:29PM +0200, Luis R. Rodriguez wrote: > On Thu, May 11, 2017 at 07:46:27PM +0900, AKASHI Takahiro wrote: > > On Fri, Apr 28, 2017 at 03:45:35AM +0200, Luis R. Rodriguez wrote: > > > > > diff --git a/tools/testing/selftests/firmware/driver_da

Re: [PATCH v6 3/5] test: add new driver_data load tester

2017-05-11 Thread AKASHI Takahiro
Luis, On Fri, Apr 28, 2017 at 03:45:35AM +0200, Luis R. Rodriguez wrote: > > > +To test an async call one could do:: > > > + > > > +echo anything > /lib/firmware/test-driver_data.bin > > > > Your current shell script doesn't search for the firmware in > > /lib/firmware unless you explicit

Re: [PATCH v7 3/5] test: add new driver_data load tester

2017-05-11 Thread AKASHI Takahiro
Luis, On Tue, May 02, 2017 at 01:49:12AM -0700, Luis R. Rodriguez wrote: > > diff --git a/lib/test_driver_data.c b/lib/test_driver_data.c > new file mode 100644 > index ..488cc6e9eed4 > --- /dev/null > +++ b/lib/test_driver_data.c ... > +static int trigger_config_sync(struct drive

Re: [PATCH v6 2/5] firmware: add extensible driver data API

2017-04-27 Thread AKASHI Takahiro
Luis, On Fri, Apr 28, 2017 at 02:51:44AM +0200, Luis R. Rodriguez wrote: > On Thu, Apr 13, 2017 at 06:36:17PM +0900, AKASHI Takahiro wrote: > > On Wed, Mar 29, 2017 at 08:25:11PM -0700, Luis R. Rodriguez wrote: > > > Signed-off-by: Luis R. Rodriguez > > > --- >

Re: [PATCH] kexec: allocate buffer in top-down, if specified, correctly

2017-04-27 Thread AKASHI Takahiro
Thiago, Thank you for the comment. On Thu, Apr 27, 2017 at 07:00:04PM -0300, Thiago Jung Bauermann wrote: > Hello, > > Am Mittwoch, 26. April 2017, 17:22:09 BRT schrieb AKASHI Takahiro: > > The current kexec_locate_mem_hole(kbuf.top_down == 1) stops searching at > > the fir

[PATCH] kexec: allocate buffer in top-down, if specified, correctly

2017-04-26 Thread AKASHI Takahiro
bug, going though all the memory regions anyway. Signed-off-by: AKASHI Takahiro --- kernel/kexec_file.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index b118735fea9d..2f131c0d9017 100644 --- a/kernel

Re: [PATCH v6 2/5] firmware: add extensible driver data API

2017-04-13 Thread AKASHI Takahiro
On Wed, Mar 29, 2017 at 08:25:11PM -0700, Luis R. Rodriguez wrote: > The firmware API does not scale well: when new features are added we > either add a new exported symbol or extend the arguments of existing > routines. For the later case this means we need to traverse the kernel > with a slew of

Re: [PATCH v6 3/5] test: add new driver_data load tester

2017-04-11 Thread AKASHI Takahiro
On Wed, Mar 29, 2017 at 08:25:12PM -0700, Luis R. Rodriguez wrote: > This adds a load tester driver test_driver_data a for the new extensible > driver_data loader API, part of firmware_class. This test driver enables > you to build your tests in userspace by exposing knobs of the exported > API to

[PATCH] memblock: fix memblock_next_valid_pfn()

2017-03-02 Thread AKASHI Takahiro
Obviously, we should not access memblock.memory.regions[right] if 'right' is outside of [0..memblock.memory.cnt>. Fixes: b92df1de5d28 ("mm: page_alloc: skip over regions of invalid pfns where possible") Signed-off-by: AKASHI Takahiro --- mm/memblock.c | 5 - 1 fil

Re: [RFC PATCH v3 1/2] Add support for eXclusive Page Frame Ownership (XPFO)

2016-12-09 Thread AKASHI Takahiro
On Thu, Nov 24, 2016 at 07:56:30PM +0900, AKASHI Takahiro wrote: > Hi, > > I'm trying to give it a spin on arm64, but ... In my experiment on hikey, the kernel boot failed, catching a page fault around cache operations, (a) __clean_dcache_area_pou() on 4KB-page kernel, (b) __inv

Re: [PATCH v3] module: extend 'rodata=off' boot cmdline parameter to module mappings

2016-11-28 Thread AKASHI Takahiro
On Mon, Nov 28, 2016 at 08:59:40AM +0100, Andreas Ziegler wrote: > Hi Akashi, > > your patch "module: extend 'rodata=off' boot cmdline parameter to module > mappings" showed up in linux-next today, and I noticed a small error in it. > > The first modified #ifdef is fine, the second one, however,

Re: [RFC PATCH v3 1/2] Add support for eXclusive Page Frame Ownership (XPFO)

2016-11-24 Thread AKASHI Takahiro
Hi, I'm trying to give it a spin on arm64, but ... On Fri, Nov 04, 2016 at 03:45:33PM +0100, Juerg Haefliger wrote: > This patch adds support for XPFO which protects against 'ret2dir' kernel > attacks. The basic idea is to enforce exclusive ownership of page frames > by either the kernel or users

[PATCH v3] module: extend 'rodata=off' boot cmdline parameter to module mappings

2016-11-13 Thread AKASHI Takahiro
CONFIG_DEBUG_RODATA on x86 and arm64. Suggested-by: and Acked-by: Mark Rutland Signed-off-by: AKASHI Takahiro Reviewed-by: Kees Cook Cc: Rusty Russell Cc: Jessica Yu --- v3: * merge if-statements in disable_ro_nx() v2: * use CONFIG_DEBUG_RODATA/SET_MODULE_RONX guards better where approp

Re: module: extend 'rodata=off' boot cmdline parameter to module mappings

2016-11-13 Thread AKASHI Takahiro
On Sat, Nov 12, 2016 at 07:04:22PM -0800, Jessica Yu wrote: > +++ AKASHI Takahiro [21/10/16 10:13 +0900]: > >The current "rodata=off" parameter disables read-only kernel mappings > >under CONFIG_DEBUG_RODATA: > > commit d2aa1acad22f ("mm/init: Add 'ro

Re: [kernel-hardening] [PATCH] module: extend 'rodata=off' boot cmdline parameter to module mappings

2016-10-25 Thread AKASHI Takahiro
Rusty, Jessica On Wed, Oct 26, 2016 at 10:43:32AM +1030, Rusty Russell wrote: > AKASHI Takahiro writes: > > On Thu, Oct 20, 2016 at 01:48:15PM -0700, Kees Cook wrote: > >> On Wed, Oct 19, 2016 at 11:24 PM, AKASHI Takahiro > >> wrote: > >> > The current &q

[PATCH v2] module: extend 'rodata=off' boot cmdline parameter to module mappings

2016-10-20 Thread AKASHI Takahiro
CONFIG_DEBUG_RODATA on x86 and arm64. Suggested-by: Mark Rutland Signed-off-by: AKASHI Takahiro Reviewed-by: Kees Cook Cc: Rusty Russell --- v2: * use CONFIG_DEBUG_RODATA/SET_MODULE_RONX guards better where appropriate * make "rodata_enabled" variable as __ro_after_init v1: * remov

Re: [kernel-hardening] [PATCH] module: extend 'rodata=off' boot cmdline parameter to module mappings

2016-10-20 Thread AKASHI Takahiro
On Thu, Oct 20, 2016 at 01:48:15PM -0700, Kees Cook wrote: > On Wed, Oct 19, 2016 at 11:24 PM, AKASHI Takahiro > wrote: > > The current "rodata=off" parameter disables read-only kernel mappings > > under CONFIG_DEBUG_RODATA: > > commit d2aa1acad22f ("

[PATCH] module: extend 'rodata=off' boot cmdline parameter to module mappings

2016-10-19 Thread AKASHI Takahiro
CONFIG_DEBUG_RODATA on x86 and arm64. Suggested-by: Mark Rutland Signed-off-by: AKASHI Takahiro Cc: Rusty Russell --- v1: * remove RFC's "module_ronx=" and merge it with "rodata=" * always keep NX set if CONFIG_SET_MODULE_RONX include/linux/init.h | 3 ++-

[RFC] module: add 'module_ronx=off' boot cmdline parameter to disable ro/nx module mappings

2016-10-17 Thread AKASHI Takahiro
ter_init data ro. Any comments are welcome. Thanks, -Takahiro AKASHI ===8<=== >From aeb6bcdbe462251f5aab828ba58f2f64e9c51d69 Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Thu, 13 Oct 2016 14:39:20 +0900 Subject: [RFC] module: add 'module_ronx=off' boot cmdline parameter to di

Re: [RESEND PATCH] arm64: kgdb: fix single stepping

2016-09-20 Thread AKASHI Takahiro
Jason, On Mon, Sep 19, 2016 at 05:29:36PM -0500, Jason Wessel wrote: > On 09/15/2016 11:32 PM, AKASHI Takahiro wrote: > >@@ -176,18 +183,14 @@ int kgdb_arch_handle_exception(int exception_vector, > >int signo, > >>>

Re: [RESEND PATCH] arm64: kgdb: fix single stepping

2016-09-15 Thread AKASHI Takahiro
Hi Jason, Welcome back to mainline development. I've been looking forward to your comments. On Thu, Sep 15, 2016 at 08:04:57AM -0500, Jason Wessel wrote: > On 04/20/2015 08:13 PM, AKASHI Takahiro wrote: > >Jason, > > > >Could you please review my patch below? >

Re: [RESEND PATCH] arm64: kgdb: fix single stepping

2016-09-15 Thread AKASHI Takahiro
On Wed, Sep 14, 2016 at 03:58:51PM +0100, Will Deacon wrote: > Hi Akashi, > > On Tue, Apr 21, 2015 at 02:13:13AM +0100, AKASHI Takahiro wrote: > > Could you please review my patch below? > > See also arm64 maintainer's comment: > > http://lists.infradead.org

Re: [PATCH v3 2/3] hwmon: xgene: Add hwmon driver

2016-09-08 Thread AKASHI Takahiro
On Thu, Sep 08, 2016 at 11:47:59AM +0100, James Morse wrote: > Hi, > > On 08/09/16 09:14, Arnd Bergmann wrote: > > On Wednesday, September 7, 2016 3:37:05 PM CEST Guenter Roeck wrote: > >> On Wed, Sep 07, 2016 at 11:41:44PM +0200, Arnd Bergmann wrote: > >>> On Thursday, July 21, 2016 1:55:56 PM CE

Re: [PATCH v1] kdump, vmcoreinfo: report memory sections virtual addresses

2016-09-06 Thread AKASHI Takahiro
On Mon, Aug 29, 2016 at 06:11:37PM +0800, Baoquan He wrote: > Hi Thomas, > > I used below code and it works. Since using VMCOREINFO_NUMBER can reuse > the existing struct number_table to import the data. It makes change > easier. But the place could be next to KERNEL_IMAGE_SIZE, or as your > patch

Re: [RFC 0/3] extend kexec_file_load system call

2016-07-13 Thread AKASHI Takahiro
Apologies for the slow response. I'm attending LinuxCon this week. On Wed, Jul 13, 2016 at 10:34:47AM +0100, Mark Rutland wrote: > On Wed, Jul 13, 2016 at 10:36:14AM +0800, Dave Young wrote: > > But consider we can kexec to a different kernel and a different initrd so > > there > > will be use ca

[RFC 1/3] syscall: add kexec_file_load to generic unistd.h

2016-07-11 Thread AKASHI Takahiro
Currently kexec_file_load is supported only on x86, but it will be supported on powerpc and arm64 in near future. Since both archs use asm-generic/unistd.h, this patch adds the entry to this file. Signed-off-by: AKASHI Takahiro --- include/uapi/asm-generic/unistd.h | 8 +++- 1 file changed

[RFC 3/3] kexec: extend kexec_file_load system call

2016-07-11 Thread AKASHI Takahiro
]; } Signed-off-by: AKASHI Takahiro --- include/linux/fs.h | 1 + include/linux/kexec.h | 2 +- include/linux/syscalls.h | 4 +++- include/uapi/linux/kexec.h | 17 ++ kernel/kexec_file.c| 57 -- 5 files ch

[RFC 2/3] kexec: add dtb info to struct kimage

2016-07-11 Thread AKASHI Takahiro
be re-used, this change will be good enough for implementing kexec_file_load feature. Signed-off-by: AKASHI Takahiro --- include/linux/kexec.h | 3 +++ kernel/kexec_file.c | 5 + 2 files changed, 8 insertions(+) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index e8acb2b..55

[RFC 0/3] extend kexec_file_load system call

2016-07-11 Thread AKASHI Takahiro
une/016276.html AKASHI Takahiro (3): syscall: add kexec_file_load to generic unistd.h kexec: add dtb info to struct kimage kexec: extend kexec_file_load system call include/linux/fs.h| 1 + include/linux/kexec.h | 5 +++- include/linux/syscalls.h | 4 ++

Re: [RFC] arm64: kexec_file_load support

2016-07-11 Thread AKASHI Takahiro
On Fri, Jul 08, 2016 at 11:48:44AM -0300, Thiago Jung Bauermann wrote: > Am Donnerstag, 07 Juli 2016, 14:12:45 schrieb Dave Young: > > If so maybe change a bit from your precious mentioned 7 args proposal like > > below? > > > > struct kexec_file_fd { > > enum kexec_file_type; > > int fd;

Re: [RFC] arm64: kexec_file_load support

2016-07-05 Thread AKASHI Takahiro
On Mon, Jul 04, 2016 at 07:50:19PM -0300, Thiago Jung Bauermann wrote: > Hello, > > Am Montag, 04 Juli 2016, 15:58:15 schrieb AKASHI Takahiro: > > On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote: > > > I agree that it would be better if we could ha

Re: [RFC] arm64: kexec_file_load support

2016-07-05 Thread AKASHI Takahiro
Hi Dave, On Tue, Jul 05, 2016 at 09:25:56AM +0800, Dave Young wrote: > On 07/04/16 at 03:58pm, AKASHI Takahiro wrote: > > Hi, > > > > On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote: > > > Am Freitag, 01 Juli 2016, 14:11:12 schrieb AKASHI

Re: [RFC] arm64: kexec_file_load support

2016-07-03 Thread AKASHI Takahiro
Hi, On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote: > Am Freitag, 01 Juli 2016, 14:11:12 schrieb AKASHI Takahiro: > > I'm not sure whether there is any demand for kexec_file_load > > support on arm64, but anyhow I'm working on this and now > &g

[RFC] arm64: kexec_file_load support

2016-06-30 Thread AKASHI Takahiro
Hi, I'm not sure whether there is any demand for kexec_file_load support on arm64, but anyhow I'm working on this and now my early prototype code does work fine. There is, however, one essential issue: While arm64 kernel requires a device tree blob to be set up correctly at boot time, the current

Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel

2016-02-04 Thread AKASHI Takahiro
Jiri, Torsten Thank you for your explanation. On 02/03/2016 08:24 PM, Torsten Duwe wrote: On Wed, Feb 03, 2016 at 09:55:11AM +0100, Jiri Kosina wrote: On Wed, 3 Feb 2016, AKASHI Takahiro wrote: those efforts, we are proposing[1] a new *generic* gcc option, -fprolog-add=N. This option will

Re: [PATCH v6 1/9] ppc64 (le): prepare for -mprofile-kernel

2016-02-02 Thread AKASHI Takahiro
Hi, On 01/26/2016 12:26 AM, Torsten Duwe wrote: The gcc switch -mprofile-kernel, available for ppc64 on gcc > 4.8.5, allows to call _mcount very early in the function, which low-level ASM code and code patching functions need to consider. Especially the link register and the parameter registers

Re: [PATCH 2/5] arm64: cpufeature: Track unsigned fields

2015-11-18 Thread AKASHI Takahiro
, On 11/19/2015 02:08 AM, Suzuki K. Poulose wrote: Some of the feature bits have unsigned values and need to be treated accordingly to avoid errors. Adds the property to the feature bits and use the appropriate field extract helpers. Reported-by: AKASHI Takahiro Cc: Ard Biesheuvel Signed-off-by

Re: [PATCH v5 2/6] arm64: ftrace: fix a stack tracer's output under function graph tracer

2015-11-16 Thread AKASHI Takahiro
Jungseok, On 11/14/2015 12:01 AM, Jungseok Lee wrote: (+ Li Bin in CC) On Nov 10, 2015, at 11:42 AM, AKASHI Takahiro wrote: On 11/09/2015 11:04 PM, Jungseok Lee wrote: On Nov 6, 2015, at 3:44 PM, AKASHI Takahiro wrote: Hi Akashi, Function graph tracer modifies a return address (LR) in a

Re: [PATCH v5 5/6] arm64: ftrace: add arch-specific stack tracer

2015-11-10 Thread AKASHI Takahiro
Jungseok, On 11/10/2015 11:05 PM, Jungseok Lee wrote: On Nov 6, 2015, at 3:44 PM, AKASHI Takahiro wrote: Hi Akashi, Stack tracer on arm64, check_stack(), is uniqeue in the following points: * analyze a function prologue of a traced function to estimate a more accurate stack pointer value

Re: [PATCH v5 4/6] arm64: insn: add instruction decoders for ldp/stp and add/sub

2015-11-10 Thread AKASHI Takahiro
On 11/10/2015 10:40 PM, Jungseok Lee wrote: On Nov 6, 2015, at 3:44 PM, AKASHI Takahiro wrote: A function prologue analyzer is a requisite for implementing stack tracer and getting better views of stack usages on arm64. To implement a function prologue analyzer, we have to be able to decode, at

Re: [PATCH v5 0/6] arm64: ftrace: fix incorrect output from stack tracer

2015-11-09 Thread AKASHI Takahiro
On 11/09/2015 11:24 PM, Jungseok Lee wrote: On Nov 6, 2015, at 3:44 PM, AKASHI Takahiro wrote: Hi Akashi, This is the fifth patch series for fixing stack tracer on arm64. The original issue was reported by Jungseok[1], and then I found more issues[2]. We don't have to care about the ori

Re: [PATCH v5 2/6] arm64: ftrace: fix a stack tracer's output under function graph tracer

2015-11-09 Thread AKASHI Takahiro
On 11/09/2015 11:04 PM, Jungseok Lee wrote: On Nov 6, 2015, at 3:44 PM, AKASHI Takahiro wrote: Hi Akashi, Function graph tracer modifies a return address (LR) in a stack frame to hook a function return. This will result in many useless entries (return_to_handler) showing up in a stack

[PATCH v5 6/6] arm64: ftrace: add a test of function prologue analyzer

2015-11-05 Thread AKASHI Takahiro
t's fp at the exit of function prologue. "fp" is also an ofset against sp at the exit of function prologue. So normally, = + <"sp"> = - <"fp"> And the last line shows the number of possible errors in the result. For function_prologue_analy

[PATCH v5 4/6] arm64: insn: add instruction decoders for ldp/stp and add/sub

2015-11-05 Thread AKASHI Takahiro
are used solely by stack tracer for now, but generic enough for other uses. Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/insn.h | 18 arch/arm64/kernel/insn.c | 102 + 2 files changed, 120 insertions(+) diff --git a/arch

[PATCH v5 5/6] arm64: ftrace: add arch-specific stack tracer

2015-11-05 Thread AKASHI Takahiro
ions. Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/stacktrace.h |4 + arch/arm64/kernel/ftrace.c | 64 arch/arm64/kernel/stacktrace.c | 185 ++- 3 files changed, 250 insertions(+), 3 deletions(-) diff --git a/ar

[PATCH v5 3/6] ftrace: allow arch-specific stack tracer

2015-11-05 Thread AKASHI Takahiro
possibility that we will mistakenly detect a stale stack frame which has not been overwritten. This patch makes check_stack() a weak function so as to later implement arch-specific version. Signed-off-by: AKASHI Takahiro --- include/linux/ftrace.h | 10 ++ kernel/trace/trace_stack.c | 80

[PATCH v5 2/6] arm64: ftrace: fix a stack tracer's output under function graph tracer

2015-11-05 Thread AKASHI Takahiro
Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/ftrace.h |2 ++ arch/arm64/kernel/stacktrace.c | 21 + 2 files changed, 23 insertions(+) diff --git a/arch/arm64/include/asm/ftrace.h b/arch/arm64/include/asm/ftrace.h index c5534fa..3c60f37 100644 --- a/ar

[PATCH v5 1/6] arm64: ftrace: modify a stack frame in a safe way

2015-11-05 Thread AKASHI Takahiro
(). Signed-off-by: AKASHI Takahiro --- arch/arm64/kernel/ftrace.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c index c851be7..314f82d 100644 --- a/arch/arm64/kernel/ftrace.c +++ b/arch/arm64/kernel/ftra

[PATCH v5 0/6] arm64: ftrace: fix incorrect output from stack tracer

2015-11-05 Thread AKASHI Takahiro
15-July/354126.html [2] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/355920.html [3] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-September/368003.html [4] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/378699.html AKASHI Takahiro (6): arm64: f

Re: [PATCH v4 6/6] arm64: ftrace: add arch-specific stack tracer

2015-11-04 Thread AKASHI Takahiro
Jungseok, On 11/01/2015 05:30 PM, Jungseok Lee wrote: On Oct 30, 2015, at 2:25 PM, AKASHI Takahiro wrote: Hi Akashi, Stack tracer on arm64, check_stack(), is uniqeue in the following points: * analyze a function prologue of a traced function to estimate a more accurate stack pointer value

Re: [PATCH v4 3/6] arm64: ftrace: fix a stack tracer's output under function graph tracer

2015-11-03 Thread AKASHI Takahiro
On 11/01/2015 05:00 PM, Jungseok Lee wrote: On Oct 30, 2015, at 2:25 PM, AKASHI Takahiro wrote: Hi Akashi, Function graph tracer modifies a return address (LR) in a stack frame to hook a function return. This will result in many useless entries (return_to_handler) showing up in a stack

[PATCH v4 5/6] arm64: insn: add instruction decoders for ldp/stp and add/sub

2015-10-29 Thread AKASHI Takahiro
are used solely by stack tracer for now, but generic enough for other uses. Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/insn.h | 18 arch/arm64/kernel/insn.c | 102 + 2 files changed, 120 insertions(+) diff --git a/arch

[PATCH v4 2/6] arm64: ftrace: modify a stack frame in a safe way

2015-10-29 Thread AKASHI Takahiro
(). Signed-off-by: AKASHI Takahiro --- arch/arm64/kernel/ftrace.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c index c851be7..314f82d 100644 --- a/arch/arm64/kernel/ftrace.c +++ b/arch/arm64/kernel/ftra

[PATCH v4 6/6] arm64: ftrace: add arch-specific stack tracer

2015-10-29 Thread AKASHI Takahiro
ions. Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/stacktrace.h |4 + arch/arm64/kernel/ftrace.c | 68 + arch/arm64/kernel/stacktrace.c | 185 ++- 3 files changed, 254 insertions(+), 3 deletions(-) diff --git a/ar

[PATCH v4 4/6] ftrace: allow arch-specific stack tracer

2015-10-29 Thread AKASHI Takahiro
possibility that we will mistakenly detect a stale stack frame which has not been overwritten. This patch makes check_stack() a weak function so as to later implement arch-specific version. Signed-off-by: AKASHI Takahiro --- include/linux/ftrace.h | 10 ++ kernel/trace/trace_stack.c | 80

[PATCH v4 3/6] arm64: ftrace: fix a stack tracer's output under function graph tracer

2015-10-29 Thread AKASHI Takahiro
Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/ftrace.h |2 ++ arch/arm64/kernel/stacktrace.c | 21 + 2 files changed, 23 insertions(+) diff --git a/arch/arm64/include/asm/ftrace.h b/arch/arm64/include/asm/ftrace.h index 2b43e20..b7d597c 100644 --- a/ar

[PATCH v4 0/6] arm64: ftrace: fix incorrect output from stack tracer

2015-10-29 Thread AKASHI Takahiro
dead.org/pipermail/linux-arm-kernel/2015-July/355920.html [3] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-September/368003.html [4] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/378699.html AKASHI Takahiro (6): arm64: ftrace: adjust callsite addresses exami

[PATCH v4 1/6] arm64: ftrace: adjust callsite addresses examined by stack tracer

2015-10-29 Thread AKASHI Takahiro
es an arch-defined macro, FTRACE_STACK_FRAME_OFFSET, so that check_stack() can handle this case correctly. Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/ftrace.h |5 +++-- arch/arm64/kernel/stacktrace.c |7 --- include/linux/ftrace.h |7 +++ kernel/trace/tra

Re: [PATCH] recordmcount: arm64: replace the ignored mcount call into nop

2015-10-28 Thread AKASHI Takahiro
On 10/28/2015 08:58 PM, Will Deacon wrote: On Wed, Oct 28, 2015 at 04:16:19AM -0400, Steven Rostedt wrote: On Wed, 28 Oct 2015 16:04:05 +0800 Li Bin wrote: By now, the recordmcount only records the function that in following sections: .text/.ref.text/.sched.text/.spinlock.text/.irqentry.text/

Re: [PATCH v3 0/7] arm64: ftrace: fix incorrect output from stack tracer

2015-10-28 Thread AKASHI Takahiro
On 10/29/2015 12:23 AM, Will Deacon wrote: On Thu, Oct 08, 2015 at 07:01:37PM +0900, AKASHI Takahiro wrote: This is the third patch series for fixing stack tracer on arm64. The original issue was reported by Jungseok[1], and then I found more issues[2]. (Steven, Jungseok, sorry for not replying

Re: [PATCH v2 1/2] arm64: revamp unwind_frame for interrupt stack

2015-10-20 Thread AKASHI Takahiro
On 10/20/2015 10:26 PM, Jungseok Lee wrote: On Oct 20, 2015, at 5:00 PM, AKASHI Takahiro wrote: This patch allows unwind_frame() to traverse from interrupt stack to process stack correctly by having a dummy stack frame for irq exception entry created at its prologue. Signed-off-by: AKASHI

[PATCH v2 2/2] arm64: fix dump_backtrace() to show correct pt_regs at interrupt

2015-10-20 Thread AKASHI Takahiro
is can happen even without this patch if CONFIG_FUNCTION_GRAPH_TRACER is enabled.) Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/exception.h |7 +++ arch/arm64/include/asm/traps.h |7 --- arch/arm64/kernel/traps.c |9 +++-- arch/arm64/kernel/vmlinux.lds.S|7 ++

[PATCH v2 1/2] arm64: revamp unwind_frame for interrupt stack

2015-10-20 Thread AKASHI Takahiro
This patch allows unwind_frame() to traverse from interrupt stack to process stack correctly by having a dummy stack frame for irq exception entry created at its prologue. Signed-off-by: AKASHI Takahiro --- arch/arm64/kernel/entry.S | 22 -- arch/arm64/kernel

[PATCH v2 0/2] arm64: unwind_frame for interrupt stack

2015-10-20 Thread AKASHI Takahiro
/378699.html [2] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/377723.html [3] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/378700.html AKASHI Takahiro (2): arm64: revamp unwind_frame for interrupt stack arm64: fix dump_backtrace() to show correct

Re: [PATCH v5] arm64: Introduce IRQ stack

2015-10-18 Thread AKASHI Takahiro
. - Jungseok] Cc: AKASHI Takahiro Cc: James Morse Signed-off-by: Jungseok Lee --- I've used Cc', not Tested-by tag, from James, since there is a gap between v4 and v5. Changes since v4: - Supported 64KB page system - Introduced IRQ_STACK_* macro, per Catalin - Rebased on top of for

Re: [PATCH v4 2/2] arm64: Expand the stack trace feature to support IRQ stack

2015-10-18 Thread AKASHI Takahiro
Jungseok, On 10/15/2015 10:39 PM, Jungseok Lee wrote: On Oct 15, 2015, at 1:19 PM, AKASHI Takahiro wrote: Jungseok, 8< diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index f93aae5..e18be43 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/trap

Re: [PATCH v5 1/2] arm64: kvm: allows kvm cpu hotplug

2015-10-15 Thread AKASHI Takahiro
James, I reproduced the problem on Hikey board, but On 10/13/2015 07:43 PM, James Morse wrote: Hi, On 13/10/15 06:38, AKASHI Takahiro wrote: On 10/12/2015 10:28 PM, James Morse wrote: On 29/05/15 06:38, AKASHI Takahiro wrote: The current kvm implementation on arm64 does cpu-specific

Re: [PATCH v4 2/2] arm64: Expand the stack trace feature to support IRQ stack

2015-10-14 Thread AKASHI Takahiro
Jungseok, On 10/14/2015 09:55 PM, Jungseok Lee wrote: On Oct 14, 2015, at 9:24 PM, Jungseok Lee wrote: On Oct 14, 2015, at 4:13 PM, AKASHI Takahiro wrote: On 10/09/2015 11:24 PM, James Morse wrote: Hi Jungseok, On 07/10/15 16:28, Jungseok Lee wrote: Currently, a call trace drops a process

Re: [PATCH v4 2/2] arm64: Expand the stack trace feature to support IRQ stack

2015-10-14 Thread AKASHI Takahiro
On 10/09/2015 11:24 PM, James Morse wrote: Hi Jungseok, On 07/10/15 16:28, Jungseok Lee wrote: Currently, a call trace drops a process stack walk when a separate IRQ stack is used. It makes a call trace information much less useful when a system gets paniked in interrupt context. panicked T

Re: [PATCH v3 1/7] arm64: ftrace: adjust callsite addresses examined by stack tracer

2015-10-13 Thread AKASHI Takahiro
On 10/14/2015 12:37 AM, Steven Rostedt wrote: On Thu, 8 Oct 2015 19:01:38 +0900 AKASHI Takahiro wrote: extern int stack_tracer_enabled; int stack_trace_sysctl(struct ctl_table *table, int write, diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c index b746399..30521ea

Re: [PATCH v3 3/7] arm64: ftrace: fix a stack tracer's output under function graph tracer

2015-10-13 Thread AKASHI Takahiro
On 10/14/2015 12:24 AM, Jungseok Lee wrote: On Oct 8, 2015, at 7:01 PM, AKASHI Takahiro wrote: Hi Akashi, Function graph tracer modifies a return address (LR) in a stack frame to hook a function return. This will result in many useless entries (return_to_handler) showing up in a stack

Re: [PATCH v5 1/2] arm64: kvm: allows kvm cpu hotplug

2015-10-12 Thread AKASHI Takahiro
On 10/12/2015 10:28 PM, James Morse wrote: On 29/05/15 06:38, AKASHI Takahiro wrote: The current kvm implementation on arm64 does cpu-specific initialization at system boot, and has no way to gracefully shutdown a core in terms of kvm. This prevents, especially, kexec from rebooting the system

[PATCH v3 3/7] arm64: ftrace: fix a stack tracer's output under function graph tracer

2015-10-08 Thread AKASHI Takahiro
Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/ftrace.h |2 ++ arch/arm64/kernel/stacktrace.c | 20 2 files changed, 22 insertions(+) diff --git a/arch/arm64/include/asm/ftrace.h b/arch/arm64/include/asm/ftrace.h index 2b43e20..b7d597c 100644 --- a/arch/arm64

[PATCH v3 6/7] arm64: insn: add instruction decoders for ldp/stp and add/sub

2015-10-08 Thread AKASHI Takahiro
are used solely by stack tracer for now, but generic enough for other uses. Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/insn.h | 18 arch/arm64/kernel/insn.c | 102 + 2 files changed, 120 insertions(+) diff --git a/arch

[PATCH v3 4/7] arm64: ftrace: allow for tracing leaf functions

2015-10-08 Thread AKASHI Takahiro
under ftrace. This patch allows for tracing leaf functions by adding -fno-omit-leaf-frame-pointer option, but does it only when CONFIG_STACK_TRACER is configured because it will increase the kernel size and add extra instructions on runtime. Signed-off-by: AKASHI Takahiro --- arch/arm64/Makefile

[PATCH v3 7/7] arm64: ftrace: add arch-specific stack tracer

2015-10-08 Thread AKASHI Takahiro
ions. Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/stacktrace.h |1 + arch/arm64/kernel/ftrace.c | 66 + arch/arm64/kernel/stacktrace.c | 186 ++- 3 files changed, 250 insertions(+), 3 deletions(-) diff --git a/ar

[PATCH v3 5/7] ftrace: allow arch-specific stack tracer

2015-10-08 Thread AKASHI Takahiro
possibility that we will mistakenly detect a stale stack frame which has not been overwritten. This patch makes check_stack() a weak function so as to later implement arch-specific version. Signed-off-by: AKASHI Takahiro --- include/linux/ftrace.h | 10 ++ kernel/trace/trace_stack.c | 22

[PATCH v3 1/7] arm64: ftrace: adjust callsite addresses examined by stack tracer

2015-10-08 Thread AKASHI Takahiro
es an arch-defined macro, FTRACE_STACK_FRAME_OFFSET, so that check_stack() can handle this case correctly. Signed-off-by: AKASHI Takahiro --- arch/arm64/include/asm/ftrace.h |5 +++-- arch/arm64/kernel/stacktrace.c |7 --- include/linux/ftrace.h |7 +++ kernel/trace/tra

[PATCH v3 2/7] arm64: ftrace: modify a stack frame in a safe way

2015-10-08 Thread AKASHI Takahiro
(). Signed-off-by: AKASHI Takahiro --- arch/arm64/kernel/ftrace.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c index c851be7..314f82d 100644 --- a/arch/arm64/kernel/ftrace.c +++ b/arch/arm64/kernel/ftra

[PATCH v3 0/7] arm64: ftrace: fix incorrect output from stack tracer

2015-10-08 Thread AKASHI Takahiro
linux-arm-kernel/2015-July/355920.html [3] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-September/368003.html [4] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-September/371451.html AKASHI Takahiro (7): arm64: ftrace: adjust callsite addresses examined by stack t

Re: [PATCH v3] arm64: Introduce IRQ stack

2015-10-04 Thread AKASHI Takahiro
On 10/04/2015 11:32 PM, Jungseok Lee wrote: On Oct 3, 2015, at 1:23 AM, James Morse wrote: Hi, Hi James, On 22/09/15 13:11, Jungseok Lee wrote: Currently, kernel context and interrupts are handled using a single kernel stack navigated by sp_el1. This forces a system to use 16KB stack, not

Re: [PATCH] arm64: ftrace: fix function_graph tracer panic

2015-10-02 Thread AKASHI Takahiro
> Do I take this as an ack? Yes, but On 10/02/2015 12:27 AM, Catalin Marinas wrote: On Thu, Oct 01, 2015 at 03:11:29PM +0900, AKASHI Takahiro wrote: On 09/30/2015 11:49 AM, Li Bin wrote: When function graph tracer is enabled, the following operation will trigger panic: mount -t debu

Re: [PATCH] arm64: ftrace: fix function_graph tracer panic

2015-09-30 Thread AKASHI Takahiro
On 09/30/2015 11:49 AM, Li Bin wrote: When function graph tracer is enabled, the following operation will trigger panic: mount -t debugfs nodev /sys/kernel echo next_tgid > /sys/kernel/tracing/set_ftrace_filter echo function_graph > /sys/kernel/tracing/current_tracer ls /proc/ [ cut

Re: [PATCH] selftests/seccomp: build on aarch64, document ABI

2015-09-10 Thread AKASHI Takahiro
On 09/10/2015 04:30 AM, Kees Cook wrote: The syscall ABI is inconsistent on aarch64 compat, so at least we should document it in the seccomp_bpf tests. Signed-off-by: Kees Cook --- Can someone with access to native aarch64 double-check this for me? I think we need to change these tests to pass

Re: [PATCH] arm64: kernel: Use a separate stack for irq interrupts.

2015-09-08 Thread AKASHI Takahiro
On 09/07/2015 11:36 PM, James Morse wrote: Having to handle interrupts on top of an existing kernel stack means the kernel stack must be large enough to accomodate both the maximum kernel usage, and the maximum irq handler usage. Switching to a different stack when processing irqs allows us to ma

Re: [PATCH] arm64: kernel: Use a separate stack for irq interrupts.

2015-09-07 Thread AKASHI Takahiro
On 09/08/2015 10:45 AM, AKASHI Takahiro wrote: Jungseok, On 09/08/2015 01:34 AM, Jungseok Lee wrote: On Sep 8, 2015, at 1:06 AM, James Morse wrote: On 07/09/15 16:48, Jungseok Lee wrote: On Sep 7, 2015, at 11:36 PM, James Morse wrote: Hi James, Having to handle interrupts on top of an

Re: [PATCH] arm64: kernel: Use a separate stack for irq interrupts.

2015-09-07 Thread AKASHI Takahiro
Jungseok, On 09/08/2015 01:34 AM, Jungseok Lee wrote: On Sep 8, 2015, at 1:06 AM, James Morse wrote: On 07/09/15 16:48, Jungseok Lee wrote: On Sep 7, 2015, at 11:36 PM, James Morse wrote: Hi James, Having to handle interrupts on top of an existing kernel stack means the kernel stack must be

Re: [RFC v2 1/4] ftrace: allow arch-specific check_stack()

2015-08-16 Thread AKASHI Takahiro
Will, On 08/12/2015 02:03 AM, Will Deacon wrote: On Tue, Aug 04, 2015 at 08:44:06AM +0100, AKASHI Takahiro wrote: A stack frame pointer may be used in a different way depending on cpu architecture. Thus it is not always appropriate to slurp the stack contents, as currently done in check_stack

Re: [RFC v2 4/4] arm64: ftrace: add a stack frame for exception handler

2015-08-16 Thread AKASHI Takahiro
On 08/11/2015 11:57 PM, Jungseok Lee wrote: On Aug 4, 2015, at 4:44 PM, AKASHI Takahiro wrote: Hi Akashi, On arm64, an exception handler use the same stack as in non-exception contexts, but doesn't create a stack frame for elx_xx entry, only updating sp register. This behavior resul

Re: [RFC v2 0/4] arm64: ftrace: fix incorrect output from stack tracer

2015-08-16 Thread AKASHI Takahiro
Hi On 08/11/2015 11:52 PM, Jungseok Lee wrote: On Aug 4, 2015, at 4:44 PM, AKASHI Takahiro wrote: Hi Akashi, See the following threads [1],[2] for the background. With this patch series, I'm trying to fix several problems I noticed with stack tracer on arm64. But it is rather experim

Re: [v2 2/5] arm64: kdump: implement machine_crash_shutdown()

2015-08-06 Thread AKASHI Takahiro
Marc, On 08/07/2015 12:51 AM, Marc Zyngier wrote: Hi, On 06/08/15 08:09, AKASHI Takahiro wrote: Marc, Mark Sorry for not revisiting your comment below for a while. Wow. It took me a few minutes to page the context back in. Please don't purge the page from your cache for a while :)

Re: [v2 2/5] arm64: kdump: implement machine_crash_shutdown()

2015-08-06 Thread AKASHI Takahiro
Marc, Mark Sorry for not revisiting your comment below for a while. On 04/24/2015 07:43 PM, Marc Zyngier wrote: On 24/04/15 11:39, Mark Rutland wrote: On Fri, Apr 24, 2015 at 08:53:05AM +0100, AKASHI Takahiro wrote: kdump calls machine_crash_shutdown() to shut down non-boot cpus and save per

[RFC v2 4/4] arm64: ftrace: add a stack frame for exception handler

2015-08-04 Thread AKASHI Takahiro
frame for this case, and puts an additional entry for the function in a stack trace list. Signed-off-by: AKASHI Takahiro --- arch/arm64/kernel/entry.S |4 arch/arm64/kernel/stacktrace.c | 17 + 2 files changed, 21 insertions(+) diff --git a/arch/arm64/kernel/entr

[RFC v2 2/4] arm64: ftrace: add arch-specific stack tracer

2015-08-04 Thread AKASHI Takahiro
-by: AKASHI Takahiro --- arch/arm64/include/asm/ftrace.h |2 ++ arch/arm64/kernel/ftrace.c | 37 + arch/arm64/kernel/stacktrace.c | 58 +-- 3 files changed, 95 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include

<    1   2   3   4   5   6   7   8   >