Re: [PATCH 17/19] csky: defconfig

2018-03-26 Thread Guo Ren
A_CONSOLE is not set > > +CONFIG_FRAMEBUFFER_CONSOLE=y > > +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y > > +CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y > > +CONFIG_LOGO=y > > +# CONFIG_LOGO_LINUX_MONO is not set > > +# CONFIG_LOGO_LINUX_VGA16 is not set > > For new platforms, using the DRM subsystem is the recommend > way to do graphics, it mostly replaces the framebuffer subsystem > here. These used by: https://github.com/c-sky/addons-linux/tree/master/addons/drivers/video/fbdev/nationalchip I'll consider the DRM subsystem. > > +CONFIG_STE_MODEM_RPROC=m > > I think this is no longer there. Yes, remove it. > > +CONFIG_EXT2_FS=y > > +CONFIG_EXT2_FS_XATTR=y > > +CONFIG_EXT2_FS_POSIX_ACL=y > > +CONFIG_EXT2_FS_SECURITY=y > > +CONFIG_EXT3_FS=y > > +CONFIG_EXT3_FS_POSIX_ACL=y > > +CONFIG_EXT3_FS_SECURITY=y > > Better use EXT4 for the defconfig instead. OK. Best Regards Guo Ren

Re: [PATCH 15/19] csky: Build infrastructure

2018-03-26 Thread Guo Ren
e DT always has this information as well, > so this can be changed in the future when desired, without having to > make incompatible changes to the devicetree binary files. Ok Best Regards Guo Ren

Re: [PATCH 10/19] csky: Signal handling

2018-03-26 Thread Guo Ren
On Mon, Mar 26, 2018 at 03:04:01PM +0200, Arnd Bergmann wrote: > On Sun, Mar 18, 2018 at 8:51 PM, Guo Ren wrote: > > Signed-off-by: Guo Ren > > --- > > arch/csky/include/uapi/asm/sigcontext.h | 33 +++ > > arch/csky/include/uapi/asm/signal.h | 164 +

Re: [PATCH 15/19] csky: Build infrastructure

2018-03-27 Thread Guo Ren
current design for abiv1? In abiv3, we will take your advice seriously. Best Regards Guo Ren

Re: [PATCH 17/19] csky: defconfig

2018-03-27 Thread Guo Ren
On Tue, Mar 27, 2018 at 09:48:23AM +0200, Arnd Bergmann wrote: > On Tue, Mar 27, 2018 at 4:21 AM, Guo Ren wrote: > > On Mon, Mar 26, 2018 at 03:16:31PM +0200, Arnd Bergmann wrote: > > >> > +CONFIG_CFG80211=y > >> > +CONFIG_CFG80211_DEBUGFS=y > >> >

Re: [PATCH 15/19] csky: Build infrastructure

2018-03-28 Thread Guo Ren
ble at the kernel level. Best Regards Guo Ren

Re: [PATCH 06/19] csky: IRQ handling

2018-03-19 Thread Guo Ren
explanation are bad. Yes, you are right. I will fixup them next. PSR is our Processor Status Register and it store the vector number. '10' is our auto-interrupt exception entry and we need get the irqno from the interrupt-controller. The "vector num > 32" is our vector interrupt exception entries, so we can calculate the irq-num by vector-num and no need to access the interrupt-controller's io regs. Best Regards Guo Ren

Re: [PATCH 14/19] csky: Misc headers

2018-03-19 Thread Guo Ren
Hi Arnd, On Tue, Mar 20, 2018 at 12:11:24AM +0800, Arnd Bergmann wrote: > On Mon, Mar 19, 2018 at 3:51 AM, Guo Ren wrote: > > +++ b/arch/csky/include/uapi/asm/fcntl.h > > @@ -0,0 +1,13 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +// Copyright (C) 2018 Hangzhou

Re: [PATCH 15/19] csky: Build infrastructure

2018-03-20 Thread Guo Ren
-dse? This is from "gcc-4.5 compile linux-4.7" and it will cause wrong code without -fno-tree-dse for list.h. Now we use gcc-6.3, so I will try to remove it. > > +++ b/arch/csky/abiv1/Makefile > > @@ -0,0 +1,8 @@ > > +obj-y += src/bswapdi.o > > +obj-y += src/bswapsi.o > > +obj-y += src/cacheflush.o > > +obj-y += src/memcpy.o > > +obj-y += src/mmap.o > > + > > +obj-$(CONFIG_CPU_NEED_SOFTALIGN) +=src/alignment.o > > Better not use subdirectories like that. Ok, I will change them like this: obj-y += bswapdi.o obj-y += bswapsi.o ... > Can you explain why you need the alignement fixups? For abiv1 ck610 couldn't handle the unalignment address access, so we need soft-alignment exception to fixup. There is no problem in abiv2 cpus. Best Regards Guo Ren

Re: [PATCH 14/19] csky: Misc headers

2018-03-20 Thread Guo Ren
On Tue, Mar 20, 2018 at 03:54:53PM +0800, Arnd Bergmann wrote: > We generally assume that any upstream kernel ABI cannot be changed, so this > has to be changed before the code gets merged upstream. > > You can obviously maintain the old and the new ABI in parallel for a while, > until the libc

Re: [PATCH 16/19] csky: Device tree

