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

Re: [Xen-devel] [PATCH v4 3/8] xen/arm32: head: Remove 1:1 mapping as soon as it is not used


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Julien Grall <Julien.Grall@xxxxxxx>
  • Date: Wed, 25 Sep 2019 21:29:27 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jGJq75SSSv+PjC6y1Kj6JZ9KEMnAZTL0+GeCXzEyrjw=; b=jPhIxG8881kF6iNrWkE8L0PLOeSu1wBOoNNG9y9ffMw7cej24efez9Xp+Loh76rtMz3TPhNmxDTz6g/3+YbZ0L981mqrX/eauSHob95S+/b+44S9j8oSvZNVFEkLwgd/78geVPehvBqKnzgMMEeiuRzHNyTssLmwS7vBtS1fpt/9CR2tL8/Vkvi8/nmcJ58Ef3MHnvOwiIsrhidtxo8iHbW4JqKTQTeVbwn/L2zO47sAwMXZrCID6YvG6ztx2oZmLn+89h6saQf347bE6bhIIGnh/PfKKYXZrrSi4eb9ASyrh6YJshuN2c4aLP/AEnDh7fCmGkhW2+2bvwYeoMytfQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iGd6EMxXj4lo4iVmJDNmiTe5/6ZuxjQvBDBA6MS34paIaLsquf6JYX08pHTMCgluLKYyYlRfrJ9hugelBDbe+RZBk/8K67422IdCi/9sG5d9X8hyUkb2yLv10Jt03EmBGwLbWoqZn+ecd5qfYlmTdMFmgnGcay3odBPCr+WcZYIR8//nPpv9MlVo5znMayGpWdCP0k7b87WyGTdWRNv0R+Y+JN1I/Qonp1FGGOBmSSA3ldPzi/Z3Pzh0J0S9cSZyqVybCRDkSoA1Ml0MSHTBEEqr0v+5HOmDJoG0Lol/kngxdlcXoZW1h0Fi/b7F+diE0BVY0fLdx8NbS6mcThmcDg==
  • Authentication-results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=none action=none header.from=arm.com;
  • Authentication-results-original: spf=none (sender IP is ) smtp.mailfrom=Julien.Grall@xxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, nd <nd@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 25 Sep 2019 21:29:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: True
  • Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Julien.Grall@xxxxxxx;
  • Thread-index: AQHVbYOOnjrbATj/UkSOYuk5XmKLtKc85dwAgAAPtwA=
  • Thread-topic: [PATCH v4 3/8] xen/arm32: head: Remove 1:1 mapping as soon as it is not used

Hi,

On 25/09/2019 21:33, Stefano Stabellini wrote:
> On Tue, 17 Sep 2019, Julien Grall wrote:
>> The 1:1 mapping may clash with other parts of the Xen virtual memory
>> layout. At the moment, Xen is handling the clash by only creating a
>> mapping to the runtime virtual address before enabling the MMU.
>>
>> The rest of the mappings (such as the fixmap) will be mapped after the
>> MMU is enabled. However, the code doing the mapping is not safe as it
>> replace mapping without using the Break-Before-Make sequence.
>>
>> As the 1:1 mapping can be anywhere in the memory, it is easier to remove
>> all the entries added as soon as the 1:1 mapping is not used rather than
>> adding the Break-Before-Make sequence everywhere.
>>
>> It is difficult to track where exactly the 1:1 mapping was created
>> without a full rework of create_page_tables(). Instead, introduce a new
>> function remove_identity_mapping() will look where is the top-level entry
>> for the 1:1 mapping and remove it.
>>
>> The new function is only called for the boot CPU. Secondary CPUs will
>> switch directly to the runtime page-tables so there are no need to
>> remove the 1:1 mapping. Note that this still doesn't make the Secondary
>> CPUs path safe but it is not making it worst.
>>
>> Note that the TLB flush sequence is same sequence as described in
>> asm-arm/arm32/flushtlb.h with a twist. Per G5-5532 ARM DDI 0487D.a,
>> a dsb nsh is sufficient for local flushed. Note the section is from the
>> AArch32 Armv8 spec, I wasn't able to find the same exact section in the
>> Armv7 spec but this is dotted as local operations only applies to
>> non-shareable domain. This was missed while reworking the header and
>> therefore a more conservative way were adopted.

I guess the NIT mention in patch #1 should also be fixed here.

>>
>> Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>

Thank you for the review.

Cheers,

-- 
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.