qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] translate-all: fix locking of TBs whose two pag


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] translate-all: fix locking of TBs whose two pages share the same physical page
Date: Thu, 28 Jun 2018 16:06:56 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 06/27/2018 09:47 AM, Emilio G. Cota wrote:
>>> -    if (p2) {
>>> +    if (p2 && p2 != p) {
>>>          page_unlock(p2);
>>
>> ... so that you need no change here.
>> Otherwise it looks good.
> 
> I did that initially. However, note that if we do that then
> the second page is not added to the list of pages for this
> TB (via tb_page_add), which breaks the provided test case.
> 
>     page_lock_pair(&p, phys_pc, &p2, phys_page2, 1);
>     tb_page_add(p, tb, 0, phys_pc & TARGET_PAGE_MASK);
>     if (p2) {
>         tb_page_add(p2, tb, 1, phys_page2);
>     } else {
>         tb->page_addr[1] = -1;
>     }
> 
> Regardless of whether p1 and p2 point to the same physical page,
> the fact that the TB goes across two virtual pages should be
> preserved, and in this case tb_page_add must be called twice.

Hmm.  Ok.  Queued.


r~



reply via email to

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