thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
Blob Blame History Raw
From c097095019b643c2212037eb98c150650931284e Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Tue, 11 Feb 2014 14:03:47 +0100
Subject: [PATCH 11/28] pc: Save size of RAM below 4GB

RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <1392127428-9286-2-git-send-email-ehabkost@redhat.com>
Patchwork-id: 57204
O-Subject: [PATCH 1/2] pc: Save size of RAM below 4GB
Bugzilla: 1048080
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>

Bugzilla: 1048080
Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7027865

The ram_below_4g value will be useful in other places, such as the ACPI
table code, and other code that currently requires passing
below_4g_mem_size around in function arguments.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit f30ee8a9682be4abfcb05c6389894f8cfc35c3f0)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc.c         | 1 +
 include/hw/i386/pc.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 hw/i386/pc.c         |    1 +
 include/hw/i386/pc.h |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index a0f0b24..1468d50 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1046,6 +1046,7 @@ PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size,
     PcGuestInfo *guest_info = &guest_info_state->info;
     int i, j;
 
+    guest_info->ram_size_below_4g = below_4g_mem_size;
     guest_info->ram_size = below_4g_mem_size + above_4g_mem_size;
     guest_info->apic_id_limit = pc_apic_id_limit(max_cpus);
     guest_info->apic_xrupt_override = kvm_allows_irq0_override();
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 413358f..f56e9ea 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -35,7 +35,7 @@ typedef struct PcPciInfo {
 struct PcGuestInfo {
     bool has_pci_info;
     bool isapc_ram_fw;
-    hwaddr ram_size;
+    hwaddr ram_size, ram_size_below_4g;
     unsigned apic_id_limit;
     bool apic_xrupt_override;
     uint64_t numa_nodes;
-- 
1.7.1