qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v11 0/9] PC system flash support
@ 2012-02-22  7:18 Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 1/9] blockdev: allow read-only pflash devices Jordan Justen
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Jordan Justen @ 2012-02-22  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jordan Justen

Enable flash emulation in a PC system using pflash_cfi01.

v11:
* Convert pc-sysfw to qdev
  - Add rom_only property
* Remove KVM flash support to remove the need for using
  bdrv_read during machine initialization.  KVM should
  now continue to use the same 'rom' initialization
  sequence that it uses today.

v10:
* Rebase to HEAD
* "decouple vmstate from memory API" as in c5705a7
* Break changes into smaller pieces

v9:
* Add pc-1.1
* pc-1.0 uses previous rom firmware init code path

v8:
* Cleanup two chunks of debug code (printf messages)
* Fix comment in pc.h (pcflash.c => pc_sysfw.c)

v7:
* Do not add system firmware to qemu roms
* If kvm is enabled, copy pflash drive contents into a
  read-only ram region, since kvm cannot currently execute
  code from a pflash device.
* Rename pcflash.c to pc_sysfw.c

v6:
* Rebase for memory API
* pflash_cfi01: Set error in status register when a write to
  erase is attempted in read-only mode.
* Add system firmware to qemu roms

v5:
* Enable pflash read-only mode
* Enable -drive with if=pflash to define system firmware image

v4:
* Rebase

v3:
* Fix code style issues
* Add additional comments

v2:
* Convert debug printf to DPRINTF

Jordan Justen (9):
  blockdev: allow read-only pflash devices
  pflash_cfi01/02: support read-only pflash devices
  vl: make find_default_machine externally visible
  hw/pc: move rom init to pc_sysfw.c
  hw/pc_sysfw: enable pc-sysfw as a qdev
  hw/pc_sysfw: support system flash memory with pflash
  hw/pc_piix: remove is_default for pc-0.15
  hw/pc_piix: add pc-1.1
  pc_piix/pc_sysfw: enable flash by default

 Makefile.target                    |    1 +
 blockdev.c                         |    3 +-
 default-configs/i386-softmmu.mak   |    1 +
 default-configs/x86_64-softmmu.mak |    1 +
 hw/boards.h                        |    1 +
 hw/pc.c                            |   56 +-------
 hw/pc.h                            |    3 +
 hw/pc_piix.c                       |   62 +++++++++-
 hw/pc_sysfw.c                      |  254 ++++++++++++++++++++++++++++++++++++
 hw/pflash_cfi01.c                  |   44 +++++--
 hw/pflash_cfi02.c                  |   83 +++++++------
 vl.c                               |    2 +-
 12 files changed, 403 insertions(+), 108 deletions(-)
 create mode 100644 hw/pc_sysfw.c

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

* [Qemu-devel] [PATCH v11 1/9] blockdev: allow read-only pflash devices
  2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
@ 2012-02-22  7:18 ` Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 2/9] pflash_cfi01/02: support " Jordan Justen
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Jordan Justen @ 2012-02-22  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jordan Justen

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 blockdev.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 7a6613a..2c132a3 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -595,7 +595,8 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
         /* CDROM is fine for any interface, don't check.  */
         ro = 1;
     } else if (ro == 1) {
-        if (type != IF_SCSI && type != IF_VIRTIO && type != IF_FLOPPY && type != IF_NONE) {
+        if (type != IF_SCSI && type != IF_VIRTIO && type != IF_FLOPPY &&
+            type != IF_NONE && type != IF_PFLASH) {
             error_report("readonly not supported by this bus type");
             goto err;
         }
-- 
1.7.1

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

* [Qemu-devel] [PATCH v11 2/9] pflash_cfi01/02: support read-only pflash devices
  2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 1/9] blockdev: allow read-only pflash devices Jordan Justen
@ 2012-02-22  7:18 ` Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 3/9] vl: make find_default_machine externally visible Jordan Justen
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Jordan Justen @ 2012-02-22  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jordan Justen

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 hw/pflash_cfi01.c |   44 +++++++++++++++++++---------
 hw/pflash_cfi02.c |   83 ++++++++++++++++++++++++++++------------------------
 2 files changed, 75 insertions(+), 52 deletions(-)

diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
index ee0c3ba..b03f623 100644
--- a/hw/pflash_cfi01.c
+++ b/hw/pflash_cfi01.c
@@ -283,8 +283,12 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
                     TARGET_FMT_plx "\n",
                     __func__, offset, pfl->sector_len);
 
-            memset(p + offset, 0xff, pfl->sector_len);
-            pflash_update(pfl, offset, pfl->sector_len);
+            if (!pfl->ro) {
+                memset(p + offset, 0xff, pfl->sector_len);
+                pflash_update(pfl, offset, pfl->sector_len);
+            } else {
+                pfl->status |= 0x20; /* Block erase error */
+            }
             pfl->status |= 0x80; /* Ready! */
             break;
         case 0x50: /* Clear status bits */
@@ -323,8 +327,12 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
         case 0x10: /* Single Byte Program */
         case 0x40: /* Single Byte Program */
             DPRINTF("%s: Single Byte Program\n", __func__);
-            pflash_data_write(pfl, offset, value, width, be);
-            pflash_update(pfl, offset, width);
+            if (!pfl->ro) {
+                pflash_data_write(pfl, offset, value, width, be);
+                pflash_update(pfl, offset, width);
+            } else {
+                pfl->status |= 0x10; /* Programming error */
+            }
             pfl->status |= 0x80; /* Ready! */
             pfl->wcycle = 0;
         break;
