From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH v3 11/32] xen/x86: add bitmap of enabled emulated devices Date: Tue, 07 Jul 2015 08:26:12 +0100 Message-ID: <559B9B34020000780008D24B@mail.emea.novell.com> References: <1435923310-9019-1-git-send-email-roger.pau@citrix.com> <1435923310-9019-12-git-send-email-roger.pau@citrix.com> <559A8C3A.7090406@citrix.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 1ZCNGi-0008Ts-It for xen-devel@lists.xenproject.org; Tue, 07 Jul 2015 07:26:16 +0000 In-Reply-To: <559A8C3A.7090406@citrix.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: Andrew Cooper , Roger Pau Monne , xen-devel@lists.xenproject.org Cc: Ian Jackson , Wei Liu , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org >>> On 06.07.15 at 16:10, wrote: > On 03/07/15 12:34, Roger Pau Monne wrote: >> @@ -550,6 +551,20 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags, >> d->domain_id); >> } >> >> + if ( is_hvm_domain(d) ) >> + { >> + emulation_mask = (EMU_LAPIC | EMU_HPET | EMU_PMTIMER | EMU_RTC | >> + EMU_IOAPIC | EMU_PIC | EMU_PMU | EMU_VGA | EMU_IOMMU); >> + if ( (config->emulation_flags & emulation_mask) != emulation_mask ) >> + { >> + printk(XENLOG_G_ERR "Xen does not allow HVM creation with the " >> + "current selection of emulators: 0x%x.\n", >> + config->emulation_flags); > > Please put "d%d" in the error message to identify which domain has the > bad configuration. Plus please use %#x instead of 0x%x. >> + return -EPERM; > > EPERM feels wrong here. It is not a lack of permissions causing the > issue. EINVAL/EOPNOTSUPP perhaps? Indeed, -EOPNOTSUPP. Jan