ia64/xen-unstable
changeset 15401:2805246f6cac
x86/hvm: determine shared info format earlier.
Latch guest shared info format when hypercall page is being set up
rather than during an arbitrarily selected hypercall.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
Latch guest shared info format when hypercall page is being set up
rather than during an arbitrarily selected hypercall.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kfraser@localhost.localdomain |
---|---|
date | Wed Jun 20 15:03:39 2007 +0100 (2007-06-20) |
parents | 3187ffc5272c |
children | 3624ba0caccc |
files | xen/arch/x86/hvm/hvm.c |
line diff
1.1 --- a/xen/arch/x86/hvm/hvm.c Wed Jun 20 14:57:49 2007 +0100 1.2 +++ b/xen/arch/x86/hvm/hvm.c Wed Jun 20 15:03:39 2007 +0100 1.3 @@ -831,11 +831,24 @@ void hvm_update_guest_cr3(struct vcpu *v 1.4 hvm_funcs.update_guest_cr3(v); 1.5 } 1.6 1.7 +static void hvm_latch_shinfo_size(struct domain *d) 1.8 +{ 1.9 + /* 1.10 + * Called from operations which are among the very first executed by 1.11 + * PV drivers on initialisation or after save/restore. These are sensible 1.12 + * points at which to sample the execution mode of the guest and latch 1.13 + * 32- or 64-bit format for shared state. 1.14 + */ 1.15 + if ( current->domain == d ) 1.16 + d->arch.has_32bit_shinfo = (hvm_guest_x86_mode(current) != 8); 1.17 +} 1.18 + 1.19 /* Initialise a hypercall transfer page for a VMX domain using 1.20 paravirtualised drivers. */ 1.21 void hvm_hypercall_page_initialise(struct domain *d, 1.22 void *hypercall_page) 1.23 { 1.24 + hvm_latch_shinfo_size(d); 1.25 hvm_funcs.init_hypercall_page(d, hypercall_page); 1.26 } 1.27 1.28 @@ -1065,13 +1078,7 @@ long do_hvm_op(unsigned long op, XEN_GUE 1.29 break; 1.30 case HVM_PARAM_CALLBACK_IRQ: 1.31 hvm_set_callback_via(d, a.value); 1.32 - /* 1.33 - * Since this operation is one of the very first executed 1.34 - * by PV drivers on initialisation or after save/restore, it 1.35 - * is a sensible point at which to sample the execution mode of 1.36 - * the guest and latch 32- or 64-bit format for shared state. 1.37 - */ 1.38 - d->arch.has_32bit_shinfo = (hvm_guest_x86_mode(current) != 8); 1.39 + hvm_latch_shinfo_size(d); 1.40 break; 1.41 } 1.42 d->arch.hvm_domain.params[a.index] = a.value;