qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Emilio G. Cota" <cota@braap.org>
Cc: qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Fam Zheng" <famz@redhat.com>,
	"Max Filippov" <jcmvbkbc@gmail.com>
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	[thread overview]
Message-ID: <c2ccb0a2-fc74-7d5c-3935-99522e19fed0@linaro.org> (raw)
In-Reply-To: <20180627164757.GA17117@flamenco>

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	other threads:[~2018-06-28 23:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25 16:31 [Qemu-devel] [PATCH] translate-all: fix locking of TBs whose two pages share the same physical page Emilio G. Cota
2018-06-25 16:46 ` Max Filippov
2018-06-25 17:11 ` Philippe Mathieu-Daudé
2018-06-27  2:28 ` Richard Henderson
2018-06-27 16:47   ` Emilio G. Cota
2018-06-28 23:06     ` Richard Henderson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2ccb0a2-fc74-7d5c-3935-99522e19fed0@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=cota@braap.org \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).