2018-03-20 Thread Guo Ren
+ ohci0: ohci-hcd0 { > The names here should be "usb@...", not "ehci-hcd" Ok > > + chosen { > > + bootargs = "console=ttyS0,115200 rdinit=/sbin/init > > root=/dev/ram0"; > > + }; > > The bootargs should not be in the dts file normally, they should come from the > boot loader. I want to keep bootargs in dts, because the bootloader only pass the dtb to kernel. > For the console, use the "stdout-path" property. Ok Best Regards Guo Ren

Re: [PATCH 19/19] irqchip: add irq-nationalchip.c and irq-csky.c

2018-03-20 Thread Guo Ren
:"=r"(lo) > > + :"r"(lo) > > + : > > + ); > > So you want to decode the interrupt number from a bitfield. What's wrong > with ffs()? There is no wrong with ffs(). Ok, I will use the ffs(). > > + if( lo != 32 ) > > + result = 31-lo; > > Why is this subtracted? ff1 find from high bit, so we need reverse it to get the right num. > That code makes no sense w/o comments. Sorry, I will add. > > + else if( hi != 32 ) result = 31-hi + 32; > > + else { > > + printk("nc_get_irqno error hi:%x, lo:%x.\n", hi, lo); > > + result = NR_IRQS; > > + } > > Pleas use braces consistently. Ok > > +unsigned int nc_get_irqno(void) > > static? Yes > Same comments as for the other variant. Ok Best Regards Guo Ren

Re: [PATCH 15/19] csky: Build infrastructure

2018-03-21 Thread Guo Ren
ress access, so we > > need soft-alignment exception to fixup. There is no problem in abiv2 cpus. > > Ok. Generally speaking, architectures that don't allow unaligned access > should have all code built in a way that uses aligned access (gcc normally > falls back to byte access when it encounters an unaligned pointer at > compile time), but if this is just for old CPUs that are not used in future > products, having the fixup does sound simpler, as it allows you to still > run new binaries on the old machines. I haven't looked at the implementation > for the fixup here, but I remember the same thing from the nds32 port. > In that case, we ended up keeping the fixup as an option for old > user space, but disabled to softalign fixups for kernel code. Can you do > the same thing here? Ok. I got it, I'll do the same as nds32. Best Regards Guo Ren

Re: [PATCH v3 07/33] nds32: MMU initialization

2017-12-18 Thread Guo Ren
map(page1) // Mostly vaddr1 = vaddr0 val = vaddr1; //No tlb-miss and it will get page0's val not page1, because last expired vaddr0's entry is left in CPU-MMU-tlb. Best Regards Guo Ren

Re: [PATCH v3 07/33] nds32: MMU initialization

2017-12-18 Thread Guo Ren
On Mon, Dec 18, 2017 at 07:21:30PM +0800, Greentime Hu wrote: > Hi, Guo Ren: > > 2017-12-18 17:08 GMT+08:00 Guo Ren : > > Hi Greentime, > > > > On Fri, Dec 08, 2017 at 05:11:50PM +0800, Greentime Hu wrote: > > [...] > >> > >> diff --git

[PATCH 07/19] csky: Atomic operations

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/kernel/atomic.S | 55 +++ 1 file changed, 55 insertions(+) create mode 100644 arch/csky/kernel/atomic.S diff --git a/arch/csky/kernel/atomic.S b/arch/csky/kernel/atomic.S new file mode 100644 index 000

[PATCH 09/19] csky: VDSO and rt_sigreturn

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/vdso.h | 19 + arch/csky/abiv2/inc/abi/vdso.h | 18 + arch/csky/include/asm/vdso.h | 12 ++ arch/csky/kernel/vdso.c| 89 ++ 4 files changed, 138 insertions(+) create mode

[PATCH 04/19] csky: MMU and page talbe management

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/ckmmu.h| 140 +++ arch/csky/abiv1/inc/abi/page.h | 26 +++ arch/csky/abiv1/inc/abi/pgtable-bits.h | 36 arch/csky/abiv1/src/mmap.c | 65 +++ arch/csky/abiv2/inc/abi/ckmmu.h| 126

[PATCH 19/19] irqchip: add irq-nationalchip.c and irq-csky.c

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-csky.c | 151 drivers/irqchip/irq-nationalchip.c | 196 + 3 files changed, 348 insertions(+) create mode 100644 drivers/irqchip/irq

[PATCH 00/19] C-SKY(csky) Linux Kernel Port

2018-03-18 Thread Guo Ren
ng and the source code is here: https://github.com/c-sky It's my first patchset to linux and any feedback is welcome :) Guo Ren (19): csky: Kernel booting csky: Exception handling and syscall csky: Cache and TLB routines csky: MMU and page talbe management csky: Process management csk

[PATCH 13/19] csky: User access

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/uaccess.h | 408 arch/csky/include/asm/user.h| 102 ++ 2 files changed, 510 insertions(+) create mode 100644 arch/csky/include/asm/uaccess.h create mode 100644 arch/csky/include/asm/user.h

[PATCH 12/19] csky: Debug and Ptrace GDB

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/uapi/asm/ptrace.h | 97 +++ arch/csky/kernel/dumpstack.c| 65 +++ arch/csky/kernel/ptrace.c | 339 3 files changed, 501 insertions(+) create mode 100644 arch/csky/include/uapi/asm

[PATCH 17/19] csky: defconfig

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/configs/gx66xx_defconfig | 549 + arch/csky/configs/qemu_ck807_defconfig | 541 2 files changed, 1090 insertions(+) create mode 100644 arch/csky/configs/gx66xx_defconfig create mode 100644

