From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH RFC v12 15/21] pvh: Set up more PV stuff in set_info_guest Date: Fri, 20 Sep 2013 16:12:33 +0100 Message-ID: <523C65E1.4040108@eu.citrix.com> References: <1379089521-25720-1-git-send-email-george.dunlap@eu.citrix.com> <1379089521-25720-16-git-send-email-george.dunlap@eu.citrix.com> <5239E01C02000078000F4746@nat28.tlf.novell.com> <523C60A9.6050908@eu.citrix.com> <523C7EBA02000078000F50A9@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VN2Ns-0001jp-GB for xen-devel@lists.xenproject.org; Fri, 20 Sep 2013 15:12:40 +0000 In-Reply-To: <523C7EBA02000078000F50A9@nat28.tlf.novell.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: Jan Beulich Cc: xen-devel , Keir Fraser , Tim Deegan List-Id: xen-devel@lists.xenproject.org On 20/09/13 15:58, Jan Beulich wrote: >>>> On 20.09.13 at 16:50, George Dunlap wrote: >> On 18/09/13 16:17, Jan Beulich wrote: >>>>>> On 13.09.13 at 18:25, George Dunlap wrote: >>>> +int vmx_pvh_vcpu_boot_set_info(struct vcpu *v, >>>> + struct vcpu_guest_context *ctxtp) >>>> +{ >>>> + if ( ctxtp->ldt_base || ctxtp->ldt_ents || >>>> + ctxtp->user_regs.cs || ctxtp->user_regs.ss || ctxtp->user_regs.es || >>>> + ctxtp->user_regs.ds || ctxtp->user_regs.fs || ctxtp->user_regs.gs || >>>> + *ctxtp->gdt_frames || ctxtp->gdt_ents || >>> Don't know why I didn't spot this earlier, but the gdt_frames check >>> is pointless when gdt_ents is verified to be zero. >> You know, looking at this again -- is there a reason we can't just put >> this in hvm_set_info_guest()? It's already only called from that one >> place, only a few lines before. There doesn't really seem to be a need >> to have yet another function for just a few lines. > Indeed - only the VMX specific piece belongs here; everything > else should be in the generic wrapper (which perhaps then > won't be a simple wrapper anymore). Or, we could do like is done for pv, and put the validity checks at the top of arch_set_info_guest(). I think I like that option the best. -George