linux-user: Fix register used for 6th and 7th syscall argument on aarch64
PATCH 1/1 linux-user: Fix register used for 6th and 7th syscall argument on aarch64
Unbreaks the testcase from
http://lists.nongnu.org/archive/html/qemu-arm/2018-01/msg00514.html
Thanks to Laurent Vivier for spotting the 7th one.
--- linux-user/host/aarch64/safe-syscall.inc.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
linux-user/host/aarch64/safe-syscall.inc.S +3 -3
@@ -36,7 +36,7 @@ safe_syscall_base: * and return the result in x0 * and the syscall instruction needs * x8 == syscall number - * x0 ... x7 == syscall arguments + * x0 ... x6 == syscall arguments * and returns the result in x0 * Shuffle everything around appropriately. */
@@ -47,8 +47,8 @@ safe_syscall_base: mov x2, x4 mov x3, x5 mov x4, x6 - mov x6, x7 - ldr x7, [sp] + mov x5, x7 + ldr x6, [sp] /* This next sequence of code works in conjunction with the * rewind_if_safe_syscall_function(). If a signal is taken
Signature · 1 line
2.15.1
I spent the night studying linux-user end figured out the same correct fix. Just checking morning ML before sending the patch :)
Mine had "Suggested-by: Laurent Vivier <[email protected]>" since he said on IRC "gdb will help" and indeed single stepping before the syscall the bug was obvious.
Quoted 6 lines · Guido Günther
Unbreaks the testcase from
http://lists.nongnu.org/archive/html/qemu-arm/2018-01/msg00514.htmlThanks to Laurent Vivier for spotting the 7th one.
Signed-off-by Guido Günther <[email protected]>
Quoted 29 lines
--- linux-user/host/aarch64/safe-syscall.inc.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)linux-user/host/aarch64/safe-syscall.inc.S +3
-3@@ -36,7 +36,7 @@ safe_syscall_base: * and return the result in x0 * and the syscall instruction needs * x8 == syscall number - * x0 ... x7 == syscall arguments + * x0 ... x6 == syscall arguments * and returns the result in x0 * Shuffle everything around appropriately. */@@ -47,8 +47,8 @@ safe_syscall_base: mov x2, x4 mov x3, x5 mov x4, x6 - mov x6, x7 - ldr x7, [sp] + mov x5, x7 + ldr x6, [sp] /* This next sequence of code works in conjunction with the * rewind_if_safe_syscall_function(). If a signal is taken
Le 24/01/2018 à 11:13, Guido Günther a écrit :
Quoted 25 lines
Unbreaks the testcase from
http://lists.nongnu.org/archive/html/qemu-arm/2018-01/msg00514.htmlThanks to Laurent Vivier for spotting the 7th one.
Signed-off-by Guido Günther <[email protected]>--- linux-user/host/aarch64/safe-syscall.inc.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)linux-user/host/aarch64/safe-syscall.inc.S +1
-1@@ -36,7 +36,7 @@ safe_syscall_base: * and return the result in x0 * and the syscall instruction needs * x8 == syscall number - * x0 ... x7 == syscall arguments + * x0 ... x6 == syscall arguments * and returns the result in x0 * Shuffle everything around appropriately. */
linux-user/host/aarch64/safe-syscall.inc.S safe_syscall_base: · line 54
Quoted 10 lines
linux-user/host/aarch64/safe-syscall.inc.S +2
-2@@ -47,8 +47,8 @@ safe_syscall_base: mov x2, x4 mov x3, x5 mov x4, x6 - mov x6, x7 - ldr x7, [sp] + mov x5, x7 + ldr x6, [sp] /* This next sequence of code works in conjunction with the * rewind_if_safe_syscall_function(). If a signal is taken
for your future patches (I hope there will be), if there are several versions, add the version number in the Subject (i.e. "[PATCH v2]") and version history below the signature mark ("---"):
...
---
v2: fix also 7th arg
linux-user/host/aarch64/safe-syscall.inc.S | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)...
Thanks,
Laurent
Quoted 9 lines · Guido Günther
Unbreaks the testcase from
http://lists.nongnu.org/archive/html/qemu-arm/2018-01/msg00514.htmlThanks to Laurent Vivier for spotting the 7th one.
Signed-off-by Guido Günther <[email protected]>--- linux-user/host/aarch64/safe-syscall.inc.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
r~
PATCH v3 1/1 linux-user: Fix register used for 6th and 7th syscall argument on aarch64
In reply to Guido GüntherThis unbreaks the testcase from
http://lists.nongnu.org/archive/html/qemu-arm/2018-01/msg00514.html
Thanks to Laurent Vivier for spotting the 7th one.
---
v3 collects *-by: replies. Anything else I can do to get this applied?
linux-user/host/aarch64/safe-syscall.inc.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
linux-user/host/aarch64/safe-syscall.inc.S +3 -3
@@ -36,7 +36,7 @@ safe_syscall_base: * and return the result in x0 * and the syscall instruction needs * x8 == syscall number - * x0 ... x7 == syscall arguments + * x0 ... x6 == syscall arguments * and returns the result in x0 * Shuffle everything around appropriately. */
@@ -47,8 +47,8 @@ safe_syscall_base: mov x2, x4 mov x3, x5 mov x4, x6 - mov x6, x7 - ldr x7, [sp] + mov x5, x7 + ldr x6, [sp] /* This next sequence of code works in conjunction with the * rewind_if_safe_syscall_function(). If a signal is taken
Signature · 1 line
2.15.1
Laurent Vivier
AppliedLe 02/02/2018 à 11:02, Guido Günther a écrit :
Quoted 11 lines
This unbreaks the testcase from
http://lists.nongnu.org/archive/html/qemu-arm/2018-01/msg00514.htmlThanks to Laurent Vivier for spotting the 7th one.
Signed-off-by Guido Günther <[email protected]>Suggested-by Laurent Vivier <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Richard Henderson <[email protected]>
Quoted 5 lines
---
v3 collects *-by: replies. Anything else I can do to get this applied?linux-user/host/aarch64/safe-syscall.inc.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Applied to my 'linux-user-for-2.12' branch.
Thanks,
Laurent