Skip to contentSkip to conversation

How to turn on EPT support?

DISCUSSION Superymk 5 participants 8 messages Jan 27, 2010

lore
Share & tools
lore

Superymk

author
#0 lore raw

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

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Can you check Xen's boot log to see whether the sentence as following is printed out ?

(XEN) HVM: Hardware Assisted Paging detected.

I don't know Xen-3.4.2's policy for EPT's default option, maybe you can add "hap=1" in your configuration file to ensure EPT on when you create virtual machine if the system supports it.

Xiantao

________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Superymk
Sent: Wednesday, January 27, 2010 2:42 PM
To: [email protected]
Cc: [email protected]
Subject: [Xen-devel] How to turn on EPT support?

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

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

i7 965 has EPT support.
Use command "xm debug-k v; xm dmesg" to see if EPT pointer is 0. If 0 then EPT should disabled for the guest. as Xiantao mentioned, I guess your hap in config file is set to 0. By default if you don't set it, ept should be enabled. Thanks!
-Xin

From: [email protected] [mailto:[email protected]] On Behalf Of Zhang, Xiantao
Sent: Wednesday, January 27, 2010 5:09 PM
To: Superymk; [email protected]
Cc: [email protected]
Subject: RE: [Xen-devel] How to turn on EPT support?

Can you check Xen's boot log to see whether the sentence as following is printed out ?

(XEN) HVM: Hardware Assisted Paging detected.

I don't know Xen-3.4.2's policy for EPT's default option, maybe you can add "hap=1" in your configuration file to ensure EPT on when you create virtual machine if the system supports it.

Xiantao

________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of Superymk
Sent: Wednesday, January 27, 2010 2:42 PM
To: [email protected]
Cc: [email protected]
Subject: [Xen-devel] How to turn on EPT support?
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

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

author
#3 lore raw