@@ -372,7 +380,11 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
     case 2:
         switch (pfl->cmd) {
         case 0xe8: /* Block write */
-            pflash_data_write(pfl, offset, value, width, be);
+            if (!pfl->ro) {
+                pflash_data_write(pfl, offset, value, width, be);
+            } else {
+                pfl->status |= 0x10; /* Programming error */
+            }
 
             pfl->status |= 0x80;
 
@@ -382,8 +394,12 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
 
                 DPRINTF("%s: block write finished\n", __func__);
                 pfl->wcycle++;
-                /* Flush the entire write buffer onto backing storage.  */
-                pflash_update(pfl, offset & mask, pfl->writeblock_size);
+                if (!pfl->ro) {
+                    /* Flush the entire write buffer onto backing storage.  */
+                    pflash_update(pfl, offset & mask, pfl->writeblock_size);
+                } else {
+                    pfl->status |= 0x10; /* Programming error */
+                }
             }
 
             pfl->counter--;
@@ -607,13 +623,13 @@ pflash_t *pflash_cfi01_register(target_phys_addr_t base,
         }
         bdrv_attach_dev_nofail(pfl->bs, pfl);
     }
-#if 0 /* XXX: there should be a bit to set up read-only,
-       *      the same way the hardware does (with WP pin).
-       */
-    pfl->ro = 1;
-#else
-    pfl->ro = 0;
-#endif
+
+    if (pfl->bs) {
+        pfl->ro = bdrv_is_read_only(pfl->bs);
+    } else {
+        pfl->ro = 0;
+    }
+
     pfl->timer = qemu_new_timer_ns(vm_clock, pflash_timer, pfl);
     pfl->base = base;
     pfl->sector_len = sector_len;
diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c
index 2ca0fd4..3e2002e 100644
--- a/hw/pflash_cfi02.c
+++ b/hw/pflash_cfi02.c
@@ -330,35 +330,37 @@ static void pflash_write (pflash_t *pfl, target_phys_addr_t offset,
             DPRINTF("%s: write data offset " TARGET_FMT_plx " %08x %d\n",
                     __func__, offset, value, width);
             p = pfl->storage;
-            switch (width) {
-            case 1:
-                p[offset] &= value;
-                pflash_update(pfl, offset, 1);
-                break;
-            case 2:
-                if (be) {
-                    p[offset] &= value >> 8;
-                    p[offset + 1] &= value;
-                } else {
+            if (!pfl->ro) {
+                switch (width) {
+                case 1:
                     p[offset] &= value;
-                    p[offset + 1] &= value >> 8;
+                    pflash_update(pfl, offset, 1);
+                    break;
+                case 2:
+                    if (be) {
+                        p[offset] &= value >> 8;
+                        p[offset + 1] &= value;
+                    } else {
+                        p[offset] &= value;
+                        p[offset + 1] &= value >> 8;
+                    }
+                    pflash_update(pfl, offset, 2);
+                    break;
+                case 4:
+                    if (be) {
+                        p[offset] &= value >> 24;
+                        p[offset + 1] &= value >> 16;
+                        p[offset + 2] &= value >> 8;
+                        p[offset + 3] &= value;
+                    } else {
+                        p[offset] &= value;
+                        p[offset + 1] &= value >> 8;
+                        p[offset + 2] &= value >> 16;
+                        p[offset + 3] &= value >> 24;
+                    }
+                    pflash_update(pfl, offset, 4);
+                    break;
                 }
-                pflash_update(pfl, offset, 2);
-                break;
-            case 4:
-                if (be) {
-                    p[offset] &= value >> 24;
-                    p[offset + 1] &= value >> 16;
-                    p[offset + 2] &= value >> 8;
-                    p[offset + 3] &= value;
-                } else {
-                    p[offset] &= value;
-                    p[offset + 1] &= value >> 8;
-                    p[offset + 2] &= value >> 16;
-                    p[offset + 3] &= value >> 24;
-                }
-                pflash_update(pfl, offset, 4);
-                break;
             }
             pfl->status = 0x00 | ~(value & 0x80);
             /* Let's pretend write is immediate */
@@ -404,9 +406,11 @@ static void pflash_write (pflash_t *pfl, target_phys_addr_t offset,
             }
             /* Chip erase */
             DPRINTF("%s: start chip erase\n", __func__);
-            memset(pfl->storage, 0xFF, pfl->chip_len);
+            if (!pfl->ro) {
+                memset(pfl->storage, 0xFF, pfl->chip_len);
+                pflash_update(pfl, 0, pfl->chip_len);
+            }
             pfl->status = 0x00;
-            pflash_update(pfl, 0, pfl->chip_len);
             /* Let's wait 5 seconds before chip erase is done */
             qemu_mod_timer(pfl->timer,
                            qemu_get_clock_ns(vm_clock) + (get_ticks_per_sec() * 5));
@@ -417,8 +421,10 @@ static void pflash_write (pflash_t *pfl, target_phys_addr_t offset,
             offset &= ~(pfl->sector_len - 1);
             DPRINTF("%s: start sector erase at " TARGET_FMT_plx "\n", __func__,
                     offset);
-            memset(p + offset, 0xFF, pfl->sector_len);
-            pflash_update(pfl, offset, pfl->sector_len);
+            if (!pfl->ro) {
+                memset(p + offset, 0xFF, pfl->sector_len);
+                pflash_update(pfl, offset, pfl->sector_len);
+            }
             pfl->status = 0x00;
             /* Let's wait 1/2 second before sector erase is done */
             qemu_mod_timer(pfl->timer,
@@ -645,16 +651,17 @@ pflash_t *pflash_cfi02_register(target_phys_addr_t base,
         }
         bdrv_attach_dev_nofail(pfl->bs, pfl);
     }
+
     pflash_setup_mappings(pfl);
     pfl->rom_mode = 1;
     memory_region_add_subregion(get_system_memory(), pfl->base, &pfl->mem);
-#if 0 /* XXX: there should be a bit to set up read-only,
-       *      the same way the hardware does (with WP pin).
-       */
-    pfl->ro = 1;
-#else
-    pfl->ro = 0;
-#endif
+
+    if (pfl->bs) {
+        pfl->ro = bdrv_is_read_only(pfl->bs);
+    } else {
+        pfl->ro = 0;
+    }
+
     pfl->timer = qemu_new_timer_ns(vm_clock, pflash_timer, pfl);
     pfl->sector_len = sector_len;
     pfl->width = width;
-- 
1.7.1

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

* [Qemu-devel] [PATCH v11 3/9] vl: make find_default_machine externally visible
  2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 1/9] blockdev: allow read-only pflash devices Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 2/9] pflash_cfi01/02: support " Jordan Justen
@ 2012-02-22  7:18 ` Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 4/9] hw/pc: move rom init to pc_sysfw.c Jordan Justen
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Jordan Justen @ 2012-02-22  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jordan Justen

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 hw/boards.h |    1 +
 vl.c        |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/boards.h b/hw/boards.h
index f6d3784..667177d 100644
--- a/hw/boards.h
+++ b/hw/boards.h
@@ -32,6 +32,7 @@ typedef struct QEMUMachine {
 } QEMUMachine;
 
 int qemu_register_machine(QEMUMachine *m);
+QEMUMachine *find_default_machine(void);
 
 extern QEMUMachine *current_machine;
 
diff --git a/vl.c b/vl.c
index d8a521a..5549fcd 100644
--- a/vl.c
+++ b/vl.c
@@ -1187,7 +1187,7 @@ static QEMUMachine *find_machine(const char *name)
     return NULL;
 }
 
-static QEMUMachine *find_default_machine(void)
+QEMUMachine *find_default_machine(void)
 {
     QEMUMachine *m;
 
-- 
1.7.1

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

* [Qemu-devel] [PATCH v11 4/9] hw/pc: move rom init to pc_sysfw.c
  2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
                   ` (2 preceding siblings ...)
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 3/9] vl: make find_default_machine externally visible Jordan Justen
@ 2012-02-22  7:18 ` Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 5/9] hw/pc_sysfw: enable pc-sysfw as a qdev Jordan Justen
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Jordan Justen @ 2012-02-22  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jordan Justen

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 Makefile.target |    1 +
 hw/pc.c         |   56 +++------------------------------
 hw/pc.h         |    3 ++
 hw/pc_sysfw.c   |   92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 101 insertions(+), 51 deletions(-)
 create mode 100644 hw/pc_sysfw.c

diff --git a/Makefile.target b/Makefile.target
index 651500e..2fc9f39 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -241,6 +241,7 @@ obj-i386-y += vmport.o
 obj-i386-y += pci-hotplug.o smbios.o wdt_ib700.o
 obj-i386-y += debugcon.o multiboot.o
 obj-i386-y += pc_piix.o
+obj-i386-y += pc_sysfw.o
 obj-i386-$(CONFIG_KVM) += kvm/clock.o kvm/apic.o kvm/i8259.o kvm/ioapic.o
 obj-i386-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o
 
diff --git a/hw/pc.c b/hw/pc.c
index 5746129..b9f4bc7 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -60,10 +60,6 @@
 #define DPRINTF(fmt, ...)
 #endif
 
-#define BIOS_FILENAME "bios.bin"
-
-#define PC_MAX_BIOS_SIZE (4 * 1024 * 1024)
-
 /* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables.  */
 #define ACPI_DATA_SIZE       0x10000
 #define BIOS_CFG_IOPORT 0x510
@@ -990,11 +986,9 @@ void pc_memory_init(MemoryRegion *system_memory,
                     MemoryRegion *rom_memory,
                     MemoryRegion **ram_memory)
 {
-    char *filename;
-    int ret, linux_boot, i;
-    MemoryRegion *ram, *bios, *isa_bios, *option_rom_mr;
+    int linux_boot, i;
+    MemoryRegion *ram, *option_rom_mr;
     MemoryRegion *ram_below_4g, *ram_above_4g;
-    int bios_size, isa_bios_size;
     void *fw_cfg;
 
     linux_boot = (kernel_filename != NULL);
@@ -1020,44 +1014,9 @@ void pc_memory_init(MemoryRegion *system_memory,
                                     ram_above_4g);
     }
 
-    /* BIOS load */
-    if (bios_name == NULL)
-        bios_name = BIOS_FILENAME;
-    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
-    if (filename) {
-        bios_size = get_image_size(filename);
-    } else {
-        bios_size = -1;
-    }
-    if (bios_size <= 0 ||
-        (bios_size % 65536) != 0) {
-        goto bios_error;
-    }
-    bios = g_malloc(sizeof(*bios));
-    memory_region_init_ram(bios, "pc.bios", bios_size);
-    vmstate_register_ram_global(bios);
-    memory_region_set_readonly(bios, true);
-    ret = rom_add_file_fixed(bios_name, (uint32_t)(-bios_size), -1);
-    if (ret != 0) {
-    bios_error:
-        fprintf(stderr, "qemu: could not load PC BIOS '%s'\n", bios_name);
-        exit(1);
-    }
-    if (filename) {
-        g_free(filename);
-    }
-    /* map the last 128KB of the BIOS in ISA space */
-    isa_bios_size = bios_size;
-    if (isa_bios_size > (128 * 1024))
-        isa_bios_size = 128 * 1024;
-    isa_bios = g_malloc(sizeof(*isa_bios));
-    memory_region_init_alias(isa_bios, "isa-bios", bios,
-                             bios_size - isa_bios_size, isa_bios_size);
-    memory_region_add_subregion_overlap(rom_memory,
-                                        0x100000 - isa_bios_size,
-                                        isa_bios,
-                                        1);
-    memory_region_set_readonly(isa_bios, true);
+
+    /* Initialize PC system firmware */
+    pc_system_firmware_init(rom_memory);
 
     option_rom_mr = g_malloc(sizeof(*option_rom_mr));
     memory_region_init_ram(option_rom_mr, "pc.rom", PC_ROM_SIZE);
@@ -1067,11 +1026,6 @@ void pc_memory_init(MemoryRegion *system_memory,
                                         option_rom_mr,
                                         1);
 
-    /* map all the bios at the top of memory */
-    memory_region_add_subregion(rom_memory,
-                                (uint32_t)(-bios_size),
-                                bios);
-
     fw_cfg = bochs_bios_init();
     rom_set_fw(fw_cfg);
 
diff --git a/hw/pc.h b/hw/pc.h
index 1b47bbd..71f7df3 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -216,6 +216,9 @@ static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
     return true;
 }
 
+/* pc_sysfw.c */
+void pc_system_firmware_init(MemoryRegion *rom_memory);
+
 /* e820 types */
 #define E820_RAM        1
 #define E820_RESERVED   2
diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
new file mode 100644
index 0000000..b0bb7b8
--- /dev/null
+++ b/hw/pc_sysfw.c
@@ -0,0 +1,92 @@
+/*
+ * QEMU PC System Firmware
+ *
+ * Copyright (c) 2003-2004 Fabrice Bellard
+ * Copyright (c) 2011-2012 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "pc.h"
+#include "loader.h"
+#include "sysemu.h"
+
+#define BIOS_FILENAME "bios.bin"
+
+static void pc_system_rom_init(MemoryRegion *rom_memory)
+{
+    char *filename;
+    MemoryRegion *bios, *isa_bios;
+    int bios_size, isa_bios_size;
+    int ret;
+
+    /* BIOS load */
+    if (bios_name == NULL) {
+        bios_name = BIOS_FILENAME;
+    }
+    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+    if (filename) {
+        bios_size = get_image_size(filename);
+    } else {
+        bios_size = -1;
+    }
+    if (bios_size <= 0 ||
+        (bios_size % 65536) != 0) {
+        goto bios_error;
+    }
+    bios = g_malloc(sizeof(*bios));
+    memory_region_init_ram(bios, "pc.bios", bios_size);
+    vmstate_register_ram_global(bios);
+    memory_region_set_readonly(bios, true);
+    ret = rom_add_file_fixed(bios_name, (uint32_t)(-bios_size), -1);
+    if (ret != 0) {
+    bios_error:
+        fprintf(stderr, "qemu: could not load PC BIOS '%s'\n", bios_name);
+        exit(1);
+    }
+    if (filename) {
+        g_free(filename);
+    }
+
+    /* map the last 128KB of the BIOS in ISA space */
+    isa_bios_size = bios_size;
+    if (isa_bios_size > (128 * 1024)) {
+        isa_bios_size = 128 * 1024;
+    }
+    isa_bios = g_malloc(sizeof(*isa_bios));
+    memory_region_init_alias(isa_bios, "isa-bios", bios,
+                             bios_size - isa_bios_size, isa_bios_size);
+    memory_region_add_subregion_overlap(rom_memory,
+                                        0x100000 - isa_bios_size,
+                                        isa_bios,
+                                        1);
+    memory_region_set_readonly(isa_bios, true);
+
+    /* map all the bios at the top of memory */
+    memory_region_add_subregion(rom_memory,
+                                (uint32_t)(-bios_size),
+                                bios);
+}
+
+void pc_system_firmware_init(MemoryRegion *rom_memory)
+{
+    pc_system_rom_init(rom_memory);
+}
+
+
-- 
1.7.1

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

* [Qemu-devel] [PATCH v11 5/9] hw/pc_sysfw: enable pc-sysfw as a qdev
  2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
                   ` (3 preceding siblings ...)
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 4/9] hw/pc: move rom init to pc_sysfw.c Jordan Justen
@ 2012-02-22  7:18 ` Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 6/9] hw/pc_sysfw: support system flash memory with pflash Jordan Justen
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Jordan Justen @ 2012-02-22  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jordan Justen

Setup a pc-sysfw device type.  It contains a single
property of 'rom_only' which is defaulted to enabled.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 hw/pc_sysfw.c |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
index b0bb7b8..ae5c4b1 100644
--- a/hw/pc_sysfw.c
+++ b/hw/pc_sysfw.c
@@ -23,12 +23,19 @@
  * THE SOFTWARE.
  */
 
+#include "sysbus.h"
+#include "hw.h"
 #include "pc.h"
 #include "loader.h"
 #include "sysemu.h"
 
 #define BIOS_FILENAME "bios.bin"
 
+typedef struct PcSysFwDevice {
+    SysBusDevice busdev;
+    uint8_t rom_only;
+} PcSysFwDevice;
+
 static void pc_system_rom_init(MemoryRegion *rom_memory)
 {
     char *filename;
@@ -86,7 +93,37 @@ static void pc_system_rom_init(MemoryRegion *rom_memory)
 
 void pc_system_firmware_init(MemoryRegion *rom_memory)
 {
+    PcSysFwDevice *sysfw_dev;
+
+    sysfw_dev = (PcSysFwDevice*) qdev_create(NULL, "pc-sysfw");
+
     pc_system_rom_init(rom_memory);
 }
 
+static Property pcsysfw_properties[] = {
+    DEFINE_PROP_UINT8("rom_only", PcSysFwDevice, rom_only, 1),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void pcsysfw_class_init (ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS (klass);
+
+    dc->desc = "PC System Firmware";
+    dc->props = pcsysfw_properties;
+}
+
+static TypeInfo pcsysfw_info = {
+    .name          = "pc-sysfw",
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof (PcSysFwDevice),
+    .class_init    = pcsysfw_class_init,
+};
+
+static void pcsysfw_register (void)
+{
+    type_register_static (&pcsysfw_info);
+}
+
+type_init (pcsysfw_register);
 
-- 
1.7.1

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

* [Qemu-devel] [PATCH v11 6/9] hw/pc_sysfw: support system flash memory with pflash
  2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
                   ` (4 preceding siblings ...)
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 5/9] hw/pc_sysfw: enable pc-sysfw as a qdev Jordan Justen
@ 2012-02-22  7:18 ` Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 7/9] hw/pc_piix: remove is_default for pc-0.15 Jordan Justen
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Jordan Justen @ 2012-02-22  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jordan Justen

Flash can be enabled by calling pc_system_firmware_init
with the system_flash_enabled parameter being non-zero.
If system_flash_enabled is zero, then the older qemu
rom creation method will be used.

If flash is enabled and a pflash image is found, then
it is used for the system firmware image.

If flash is enabled and a pflash image is not initially
found, then a read-only pflash device is created using
the -bios filename.

KVM cannot execute from a pflash region currently.
Therefore, when KVM is enabled, the old rom based
initialization method is used.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 default-configs/i386-softmmu.mak   |    1 +
 default-configs/x86_64-softmmu.mak |    1 +
 hw/pc_sysfw.c                      |  129 +++++++++++++++++++++++++++++++++++-
 3 files changed, 129 insertions(+), 2 deletions(-)

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 662348e..2c78175 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -24,3 +24,4 @@ CONFIG_SOUND=y
 CONFIG_HPET=y
 CONFIG_APPLESMC=y
 CONFIG_I8259=y
+CONFIG_PFLASH_CFI01=y
diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
index b445be2..233a856 100644
--- a/default-configs/x86_64-softmmu.mak
+++ b/default-configs/x86_64-softmmu.mak
@@ -24,3 +24,4 @@ CONFIG_SOUND=y
 CONFIG_HPET=y
 CONFIG_APPLESMC=y
 CONFIG_I8259=y
+CONFIG_PFLASH_CFI01=y
diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
index ae5c4b1..972706c 100644
--- a/hw/pc_sysfw.c
+++ b/hw/pc_sysfw.c
@@ -26,8 +26,11 @@
 #include "sysbus.h"
 #include "hw.h"
 #include "pc.h"
+#include "hw/boards.h"
 #include "loader.h"
 #include "sysemu.h"
+#include "flash.h"
+#include "kvm.h"
 
 #define BIOS_FILENAME "bios.bin"
 
@@ -36,7 +39,96 @@ typedef struct PcSysFwDevice {
     uint8_t rom_only;
 } PcSysFwDevice;
 
-static void pc_system_rom_init(MemoryRegion *rom_memory)
+static void pc_isa_bios_init(MemoryRegion *rom_memory,
+                             MemoryRegion *flash_mem,
+                             int ram_size)
+{
+    int isa_bios_size;
+    MemoryRegion *isa_bios;
+    uint64_t flash_size;
+    void *flash_ptr, *isa_bios_ptr;
+
+    flash_size = memory_region_size(flash_mem);
+
+    /* map the last 128KB of the BIOS in ISA space */
+    isa_bios_size = flash_size;
+    if (isa_bios_size > (128 * 1024)) {
+        isa_bios_size = 128 * 1024;
+    }
+    isa_bios = g_malloc(sizeof(*isa_bios));
+    memory_region_init_ram(isa_bios, "isa-bios", isa_bios_size);
+    vmstate_register_ram_global(isa_bios);
+    memory_region_add_subregion_overlap(rom_memory,
+                                        0x100000 - isa_bios_size,
+                                        isa_bios,
+                                        1);
+
+    /* copy ISA rom image from top of flash memory */
+    flash_ptr = memory_region_get_ram_ptr(flash_mem);
+    isa_bios_ptr = memory_region_get_ram_ptr(isa_bios);
+    memcpy(isa_bios_ptr,
+           ((uint8_t*)flash_ptr) + (flash_size - isa_bios_size),
+           isa_bios_size);
+
+    memory_region_set_readonly(isa_bios, true);
+}
+
+static void pc_fw_add_pflash_drv(void)
+{
+    QemuOpts *opts;
+    QEMUMachine *machine;
+    char *filename;
+
+    if (bios_name == NULL) {
+        bios_name = BIOS_FILENAME;
+    }
+    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+
+    opts = drive_add(IF_PFLASH, -1, filename, "readonly=on");
+    if (opts == NULL) {
+      return;
+    }
+
+    machine = find_default_machine();
+    if (machine == NULL) {
+      return;
+    }
+
+    drive_init(opts, machine->use_scsi);
+}
+
+static void pc_system_flash_init(MemoryRegion *rom_memory,
+                                 DriveInfo *pflash_drv)
+{
+    BlockDriverState *bdrv;
+    int64_t size;
+    target_phys_addr_t phys_addr;
+    int sector_bits, sector_size;
+    pflash_t *system_flash;
+    MemoryRegion *flash_mem;
+
+    bdrv = pflash_drv->bdrv;
+    size = bdrv_getlength(pflash_drv->bdrv);
+    sector_bits = 12;
+    sector_size = 1 << sector_bits;
+
+    if ((size % sector_size) != 0) {
+        fprintf(stderr,
+                "qemu: PC system firmware (pflash) must be a multiple of 0x%x\n",
+                sector_size);
+        exit(1);
+    }
+
+    phys_addr = 0x100000000ULL - size;
+    system_flash = pflash_cfi01_register(phys_addr, NULL, "system.flash", size,
+                                         bdrv, sector_size, size >> sector_bits,
+                                         1, 0x0000, 0x0000, 0x0000, 0x0000, 0);
+    flash_mem = pflash_cfi01_get_memory(system_flash);
+
+    pc_isa_bios_init(rom_memory, flash_mem, size);
+}
+
+static void old_pc_system_rom_init(MemoryRegion *rom_memory)
 {
     char *filename;
     MemoryRegion *bios, *isa_bios;
@@ -93,11 +185,44 @@ static void pc_system_rom_init(MemoryRegion *rom_memory)
 
 void pc_system_firmware_init(MemoryRegion *rom_memory)
 {
+    DriveInfo *pflash_drv;
     PcSysFwDevice *sysfw_dev;
 
     sysfw_dev = (PcSysFwDevice*) qdev_create(NULL, "pc-sysfw");
 
-    pc_system_rom_init(rom_memory);
+    if (sysfw_dev->rom_only) {
+        old_pc_system_rom_init(rom_memory);
+        return;
+    }
+
+    pflash_drv = drive_get(IF_PFLASH, 0, 0);
+
+    /* Currently KVM cannot execute from device memory.
+       Use old rom based firmware initialization for KVM. */
+    if (kvm_enabled()) {
+        if (pflash_drv != NULL) {
+            fprintf(stderr, "qemu: pflash cannot be used with kvm enabled\n");
+            exit(1);
+        } else {
+            sysfw_dev->rom_only = 1;
+            old_pc_system_rom_init(rom_memory);
+            return;
+        }
+    }
+
+    /* If a pflash drive is not found, then create one using
+       the bios filename. */
+    if (pflash_drv == NULL) {
+        pc_fw_add_pflash_drv();
+        pflash_drv = drive_get(IF_PFLASH, 0, 0);
+    }
+
+    if (pflash_drv != NULL) {
+        pc_system_flash_init(rom_memory, pflash_drv);
+    } else {
+        fprintf(stderr, "qemu: PC system firmware (pflash) not available\n");
+        exit(1);
+    }
 }
 
 static Property pcsysfw_properties[] = {
-- 
1.7.1

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

* [Qemu-devel] [PATCH v11 7/9] hw/pc_piix: remove is_default for pc-0.15
  2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
                   ` (5 preceding siblings ...)
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 6/9] hw/pc_sysfw: support system flash memory with pflash Jordan Justen
@ 2012-02-22  7:18 ` Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 8/9] hw/pc_piix: add pc-1.1 Jordan Justen
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Jordan Justen @ 2012-02-22  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jordan Justen

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 hw/pc_piix.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 17f8d5d..2fc4211 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -385,7 +385,6 @@ static QEMUMachine pc_machine_v0_15 = {
     .desc = "Standard PC",
     .init = pc_init_pci,
     .max_cpus = 255,
-    .is_default = 1,
 };
 
 static QEMUMachine pc_machine_v0_14 = {
-- 
1.7.1

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

* [Qemu-devel] [PATCH v11 8/9] hw/pc_piix: add pc-1.1
  2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
                   ` (6 preceding siblings ...)
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 7/9] hw/pc_piix: remove is_default for pc-0.15 Jordan Justen
@ 2012-02-22  7:18 ` Jordan Justen
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 9/9] pc_piix/pc_sysfw: enable flash by default Jordan Justen
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: Jordan Justen @ 2012-02-22  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jordan Justen

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 hw/pc_piix.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 2fc4211..fcf0153 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -371,8 +371,8 @@ static void pc_xen_hvm_init(ram_addr_t ram_size,
 }
 #endif
 
-static QEMUMachine pc_machine_v1_0 = {
-    .name = "pc-1.0",
+static QEMUMachine pc_machine_v1_1 = {
+    .name = "pc-1.1",
     .alias = "pc",
     .desc = "Standard PC",
     .init = pc_init_pci,
@@ -380,6 +380,13 @@ static QEMUMachine pc_machine_v1_0 = {
     .is_default = 1,
 };
 
+static QEMUMachine pc_machine_v1_0 = {
+    .name = "pc-1.0",
+    .desc = "Standard PC",
+    .init = pc_init_pci,
+    .max_cpus = 255,
+};
+
 static QEMUMachine pc_machine_v0_15 = {
     .name = "pc-0.15",
     .desc = "Standard PC",
@@ -669,6 +676,7 @@ static QEMUMachine xenfv_machine = {
 
 static void pc_machine_init(void)
 {
+    qemu_register_machine(&pc_machine_v1_1);
     qemu_register_machine(&pc_machine_v1_0);
     qemu_register_machine(&pc_machine_v0_15);
     qemu_register_machine(&pc_machine_v0_14);
-- 
1.7.1

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

* [Qemu-devel] [PATCH v11 9/9] pc_piix/pc_sysfw: enable flash by default
  2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
                   ` (7 preceding siblings ...)
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 8/9] hw/pc_piix: add pc-1.1 Jordan Justen
@ 2012-02-22  7:18 ` Jordan Justen
  2012-02-22 18:54 ` [Qemu-devel] [PATCH v11 0/9] PC system flash support Anthony Liguori
  2012-03-13 12:34 ` Paolo Bonzini
  10 siblings, 0 replies; 13+ messages in thread
From: Jordan Justen @ 2012-02-22  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jordan Justen

Now, the pc-sysfw:rom_only property will default
to false which enables flash by default.

All pc types below pc-1.1 set rom_only to true.
This prevents flash from being enabled on these
pc machine types.

For pc-1.1 rom_only will use the default (false),
which will allow flash to be used for pc-1.1.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
---
 hw/pc_piix.c  |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 hw/pc_sysfw.c |    2 +-
 2 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index fcf0153..fe7a729 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -385,6 +385,14 @@ static QEMUMachine pc_machine_v1_0 = {
     .desc = "Standard PC",
     .init = pc_init_pci,
     .max_cpus = 255,
+    .compat_props = (GlobalProperty[]) {
+        {
+            .driver   = "pc-sysfw",
+            .property = "rom_only",
+            .value    = stringify(1),
+        },
+        { /* end of list */ }
+    },
 };
 
 static QEMUMachine pc_machine_v0_15 = {
@@ -392,6 +400,14 @@ static QEMUMachine pc_machine_v0_15 = {
     .desc = "Standard PC",
     .init = pc_init_pci,
     .max_cpus = 255,
+    .compat_props = (GlobalProperty[]) {
+        {
+            .driver   = "pc-sysfw",
+            .property = "rom_only",
+            .value    = stringify(1),
+        },
+        { /* end of list */ }
+    },
 };
 
 static QEMUMachine pc_machine_v0_14 = {
@@ -425,6 +441,11 @@ static QEMUMachine pc_machine_v0_14 = {
             .property = "event_idx",
             .value    = "off",
         },
+        {
+            .driver   = "pc-sysfw",
+            .property = "rom_only",
+            .value    = stringify(1),
+        },
         { /* end of list */ }
     },
 };
@@ -472,6 +493,11 @@ static QEMUMachine pc_machine_v0_13 = {
             .property = "use_broken_id",
             .value    = stringify(1),
         },
+        {
+            .driver   = "pc-sysfw",
+            .property = "rom_only",
+            .value    = stringify(1),
+        },
         { /* end of list */ }
     },
 };
@@ -523,6 +549,11 @@ static QEMUMachine pc_machine_v0_12 = {
             .property = "use_broken_id",
             .value    = stringify(1),
         },
+        {
+            .driver   = "pc-sysfw",
+            .property = "rom_only",
+            .value    = stringify(1),
+        },
         { /* end of list */ }
     }
 };
@@ -582,6 +613,11 @@ static QEMUMachine pc_machine_v0_11 = {
             .property = "use_broken_id",
             .value    = stringify(1),
         },
+        {
+            .driver   = "pc-sysfw",
+            .property = "rom_only",
+            .value    = stringify(1),
+        },
         { /* end of list */ }
     }
 };
@@ -653,6 +689,11 @@ static QEMUMachine pc_machine_v0_10 = {
             .property = "use_broken_id",
             .value    = stringify(1),
         },
+        {
+            .driver   = "pc-sysfw",
+            .property = "rom_only",
+            .value    = stringify(1),
+        },
         { /* end of list */ }
     },
 };
@@ -662,6 +703,14 @@ static QEMUMachine isapc_machine = {
     .desc = "ISA-only PC",
     .init = pc_init_isa,
     .max_cpus = 1,
+    .compat_props = (GlobalProperty[]) {
+        {
+            .driver   = "pc-sysfw",
+            .property = "rom_only",
+            .value    = stringify(1),
+        },
+        { /* end of list */ }
+    },
 };
 
 #ifdef CONFIG_XEN
diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
index 972706c..abf9004 100644
--- a/hw/pc_sysfw.c
+++ b/hw/pc_sysfw.c
@@ -226,7 +226,7 @@ void pc_system_firmware_init(MemoryRegion *rom_memory)
 }
 
 static Property pcsysfw_properties[] = {
-    DEFINE_PROP_UINT8("rom_only", PcSysFwDevice, rom_only, 1),
+    DEFINE_PROP_UINT8("rom_only", PcSysFwDevice, rom_only, 0),
     DEFINE_PROP_END_OF_LIST(),
 };
 
-- 
1.7.1

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

* Re: [Qemu-devel] [PATCH v11 0/9] PC system flash support
  2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
                   ` (8 preceding siblings ...)
  2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 9/9] pc_piix/pc_sysfw: enable flash by default Jordan Justen
