From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PULL 01/19] piix: gigabyte alignment for ram
Date: Mon, 23 Dec 2013 18:11:33 +0200 [thread overview]
Message-ID: <1387815007-1272-2-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1387815007-1272-1-git-send-email-mst@redhat.com>
From: Gerd Hoffmann <kraxel@redhat.com>
Map 3G (i440fx) of memory below 4G, so the RAM pieces
are nicely aligned to gigabyte borders.
Keep old memory layout for (a) old machine types and (b) in case all
memory fits below 4G and thus we don't have to split RAM into pieces
in the first place. The later makes sure this change doesn't take
away memory from 32bit guests.
So, with i440fx and up to 3.5 GB of memory, all of it will be mapped
below 4G. With more than 3.5 GB of memory 3 GB will be mapped below
4G and the remaining amount will be mapped above 4G.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/i386/pc_piix.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 4e0dae7..acb9445 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -61,6 +61,7 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
static bool has_pci_info;
static bool has_acpi_build = true;
static bool smbios_type1_defaults = true;
+static bool gigabyte_align = true;
/* PC hardware initialisation */
static void pc_init1(QEMUMachineInitArgs *args,
@@ -107,8 +108,9 @@ static void pc_init1(QEMUMachineInitArgs *args,
}
if (args->ram_size >= 0xe0000000) {
- above_4g_mem_size = args->ram_size - 0xe0000000;
- below_4g_mem_size = 0xe0000000;
+ ram_addr_t lowmem = gigabyte_align ? 0xc0000000 : 0xe0000000;
+ above_4g_mem_size = args->ram_size - lowmem;
+ below_4g_mem_size = lowmem;
} else {
above_4g_mem_size = 0;
below_4g_mem_size = args->ram_size;
@@ -245,6 +247,7 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
static void pc_compat_1_7(QEMUMachineInitArgs *args)
{
smbios_type1_defaults = false;
+ gigabyte_align = false;
}
static void pc_compat_1_6(QEMUMachineInitArgs *args)
--
MST
next prev parent reply other threads:[~2013-12-23 16:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-23 16:11 [Qemu-devel] [PULL 00/19] acpi, pci, pc, fedora, virtio fixes and enhancements Michael S. Tsirkin
2013-12-23 16:11 ` Michael S. Tsirkin [this message]
2013-12-23 16:11 ` [Qemu-devel] [PULL 02/19] pc_piix: document gigabyte_align Michael S. Tsirkin
2013-12-23 16:11 ` [Qemu-devel] [PULL 03/19] hw/i386/pc_sysfw: support two flash drives Michael S. Tsirkin
2013-12-23 16:11 ` [Qemu-devel] [PULL 04/19] i440fx-test: qtest_start() should be paired with qtest_end() Michael S. Tsirkin
2013-12-23 16:11 ` [Qemu-devel] [PULL 05/19] i440fx-test: give each GTest case its own qtest Michael S. Tsirkin
2013-12-23 16:11 ` [Qemu-devel] [PULL 06/19] i440fx-test: generate temporary firmware blob Michael S. Tsirkin
2013-12-23 16:11 ` [Qemu-devel] [PULL 07/19] i440fx-test: verify firmware under 4G and 1M, both -bios and -pflash Michael S. Tsirkin
2013-12-23 16:11 ` [Qemu-devel] [PULL 08/19] acpi: piix4: remove not needed GPE0 mask Michael S. Tsirkin
2013-12-23 16:11 ` [Qemu-devel] [PULL 09/19] acpi: factor out common pm_update_sci() into acpi core Michael S. Tsirkin
2013-12-23 16:12 ` [Qemu-devel] [PULL 10/19] acpi: ich9: allow guest to clear SCI rised by GPE Michael S. Tsirkin
2013-12-23 16:12 ` [Qemu-devel] [PULL 11/19] ACPI: Q35 DSDT: fix CPU hotplug GPE0.2 handler Michael S. Tsirkin
2013-12-23 16:12 ` [Qemu-devel] [PULL 12/19] ACPI/DSDT-CPU: cleanup bogus comment Michael S. Tsirkin
2013-12-23 16:12 ` [Qemu-devel] [PULL 13/19] pci: do not export pci_bus_reset Michael S. Tsirkin
2013-12-23 16:12 ` [Qemu-devel] [PULL 14/19] pci: clean up resetting of IRQs Michael S. Tsirkin
2013-12-23 16:12 ` [Qemu-devel] [PULL 15/19] qdev: allow both pre- and post-order vists in qdev walking functions Michael S. Tsirkin
2013-12-23 16:12 ` [Qemu-devel] [PULL 16/19] qdev: switch reset to post-order Michael S. Tsirkin
2013-12-23 16:12 ` [Qemu-devel] [PULL 17/19] piix: fix 32bit pci hole Michael S. Tsirkin
2013-12-23 16:12 ` [Qemu-devel] [PULL 18/19] virtio: add back call to virtio_bus_device_unplugged Michael S. Tsirkin
2013-12-23 16:12 ` [Qemu-devel] [PULL 19/19] target-arm: fix build with gcc 4.8.2 Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1387815007-1272-2-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=aliguori@amazon.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).