Skip to contentSkip to conversation

Fix ABI incompatibility between Qemu-aarch64 and Linux Kernel in signal handling.

PATCH In review Maxim Ostapenko 3 participants 3 messages Feb 2, 2015 – Feb 7, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Fix ABI incompatibility between Qemu-aarch64 and Linux Kernel in signal handling.

Thanks again,

I've updated the patch. Is this correct now?

-Maxim

From 5b035df58f9f17e64b35311b6b5f55097c7f8ce1 Mon Sep 17 00:00:00 2001
From: Max Ostapenko <[email protected]>
Date: Mon, 2 Feb 2015 12:03:20 +0400
Subject: [PATCH] linux-user: wrong TARGET_SI_PAD_SIZE value for some targets.

Fix TARGET_SI_PAD_SIZE calculation to match the way the kernel does it. Use different TARGET_SI_PREAMBLE_SIZE for 32-bit and 64-bit targets.

---
 linux-user/syscall_defs.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
linux-user/syscall_defs.h +8 -1
index ebb3be1..9ed6de8 100644
@@ -655,7 +655,14 @@ typedef struct {
 #endif
 
 #define TARGET_SI_MAX_SIZE    128
-#define TARGET_SI_PAD_SIZE    ((TARGET_SI_MAX_SIZE/sizeof(int)) - 3)
+
+#if TARGET_ABI_BITS == 32
+#define TARGET_SI_PREAMBLE_SIZE (3 * sizeof(int))
+#else
+#define TARGET_SI_PREAMBLE_SIZE (4 * sizeof(int))
+#endif
+
+#define TARGET_SI_PAD_SIZE ((TARGET_SI_MAX_SIZE - TARGET_SI_PREAMBLE_SIZE) / sizeof(int))
 
 typedef struct target_siginfo {
 #ifdef TARGET_MIPS
Signature · 1 line
1.8.5.2.2930.gf745acb
Reviewed-by on v2 1/1
#1 lore raw
Quoted 3 lines · Maxim Ostapenko

Thanks again,

I've updated the patch. Is this correct now?

Yes, and you can have my

(though I notice you ignored the bit about sending a separate email, not a followup. Still, I expect that Riku or the -trivial maintainers can fish it out manually.)

thanks
-- PMM

#2 lore raw
In reply to Maxim Ostapenko
Quoted 7 lines · Maxim Ostapenko

From 5b035df58f9f17e64b35311b6b5f55097c7f8ce1 Mon Sep 17 00:00:00 2001
From: Max Ostapenko <[email protected]>
Date: Mon, 2 Feb 2015 12:03:20 +0400
Subject: [PATCH] linux-user: wrong TARGET_SI_PAD_SIZE value for some targets.

Fix TARGET_SI_PAD_SIZE calculation to match the way the kernel does it. Use different TARGET_SI_PREAMBLE_SIZE for 32-bit and 64-bit targets.

I've applied your patch to -trivial. However, the patch has been whitespace- damaged so I had to apply it manually - your mailer added several leading spaces, changed tabs into spaces, and word-wrapped several lines. Please, for the next time, send a patch over email to youself and verify if it still applies to a clean branch -- before sending it to the list.

Note also that I used the original subject line of your patch, not the subject line of this emai. Again, please ensure there's just one message with one subject and date, not two ;)

Thanks,

/mjt

Quoted 25 lines
---
 linux-user/syscall_defs.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
linux-user/syscall_defs.h +8 -1
index ebb3be1..9ed6de8 100644
@@ -655,7 +655,14 @@ typedef struct {
 #endif
 
 #define TARGET_SI_MAX_SIZE    128
-#define TARGET_SI_PAD_SIZE    ((TARGET_SI_MAX_SIZE/sizeof(int)) - 3)
+
+#if TARGET_ABI_BITS == 32
+#define TARGET_SI_PREAMBLE_SIZE (3 * sizeof(int))
+#else
+#define TARGET_SI_PREAMBLE_SIZE (4 * sizeof(int))
+#endif
+
+#define TARGET_SI_PAD_SIZE ((TARGET_SI_MAX_SIZE - TARGET_SI_PREAMBLE_SIZE) / sizeof(int))
 
 typedef struct target_siginfo {
 #ifdef TARGET_MIPS