Blame SOURCES/kvm-exec-Fix-prototype-of-phys_mem_set_alloc-and-related.patch

0a122b
From 394423ac51f2b4f551bece834aa9c8586dc0a984 Mon Sep 17 00:00:00 2001
0a122b
Message-Id: <394423ac51f2b4f551bece834aa9c8586dc0a984.1387298827.git.minovotn@redhat.com>
0a122b
In-Reply-To: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
0a122b
References: <3ed0fb61a3dc912ef036d7ef450bed192090709e.1387298827.git.minovotn@redhat.com>
0a122b
From: "Michael S. Tsirkin" <mst@redhat.com>
0a122b
Date: Tue, 17 Dec 2013 15:19:29 +0100
0a122b
Subject: [PATCH 56/56] exec: Fix prototype of phys_mem_set_alloc and related
0a122b
 functions
0a122b
0a122b
RH-Author: Michael S. Tsirkin <mst@redhat.com>
0a122b
Message-id: <1387293161-4085-57-git-send-email-mst@redhat.com>
0a122b
Patchwork-id: 56362
0a122b
O-Subject: [PATCH qemu-kvm RHEL7.0 v2 56/57] exec: Fix prototype of phys_mem_set_alloc and related functions
0a122b
Bugzilla: 1034876
0a122b
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
0a122b
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
0a122b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
0a122b
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
0a122b
0a122b
From: Stefan Weil <sw@weilnetz.de>
0a122b
0a122b
phys_mem_alloc and its assigned values qemu_anon_ram_alloc and
0a122b
legacy_s390_alloc must have identical argument lists.
0a122b
0a122b
legacy_s390_alloc uses the size parameter to call mmap, so size_t is
0a122b
good enough for all of them.
0a122b
0a122b
This patch fixes compiler errors on i686 Linux hosts:
0a122b
0a122b
  CC    alpha-softmmu/exec.o
0a122b
exec.c:752:51: error:
0a122b
 initialization from incompatible pointer type [-Werror]
0a122b
exec.c: In function 'qemu_ram_alloc_from_ptr':
0a122b
exec.c:1139:32: error:
0a122b
 comparison of distinct pointer types lacks a cast [-Werror]
0a122b
exec.c: In function 'qemu_ram_remap':
0a122b
exec.c:1283:21: error:
0a122b
 comparison of distinct pointer types lacks a cast [-Werror]
0a122b
0a122b
Signed-off-by: Stefan Weil <sw@weilnetz.de>
0a122b
Reviewed-by: Markus Armbruster <armbru@redhat.com>
0a122b
Message-id: 1380481005-32399-1-git-send-email-sw@weilnetz.de
0a122b
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
0a122b
(cherry picked from commit 575ddeb459f622a114cbfe37d220c0519ec9c2a4)
0a122b
0a122b
Note: not directly related to this change, and we don't have
0a122b
to support building on i686.
0a122b
However this is gratitious and ugly difference from upstream,
0a122b
and some machines I use to test ACPI are i686, so including
0a122b
this here was required for testing.
0a122b
---
0a122b
 include/exec/exec-all.h | 2 +-
0a122b
 exec.c                  | 4 ++--
0a122b
 target-s390x/kvm.c      | 4 ++--
0a122b
 3 files changed, 5 insertions(+), 5 deletions(-)
0a122b
0a122b
Signed-off-by: Michal Novotny <minovotn@redhat.com>
0a122b
---
0a122b
 exec.c                  | 4 ++--
0a122b
 include/exec/exec-all.h | 2 +-
0a122b
 target-s390x/kvm.c      | 4 ++--
0a122b
 3 files changed, 5 insertions(+), 5 deletions(-)
0a122b
0a122b
diff --git a/exec.c b/exec.c
0a122b
index 9117a59..cb11571 100644
0a122b
--- a/exec.c
0a122b
+++ b/exec.c
0a122b
@@ -680,14 +680,14 @@ static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,
0a122b
                              uint16_t section);
0a122b
 static subpage_t *subpage_init(hwaddr base);
0a122b
 
0a122b
-static void *(*phys_mem_alloc)(ram_addr_t size) = qemu_anon_ram_alloc;
0a122b
+static void *(*phys_mem_alloc)(size_t size) = qemu_anon_ram_alloc;
0a122b
 
0a122b
 /*
0a122b
  * Set a custom physical guest memory alloator.
0a122b
  * Accelerators with unusual needs may need this.  Hopefully, we can
0a122b
  * get rid of it eventually.
0a122b
  */
0a122b
-void phys_mem_set_alloc(void *(*alloc)(ram_addr_t))
0a122b
+void phys_mem_set_alloc(void *(*alloc)(size_t))
0a122b
 {
0a122b
     phys_mem_alloc = alloc;
0a122b
 }
0a122b
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
0a122b
index 993c655..3fddc3b 100644
0a122b
--- a/include/exec/exec-all.h
0a122b
+++ b/include/exec/exec-all.h
0a122b
@@ -366,7 +366,7 @@ bool is_tcg_gen_code(uintptr_t pc_ptr);
0a122b
 
0a122b
 #if !defined(CONFIG_USER_ONLY)
0a122b
 
0a122b
-void phys_mem_set_alloc(void *(*alloc)(ram_addr_t));
0a122b
+void phys_mem_set_alloc(void *(*alloc)(size_t));
0a122b
 
0a122b
 struct MemoryRegion *iotlb_to_region(hwaddr index);
0a122b
 uint64_t io_mem_read(struct MemoryRegion *mr, hwaddr addr,
0a122b
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
0a122b
index a106e62..3fd8be5 100644
0a122b
--- a/target-s390x/kvm.c
0a122b
+++ b/target-s390x/kvm.c
0a122b
@@ -92,7 +92,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
0a122b
 
0a122b
 static int cap_sync_regs;
0a122b
 
0a122b
-static void *legacy_s390_alloc(ram_addr_t size);
0a122b
+static void *legacy_s390_alloc(size_t size);
0a122b
 
0a122b
 int kvm_arch_init(KVMState *s)
0a122b
 {
0a122b
@@ -324,7 +324,7 @@ int kvm_s390_get_registers_partial(CPUState *cs)
0a122b
  * to grow. We also have to use MAP parameters that avoid
0a122b
  * read-only mapping of guest pages.
0a122b
  */
0a122b
-static void *legacy_s390_alloc(ram_addr_t size)
0a122b
+static void *legacy_s390_alloc(size_t size)
0a122b
 {
0a122b
     void *mem;
0a122b
 
0a122b
-- 
0a122b
1.7.11.7
0a122b