From: "Jan Beulich" Subject: [PATCH] x86/hvm: determine shared info format earlier Date: Mon, 14 May 2007 17:23:00 +0200 Message-ID: <46489AF4.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Latch guest shared info format when hypercall page is being set up rather than during an arbitrarily selected hypercall. Signed-off-by: Jan Beulich Index: 2007-05-14/xen/arch/x86/hvm/hvm.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2007-05-14.orig/xen/arch/x86/hvm/hvm.c 2007-05-14 08:28:38.0000000= 00 +0200 +++ 2007-05-14/xen/arch/x86/hvm/hvm.c 2007-05-14 13:47:02.000000000 = +0200 @@ -824,6 +824,15 @@ void hvm_update_guest_cr3(struct vcpu *v void hvm_hypercall_page_initialise(struct domain *d, void *hypercall_page) { +#ifdef __x86_64__ + /* + * Since this operation is one of the very first executed by PV = drivers + * on initialisation or after save/restore, it is a sensible point at + * which to sample the execution mode of the guest and latch 32- or = 64- + * bit format for shared state. + */ + d->arch.has_32bit_shinfo =3D (hvm_guest_x86_mode(current) !=3D 8); +#endif hvm_funcs.init_hypercall_page(d, hypercall_page); } =20 @@ -1053,13 +1062,6 @@ long do_hvm_op(unsigned long op, XEN_GUE break; case HVM_PARAM_CALLBACK_IRQ: hvm_set_callback_via(d, a.value); - /* - * Since this operation is one of the very first executed - * by PV drivers on initialisation or after save/restore, = it - * is a sensible point at which to sample the execution = mode of - * the guest and latch 32- or 64-bit format for shared = state. - */ - d->arch.has_32bit_shinfo =3D (hvm_guest_x86_mode(current) = !=3D 8); break; } d->arch.hvm_domain.params[a.index] =3D a.value;