mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
In alloc_vcpu_struct, after doing a memset on the new allocated vcpu, we
do a memcpy from idle0_vcpu.arch to arch of the new vcpu, which causes monitor_pagetable is set to a none 0 value. For VMX guest which is using external shadow mode, this is not what we really need. the previous patch is OK for UP VMX guest, but failed on SMP VMX guest. Signed-off-by: Xin Li <xin.b.li@intel.com>
This commit is contained in:
1 parent
298ec42fe7
commit
be06e2c74b
2 files changed
+14
-10
No files matched your search
@@ -414,9 +414,6 @@ int arch_set_info_guest(
|
||||
d->arch.phys_table = v->arch.guest_table;
|
||||
v->arch.guest_table = mk_pagetable(0);
|
||||
|
||||
/* Initialize monitor page table */
|
||||
v->arch.monitor_table = mk_pagetable(0);
|
||||
|
||||
vmx_final_setup_guest(v);
|
||||
}
|
||||
|
||||
|
||||
+14
-7
@@ -61,23 +61,30 @@ void vmx_final_setup_guest(struct vcpu *v)
|
||||
{
|
||||
v->arch.schedule_tail = arch_vmx_do_launch;
|
||||
|
||||
if ( v == v->domain->vcpu[0] )
|
||||
if ( v->vcpu_id == 0 )
|
||||
{
|
||||
v->domain->arch.vmx_platform.lapic_enable =
|
||||
v->arch.guest_context.user_regs.ecx;
|
||||
struct domain *d = v->domain;
|
||||
struct vcpu *vc;
|
||||
|
||||
d->arch.vmx_platform.lapic_enable = v->arch.guest_context.user_regs.ecx;
|
||||
v->arch.guest_context.user_regs.ecx = 0;
|
||||
VMX_DBG_LOG(DBG_LEVEL_VLAPIC, "lapic enable is %d.\n",
|
||||
v->domain->arch.vmx_platform.lapic_enable);
|
||||
d->arch.vmx_platform.lapic_enable);
|
||||
|
||||
/* Initialize monitor page table */
|
||||
for_each_vcpu(d, vc)
|
||||
vc->arch.monitor_table = mk_pagetable(0);
|
||||
|
||||
/*
|
||||
* Required to do this once per domain
|
||||
* XXX todo: add a seperate function to do these.
|
||||
*/
|
||||
memset(&v->domain->shared_info->evtchn_mask[0], 0xff,
|
||||
sizeof(v->domain->shared_info->evtchn_mask));
|
||||
memset(&d->shared_info->evtchn_mask[0], 0xff,
|
||||
sizeof(d->shared_info->evtchn_mask));
|
||||
|
||||
/* Put the domain in shadow mode even though we're going to be using
|
||||
* the shared 1:1 page table initially. It shouldn't hurt */
|
||||
shadow_mode_enable(v->domain,
|
||||
shadow_mode_enable(d,
|
||||
SHM_enable|SHM_refcounts|
|
||||
SHM_translate|SHM_external|SHM_wr_pt_pte);
|
||||
}
|
||||
|
||||