On 02/03/2018 01:30 PM, Peter Maydell wrote: > On 3 February 2018 at 21:21, Richard Henderson > <richard.hender...@linaro.org> wrote: >> On 01/30/2018 07:02 AM, Peter Maydell wrote: >>> + if (get_phys_addr(env, addr, MMU_DATA_STORE, mmu_idx, &physaddr, >>> + &attrs, &prot, &page_size, &fi, NULL)) { >> >> Given that you know you're going to call this at least 8 times in a row, >> probably with all operations on the same page, it is worth querying the qemu >> tlb first, and when that fails but the lookup succeeds, installing the result >> into the tlb? > > get_phys_addr and address_space_stl_le don't touch the TLB though?
No, get_phys_addr is the primitive that tlb_fill uses. > We could in theory do a get_phys_addr() once per-page rather than > doing it all 8 times though, yes. After I sent that first message I thought perhaps interacting with the proper TLB is too/overly complicated. We'd get nearly the same results just having a local 1-entry cache. Something like pagecache = -1; stacked_ok = v7m_stack_write(cpu, frameptr, env->regs[0], &pagecache, mmu_idx, false) && v7m_stack_write(cpu, frameptr + 4, env->regs[1], &pagecache, mmu_idx, false) && ... r~