qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH][MIPS] Fix [ls][wd][lr] instructions


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH][MIPS] Fix [ls][wd][lr] instructions
Date: Wed, 26 Sep 2007 12:45:48 +0200
User-agent: IceDove 1.5.0.10 (X11/20070328)

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
 `. `'   address@hidden         | address@hidden
   `-    people.debian.org/~aurel32 | www.aurel32.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]