Skip to content

Commit 7f50d4d

Browse files
committed
Merge tag 'for-linus' of https://github.com/openrisc/linux
Pull OpenRISC updates from Stafford Horne: - A few sparse warning fixups and other cleanups I noticed when working on a recent TLB bug found on a new OpenRISC core bring up. - A few fixup's from me and Jason A Donenfeld to help shutdown OpenRISC platforms when running CI tests * tag 'for-linus' of https://github.com/openrisc/linux: openrisc: Allow power off handler overriding openrisc: Remove unused IMMU tlb workardound openrisc/fault: Fix symbol scope warnings openrisc/delay: Add include to fix symbol not declared warning openrisc/time: Fix symbol scope warnings openrisc/traps: Declare unhandled_exception for asmlinkage openrisc/traps: Remove die_if_kernel function openrisc/traps: Declare file scope symbols as static openrisc: Update litex defconfig to support glibc userland openrisc: Pretty print show_registers memory dumps openrisc: Add syscall details to emergency syscall debugging openrisc: Add support for liteuart emergency printing openrisc: Cleanup emergency print handling openrisc: Add gcc machine instruction flag configuration openrisc: define nop command for simulator reboot openrisc: remove bogus nops and shutdowns openrisc: fix typos in comments
2 parents ba62a53 + 83da38d commit 7f50d4d

File tree

11 files changed

+272
-315
lines changed

11 files changed

+272
-315
lines changed

arch/openrisc/Kconfig

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,59 @@ config OPENRISC_HAVE_INST_DIV
113113
default y
114114
help
115115
Select this if your implementation has a hardware divide instruction
116+
117+
config OPENRISC_HAVE_INST_CMOV
118+
bool "Have instruction l.cmov for conditional move"
119+
default n
120+
help
121+
This config enables gcc to generate l.cmov instructions when compiling
122+
the kernel which in general will improve performance and reduce the
123+
binary size.
124+
125+
Select this if your implementation has support for the Class II
126+
l.cmov conistional move instruction.
127+
128+
Say N if you are unsure.
129+
130+
config OPENRISC_HAVE_INST_ROR
131+
bool "Have instruction l.ror for rotate right"
132+
default n
133+
help
134+
This config enables gcc to generate l.ror instructions when compiling
135+
the kernel which in general will improve performance and reduce the
136+
binary size.
137+
138+
Select this if your implementation has support for the Class II
139+
l.ror rotate right instruction.
140+
141+
Say N if you are unsure.
142+
143+
config OPENRISC_HAVE_INST_RORI
144+
bool "Have instruction l.rori for rotate right with immediate"
145+
default n
146+
help
147+
This config enables gcc to generate l.rori instructions when compiling
148+
the kernel which in general will improve performance and reduce the
149+
binary size.
150+
151+
Select this if your implementation has support for the Class II
152+
l.rori rotate right with immediate instruction.
153+
154+
Say N if you are unsure.
155+
156+
config OPENRISC_HAVE_INST_SEXT
157+
bool "Have instructions l.ext* for sign extension"
158+
default n
159+
help
160+
This config enables gcc to generate l.ext* instructions when compiling
161+
the kernel which in general will improve performance and reduce the
162+
binary size.
163+
164+
Select this if your implementation has support for the Class II
165+
l.exths, l.extbs, l.exthz and l.extbz size extend instructions.
166+
167+
Say N if you are unsure.
168+
116169
endmenu
117170

118171
config NR_CPUS

arch/openrisc/Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S
2121
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
2222

2323
KBUILD_CFLAGS += -pipe -ffixed-r10 -D__linux__
24+
KBUILD_CFLAGS += -msfimm -mshftimm
2425

2526
all: vmlinux.bin
2627

@@ -38,6 +39,22 @@ else
3839
KBUILD_CFLAGS += $(call cc-option,-msoft-div)
3940
endif
4041

42+
ifeq ($(CONFIG_OPENRISC_HAVE_INST_CMOV),y)
43+
KBUILD_CFLAGS += $(call cc-option,-mcmov)
44+
endif
45+
46+
ifeq ($(CONFIG_OPENRISC_HAVE_INST_ROR),y)
47+
KBUILD_CFLAGS += $(call cc-option,-mror)
48+
endif
49+
50+
ifeq ($(CONFIG_OPENRISC_HAVE_INST_RORI),y)
51+
KBUILD_CFLAGS += $(call cc-option,-mrori)
52+
endif
53+
54+
ifeq ($(CONFIG_OPENRISC_HAVE_INST_SEXT),y)
55+
KBUILD_CFLAGS += $(call cc-option,-msext)
56+
endif
57+
4158
head-y := arch/openrisc/kernel/head.o
4259

