Skip to contentSkip to conversation

Misc paging code clean up

RFC PATCH In review Wei Liu 5 participants 14 messages Aug 23, 2017 – Aug 24, 2017

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

cover Misc paging code clean up

Wei Liu (2):
xen: remove CONFIG_PAGING_ASSISTANCE
x86/mm: PG_translate implies PG_refcounts

 xen/arch/x86/domain.c        |  6 ++----
 xen/arch/x86/hvm/hvm.c       |  2 +-
 xen/arch/x86/mm.c            | 20 ++++++++++----------
 xen/arch/x86/mm/paging.c     |  8 +++-----
 xen/include/asm-arm/config.h |  2 --
 xen/include/asm-x86/config.h |  1 -
 xen/include/asm-x86/paging.h |  5 +----
 xen/include/asm-x86/shadow.h |  2 +-
 xen/include/xen/paging.h     | 19 -------------------
 9 files changed, 18 insertions(+), 47 deletions(-)
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#1 lore raw

RFC PATCH 1/2 xen: remove CONFIG_PAGING_ASSISTANCE

Arm should always set it, while on x86 xen can't build with it set to 0, which means people haven't used it for years.

Remove it and simplify xen/paging.h.

---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Julien Grall <[email protected]>

---
 xen/include/asm-arm/config.h |  2 --
 xen/include/asm-x86/config.h |  1 -
 xen/include/xen/paging.h     | 19 -------------------
 3 files changed, 22 deletions(-)
xen/include/asm-arm/config.h +0 -2
index 7da94698e1..210c9f858b 100644
@@ -24,8 +24,6 @@
 /* xen_ulong_t is always 64 bits */
 #define BITS_PER_XEN_ULONG 64
 
-#define CONFIG_PAGING_ASSISTANCE 1
-
 #define CONFIG_PAGING_LEVELS 3
 
 #define CONFIG_ARM 1
xen/include/asm-x86/config.h +0 -1
index 0130ac864f..f63a9cb952 100644
@@ -19,7 +19,6 @@
 
 #define BITS_PER_XEN_ULONG BITS_PER_LONG
 
-#define CONFIG_PAGING_ASSISTANCE 1
 #define CONFIG_X86_PM_TIMER 1
 #define CONFIG_HPET_TIMER 1
 #define CONFIG_X86_MCE_THERMAL 1
xen/include/xen/paging.h +0 -19
index 214bde5576..a126c9bf58 100644
@@ -1,26 +1,7 @@
-
 #ifndef __XEN_PAGING_H__
 #define __XEN_PAGING_H__
 
-#if defined CONFIG_PAGING_ASSISTANCE
-
 #include <asm/paging.h>
 #include <asm/p2m.h>
 
-#elif defined CONFIG_SHADOW_PAGING
-
-#include <asm/shadow.h>
-
-#define paging_mode_translate(d)  shadow_mode_translate(d)
-#define paging_mode_external(d)   (0)
-
-#else
-
-#define paging_mode_translate(d)              (0)
-#define paging_mode_external(d)               (0)
-#define guest_physmap_add_page(d, p, m, o)    ((void)0)
-#define guest_physmap_remove_page(d, p, m, o) ((void)0)
-
-#endif
-
 #endif /* __XEN_PAGING_H__ */
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#2 lore raw

Re: [PATCH RFC 1/2] xen: remove CONFIG_PAGING_ASSISTANCE

Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 23.08.17 at 17:58, <[email protected]> wrote:

Arm should always set it, while on x86 xen can't build with it set to 0, which means people haven't used it for years.

Remove it and simplify xen/paging.h.

This is something I certainly would want Tim to see (and perhaps approve).

Jan

Quoted 69 lines

---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Julien Grall <[email protected]>

---
 xen/include/asm-arm/config.h |  2 --
 xen/include/asm-x86/config.h |  1 -
 xen/include/xen/paging.h     | 19 -------------------
 3 files changed, 22 deletions(-)
xen/include/asm-arm/config.h +0 -2
index 7da94698e1..210c9f858b 100644
@@ -24,8 +24,6 @@
 /* xen_ulong_t is always 64 bits */
 #define BITS_PER_XEN_ULONG 64
 
