To test if EPT is enabled on my machine, I add some
codes in my own xen shadow and create a guest vm (named
testvm) by Virtual Machine Manager. However, it seems that testvm
doesn't use EPT at all (See the log). So how to turn on EPT support? I thought
it should be enabled automatically.
My box is configured as:
Intel Core i7 965
2G*3 DDR3 1333
Seagate 1T
Centos 5.2
Xen-3.4.2 with linux 2.6.18 xenified kernel (downloaded
from xen.org)
Log:
(XEN) (Joan)domain.c:388: Domain ID 32767 (XEN)
(Joan)domain.c:389: is_hvm_domain(d) 0 (XEN) (Joan)domain.c:390:
hvm_funcs.hap_supported 0 (XEN) (Joan)domain.c:391: (domcr_flags &
DOMCRF_hap) 0 (XEN) (Joan)p2m.c:1464: is_hvm_domain(d) 0 (XEN)
(Joan)p2m.c:1465: d->arch.hvm_domain.hap_enabled 0 (XEN) (Joan)p2m.c:1466:
X86_VENDOR_INTEL 1 (XEN) (Joan)p2m.c:1473: d->arch.p2m->set_entry
FFFF828C8019FD50 (XEN) (Joan)p2m.c:1474: p2m_set_entry
FFFF828C8019FD50 (XEN) (Joan)domain.c:388: Domain ID 0 (XEN)
(Joan)domain.c:389: is_hvm_domain(d) 0 (XEN) (Joan)domain.c:390:
hvm_funcs.hap_supported 1 (XEN) (Joan)domain.c:391: (domcr_flags &
DOMCRF_hap) 0 (XEN) (Joan)p2m.c:1464: is_hvm_domain(d) 0 (XEN)
(Joan)p2m.c:1465: d->arch.hvm_domain.hap_enabled 0 (XEN) (Joan)p2m.c:1466:
X86_VENDOR_INTEL 1 (XEN) (Joan)p2m.c:1473: d->arch.p2m->set_entry
FFFF828C8019FD50 (XEN) (Joan)p2m.c:1474: p2m_set_entry
FFFF828C8019FD50 (XEN) (Joan)domain.c:388: Domain ID 1 (XEN)
(Joan)domain.c:389: is_hvm_domain(d) 1 (XEN) (Joan)domain.c:390:
hvm_funcs.hap_supported 1 (XEN) (Joan)domain.c:391: (domcr_flags &
DOMCRF_hap) 0 (XEN) (Joan)p2m.c:1464: is_hvm_domain(d) 1 (XEN)
(Joan)p2m.c:1465: d->arch.hvm_domain.hap_enabled 0 (XEN) (Joan)p2m.c:1466:
X86_VENDOR_INTEL 1 (XEN) (Joan)p2m.c:1473: d->arch.p2m->set_entry
FFFF828C8019FD50 (XEN) (Joan)p2m.c:1474: p2m_set_entry
FFFF828C8019FD50
Modified Code:
/* Init the datastructures for later use by the p2m code
*/ 1442: int p2m_init(struct domain *d) { struct
p2m_domain *p2m;
p2m = xmalloc(struct
p2m_domain); if ( p2m == NULL
) return -ENOMEM;
d->arch.p2m = p2m;
memset(p2m, 0,
sizeof(*p2m)); p2m_lock_init(p2m);
INIT_PAGE_LIST_HEAD(&p2m->pages);
INIT_PAGE_LIST_HEAD(&p2m->pod.super);
INIT_PAGE_LIST_HEAD(&p2m->pod.single);
p2m->set_entry =
p2m_set_entry; p2m->get_entry =
p2m_gfn_to_mfn; p2m->get_entry_current =
p2m_gfn_to_mfn_current; p2m->change_entry_type_global =
p2m_change_type_global; joan_dprintk("is_hvm_domain(d)
%d\n",
is_hvm_domain(d)); joan_dprintk("d->arch.hvm_domain.hap_enabled
%d\n",
d->arch.hvm_domain.hap_enabled); joan_dprintk("X86_VENDOR_INTEL
%d\n", (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)); if
( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled
&&
(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
) { joan_dprintk("Add Ept
Support\n");
ept_p2m_init(d); } joan_dprintk("d->arch.p2m->set_entry
%lX\n", (uint64_t)(d->arch.p2m->set_entry)
); joan_dprintk("p2m_set_entry %lX\n",
(uint64_t)p2m_set_entry);
return 0; }
Thanks,
Miao
|