[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 0/2] tcg: fix TLB miss check in get_page_addr_co

From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 0/2] tcg: fix TLB miss check in get_page_addr_code()
Date: Fri, 29 Jun 2018 10:39:01 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 06/29/2018 09:21 AM, Peter Maydell wrote:
> In commit 71b9a45330fe220d1 we changed the condition we use to
> determine whether we need to refill the TLB in get_page_addr_code() to
>         if (unlikely(env->tlb_table[mmu_idx][index].addr_code !=
>                      (addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK)))) {
> This isn't the right check (it will falsely fail if the
> input addr happens to have the low bit corresponding to
> TLB_INVALID_MASK set, for instance).
> This patchset first factors out the "check for a hit" logic
> into some new functions tlb_hit() and tlb_hit_page() (the
> latter is for when the address is known to be page-aligned),
> uses those functions in the various places that do TLB hit tests,
> and then uses tlb_hit() to replace the erroneous code in
> get_page_addr_code().
> I noticed this while trying to debug Laurent's m68k test case:
> it meant that we would come into get_page_addr_code() for a
> TLB hit, falsely decide it was a miss, and then fish an
> older entry out of the TLB victim cache...
> Peter Maydell (2):
>   tcg: Define and use new tlb_hit() and tlb_hit_page() functions
>   accel/tcg: Correct "is this a TLB miss" check in get_page_addr_code()

Reviewed-by: Richard Henderson <address@hidden>
Also, queued to tcg-next.


reply via email to

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