From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH][MIPS] Fix [ls][wd][lr] instructions
Date: Wed, 26 Sep 2007 12:45:48 +0200 [thread overview]
Message-ID: <46FA385C.50505@aurel32.net> (raw)
In-Reply-To: <46FA2BE1.3070307@bellard.org>
Fabrice Bellard a écrit :
> Aurelien Jarno wrote:
>> Hi,
>>
>> As written in the MIPS TODO file, the lwl, lwr, ldl, ldr, swl, swr,
>> sdl and sdr instructions are not correctly implemented. In case of
>> exception the BadVAddr register gets the aligned address instead of the
>> unaligned original address.
>>
>> In addition to that, the store instructions are generating the wrong
>> exception, AdEl instead of AdEs, because the current implementation
>> first do a load.
>>
>> The patch below fixes that by accessing the bytes one by one, starting
>> by the unaligned original address.
> > [...]
>
> It would be a lot more efficient to add specific code in the MIPS
> exception handling.
>
That was the first approach I tried to follow, but it is not that easy.
Basically the solution is to add a new flag to CPUMIPSState to mark
instructions that need fix when an exception occurs and then fix the
exception type and address if needed.
Given those instructions are not used that often (unaligned memory
accesses have to be avoided), I am not sure it is worth adding too much
complexity in the mmu fault and exception handling code, which is used
by all instructions.
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
next prev parent reply other threads:[~2007-09-26 10:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-26 9:23 [Qemu-devel] [PATCH][MIPS] Fix [ls][wd][lr] instructions Aurelien Jarno
2007-09-26 9:47 ` Fabrice Bellard
2007-09-26 10:45 ` Aurelien Jarno
2007-09-26 9:52 ` Fabrice Bellard
2007-09-26 10:45 ` Aurelien Jarno [this message]
2007-10-06 11:19 ` Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46FA385C.50505@aurel32.net \
--to=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).