* xen: use paging_mode_hap()
@ 2010-03-30 15:51 Christoph Egger
2010-03-31 9:29 ` Tim Deegan
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Egger @ 2010-03-30 15:51 UTC (permalink / raw)
To: xen-devel; +Cc: Tim Deegan
[-- Attachment #1: Type: text/plain, Size: 464 bytes --]
Hi!
Attached patch makes xen consequently use paging_mode_hap().
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
P.S.: This is a resend. Needs ack from Tim.
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
[-- Attachment #2: xen_pagingmode.diff --]
[-- Type: text/x-diff, Size: 3446 bytes --]
diff -r af15aa70b6ff xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c Tue Mar 09 14:01:51 2010 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c Tue Mar 09 14:34:24 2010 +0100
@@ -92,7 +92,7 @@ static int vmx_domain_initialise(struct
static void vmx_domain_destroy(struct domain *d)
{
- if ( d->arch.hvm_domain.hap_enabled )
+ if ( paging_mode_hap(d) )
on_each_cpu(__ept_sync_domain, d, 1);
vmx_free_vlapic_mapping(d);
}
@@ -678,7 +678,7 @@ static void vmx_ctxt_switch_to(struct vc
if ( old_cr4 != new_cr4 )
write_cr4(new_cr4);
- if ( d->arch.hvm_domain.hap_enabled )
+ if ( paging_mode_hap(d) )
{
unsigned int cpu = smp_processor_id();
/* Test-and-test-and-set this CPU in the EPT-is-synced mask. */
@@ -1222,7 +1222,7 @@ static void __ept_sync_domain(void *info
void ept_sync_domain(struct domain *d)
{
/* Only if using EPT and this domain has some VCPUs to dirty. */
- if ( !d->arch.hvm_domain.hap_enabled || !d->vcpu || !d->vcpu[0] )
+ if ( !paging_mode_hap(d) || !d->vcpu || !d->vcpu[0] )
return;
ASSERT(local_irq_is_enabled());
diff -r af15aa70b6ff xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c Tue Mar 09 14:01:51 2010 +0100
+++ b/xen/arch/x86/mm/mem_sharing.c Tue Mar 09 14:34:24 2010 +0100
@@ -44,7 +44,7 @@ static void mem_sharing_audit(void);
#define hap_enabled(d) \
- (is_hvm_domain(d) && (d)->arch.hvm_domain.hap_enabled)
+ (is_hvm_domain(d) && paging_mode_hap(d))
#define mem_sharing_enabled(d) \
(is_hvm_domain(d) && (d)->arch.hvm_domain.mem_sharing_enabled)
diff -r af15aa70b6ff xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c Tue Mar 09 14:01:51 2010 +0100
+++ b/xen/arch/x86/mm/p2m.c Tue Mar 09 14:34:24 2010 +0100
@@ -1231,7 +1231,7 @@ p2m_set_entry(struct domain *d, unsigned
if ( !p2m_next_level(d, &table_mfn, &table, &gfn_remainder, gfn,
L3_PAGETABLE_SHIFT - PAGE_SHIFT,
((CONFIG_PAGING_LEVELS == 3)
- ? (d->arch.hvm_domain.hap_enabled ? 4 : 8)
+ ? (paging_mode_hap(d) ? 4 : 8)
: L3_PAGETABLE_ENTRIES),
PGT_l2_page_table) )
goto out;
@@ -1568,7 +1568,7 @@ int p2m_init(struct domain *d)
p2m->get_entry_current = p2m_gfn_to_mfn_current;
p2m->change_entry_type_global = p2m_change_type_global;
- if ( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled &&
+ if ( is_hvm_domain(d) && paging_mode_hap(d) &&
(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) )
ept_p2m_init(d);
@@ -1595,7 +1595,7 @@ int set_p2m_entry(struct domain *d, unsi
while ( todo )
{
- if ( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled )
+ if ( is_hvm_domain(d) && paging_mode_hap(d) )
order = (((gfn | mfn_x(mfn) | todo) & (SUPERPAGE_PAGES - 1)) == 0) ?
9 : 0;
else
diff -r af15aa70b6ff xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c Tue Mar 09 14:01:51 2010 +0100
+++ b/xen/arch/x86/mm/paging.c Tue Mar 09 14:34:24 2010 +0100
@@ -29,7 +29,7 @@
#include <xen/numa.h>
#include <xsm/xsm.h>
-#define hap_enabled(d) (is_hvm_domain(d) && (d)->arch.hvm_domain.hap_enabled)
+#define hap_enabled(d) (is_hvm_domain(d) && paging_mode_hap(d))
/* Printouts */
#define PAGING_PRINTK(_f, _a...) \
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: xen: use paging_mode_hap()
2010-03-30 15:51 xen: use paging_mode_hap() Christoph Egger
@ 2010-03-31 9:29 ` Tim Deegan
2010-03-31 12:48 ` Christoph Egger
0 siblings, 1 reply; 6+ messages in thread
From: Tim Deegan @ 2010-03-31 9:29 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel@lists.xensource.com
At 16:51 +0100 on 30 Mar (1269967863), Christoph Egger wrote:
>
> Hi!
>
> Attached patch makes xen consequently use paging_mode_hap().
>
> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
>
> P.S.: This is a resend. Needs ack from Tim.
Nack, at least in its current form - paging_mode_hap(d) is not the same
as d->arch.hvm_domain.hap_enabled. Especially in paging.c, where we
test hap_enabled to gate whether we should call the function that makes
paging_mode_hap(d) true!
I think the p2m.c changes are wrong too, since the p2m init code is
called from hap_enable before it writes PG_HAP_enable to the paging
mode. (That's probably a bug in its own right; it should set the mode
and then call the p2m code, and shadow should do likewise, and then
these changes would be correct and desirable).
The other substitutions are probably OK.
Cheers,
Tim.
Content-Description: xen_pagingmode.diff
> diff -r af15aa70b6ff xen/arch/x86/hvm/vmx/vmx.c
> --- a/xen/arch/x86/hvm/vmx/vmx.c Tue Mar 09 14:01:51 2010 +0100
> +++ b/xen/arch/x86/hvm/vmx/vmx.c Tue Mar 09 14:34:24 2010 +0100
> @@ -92,7 +92,7 @@ static int vmx_domain_initialise(struct
>
> static void vmx_domain_destroy(struct domain *d)
> {
> - if ( d->arch.hvm_domain.hap_enabled )
> + if ( paging_mode_hap(d) )
> on_each_cpu(__ept_sync_domain, d, 1);
> vmx_free_vlapic_mapping(d);
> }
> @@ -678,7 +678,7 @@ static void vmx_ctxt_switch_to(struct vc
> if ( old_cr4 != new_cr4 )
> write_cr4(new_cr4);
>
> - if ( d->arch.hvm_domain.hap_enabled )
> + if ( paging_mode_hap(d) )
> {
> unsigned int cpu = smp_processor_id();
> /* Test-and-test-and-set this CPU in the EPT-is-synced mask. */
> @@ -1222,7 +1222,7 @@ static void __ept_sync_domain(void *info
> void ept_sync_domain(struct domain *d)
> {
> /* Only if using EPT and this domain has some VCPUs to dirty. */
> - if ( !d->arch.hvm_domain.hap_enabled || !d->vcpu || !d->vcpu[0] )
> + if ( !paging_mode_hap(d) || !d->vcpu || !d->vcpu[0] )
> return;
>
> ASSERT(local_irq_is_enabled());
> diff -r af15aa70b6ff xen/arch/x86/mm/mem_sharing.c
> --- a/xen/arch/x86/mm/mem_sharing.c Tue Mar 09 14:01:51 2010 +0100
> +++ b/xen/arch/x86/mm/mem_sharing.c Tue Mar 09 14:34:24 2010 +0100
> @@ -44,7 +44,7 @@ static void mem_sharing_audit(void);
>
>
> #define hap_enabled(d) \
> - (is_hvm_domain(d) && (d)->arch.hvm_domain.hap_enabled)
> + (is_hvm_domain(d) && paging_mode_hap(d))
> #define mem_sharing_enabled(d) \
> (is_hvm_domain(d) && (d)->arch.hvm_domain.mem_sharing_enabled)
>
> diff -r af15aa70b6ff xen/arch/x86/mm/p2m.c
> --- a/xen/arch/x86/mm/p2m.c Tue Mar 09 14:01:51 2010 +0100
> +++ b/xen/arch/x86/mm/p2m.c Tue Mar 09 14:34:24 2010 +0100
> @@ -1231,7 +1231,7 @@ p2m_set_entry(struct domain *d, unsigned
> if ( !p2m_next_level(d, &table_mfn, &table, &gfn_remainder, gfn,
> L3_PAGETABLE_SHIFT - PAGE_SHIFT,
> ((CONFIG_PAGING_LEVELS == 3)
> - ? (d->arch.hvm_domain.hap_enabled ? 4 : 8)
> + ? (paging_mode_hap(d) ? 4 : 8)
> : L3_PAGETABLE_ENTRIES),
> PGT_l2_page_table) )
> goto out;
> @@ -1568,7 +1568,7 @@ int p2m_init(struct domain *d)
> p2m->get_entry_current = p2m_gfn_to_mfn_current;
> p2m->change_entry_type_global = p2m_change_type_global;
>
> - if ( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled &&
> + if ( is_hvm_domain(d) && paging_mode_hap(d) &&
> (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) )
> ept_p2m_init(d);
>
> @@ -1595,7 +1595,7 @@ int set_p2m_entry(struct domain *d, unsi
>
> while ( todo )
> {
> - if ( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled )
> + if ( is_hvm_domain(d) && paging_mode_hap(d) )
> order = (((gfn | mfn_x(mfn) | todo) & (SUPERPAGE_PAGES - 1)) == 0) ?
> 9 : 0;
> else
> diff -r af15aa70b6ff xen/arch/x86/mm/paging.c
> --- a/xen/arch/x86/mm/paging.c Tue Mar 09 14:01:51 2010 +0100
> +++ b/xen/arch/x86/mm/paging.c Tue Mar 09 14:34:24 2010 +0100
> @@ -29,7 +29,7 @@
> #include <xen/numa.h>
> #include <xsm/xsm.h>
>
> -#define hap_enabled(d) (is_hvm_domain(d) && (d)->arch.hvm_domain.hap_enabled)
> +#define hap_enabled(d) (is_hvm_domain(d) && paging_mode_hap(d))
>
> /* Printouts */
> #define PAGING_PRINTK(_f, _a...) \
--
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: xen: use paging_mode_hap()
2010-03-31 9:29 ` Tim Deegan
@ 2010-03-31 12:48 ` Christoph Egger
2010-04-01 10:27 ` Tim Deegan
2010-04-07 7:53 ` Xu, Dongxiao
0 siblings, 2 replies; 6+ messages in thread
From: Christoph Egger @ 2010-03-31 12:48 UTC (permalink / raw)
To: xen-devel; +Cc: Tim Deegan
[-- Attachment #1: Type: text/plain, Size: 1370 bytes --]
On Wednesday 31 March 2010 11:29:32 Tim Deegan wrote:
> At 16:51 +0100 on 30 Mar (1269967863), Christoph Egger wrote:
> > Hi!
> >
> > Attached patch makes xen consequently use paging_mode_hap().
> >
> > Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
> >
> > P.S.: This is a resend. Needs ack from Tim.
>
> Nack, at least in its current form - paging_mode_hap(d) is not the same
> as d->arch.hvm_domain.hap_enabled. Especially in paging.c, where we
> test hap_enabled to gate whether we should call the function that makes
> paging_mode_hap(d) true!
>
> I think the p2m.c changes are wrong too, since the p2m init code is
> called from hap_enable before it writes PG_HAP_enable to the paging
> mode. (That's probably a bug in its own right; it should set the mode
> and then call the p2m code, and shadow should do likewise, and then
> these changes would be correct and desirable).
>
> The other substitutions are probably OK.
>
> Cheers,
>
> Tim.
Thanks for you comments. Attached is my updated patch.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
[-- Attachment #2: xen_pagingmode.diff --]
[-- Type: text/x-diff, Size: 3708 bytes --]
diff -r fa1ad484bf0b xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c Wed Mar 31 14:28:31 2010 +0200
+++ b/xen/arch/x86/hvm/vmx/vmx.c Wed Mar 31 14:44:39 2010 +0200
@@ -92,7 +92,7 @@ static int vmx_domain_initialise(struct
static void vmx_domain_destroy(struct domain *d)
{
- if ( d->arch.hvm_domain.hap_enabled )
+ if ( paging_mode_hap(d) )
on_each_cpu(__ept_sync_domain, d, 1);
vmx_free_vlapic_mapping(d);
}
@@ -678,7 +678,7 @@ static void vmx_ctxt_switch_to(struct vc
if ( old_cr4 != new_cr4 )
write_cr4(new_cr4);
- if ( d->arch.hvm_domain.hap_enabled )
+ if ( paging_mode_hap(d) )
{
unsigned int cpu = smp_processor_id();
/* Test-and-test-and-set this CPU in the EPT-is-synced mask. */
@@ -1222,7 +1222,7 @@ static void __ept_sync_domain(void *info
void ept_sync_domain(struct domain *d)
{
/* Only if using EPT and this domain has some VCPUs to dirty. */
- if ( !d->arch.hvm_domain.hap_enabled || !d->vcpu || !d->vcpu[0] )
+ if ( !paging_mode_hap(d) || !d->vcpu || !d->vcpu[0] )
return;
ASSERT(local_irq_is_enabled());
diff -r fa1ad484bf0b xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c Wed Mar 31 14:28:31 2010 +0200
+++ b/xen/arch/x86/mm/hap/hap.c Wed Mar 31 14:44:39 2010 +0200
@@ -550,8 +550,13 @@ int hap_enable(struct domain *d, u32 mod
{
unsigned int old_pages;
int rv = 0;
+ uint32_t oldmode;
domain_pause(d);
+
+ oldmode = d->arch.paging.mode;
+ d->arch.paging.mode = mode | PG_HAP_enable;
+
/* error check */
if ( (d == current->domain) )
{
@@ -582,9 +587,9 @@ int hap_enable(struct domain *d, u32 mod
goto out;
}
- d->arch.paging.mode = mode | PG_HAP_enable;
-
out:
+ if (rv)
+ d->arch.paging.mode = oldmode;
domain_unpause(d);
return rv;
}
diff -r fa1ad484bf0b xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c Wed Mar 31 14:28:31 2010 +0200
+++ b/xen/arch/x86/mm/mem_sharing.c Wed Mar 31 14:44:39 2010 +0200
@@ -44,7 +44,7 @@ static void mem_sharing_audit(void);
#define hap_enabled(d) \
- (is_hvm_domain(d) && (d)->arch.hvm_domain.hap_enabled)
+ (is_hvm_domain(d) && paging_mode_hap(d))
#define mem_sharing_enabled(d) \
(is_hvm_domain(d) && (d)->arch.hvm_domain.mem_sharing_enabled)
diff -r fa1ad484bf0b xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c Wed Mar 31 14:28:31 2010 +0200
+++ b/xen/arch/x86/mm/p2m.c Wed Mar 31 14:44:39 2010 +0200
@@ -1231,7 +1231,7 @@ p2m_set_entry(struct domain *d, unsigned
if ( !p2m_next_level(d, &table_mfn, &table, &gfn_remainder, gfn,
L3_PAGETABLE_SHIFT - PAGE_SHIFT,
((CONFIG_PAGING_LEVELS == 3)
- ? (d->arch.hvm_domain.hap_enabled ? 4 : 8)
+ ? (paging_mode_hap(d) ? 4 : 8)
: L3_PAGETABLE_ENTRIES),
PGT_l2_page_table) )
goto out;
@@ -1568,7 +1568,7 @@ int p2m_init(struct domain *d)
p2m->get_entry_current = p2m_gfn_to_mfn_current;
p2m->change_entry_type_global = p2m_change_type_global;
- if ( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled &&
+ if ( is_hvm_domain(d) && paging_mode_hap(d) &&
(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) )
ept_p2m_init(d);
@@ -1595,7 +1595,7 @@ int set_p2m_entry(struct domain *d, unsi
while ( todo )
{
- if ( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled )
+ if ( is_hvm_domain(d) && paging_mode_hap(d) )
order = (((gfn | mfn_x(mfn) | todo) & (SUPERPAGE_PAGES - 1)) == 0) ?
9 : 0;
else
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: xen: use paging_mode_hap()
2010-03-31 12:48 ` Christoph Egger
@ 2010-04-01 10:27 ` Tim Deegan
2010-04-07 7:53 ` Xu, Dongxiao
1 sibling, 0 replies; 6+ messages in thread
From: Tim Deegan @ 2010-04-01 10:27 UTC (permalink / raw)
To: Christoph Egger; +Cc: xen-devel@lists.xensource.com
At 13:48 +0100 on 31 Mar (1270043321), Christoph Egger wrote:
> Thanks for you comments. Attached is my updated patch.
>
> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
--
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Re: xen: use paging_mode_hap()
2010-03-31 12:48 ` Christoph Egger
2010-04-01 10:27 ` Tim Deegan
@ 2010-04-07 7:53 ` Xu, Dongxiao
2010-04-07 9:01 ` Tim Deegan
1 sibling, 1 reply; 6+ messages in thread
From: Xu, Dongxiao @ 2010-04-07 7:53 UTC (permalink / raw)
To: Christoph Egger, xen-devel@lists.xensource.com; +Cc: Tim Deegan, Keir Fraser
Hi Egger,
We found that guests with Intel EPT could not boot up with latest
upstream Xen.
The root cause is:
When calling p2m_init() function, the PG_HAP_enable hasn't been
written to paging mode, which Tim has pointed out in this mail.
After adding the following patch, HVM guest with hap=1 works well.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
diff -r adce8bc43fcc xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c Tue Apr 06 07:16:47 2010 +0100
+++ b/xen/arch/x86/mm/p2m.c Wed Apr 07 23:48:14 2010 +0800
@@ -1712,7 +1712,7 @@ int p2m_init(struct domain *d)
p2m->get_entry_current = p2m_gfn_to_mfn_current;
p2m->change_entry_type_global = p2m_change_type_global;
- if ( is_hvm_domain(d) && paging_mode_hap(d) &&
+ if ( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled &&
(boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) )
ept_p2m_init(d);
Thanks,
Dongxiao
Christoph Egger wrote:
> On Wednesday 31 March 2010 11:29:32 Tim Deegan wrote:
>> At 16:51 +0100 on 30 Mar (1269967863), Christoph Egger wrote:
>>> Hi!
>>>
>>> Attached patch makes xen consequently use paging_mode_hap().
>>>
>>> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
>>>
>>> P.S.: This is a resend. Needs ack from Tim.
>>
>> Nack, at least in its current form - paging_mode_hap(d) is not the
>> same as d->arch.hvm_domain.hap_enabled. Especially in paging.c,
>> where we test hap_enabled to gate whether we should call the
>> function that makes paging_mode_hap(d) true!
>>
>> I think the p2m.c changes are wrong too, since the p2m init code is
>> called from hap_enable before it writes PG_HAP_enable to the paging
>> mode. (That's probably a bug in its own right; it should set the
>> mode and then call the p2m code, and shadow should do likewise, and
>> then these changes would be correct and desirable).
>>
>> The other substitutions are probably OK.
>>
>> Cheers,
>>
>> Tim.
>
> Thanks for you comments. Attached is my updated patch.
>
> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Re: xen: use paging_mode_hap()
2010-04-07 7:53 ` Xu, Dongxiao
@ 2010-04-07 9:01 ` Tim Deegan
0 siblings, 0 replies; 6+ messages in thread
From: Tim Deegan @ 2010-04-07 9:01 UTC (permalink / raw)
To: Xu, Dongxiao; +Cc: Christoph Egger, xen-devel@lists.xensource.com, Keir Fraser
At 08:53 +0100 on 07 Apr (1270630406), Xu, Dongxiao wrote:
> We found that guests with Intel EPT could not boot up with latest
> upstream Xen.
>
> The root cause is:
> When calling p2m_init() function, the PG_HAP_enable hasn't been
> written to paging mode, which Tim has pointed out in this mail.
True - I thought that reshuffling hap_enable() would be good enough, but
of course p2m_init() gets called before any hap code, so this patch is
needed.
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
> After adding the following patch, HVM guest with hap=1 works well.
>
> Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
>
> diff -r adce8bc43fcc xen/arch/x86/mm/p2m.c
> --- a/xen/arch/x86/mm/p2m.c Tue Apr 06 07:16:47 2010 +0100
> +++ b/xen/arch/x86/mm/p2m.c Wed Apr 07 23:48:14 2010 +0800
> @@ -1712,7 +1712,7 @@ int p2m_init(struct domain *d)
> p2m->get_entry_current = p2m_gfn_to_mfn_current;
> p2m->change_entry_type_global = p2m_change_type_global;
>
> - if ( is_hvm_domain(d) && paging_mode_hap(d) &&
> + if ( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled &&
> (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) )
> ept_p2m_init(d);
>
>
> Thanks,
> Dongxiao
>
>
> Christoph Egger wrote:
> > On Wednesday 31 March 2010 11:29:32 Tim Deegan wrote:
> >> At 16:51 +0100 on 30 Mar (1269967863), Christoph Egger wrote:
> >>> Hi!
> >>>
> >>> Attached patch makes xen consequently use paging_mode_hap().
> >>>
> >>> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
> >>>
> >>> P.S.: This is a resend. Needs ack from Tim.
> >>
> >> Nack, at least in its current form - paging_mode_hap(d) is not the
> >> same as d->arch.hvm_domain.hap_enabled. Especially in paging.c,
> >> where we test hap_enabled to gate whether we should call the
> >> function that makes paging_mode_hap(d) true!
> >>
> >> I think the p2m.c changes are wrong too, since the p2m init code is
> >> called from hap_enable before it writes PG_HAP_enable to the paging
> >> mode. (That's probably a bug in its own right; it should set the
> >> mode and then call the p2m code, and shadow should do likewise, and
> >> then these changes would be correct and desirable).
> >>
> >> The other substitutions are probably OK.
> >>
> >> Cheers,
> >>
> >> Tim.
> >
> > Thanks for you comments. Attached is my updated patch.
> >
> > Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
>
--
Tim Deegan <Tim.Deegan@citrix.com>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-04-07 9:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-30 15:51 xen: use paging_mode_hap() Christoph Egger
2010-03-31 9:29 ` Tim Deegan
2010-03-31 12:48 ` Christoph Egger
2010-04-01 10:27 ` Tim Deegan
2010-04-07 7:53 ` Xu, Dongxiao
2010-04-07 9:01 ` Tim Deegan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).