[PATCH 02/19] csky: Exception handling and syscall

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/entry.h | 171 arch/csky/abiv1/src/alignment.c | 513 arch/csky/abiv2/inc/abi/entry.h | 154 +++ arch/csky/include/asm/syscalls.h| 14 + arch/csky/include/asm/traps.h

[PATCH 11/19] csky: Library functions

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/src/bswapdi.c| 18 ++ arch/csky/abiv1/src/bswapsi.c| 15 ++ arch/csky/abiv1/src/memcpy.S | 344 +++ arch/csky/abiv2/src/fpu.c| 312 +++ arch/csky/abiv2/src

[PATCH 16/19] csky: Device tree

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/boot/dts/gx6605s.dts | 159 + arch/csky/boot/dts/include/dt-bindings | 1 + arch/csky/boot/dts/qemu.dts| 87 ++ 3 files changed, 247 insertions(+) create mode 100644 arch/csky/boot/dts

[PATCH 01/19] csky: Kernel booting

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/kernel/head.S | 20 ++ arch/csky/kernel/setup.c | 157 +++ 2 files changed, 177 insertions(+) create mode 100644 arch/csky/kernel/head.S create mode 100644 arch/csky/kernel/setup.c diff --git a/arch/csky

[PATCH 15/19] csky: Build infrastructure

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/Kconfig | 203 ++ arch/csky/Kconfig.debug | 22 + arch/csky/Makefile| 92 + arch/csky/abiv1/Makefile | 8 ++ arch/csky/abiv2/Makefile | 3

[PATCH 03/19] csky: Cache and TLB routines

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/cacheflush.h | 40 +++ arch/csky/abiv1/src/cacheflush.c | 32 ++ arch/csky/abiv2/inc/abi/cacheflush.h | 9 ++ arch/csky/include/asm/barrier.h | 14 +++ arch/csky/include/asm/cache.h | 32 ++ arch/csky

[PATCH 14/19] csky: Misc headers

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/abiv1/inc/abi/reg_ops.h | 79 + arch/csky/abiv1/inc/abi/regdef.h | 27 +++ arch/csky/abiv2/inc/abi/fpu.h | 296 + arch/csky/abiv2/inc/abi/reg_ops.h | 86 ++ arch/csky/abiv2/inc/abi

[PATCH 18/19] clocksource: add timer-nationalchip.c

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-nationalchip.c | 149 +++ 2 files changed, 150 insertions(+) create mode 100644 drivers/clocksource/timer-nationalchip.c diff --git a/drivers/clocksource/Makefile

[PATCH 06/19] csky: IRQ handling

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/irq.h | 12 + arch/csky/include/asm/irqflags.h | 55 arch/csky/kernel/irq.c | 41 ++ 3 files changed, 108 insertions(+) create mode 100644 arch/csky

[PATCH 05/19] csky: Process management

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/mmu_context.h | 140 ++ arch/csky/include/asm/processor.h | 140 ++ arch/csky/include/asm/thread_info.h | 77 +++ arch/csky/kernel/process.c | 147

[PATCH 08/19] csky: ELF and module probe

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/asm/elf.h | 151 arch/csky/kernel/module.c | 130 ++ 2 files changed, 281 insertions(+) create mode 100644 arch/csky/include/asm/elf.h create mode 100644 arch/csky

[PATCH 10/19] csky: Signal handling

2018-03-18 Thread Guo Ren
Signed-off-by: Guo Ren --- arch/csky/include/uapi/asm/sigcontext.h | 33 +++ arch/csky/include/uapi/asm/signal.h | 164 ++ arch/csky/kernel/signal.c | 379 3 files changed, 576 insertions(+) create mode 100644 arch/csky/include

Re: [PATCH 02/19] csky: Exception handling and syscall

2018-03-19 Thread Guo Ren
T. > Em... I'll think about it. > For consistency, and in case you change your stack size in future, this should > be THREADSIZE_MASK_BIT. > OK > > +if (unlikely(address >= VMALLOC_START && address <= VMALLOC_END)) > > +goto vmalloc_fault; > > You might want to check if this was a user mode fault here, so that users > can't trigger vmalloc faults. Is it necessary to check user mode? If a user-process touch a kernel-addr, it will cause a supervisor exception. Best Regards Guo Ren

Re: [PATCH 18/19] clocksource: add timer-nationalchip.c

2018-03-19 Thread Guo Ren
> > + clockevents_config_and_register(_ced, freq, 1, ULONG_MAX); > > + > > + nc_csd_enable(); > > + clocksource_mmio_init(NC_VA_COUNTER_2_VALUE, "nationalchip-clksource", > > freq, 200, 32, clocksource_mmio_readl_up); > > s/nationalchip-clksource/nationalchip/ > > line wrap > OK > > + sched_clock_register(nc_sched_clock_read, 32, freq); > > + > > + return 0; > > +} > > +CLOCKSOURCE_OF_DECLARE(nc_timer, "nationalchip,timer-v1", nc_timer_init); > > s/CLOCKSOURCE_OF_DECLARE/TIMER_OF_DECLARE/ > OK Best Regards Guo Ren

Re: [PATCH 18/19] clocksource: add timer-nationalchip.c

2018-03-19 Thread Guo Ren
CKSOURCE_OF_DECLARE(nc_timer, "nationalchip,timer-v1", nc_timer_init); > > This needs a devicetree binding document. Please see > Documentation/devicetree/bindings/submitting-patches.txt. > OK Best Regards Guo Ren

Re: [PATCH 19/19] irqchip: add irq-nationalchip.c and irq-csky.c

