[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH][SPARC] mem_address_not_aligned trap for unalign
From: |
Aurelien Jarno |
Subject: |
Re: [Qemu-devel] [PATCH][SPARC] mem_address_not_aligned trap for unaligned PC |
Date: |
Sun, 01 Apr 2007 19:30:40 +0200 |
User-agent: |
IceDove 1.5.0.10 (X11/20070307) |
Blue Swirl a écrit :
>> According to the SPARCv8 and SPARCv9 manuals, the jmpl, rett and return
>> instructions should generate a mem_address_not_aligned trap if either
>> of the low-order two bits of the target address is nonzero.
>
> This is true, but in that case alignment should be enforced for loads ands
> stores as well. The checks also incur a performance penalty for little
> advantage. Maybe the checks should be enabled only with a compile/run-time
> option.
>
I also have a patch for load/store, but openbios is doing a few
unaligned memory accesses, so the patch can't be used until openbios is
fixed.
I haven't made any benchmark, but the performance penality is probably
very small. If you look at softmmu_template.h, you will see that it only
adds a if test, while the whole function is already a few dozen of lines
long.
I would really like to see the QEMU having the same behaviour as real
hardware, this allow for example debugging SIGBUS problems in a program
without having real hardware.
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' address@hidden | address@hidden
`- people.debian.org/~aurel32 | www.aurel32.net