From: Tim Deegan Subject: Re: [PATCH v14 05/17] pvh: Introduce PVH guest type Date: Thu, 7 Nov 2013 17:59:02 +0100 Message-ID: <20131107165902.GA19904@deinos.phlegethon.org> References: <1383567306-6636-1-git-send-email-george.dunlap@eu.citrix.com> <1383567306-6636-6-git-send-email-george.dunlap@eu.citrix.com> <20131106232810.GB32964@deinos.phlegethon.org> <527B77BF.7030603@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <527B77BF.7030603@eu.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: George Dunlap Cc: Keir Fraser , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 11:21 +0000 on 07 Nov (1383819695), George Dunlap wrote: > On 06/11/13 23:28, Tim Deegan wrote: > > At 12:14 +0000 on 04 Nov (1383563694), George Dunlap wrote: > >> --- a/xen/common/domain.c > >> +++ b/xen/common/domain.c > >> @@ -239,6 +239,17 @@ struct domain *domain_create( > >> > >> if ( domcr_flags & DOMCRF_hvm ) > >> d->guest_type = guest_type_hvm; > >> + else if ( domcr_flags & DOMCRF_pvh ) > >> + { > >> + if ( !(domcr_flags & DOMCRF_hap) ) > >> + { > >> + err = -EOPNOTSUPP; > >> + printk(XENLOG_INFO "PVH guest must have HAP on\n"); > >> + goto fail; > >> + } > >> + d->guest_type = guest_type_pvh; > >> + printk("Creating PVH guest d%d\n", d->domain_id); > >> + } > > This check seems like it should be in arch-specific code. If it > > were in arch_domain_create(), it would also correctly handle the > > case where the tools asked for PVH+HAP but HAP wasn't available. > > Looking at the HVM case, this (and Jan's comments on the vmcs patch from > v13) should probably be handled the same way: i.e., at start of day, see > if we have the necessary hardware support to run in pvh mode; and set > "pvh_enabled" (analog to hvm_enabled) accordingly. Then we can check > this in hvm_domain_initialise() just as we do for hvm guests. Yep, that sounds like a good idea. Tim.