From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965563AbcBCS7u (ORCPT ); Wed, 3 Feb 2016 13:59:50 -0500 Received: from mx2.suse.de ([195.135.220.15]:41809 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933040AbcBCS7t (ORCPT ); Wed, 3 Feb 2016 13:59:49 -0500 Date: Wed, 3 Feb 2016 19:59:48 +0100 From: "Luis R. Rodriguez" To: Boris Ostrovsky Cc: david.vrabel@citrix.com, konrad.wilk@oracle.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, roger.pau@citrix.com Subject: Re: [PATCH v2 04/11] xen/hvmlite: Allow HVMlite guests delay initializing grant table Message-ID: <20160203185948.GW20964@wotan.suse.de> References: <1454341137-14110-1-git-send-email-boris.ostrovsky@oracle.com> <1454341137-14110-5-git-send-email-boris.ostrovsky@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1454341137-14110-5-git-send-email-boris.ostrovsky@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 01, 2016 at 10:38:50AM -0500, Boris Ostrovsky wrote: > diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c > index c49f79e..9a239d5 100644 > --- a/drivers/xen/grant-table.c > +++ b/drivers/xen/grant-table.c > @@ -1147,13 +1147,13 @@ EXPORT_SYMBOL_GPL(gnttab_init); > > static int __gnttab_init(void) > { > + if (!xen_domain()) > + return -ENODEV; > + > /* Delay grant-table initialization in the PV on HVM case */ > - if (xen_hvm_domain()) > + if (xen_hvm_domain() && !xen_hvmlite) > return 0; > > - if (!xen_pv_domain()) > - return -ENODEV; > - > return gnttab_init(); > } For instance if we had pv types generalized then this would just be a one line addition for __gnttab_init() to support hvmlite. Much cleaner, generalizes the extensions and gets folks thinking about the types on all calls Xen init call sites. Luis