-#define CONFIG_PAGING_ASSISTANCE 1
-
 #define CONFIG_PAGING_LEVELS 3
 
 #define CONFIG_ARM 1
xen/include/asm-x86/config.h +0 -1
index 0130ac864f..f63a9cb952 100644
@@ -19,7 +19,6 @@
 
 #define BITS_PER_XEN_ULONG BITS_PER_LONG
 
-#define CONFIG_PAGING_ASSISTANCE 1
 #define CONFIG_X86_PM_TIMER 1
 #define CONFIG_HPET_TIMER 1
 #define CONFIG_X86_MCE_THERMAL 1
xen/include/xen/paging.h +0 -19
index 214bde5576..a126c9bf58 100644
@@ -1,26 +1,7 @@
-
 #ifndef __XEN_PAGING_H__
 #define __XEN_PAGING_H__
 
-#if defined CONFIG_PAGING_ASSISTANCE
-
 #include <asm/paging.h>
 #include <asm/p2m.h>
 
-#elif defined CONFIG_SHADOW_PAGING
-
-#include <asm/shadow.h>
-
-#define paging_mode_translate(d)  shadow_mode_translate(d)
-#define paging_mode_external(d)   (0)
-
-#else
-
-#define paging_mode_translate(d)              (0)
-#define paging_mode_external(d)               (0)
-#define guest_physmap_add_page(d, p, m, o)    ((void)0)
-#define guest_physmap_remove_page(d, p, m, o) ((void)0)
-
-#endif
-
 #endif /* __XEN_PAGING_H__ */
Signature · 1 line
2.11.0

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Acked-by
#3 lore raw

Re: [PATCH RFC 1/2] xen: remove CONFIG_PAGING_ASSISTANCE

Quoted 10 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 23.08.17 at 17:58, <[email protected]> wrote:

Arm should always set it, while on x86 xen can't build with it set to 0, which means people haven't used it for years.

Remove it and simplify xen/paging.h.

This is something I certainly would want Tim to see (and perhaps approve).

Thanks. I see and approve. :)

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#4 lore raw

Re: [PATCH RFC 1/2] xen: remove CONFIG_PAGING_ASSISTANCE

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 24.08.17 at 12:04, <[email protected]> wrote:
Quoted 6 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 23.08.17 at 17:58, <[email protected]> wrote:

Arm should always set it, while on x86 xen can't build with it set to 0, which means people haven't used it for years.

Remove it and simplify xen/paging.h.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

This is something I certainly would want Tim to see (and perhaps approve).

Thanks. I see and approve. :)