2018-03-19 Thread Guo Ren
On Mon, Mar 19, 2018 at 04:26:00AM +, Mark Rutland wrote: > On Mon, Mar 19, 2018 at 03:51:41AM +0800, Guo Ren wrote: > > +static unsigned int intc_reg; > > This should be a void __iomem *ptr; > OK > > +#define CK_VA_INTC_ICR (void *)(intc_reg + 0x00)

Re: [PATCH 00/19] C-SKY(csky) Linux Kernel Port

2018-03-19 Thread Guo Ren
Thx Joe, On Sun, Mar 18, 2018 at 01:25:57PM -0700, Joe Perches wrote: > On Mon, 2018-03-19 at 03:51 +0800, Guo Ren wrote: > > This patchset adds architecture support to Linux for C-SKY's 32-bit embedded > > CPU cores and the patches are based on linux-4.16-rc5. > > > >

Re: [PATCH 02/19] csky: Exception handling and syscall

2018-03-19 Thread Guo Ren
next and check the unistd.h again. Best Regards Guo Ren

Re: [PATCH v3 09/33] nds32: Cache and TLB routines

2017-12-12 Thread Guo Ren
b" and "tlbop_rwr" and a update_mmu_cache() is invoked again, then an error page mapping is set up in your tlb-buffer when tlbop_rwr is excuted from interrupt. Because it's another addr in NDS32_SR_TLB_VPN. It seems that tlb-hardrefill can help build tlb-buffer mapping, why you update it in this software way? Guo Ren

Re: [PATCH v3 09/33] nds32: Cache and TLB routines

2017-12-13 Thread Guo Ren
On Wed, Dec 13, 2017 at 01:45:02PM +0800, Greentime Hu wrote: > I think it should be fine if an interruption between mtsr_dsb and > tlbop_rwr because this is a optimization by sw. Fine? When there is an unexpected vaddr in SR_TLB_VPN, tlbop_rwr(*pte) will break that vaddr's pfn in the CPU

Re: [PATCH v3 09/33] nds32: Cache and TLB routines

2017-12-13 Thread Guo Ren
On Wed, Dec 13, 2017 at 04:30:41PM +0800, Greentime Hu wrote: > 2017-12-13 16:19 GMT+08:00 Guo Ren : > > On Wed, Dec 13, 2017 at 01:45:02PM +0800, Greentime Hu wrote: > > > >> I think it should be fine if an interruption between mtsr_dsb and > >> tlbop_rwr bec

Re: [PATCH v3 09/33] nds32: Cache and TLB routines

2017-12-13 Thread Guo Ren
PN is in a invalid state, no operation happen on tlbop_rwr. Then they are atomic safe ,no spin_lock_irq need. :) Guo Ren

Re: [PATCH v2 4/5] csky: Fixup asm/cmpxchg.h with correct ordering barrier

2021-01-20 Thread Guo Ren
struction. arw means after read and write would happen after the instruction So it also could be bar.brarw / bar.arw / bar.brw / bar.braw sync means we need to wait until all instructions complete in the CPU pipeline and then issue the next instructions. -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH v2 1/5] csky: Remove custom asm/atomic.h implementation

2021-01-20 Thread Guo Ren
Hi Peter, On Thu, Jan 7, 2021 at 7:19 PM Peter Zijlstra wrote: > > On Sun, Dec 20, 2020 at 03:39:19PM +, guo...@kernel.org wrote: > > From: Guo Ren > > > > Use generic atomic implementation based on cmpxchg. So remove csky > > asm/atomic.h. > > Clarificat

Re: [PATCH] RISC-V: probes: Treat the instruction stream as host-endian

2021-01-22 Thread Guo Ren
Acked-by: Guo Ren On 2021/1/23 上午11:34, Palmer Dabbelt wrote: From: Palmer Dabbelt Neither of these are actually correct: the instruction stream is defined (for versions of the ISA manual newer than 2.2) as a stream of 16-bit little-endian parcels, which is different than just being little

Re: [PATCH/v2] csky: Fix typos in Kconfig

2021-01-07 Thread Guo Ren
odes could be > > re-used directly. > > > > if HAVE_TCM > > > > LGTM. Thanks. > Reviewed-by: Randy Dunlap > > -- > ~Randy -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH] riscv: Remove duplicate definition in pagtable.h

2021-01-12 Thread Guo Ren
On Tue, Jan 12, 2021 at 4:18 PM Atish Patra wrote: > > On Mon, Jan 11, 2021 at 6:38 PM wrote: > > > > From: Guo Ren > > > > PAGE_KERNEL_EXEC has been defined above. > > > > Signed-off-by: Guo Ren > > Cc: Palmer Dabbelt > > Cc: Pekka Enb

Re: [PATCH V2 1/3] riscv: Fixup static_obj() fail

2020-10-06 Thread Guo Ren
On Tue, Oct 6, 2020 at 3:14 AM Atish Patra wrote: > > On Thu, Sep 24, 2020 at 9:19 AM Guo Ren wrote: > > > > How about this, revert the commit and don't free INIT_DATA_SECTION. I > > think the solution is safe enough, but wast a little memory. > > > > diff --g

Re: [PATCH V2 1/3] riscv: Fixup static_obj() fail

2020-10-06 Thread Guo Ren
for this, do you > mind posting one? Otherwise I'll take a crack at constructing the revert > myself. Please have a look: https://lore.kernel.org/linux-riscv/1602002973-92934-1-git-send-email-guo...@kernel.org/T/#u The only revert couldn't solve the static_obj problem. -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH V2 1/3] riscv: Fixup static_obj() fail

