[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fi
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields |
Date: |
Thu, 24 Mar 2016 15:23:11 +0000 |
User-agent: |
mu4e 0.9.17; emacs 25.0.92.7 |
Paolo Bonzini <address@hidden> writes:
> On 24/03/2016 16:01, Alex Bennée wrote:
>>>> >> OK I found that tricky to follow. Where does the value of the pointer
>>>> >> come from that sets these bottom bits? The TB jumping to this TB sets
>>>> >> it?
>>
>> Where I get confused it what is the point of jmp_list_first? If these
>> are two circular lists do we care which the first in the list is? The
>> exit condition when coming out of searching seems when ntb with index =
>> orig tb with index.
>
> Say you have a list for blocks that jump to TB. The next pointer is in
> jmp_list_next[0] for blocks whose first jump is to TB. It is in
> jmp_list_next[1] for blocks whose second jump is to TB.
>
> However, because it is a circular list, you also need TB itself to be a
> part of the list. For TB, the next pointer is in jmp_list_first.
>
> Because TB probably doesn't jump to itself, the first link of the list
> of blocks that jumps to TB is not in jmp_list_next[]. Thus QEMU places
> it in tb->jmp_list_first.
>
> Say you have three tbs. TB1's first jump and TB2's second jump lead to
> TB0. Then the list starting at tb0->jmp_list_first goes like this:
>
> tb0->jmp_list_first = tb1 | 0;
> .--------------------' |
> | .--------'
> tb1->jmp_list_next[0] = tb2 | 1;
> .--------------------' |
> | .---------'
> tb2->jmp_list_next[1] = tb0 | 2;
>
> There is also a case where a TB jumps to itself; it then appears twice
> in the list with different values in the low bits, such as this:
>
> tb->jmp_list_first = tb | 0;
> .--------------------' |
> | .-------'
> tb->jmp_list_next[0] = tb | 2;
>
> Other blocks jumping to TB would appear in the same list, too, either
> before or after the tb|0 link.
Right I follow now. Extra ascii art always helps ;-)
--
Alex Bennée
- [Qemu-devel] [PATCH 0/8] tcg: Direct block chaining clean-up, sergey . fedorov, 2016/03/24
- [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, sergey . fedorov, 2016/03/24
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Alex Bennée, 2016/03/24
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Sergey Fedorov, 2016/03/24
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Alex Bennée, 2016/03/24
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Sergey Fedorov, 2016/03/24
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Paolo Bonzini, 2016/03/24
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields,
Alex Bennée <=
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Richard Henderson, 2016/03/28
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Paolo Bonzini, 2016/03/29
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Paolo Bonzini, 2016/03/29
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Sergey Fedorov, 2016/03/29
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Richard Henderson, 2016/03/29
- Re: [Qemu-devel] [Qemu-arm] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Peter Maydell, 2016/03/29
- Re: [Qemu-devel] [Qemu-arm] [PATCH 1/8] tcg: Clean up direct block chaining data fields, Sergey Fedorov, 2016/03/29
[Qemu-devel] [PATCH 2/8] tcg: Use uintptr_t type for jmp_list_{next|first} fields of TB, sergey . fedorov, 2016/03/24