From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v3 2/6] libxl: do not add a vkb backend to hvm guests Date: Thu, 2 Jul 2015 10:31:31 -0400 Message-ID: <20150702143130.GA4513@l.oracle.com> References: <1435654263.21469.19.camel@citrix.com> <1435671177.21469.163.camel@citrix.com> <1435673633.21469.186.camel@citrix.com> <20150630203837.GF7546@l.oracle.com> <20150701184123.GB22498@l.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline 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: Stefano Stabellini Cc: Wei Liu , xen-devel@lists.xensource.com, Ian.Jackson@eu.citrix.com, Ian Campbell , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org > > But I am looking at the xen-fbfront.c driver and it might be that > > I had already fixed this issue! (inadvertly it seems) > > > > 51c71a3bbaca868043cc45b3ad3786dd48a90235 > > Author: Konrad Rzeszutek Wilk > > Date: Tue Nov 26 15:05:40 2013 -0500 > > > > xen/pvhvm: If xen_platform_pci=0 is set don't blow up (v4). > > > > .. > > - if running in HVM, check if user wanted 'xen_emul_unplug=never', > > in which case bail out and don't load any PV drivers. > > - if running in HVM, and if PCI device 5853:0001 (xen_platform_pci) > > does not exist, then bail out and not load PV drivers. > > - (v2) if running in HVM, and if the user wanted 'xen_emul_unplug=ide-disks', > > then bail out for all PV devices _except_ the block one. > > Ditto for the network one ('nics'). > > - (v2) if running in HVM, and if the user wanted 'xen_emul_unplug=unnecessary' > > then load block PV driver, and also setup the legacy IDE paths. > > In (v3) make it actually load PV drivers. > > > > .. which means that if the driver does not use the 'xen_has_pv_XXX_devices' > > but only the 'xen_has_pv_devices' then for a normal HVM guest it won't load > > it. > > > > And sure enough we have: > > > > + if (!xen_has_pv_devices()) > > + return -ENODEV; > > > > so we bail out and not load it under HVM. > > And at the same time it works on ARM because CONFIG_XEN_PVHVM is not > defined there, right? Yup, and it ends up doing: static inline bool xen_has_pv_devices(void) { return IS_ENABLED(CONFIG_XEN); } which will return true if CONFIG_XEN is set.