2020-10-07 Thread Guo Ren
On Wed, Oct 7, 2020 at 4:39 AM Atish Patra wrote: > > On Tue, Oct 6, 2020 at 9:46 AM Guo Ren wrote: > > > > On Tue, Oct 6, 2020 at 3:14 AM Atish Patra wrote: > > > > > > On Thu, Sep 24, 2020 at 9:19 AM Guo Ren wrote: > > > > > >

Re: [PATCH 2/2] riscv: Fixup static_obj() fail v2

2020-10-07 Thread Guo Ren
On Thu, Oct 8, 2020 at 3:46 AM Atish Patra wrote: > > On Wed, Oct 7, 2020 at 8:09 AM wrote: > > > > From: Guo Ren > > > > v1 is commit: 6184358da0004c8fd940afda6c0a0fa4027dc911 which has > > been reverted. > > > > When enable LOCKDEP, static_obj

Re: [PATCH 2/2] riscv: Fixup static_obj() fail v2

2020-10-08 Thread Guo Ren
On Thu, Oct 8, 2020 at 11:54 AM Palmer Dabbelt wrote: > > On Wed, 07 Oct 2020 08:08:33 PDT (-0700), guo...@kernel.org wrote: > > From: Guo Ren > > > > v1 is commit: 6184358da0004c8fd940afda6c0a0fa4027dc911 which has > > been reverted. > > > > When ena

Re: [PATCH V2 1/3] riscv: Fixup static_obj() fail

2020-09-11 Thread Guo Ren
2020-06-27 13:57, guo...@kernel.org wrote: > > From: Guo Ren > > > > When enable LOCKDEP, static_obj() will cause error. Because some > > __initdata static variables is before _stext: > > > > static int static_obj(const void *obj) > > { > > unsign

Re: [PATCH] csky: Fix a size determination in gpr_get()

2020-12-23 Thread Guo Ren
Hi Zhengzhong, I'll take it, thx. On Wed, Dec 23, 2020 at 10:31 AM Zhenzhong Duan wrote: > > On Wed, Sep 23, 2020 at 12:52 PM Al Viro wrote: > > > > On Wed, Sep 23, 2020 at 10:37:31AM +0800, Guo Ren wrote: > > > > > > What's going on there? The mapping is

Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline'

2020-12-20 Thread Guo Ren
Hi Arnd, On Tue, Dec 15, 2020 at 7:26 PM Arnd Bergmann wrote: > > On Tue, Dec 15, 2020 at 7:09 AM Guo Ren wrote: > > On Mon, Dec 14, 2020 at 9:15 PM Arnd Bergmann wrote: > > > I had a look at what other architectures always implement > > > futex_atomic_cmpxchg

Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline'

2020-12-20 Thread Guo Ren
Hi Arnd, On Mon, Dec 21, 2020 at 1:49 AM Arnd Bergmann wrote: > > On Sun, Dec 20, 2020 at 4:46 PM Guo Ren wrote: > > On Tue, Dec 15, 2020 at 7:26 PM Arnd Bergmann wrote: > > > > > > On Tue, Dec 15, 2020 at 7:09 AM Guo Ren wrote: > > > > On Mon, De

Re: [PATCH 1/2] futex: mark futex_detect_cmpxchg() as 'noinline'

2020-12-14 Thread Guo Ren
inline int +arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *uaddr) +{ + int oldval = 0, ret = 0; + + if (!access_ok(uaddr, sizeof(u32))) + return -EFAULT; + + <...> + + return ret; +} + +static inline int +futex_atomic_cmpxchg_inatomic(u32 *uval, u32

Re: [PATCH 1/3] irqchip/irq-sifive-plic: Fixup wrong size of xxx_PER_HART and reg base

2020-10-23 Thread Guo Ren
On Fri, Oct 23, 2020 at 8:31 PM Anup Patel wrote: > > On Fri, Oct 23, 2020 at 3:48 PM wrote: > > > > From: Guo Ren > > > > ENABLE and CONTEXT registers contain M & S status for per-hart, so > > ref to the specification the correct definition is double to

Re: [PATCH 2/3] irqchip/irq-sifive-plic: Fixup couldn't broadcast to multi CPUs

2020-10-23 Thread Guo Ren
On Fri, Oct 23, 2020 at 8:17 PM Anup Patel wrote: > > On Fri, Oct 23, 2020 at 3:48 PM wrote: > > > > From: Guo Ren > > > > If "echo 3 > /proc/irq/1/smp_affinity", we want irq 1 could be > > broadcast to CPU0 & CPU1 and one of them w

Re: [PATCH v4] riscv: Enable per-task stack canaries

2020-11-14 Thread Guo Ren
Hi Palmer, Could you help move the patch into your next-tree with Kees' review added? On Sat, Nov 14, 2020 at 6:57 AM Kees Cook wrote: > > On Sun, Oct 18, 2020 at 12:38:17PM +, guo...@kernel.org wrote: > > From: Guo Ren > > > > This enables the use of per-task st

Re: [PATCH v4 9/9] riscv: Fixup lockdep_assert_held(_mutex) in patch_insn_write

2020-10-20 Thread Guo Ren
On Mon, Oct 19, 2020 at 4:36 PM Masami Hiramatsu wrote: > > On Sat, 17 Oct 2020 07:06:17 + > guo...@kernel.org wrote: > > > From: Guo Ren > > > > It will cause warning messages: > > echo function_graph > /sys/kernel/debug/tracing/current_tracer &g

Re: [PATCH v4 9/9] riscv: Fixup lockdep_assert_held(_mutex) in patch_insn_write

2020-10-20 Thread Guo Ren
On Tue, Oct 20, 2020 at 2:54 AM Atish Patra wrote: > > On Sat, Oct 17, 2020 at 12:07 AM wrote: > > > > From: Guo Ren > > > > It will cause warning messages: > > echo function_graph > /sys/kernel/debug/tracing/current_tracer &g

Re: [PATCH v4 9/9] riscv: Fixup lockdep_assert_held(_mutex) in patch_insn_write

2020-10-21 Thread Guo Ren
ken. On Wed, Oct 21, 2020 at 4:41 AM Steven Rostedt wrote: > > On Tue, 20 Oct 2020 19:18:01 +0800 > Guo Ren wrote: > > > > What platform are you testing ? We are seeing a crash while enabling > > > any of the tracers multiple times > > > on Qemu/HiFive Unleashed

Re: [PATCH 1/3] irqchip/irq-sifive-plic: Fixup wrong size of xxx_PER_HART and reg base

2020-10-26 Thread Guo Ren
Hi Anup, On Sun, Oct 25, 2020 at 5:18 PM Anup Patel wrote: > > On Sat, Oct 24, 2020 at 8:40 AM Guo Ren wrote: > > > > On Fri, Oct 23, 2020 at 8:31 PM Anup Patel wrote: > > > > > > On Fri, Oct 23, 2020 at 3:48 PM wrote: > > > > > >

Re: [PATCH] stop_machine: Mark functions as notrace

2020-10-29 Thread Guo Ren
On Fri, Oct 30, 2020 at 2:46 AM Atish Patra wrote: > > On Thu, Oct 29, 2020 at 9:06 AM Guo Ren wrote: > > > > On Thu, Oct 29, 2020 at 10:34 AM Zong Li wrote: > > > > > > On Thu, Oct 29, 2020 at 8:23 AM Atish Patra wrote: > > > > > &

Re: [PATCH] stop_machine: Mark functions as notrace

2020-10-31 Thread Guo Ren
m ftrace. My patch just use notrace flag setting on some functions. @Atish How do think: CFLAGS_REMOVE_cacheflush.o = $(CC_FLAGS_FTRACE) CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE) -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: set_thread_area.2: csky architecture undocumented

