Skip to contentSkip to conversation

x86/mm/shadow: spurious warning when unmapping xenheap pages.

PATCH In review Tim Deegan 3 participants 7 messages Mar 28, 2013 – Apr 5, 2013

lore
Share & tools
lore

Tim Deegan

author
#0 lore raw

PATCH 1/1 x86/mm/shadow: spurious warning when unmapping xenheap pages.

Xenheap pages will always have an extra typecount, taken in share_xen_page_with_guest(), which doesn't come from a shadow PTE. Adjust the warning in sh_remove_all_mappings() to account for it.

---
 xen/arch/x86/mm/shadow/common.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
xen/arch/x86/mm/shadow/common.c +5 -2
index 4b576ac..adffa06 100644
@@ -2437,10 +2437,13 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
     {
         /* Don't complain if we're in HVM and there are some extra mappings: 
          * The qemu helper process has an untyped mapping of this dom's RAM 
-         * and the HVM restore program takes another. */
+         * and the HVM restore program takes another.
+         * Also allow one typed refcount for xenheap pages, to match
+         * share_xen_page_with_guest(). */
         if ( !(shadow_mode_external(v->domain)
                && (page->count_info & PGC_count_mask) <= 3
-               && (page->u.inuse.type_info & PGT_count_mask) == 0) )
+               && ((page->u.inuse.type_info & PGT_count_mask)
+                   == !!is_xen_heap_page(page))) )
         {
             SHADOW_ERROR("can't find all mappings of mfn %lx: "
                           "c=%08lx t=%08lx\n", mfn_x(gmfn), 
Signature · 1 line
1.7.10.4
Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · Tim Deegan

Xenheap pages will always have an extra typecount, taken in share_xen_page_with_guest(), which doesn't come from a shadow PTE. Adjust the warning in sh_remove_all_mappings() to account for it.

Quoted 24 lines
---
 xen/arch/x86/mm/shadow/common.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
xen/arch/x86/mm/shadow/common.c +5 -2
index 4b576ac..adffa06 100644
@@ -2437,10 +2437,13 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
     {
         /* Don't complain if we're in HVM and there are some extra mappings: 
          * The qemu helper process has an untyped mapping of this dom's RAM 
-         * and the HVM restore program takes another. */
+         * and the HVM restore program takes another.
+         * Also allow one typed refcount for xenheap pages, to match
+         * share_xen_page_with_guest(). */
         if ( !(shadow_mode_external(v->domain)
                && (page->count_info & PGC_count_mask) <= 3
-               && (page->u.inuse.type_info & PGT_count_mask) == 0) )
+               && ((page->u.inuse.type_info & PGT_count_mask)
+                   == !!is_xen_heap_page(page))) )
         {
             SHADOW_ERROR("can't find all mappings of mfn %lx: "
                           "c=%08lx t=%08lx\n", mfn_x(gmfn), 
author
#3 lore raw
Quoted 9 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · Tim Deegan

Xenheap pages will always have an extra typecount, taken in share_xen_page_with_guest(), which doesn't come from a shadow PTE. Adjust the warning in sh_remove_all_mappings() to account for it.

I suppose this ought to go into 4.2.2 and 4.1.5 as well?

Could do -- it's just suppressing a printk, so not a particularly urgent fix AFAICT.

Tim.

#4 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line · Tim Deegan
Quoted 5 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · Tim Deegan

Xenheap pages will always have an extra typecount, taken in share_xen_page_with_guest(), which doesn't come from a shadow PTE. Adjust the warning in sh_remove_all_mappings() to account for it.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

I suppose this ought to go into 4.2.2 and 4.1.5 as well?

Could do -- it's just suppressing a printk, so not a particularly urgent fix AFAICT.

But the message, if present when inspecting some random log, looks worrying, so getting rid of the false positive is likely going to help assessing the health of systems/guests.

Jan

author
#5 lore raw
Quoted 10 lines · Jan Beulich
Quoted 10 lines
Quoted 1 line
Quoted 1 line · Tim Deegan
Quoted 8 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · Tim Deegan

Xenheap pages will always have an extra typecount, taken in share_xen_page_with_guest(), which doesn't come from a shadow PTE. Adjust the warning in sh_remove_all_mappings() to account for it.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I suppose this ought to go into 4.2.2 and 4.1.5 as well?

Could do -- it's just suppressing a printk, so not a particularly urgent fix AFAICT.

But the message, if present when inspecting some random log, looks worrying, so getting rid of the false positive is likely going to help assessing the health of systems/guests.

Sure. In any case the patch is harmless, so there should be no risk to putting it in.

Tim.

#6 lore raw
Quoted 13 lines · Tim Deegan
Quoted 12 lines · Jan Beulich
Quoted 12 lines
Quoted 1 line
Quoted 1 line · Tim Deegan
Quoted 8 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · Tim Deegan

Xenheap pages will always have an extra typecount, taken in share_xen_page_with_guest(), which doesn't come from a shadow PTE. Adjust the warning in sh_remove_all_mappings() to account for it.

I suppose this ought to go into 4.2.2 and 4.1.5 as well?

Could do -- it's just suppressing a printk, so not a particularly urgent fix AFAICT.

Quoted 7 lines
Quoted 3 lines

But the message, if present when inspecting some random log, looks worrying, so getting rid of the false positive is likely going to help assessing the health of systems/guests.

Sure. In any case the patch is harmless, so there should be no risk to putting it in.

Tim.

The reason I started debugging it was because it is an scary message for what turns out to be a safe action.

So please backport :)

~Andrew

Quoted 5 lines

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