Re: [PATCH 1/2] nds32: remove dump_instr

2020-07-21 Thread Nick Hu
> - > - set_fs(fs); > -} > - > #define LOOP_TIMES (100) > static void __dump(struct task_struct *tsk, unsigned long *base_reg, > const char *loglvl) > @@ -179,7 +145,6 @@ void die(const char *str, struct pt_regs *regs, int err) > > if (!user_mode(regs) || in_interrupt()) { > dump_mem("Stack: ", regs->sp, (regs->sp + PAGE_SIZE) & > PAGE_MASK); > - dump_instr(regs); > dump_stack(); > } > > -- > 2.27.0 > Acked-by: Nick Hu

Re: [PATCH 2/2] nds32: use get_kernel_nofault in dump_mem

2020-07-21 Thread Nick Hu
6 @@ void dump_mem(const char *lvl, unsigned long bottom, > unsigned long top) > } > pr_emerg("%s%04lx:%s\n", lvl, first & 0x, str); > } > - > - set_fs(fs); > } > > EXPORT_SYMBOL(dump_mem); > -- > 2.27.0 > Hi Christoph, Thank you! Acked-by: Nick Hu

[PATCH v2 0/2] KASAN support for RISC-V

2019-10-02 Thread Nick Hu
KASAN is an important runtime memory debugging feature in linux kernel which can detect use-after-free and out-of- bounds problems. Changes in v2: - Remove the porting of memmove and exclude the check instead. - Fix some code noted by Christoph Hellwig Nick Hu (2): kasan: Archs don't check

[PATCH v2 1/2] kasan: Archs don't check memmove if not support it.

2019-10-02 Thread Nick Hu
Skip the memmove checking for those archs who don't support it. Signed-off-by: Nick Hu --- mm/kasan/common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/kasan/common.c b/mm/kasan/common.c index 6814d6d6a023..897f9520bab3 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c

[PATCH v2 2/2] riscv: Add KASAN support

2019-10-02 Thread Nick Hu
to VMALLOC area, to the kasan_early_shadow_page because we don't have enough physical space for all the shadow memory corresponding to VMALLOC area. Signed-off-by: Nick Hu --- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/kasan.h | 27 arch/riscv/include/asm

Re: [PATCH 2/2] riscv: Add KASAN support

2019-09-03 Thread Nick Hu
Hi Daniel, On Wed, Sep 04, 2019 at 01:08:51AM +1000, Daniel Axtens wrote: > Nick Hu writes: > > > Hi Christoph, > > > > Thanks for your reply. I will answer one by one. > > > > Hi Alexander, > > > > Would you help me for the question about SOFTI

Re: [PATCH 1/2] riscv: Add memmove string operation.

2019-08-27 Thread Nick Hu
Hi Paul, On Tue, Aug 27, 2019 at 05:33:11PM +0800, Andrey Ryabinin wrote: > > > On 8/27/19 12:07 PM, Nick Hu wrote: > > Hi Andrey > > > > On Thu, Aug 22, 2019 at 11:59:02PM +0800, Andrey Ryabinin wrote: > >> On 8/7/19 10:19 AM, Nick Hu wrote: >

Re: [PATCH 1/2] riscv: Add memmove string operation.

2019-08-27 Thread Nick Hu
Hi Andrey On Thu, Aug 22, 2019 at 11:59:02PM +0800, Andrey Ryabinin wrote: > On 8/7/19 10:19 AM, Nick Hu wrote: > > There are some features which need this string operation for compilation, > > like KASAN. So the purpose of this porting is for the features like KASAN > > whi

Re: [PATCH 1/2] riscv: Add memmove string operation.

2019-08-19 Thread Nick Hu
Hi Paul, On Thu, Aug 15, 2019 at 11:27:51AM -0700, Paul Walmsley wrote: > On Thu, 15 Aug 2019, Nick Hu wrote: > > > On Wed, Aug 14, 2019 at 10:03:39AM -0700, Paul Walmsley wrote: > > > > > Thanks for the explanation. What do you think about Palmer's idea to &

Re: [PATCH 1/2] riscv: Add memmove string operation.

