[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 5/7] pc-bios/s390-ccw: Provide space for initial stack frame i
From: |
Thomas Huth |
Subject: |
[PATCH v3 5/7] pc-bios/s390-ccw: Provide space for initial stack frame in start.S |
Date: |
Thu, 29 Jun 2023 12:48:19 +0200 |
Providing the space of a stack frame is the duty of the caller,
so we should reserve 160 bytes before jumping into the main function.
Otherwise the main() function might write past the stack array.
While we're at it, add a proper STACK_SIZE macro for the stack size
instead of using magic numbers (this is also required for the following
patch).
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-Id: <20230627074703.99608-3-thuth@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
pc-bios/s390-ccw/start.S | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S
index d29de09cc6..abd6fe6639 100644
--- a/pc-bios/s390-ccw/start.S
+++ b/pc-bios/s390-ccw/start.S
@@ -10,10 +10,13 @@
* directory.
*/
+#define STACK_SIZE 0x8000
+#define STACK_FRAME_SIZE 160
+
.globl _start
_start:
- larl %r15,stack + 0x8000 /* Set up stack */
+ larl %r15,stack + STACK_SIZE - STACK_FRAME_SIZE /* Set up stack */
/* clear bss */
larl %r2,__bss_start
--
2.39.3
- [PATCH v3 0/7] pc-bios/s390-ccw: Fixes and improvements for start.S (and other files), Thomas Huth, 2023/06/29
- [PATCH v3 1/7] s390-ccw: Getting rid of ulong, Thomas Huth, 2023/06/29
- [PATCH v3 5/7] pc-bios/s390-ccw: Provide space for initial stack frame in start.S,
Thomas Huth <=
- [PATCH v3 2/7] pc-bios/s390-ccw: Get rid of the the __u* types, Thomas Huth, 2023/06/29
- [PATCH v3 3/7] pc-bios/s390-ccw/Makefile: Use -z noexecstack to silence linker warning, Thomas Huth, 2023/06/29
- [PATCH v3 6/7] pc-bios/s390-ccw: Move the stack array into start.S, Thomas Huth, 2023/06/29
- [PATCH v3 4/7] pc-bios/s390-ccw: Fix indentation in start.S, Thomas Huth, 2023/06/29
- [PATCH v3 7/7] pc-bios/s390-ccw: Don't use __bss_start with the "larl" instruction, Thomas Huth, 2023/06/29