Re: [Qemu-devel] [Qemu-ppc] BookE MMU question

2017-08-20 Thread BALATON Zoltan
On Sun, 20 Aug 2017, Mark Cave-Ayland wrote: On 20/08/17 22:59, BALATON Zoltan wrote: So I'd suggest adding debugging to alloc_tlb() to find out why TLB slot 0 is being chosen again for the 0x8000 mapping even though free_tlb() hasn't been called for that entry. I've tried that but it onl

Re: [Qemu-devel] [Qemu-ppc] BookE MMU question

2017-08-20 Thread Mark Cave-Ayland
On 20/08/17 22:59, BALATON Zoltan wrote: >> So I'd suggest adding debugging to alloc_tlb() to find out why TLB slot >> 0 is being chosen again for the 0x8000 mapping even though >> free_tlb() hasn't been called for that entry. > > I've tried that but it only confirmed what I thought. This is

Re: [Qemu-devel] [Qemu-ppc] BookE MMU question

2017-08-20 Thread BALATON Zoltan
On Sun, 20 Aug 2017, Mark Cave-Ayland wrote: Just glancing at the code again it looks like the choice of slot is determined by alloc_tlb(). It seems there are 64 TLB slots stored in tlb_info as 2 x 32-bit bitmaps where a 1 bit indicates the slot is free and a 0 bit indicates the slot is in use.

Re: [Qemu-devel] [Qemu-ppc] BookE MMU question

2017-08-20 Thread Mark Cave-Ayland
On 20/08/17 14:35, BALATON Zoltan wrote: > Anyway, this makes more sense because if the TLB 0 entry is replaced > like the above log shows then there will be no mapping for the ff7fd648 > address until the next map_region call maps it. On real hardware this > seems to work but on QEMU this causes

Re: [Qemu-devel] [Qemu-ppc] BookE MMU question

2017-08-20 Thread BALATON Zoltan
On Sun, 20 Aug 2017, Mark Cave-Ayland wrote: I've only spent a small amount of time in PPC MMU land via OpenBIOS but the obvious thing that stands out here is this: helper_440_tlbwe word 0 entry 0 value ff7f7210 tlb_flush_nocheck: (count: 36) helper_440_tlbwe word 1 entry 0 value 007f7000 tlb_fl

Re: [Qemu-devel] [Qemu-ppc] BookE MMU question

2017-08-20 Thread Mark Cave-Ayland
On 20/08/17 00:19, BALATON Zoltan wrote: > This function is defined in AROS/arch/ppc-sam440/kernel/mmu.c:95 at the > link below. I think it basically generates tlbwe instructions to set up > a TLB entry to map the region to a virtual address. > >> eg: what is in the MAS registers before the tlbwe

Re: [Qemu-devel] [Qemu-ppc] BookE MMU question

2017-08-19 Thread BALATON Zoltan
On Sun, 20 Aug 2017, KONRAD Frederic wrote: Hi, I think you need to go more in detail in what this map_region function does.. This function is defined in AROS/arch/ppc-sam440/kernel/mmu.c:95 at the link below. I think it basically generates tlbwe instructions to set up a TLB entry to map the