Thanks. I tailor the hvm example configuration file in xen manually instead of using Virtual Machine Manager. I use your method to verify it and the problem is solved now. However I find that hap configuration belongs to the Timers category in Xen Configurations Details (http://www.xen.org/files/Support/XenConfigurationDetails.pdf), is it a mistake?

Miao

From: Li, Xin
Sent: Wednesday, January 27, 2010 5:53 PM
To: Zhang, Xiantao ; Superymk ; [email protected]
Cc: [email protected]
Subject: RE: [Xen-devel] How to turn on EPT support?

i7 965 has EPT support.

Use command "xm debug-k v; xm dmesg" to see if EPT pointer is 0. If 0 then EPT should disabled for the guest.

as Xiantao mentioned, I guess your hap in config file is set to 0. By default if you don't set it, ept should be enabled.

Thanks!

-Xin

From: [email protected] [mailto:[email protected]] On Behalf Of Zhang, Xiantao
Sent: Wednesday, January 27, 2010 5:09 PM
To: Superymk; [email protected]
Cc: [email protected]
Subject: RE: [Xen-devel] How to turn on EPT support?

Can you check Xen's boot log to see whether the sentence as following is printed out ?

(XEN) HVM: Hardware Assisted Paging detected.

I don't know Xen-3.4.2's policy for EPT's default option, maybe you can add "hap=1" in your configuration file to ensure EPT on when you create virtual machine if the system supports it.

Xiantao

--------------------------------------------------------------------------------

From: [email protected] [mailto:[email protected]] On Behalf Of Superymk
Sent: Wednesday, January 27, 2010 2:42 PM
To: [email protected]
Cc: [email protected]
Subject: [Xen-devel] How to turn on EPT support?

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

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#4 lore raw
Quoted 8 lines · Superymk

Thanks. I tailor the hvm example configuration file in xen manually instead of using Virtual Machine Manager. I use your method to verify it and the problem is solved now.
However I find that hap configuration belongs to the Timers category in Xen Configurations Details ([1]http://www.xen.org/files/Support/XenConfigurationDetails.pdf), is it a mistake?

Here's the wiki version of the pdf, created just yesterday:
http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions

It's easy to edit and fix the stuff in the wiki now :)

-- Pasi

Quoted 201 lines
   Miao
   From: [2]Li, Xin
   Sent: Wednesday, January 27, 2010 5:53 PM
   To: [3]Zhang, Xiantao ; [4]Superymk ; [5][email protected]
   Cc: [6][email protected]
   Subject: RE: [Xen-devel] How to turn on EPT support?

   i7 965 has EPT support.

   Use command *xm debug-k v; xm dmesg* to see if EPT pointer is 0. If 0 then
   EPT should disabled for the guest.

   as Xiantao mentioned, I guess your hap in config file is set to 0. By
   default if you don*t set it, ept should be enabled.

   Thanks!

   -Xin



   From: [7][email protected]
   [mailto:[email protected]] On Behalf Of Zhang, Xiantao
   Sent: Wednesday, January 27, 2010 5:09 PM
   To: Superymk; [8][email protected]
   Cc: [9][email protected]
   Subject: RE: [Xen-devel] How to turn on EPT support?



   Can you check Xen's boot log to see whether the sentence as following is
   printed out ?



   (XEN) HVM: Hardware Assisted Paging detected.



   I don't know Xen-3.4.2's policy for EPT's default option, maybe you can
   add "hap=1" in your configuration file to ensure EPT on when you create
   virtual machine  if the system supports it.



   Xiantao



   --------------------------------------------------------------------------

   From: [email protected]
   [mailto:[email protected]] On Behalf Of Superymk
   Sent: Wednesday, January 27, 2010 2:42 PM
   To: [email protected]
   Cc: [email protected]
   Subject: [Xen-devel] How to turn on EPT support?

   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

References

Visible links
1. http://www.xen.org/files/Support/XenConfigurationDetails.pdf
CTRL + Click to follow link
http://www.xen.org/files/Support/XenConfigurationDetails.pdf
2. [email protected]
mailto:[email protected]
3. [email protected] mailto:[email protected]
4. [email protected] mailto:[email protected]
5. [email protected] mailto:[email protected]
6. [email protected] mailto:[email protected]
7. mailto:[email protected]
8. mailto:[email protected]
9. mailto:[email protected]

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

author
#5 lore raw

All right, I'll verify it. Can I really modify it on the xen wiki? I've never dreamed about that. :)

--------------------------------------------------
From: "PasiKärkkäinen" <[email protected]>
Sent: Wednesday, January 27, 2010 7:26 PM
To: "Superymk" <[email protected]>
Cc: <[email protected]>; "Li, Xin" <[email protected]>
Subject: Re: [Xen-devel] How to turn on EPT support?

Quoted 236 lines · Superymk
Quoted 11 lines

Thanks. I tailor the hvm example configuration file in xen manually instead of using Virtual Machine Manager. I use your method to verify
it
and the problem is solved now.
However I find that hap configuration belongs to the Timers category
in
Xen Configurations Details ([1]http://www.xen.org/files/Support/XenConfigurationDetails.pdf), is
it a
mistake?

Here's the wiki version of the pdf, created just yesterday:
http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions

It's easy to edit and fix the stuff in the wiki now :)

-- Pasi

Quoted 205 lines

Miao
From: [2]Li, Xin
Sent: Wednesday, January 27, 2010 5:53 PM
To: [3]Zhang, Xiantao ; [4]Superymk ; [5][email protected]
Cc: [6][email protected]
Subject: RE: [Xen-devel] How to turn on EPT support?

i7 965 has EPT support.

Use command *xm debug-k v; xm dmesg* to see if EPT pointer is 0. If 0
then
EPT should disabled for the guest.

as Xiantao mentioned, I guess your hap in config file is set to 0. By default if you don*t set it, ept should be enabled.

Thanks!

-Xin

From: [7][email protected] [mailto:[email protected]] On Behalf Of Zhang,
Xiantao
Sent: Wednesday, January 27, 2010 5:09 PM
To: Superymk; [8][email protected]
Cc: [9][email protected]
Subject: RE: [Xen-devel] How to turn on EPT support?

Can you check Xen's boot log to see whether the sentence as following
is
printed out ?

(XEN) HVM: Hardware Assisted Paging detected.

I don't know Xen-3.4.2's policy for EPT's default option, maybe you
can
add "hap=1" in your configuration file to ensure EPT on when you
create
virtual machine if the system supports it.

Xiantao

--------------------------------------------------------------------------

From: [email protected] [mailto:[email protected]] On Behalf Of Superymk
Sent: Wednesday, January 27, 2010 2:42 PM
To: [email protected]
Cc: [email protected]
Subject: [Xen-devel] How to turn on EPT support?

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

References

Visible links
1. http://www.xen.org/files/Support/XenConfigurationDetails.pdf
CTRL + Click to follow link
http://www.xen.org/files/Support/XenConfigurationDetails.pdf
2. [email protected]
mailto:[email protected]
3. [email protected]
mailto:[email protected]
4. [email protected]
mailto:[email protected]
5. [email protected]
mailto:[email protected]
6. [email protected]
mailto:[email protected]
7. mailto:[email protected]
8. mailto:[email protected]
9. mailto:[email protected]

Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#6 lore raw
Quoted 3 lines · Superymk

All right, I'll verify it. Can I really modify it on the xen wiki? I've never dreamed about that. :)

Yeah, you can, after you create an account.. :)

