From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v14 05/17] pvh: Introduce PVH guest type Date: Thu, 7 Nov 2013 11:21:35 +0000 Message-ID: <527B77BF.7030603@eu.citrix.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20131106232810.GB32964@deinos.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: Keir Fraser , Jan Beulich , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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. -George