From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xenproject.org, patches@linaro.org,
stefano.stabellini@citrix.com, tim@xen.org
Subject: Re: [PATCH v2] xen/arm: p2m: Correctly flush TLB in create_p2m_entries
Date: Tue, 14 Jan 2014 12:41:47 +0000 [thread overview]
Message-ID: <52D5308B.6020000@linaro.org> (raw)
In-Reply-To: <1389635845.13654.117.camel@kazak.uk.xensource.com>
On 01/13/2014 05:57 PM, Ian Campbell wrote:
> On Mon, 2014-01-13 at 17:37 +0000, Julien Grall wrote:
>> On 01/13/2014 05:10 PM, Ian Campbell wrote:
>>> Hrm, our TLB flush discipline is horribly confused isn't it...
>>>
>>> On Thu, 2014-01-09 at 16:34 +0000, Julien Grall wrote:
>>>> The p2m is shared between VCPUs for each domain. Currently Xen only flush
>>>> TLB on the local PCPU. This could result to mismatch between the mapping in the
>>>> p2m and TLBs.
>>>>
>>>> Flush TLB entries used by this domain on every PCPU. The flush can also be
>>>> moved out of the loop because:
>>>> - ALLOCATE: only called for dom0 RAM allocation, so the flush is never called
>>>
>>> OK.
>>>
>>> An ASSERT(!third[third_table_offset(addr)].p2m.valid) might be
>>> worthwhile if that is the case.
>>
>> Will add it.
>
> Thanks.
>
>>> (I'm not sure why ALLOCATE can't be replaced by allocation followed by
>>> an INSERT, it's seems very special case)
>>>
>>>> - INSERT: if valid = 1 that would means with have replaced a
>>>> page that already belongs to the domain. A VCPU can write on the wrong page.
>>>> This can append for dom0 with the 1:1 mapping because the mapping is not
>>>> removed from the p2m.
>>>
>>> "append"? Do you mean "happen"?
>>
>> I meant "happen".
>>
>>>
>>> In the non-dom0 1:1 case eventually the page will be freed, I guess by a
>>> subsequent put_page elsewhere -- do they all contain the correct
>>> flushing? Or do we just leak?
>>
>> As for foreign mapping the INSERT function should be hardened. We don't
>
> Did you mean "handled"?
I meant both :). Actually we don't have any check in this function as
for REMOVE case.
I don't think it's possible to do it for 4.4, we take a reference on the
mapping every time a new entrie is added in the p2m.
--
Julien Grall
next prev parent reply other threads:[~2014-01-14 12:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-09 16:34 [PATCH v2] xen/arm: p2m: Correctly flush TLB in create_p2m_entries Julien Grall
2014-01-13 17:10 ` Ian Campbell
2014-01-13 17:37 ` Julien Grall
2014-01-13 17:57 ` Ian Campbell
2014-01-14 12:41 ` Julien Grall [this message]
2014-01-14 12:54 ` Ian Campbell
2014-01-14 13:20 ` Julien Grall
2014-01-14 15:28 ` Ian Campbell
2014-01-16 10:10 ` Tim Deegan
2014-01-16 10:46 ` Ian Campbell
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=52D5308B.6020000@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=patches@linaro.org \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.