From: Stefano Stabellini Subject: Re: [PATCH v3 0/3] map grant refs at pfn = mfn Date: Wed, 6 Aug 2014 14:35:15 +0100 Message-ID: References: <53DB8A01.5020205@gmail.com> <53DBBE81.3070902@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Thomas Leonard Cc: "xen-devel@lists.xensource.com" , Wei Liu , Ian Campbell , Stefano Stabellini , Julien Grall , Julien Grall List-Id: xen-devel@lists.xenproject.org On Wed, 6 Aug 2014, Thomas Leonard wrote: > On 1 August 2014 19:12, Thomas Leonard wrote: > > On 1 August 2014 18:16, Stefano Stabellini > > wrote: > >> On Fri, 1 Aug 2014, Thomas Leonard wrote: > >>> On 1 August 2014 18:01, Stefano Stabellini > >>> wrote: > >>> > On Fri, 1 Aug 2014, Thomas Leonard wrote: > >>> >> On 1 August 2014 17:25, Stefano Stabellini > >>> >> wrote: > >>> >> > On Fri, 1 Aug 2014, Julien Grall wrote: > >>> >> >> On 01/08/14 17:16, Thomas Leonard wrote: > >>> >> >> > On 1 August 2014 16:13, Stefano Stabellini > >>> >> >> > wrote: > >>> >> >> > > On Fri, 1 Aug 2014, Thomas Leonard wrote: > >>> >> >> > > > On 24/07/14 14:30, Stefano Stabellini wrote: > >>> >> >> > > > > Hi all, > >>> >> >> > > > > this patch series introduces a second p2m mapping of grant reference > >>> >> >> > > > > on > >>> >> >> > > > > ARM at guest physical address == machine address of the grant ref. It > >>> >> >> > > > > is safe because dom0 is already mapped 1:1. We export > >>> >> >> > > > > XENFEAT_grant_map_identity to signal the guest that this second p2m > >>> >> >> > > > > mapping is > >>> >> >> > > > > available. > >>> >> >> > > > > > >>> >> >> > > > > One reason for wanting the second p2m mapping is to avoid tracking mfn > >>> >> >> > > > > to pfn mappings in the guest kernel. Since the same mfn can be granted > >>> >> >> > > > > multiple times to the backend, finding the right pfn corresponding to > >>> >> >> > > > > a > >>> >> >> > > > > given mfn can be difficult and expensive. Providing a second mapping > >>> >> >> > > > > at > >>> >> >> > > > > a known address allow the kernel to access the page without knowing > >>> >> >> > > > > the > >>> >> >> > > > > pfn. > >>> >> >> > > > > >>> >> >> > > > Is there a version of these patches for Xen 4.4 that I can test? The > >>> >> >> > > > restriction on duplicate pages is causing trouble for networking on > >>> >> >> > > > Mirage too > >>> >> >> > > > (http://roscidus.com/blog/blog/2014/07/28/my-first-unikernel/#tcp-retransmissions). > [...] > >> Checkout the branch grant_map_identity_4.4_2 > > > > Thanks - it's working now! > > Update: if my VM uses the network and then exits quickly, dom0 gets > stuck. What do you mean by exit quickly? xl destroy domain? > It keeps logging: > > [ 360.652715] vif vif-1-0 (unregistered net_device): Page still > granted! Index: 9d > [ 360.652796] vif vif-1-0 (unregistered net_device): Page still > granted! Index: 9d > [ 360.652835] vif vif-1-0 (unregistered net_device): Page still > granted! Index: 9d > [ 360.652874] vif vif-1-0 (unregistered net_device): Page still > granted! Index: 9d > [ 360.652910] vif vif-1-0 (unregistered net_device): Page still > granted! Index: 9d > [ 360.652947] vif vif-1-0 (unregistered net_device): Page still > granted! Index: 9d > [ 360.652983] vif vif-1-0 (unregistered net_device): Page still > granted! Index: 9d > [ 360.653026] vif vif-1-0 (unregistered net_device): Page still > granted! Index: 9d > > The domain can't be destroyed: > > $ sudo xl list > Name ID Mem VCPUs State Time(s) > Domain-0 0 512 2 r----- 185.7 > (null) 10 0 1 --ps-d 0.1 > > top shows the "xenwatch" process using 100% CPU and I have to reboot. > > A work-around is to use: > > on_poweroff = 'preserve' Does the "Page still granted!" message go away after a while, or just keeps printing it? > > -- > Dr Thomas Leonard http://0install.net/ > GPG: 9242 9807 C985 3C07 44A6 8B9A AE07 8280 59A5 3CC1 > GPG: DA98 25AE CAD0 8975 7CDA BD8E 0713 3F96 CA74 D8BA >