2019-08-14 Thread Nick Hu
Hi Paul, On Wed, Aug 14, 2019 at 10:03:39AM -0700, Paul Walmsley wrote: > Hi Nick, > > On Wed, 14 Aug 2019, Nick Hu wrote: > > > On Wed, Aug 14, 2019 at 10:22:15AM +0800, Paul Walmsley wrote: > > > On Tue, 13 Aug 2019, Palmer Dabbelt wrote: > > > > > &

Re: [PATCH 2/2] riscv: Add KASAN support

2019-08-14 Thread Nick Hu
Hi Christoph, Thanks for your reply. I will answer one by one. Hi Alexander, Would you help me for the question about SOFTIRQENTRY_TEXT? On Mon, Aug 12, 2019 at 11:10:50PM +0800, Christoph Hellwig wrote: > > 2. KASAN can't debug the modules since the modules are allocated in VMALLOC > > area.

Re: [PATCH 1/2] riscv: Add memmove string operation.

2019-08-13 Thread Nick Hu
On Wed, Aug 14, 2019 at 10:22:15AM +0800, Paul Walmsley wrote: > On Tue, 13 Aug 2019, Palmer Dabbelt wrote: > > > On Mon, 12 Aug 2019 08:04:46 PDT (-0700), Christoph Hellwig wrote: > > > On Wed, Aug 07, 2019 at 03:19:14PM +0800, Nick Hu wrote: > > > > T

[PATCH 1/2] riscv: Add memmove string operation.

2019-08-07 Thread Nick Hu
string operations. Since we don't have this in current kernel, this patch provides the implementation. This porting refers to the 'arch/nds32/lib/memmove.S'. Signed-off-by: Nick Hu --- arch/riscv/include/asm/string.h |3 ++ arch/riscv/kernel/riscv_ksyms.c |1 + arch/riscv/lib/Makefile

[PATCH 2/2] riscv: Add KASAN support

2019-08-07 Thread Nick Hu
to VMALLOC area, to the kasan_early_shadow_page because we don't have enough physical space for all the shadow memory corresponding to VMALLOC area. Signed-off-by: Nick Hu --- arch/riscv/Kconfig |2 + arch/riscv/include/asm/kasan.h | 26 + arch/riscv/include/asm

[PATCH 0/2] KASAN support for RISC-V

2019-08-07 Thread Nick Hu
KASAN is an important runtime memory debugging feature in linux kernel which can detect use-after-free and out-of- bounds problems. There are two patches in this letter: 1. Porting the memmove string operation. 2. Porting the feature KASAN. Nick Hu (2): riscv: Add memmove string operation

[PATCH v3] riscv: Fix udelay in RV32.

2019-05-30 Thread Nick Hu
In RV32, udelay would delay the wrong cycle. When it shifts right "UDELAY_SHITFT" bits, it either delays 0 cycle or 1 cycle. It only works correctly in RV64. Because the 'ucycles' always needs to be 64 bits variable. Signed-off-by: Nick Hu Reviewed-by: Palmer Dabbelt --- arch/riscv/l

Re: [PATCH v2] riscv: Fix udelay in RV32.

2019-05-30 Thread Nick Hu
64 bits > variable. > > Signed-off-by: Nick Hu > --- > arch/riscv/lib/delay.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/lib/delay.c b/arch/riscv/lib/delay.c > index dce8ae24c6d3..ee6853c1e341 100644 > --- a/arch/riscv/lib/

[PATCH v2] riscv: Fix udelay in RV32.

2019-05-30 Thread Nick Hu
In RV32, udelay would delay the wrong cycle. When it shifts right "UDELAY_SHITFT" bits, it either delays 0 cycle or 1 cycle. It only works correctly in RV64. Because the 'ucycles' always needs to be 64 bits variable. Signed-off-by: Nick Hu --- arch/riscv/lib/delay.c | 2 +- 1 file

Re: [PATCH] riscv: Fix udelay in RV32.

2019-05-30 Thread Nick Hu
On Thu, May 30, 2019 at 01:52:58PM +0800, Christoph Hellwig wrote: > On Tue, May 28, 2019 at 05:26:49PM +0800, Nick Hu wrote: > > In RV32, udelay would delay the wrong cycle. > > When it shifts right "UDELAY_SHITFT" bits, it > > either delays 0 cycle or 1 cycle. It o