2020-11-24 Thread Guo Ren
__mips__ > > + #elif defined(__mips__ || __csky__) > > > > and then change the rest of the text to add csky when appropriate. > > Am I correct? > > AFAICT, you are correct. I think the reason that csky is missing is > that the architecture was added after this manual pages was added. > > Thanks, > > Michael > > > -- > Michael Kerrisk > Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ > Linux/UNIX System Programming Training: http://man7.org/training/ -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH 2/5] riscv: Add QUEUED_SPINLOCKS & QUEUED_RWLOCKS supported

2020-11-24 Thread Guo Ren
> case 4: \ > > __asm__ __volatile__ ( \ > > " amoswap.w %0, %2, %1\n" \ > > I'm pretty sure there's a handfull of implementations like this out > there... if only we could share. Michael has sent qspinlock before, ref to Link below. He reused mips' code. Link: https://lore.kernel.org/linux-riscv/20190211043829.30096-1-michaeljcl...@mac.com/ Which short xchg implementation do you prefer (Mine or his)? > > Anyway, this too should be an independent patch. Ok, I'll separate it into two patches, 1. implement short xchg 2. qspinlock enabled based on Michael's patch -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH 2/5] riscv: Add QUEUED_SPINLOCKS & QUEUED_RWLOCKS supported

2020-11-25 Thread Guo Ren
* tail. */ old = atomic_cmpxchg_relaxed(>val, val, new); if (old == val) break; val = old; } return old; } #endif /* _Q_PENDING_BITS == 8 */ > > If nothing else needs xchg() on a 16-bit val

Re: [PATCH 1/5] riscv: Coding convention for xchg

2020-11-25 Thread Guo Ren
On Tue, Nov 24, 2020 at 10:29 PM Peter Zijlstra wrote: > > On Tue, Nov 24, 2020 at 01:43:53PM +, guo...@kernel.org wrote: > > From: Guo Ren > > > > This is prepare for QUEUED_SPINLOCKS which need xchg support short > > type value. > > - Remove unu

Re: [PATCH 2/5] riscv: Add QUEUED_SPINLOCKS & QUEUED_RWLOCKS supported

2020-11-25 Thread Guo Ren
ing in > it over tickets for <= 16 CPUs. NUMA is on the way: https://lore.kernel.org/linux-riscv/20201119003829.1282810-1-atish.pa...@wdc.com/ With your advice, I think we could using tickets lock when <= 16 CPUs and using qspinlock when > 16 CPUs. Is that right? The next patchset plan is: - Using tickets & qspinlock together in riscv. Abandon 16bits xchg/cmpxchg implementation. - Abanden qspinlock in csky, because it only could 4 CPUs' SMP. > > Will -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH] stop_machine: Mark functions as notrace

2020-11-05 Thread Guo Ren
On Tue, Nov 3, 2020 at 11:33 PM Atish Patra wrote: > > On Sat, Oct 31, 2020 at 12:42 AM Guo Ren wrote: > > > > On Sat, Oct 31, 2020 at 8:28 AM Steven Rostedt wrote: > > > > > > On Fri, 30 Oct 2020 14:47:56 -0700 > > > Atish Patra wrote: > > &

