From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] xen/grant-table: fix suspend for non-PV guests Date: Mon, 16 Jun 2014 10:20:02 -0400 Message-ID: <20140616142002.GD11200@laptop.dumpdata.com> References: <1402919358-9564-1-git-send-email-david.vrabel@citrix.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 1WwXla-0003u5-DZ for xen-devel@lists.xenproject.org; Mon, 16 Jun 2014 14:20:10 +0000 Content-Disposition: inline In-Reply-To: <1402919358-9564-1-git-send-email-david.vrabel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: xen-devel@lists.xenproject.org, Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org On Mon, Jun 16, 2014 at 12:49:18PM +0100, David Vrabel wrote: > Commit aa8532c32216ae07c3813b9aeb774517878a7573 (xen: refactor suspend > pre/post hooks) broke resuming PVHVM (auto-translated physmap) guests. > > The gnttab_suspend() would clear the mapping for the grant table > frames, but the ->unmap_frames() call is only applicable to PV guests. > > Signed-off-by: David Vrabel You forgot: Reported-by: Konrad Rzeszutek Wilk However, if the code is structured like this, should we just make the 'unmap_frames' be a NOP for HVM and instead have: if (gnttab_interface->unmap_frames) gnttab_interface->unmap_frames(); And the HVM path will make sure that 'unmap_frames' is set to NULL? Maybe even change the name to 'unmap_frames_pv' ? > --- > drivers/xen/grant-table.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c > index 6d325bd..5d4de88 100644 > --- a/drivers/xen/grant-table.c > +++ b/drivers/xen/grant-table.c > @@ -1168,7 +1168,8 @@ int gnttab_resume(void) > > int gnttab_suspend(void) > { > - gnttab_interface->unmap_frames(); > + if (!xen_feature(XENFEAT_auto_translated_physmap)) > + gnttab_interface->unmap_frames(); > return 0; > } > > -- > 1.7.10.4 >