From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vitaly Kuznetsov Subject: Re: [PATCH RFC 2/4] xen: grant_table: implement grant_table_soft_reset() Date: Mon, 08 Jun 2015 16:58:41 +0200 Message-ID: <87a8wackm6.fsf@vitty.brq.redhat.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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z1yVm-0003O2-Ot for xen-devel@lists.xenproject.org; Mon, 08 Jun 2015 14:58:50 +0000 In-Reply-To: <5575C22C0200007800082319@mail.emea.novell.com> (Jan Beulich's message of "Mon, 08 Jun 2015 15:26:20 +0100") List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich 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 "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. -- Vitaly