Re: [PATCH v4 1/9] RISC-V: Implement ptrace regs and stack API

2020-11-05 Thread Guo Ren
On Fri, Nov 6, 2020 at 9:03 AM Palmer Dabbelt wrote: > > On Sat, 17 Oct 2020 00:06:09 PDT (-0700), guo...@kernel.org wrote: > > From: Patrick Stählin > > > > Needed for kprobes support. Copied and adapted from arm64 code. > > > > Guo Ren fixup pt_regs type f

Re: [PATCH v4 5/9] riscv: Add kprobes supported

2020-11-05 Thread Guo Ren
On Fri, Nov 6, 2020 at 9:02 AM Palmer Dabbelt wrote: > > On Sat, 17 Oct 2020 00:06:13 PDT (-0700), guo...@kernel.org wrote: > > From: Guo Ren > > > > This patch enables "kprobe & kretprobe" to work with ftrace > > interface. It utilized soft

Re: [PATCH] csky: Move static keyword to the front of declaration

2019-09-03 Thread Guo Ren
Thx, Acked by: Guo Ren You may also modify others' ➜ linux-next git:(linux-next-for-v5.4) ✗ grep "const static" * -r arch/csky/kernel/perf_event.c:const static struct of_device_id csky_pmu_of_device_ids[] = { arch/nds32/kernel/perf_event_cpu.c:const static struct of

Re: [PATCH V6 0/3] riscv: Add perf callchain support

2019-09-04 Thread Guo Ren
force to build kernel with -fno-omit-frame-pointer if perf > > event is enabled > > > > Changes since v1: > > - simplify implementation and code convention > > > > Cc: Paul Walmsley > > Cc: Greentime Hu > > Cc: Palmer Dabbelt > > Cc: linux-r

Re: [PATCH V5 1/3] riscv: Add perf callchain support

2019-08-23 Thread Guo Ren
llchain sampling on riscv platform. > > The return address of leaf function is retrieved from pt_regs as > > it is not saved in the outmost frame. > > > > Signed-off-by: Mao Han > > Cc: Paul Walmsley > > Cc: Greentime Hu > > Cc: Palmer Dabbelt > > Cc

Re: [PATCH V2] csky: Fixup 610 vipt cache flush mechanism

2019-08-26 Thread Guo Ren
Thx Christoph, On Mon, Aug 26, 2019 at 2:38 PM Christoph Hellwig wrote: > > On Thu, Aug 22, 2019 at 11:05:22AM +0800, guo...@kernel.org wrote: > > From: Guo Ren > > > > 610 has vipt aliasing issue, so we need to finish the cache flush > > apis mentioned in cachetl

Re: [PATCH V5 1/3] riscv: Add perf callchain support

2019-08-26 Thread Guo Ren
On Mon, Aug 26, 2019 at 4:03 PM Greentime Hu wrote: > > Hi Guo, > > Guo Ren 於 2019年8月24日 週六 上午8:54寫道: > > > > Please check CONFIG_FRAME_POINTER > > > > 1 *frame = *((struct stackframe *)frame->fp - 1); > > This code is origionally from riscv/kernel/s

Re: [PATCH 4/4] csky: Add dma_inv_range for DMA_FROM_DEVICE

2019-07-30 Thread Guo Ren
Thx Arnd, On Tue, Jul 30, 2019 at 9:43 PM Arnd Bergmann wrote: > > On Tue, Jul 30, 2019 at 2:16 PM wrote: > > From: Guo Ren > > > diff --git a/arch/csky/mm/dma-mapping.c b/arch/csky/mm/dma-mapping.c > > index 3f1ff9d..d8f0f81 100644 > > --- a/arch/csky/mm/dma

Re: [PATCH 1/4] csky: Fixup dma_rmb/wmb synchronization problem

2019-07-30 Thread Guo Ren
On Tue, Jul 30, 2019 at 9:29 PM Arnd Bergmann wrote: > > On Tue, Jul 30, 2019 at 2:15 PM wrote: > > > > From: Guo Ren > > > > If arch didn't define dma_r/wmb(), linux will use w/rmb instead. Csky > > use bar.xxx to implement mb() and that will cause proble

Re: [PATCH 1/4] csky: Fixup dma_rmb/wmb synchronization problem

2019-07-30 Thread Guo Ren
Thx Arnd, On Tue, Jul 30, 2019 at 9:29 PM Arnd Bergmann wrote: > > On Tue, Jul 30, 2019 at 2:15 PM wrote: > > > > From: Guo Ren > > > > If arch didn't define dma_r/wmb(), linux will use w/rmb instead. Csky > > use bar.xxx to implement mb() and th

Re: [PATCH 4/4] csky: Add dma_inv_range for DMA_FROM_DEVICE

2019-07-30 Thread Guo Ren
Thx Arnd, On Tue, Jul 30, 2019 at 11:22 PM Arnd Bergmann wrote: > > On Tue, Jul 30, 2019 at 5:11 PM Guo Ren wrote: > > > > diff --git a/arch/csky/mm/dma-mapping.c b/arch/csky/mm/dma-mapping.c > > > > cache_op(paddr, size, dma_wb_range);

Re: [PATCH] csky: Fixup ioremap function losing

2019-08-20 Thread Guo Ren
On Mon, Aug 19, 2019 at 2:21 AM Christoph Hellwig wrote: > > On Sun, Aug 18, 2019 at 10:20:18AM +0800, Guo Ren wrote: > > > > Also change flag VM_ALLOC to VM_IOREMAP in get_vm_area_caller. > > > > > > Looks generally fine, but two comments: > > > >

