Skip to contentSkip to conversation

p2m: merge ptp allocation

PATCH In review Christoph Egger 2 participants 3 messages Apr 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 p2m: merge ptp allocation

Hi!

Attached patch merges ptp allocation in p2m.

Signature · 6 lines
---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
xen/arch/x86/mm/hap/p2m-ept.c +3 -5
diff -r 105fdf064d27 xen/arch/x86/mm/hap/p2m-ept.c
@@ -30,6 +30,8 @@
 #include <asm/mtrr.h>
 #include <asm/hvm/cacheattr.h>
 
+#include "private.h"
+
 /* Non-ept "lock-and-check" wrapper */
 static int ept_pod_check_and_populate(struct domain *d, unsigned long gfn,
                                       ept_entry_t *entry, int order,
@@ -97,14 +99,10 @@ static int ept_set_middle_entry(struct d
 {
     struct page_info *pg;
 
-    pg = d->arch.p2m->alloc_page(d);
+    pg = p2m_alloc_ptp(d, 0);
     if ( pg == NULL )
         return 0;
 
-    pg->count_info = 1;
-    pg->u.inuse.type_info = 1 | PGT_validated;
-    page_list_add_tail(pg, &d->arch.p2m->pages);
-
     ept_entry->emt = 0;
     ept_entry->ipat = 0;
     ept_entry->sp_avail = 0;
xen/arch/x86/mm/hap/private.h +2 -1
diff -r 105fdf064d27 xen/arch/x86/mm/hap/private.h
@@ -30,5 +30,6 @@ unsigned long hap_gva_to_gfn_3_levels(st
 unsigned long hap_gva_to_gfn_4_levels(struct vcpu *v, unsigned long gva,
                                      uint32_t *pfec);
 
+struct page_info *p2m_alloc_ptp(struct domain *d, unsigned long type);
 
-#endif /* __SVM_NPT_H__ */
+#endif /* __HAP_PRIVATE_H__ */
xen/arch/x86/mm/p2m.c +29 -16

79 lines not on this page · raw message

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

#1 lore raw

Hi,

xen/arch/x86/mm/hap/private.h unsigned long hap_gva_to_gfn_3_levels(st · line 33

Quoted 12 lines · Christoph Egger

Attached patch merges ptp allocation in p2m.

diff -r 105fdf064d27 xen/arch/x86/mm/hap/private.h

xen/arch/x86/mm/hap/private.h +1 -0
@@ -30,5 +30,6 @@ unsigned long hap_gva_to_gfn_3_levels(st
 unsigned long hap_gva_to_gfn_4_levels(struct vcpu *v, unsigned long gva,
                                      uint32_t *pfec);
 
+struct page_info *p2m_alloc_ptp(struct domain *d, unsigned long type);

Why is this declared in hap/private.h when it's not a hap function? Maybe asm-x86/p2m.h would be a better place.

Otherwise, Ack.

Tim.

Signature · 3 lines
Tim Deegan <[email protected]>
Principal Software Engineer, XenServer Engineering
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)
#2 lore raw
Quoted 14 lines · On Tuesday 13 April 2010 12:22:21 Tim Deegan wrote:

Hi,

Quoted 11 lines · Christoph Egger

Attached patch merges ptp allocation in p2m.

diff -r 105fdf064d27 xen/arch/x86/mm/hap/private.h

xen/arch/x86/mm/hap/private.h +0 -0
@@ -30,5 +30,6 @@ unsigned long hap_gva_to_gfn_3_levels(st
 unsigned long hap_gva_to_gfn_4_levels(struct vcpu *v, unsigned long gva,
                                      uint32_t *pfec);
 
Quoted 4 lines

xen/arch/x86/mm/hap/private.h unsigned long hap_gva_to_gfn_3_levels(st · line 33

Quoted 1 line
xen/arch/x86/mm/hap/private.h +1 -0
+struct page_info *p2m_alloc_ptp(struct domain *d, unsigned long type);

Why is this declared in hap/private.h when it's not a hap function? Maybe asm-x86/p2m.h would be a better place.

Ok, I'm fine with this change.
Keir: Do you want me to resend the diff or will you do that right before applying the patch?

Quoted 2 lines

Otherwise, Ack.

Thanks.

Quoted 1 line

Tim.

Christoph

Signature · 6 lines
---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