[PATCH] riscv: Fix udelay in RV32.

2019-05-28 Thread Nick Hu
In RV32, udelay would delay the wrong cycle. When it shifts right "UDELAY_SHITFT" bits, it either delays 0 cycle or 1 cycle. It only works correctly in RV64. Because the 'ucycles' always needs to be 64 bits variable. Signed-off-by: Nick Hu --- arch/riscv/lib/delay.c | 2 +- 1 file

[PATCH v4 1/4] nds32: Fix bug in bitfield.h

2018-10-24 Thread Nick Hu
From: Nickhu There two bitfield bug for perfomance counter in bitfield.h: PFM_CTL_offSEL1 21 --> 16 PFM_CTL_offSEL2 27 --> 22 This commit fix it. Signed-off-by: Nickhu --- arch/nds32/include/asm/bitfield.h | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v4 1/4] nds32: Fix bug in bitfield.h

2018-10-24 Thread Nick Hu
From: Nickhu There two bitfield bug for perfomance counter in bitfield.h: PFM_CTL_offSEL1 21 --> 16 PFM_CTL_offSEL2 27 --> 22 This commit fix it. Signed-off-by: Nickhu --- arch/nds32/include/asm/bitfield.h | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v4 4/4] nds32: Add document for NDS32 PMU.

2018-10-24 Thread Nick Hu
From: Nickhu The document for how to add NDS32 PMU in devicetree. Signed-off-by: Nickhu Reviewed-by: Rob Herring --- .../devicetree/bindings/perf/nds32v3-pmu.txt| 17 + 1 file changed, 17 insertions(+) create mode 100644

[PATCH v4 2/4] nds32: Perf porting

