qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/1] Block patches
@ 2017-10-20 12:02 Stefan Hajnoczi
  2017-10-20 12:02 ` [Qemu-devel] [PULL 1/1] oslib-posix: Fix compiler warning and some data types Stefan Hajnoczi
  2017-10-20 16:36 ` [Qemu-devel] [PULL 0/1] Block patches Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2017-10-20 12:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 063833a6ec2a6747e27c5f9866bb44c7e8de1265:

  Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into staging (2017-10-19 18:42:51 +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 e947d47da0b16e80d237c510e9d2e80799578c7f:

  oslib-posix: Fix compiler warning and some data types (2017-10-20 11:16:27 +0200)

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

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

Stefan Weil (1):
  oslib-posix: Fix compiler warning and some data types

 util/oslib-posix.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

-- 
2.13.6

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

* [Qemu-devel] [PULL 1/1] oslib-posix: Fix compiler warning and some data types
  2017-10-20 12:02 [Qemu-devel] [PULL 0/1] Block patches Stefan Hajnoczi
@ 2017-10-20 12:02 ` Stefan Hajnoczi
  2017-10-20 16:36 ` [Qemu-devel] [PULL 0/1] Block patches Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2017-10-20 12:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Weil, Stefan Hajnoczi

From: Stefan Weil <sw@weilnetz.de>

gcc warning:

/qemu/util/oslib-posix.c:304:11: error:
 variable ‘addr’ might be clobbered by ‘longjmp’ or ‘vfork’
 [-Werror=clobbered]

Fix also some related data types:

numpages, hpagesize are used as pointer offset.
Always use size_t for them and also for the derived
numpages_per_thread and size_per_thread.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-id: 20171016202912.1117-1-sw@weilnetz.de
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 util/oslib-posix.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 80086c549f..382bd4a231 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -59,8 +59,8 @@
 
 struct MemsetThread {
     char *addr;
-    uint64_t numpages;
-    uint64_t hpagesize;
+    size_t numpages;
+    size_t hpagesize;
     QemuThread pgthread;
     sigjmp_buf env;
 };
@@ -301,11 +301,7 @@ static void sigbus_handler(int signal)
 static void *do_touch_pages(void *arg)
 {
     MemsetThread *memset_args = (MemsetThread *)arg;
-    char *addr = memset_args->addr;
-    uint64_t numpages = memset_args->numpages;
-    uint64_t hpagesize = memset_args->hpagesize;
     sigset_t set, oldset;
-    int i = 0;
 
     /* unblock SIGBUS */
     sigemptyset(&set);
@@ -315,6 +311,10 @@ static void *do_touch_pages(void *arg)
     if (sigsetjmp(memset_args->env, 1)) {
         memset_thread_failed = true;
     } else {
+        char *addr = memset_args->addr;
+        size_t numpages = memset_args->numpages;
+        size_t hpagesize = memset_args->hpagesize;
+        size_t i;
         for (i = 0; i < numpages; i++) {
             /*
              * Read & write back the same value, so we don't
@@ -351,7 +351,8 @@ static inline int get_memset_num_threads(int smp_cpus)
 static bool touch_all_pages(char *area, size_t hpagesize, size_t numpages,
                             int smp_cpus)
 {
-    uint64_t numpages_per_thread, size_per_thread;
+    size_t numpages_per_thread;
+    size_t size_per_thread;
     char *addr = area;
     int i = 0;
 
-- 
2.13.6

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

* Re: [Qemu-devel] [PULL 0/1] Block patches
  2017-10-20 12:02 [Qemu-devel] [PULL 0/1] Block patches Stefan Hajnoczi
  2017-10-20 12:02 ` [Qemu-devel] [PULL 1/1] oslib-posix: Fix compiler warning and some data types Stefan Hajnoczi
@ 2017-10-20 16:36 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2017-10-20 16:36 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 20 October 2017 at 13:02, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 063833a6ec2a6747e27c5f9866bb44c7e8de1265:
>
>   Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into staging (2017-10-19 18:42:51 +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 e947d47da0b16e80d237c510e9d2e80799578c7f:
>
>   oslib-posix: Fix compiler warning and some data types (2017-10-20 11:16:27 +0200)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------
>
> Stefan Weil (1):
>   oslib-posix: Fix compiler warning and some data types
>
>  util/oslib-posix.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2017-10-20 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-20 12:02 [Qemu-devel] [PULL 0/1] Block patches Stefan Hajnoczi
2017-10-20 12:02 ` [Qemu-devel] [PULL 1/1] oslib-posix: Fix compiler warning and some data types Stefan Hajnoczi
2017-10-20 16:36 ` [Qemu-devel] [PULL 0/1] Block patches Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).