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

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