[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 24/39] pc: Move gigabyte_align to PCMachineClass
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [RFC v2 24/39] pc: Move gigabyte_align to PCMachineClass |
Date: |
Fri, 13 Jun 2014 16:44:03 -0300 |
Signed-off-by: Eduardo Habkost <address@hidden>
---
hw/i386/pc.c | 1 +
hw/i386/pc_piix.c | 9 ++-------
hw/i386/pc_q35.c | 9 ++-------
include/hw/i386/pc.h | 5 +++++
4 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 874c342..5c6304b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1619,6 +1619,7 @@ static void pc_machine_class_init(ObjectClass *oc, void
*data)
pcmc->kvmclock_enabled = true;
pcmc->smbios_defaults = true;
pcmc->has_acpi_build = true;
+ pcmc->gigabyte_align = true;
mc->get_hotplug_handler = pc_get_hotpug_handler;
mc->default_boot_order = "cad";
mc->hot_add_cpu = pc_hot_add_cpu;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 769982d..98812d4 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -58,11 +58,6 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 };
static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 };
static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
-/* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
- * host addresses aligned at 1Gbyte boundaries. This way we can use 1GByte
- * pages in the host.
- */
-static bool gigabyte_align = true;
static bool has_reserved_memory = true;
/* PC hardware initialisation */
@@ -119,7 +114,7 @@ static void pc_init1(MachineState *machine)
* breaking migration.
*/
if (machine->ram_size >= 0xe0000000) {
- ram_addr_t lowmem = gigabyte_align ? 0xc0000000 : 0xe0000000;
+ ram_addr_t lowmem = pcmc->gigabyte_align ? 0xc0000000 : 0xe0000000;
above_4g_mem_size = machine->ram_size - lowmem;
below_4g_mem_size = lowmem;
} else {
@@ -281,7 +276,6 @@ static void pc_compat_2_0(MachineState *machine)
static void pc_compat_1_7(MachineState *machine)
{
pc_compat_2_0(machine);
- gigabyte_align = false;
option_rom_has_mr = true;
x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
}
@@ -463,6 +457,7 @@ static void pc_i440fx_machine_v1_7_class_init(ObjectClass
*oc, void *data)
mc->name = "pc-i440fx-1.7";
machine_class_add_compat_props(mc, compat_props);
pcmc->smbios_defaults = false;
+ pcmc->gigabyte_align = false;
}
static TypeInfo pc_i440fx_machine_v1_7_type_info = {
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index c8164d7..ddaeeb5 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -48,11 +48,6 @@
/* ICH9 AHCI has 6 ports */
#define MAX_SATA_PORTS 6
-/* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
- * host addresses aligned at 1Gbyte boundaries. This way we can use 1GByte
- * pages in the host.
- */
-static bool gigabyte_align = true;
static bool has_reserved_memory = true;
/* PC hardware initialisation */
@@ -107,7 +102,7 @@ static void pc_q35_init(MachineState *machine)
* breaking migration.
*/
if (machine->ram_size >= 0xb0000000) {
- ram_addr_t lowmem = gigabyte_align ? 0x80000000 : 0xb0000000;
+ ram_addr_t lowmem = pcmc->gigabyte_align ? 0x80000000 : 0xb0000000;
above_4g_mem_size = machine->ram_size - lowmem;
below_4g_mem_size = lowmem;
} else {
@@ -259,7 +254,6 @@ static void pc_compat_2_0(MachineState *machine)
static void pc_compat_1_7(MachineState *machine)
{
pc_compat_2_0(machine);
- gigabyte_align = false;
option_rom_has_mr = true;
x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC);
}
@@ -381,6 +375,7 @@ static void pc_q35_machine_v1_7_class_init(ObjectClass *oc,
void *data)
machine_class_add_compat_props(mc, compat_props);
mc->name = "pc-q35-1.7";
pcmc->smbios_defaults = false;
+ pcmc->gigabyte_align = false;
}
static TypeInfo pc_q35_machine_v1_7_type_info = {
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 37d91b2..ee97059 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -55,6 +55,11 @@ struct PCMachineClass {
bool smbios_defaults;
bool has_acpi_build;
bool has_pci_info;
+ /* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped
to
+ * host addresses aligned at 1Gbyte boundaries. This way we can use 1GByte
+ * pages in the host.
+ */
+ bool gigabyte_align;
};
typedef struct PCMachineState PCMachineState;
--
1.9.0
- [Qemu-devel] [RFC v2 09/39] pc: Eliminate pc_common_machine_options(), (continued)
- [Qemu-devel] [RFC v2 09/39] pc: Eliminate pc_common_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 11/39] piix: Eliminate pc_i440fx_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 13/39] q35: Eliminate pc_q35_1_4_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 12/39] q35: Eliminate pc_q35_machine_options(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 14/39] pc: Eliminate *machine_options macros, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 15/39] piix: Make all *machine_options() functions call the previous one, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 16/39] pc: Eliminate all *_machine_options() functions, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 21/39] pc: Move smbios_defaults to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 22/39] pc: Move has_acpi_build to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 23/39] pc: Move has_pci_info to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 24/39] pc: Move gigabyte_align to PCMachineClass,
Eduardo Habkost <=
- [Qemu-devel] [RFC v2 04/39] piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 25/39] pc: Move has_reserved_memory to PCMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 26/39] pc: Move option_rom_has_mr/rom_file_has_mr to MachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 27/39] piix: Eliminate pc_init_pci(), Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 28/39] piix: Introduce struct PCI440FXMachineClass, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 29/39] pc: Create common machine init function, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 30/39] pc: Eliminate empty or trivial compat functions, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 31/39] piix: Move compat/init functions closer to corresponding class_init, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 32/39] pc: Rename pc_machine variable to pcms, Eduardo Habkost, 2014/06/13
- [Qemu-devel] [RFC v2 34/39] pc: Move duplicate Xen init code to pc_machine_init(), Eduardo Habkost, 2014/06/13