All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/0] qemu: change pci mem address of the pc arch (v2)
@ 2009-02-12  2:36 Izik Eidus
  2009-02-12  2:36 ` [Qemu-devel] [PATCH] qemu: change the pc pci mapping to start from 0xc0000000 Izik Eidus
  0 siblings, 1 reply; 4+ messages in thread
From: Izik Eidus @ 2009-02-12  2:36 UTC (permalink / raw)
  To: qemu-devel


Diffrence from v1 - remove the changes from the vbe bios:
the vbe bios does not have to be compiled with physical address of LBF
instead it can read that memory address from the bochs bios.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH] qemu: change the pc pci mapping to start from 0xc0000000
  2009-02-12  2:36 [Qemu-devel] [PATCH 0/0] qemu: change pci mem address of the pc arch (v2) Izik Eidus
@ 2009-02-12  2:36 ` Izik Eidus
  2009-02-16 15:40   ` Anthony Liguori
  0 siblings, 1 reply; 4+ messages in thread
From: Izik Eidus @ 2009-02-12  2:36 UTC (permalink / raw)
  To: qemu-devel; +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 <ieidus@redhat.com>
---
 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 <ieidus@redhat.com>
+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 <ieidus@redhat.com>
+---
+ 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu: change the pc pci mapping to start from 0xc0000000
  2009-02-12  2:36 ` [Qemu-devel] [PATCH] qemu: change the pc pci mapping to start from 0xc0000000 Izik Eidus
@ 2009-02-16 15:40   ` Anthony Liguori
  2009-02-16 19:39     ` Izik Eidus
  0 siblings, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2009-02-16 15:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Izik Eidus

Izik Eidus wrote:
> 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 <ieidus@redhat.com>
> ---
>  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
>   

Can you please split this into a separate patch and CC bochs-devel?

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu: change the pc pci mapping to start from 0xc0000000
  2009-02-16 15:40   ` Anthony Liguori
@ 2009-02-16 19:39     ` Izik Eidus
  0 siblings, 0 replies; 4+ messages in thread
From: Izik Eidus @ 2009-02-16 19:39 UTC (permalink / raw)
  To: qemu-devel, info

Anthony Liguori wrote:
> Izik Eidus wrote:
>> This is needed in order to allocate more memory to pci devices
>>
>
> Can you please split this into a separate patch and CC bochs-devel?
>
> Regards,
>
> Anthony Liguori
>
>
Sure, but first i am waiting for answer from Volker, about the 
possibility that we have to change the mapping in the vga bios anyway
(due to the fact that qemu can run without pci)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-16 19:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-12  2:36 [Qemu-devel] [PATCH 0/0] qemu: change pci mem address of the pc arch (v2) Izik Eidus
2009-02-12  2:36 ` [Qemu-devel] [PATCH] qemu: change the pc pci mapping to start from 0xc0000000 Izik Eidus
2009-02-16 15:40   ` Anthony Liguori
2009-02-16 19:39     ` Izik Eidus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.