From: "Jan Beulich" Subject: Re: [PATCH RFC 2/4] xen: grant_table: implement grant_table_soft_reset() Date: Mon, 08 Jun 2015 16:35:02 +0100 Message-ID: <5575D2460200007800082497@mail.emea.novell.com> References: <1433338522-8422-1-git-send-email-vkuznets@redhat.com> <1433338522-8422-3-git-send-email-vkuznets@redhat.com> <5575C22C0200007800082319@mail.emea.novell.com><5575C22C0200007800082319@mail.emea.novell.com> (Jan Beulich's message of "Mon, 08 Jun 2015 15:26:20 +0100") <87a8wackm6.fsf@vitty.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z1z4t-0007yp-La for xen-devel@lists.xenproject.org; Mon, 08 Jun 2015 15:35:07 +0000 In-Reply-To: <87a8wackm6.fsf@vitty.brq.redhat.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vitaly Kuznetsov Cc: Olaf Hering , Wei Liu , Ian Campbell , Stefano Stabellini , Andrew Cooper , Julien Grall , Ian Jackson , Andrew Jones , Tim Deegan , David Vrabel , xen-devel@lists.xenproject.org, Daniel De Graaf , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 08.06.15 at 16:58, wrote: > "Jan Beulich" writes: > >>>>> On 03.06.15 at 15:35, wrote: >>> When soft reset is being performed we need to replace all actively >>> granted pages with empty pages to prevent possible future memory >>> corruption as the newly started kernel won't be aware of these >>> granted pages. >>> >>> We make the tot_pages < max_pages assumption here: previously granted pages >>> need to belong to someone and we don't want to implement possible DoS by >>> reassigning them to the grantee/anonymous domain/xen/.. (the malicious guest >>> will be able to consume all host's memory). >> >> How is that going to look in practice? I.e. won't this cause frequent >> failures? >> > > I'm not sure we actually need that in practice. In my testing backends > (even with persistent grants enabled) collaborate nicely and release all > grants. I can see a single page still being held and I suppose it's > being held by QEMU (haven't checked what that but I think it is the > console ring). In case we go for the toolstack-assisted approach we can > restart qemu and add some warning when there are active grants. But even a single page could cause the allocation to fail because of otherwise going over the set limit. Jan