Re: [PATCH 3/3] csky: Support kernel non-aligned access

2019-08-20 Thread Guo Ren
Thx Christoph On Wed, Aug 21, 2019 at 10:17 AM Christoph Hellwig wrote: > > On Tue, Aug 20, 2019 at 08:34:29PM +0800, guo...@kernel.org wrote: > > From: Guo Ren > > > > We prohibit non-aligned access in kernel mode, but some special NIC > > driver needs to support

Re: [PATCH 1/3] csky: Fixup arch_get_unmapped_area() implementation

2019-08-20 Thread Guo Ren
invalidate_kernel_vmap_range functions to avoid data corruption when > doing I/O on vmalloc/vmap ranges. I'll give another patch for this issue -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: [PATCH] csky: Fixup ioremap function losing

2019-08-17 Thread Guo Ren
Thx Christoph, On Fri, Aug 16, 2019 at 3:03 PM Christoph Hellwig wrote: > > On Thu, Aug 15, 2019 at 07:28:57PM +0800, guo...@kernel.org wrote: > > From: Guo Ren > > > > Implement the following apis to meet usage in different scenarios. > > > > - iore

Re: [PATCH V3 2/6] csky: Add reg-io-width property for csky pmu

2019-06-03 Thread Guo Ren
init_fn(_pmu); > } > > + if (!of_property_read_u32(node, "reg-io-width", _width)) { > + csky_pmu.sign_extend = 64 - cnt_width; 63? Please use count_width, see above. > + } else { > + csky_pmu.sign_extend = 16; Please define a macro for define DEFAULT_COUNT_WIDTH 48 and change the format like this: if (of_property_read_u32(node, "count-width", _pmu.count_width)) csky_pmu.count_width = DEFAULT_COUNT_WIDTH; Best Regards Guo Ren

Re: [PATCH] csky: remove unsued thread_saved_pc and *_segments functions/macros

2019-06-13 Thread Guo Ren
Acked-by: Guo Ren thread_saved_pc should be used in unwind stack and I'll give another patch to optimize the unwind flow for csky. On Wed, Jun 12, 2019 at 7:22 PM Tobias Klauser wrote: > > These are used nowhere in the tree (except for some architectures which > define them for thei

Re: [PATCH v3 06/16] csky: kprobes: Use generic kretprobe trampoline handler

2020-08-28 Thread Guo Ren
Looks more clear. Acked-by: Guo Ren On Fri, Aug 28, 2020 at 12:39 AM Masami Hiramatsu wrote: > > Signed-off-by: Masami Hiramatsu > --- > arch/csky/kernel/probes/kprobes.c | 78 > + > 1 file changed, 3 insertions(+), 75 deletions(-) >

Re: csky: smp_mb__after_spinlock

2020-08-06 Thread Guo Ren
s a bit heavy, are any tickets-like comm spinlock infrastructures in the plan? -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

Re: csky: smp_mb__after_spinlock

2020-08-06 Thread Guo Ren
Acked-by: Guo Ren On Thu, Aug 6, 2020 at 3:55 AM wrote: > > On Wed, Aug 05, 2020 at 12:41:46PM +0200, pet...@infradead.org wrote: > > Hi, > > > > While doing an audit of smp_mb__after_spinlock, I found that csky > > defines it, why? > > > > C

Re: [PATCH] ftrace: Fixup lockdep assert held of text_mutex

2020-08-06 Thread Guo Ren
On Thu, Aug 6, 2020 at 11:48 PM Steven Rostedt wrote: > > On Thu, 6 Aug 2020 14:50:54 + > guo...@kernel.org wrote: > > > From: Guo Ren > > > > The function ftrace_process_locs() will modify text code, so we > > should give a text_mutex lock. Because so

Re: [PATCH] ftrace: Fixup lockdep assert held of text_mutex

2020-08-06 Thread Guo Ren
On Fri, Aug 7, 2020 at 12:01 PM Steven Rostedt wrote: > > On Fri, 7 Aug 2020 10:59:16 +0800 > Guo Ren wrote: > > > > > > This looks like a bug in the lockdep_assert_held() in whatever arch > > > (riscv) is running. > > Seems you think it's a bug o

Re: [PATCH v3 3/7] riscv: Fixup kprobes handler couldn't change pc

2020-08-17 Thread Guo Ren
On Sat, Aug 15, 2020 at 6:36 AM Palmer Dabbelt wrote: > > On Mon, 13 Jul 2020 16:39:18 PDT (-0700), guo...@kernel.org wrote: > > From: Guo Ren > > > > The "Changing Execution Path" section in the Documentation/kprobes.txt > > said: > > > >

Re: [PATCH v3 4/7] riscv: Add kprobes supported

2020-08-17 Thread Guo Ren
On Sat, Aug 15, 2020 at 6:36 AM Palmer Dabbelt wrote: > > On Mon, 13 Jul 2020 16:39:19 PDT (-0700), guo...@kernel.org wrote: > > From: Guo Ren > > > > This patch enables "kprobe & kretprobe" to work with ftrace > > interface. It utilized soft

Re: [PATCH V2 1/3] riscv: Fixup static_obj() fail

2020-09-24 Thread Guo Ren
. > > -- > Andreas Schwab, sch...@linux-m68k.org > GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 > "And now for something completely different." -- Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/

<    1   2   3   4   5   6   7   8   9   10   >