All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for-2.9 0/1] Block patches
@ 2017-03-15  5:06 Stefan Hajnoczi
  2017-03-15  5:06 ` [Qemu-devel] [PULL for-2.9 1/1] os: don't corrupt pre-existing memory-backend data with prealloc Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2017-03-15  5:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit d84f714eafedd8bb9d4aaec8b76417bef8e3535e:

  Update version for v2.9.0-rc0 release (2017-03-14 19:18:23 +0000)

are available in the git repository at:

  git://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to 9dc44aa5829eb3131a01378a738dee28a382bbc1:

  os: don't corrupt pre-existing memory-backend data with prealloc (2017-03-15 11:55:41 +0800)

----------------------------------------------------------------

----------------------------------------------------------------

Daniel P. Berrange (1):
  os: don't corrupt pre-existing memory-backend data with prealloc

 util/oslib-posix.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PULL for-2.9 1/1] os: don't corrupt pre-existing memory-backend data with prealloc
  2017-03-15  5:06 [Qemu-devel] [PULL for-2.9 0/1] Block patches Stefan Hajnoczi
@ 2017-03-15  5:06 ` Stefan Hajnoczi
  2017-03-15  5:10 ` [Qemu-devel] [PULL for-2.9 0/1] Block patches no-reply
  2017-03-15 17:54 ` Peter Maydell
  2 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2017-03-15  5:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Daniel P. Berrange, Stefan Hajnoczi

From: "Daniel P. Berrange" <berrange@redhat.com>

When using a memory-backend object with prealloc turned on, QEMU
will memset() the first byte in every memory page to zero. While
this might have been acceptable for memory backends associated
with RAM, this corrupts application data for NVDIMMs.

Instead of setting every page to zero, read the current byte
value and then just write that same value back, so we are not
corrupting the original data. Directly write the value instead
of memset()ing it, since there's no benefit to memset for a
single byte write.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Andrea Arcangeli <aarcange@redhat.com>
Message-id: 20170303113255.28262-1-berrange@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 util/oslib-posix.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 956f66a..94d81b9 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -361,7 +361,19 @@ static void *do_touch_pages(void *arg)
         memset_thread_failed = true;
     } else {
         for (i = 0; i < numpages; i++) {
-            memset(addr, 0, 1);
+            /*
+             * Read & write back the same value, so we don't
+             * corrupt existing user/app data that might be
+             * stored.
+             *
+             * 'volatile' to stop compiler optimizing this away
+             * to a no-op
+             *
+             * TODO: get a better solution from kernel so we
+             * don't need to write at all so we don't cause
+             * wear on the storage backing the region...
+             */
+            *(volatile char *)addr = *addr;
             addr += hpagesize;
         }
     }
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PULL for-2.9 0/1] Block patches
  2017-03-15  5:06 [Qemu-devel] [PULL for-2.9 0/1] Block patches Stefan Hajnoczi
  2017-03-15  5:06 ` [Qemu-devel] [PULL for-2.9 1/1] os: don't corrupt pre-existing memory-backend data with prealloc Stefan Hajnoczi
@ 2017-03-15  5:10 ` no-reply
  2017-03-15 17:54 ` Peter Maydell
  2 siblings, 0 replies; 8+ messages in thread
From: no-reply @ 2017-03-15  5:10 UTC (permalink / raw)
  To: stefanha; +Cc: famz, qemu-devel, peter.maydell

Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Subject: [Qemu-devel] [PULL for-2.9 0/1] Block patches
Message-id: 20170315050602.7750-1-stefanha@redhat.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20170315050602.7750-1-stefanha@redhat.com -> patchew/20170315050602.7750-1-stefanha@redhat.com
Switched to a new branch 'test'
1562711 os: don't corrupt pre-existing memory-backend data with prealloc

=== OUTPUT BEGIN ===
Checking PATCH 1/1: os: don't corrupt pre-existing memory-backend data with prealloc...
ERROR: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt
#45: FILE: util/oslib-posix.c:376:
+            *(volatile char *)addr = *addr;

total: 1 errors, 0 warnings, 20 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PULL for-2.9 0/1] Block patches
  2017-03-15  5:06 [Qemu-devel] [PULL for-2.9 0/1] Block patches Stefan Hajnoczi
  2017-03-15  5:06 ` [Qemu-devel] [PULL for-2.9 1/1] os: don't corrupt pre-existing memory-backend data with prealloc Stefan Hajnoczi
  2017-03-15  5:10 ` [Qemu-devel] [PULL for-2.9 0/1] Block patches no-reply
@ 2017-03-15 17:54 ` Peter Maydell
  2 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2017-03-15 17:54 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 15 March 2017 at 05:06, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit d84f714eafedd8bb9d4aaec8b76417bef8e3535e:
