qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] tcg: Add tlb_index and tlb_entry helpers


From: Emilio G. Cota
Subject: Re: [Qemu-devel] [PATCH] tcg: Add tlb_index and tlb_entry helpers
Date: Mon, 8 Oct 2018 14:29:00 -0400
User-agent: Mutt/1.9.4 (2018-02-28)

On Sun, Oct 07, 2018 at 18:05:22 -0700, Richard Henderson wrote:
> Isolate the computation of an index from an address into a
> helper before we change that function.
> 
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> 
> Emilio, this should make your dynamic tlb sizing patch 1/6
> significantly smaller.

Nice! I'm adding this as patch 1 for v2. Had to fix the conflicts
with the .addr_write conversion to atomic_write, and also
fixed a few typos like the following:

>  void helper_be_st_name(CPUArchState *env, target_ulong addr, DATA_TYPE val,
>                         TCGMemOpIdx oi, uintptr_t retaddr)
>  {
> -    unsigned mmu_idx = get_mmuidx(oi);
> -    int index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
> -    target_ulong tlb_addr = env->tlb_table[mmu_idx][index].addr_write;
> +    uintptr_t mmu_idx = get_mmuidx(oi);
> +    uintptr_t index = tlb_index(env, mmu_idx, addr);
> +    CPUTLBEntry *entry = tlb_entry(env, mmu_idx, index);

Should be tlb_entry(env, mmu_idx, addr)

Thanks,

                Emilio



reply via email to

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