* [Qemu-devel] [PATCH 1/1] hw: better i440 emulation
@ 2010-04-19 15:47 Bernhard M. Wiedemann
2010-04-20 16:55 ` Andreas Färber
0 siblings, 1 reply; 4+ messages in thread
From: Bernhard M. Wiedemann @ 2010-04-19 15:47 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 744 bytes --]
attached is a tested 0.12.3-version of an old patch
http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch
that together with
http://www.mail-archive.com/linuxbios@linuxbios.org/msg02390.html
(which is already in coreboot trunk) allows coreboot BIOS to autodetect the amount of RAM within qemu/kvm from a register in i440 northbridge.
The message on the old patch states:
Unfortunately the current version of qemu does not set these
registers, but I have patched qemu so that it emulates the i440 more
faithfully in this regard.
new patch is also available at
http://www.zq1.de/~bernhard/linux/qemu-0.12.3-piix-ram-size.patch
Please discuss or apply this patch.
regards
Bernhard M. Wiedemann
--
software engineer
[-- Attachment #2: qemu-0.12.3-piix-ram-size.patch --]
[-- Type: text/x-diff, Size: 1614 bytes --]
diff -ru ./hw/pc.c ../qpatch/hw/pc.c
--- ./hw/pc.c 2010-02-26 03:34:00.000000000 +0100
+++ ../qpatch/hw/pc.c 2010-04-19 17:18:12.000000000 +0200
@@ -1130,7 +1130,7 @@
}
if (pci_enabled) {
- pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, isa_irq);
+ pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, isa_irq, ram_size);
} else {
pci_bus = NULL;
isa_bus_new(NULL);
diff -ru ./hw/pc.h ../qpatch/hw/pc.h
--- ./hw/pc.h 2010-02-26 03:34:00.000000000 +0100
+++ ../qpatch/hw/pc.h 2010-04-19 17:10:50.000000000 +0200
@@ -129,7 +129,7 @@
struct PCII440FXState;
typedef struct PCII440FXState PCII440FXState;
-PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, qemu_irq *pic);
+PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, qemu_irq *pic, int ram_size);
void i440fx_set_smm(PCII440FXState *d, int val);
void i440fx_init_memory_mappings(PCII440FXState *d);
diff -ru ./hw/piix_pci.c ../qpatch/hw/piix_pci.c
--- ./hw/piix_pci.c 2010-02-26 03:34:00.000000000 +0100
+++ ../qpatch/hw/piix_pci.c 2010-04-19 17:27:59.000000000 +0200
@@ -209,7 +209,7 @@
static PIIX3State *piix3_dev;
-PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *pic)
+PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *pic, int ram_size)
{
DeviceState *dev;
PCIBus *b;
@@ -236,6 +236,11 @@
piix3_dev = piix3;
+ ram_size = ram_size / 8 / 1024 / 1024;
+ if (ram_size > 255)
+ ram_size = 255;
+ (*pi440fx_state)->dev.config[0x57]=ram_size;
+
return b;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] hw: better i440 emulation
2010-04-19 15:47 [Qemu-devel] [PATCH 1/1] hw: better i440 emulation Bernhard M. Wiedemann
@ 2010-04-20 16:55 ` Andreas Färber
2010-04-20 18:48 ` [Qemu-devel] [PATCH] " Bernhard M. Wiedemann
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Färber @ 2010-04-20 16:55 UTC (permalink / raw)
To: Bernhard M. Wiedemann; +Cc: qemu-devel
Am 19.04.2010 um 17:47 schrieb Bernhard M. Wiedemann:
> attached is a tested 0.12.3-version of an old patch
> http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch
> that together with
> http://www.mail-archive.com/linuxbios@linuxbios.org/msg02390.html
> (which is already in coreboot trunk) allows coreboot BIOS to
> autodetect the amount of RAM within qemu/kvm from a register in i440
> northbridge.
>
> The message on the old patch states:
> Unfortunately the current version of qemu does not set these
> registers, but I have patched qemu so that it emulates the i440 more
> faithfully in this regard.
Both the original patch and yours are missing a Signed-off-by statement.
Generally preferred are patches against git master branch with a ready-
to-commit summary, sent with git-send-email.
Andreas
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH] hw: better i440 emulation
2010-04-20 16:55 ` Andreas Färber
@ 2010-04-20 18:48 ` Bernhard M. Wiedemann
2010-05-04 13:47 ` Anthony Liguori
0 siblings, 1 reply; 4+ messages in thread
From: Bernhard M. Wiedemann @ 2010-04-20 18:48 UTC (permalink / raw)
To: qemu-devel; +Cc: Bernhard M. Wiedemann
updated version of an old patch
http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch
that together with
http://www.mail-archive.com/linuxbios@linuxbios.org/msg02390.html
(which is already in coreboot trunk) allows coreboot to autodetect the amount of RAM within qemu/kvm from a register in i440 northbridge.
The message on the old patch states:
Unfortunately the current version of qemu does not set these
registers, but I have patched qemu so that it emulates the i440 more
faithfully in this regard.
Signed-off-by: Bernhard M. Wiedemann <qemudevbmw@lsmod.de>
---
hw/pc.c | 2 +-
hw/pc.h | 2 +-
hw/piix_pci.c | 7 ++++++-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index b797f21..eec0864 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -926,7 +926,7 @@ static void pc_init1(ram_addr_t ram_size,
isa_irq = qemu_allocate_irqs(isa_irq_handler, isa_irq_state, 24);
if (pci_enabled) {
- pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, isa_irq);
+ pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, isa_irq, ram_size);
} else {
pci_bus = NULL;
isa_bus_new(NULL);
diff --git a/hw/pc.h b/hw/pc.h
index 5f86b37..d11a576 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -107,7 +107,7 @@ int pcspk_audio_init(qemu_irq *pic);
struct PCII440FXState;
typedef struct PCII440FXState PCII440FXState;
-PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, qemu_irq *pic);
+PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, qemu_irq *pic, int ram_size);
void i440fx_set_smm(PCII440FXState *d, int val);
void i440fx_init_memory_mappings(PCII440FXState *d);
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index cd12212..97519db 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -213,7 +213,7 @@ static int i440fx_initfn(PCIDevice *dev)
return 0;
}
-PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *pic)
+PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *pic, int ram_size)
{
DeviceState *dev;
PCIBus *b;
@@ -238,6 +238,11 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *
*piix3_devfn = piix3->dev.devfn;
+ ram_size = ram_size / 8 / 1024 / 1024;
+ if (ram_size > 255)
+ ram_size = 255;
+ (*pi440fx_state)->dev.config[0x57]=ram_size;
+
return b;
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] hw: better i440 emulation
2010-04-20 18:48 ` [Qemu-devel] [PATCH] " Bernhard M. Wiedemann
@ 2010-05-04 13:47 ` Anthony Liguori
0 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2010-05-04 13:47 UTC (permalink / raw)
To: Bernhard M. Wiedemann; +Cc: qemu-devel
On 04/20/2010 01:48 PM, Bernhard M. Wiedemann wrote:
> updated version of an old patch
> http://xenon.stanford.edu/~eswierk/misc/qemu-linuxbios/qemu-piix-ram-size.patch
> that together with
> http://www.mail-archive.com/linuxbios@linuxbios.org/msg02390.html
> (which is already in coreboot trunk) allows coreboot to autodetect the amount of RAM within qemu/kvm from a register in i440 northbridge.
>
> The message on the old patch states:
> Unfortunately the current version of qemu does not set these
> registers, but I have patched qemu so that it emulates the i440 more
> faithfully in this regard.
>
> Signed-off-by: Bernhard M. Wiedemann<qemudevbmw@lsmod.de>
>
Applied. Thanks.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-04 13:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-19 15:47 [Qemu-devel] [PATCH 1/1] hw: better i440 emulation Bernhard M. Wiedemann
2010-04-20 16:55 ` Andreas Färber
2010-04-20 18:48 ` [Qemu-devel] [PATCH] " Bernhard M. Wiedemann
2010-05-04 13:47 ` Anthony Liguori
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).