All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Juan Quintela <quintela@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	peterx@redhat.com
Subject: [Qemu-devel] [PATCH for-3.0 3/4] tests: only update last_byte when at the edge
Date: Mon, 23 Jul 2018 20:33:04 +0800	[thread overview]
Message-ID: <20180723123305.24792-4-peterx@redhat.com> (raw)
In-Reply-To: <20180723123305.24792-1-peterx@redhat.com>

The only possible change of last_byte is when it reaches the edge.
Setting it every time might let last_byte contain an invalid data when
memory corruption is detected, then the check of the next byte will be
incorrect.  For example, a single page corruption at address 0x14ad000
will also lead to a "fake" corruption at 0x14ae000:

  Memory content inconsistency at 14ad000 first_byte = 44 last_byte = 44 current = ef hit_edge = 0
  Memory content inconsistency at 14ae000 first_byte = 44 last_byte = ef current = 44 hit_edge = 0

After the patch, it'll only report the corrputed page:

  Memory content inconsistency at 14ad000 first_byte = 44 last_byte = 44 current = ef hit_edge = 0

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 tests/migration-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/migration-test.c b/tests/migration-test.c
index 086f727b34..e079e0bdb6 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -300,6 +300,7 @@ static void check_guests_ram(QTestState *who)
                  * to us yet.
                  */
                 hit_edge = true;
+                last_byte = b;
             } else {
                 fprintf(stderr, "Memory content inconsistency at %x"
                                 " first_byte = %x last_byte = %x current = %x"
@@ -308,7 +309,6 @@ static void check_guests_ram(QTestState *who)
                 bad = true;
             }
         }
-        last_byte = b;
     }
     g_assert_false(bad);
 }
-- 
2.17.1

  parent reply	other threads:[~2018-07-23 12:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 12:33 [Qemu-devel] [PATCH for-3.0 0/4] migration: some fixes for release-ram Peter Xu
2018-07-23 12:33 ` [Qemu-devel] [PATCH for-3.0 1/4] migration: update recv bitmap only on dest vm Peter Xu
2018-07-24  9:20   ` Juan Quintela
2018-07-23 12:33 ` [Qemu-devel] [PATCH for-3.0 2/4] migration: disallow recovery for release-ram Peter Xu
2018-07-24  9:21   ` Juan Quintela
2018-07-24 11:39     ` Peter Xu
2018-07-23 12:33 ` Peter Xu [this message]
2018-07-24  9:23   ` [Qemu-devel] [PATCH for-3.0 3/4] tests: only update last_byte when at the edge Juan Quintela
2018-07-23 12:33 ` [Qemu-devel] [PATCH for-3.0 4/4] tests: torture release-ram in postcopy test Peter Xu
2018-07-24  9:25   ` Juan Quintela
2018-07-24 11:36     ` Peter Xu
2018-07-24 11:42       ` Dr. David Alan Gilbert
2018-07-24 11:52         ` Peter Xu
2018-07-24 16:22 ` [Qemu-devel] [PATCH for-3.0 0/4] migration: some fixes for release-ram Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180723123305.24792-4-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.