From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1L2l-0008BY-J8 for qemu-devel@nongnu.org; Thu, 09 Jan 2014 14:13:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1L2f-0006AO-FW for qemu-devel@nongnu.org; Thu, 09 Jan 2014 14:13:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1L2f-0006A7-5X for qemu-devel@nongnu.org; Thu, 09 Jan 2014 14:13:21 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s09JDKcZ015133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Jan 2014 14:13:20 -0500 From: Eduardo Habkost Date: Thu, 9 Jan 2014 17:12:43 -0200 Message-Id: <1389294763-8137-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1389294763-8137-1-git-send-email-ehabkost@redhat.com> References: <1389294763-8137-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] acpi: Fix PCI hole handling on build_srat() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , Gerd Hoffmann , "Michael S. Tsirkin" The original SeaBIOS code used the RamSize variable, that was used by SeaBIOS for the size of RAM below 4GB, not for all RAM. When copied to QEMU, the code was changed to use the full RAM size, and this broke the build_srat() code that handles the PCI hole. Change build_srat() to use ram_size_below_4g instead of ram_size, to restore the original behavior from SeaBIOS. Signed-off-by: Eduardo Habkost --- hw/i386/acpi-build.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 48312f5..b58cc1a 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -867,16 +867,16 @@ build_srat(GArray *table_data, GArray *linker, next_base = mem_base + mem_len; /* Cut out the ACPI_PCI hole */ - if (mem_base <= guest_info->ram_size && - next_base > guest_info->ram_size) { - mem_len -= next_base - guest_info->ram_size; + if (mem_base <= guest_info->ram_size_below_4g && + next_base > guest_info->ram_size_below_4g) { + mem_len -= next_base - guest_info->ram_size_below_4g; if (mem_len > 0) { numamem = acpi_data_push(table_data, sizeof *numamem); acpi_build_srat_memory(numamem, mem_base, mem_len, i-1, 1); } mem_base = 1ULL << 32; - mem_len = next_base - guest_info->ram_size; - next_base += (1ULL << 32) - guest_info->ram_size; + mem_len = next_base - guest_info->ram_size_below_4g; + next_base += (1ULL << 32) - guest_info->ram_size_below_4g; } numamem = acpi_data_push(table_data, sizeof *numamem); acpi_build_srat_memory(numamem, mem_base, mem_len, i - 1, 1); -- 1.8.4.2