@ 2012-02-22 18:54 ` Anthony Liguori
  2012-03-13 12:34 ` Paolo Bonzini
  10 siblings, 0 replies; 13+ messages in thread
From: Anthony Liguori @ 2012-02-22 18:54 UTC (permalink / raw)
  To: Jordan Justen; +Cc: qemu-devel

On 02/22/2012 01:18 AM, Jordan Justen wrote:
> Enable flash emulation in a PC system using pflash_cfi01.

Applied all.

I know it's taken a while to get these merged, but I'm very pleased with the 
final result.  Thanks for sticking through it!

Regards,

Anthony Liguori

>
> v11:
> * Convert pc-sysfw to qdev
>    - Add rom_only property
> * Remove KVM flash support to remove the need for using
>    bdrv_read during machine initialization.  KVM should
>    now continue to use the same 'rom' initialization
>    sequence that it uses today.
>
> v10:
> * Rebase to HEAD
> * "decouple vmstate from memory API" as in c5705a7
> * Break changes into smaller pieces
>
> v9:
> * Add pc-1.1
> * pc-1.0 uses previous rom firmware init code path
>
> v8:
> * Cleanup two chunks of debug code (printf messages)
> * Fix comment in pc.h (pcflash.c =>  pc_sysfw.c)
>
> v7:
> * Do not add system firmware to qemu roms
> * If kvm is enabled, copy pflash drive contents into a
>    read-only ram region, since kvm cannot currently execute
>    code from a pflash device.
> * Rename pcflash.c to pc_sysfw.c
>
> v6:
> * Rebase for memory API
> * pflash_cfi01: Set error in status register when a write to
>    erase is attempted in read-only mode.
> * Add system firmware to qemu roms
>
> v5:
> * Enable pflash read-only mode
> * Enable -drive with if=pflash to define system firmware image
>
> v4:
> * Rebase
>
> v3:
> * Fix code style issues
> * Add additional comments
>
> v2:
> * Convert debug printf to DPRINTF
>
> Jordan Justen (9):
>    blockdev: allow read-only pflash devices
>    pflash_cfi01/02: support read-only pflash devices
>    vl: make find_default_machine externally visible
>    hw/pc: move rom init to pc_sysfw.c
>    hw/pc_sysfw: enable pc-sysfw as a qdev
>    hw/pc_sysfw: support system flash memory with pflash
>    hw/pc_piix: remove is_default for pc-0.15
>    hw/pc_piix: add pc-1.1
>    pc_piix/pc_sysfw: enable flash by default
>
>   Makefile.target                    |    1 +
>   blockdev.c                         |    3 +-
>   default-configs/i386-softmmu.mak   |    1 +
>   default-configs/x86_64-softmmu.mak |    1 +
>   hw/boards.h                        |    1 +
>   hw/pc.c                            |   56 +-------
>   hw/pc.h                            |    3 +
>   hw/pc_piix.c                       |   62 +++++++++-
>   hw/pc_sysfw.c                      |  254 ++++++++++++++++++++++++++++++++++++
>   hw/pflash_cfi01.c                  |   44 +++++--
>   hw/pflash_cfi02.c                  |   83 +++++++------
>   vl.c                               |    2 +-
>   12 files changed, 403 insertions(+), 108 deletions(-)
>   create mode 100644 hw/pc_sysfw.c
>
>
>

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

