From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCHv1 4/5] x86/viridian: set x87 FIP width to 4 for Windows guests Date: Thu, 18 Feb 2016 19:19:16 +0000 Message-ID: <56C61934.7000300@citrix.com> References: <1455821530-4263-1-git-send-email-david.vrabel@citrix.com> <1455821530-4263-5-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aWU6i-00055B-L3 for xen-devel@lists.xenproject.org; Thu, 18 Feb 2016 19:19:20 +0000 In-Reply-To: <1455821530-4263-5-git-send-email-david.vrabel@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: David Vrabel , xen-devel@lists.xenproject.org Cc: Jan Beulich List-Id: xen-devel@lists.xenproject.org On 18/02/16 18:52, David Vrabel wrote: > diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c > index 6bd844b..fb9f044 100644 > --- a/xen/arch/x86/hvm/viridian.c > +++ b/xen/arch/x86/hvm/viridian.c > @@ -148,6 +148,30 @@ static void dump_guest_os_id(const struct domain *d) > goi->fields.service_pack, goi->fields.build_number); > } > > +static void set_guest_os_id(struct domain *d, uint64_t val) > +{ > + const union viridian_guest_os_id *goi; > + > + d->arch.hvm_domain.viridian.guest_os_id.raw = val; > + goi = &d->arch.hvm_domain.viridian.guest_os_id; > + > + /* > + * Microsoft Windows only saves the lower 32-bits of FIP/FDP and > + * can get upset if the selectors are not saved/restored by the > + * hypervisor. > + * > + * Only do this if the FIP width is not in auto-mode, so this > + * heuristic can be overriden by the toolstack. > + */ > + if ( !d->arch.x87_fip_width ) > + { > + if ( goi->fields.vendor == 1 && goi->fields.os == 4 ) Are there any named parameters we could use here? In principle, Reviewed-by: Andrew Cooper (allowing for the potential change of x86_fip_width per the discussion on patch 3). > + d->arch.x87_fip_width = 4; > + } > + > + dump_guest_os_id(d); > +} > + > static void dump_hypercall(const struct domain *d) > { > const union viridian_hypercall_gpa *hg;