2018-10-24 Thread Nick Hu
From: Nickhu This is the commit that porting the perf for nds32. 1.Raw event: The raw events start with 'r'. Usage: perf stat -e rXYZ ./app X: the index of performance counter. YZ: the index(convert

[PATCH v4 4/4] nds32: Add document for NDS32 PMU.

2018-10-24 Thread Nick Hu
From: Nickhu The document for how to add NDS32 PMU in devicetree. Signed-off-by: Nickhu Reviewed-by: Rob Herring --- .../devicetree/bindings/perf/nds32v3-pmu.txt| 17 + 1 file changed, 17 insertions(+) create mode 100644

[PATCH v4 2/4] nds32: Perf porting

2018-10-24 Thread Nick Hu
From: Nickhu This is the commit that porting the perf for nds32. 1.Raw event: The raw events start with 'r'. Usage: perf stat -e rXYZ ./app X: the index of performance counter. YZ: the index(convert

[PATCH v4 0/4] nds32: Perf support

2018-10-24 Thread Nick Hu
These four commits are perf supporting for nds32. There are three perfomance counters in nds32, and each of them can counts different events. You can use 'perf list' to show the available events that can be used. Changes in V2: 1. Change the definition 'PFM_CTL_xxx' to array form.

[PATCH v4 3/4] nds32: Add perf call-graph support.

2018-10-24 Thread Nick Hu
From: Nickhu The perf call-graph option can trace the callchain between functions. This commit add the perf callchain for nds32. There are kerenl callchain and user callchain. The kerenl callchain can trace the function in kernel space. There are two type for user callchain. One for the

[PATCH v4 0/4] nds32: Perf support

2018-10-24 Thread Nick Hu
These four commits are perf supporting for nds32. There are three perfomance counters in nds32, and each of them can counts different events. You can use 'perf list' to show the available events that can be used. Changes in V2: 1. Change the definition 'PFM_CTL_xxx' to array form.

[PATCH v4 3/4] nds32: Add perf call-graph support.

2018-10-24 Thread Nick Hu
From: Nickhu The perf call-graph option can trace the callchain between functions. This commit add the perf callchain for nds32. There are kerenl callchain and user callchain. The kerenl callchain can trace the function in kernel space. There are two type for user callchain. One for the

Re: [PATCH v3 4/4] nds32: Add document for NDS32 PMU.

2018-10-24 Thread Nick Hu
Hi Rob, On Thu, Oct 25, 2018 at 02:32:48AM +0800, Rob Herring wrote: > On Wed, Oct 24, 2018 at 11:32:40AM +0800, Nickhu wrote: > > The document for how to add NDS32 PMU > > in devicetree. > > > > Signed-off-by: Nickhu > > --- > > Documentation/devicetree/bindings/nds32/pmu.txt | 17

Re: [PATCH v3 4/4] nds32: Add document for NDS32 PMU.

2018-10-24 Thread Nick Hu
Hi Rob, On Thu, Oct 25, 2018 at 02:32:48AM +0800, Rob Herring wrote: > On Wed, Oct 24, 2018 at 11:32:40AM +0800, Nickhu wrote: > > The document for how to add NDS32 PMU > > in devicetree. > > > > Signed-off-by: Nickhu > > --- > > Documentation/devicetree/bindings/nds32/pmu.txt | 17

[PATCH v2 0/1] nds32: Power management

2018-10-24 Thread Nick Hu
This commit is power management porting for nds32. Changes in V2: 1. Fix the my complete name "Nickhu" to "Nick Hu". 2. Fix missing space in 'arch/nds32/kernel/sleep.S'. 3. Use normal bit operations to replace the array 'is_bit_1' in 'drivers/ir

[PATCH v2 1/1] nds32: Power management for nds32

2018-10-24 Thread Nick Hu
will be break and resume the system. Signed-off-by: Nick Hu Acked-by: Pavel Machek --- arch/nds32/Kconfig | 10 +++ arch/nds32/include/asm/suspend.h | 11 +++ arch/nds32/kernel/Makefile | 2 +- arch/nds32/kernel/pm.c | 79 +++ arch/nds32/kernel/sleep.S

[PATCH v2 0/1] nds32: Power management

2018-10-24 Thread Nick Hu
This commit is power management porting for nds32. Changes in V2: 1. Fix the my complete name "Nickhu" to "Nick Hu". 2. Fix missing space in 'arch/nds32/kernel/sleep.S'. 3. Use normal bit operations to replace the array 'is_bit_1' in 'drivers/ir

[PATCH v2 1/1] nds32: Power management for nds32

2018-10-24 Thread Nick Hu
will be break and resume the system. Signed-off-by: Nick Hu Acked-by: Pavel Machek --- arch/nds32/Kconfig | 10 +++ arch/nds32/include/asm/suspend.h | 11 +++ arch/nds32/kernel/Makefile | 2 +- arch/nds32/kernel/pm.c | 79 +++ arch/nds32/kernel/sleep.S

Re: [PATCH 1/1] nds32: Power management for nds32

2018-10-24 Thread Nick Hu
ate stack pointer to physical address > > and store to memory to save the stack pointer. Third, after write > > back and invalid the cache we hang in 'standby' intruction. > > When wakeup source trigger wake up events, the loop will be break > > and resume the system. > &g

Re: [PATCH 1/1] nds32: Power management for nds32

2018-10-24 Thread Nick Hu
ate stack pointer to physical address > > and store to memory to save the stack pointer. Third, after write > > back and invalid the cache we hang in 'standby' intruction. > > When wakeup source trigger wake up events, the loop will be break > > and resume the system. > &g

Re: [PATCH 5/5] nds32: Add document for NDS32 PMU.

2018-10-22 Thread Nick Hu
Hi Mark, On Thu, Oct 18, 2018 at 10:31:32PM +0800, Mark Rutland wrote: > On Thu, Oct 18, 2018 at 04:43:17PM +0800, Nickhu wrote: > > The document for how to add NDS32 PMU > > in devicetree. > > > > Signed-off-by: Nickhu > > --- > > Documentation/devicetree/bindings/nds32/pmu.txt | 17

Re: [PATCH 5/5] nds32: Add document for NDS32 PMU.

2018-10-22 Thread Nick Hu
Hi Mark, On Thu, Oct 18, 2018 at 10:31:32PM +0800, Mark Rutland wrote: > On Thu, Oct 18, 2018 at 04:43:17PM +0800, Nickhu wrote: > > The document for how to add NDS32 PMU > > in devicetree. > > > > Signed-off-by: Nickhu > > --- > > Documentation/devicetree/bindings/nds32/pmu.txt | 17

Re: [PATCH 2/5] nds32: Fix bug in bitfield.h

2018-10-22 Thread Nick Hu
Hi Mark, On Thu, Oct 18, 2018 at 10:26:31PM +0800, Mark Rutland wrote: > On Thu, Oct 18, 2018 at 04:43:14PM +0800, Nickhu wrote: > > There two bitfield bug for perfomance counter > > in bitfield.h: > > > > PFM_CTL_offSEL1 21 --> 16 > > PFM_CTL_offSEL2 27 --> 22 > > > >

Re: [PATCH 2/5] nds32: Fix bug in bitfield.h

2018-10-22 Thread Nick Hu
Hi Mark, On Thu, Oct 18, 2018 at 10:26:31PM +0800, Mark Rutland wrote: > On Thu, Oct 18, 2018 at 04:43:14PM +0800, Nickhu wrote: > > There two bitfield bug for perfomance counter > > in bitfield.h: > > > > PFM_CTL_offSEL1 21 --> 16 > > PFM_CTL_offSEL2 27 --> 22 > > > >

Re: [PATCH 1/5] nds32: Perf porting

2018-10-22 Thread Nick Hu
Hi Mark, On Thu, Oct 18, 2018 at 03:23:59PM +0100, Mark Rutland wrote: > HI, > > On Thu, Oct 18, 2018 at 04:43:13PM +0800, Nickhu wrote: > > +#define PFM_CTL_OVF(idx) PFM_CTL_mskOVF ## idx > > +#define PFM_CTL_EN(idx) PFM_CTL_mskEN ## idx > > +#define

Re: [PATCH 1/5] nds32: Perf porting

2018-10-22 Thread Nick Hu
Hi Mark, On Thu, Oct 18, 2018 at 03:23:59PM +0100, Mark Rutland wrote: > HI, > > On Thu, Oct 18, 2018 at 04:43:13PM +0800, Nickhu wrote: > > +#define PFM_CTL_OVF(idx) PFM_CTL_mskOVF ## idx > > +#define PFM_CTL_EN(idx) PFM_CTL_mskEN ## idx > > +#define

Re: [PATCH 4/5] nds32: Fix perf multiple events map to same counter.

2018-10-22 Thread Nick Hu
Hi Mark, On Thu, Oct 18, 2018 at 10:29:05PM +0800, Mark Rutland wrote: > On Thu, Oct 18, 2018 at 04:43:16PM +0800, Nickhu wrote: > > When there are multiple events map to the same counter, the counter > > counts inaccurately. This is because each counter only counts one event > > in the same

Re: [PATCH 4/5] nds32: Fix perf multiple events map to same counter.

2018-10-22 Thread Nick Hu
Hi Mark, On Thu, Oct 18, 2018 at 10:29:05PM +0800, Mark Rutland wrote: > On Thu, Oct 18, 2018 at 04:43:16PM +0800, Nickhu wrote: > > When there are multiple events map to the same counter, the counter > > counts inaccurately. This is because each counter only counts one event > > in the same

Re: [PATCH 1/1] Perf: Compile failed when compile with libelf.

2018-10-21 Thread Nick Hu
Hi Arnaldo, On Thu, Oct 18, 2018 at 10:56:10PM +0800, Arnaldo Carvalho de Melo wrote: > Em Thu, Oct 18, 2018 at 04:36:46PM +0800, Nickhu escreveu: > > The error message: > > = > > util/symbol-elf.c:46:12: error: static

Re: [PATCH 1/1] Perf: Compile failed when compile with libelf.

2018-10-21 Thread Nick Hu
Hi Arnaldo, On Thu, Oct 18, 2018 at 10:56:10PM +0800, Arnaldo Carvalho de Melo wrote: > Em Thu, Oct 18, 2018 at 04:36:46PM +0800, Nickhu escreveu: > > The error message: > > = > > util/symbol-elf.c:46:12: error: static