Skip to contentSkip to conversation

Relax assertion in VRAM tracking code

PATCH In review Tim Deegan 2 participants 3 messages Nov 16, 2009 – Nov 23, 2009

lore
Share & tools
lore

Tim Deegan

author
#0 lore raw

PATCH 1/1 Relax assertion in VRAM tracking code

The original assertion is too strict, as it includes the A/D bits of the PTE, which (by design) can change under our feet.

xen/arch/x86/mm/shadow/multi.c +2 -1
diff -r 42e9682e4b61 xen/arch/x86/mm/shadow/multi.c
@@ -1117,7 +1117,8 @@
             }
             else
             {
-                ASSERT(dirty_vram->sl1ma[i] == sl1ma);
+                ASSERT((dirty_vram->sl1ma[i] & PAGE_MASK) 
+                       == (sl1ma & PAGE_MASK));
                 dirty_vram->sl1ma[i] = INVALID_PADDR;
                 if ( flags & _PAGE_DIRTY )
                     dirty = 1;

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

#1 lore raw
Quoted 5 lines
Quoted 1 line
Quoted 1 line

Tim Deegan <[email protected]> 16.11.09 18:00 >>>

The original assertion is too strict, as it includes the A/D bits of the PTE, which (by design) can change under our feet.

Wouldn't the comparison a few lines down from the ASSERT() thus fixed also benefit from a similar adjustment?

Jan

author
#2 lore raw
Quoted 8 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line

Tim Deegan <[email protected]> 16.11.09 18:00 >>>

The original assertion is too strict, as it includes the A/D bits of the PTE, which (by design) can change under our feet.

Wouldn't the comparison a few lines down from the ASSERT() thus fixed also benefit from a similar adjustment?

Actually, on closer inspection my original fix was wrong; the bottom 12 bits of sl1ma are taken from the _pointer_ to the sl1e, not the contents, so the assertion is plausible.

Keir, can you please revert it?

Tim.

Signature · 3 lines
Tim Deegan <[email protected]>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]