qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] [0.12] Map BIOS f-segment as RAM, not as ROM
@ 2009-12-04 10:33 Alexander Graf
  2009-12-04 13:48 ` [Qemu-devel] " Anthony Liguori
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexander Graf @ 2009-12-04 10:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin O'Connor, Gleb Natapov, Aurelien Jarno,
	Sebastian Herbszt

SeaBIOS needs to write to the f-segment. So it needs to have some way to set
that from read-only to read-write, write in it and when it's done set it to
read-only again.

On PCI we have a mechanism for that. The ISA machine does not though. To stay
regression free and happily enable users to continue using the -M isapc machine
let's just map it as RAM. The BIOS on PCI will set it to r/o later either way.

Signed-off-by: Alexander Graf <agraf@suse.de>

---

v1 -> v2:

  - always map r/w
---
 hw/pc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 8c1b7ea..b5dabdd 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1075,7 +1075,7 @@ static void pc_init1(ram_addr_t ram_size,
         isa_bios_size = 128 * 1024;
     cpu_register_physical_memory(0x100000 - isa_bios_size,
                                  isa_bios_size,
-                                 (bios_offset + bios_size - isa_bios_size) | IO_MEM_ROM);
+                                 (bios_offset + bios_size - isa_bios_size));
 
 
 
-- 
1.6.0.2

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

* [Qemu-devel] Re: [PATCH v2] [0.12] Map BIOS f-segment as RAM, not as ROM
  2009-12-04 10:33 [Qemu-devel] [PATCH v2] [0.12] Map BIOS f-segment as RAM, not as ROM Alexander Graf
@ 2009-12-04 13:48 ` Anthony Liguori
  2009-12-04 14:10 ` Gleb Natapov
  2009-12-05 16:31 ` Kevin O'Connor
  2 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2009-12-04 13:48 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Gleb Natapov, Kevin O'Connor, qemu-devel, Aurelien Jarno,
	Sebastian Herbszt

Alexander Graf wrote:
> SeaBIOS needs to write to the f-segment. So it needs to have some way to set
> that from read-only to read-write, write in it and when it's done set it to
> read-only again.
>
> On PCI we have a mechanism for that. The ISA machine does not though. To stay
> regression free and happily enable users to continue using the -M isapc machine
> let's just map it as RAM. The BIOS on PCI will set it to r/o later either way.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
>   

Thanks Alex.  Figuring out what to do here has been on my todo and this 
seems like a reasonable solution.

Regards,

Anthony Liguori

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

* [Qemu-devel] Re: [PATCH v2] [0.12] Map BIOS f-segment as RAM, not as ROM
  2009-12-04 10:33 [Qemu-devel] [PATCH v2] [0.12] Map BIOS f-segment as RAM, not as ROM Alexander Graf
  2009-12-04 13:48 ` [Qemu-devel] " Anthony Liguori
@ 2009-12-04 14:10 ` Gleb Natapov
  2009-12-05 16:31 ` Kevin O'Connor
  2 siblings, 0 replies; 4+ messages in thread
From: Gleb Natapov @ 2009-12-04 14:10 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Kevin O'Connor, qemu-devel, Aurelien Jarno, Sebastian Herbszt

On Fri, Dec 04, 2009 at 11:33:13AM +0100, Alexander Graf wrote:
> SeaBIOS needs to write to the f-segment. So it needs to have some way to set
> that from read-only to read-write, write in it and when it's done set it to
> read-only again.
> 
> On PCI we have a mechanism for that. The ISA machine does not though. To stay
> regression free and happily enable users to continue using the -M isapc machine
> let's just map it as RAM. The BIOS on PCI will set it to r/o later either way.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> 
Looks fine to me. Guest will be able to overwrite BIOS, but I don't
think we should care about this too much. On KVM all ROM slots are
writable anyway.

> ---
> 
> v1 -> v2:
> 
>   - always map r/w
> ---
>  hw/pc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/pc.c b/hw/pc.c
> index 8c1b7ea..b5dabdd 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -1075,7 +1075,7 @@ static void pc_init1(ram_addr_t ram_size,
>          isa_bios_size = 128 * 1024;
>      cpu_register_physical_memory(0x100000 - isa_bios_size,
>                                   isa_bios_size,
> -                                 (bios_offset + bios_size - isa_bios_size) | IO_MEM_ROM);
> +                                 (bios_offset + bios_size - isa_bios_size));
>  
>  
>  
> -- 
> 1.6.0.2

--
			Gleb.

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

* [Qemu-devel] Re: [PATCH v2] [0.12] Map BIOS f-segment as RAM, not as ROM
  2009-12-04 10:33 [Qemu-devel] [PATCH v2] [0.12] Map BIOS f-segment as RAM, not as ROM Alexander Graf
  2009-12-04 13:48 ` [Qemu-devel] " Anthony Liguori
  2009-12-04 14:10 ` Gleb Natapov
@ 2009-12-05 16:31 ` Kevin O'Connor
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin O'Connor @ 2009-12-05 16:31 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Gleb Natapov, qemu-devel, Aurelien Jarno, Sebastian Herbszt

On Fri, Dec 04, 2009 at 11:33:13AM +0100, Alexander Graf wrote:
> SeaBIOS needs to write to the f-segment. So it needs to have some way to set
> that from read-only to read-write, write in it and when it's done set it to
> read-only again.
> 
> On PCI we have a mechanism for that. The ISA machine does not though. To stay
> regression free and happily enable users to continue using the -M isapc machine
> let's just map it as RAM. The BIOS on PCI will set it to r/o later either way.

Thanks Alexander.

With this qemu patch, SeaBIOS still wouldn't boot from a harddrive
because it only probed PCI ATA controllers.  I committed 4ccb2312 to
SeaBIOS to have it probe for ISA ATA controllers when no pci devices
are found.

-Kevin

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

end of thread, other threads:[~2009-12-05 16:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-04 10:33 [Qemu-devel] [PATCH v2] [0.12] Map BIOS f-segment as RAM, not as ROM Alexander Graf
2009-12-04 13:48 ` [Qemu-devel] " Anthony Liguori
2009-12-04 14:10 ` Gleb Natapov
2009-12-05 16:31 ` Kevin O'Connor

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).