qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] MIPS little endian - Bug when decoding physaddr


From: Aurelien Jarno
Subject: Re: [Qemu-devel] MIPS little endian - Bug when decoding physaddr
Date: Sat, 13 May 2017 20:28:14 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On 2017-05-12 19:52, Vinicius Maciel wrote:
> Hi all,
> 
> I'm trying to emulate a MIPS 74Kc using a custom machine in order to run a
> CFE bootloader from broadcom. The CPU is Broadcom BCM5357. The problem
> happens when Qemu calculates physaddr inside io_readx(), cputlb.c:line 784
> 
> physaddr = (physaddr & TARGET_PAGE_MASK) + addr;
> 
> After run this line the the value is 0x18000000, which is clearly wrong.

I don't think it's wrong, see below:

> More informations:
> 
> BUG function: io_readx
> Assembly instruction: lw t1,0(a2)
> Machine code: 0x8cc90000 (Little endian)
> Access address: 0xb8000000
> 
> Assembly code:
> 80702f30 <board_earlyinit>:
> 80702f30: 3c06b800 lui a2,0xb800

This load 0xb8000000 in a2

> 80702f34: 24075350 li a3,21328
> 80702f38: 8cc90000 lw t1,0(a2) <----

Now this try to load a value from the virtual address 0xb8000000. This
address corresponds to kseg1 (Kernel Unmapped Uncached) and is mapped
to the physical address 0x18000000. See the MIPS32 Privileged Resource
Architecture Manual for more details how the virtual to physical mapping
works.

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
address@hidden                 http://www.aurel32.net



reply via email to

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