4360
libs-y += $(LIBGCC)

arch/openrisc/configs/or1klitex_defconfig

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,54 @@
1+
CONFIG_SYSVIPC=y
2+
CONFIG_POSIX_MQUEUE=y
3+
CONFIG_CGROUPS=y
4+
CONFIG_NAMESPACES=y
5+
CONFIG_USER_NS=y
16
CONFIG_BLK_DEV_INITRD=y
27
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
8+
CONFIG_SGETMASK_SYSCALL=y
39
CONFIG_EMBEDDED=y
410
CONFIG_OPENRISC_BUILTIN_DTB="or1klitex"
511
CONFIG_HZ_100=y
12+
CONFIG_OPENRISC_HAVE_SHADOW_GPRS=y
613
CONFIG_NET=y
714
CONFIG_PACKET=y
15+
CONFIG_PACKET_DIAG=y
816
CONFIG_UNIX=y
17+
CONFIG_UNIX_DIAG=y
918
CONFIG_INET=y
19+
CONFIG_IP_MULTICAST=y
20+
CONFIG_IP_ADVANCED_ROUTER=y
21+
CONFIG_INET_UDP_DIAG=y
22+
CONFIG_INET_RAW_DIAG=y
23+
# CONFIG_WIRELESS is not set
24+
# CONFIG_ETHTOOL_NETLINK is not set
1025
CONFIG_DEVTMPFS=y
1126
CONFIG_DEVTMPFS_MOUNT=y
1227
CONFIG_OF_OVERLAY=y
1328
CONFIG_NETDEVICES=y
1429
CONFIG_LITEX_LITEETH=y
30+
# CONFIG_WLAN is not set
1531
CONFIG_SERIAL_LITEUART=y
1632
CONFIG_SERIAL_LITEUART_CONSOLE=y
1733
CONFIG_TTY_PRINTK=y
34+
# CONFIG_GPIO_CDEV is not set
35+
CONFIG_MMC=y
36+
CONFIG_MMC_LITEX=y
37+
# CONFIG_VHOST_MENU is not set
38+
# CONFIG_IOMMU_SUPPORT is not set
1839
CONFIG_LITEX_SOC_CONTROLLER=y
40+
CONFIG_EXT2_FS=y
41+
CONFIG_EXT3_FS=y
42+
CONFIG_MSDOS_FS=y
43+
CONFIG_VFAT_FS=y
44+
CONFIG_EXFAT_FS=y
1945
CONFIG_TMPFS=y
46+
CONFIG_NFS_FS=y
47+
CONFIG_NFS_V3_ACL=y
48+
CONFIG_NFS_V4=y
49+
CONFIG_NLS_CODEPAGE_437=y
50+
CONFIG_NLS_ISO8859_1=y
51+
CONFIG_LSM="lockdown,yama,loadpin,safesetid,integrity,bpf"
2052
CONFIG_PRINTK_TIME=y
2153
CONFIG_PANIC_ON_OOPS=y
2254
CONFIG_SOFTLOCKUP_DETECTOR=y

arch/openrisc/kernel/entry.S

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ UNHANDLED_EXCEPTION(_vector_0xb00,0xb00)
601601
*/
602602

603603
_string_syscall_return:
604-
.string "syscall return %ld \n\r\0"
604+
.string "syscall r9:0x%08x -> syscall(%ld) return %ld\0"
605605
.align 4
606606

607607
ENTRY(_sys_call_handler)
@@ -679,15 +679,25 @@ _syscall_return:
679679
_syscall_debug:
680680
l.movhi r3,hi(_string_syscall_return)
681681
l.ori r3,r3,lo(_string_syscall_return)
682-
l.ori r27,r0,1
682+
l.ori r27,r0,2
683683
l.sw -4(r1),r27
684684
l.sw -8(r1),r11
685-
l.addi r1,r1,-8
685+
l.lwz r29,PT_ORIG_GPR11(r1)
686+
l.sw -12(r1),r29
687+
l.lwz r29,PT_GPR9(r1)
688+
l.sw -16(r1),r29
686689
l.movhi r27,hi(_printk)
687690
l.ori r27,r27,lo(_printk)
688691
l.jalr r27
689-
l.nop
690-
l.addi r1,r1,8
692+
l.addi r1,r1,-16
693+
l.addi r1,r1,16
694+
#endif
695+
#if 0
696+
_syscall_show_regs:
697+
l.movhi r27,hi(show_registers)
698+
l.ori r27,r27,lo(show_registers)
699+
l.jalr r27
700+
l.or r3,r1,r1
691701
#endif
692702

693703
_syscall_check_trace_leave:

0 commit comments

Comments
 (0)