From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LXRNt-00083s-AY for qemu-devel@nongnu.org; Wed, 11 Feb 2009 21:33:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LXRNr-00083J-Da for qemu-devel@nongnu.org; Wed, 11 Feb 2009 21:33:00 -0500 Received: from [199.232.76.173] (port=36468 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXRNr-00083E-8X for qemu-devel@nongnu.org; Wed, 11 Feb 2009 21:32:59 -0500 Received: from mx2.redhat.com ([66.187.237.31]:42651) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LXRNq-0007IN-Nq for qemu-devel@nongnu.org; Wed, 11 Feb 2009 21:32:59 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n1C2Wvjl000466 for ; Wed, 11 Feb 2009 21:32:57 -0500 From: Izik Eidus Date: Thu, 12 Feb 2009 04:36:38 +0200 Message-Id: <1234406198-14094-2-git-send-email-ieidus@redhat.com> In-Reply-To: <1234406198-14094-1-git-send-email-ieidus@redhat.com> References: <1234406198-14094-1-git-send-email-ieidus@redhat.com> Subject: [Qemu-devel] [PATCH] qemu: change the pc pci mapping to start from 0xc0000000 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Izik Eidus This is needed in order to allocate more memory to pci devices One side effect of this is that non-pea guests cant see more than 3giga of ram anymore. (vbe really sstart at 0xc0000000, pci start right after that) Signed-off-by: Izik Eidus --- hw/pc.c | 6 +- hw/vga_int.h | 2 +- hw/vmware_vga.c | 4 +- ...ge-pci-mem-address-to-start-at-0xc0000000.patch | 79 ++++++++++++++++++++ pc-bios/bios-pq/series | 1 + 5 files changed, 86 insertions(+), 6 deletions(-) create mode 100644 pc-bios/bios-pq/0011-bios-change-pci-mem-address-to-start-at-0xc0000000.patch diff --git a/hw/pc.c b/hw/pc.c index 57ba803..e26e2b5 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -771,9 +771,9 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; BlockDriverState *fd[MAX_FD]; - if (ram_size >= 0xe0000000 ) { - above_4g_mem_size = ram_size - 0xe0000000; - below_4g_mem_size = 0xe0000000; + if (ram_size >= 0xc0000000 ) { + above_4g_mem_size = ram_size - 0xc0000000; + below_4g_mem_size = 0xc0000000; } else { below_4g_mem_size = ram_size; } diff --git a/hw/vga_int.h b/hw/vga_int.h index f97e98f..57f20bf 100644 --- a/hw/vga_int.h +++ b/hw/vga_int.h @@ -59,7 +59,7 @@ #define VBE_DISPI_LFB_ENABLED 0x40 #define VBE_DISPI_NOCLEARMEM 0x80 -#define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xE0000000 +#define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xC0000000 #ifdef CONFIG_BOCHS_VBE diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c index d1cba28..5ee0ad6 100644 --- a/hw/vmware_vga.c +++ b/hw/vmware_vga.c @@ -118,14 +118,14 @@ struct pci_vmsvga_state_s { # define SVGA_IO_BASE SVGA_LEGACY_BASE_PORT # define SVGA_IO_MUL 1 # define SVGA_FIFO_SIZE 0x10000 -# define SVGA_MEM_BASE 0xe0000000 +# define SVGA_MEM_BASE 0xc0000000 # define SVGA_PCI_DEVICE_ID PCI_DEVICE_ID_VMWARE_SVGA2 #else # define SVGA_ID SVGA_ID_1 # define SVGA_IO_BASE SVGA_LEGACY_BASE_PORT # define SVGA_IO_MUL 4 # define SVGA_FIFO_SIZE 0x10000 -# define SVGA_MEM_BASE 0xe0000000 +# define SVGA_MEM_BASE 0xc0000000 # define SVGA_PCI_DEVICE_ID PCI_DEVICE_ID_VMWARE_SVGA #endif diff --git a/pc-bios/bios-pq/0011-bios-change-pci-mem-address-to-start-at-0xc0000000.patch b/pc-bios/bios-pq/0011-bios-change-pci-mem-address-to-start-at-0xc0000000.patch new file mode 100644 index 0000000..8137ccb --- /dev/null +++ b/pc-bios/bios-pq/0011-bios-change-pci-mem-address-to-start-at-0xc0000000.patch @@ -0,0 +1,79 @@ +From 803f9d70ef2b717c8b6f98cbd9a9771efe2e06ab Mon Sep 17 00:00:00 2001 +From: Izik Eidus +Date: Thu, 12 Feb 2009 04:13:28 +0200 +Subject: [PATCH] bios change the pci mem address to start at 0xc0000000 + +chaing pci address to be at 0xc0000000 is needed to allow more memory +resources for pci devices. + +Signed-off-by: Izik Eidus +--- + bios/acpi-dsdt.dsl | 2 +- + bios/rombios.c | 2 +- + bios/rombios32.c | 10 +++++----- + 3 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/bios/acpi-dsdt.dsl b/bios/acpi-dsdt.dsl +index d35886d..9d9abc4 100644 +--- a/bios/acpi-dsdt.dsl ++++ b/bios/acpi-dsdt.dsl +@@ -123,7 +123,7 @@ DefinitionBlock ( + ,, , AddressRangeMemory, TypeStatic) + DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, + 0x00000000, // Address Space Granularity +- 0xE0000000, // Address Range Minimum ++ 0xC0000000, // Address Range Minimum + 0xFEBFFFFF, // Address Range Maximum + 0x00000000, // Address Translation Offset + 0x1EC00000, // Address Length +diff --git a/bios/rombios.c b/bios/rombios.c +index 0f13b53..85d5ebd 100644 +--- a/bios/rombios.c ++++ b/bios/rombios.c +@@ -9795,7 +9795,7 @@ pcibios_init_sel_reg: + pcibios_init_iomem_bases: + push bp + mov bp, sp +- mov eax, #0xe0000000 ;; base for memory init ++ mov eax, #0xc0000000 ;; base for memory init + push eax + mov ax, #0xc000 ;; base for i/o init + push ax +diff --git a/bios/rombios32.c b/bios/rombios32.c +index 3269be5..c7c02d5 100644 +--- a/bios/rombios32.c ++++ b/bios/rombios32.c +@@ -556,8 +556,8 @@ void setup_mtrr(void) + wrmsr_smp(MSR_MTRRfix4K_E8000, 0); + wrmsr_smp(MSR_MTRRfix4K_F0000, 0); + wrmsr_smp(MSR_MTRRfix4K_F8000, 0); +- /* Mark 3.5-4GB as UC, anything not specified defaults to WB */ +- wrmsr_smp(MTRRphysBase_MSR(0), 0xe0000000ull | 0); ++ /* Mark 3-4GB as UC, anything not specified defaults to WB */ ++ wrmsr_smp(MTRRphysBase_MSR(0), 0xc0000000ull | 0); + wrmsr_smp(MTRRphysMask_MSR(0), ~(0x20000000ull - 1) | 0x800); + wrmsr_smp(MSR_MTRRdefType, 0xc06); + } +@@ -905,8 +905,8 @@ static void pci_bios_init_device(PCIDevice *d) + case 0x0300: /* Display controller - VGA compatible controller */ + if (vendor_id != 0x1234) + goto default_map; +- /* VGA: map frame buffer to default Bochs VBE address */ +- pci_set_io_region_addr(d, 0, 0xE0000000); ++ /* VGA: map frame buffer */ ++ pci_set_io_region_addr(d, 0, 0xC0000000); + break; + case 0x0800: /* Generic system peripheral - PIC */ + if (vendor_id == PCI_VENDOR_ID_IBM) { +@@ -993,7 +993,7 @@ void pci_for_each_device(void (*init_func)(PCIDevice *d)) + void pci_bios_init(void) + { + pci_bios_io_addr = 0xc000; +- pci_bios_mem_addr = 0xf0000000; ++ pci_bios_mem_addr = 0xc0000000 + 0x1000000; + pci_bios_bigmem_addr = ram_size; + if (pci_bios_bigmem_addr < 0x90000000) + pci_bios_bigmem_addr = 0x90000000; +-- +1.6.0.6 + diff --git a/pc-bios/bios-pq/series b/pc-bios/bios-pq/series index 4139227..f8ee796 100644 --- a/pc-bios/bios-pq/series +++ b/pc-bios/bios-pq/series @@ -1,4 +1,5 @@ 0001_bx-qemu.patch +0011-bios-change-pci-mem-address-to-start-at-0xc0000000.patch 0002_kvm-bios-update-smbios-table-to-report-memory-above-4g.patch 0003_kvm-bios-generate-mptable-unconditionally.patch 0004_kvm-bios-resolve-memory-device-roll-over-reporting--issues-with-32g-guests.patch -- 1.6.1