-- Pasi

Quoted 243 lines

--------------------------------------------------
From: "PasiKärkkäinen" <[email protected]>
Sent: Wednesday, January 27, 2010 7:26 PM
To: "Superymk" <[email protected]>
Cc: <[email protected]>; "Li, Xin" <[email protected]>
Subject: Re: [Xen-devel] How to turn on EPT support?

Quoted 236 lines · Superymk
Quoted 11 lines

Thanks. I tailor the hvm example configuration file in xen manually instead of using Virtual Machine Manager. I use your method to
verify it
and the problem is solved now.
However I find that hap configuration belongs to the Timers
category in
Xen Configurations Details ([1]http://www.xen.org/files/Support/XenConfigurationDetails.pdf),
is it a
mistake?

Here's the wiki version of the pdf, created just yesterday:
http://wiki.xensource.com/xenwiki/XenConfigurationFileOptions

It's easy to edit and fix the stuff in the wiki now :)

-- Pasi

Quoted 205 lines

Miao
From: [2]Li, Xin
Sent: Wednesday, January 27, 2010 5:53 PM
To: [3]Zhang, Xiantao ; [4]Superymk ; [5][email protected]
Cc: [6][email protected]
Subject: RE: [Xen-devel] How to turn on EPT support?

i7 965 has EPT support.

Use command *xm debug-k v; xm dmesg* to see if EPT pointer is 0.
If 0 then
EPT should disabled for the guest.

as Xiantao mentioned, I guess your hap in config file is set to 0. By default if you don*t set it, ept should be enabled.

Thanks!

-Xin

From: [7][email protected] [mailto:[email protected]] On Behalf Of Zhang,
Xiantao
Sent: Wednesday, January 27, 2010 5:09 PM
To: Superymk; [8][email protected]
Cc: [9][email protected]
Subject: RE: [Xen-devel] How to turn on EPT support?

Can you check Xen's boot log to see whether the sentence as
following is
printed out ?

(XEN) HVM: Hardware Assisted Paging detected.

I don't know Xen-3.4.2's policy for EPT's default option, maybe
you can
add "hap=1" in your configuration file to ensure EPT on when you
create
virtual machine if the system supports it.

Xiantao

--------------------------------------------------------------------------

From: [email protected] [mailto:[email protected]] On Behalf Of Superymk
Sent: Wednesday, January 27, 2010 2:42 PM
To: [email protected]
Cc: [email protected]
Subject: [Xen-devel] How to turn on EPT support?

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

References

Visible links
1. http://www.xen.org/files/Support/XenConfigurationDetails.pdf
CTRL + Click to follow link
http://www.xen.org/files/Support/XenConfigurationDetails.pdf
2. [email protected]
mailto:[email protected]
3. [email protected]
mailto:[email protected]
4. [email protected]
mailto:[email protected]
5. [email protected]
mailto:[email protected]
6. [email protected]
mailto:[email protected]
7. mailto:[email protected]
8. mailto:[email protected]
9. mailto:[email protected]

Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#7 lore raw
In reply to Superymk
Quoted 5 lines · Superymk

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.

It is in the hypervisor, if the tools ask for it.

Quoted 4 lines

(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

That's the one - EPT's not enabled because the tools didn't ask for it. Those flags are passed from the domain-builder tools in dom0 (xc_domain_create() in tools/libxc/xc_domain.c).

If you're using xend, it looks like those flags get assembled from magic numbers in XendDomainInfo.py based on one of the many config objects.

Try adding 'hap=1' to your xm config file?

Tim.

Signature · 3 lines
Tim Deegan <[email protected]>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]