Skip to contentSkip to conversation

Small fix for shadow_remove_all_access_in_page

PATCH In review Michael Vrable 2 participants 2 messages Sep 13, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Small fix for shadow_remove_all_access_in_page

Here's a fairly simple patch to correct a bug I hit when experimenting with VM forking earlier. Let me know if there's anything wrong with the changeset; this is the first time I've tried exporting a changeset from Mercurial.

--Michael Vrable

# HG changeset patch
# User Michael Vrable <[email protected]> # Node ID df9609e384a4a819a69d01556b8231b842b04050 # Parent d8637529dafff3c610e4bb31349d4ae00a23a18e Fix a bug in shadow_remove_all_access_in_page.

Fixes a fairly obvious bug, in which an if statement was reversed. The bug has been present for a while, so apparently this code isn't well tested.

xen/arch/x86/shadow32.c +1 -1
diff -r d8637529daff -r df9609e384a4 xen/arch/x86/shadow32.c
@@ -2226,7 +2226,7 @@
     
     for (i = 0; i < L1_PAGETABLE_ENTRIES; i++)
     {
-        if ( unlikely(!l1e_has_changed(pl1e[i], match, flags) == 0) )
+        if ( unlikely(!l1e_has_changed(pl1e[i], match, flags)) )
         {
             l1_pgentry_t ol2e = pl1e[i];
             pl1e[i] = l1e_empty();
xen/arch/x86/shadow_public.c +1 -1
diff -r d8637529daff -r df9609e384a4 xen/arch/x86/shadow_public.c
@@ -1634,7 +1634,7 @@
 
     for (i = 0; i < L1_PAGETABLE_ENTRIES; i++)
     {
-        if ( unlikely(!l1e_has_changed(pl1e[i], match, flags) == 0) )
+        if ( unlikely(!l1e_has_changed(pl1e[i], match, flags)) )
         {
             l1_pgentry_t ol2e = pl1e[i];
             pl1e[i] = l1e_empty();
#1 lore raw
Quoted 4 lines · Michael Vrable

Here's a fairly simple patch to correct a bug I hit when experimenting with VM forking earlier. Let me know if there's anything wrong with the changeset; this is the first time I've tried exporting a changeset from Mercurial.

Thanks. An embarrassing bug for whoever it was committed that code!

-- Keir