From: Jordan Justen <jordan.l.justen@intel.com>
To: qemu-devel@nongnu.org
Cc: Jordan Justen <jordan.l.justen@intel.com>, Avi Kivity <avi@redhat.com>
Subject: [Qemu-devel] [PATCH v9 1/3] pc: Add pc-1.1 machine type
Date: Thu, 15 Dec 2011 12:51:11 -0800 [thread overview]
Message-ID: <1323982273-13623-2-git-send-email-jordan.l.justen@intel.com> (raw)
In-Reply-To: <1323982273-13623-1-git-send-email-jordan.l.justen@intel.com>
This machine type adds a new system_firmware_enabled
parameter which is passed into pc_memory_init.
This will be used by the system firmware support which
enables a flash memory to be used with qemu.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Avi Kivity <avi@redhat.com>
---
hw/pc.c | 3 ++-
hw/pc.h | 3 ++-
hw/pc_piix.c | 40 ++++++++++++++++++++++++++++++++--------
3 files changed, 36 insertions(+), 10 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index 33778fe..cc6cfad 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -971,7 +971,8 @@ void pc_memory_init(MemoryRegion *system_memory,
ram_addr_t below_4g_mem_size,
ram_addr_t above_4g_mem_size,
MemoryRegion *rom_memory,
- MemoryRegion **ram_memory)
+ MemoryRegion **ram_memory,
+ int system_firmware_enabled)
{
char *filename;
int ret, linux_boot, i;
diff --git a/hw/pc.h b/hw/pc.h
index b7b7e40..49471cb 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -138,7 +138,8 @@ void pc_memory_init(MemoryRegion *system_memory,
ram_addr_t below_4g_mem_size,
ram_addr_t above_4g_mem_size,
MemoryRegion *rom_memory,
- MemoryRegion **ram_memory);
+ MemoryRegion **ram_memory,
+ int system_firmware_enabled);
qemu_irq *pc_allocate_cpu_irq(void);
void pc_vga_init(PCIBus *pci_bus);
void pc_basic_device_init(qemu_irq *gsi,
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 970f43c..007f10c 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -79,7 +79,8 @@ static void pc_init1(MemoryRegion *system_memory,
const char *initrd_filename,
const char *cpu_model,
int pci_enabled,
- int kvmclock_enabled)
+ int kvmclock_enabled,
+ int system_firmware_enabled)
{
int i;
ram_addr_t below_4g_mem_size, above_4g_mem_size;
@@ -128,7 +129,8 @@ static void pc_init1(MemoryRegion *system_memory,
pc_memory_init(system_memory,
kernel_filename, kernel_cmdline, initrd_filename,
below_4g_mem_size, above_4g_mem_size,
- pci_enabled ? rom_memory : system_memory, &ram_memory);
+ pci_enabled ? rom_memory : system_memory, &ram_memory,
+ system_firmware_enabled);
}
gsi_state = g_malloc0(sizeof(*gsi_state));
@@ -246,7 +248,21 @@ static void pc_init_pci(ram_addr_t ram_size,
get_system_io(),
ram_size, boot_device,
kernel_filename, kernel_cmdline,
- initrd_filename, cpu_model, 1, 1);
+ initrd_filename, cpu_model, 1, 1, 1);
+}
+
+static void pc_init_pci_system_rom_only(ram_addr_t ram_size,
+ const char *boot_device,
+ const char *kernel_filename,
+ const char *kernel_cmdline,
+ const char *initrd_filename,
+ const char *cpu_model)
+{
+ pc_init1(get_system_memory(),
+ get_system_io(),
+ ram_size, boot_device,
+ kernel_filename, kernel_cmdline,
+ initrd_filename, cpu_model, 1, 1, 0);
}
static void pc_init_pci_no_kvmclock(ram_addr_t ram_size,
@@ -260,7 +276,7 @@ static void pc_init_pci_no_kvmclock(ram_addr_t ram_size,
get_system_io(),
ram_size, boot_device,
kernel_filename, kernel_cmdline,
- initrd_filename, cpu_model, 1, 0);
+ initrd_filename, cpu_model, 1, 0, 0);
}
static void pc_init_isa(ram_addr_t ram_size,
@@ -276,7 +292,7 @@ static void pc_init_isa(ram_addr_t ram_size,
get_system_io(),
ram_size, boot_device,
kernel_filename, kernel_cmdline,
- initrd_filename, cpu_model, 0, 1);
+ initrd_filename, cpu_model, 0, 1, 0);
}
#ifdef CONFIG_XEN
@@ -297,8 +313,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,
@@ -306,10 +322,17 @@ 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_system_rom_only,
+ .max_cpus = 255,
+};
+
static QEMUMachine pc_machine_v0_14 = {
.name = "pc-0.14",
.desc = "Standard PC",
- .init = pc_init_pci,
+ .init = pc_init_pci_system_rom_only,
.max_cpus = 255,
.compat_props = (GlobalProperty[]) {
{
@@ -556,6 +579,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_14);
qemu_register_machine(&pc_machine_v0_13);
--
1.7.1
next prev parent reply other threads:[~2011-12-15 20:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-15 20:51 [Qemu-devel] [PATCH v9 0/3] PC system flash support Jordan Justen
2011-12-15 20:51 ` Jordan Justen [this message]
2011-12-15 20:51 ` [Qemu-devel] [PATCH v9 2/3] pflash: Support read-only mode Jordan Justen
2011-12-15 20:51 ` [Qemu-devel] [PATCH v9 3/3] pc: Support system flash memory with pflash Jordan Justen
2011-12-19 19:41 ` Anthony Liguori
2011-12-19 21:25 ` Jordan Justen
2011-12-19 22:19 ` Anthony Liguori
2012-01-09 9:28 ` Kevin Wolf
2012-01-28 23:13 ` Jordan Justen
2012-02-20 0:39 ` Jordan Justen
2011-12-20 8:11 ` Stefan Hajnoczi
2011-12-15 21:02 ` [Qemu-devel] [PATCH v9 0/3] PC system flash support Jordan Justen
2011-12-18 10:04 ` Avi Kivity
2011-12-19 18:27 ` Jordan Justen
2011-12-20 10:53 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323982273-13623-2-git-send-email-jordan.l.justen@intel.com \
--to=jordan.l.justen@intel.com \
--cc=avi@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).