: unaligned
PATCH 1/1 : unaligned
Hi
- asm wants a unsigned long
- verify_area wants a void *
one of the two places need a cast.
Once there, ralf? forgot that emulate_load_store returns void, then nuke the return 1 part.
Later, Juan.
Index: arch/mips/kernel/unaligned.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/kernel/unaligned.c,v retrieving revision 1.15.2.11
mips/kernel/unaligned.c +9 -9
@@ -139,7 +139,7 @@* The remaining opcodes are the ones that are really of interest. */ case lh_op: -if (verify_area (VERIFY_READ , addr,2 )) +if (verify_area (VERIFY_READ , (void *)addr,2 )) goto sigbus; __asm__(".set\tnoat\n"
@@ -171,7 +171,7 @@break ;case lw_op: -if (verify_area (VERIFY_READ , addr,4 )) +if (verify_area (VERIFY_READ , (void *)addr,4 )) goto sigbus; __asm__(
@@ -200,7 +200,7 @@break ;case lhu_op: -if (verify_area (VERIFY_READ , addr,2 )) +if (verify_area (VERIFY_READ , (void *)addr,2 )) goto sigbus; __asm__(
@@ -241,7 +241,7 @@* would blow up, so for now we don't handle unaligned 64-bit * instructions on 32-bit kernels. */ -if (verify_area (VERIFY_READ , addr,4 )) +if (verify_area (VERIFY_READ , (void *)addr,4 )) goto sigbus; __asm__(
@@ -284,7 +284,7 @@* would blow up, so for now we don't handle unaligned 64-bit * instructions on 32-bit kernels. */ -if (verify_area (VERIFY_READ , addr,8 )) +if (verify_area (VERIFY_READ , (void *)addr,8 )) goto sigbus; __asm__(
@@ -317,7 +317,7 @@ goto sigill;case sh_op: -if (verify_area (VERIFY_WRITE , addr,2 )) +if (verify_area (VERIFY_WRITE , (void *)addr,2 )) goto sigbus; value = regs->regs[insn.i_format.rt];
@@ -353,7 +353,7 @@break ;case sw_op: -if (verify_area (VERIFY_WRITE , addr,4 )) +if (verify_area (VERIFY_WRITE , (void *)addr,4 )) goto sigbus; value = regs->regs[insn.i_format.rt];
@@ -391,7 +391,7 @@* would blow up, so for now we don't handle unaligned 64-bit * instructions on 32-bit kernels. */ -if (verify_area (VERIFY_WRITE , addr,8 )) +if (verify_area (VERIFY_WRITE , (void *)addr,8 )) goto sigbus; value = regs->regs[insn.i_format.rt];
@@ -469,7 +469,7 @@printk (KERN_DEBUG "%s: Forwarding exception at [<%lx>] (%lx)\n" , current->comm, regs->cp0_epc, new_epc); regs->cp0_epc = new_epc; -return 1 ; +return ; }die_if_kernel ("Unhandled kernel unaligned access" , regs);
Signature · 2 lines
In theory, practice and theory are the same, but in practice they are different -- Larry McVoy
Quoted 3 lines · Juan Quintela
- asm wants a unsigned long
-verify_areawants a void *
one of the two places need a cast.
Making emulate_load_store take a void * as the address argument was much nicer instead.
Quoted 2 lines
Once there, ralf? forgot that
emulate_load_storereturns void, then nuke the return 1 part.
Already did that.
Ralf
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"ralf" == Ralf Baechle <[email protected]> writes:
Quoted 3 lines · Juan Quintela
Quoted 3 lines
- asm wants a unsigned long
-verify_areawants a void *
one of the two places need a cast.
ralf> Making emulate_load_store take a void * as the address argument was much ralf> nicer instead.
I didn't wanted to touch asm() parts yet :)
Quoted 2 lines
Quoted 2 lines
Once there, ralf? forgot that
emulate_load_storereturns void, then nuke the return 1 part.
ralf> Already did that.
nice.
Later, Juan.
Signature · 2 lines
In theory, practice and theory are the same, but in practice they are different -- Larry McVoy
Quoted 4 lines · Juan Quintela
ralf> Making
emulate_load_storetake a void * as the address argument was much ralf> nicer instead.I didn't wanted to touch
asm()parts yet :)
No need to touch them. My patch was just a two line change to unaligned.c.
Ralf