qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] MIPS CP0 Random register fix


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH] MIPS CP0 Random register fix
Date: Thu, 8 Jan 2009 19:51:53 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

On Sat, Jan 03, 2009 at 06:20:13PM +0100, Hervé Poussineau wrote:
> Hello,
>
> MIPS TLBWR instruction asks the CPU to randomly overwrite a TLB entry by  
> the one we want to write. The TLB index needs to be between number of  
> wired TLB entries and TLB count - 1.
> However, algorithm to choose which one to overwrite is implementation  
> dependant.
>
> At the moment, Qemu implementation is a random one, but can return the  
> same value more than once.
> Due to this, NetBSD 1.6.2 on MIPS Magnum emulation crashes.
>
> After checking MIPS CPU documentations, multiple algorithms exist to  
> update this Random register, but they all guarantee that 2 close TLBWR  
> instructions don't overwrite the same TLB.
>
> Attached patch prevents returning the same TLB index twice, by choosing  
> the next immediate value if random value is the same as before.

I have actually applied a different patch, which also change to a better
random generator. PLease confirm that it works.

-- 
  .''`.  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]