On 8/1/19 7:14 AM, Aaron Lindsay OS via Qemu-devel wrote: > On Jul 31 17:06, Alex Bennée wrote: >> We need to keep a local per-cpu copy of the data as other threads may >> be running. We use a automatically growing array and re-use the space >> for subsequent queries. > > [...] > >> +bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx, >> + bool is_store, struct qemu_plugin_hwaddr *data) >> +{ >> + CPUArchState *env = cpu->env_ptr; >> + CPUTLBEntry *tlbe = tlb_entry(env, mmu_idx, addr); >> + target_ulong tlb_addr = is_store ? tlb_addr_write(tlbe) : >> tlbe->addr_read; >> + >> + if (tlb_hit(tlb_addr, addr)) { >> + if (tlb_addr & TLB_MMIO) { >> + data->hostaddr = 0; >> + data->is_io = true; >> + /* XXX: lookup device */ >> + } else { >> + data->hostaddr = addr + tlbe->addend; >> + data->is_io = false; >> + } >> + return true; >> + } >> + return false; >> +} > > In what cases do you expect tlb_hit() should not evaluate to true here? > Will returns of false only be in error cases, or do you expect it can > occur during normal operation? In particular, I'm interested in ensuring > this is as reliable as possible, since some plugins may require physical > addresses.
I have the same question. Given the access has just succeeded, it would seem to be that the tlb entry *must* hit. No victim tlb check or anything. r~