>
>   Update version for v2.9.0-rc0 release (2017-03-14 19:18:23 +0000)
>
> are available in the git repository at:
>
>   git://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to 9dc44aa5829eb3131a01378a738dee28a382bbc1:
>
>   os: don't corrupt pre-existing memory-backend data with prealloc (2017-03-15 11:55:41 +0800)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------
>
> Daniel P. Berrange (1):
>   os: don't corrupt pre-existing memory-backend data with prealloc
>
>  util/oslib-posix.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PULL for-2.9 0/1] Block patches
  2017-03-28 10:07 Stefan Hajnoczi
@ 2017-03-28 10:41 ` Peter Maydell
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2017-03-28 10:41 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 28 March 2017 at 11:07, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit eb06c9e2d3c8f026a206e8402b0ffa201060ec8e:
>
>   Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-03-27 17:34:50 +0100)
>
> are available in the git repository at:
>
>   git://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to dc62da88b5d17477227a3563a6ad466129d416d6:
>
>   parallels: wrong call to bdrv_truncate (2017-03-28 11:06:00 +0100)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------
>
> Denis V. Lunev (1):
>   parallels: wrong call to bdrv_truncate
>
>  block/parallels.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PULL for-2.9 0/1] Block patches
@ 2017-03-28 10:07 Stefan Hajnoczi
  2017-03-28 10:41 ` Peter Maydell
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Hajnoczi @ 2017-03-28 10:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit eb06c9e2d3c8f026a206e8402b0ffa201060ec8e:

  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-03-27 17:34:50 +0100)

are available in the git repository at:

  git://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to dc62da88b5d17477227a3563a6ad466129d416d6:

  parallels: wrong call to bdrv_truncate (2017-03-28 11:06:00 +0100)

----------------------------------------------------------------

----------------------------------------------------------------

Denis V. Lunev (1):
  parallels: wrong call to bdrv_truncate

 block/parallels.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [PULL for-2.9 0/1] Block patches
  2017-03-22 12:54 Stefan Hajnoczi
@ 2017-03-23 11:04 ` Peter Maydell
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2017-03-23 11:04 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 22 March 2017 at 12:54, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 940a8ce075e3408742a4edcabfd6c2a15e2539eb:
>
>   Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-03-20 16:34:26 +0000)
>
> are available in the git repository at:
>
>   git://github.com/stefanha/qemu.git tags/block-pull-request
>
> for you to fetch changes up to ff5bbe56c6f9a74c2d77389a21d5d2368458c939:
>
>   parallels: fix default options parsing (2017-03-21 10:02:36 +0000)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------
>
> Edgar Kaziahmedov (1):
>   parallels: fix default options parsing
>
>  block/parallels.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [PULL for-2.9 0/1] Block patches
@ 2017-03-22 12:54 Stefan Hajnoczi
  2017-03-23 11:04 ` Peter Maydell
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Hajnoczi @ 2017-03-22 12:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 940a8ce075e3408742a4edcabfd6c2a15e2539eb:

  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2017-03-20 16:34:26 +0000)

are available in the git repository at:

  git://github.com/stefanha/qemu.git tags/block-pull-request

for you to fetch changes up to ff5bbe56c6f9a74c2d77389a21d5d2368458c939:

  parallels: fix default options parsing (2017-03-21 10:02:36 +0000)

----------------------------------------------------------------

----------------------------------------------------------------

Edgar Kaziahmedov (1):
  parallels: fix default options parsing

 block/parallels.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-03-28 10:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15  5:06 [Qemu-devel] [PULL for-2.9 0/1] Block patches Stefan Hajnoczi
2017-03-15  5:06 ` [Qemu-devel] [PULL for-2.9 1/1] os: don't corrupt pre-existing memory-backend data with prealloc Stefan Hajnoczi
2017-03-15  5:10 ` [Qemu-devel] [PULL for-2.9 0/1] Block patches no-reply
2017-03-15 17:54 ` Peter Maydell
2017-03-22 12:54 Stefan Hajnoczi
2017-03-23 11:04 ` Peter Maydell
2017-03-28 10:07 Stefan Hajnoczi
2017-03-28 10:41 ` Peter Maydell

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.