* Re: [Qemu-devel] [PATCH v11 0/9] PC system flash support
  2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
                   ` (9 preceding siblings ...)
  2012-02-22 18:54 ` [Qemu-devel] [PATCH v11 0/9] PC system flash support Anthony Liguori
@ 2012-03-13 12:34 ` Paolo Bonzini
  2012-03-14 17:04   ` Jordan Justen
  10 siblings, 1 reply; 13+ messages in thread
From: Paolo Bonzini @ 2012-03-13 12:34 UTC (permalink / raw)
  To: Jordan Justen; +Cc: qemu-devel

Il 22/02/2012 08:18, Jordan Justen ha scritto:
> Enable flash emulation in a PC system using pflash_cfi01.

Jordan, can you document this on the wiki
(http://wiki.qemu.org/ChangeLog/1.1#x86)? I found
http://wiki.qemu.org/Features/PC_System_Flash but I do not really
understand what it is used for etc.

If you need an account, you can ask on the mailing list and/or post the
text here for me to include it.

Paolo

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

* Re: [Qemu-devel] [PATCH v11 0/9] PC system flash support
  2012-03-13 12:34 ` Paolo Bonzini
@ 2012-03-14 17:04   ` Jordan Justen
  0 siblings, 0 replies; 13+ messages in thread
From: Jordan Justen @ 2012-03-14 17:04 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Jordan Justen, qemu-devel

On Tue, Mar 13, 2012 at 05:34, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 22/02/2012 08:18, Jordan Justen ha scritto:
>> Enable flash emulation in a PC system using pflash_cfi01.
>
> Jordan, can you document this on the wiki
> (http://wiki.qemu.org/ChangeLog/1.1#x86)? I found
> http://wiki.qemu.org/Features/PC_System_Flash but I do not really
> understand what it is used for etc.

I updated both wiki pages.  Do they look okay now?

-Jordan

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

end of thread, other threads:[~2012-03-14 17:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-22  7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 1/9] blockdev: allow read-only pflash devices Jordan Justen
2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 2/9] pflash_cfi01/02: support " Jordan Justen
2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 3/9] vl: make find_default_machine externally visible Jordan Justen
2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 4/9] hw/pc: move rom init to pc_sysfw.c Jordan Justen
2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 5/9] hw/pc_sysfw: enable pc-sysfw as a qdev Jordan Justen
2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 6/9] hw/pc_sysfw: support system flash memory with pflash Jordan Justen
2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 7/9] hw/pc_piix: remove is_default for pc-0.15 Jordan Justen
2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 8/9] hw/pc_piix: add pc-1.1 Jordan Justen
2012-02-22  7:18 ` [Qemu-devel] [PATCH v11 9/9] pc_piix/pc_sysfw: enable flash by default Jordan Justen
2012-02-22 18:54 ` [Qemu-devel] [PATCH v11 0/9] PC system flash support Anthony Liguori
2012-03-13 12:34 ` Paolo Bonzini
2012-03-14 17:04   ` Jordan Justen

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