cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From c097095019b643c2212037eb98c150650931284e Mon Sep 17 00:00:00 2001
9ae3a8
From: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Date: Tue, 11 Feb 2014 14:03:47 +0100
9ae3a8
Subject: [PATCH 11/28] pc: Save size of RAM below 4GB
9ae3a8
9ae3a8
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Message-id: <1392127428-9286-2-git-send-email-ehabkost@redhat.com>
9ae3a8
Patchwork-id: 57204
9ae3a8
O-Subject: [PATCH 1/2] pc: Save size of RAM below 4GB
9ae3a8
Bugzilla: 1048080
9ae3a8
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
9ae3a8
Bugzilla: 1048080
9ae3a8
Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7027865
9ae3a8
9ae3a8
The ram_below_4g value will be useful in other places, such as the ACPI
9ae3a8
table code, and other code that currently requires passing
9ae3a8
below_4g_mem_size around in function arguments.
9ae3a8
9ae3a8
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9ae3a8
(cherry picked from commit f30ee8a9682be4abfcb05c6389894f8cfc35c3f0)
9ae3a8
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/pc.c         | 1 +
9ae3a8
 include/hw/i386/pc.h | 2 +-
9ae3a8
 2 files changed, 2 insertions(+), 1 deletion(-)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/pc.c         |    1 +
9ae3a8
 include/hw/i386/pc.h |    2 +-
9ae3a8
 2 files changed, 2 insertions(+), 1 deletions(-)
9ae3a8
9ae3a8
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
9ae3a8
index a0f0b24..1468d50 100644
9ae3a8
--- a/hw/i386/pc.c
9ae3a8
+++ b/hw/i386/pc.c
9ae3a8
@@ -1046,6 +1046,7 @@ PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size,
9ae3a8
     PcGuestInfo *guest_info = &guest_info_state->info;
9ae3a8
     int i, j;
9ae3a8
 
9ae3a8
+    guest_info->ram_size_below_4g = below_4g_mem_size;
9ae3a8
     guest_info->ram_size = below_4g_mem_size + above_4g_mem_size;
9ae3a8
     guest_info->apic_id_limit = pc_apic_id_limit(max_cpus);
9ae3a8
     guest_info->apic_xrupt_override = kvm_allows_irq0_override();
9ae3a8
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
9ae3a8
index 413358f..f56e9ea 100644
9ae3a8
--- a/include/hw/i386/pc.h
9ae3a8
+++ b/include/hw/i386/pc.h
9ae3a8
@@ -35,7 +35,7 @@ typedef struct PcPciInfo {
9ae3a8
 struct PcGuestInfo {
9ae3a8
     bool has_pci_info;
9ae3a8
     bool isapc_ram_fw;
9ae3a8
-    hwaddr ram_size;
9ae3a8
+    hwaddr ram_size, ram_size_below_4g;
9ae3a8
     unsigned apic_id_limit;
9ae3a8
     bool apic_xrupt_override;
9ae3a8
     uint64_t numa_nodes;
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8