grub-core/kern/arm/misc.S: fix unaligned grub_uint64_t local variable
PATCH 1/1 grub-core/kern/arm/misc.S: fix unaligned grub_uint64_t local variable
The unaligned local in __aeabi_uidivmod leads to a store to a 64bit value at an address that is not divisible by 8 (in grub_divmod64). The compiler most likely generates a STRD instruction to store it and this causes an exception.
Fixes Savannah bug #43632.
This includes improvements done by Leif Lindholm.
--- ChangeLog | 6 ++++++ grub-core/kern/arm/misc.S | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-)
ChangeLog +6 -0
@@ -1,3 +1,9 @@ +2014-11-21 David Kozub <[email protected]> + + * grub-core/kern/arm/misc.S: fix unaligned 64bit local variable + in __aeabi_uidivmod + Fixes Savannah bug #43632. + 2014-11-20 Andrei Borzenkov <[email protected]> * tests/util/grub-fs-tester.in: Consistently print output
grub-core/kern/arm/misc.S +7 -7
@@ -60,17 +60,17 @@ FUNCTION(__aeabi_lmul) .macro division parent - stmfd sp!, {lr} - sub sp, sp, #12 + sub sp, sp, #8 @ Allocate naturally aligned 64-bit space + stmfd sp!, {r3,lr} @ Dummy r3 to maintain stack alignment + add r3, sp, #8 @ Set r3 to address of 64-bit space + str r3, [sp] @ Stack parameter, pointer to 64-bit space mov r2, r1 - add r1, sp, #4 - str r1, [sp, #0] mov r1, #0 mov r3, #0 bl \parent - ldr r1, [sp, #4] - add sp, sp, #12 - ldmfd sp!, {lr} + ldr r1, [sp, #8] @ Extract remainder + ldmfd sp!, {r3,lr} @ Pop into an unused arg/scratch register + add sp, sp, #8 bx lr .endm
Signature · 1 line
2.1.1
Quoted 6 lines · David Kozub
The unaligned local in
__aeabi_uidivmodleads to a store to a 64bit value at an address that is not divisible by 8 (ingrub_divmod64). The compiler most likely generates a STRD instruction to store it and this causes an exception.Fixes Savannah bug #43632.
I agree with this patch - am I OK to push?
/
Leif
Quoted 57 lines
This includes improvements done by Leif Lindholm.
--- ChangeLog | 6 ++++++ grub-core/kern/arm/misc.S | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-)ChangeLog +6
-0@@ -1,3 +1,9 @@ +2014-11-21 David Kozub <[email protected]> + + * grub-core/kern/arm/misc.S: fix unaligned 64bit local variable + in __aeabi_uidivmod + Fixes Savannah bug #43632. + 2014-11-20 Andrei Borzenkov <[email protected]> * tests/util/grub-fs-tester.in: Consistently print outputgrub-core/kern/arm/misc.S +7
-7@@ -60,17 +60,17 @@ FUNCTION(__aeabi_lmul) .macro division parent - stmfd sp!, {lr} - sub sp, sp, #12 + sub sp, sp, #8 @ Allocate naturally aligned 64-bit space + stmfd sp!, {r3,lr} @ Dummy r3 to maintain stack alignment + add r3, sp, #8 @ Set r3 to address of 64-bit space + str r3, [sp] @ Stack parameter, pointer to 64-bit space mov r2, r1 - add r1, sp, #4 - str r1, [sp, #0] mov r1, #0 mov r3, #0 bl \parent - ldr r1, [sp, #4] - add sp, sp, #12 - ldmfd sp!, {lr} + ldr r1, [sp, #8] @ Extract remainder + ldmfd sp!, {r3,lr} @ Pop into an unused arg/scratch register + add sp, sp, #8 bx lr .endmSignature · 7 lines
2.1.1 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
В Tue, 25 Nov 2014 11:43:57 +0000
Leif Lindholm <[email protected]> пишет:
Quoted 9 lines · David Kozub
Quoted 6 lines
The unaligned local in
__aeabi_uidivmodleads to a store to a 64bit value at an address that is not divisible by 8 (ingrub_divmod64). The compiler most likely generates a STRD instruction to store it and this causes an exception.Fixes Savannah bug #43632.
I agree with this patch - am I OK to push?
Yes, you are the best expert here.
Quoted 66 lines
/
LeifQuoted 57 lines
This includes improvements done by Leif Lindholm.
--- ChangeLog | 6 ++++++ grub-core/kern/arm/misc.S | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-)ChangeLog +6
-0@@ -1,3 +1,9 @@ +2014-11-21 David Kozub <[email protected]> + + * grub-core/kern/arm/misc.S: fix unaligned 64bit local variable + in __aeabi_uidivmod + Fixes Savannah bug #43632. + 2014-11-20 Andrei Borzenkov <[email protected]> * tests/util/grub-fs-tester.in: Consistently print outputgrub-core/kern/arm/misc.S +7
-7@@ -60,17 +60,17 @@ FUNCTION(__aeabi_lmul) .macro division parent - stmfd sp!, {lr} - sub sp, sp, #12 + sub sp, sp, #8 @ Allocate naturally aligned 64-bit space + stmfd sp!, {r3,lr} @ Dummy r3 to maintain stack alignment + add r3, sp, #8 @ Set r3 to address of 64-bit space + str r3, [sp] @ Stack parameter, pointer to 64-bit space mov r2, r1 - add r1, sp, #4 - str r1, [sp, #0] mov r1, #0 mov r3, #0 bl \parent - ldr r1, [sp, #4] - add sp, sp, #12 - ldmfd sp!, {lr} + ldr r1, [sp, #8] @ Extract remainder + ldmfd sp!, {r3,lr} @ Pop into an unused arg/scratch register + add sp, sp, #8 bx lr .endmSignature · 7 lines
2.1.1 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Please commit and push.
Quoted 88 lines · Andrei Borzenkov
В Tue, 25 Nov 2014 11:43:57 +0000
Leif Lindholm <[email protected]> пишет:Quoted 9 lines · David Kozub
Quoted 6 lines
The unaligned local in
__aeabi_uidivmodleads to a store to a 64bit value at an address that is not divisible by 8 (ingrub_divmod64). The compiler most likely generates a STRD instruction to store it and this causes an exception.Fixes Savannah bug #43632.
I agree with this patch - am I OK to push?
Yes, you are the best expert here.
Quoted 57 lines
/
LeifQuoted 53 lines
This includes improvements done by Leif Lindholm.
--- ChangeLog | 6 ++++++ grub-core/kern/arm/misc.S | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-)ChangeLog +6
-0@@ -1,3 +1,9 @@ +2014-11-21 David Kozub <[email protected]> + + * grub-core/kern/arm/misc.S: fix unaligned 64bit local variable + in __aeabi_uidivmod + Fixes Savannah bug #43632. + 2014-11-20 Andrei Borzenkov <[email protected]> * tests/util/grub-fs-tester.in: Consistently print outputgrub-core/kern/arm/misc.S +7
-7@@ -60,17 +60,17 @@ FUNCTION(__aeabi_lmul) .macro division parent - stmfd sp!, {lr} - sub sp, sp, #12 + sub sp, sp, #8 @ Allocate naturally aligned 64-bit space + stmfd sp!, {r3,lr} @ Dummy r3 to maintain stack alignment + add r3, sp, #8 @ Set r3 to address of 64-bit space + str r3, [sp] @ Stack parameter, pointer to 64-bit space mov r2, r1 - add r1, sp, #4 - str r1, [sp, #0] mov r1, #0 mov r3, #0 bl \parent - ldr r1, [sp, #4] - add sp, sp, #12 - ldmfd sp!, {lr} + ldr r1, [sp, #8] @ Extract remainder + ldmfd sp!, {r3,lr} @ Pop into an unused arg/scratch register + add sp, sp, #8 bx lr .endmSignature · 1 line
2.1.1Quoted 9 lines
Quoted 4 lines
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 1 line · Vladimir 'φ-coder/phcoder' Serbinenko
Please commit and push.
Apologies, I've been on holiday and then knocked down with a bad cold, but I notice Andrei has now committed this - thanks!
/
Leif
Quoted 10 lines · Leif Lindholm
Quoted 6 lines · David Kozub
The unaligned local in
__aeabi_uidivmodleads to a store to a 64bit value at an address that is not divisible by 8 (ingrub_divmod64). The compiler most likely generates a STRD instruction to store it and this causes an exception.Fixes Savannah bug #43632.
I agree with this patch - am I OK to push?
Go ahead.
Quoted 66 lines
/
LeifQuoted 57 lines
This includes improvements done by Leif Lindholm.
--- ChangeLog | 6 ++++++ grub-core/kern/arm/misc.S | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-)ChangeLog +6
-0@@ -1,3 +1,9 @@ +2014-11-21 David Kozub <[email protected]> + + * grub-core/kern/arm/misc.S: fix unaligned 64bit local variable + in __aeabi_uidivmod + Fixes Savannah bug #43632. + 2014-11-20 Andrei Borzenkov <[email protected]> * tests/util/grub-fs-tester.in: Consistently print outputgrub-core/kern/arm/misc.S +7
-7@@ -60,17 +60,17 @@ FUNCTION(__aeabi_lmul) .macro division parent - stmfd sp!, {lr} - sub sp, sp, #12 + sub sp, sp, #8 @ Allocate naturally aligned 64-bit space + stmfd sp!, {r3,lr} @ Dummy r3 to maintain stack alignment + add r3, sp, #8 @ Set r3 to address of 64-bit space + str r3, [sp] @ Stack parameter, pointer to 64-bit space mov r2, r1 - add r1, sp, #4 - str r1, [sp, #0] mov r1, #0 mov r3, #0 bl \parent - ldr r1, [sp, #4] - add sp, sp, #12 - ldmfd sp!, {lr} + ldr r1, [sp, #8] @ Extract remainder + ldmfd sp!, {r3,lr} @ Pop into an unused arg/scratch register + add sp, sp, #8 bx lr .endmSignature · 7 lines
2.1.1 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel