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

Re: [Xen-devel] [PATCH] vunmap: let vunmap align virtual address by itself


  • To: Andrii Anisov <andrii.anisov@xxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Mon, 22 Jul 2019 10:23:31 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.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=cgFAEco8JZuZ5XtVSPYhybBcyYshCKzGQHV5tok0Epg=; b=OyyEffGwRh3Fc9jygEyVcy3C2yPJIw6shfGT7somXWrjiLnQapDBPyNqqP2PO2+hBD+eOHQNF/DIDtMB8tRLoVbeXuuah4P+TlHl0L0ZPh33IE3VBkeAcXuOn4LctjJi74H7dXtAiRitayzDc16rfupApkwklRCXycQpgj4iTVtbM+tVhVIBpTJK1+QBvjev4qkNfbJT6VO15efY+U+z/cxtOwldvnmKt3X89YV9oEpzRKltPnV8e2NU1ifNSLDwa4Y1cEatTDxLVJ9+XSjTmQzPQ64GUYyGMS5XjGQnbFLduqgcZaNI92JuFbODQrdoUfJkFyQaPthswWBmzI0E6A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=acTXW9W+uqPNdl4m7PgWPIrj+9gJsyFNzx+5xbDgLDEAUPpS+6cHPasAlMumD+M0Kuslqy5vtB2QKMZwQgXi401AZ30fwsiU4JmYXbP4wTu9Wqn6N7Ybd1wvQ0nUcUCyQw9jBHxSfz6PJ4Y1Q5s/e+YiFcnSzpgvTH3n/NEJqHJGeaKlq98GIRyfiA1kGG+5bC74sKPvdULQ4GicbALlHisPUt9zCU/5wYsTabrw/hRN1b8rCSCk9W+0nwF3WeiQxt4rGHhDBRgEDGCrkVACJ34DbQQsQETsv0vdUUqpHDh4zOAWMdpB8n7xZtI1uXGY5Tge4mMNjGVyEOYMAxR/cg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Andrii Anisov <andrii_anisov@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 22 Jul 2019 10:26:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVPhWLg4cyYnQWKUW8aYX9saIQuqbWZDjPgAAOmQA=
  • Thread-topic: [PATCH] vunmap: let vunmap align virtual address by itself

On 22.07.2019 11:30, Andrii Anisov wrote:
> 
> 
> On 19.07.19 12:37, Jan Beulich wrote:
>> On 18.07.2019 19:11, Andrii Anisov wrote:
>>> Let vunmap align passed virtual address by PAGE_SIZE.
>>
>> Despite seeing Andrew's R-b you've already got I'd like to point out
>> that this increases the risk of some code passing the wrong pointer
>> into here. {,un}map_domain_page() act on single pages only, so there's
>> no ambiguity. When talking about multi-page regions though, not undoing
>> arithmetic previously done may mean actually pointing at other than the
>> first page of the mapping.
> 
> Well, what we are moving into vunmap(), is a page alignment only. It can't 
> save us from the wrong pointer, even if it is done outside the vunmap().
> 
>>> With the main change, also:
>>>    - strip all existing vunmap() calls from prior masking
>>
>> _If_ we are to go this route, then unmap_domain_page_global()
>> callers should also be adjusted. There, as for unmap_domain_page(),
>> I agree it would make sense to be more tolerant.
> 
> I've found two page alignments prior to `unmap_domain_page_global()` call. 
> Should I wipe them in this patch, or in separate?

If we're to go the suggested route then it might not matter much.
As I'm not entirely certain yet that we will, making this a prereq
one dealing with the alignment in unmap_domain_page_global() might
be better. Your existing patch would then further shift this into
vunmap().

Jan
_______________________________________________
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®.