Thanks, in which case both patches can have my ack too (in case it's still needed at all).

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Acked-by on v1 1/2
#5 lore raw

Re: [PATCH RFC 1/2] xen: remove CONFIG_PAGING_ASSISTANCE

In reply to Wei Liu

Hi,

Quoted 6 lines · Wei Liu

Arm should always set it, while on x86 xen can't build with it set to 0, which means people haven't used it for years.

Remove it and simplify xen/paging.h.

Arm bits:

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#6 lore raw

RFC PATCH 2/2 x86/mm: PG_translate implies PG_refcounts

In reply to Wei Liu

After 404595352 ("x86/paging: Enforce PG_external == PG_translate == PG_refcounts"), PG_refcounts and PG_translate always need to be set together.

Squash PG_refcounts to simplify code. All calls paging_mode_refcounts are replaced by calls to paging_mode_translate.

---
Cc: George Dunlap <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>

---
 xen/arch/x86/domain.c        |  6 ++----
 xen/arch/x86/hvm/hvm.c       |  2 +-
 xen/arch/x86/mm.c            | 20 ++++++++++----------
 xen/arch/x86/mm/paging.c     |  8 +++-----
 xen/include/asm-x86/paging.h |  5 +----
 xen/include/asm-x86/shadow.h |  2 +-
 6 files changed, 18 insertions(+), 25 deletions(-)
xen/arch/x86/domain.c +2 -4
index 9b4b9596d8..bbe545b165 100644
@@ -1017,8 +1017,6 @@ int arch_set_info_guest(
 
     if ( !cr3_page )
         rc = -EINVAL;
-    else if ( paging_mode_refcounts(d) )
-        /* nothing */;
     else if ( cr3_page == v->arch.old_guest_table )
     {
         v->arch.old_guest_table = NULL;
@@ -1040,7 +1038,7 @@ int arch_set_info_guest(
             break;
         case 0:
             if ( !compat && !VM_ASSIST(d, m2p_strict) &&
-                 !paging_mode_refcounts(d) )
+                 !paging_mode_translate(d) )
                 fill_ro_mpt(cr3_gfn);
             break;
         default:
@@ -1061,7 +1059,7 @@ int arch_set_info_guest(
 
             if ( !cr3_page )
                 rc = -EINVAL;
-            else if ( !paging_mode_refcounts(d) )
+            else if ( !paging_mode_translate(d) )
             {
                 rc = get_page_type_preemptible(cr3_page, PGT_root_page_table);
                 switch ( rc )
xen/arch/x86/hvm/hvm.c +1 -1
index 6cb903def5..eee0ff422e 100644
@@ -589,7 +589,7 @@ int hvm_domain_initialise(struct domain *d, unsigned long domcr_flags,
 
     hvm_init_cacheattr_region_list(d);
 
-    rc = paging_enable(d, PG_refcounts|PG_translate|PG_external);
+    rc = paging_enable(d, PG_translate|PG_external);
     if ( rc != 0 )
         goto fail0;
 
xen/arch/x86/mm.c +10 -10
index ed77270586..8adb7b6649 100644
@@ -1925,7 +1925,7 @@ static int mod_l1_entry(l1_pgentry_t *pl1e, l1_pgentry_t nl1e,
     if ( unlikely(__copy_from_user(&ol1e, pl1e, sizeof(ol1e)) != 0) )
         return -EFAULT;
 
-    ASSERT(!paging_mode_refcounts(pt_dom));
+    ASSERT(!paging_mode_translate(pt_dom));
 
     if ( l1e_get_flags(nl1e) & _PAGE_PRESENT )
     {
@@ -2257,7 +2257,7 @@ int get_page(struct page_info *page, struct domain *domain)
     if ( likely(owner == domain) )
         return 1;
 
-    if ( !paging_mode_refcounts(domain) && !domain->is_dying )
+    if ( !paging_mode_translate(domain) && !domain->is_dying )
         gprintk(XENLOG_INFO,
                 "Error mfn %"PRI_mfn": rd=%d od=%d caf=%08lx taf=%" PRtype_info "\n",
                 mfn_x(page_to_mfn(page)), domain->domain_id,
@@ -2719,7 +2719,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
     if ( mfn )
     {
         page = mfn_to_page(_mfn(mfn));
-        if ( paging_mode_refcounts(v->domain) )
+        if ( paging_mode_translate(v->domain) )
             put_page(page);
         else
             rc = put_page_and_type_preemptible(page);
@@ -2740,7 +2740,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
         if ( mfn )
         {
             page = mfn_to_page(_mfn(mfn));
-            if ( paging_mode_refcounts(v->domain) )
+            if ( paging_mode_translate(v->domain) )
                 put_page(page);
             else
                 rc = put_page_and_type_preemptible(page);
@@ -2811,7 +2811,7 @@ int new_guest_cr3(unsigned long mfn)
         return 0;
     }
 
-    rc = paging_mode_refcounts(d)
+    rc = paging_mode_translate(d)
          ? (get_page_from_mfn(_mfn(mfn), d) ? 0 : -EINVAL)
          : get_page_and_type_from_mfn(_mfn(mfn), PGT_root_page_table, d, 0, 1);
     switch ( rc )
@@ -2829,7 +2829,7 @@ int new_guest_cr3(unsigned long mfn)
 
     invalidate_shadow_ldt(curr, 0);
 
-    if ( !VM_ASSIST(d, m2p_strict) && !paging_mode_refcounts(d) )
+    if ( !VM_ASSIST(d, m2p_strict) && !paging_mode_translate(d) )
         fill_ro_mpt(mfn);
     curr->arch.guest_table = pagetable_from_pfn(mfn);
     update_cr3(curr);
@@ -2840,7 +2840,7 @@ int new_guest_cr3(unsigned long mfn)
     {
         struct page_info *page = mfn_to_page(_mfn(old_base_mfn));
 
-        if ( paging_mode_refcounts(d) )
+        if ( paging_mode_translate(d) )
             put_page(page);
         else
             switch ( rc = put_page_and_type_preemptible(page) )
@@ -3059,7 +3059,7 @@ long do_mmuext_op(
             if ( (op.cmd - MMUEXT_PIN_L1_TABLE) > (CONFIG_PAGING_LEVELS - 1) )
                 break;
 
-            if ( paging_mode_refcounts(pg_owner) )
+            if ( paging_mode_translate(pg_owner) )
                 break;
 
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
@@ -3121,7 +3121,7 @@ long do_mmuext_op(
             break;
 
         case MMUEXT_UNPIN_TABLE:
-            if ( paging_mode_refcounts(pg_owner) )
+            if ( paging_mode_translate(pg_owner) )
                 break;
 
             page = get_page_from_gfn(pg_owner, op.arg1.mfn, NULL, P2M_ALLOC);
@@ -3564,7 +3564,7 @@ long do_mmu_update(
             p2m_type_t p2mt;
 
             rc = -EOPNOTSUPP;
-            if ( unlikely(paging_mode_refcounts(pt_owner)) )
+            if ( unlikely(paging_mode_translate(pt_owner)) )
                 break;
 
             xsm_needed |= XSM_MMU_NORMAL_UPDATE;
xen/arch/x86/mm/paging.c +3 -5
index 75f5fc0024..354d96d4cc 100644
@@ -839,11 +839,11 @@ int paging_enable(struct domain *d, u32 mode)
     if ( mode & ~PG_MASK )
         return -EINVAL;
 
-    /* All of external|translate|refcounts, or none. */
-    switch ( mode & (PG_external | PG_translate | PG_refcounts) )
+    /* Both of external|translate, or none. */
+    switch ( mode & (PG_external | PG_translate) )
     {
     case 0:
-    case PG_external | PG_translate | PG_refcounts:
+    case PG_external | PG_translate:
         break;
     default:
         return -EINVAL;
@@ -881,8 +881,6 @@ void paging_dump_domain_info(struct domain *d)
             printk("shadow ");
         if ( paging_mode_hap(d) )
             printk("hap ");
-        if ( paging_mode_refcounts(d) )
-            printk("refcounts ");
         if ( paging_mode_log_dirty(d) )
             printk("log_dirty ");
         if ( paging_mode_translate(d) )
xen/include/asm-x86/paging.h +1 -4
index 64bf2f968a..496a80a1ad 100644
@@ -47,8 +47,6 @@
 
 /* common paging mode bits */
 #define PG_mode_shift  10 
-/* Refcounts based on shadow tables instead of guest tables */
-#define PG_refcounts   (XEN_DOMCTL_SHADOW_ENABLE_REFCOUNT << PG_mode_shift)
 /* Enable log dirty mode */
 #define PG_log_dirty   (XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY << PG_mode_shift)
 /* Xen does p2m translation, not guest */
@@ -58,13 +56,12 @@
 #define PG_external    (XEN_DOMCTL_SHADOW_ENABLE_EXTERNAL << PG_mode_shift)
 
 /* All paging modes. */
-#define PG_MASK (PG_refcounts | PG_log_dirty | PG_translate | PG_external)
+#define PG_MASK (PG_log_dirty | PG_translate | PG_external)
 
 #define paging_mode_enabled(_d)   (!!(_d)->arch.paging.mode)
 #define paging_mode_shadow(_d)    (!!((_d)->arch.paging.mode & PG_SH_enable))
 #define paging_mode_hap(_d)       (!!((_d)->arch.paging.mode & PG_HAP_enable))
 
-#define paging_mode_refcounts(_d) (!!((_d)->arch.paging.mode & PG_refcounts))
 #define paging_mode_log_dirty(_d) (!!((_d)->arch.paging.mode & PG_log_dirty))
 #define paging_mode_translate(_d) (!!((_d)->arch.paging.mode & PG_translate))
 #define paging_mode_external(_d)  (!!((_d)->arch.paging.mode & PG_external))
xen/include/asm-x86/shadow.h +1 -1
index 678b5d48bb..e0607b9620 100644
@@ -35,7 +35,7 @@
 
 #define shadow_mode_enabled(_d)    paging_mode_shadow(_d)
 #define shadow_mode_refcounts(_d) (paging_mode_shadow(_d) && \
-                                   paging_mode_refcounts(_d))
+                                   paging_mode_translate(_d))
 #define shadow_mode_log_dirty(_d) (paging_mode_shadow(_d) && \
                                    paging_mode_log_dirty(_d))
 #define shadow_mode_translate(_d) (paging_mode_shadow(_d) && \
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
author
#7 lore raw

Re: [PATCH RFC 2/2] x86/mm: PG_translate implies PG_refcounts

Quoted 27 lines · Wei Liu

After 404595352 ("x86/paging: Enforce PG_external == PG_translate == PG_refcounts"), PG_refcounts and PG_translate always need to be set together.

Squash PG_refcounts to simplify code. All calls paging_mode_refcounts are replaced by calls to paging_mode_translate.

---
Cc: George Dunlap <[email protected]>
Cc: Tim Deegan <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>

---
 xen/arch/x86/domain.c        |  6 ++----
 xen/arch/x86/hvm/hvm.c       |  2 +-
 xen/arch/x86/mm.c            | 20 ++++++++++----------
 xen/arch/x86/mm/paging.c     |  8 +++-----
 xen/include/asm-x86/paging.h |  5 +----
 xen/include/asm-x86/shadow.h |  2 +-
 6 files changed, 18 insertions(+), 25 deletions(-)
xen/arch/x86/domain.c +0 -0
index 9b4b9596d8..bbe545b165 100644

xen/arch/x86/domain.c int arch_set_info_guest( · line 1021

Quoted 5 lines
xen/arch/x86/domain.c +0 -2
@@ -1017,8 +1017,6 @@ int arch_set_info_guest(
 
     if ( !cr3_page )
         rc = -EINVAL;
-    else if ( paging_mode_refcounts(d) )
-        /* nothing */;

It appears I accidentally deleted this hunk, but my tests were still happy...

Given this function is rather convoluted I intend to add it back and deal with that later.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Acked-by on v1 2/2
#8 lore raw

Re: [PATCH RFC 2/2] x86/mm: PG_translate implies PG_refcounts

In reply to Wei Liu
Quoted 6 lines · Wei Liu

After 404595352 ("x86/paging: Enforce PG_external == PG_translate == PG_refcounts"), PG_refcounts and PG_translate always need to be set together.

Squash PG_refcounts to simplify code. All calls paging_mode_refcounts are replaced by calls to paging_mode_translate.

Would it be a good idea to merge all three and have only PG_external?

Quoted 1 line

with one adjustment:

xen/include/asm-x86/paging.h line 52

Quoted 7 lines

/* common paging mode bits */
#define PG_mode_shift 10

xen/include/asm-x86/paging.h +0 -2
-/* Refcounts based on shadow tables instead of guest tables */
-#define PG_refcounts   (XEN_DOMCTL_SHADOW_ENABLE_REFCOUNT << PG_mode_shift)
 /* Enable log dirty mode */
 #define PG_log_dirty   (XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY << PG_mode_shift)
 /* Xen does p2m translation, not guest */

Please add "and handles refcounts" to the comment describing PG_translate.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#9 lore raw

Re: [PATCH RFC 2/2] x86/mm: PG_translate implies PG_refcounts

Quoted 10 lines · Tim Deegan
Quoted 6 lines · Wei Liu

After 404595352 ("x86/paging: Enforce PG_external == PG_translate == PG_refcounts"), PG_refcounts and PG_translate always need to be set together.

Squash PG_refcounts to simplify code. All calls paging_mode_refcounts are replaced by calls to paging_mode_translate.

Would it be a good idea to merge all three and have only PG_external?

My reverse-engineering is that when PV guest is migrated it has PG_external and (the new) PG_translate.

I would be happy to squash all three into one if you tell me I'm wrong. :-)

Quoted 6 lines
Quoted 1 line

with one adjustment:

Quoted 10 lines

xen/include/asm-x86/paging.h line 52

Quoted 7 lines

/* common paging mode bits */
#define PG_mode_shift 10

xen/include/asm-x86/paging.h +0 -2
-/* Refcounts based on shadow tables instead of guest tables */
-#define PG_refcounts   (XEN_DOMCTL_SHADOW_ENABLE_REFCOUNT << PG_mode_shift)
 /* Enable log dirty mode */
 #define PG_log_dirty   (XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY << PG_mode_shift)
 /* Xen does p2m translation, not guest */

Please add "and handles refcounts" to the comment describing PG_translate.

Sure.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#10 lore raw

Re: [PATCH RFC 2/2] x86/mm: PG_translate implies PG_refcounts

Quoted 6 lines · Wei Liu
Quoted 5 lines · Tim Deegan
Quoted 4 lines · Wei Liu

After 404595352 ("x86/paging: Enforce PG_external == PG_translate == PG_refcounts"), PG_refcounts and PG_translate always need to be set together.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Squash PG_refcounts to simplify code. All calls paging_mode_refcounts are replaced by calls to paging_mode_translate.

Would it be a good idea to merge all three and have only PG_external?

My reverse-engineering is that when PV guest is migrated it has PG_external and (the new) PG_translate.

Sorry, I meant (!PG_external && PG_translate)

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#11 lore raw

Re: [PATCH RFC 2/2] x86/mm: PG_translate implies PG_refcounts

Quoted 7 lines · Wei Liu
Quoted 6 lines · Wei Liu
Quoted 5 lines · Tim Deegan
Quoted 4 lines · Wei Liu

After 404595352 ("x86/paging: Enforce PG_external == PG_translate == PG_refcounts"), PG_refcounts and PG_translate always need to be set together.

Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Squash PG_refcounts to simplify code. All calls paging_mode_refcounts are replaced by calls to paging_mode_translate.

Would it be a good idea to merge all three and have only PG_external?

My reverse-engineering is that when PV guest is migrated it has PG_external and (the new) PG_translate.

Sorry, I meant (!PG_external && PG_translate)

PV guests migrating should get logdirty and none of PG_external|PG_translate|PG_refcounts

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

author
#12 lore raw

Re: [PATCH RFC 2/2] x86/mm: PG_translate implies PG_refcounts

Quoted 10 lines · Andrew Cooper
Quoted 9 lines · Wei Liu
Quoted 8 lines · Wei Liu
Quoted 7 lines · Tim Deegan
Quoted 6 lines · Wei Liu

After 404595352 ("x86/paging: Enforce PG_external == PG_translate == PG_refcounts"), PG_refcounts and PG_translate always need to be set together.

Squash PG_refcounts to simplify code. All calls paging_mode_refcounts are replaced by calls to paging_mode_translate.

Quoted 9 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

Would it be a good idea to merge all three and have only PG_external?

My reverse-engineering is that when PV guest is migrated it has PG_external and (the new) PG_translate.

Sorry, I meant (!PG_external && PG_translate)

PV guests migrating should get logdirty and none of PG_external|PG_translate|PG_refcounts

OK, in that case I will squash PG_external as well.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#13 lore raw

Re: [PATCH RFC 2/2] x86/mm: PG_translate implies PG_refcounts

In reply to Wei Liu
Quoted 9 lines · Wei Liu
Quoted 8 lines · Tim Deegan
Quoted 6 lines · Wei Liu

After 404595352 ("x86/paging: Enforce PG_external == PG_translate == PG_refcounts"), PG_refcounts and PG_translate always need to be set together.

Squash PG_refcounts to simplify code. All calls paging_mode_refcounts are replaced by calls to paging_mode_translate.

Quoted 8 lines
Quoted 2 lines

Would it be a good idea to merge all three and have only PG_external?

My reverse-engineering is that when PV guest is migrated it has PG_external and (the new) PG_translate.

I would be happy to squash all three into one if you tell me I'm wrong. :-)

I _think_ you're wrong :) but can't check right now as I'm semi-offline. Migrating PV guests should have paging enabled but not any of external, translate or refcounts.

There was once code that used PG_translate with PV guests but never AFAIK checked in to upstream Xen. There was some talk of using that combination for PVH at one point but IIRC PVH now uses translate|refcounts|external like HVM.

Cheers,

Tim.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel