Skip to contentSkip to conversation

um: Increase stack frame size threshold for signal.c

PATCH In review Andy Shevchenko 2 participants 2 messages Dec 9, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 um: Increase stack frame size threshold for signal.c

The signal.c can't use heap for bit data located on stack. However, by default a compiler warns us about overstepping stack frame size threshold:

arch/um/os-Linux/signal.c: In function ‘sig_handler_common’:
arch/um/os-Linux/signal.c:51:1: warning: the frame size of 2960 bytes is larger than 2048 bytes [-Wframe-larger-than=]
51 | }

      | ^
arch/um/os-Linux/signal.c: In function ‘timer_real_alarm_handler’:
arch/um/os-Linux/signal.c:95:1: warning: the frame size of 2960 bytes is larger than 2048 bytes [-Wframe-larger-than=]
    95 | }
       | ^

Due to above increase stack frame size threshold explicitly for signal.c to avoid unnecessary warning.

---
 arch/um/os-Linux/Makefile | 2 ++
 1 file changed, 2 insertions(+)
arch/um/os-Linux/Makefile +2 -0
index 839915b8c31c..77ac50baa3f8 100644
@@ -10,6 +10,8 @@ obj-y = execvp.o file.o helper.o irq.o main.o mem.o process.o \
 	registers.o sigio.o signal.o start_up.o time.o tty.o \
 	umid.o user_syms.o util.o drivers/ skas/
 
+CFLAGS_signal.o += -Wframe-larger-than=4096
+
 obj-$(CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA) += elf_aux.o
 
 USER_OBJS := $(user-objs-y) elf_aux.o execvp.o file.o helper.o irq.o \
Signature · 7 lines
2.29.2


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um
Tested-by on v1 1/1
#1 lore raw
Quoted 14 lines · Andy Shevchenko

The signal.c can't use heap for bit data located on stack. However, by default a compiler warns us about overstepping stack frame size threshold:

arch/um/os-Linux/signal.c: In function ‘sig_handler_common’:
arch/um/os-Linux/signal.c:51:1: warning: the frame size of 2960 bytes is larger than 2048 bytes [-Wframe-larger-than=]
51 | }

      | ^
arch/um/os-Linux/signal.c: In function ‘timer_real_alarm_handler’:
arch/um/os-Linux/signal.c:95:1: warning: the frame size of 2960 bytes is larger than 2048 bytes [-Wframe-larger-than=]
    95 | }
       | ^
Quoted 5 lines

Due to above increase stack frame size threshold explicitly for signal.c to avoid unnecessary warning.

---

Thanks -- this has been annoying me for a while!

I've tested it -- the warning is indeed gone, and nothing else seems to break.

Cheers,
-- David

_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um