Skip to contentSkip to conversation

x86/mm: don't crash on unknown memory types in page_get_ram_type

PATCH In review Roger Pau Monne 2 participants 3 messages Sep 21, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mm: don't crash on unknown memory types in page_get_ram_type

Instead return RAM_TYPE_UNKNOWN.

---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Razvan Cojocaru <[email protected]>

---
 xen/arch/x86/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/mm.c +1 -1
index 955ff0bd78..7373f4167a 100644
@@ -465,7 +465,7 @@ unsigned int page_get_ram_type(mfn_t mfn)
             break;
 
         default:
-            ASSERT_UNREACHABLE();
+            type |= RAM_TYPE_UNKNOWN;
         }
     }
 
Signature · 7 lines
2.19.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw

xen/arch/x86/mm.c unsigned int page_get_ram_type(mfn_t mfn) · line 470

Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 21.09.18 at 12:59, <[email protected]> wrote:
xen/arch/x86/mm.c +1 -1
@@ -465,7 +465,7 @@ unsigned int page_get_ram_type(mfn_t mfn)
             break;
 
         default:
-            ASSERT_UNREACHABLE();
+            type |= RAM_TYPE_UNKNOWN;
         }
     }

The latest now there should be a "break". I'm happy to add that while committing; with it

Jan

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

#2 lore raw
Quoted 14 lines · Jan Beulich

xen/arch/x86/mm.c unsigned int page_get_ram_type(mfn_t mfn) · line 470

Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 21.09.18 at 12:59, <[email protected]> wrote:
xen/arch/x86/mm.c +1 -1
@@ -465,7 +465,7 @@ unsigned int page_get_ram_type(mfn_t mfn)
             break;
 
         default:
-            ASSERT_UNREACHABLE();
+            type |= RAM_TYPE_UNKNOWN;
         }
     }

The latest now there should be a "break". I'm happy to add that while committing; with it

Quoted 1 line

Sure, thanks.

Roger.

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