All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization
@ 2016-08-25 10:14 Chao Peng
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 01/12] pc: make smbus configurable Chao Peng
                   ` (12 more replies)
  0 siblings, 13 replies; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

This patchset is trying to optimize guest startup time by disabling
or simplifying some features in QEMU. The version 1 can be found at:
https://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg04842.html

Unlike version 1, this version optimizes Q35 directly instead of
introducing a totally new platform. But we still keep the design of
skipping firmware as till now we don't have good idea to optimize
firmware to get the comparable boot time.

The patchset is against commit 5f0e775 (Update version for v2.7.0-rc3
release) on master branch.

Basically this patchset introduces several switches to qemu comandline
so that several features can be turned off in some use cases. The
default behavior will not change in case no switches are provided.

Performance data:
feature(switches)       time saved in guest
-nosmbus                4ms
-nosata                 6ms
-nopic                  2ms
-nopit                  5ms
-static-prt             8ms
-nofw                   62ms

Thanks,
Chao

Chao Peng (9):
  pc: make smbus configurable
  pc: make sata configurable
  pc: make pic configurable
  pc: make pit configurable
  acpi: build static _PRT
  ich9: enable pm registers when there is no firmware
  q35: initialize MMCFG base when there is no firmware
  pc: support direct loading protected/long mode kernel
  pc: skip firmware

Haozhong Zhang (3):
  acpi: expose data structurs and functions of BIOS linker loader
  acpi: expose acpi_checksum()
  acpi: patch guest ACPI when there is no firmware

 hw/acpi/bios-linker-loader.c         |  83 +---------
 hw/acpi/core.c                       |   2 +-
 hw/acpi/nvdimm.c                     |   6 +-
 hw/i386/Makefile.objs                |   2 +-
 hw/i386/acpi-build-nofw.c            | 295 ++++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c                 | 102 +++++++-----
 hw/i386/acpi-build.h                 |   5 +
 hw/i386/pc.c                         | 301 +++++++++++++++++++++++++++++++----
 hw/i386/pc_piix.c                    |   2 +-
 hw/i386/pc_q35.c                     |  60 ++++---
 hw/isa/lpc_ich9.c                    |  12 +-
 hw/pci-host/q35.c                    |  15 +-
 include/hw/acpi/acpi.h               |   2 +
 include/hw/acpi/bios-linker-loader.h |  85 ++++++++++
 include/hw/i386/pc.h                 |  16 +-
 15 files changed, 800 insertions(+), 188 deletions(-)
 create mode 100644 hw/i386/acpi-build-nofw.c

-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 01/12] pc: make smbus configurable
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
@ 2016-08-25 10:14 ` Chao Peng
  2016-09-06 20:18   ` Eduardo Habkost
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 02/12] pc: make sata configurable Chao Peng
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 hw/i386/pc.c         | 23 +++++++++++++++++++++++
 hw/i386/pc_q35.c     | 12 +++++++-----
 include/hw/i386/pc.h |  3 +++
 3 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 022dd1b..66e1961 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -2005,6 +2005,27 @@ static HotplugHandler *pc_get_hotpug_handler(MachineState *machine,
         pcmc->get_hotplug_handler(machine, dev) : NULL;
 }
 
+static void pc_machine_get_prop_bool(Object *obj, Visitor *v, const char *name,
+                                     void *opaque, Error **errp)
+{
+    bool value = *(bool *)opaque;
+
+    visit_type_bool(v, name, &value, errp);
+}
+
+static void pc_machine_set_prop_bool(Object *obj, Visitor *v, const char *name,
+                                     void *opaque, Error **errp)
+{
+    visit_type_bool(v, name, (bool *)opaque, errp);
+}
+
+#define PC_MACHINE_DEFINE_PROP_BOOL(pcms, prop, field, defval)      \
+        pcms->field = defval;                                       \
+        object_property_add(OBJECT(pcms), prop, "bool",             \
+                            pc_machine_get_prop_bool,               \
+                            pc_machine_set_prop_bool,               \
+                            NULL, &pcms->field, &error_abort);
+
 static void
 pc_machine_get_hotplug_memory_region_size(Object *obj, Visitor *v,
                                           const char *name, void *opaque,
@@ -2168,6 +2189,8 @@ static void pc_machine_initfn(Object *obj)
     pcms->acpi_nvdimm_state.is_enabled = false;
     object_property_add_bool(obj, PC_MACHINE_NVDIMM, pc_machine_get_nvdimm,
                              pc_machine_set_nvdimm, &error_abort);
+
+    PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SMBUS, smbus, true);
 }
 
 static void pc_machine_reset(void)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index c0b9961..5bb19c1 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -247,11 +247,13 @@ static void pc_q35_init(MachineState *machine)
         ehci_create_ich9_with_companions(host_bus, 0x1d);
     }
 
-    /* TODO: Populate SPD eeprom data.  */
-    smbus_eeprom_init(ich9_smb_init(host_bus,
-                                    PCI_DEVFN(ICH9_SMB_DEV, ICH9_SMB_FUNC),
-                                    0xb100),
-                      8, NULL, 0);
+    if (pcms->smbus) {
+        /* TODO: Populate SPD eeprom data.  */
+        smbus_eeprom_init(ich9_smb_init(host_bus,
+                                        PCI_DEVFN(ICH9_SMB_DEV, ICH9_SMB_FUNC),
+                                        0xb100),
+                          8, NULL, 0);
+    }
 
     pc_cmos_init(pcms, idebus[0], idebus[1], rtc_state);
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 74c175c..aec809c 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -76,6 +76,8 @@ struct PCMachineState {
     /* Address space used by IOAPIC device. All IOAPIC interrupts
      * will be translated to MSI messages in the address space. */
     AddressSpace *ioapic_as;
+
+    bool smbus;
 };
 
 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
@@ -84,6 +86,7 @@ struct PCMachineState {
 #define PC_MACHINE_VMPORT           "vmport"
 #define PC_MACHINE_SMM              "smm"
 #define PC_MACHINE_NVDIMM           "nvdimm"
+#define PC_MACHINE_SMBUS            "smbus"
 
 /**
  * PCMachineClass:
-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 02/12] pc: make sata configurable
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 01/12] pc: make smbus configurable Chao Peng
@ 2016-08-25 10:14 ` Chao Peng
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 03/12] pc: make pic configurable Chao Peng
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 hw/i386/pc.c         | 12 +++++++-----
 hw/i386/pc_q35.c     | 25 +++++++++++++++----------
 include/hw/i386/pc.h |  2 ++
 3 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 66e1961..99fb9aa 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -397,13 +397,13 @@ static void pc_cmos_init_late(void *opaque)
     int i, trans;
 
     val = 0;
-    if (ide_get_geometry(arg->idebus[0], 0,
-                         &cylinders, &heads, &sectors) >= 0) {
+    if (arg->idebus[0] && ide_get_geometry(arg->idebus[0], 0,
+                                           &cylinders, &heads, &sectors) >= 0) {
         cmos_init_hd(s, 0x19, 0x1b, cylinders, heads, sectors);
         val |= 0xf0;
     }
-    if (ide_get_geometry(arg->idebus[0], 1,
-                         &cylinders, &heads, &sectors) >= 0) {
+    if (arg->idebus[0] && ide_get_geometry(arg->idebus[0], 1,
+                                           &cylinders, &heads, &sectors) >= 0) {
         cmos_init_hd(s, 0x1a, 0x24, cylinders, heads, sectors);
         val |= 0x0f;
     }
@@ -415,7 +415,8 @@ static void pc_cmos_init_late(void *opaque)
            geometry.  It is always such that: 1 <= sects <= 63, 1
            <= heads <= 16, 1 <= cylinders <= 16383. The BIOS
            geometry can be different if a translation is done. */
-        if (ide_get_geometry(arg->idebus[i / 2], i % 2,
+        if (arg->idebus[i / 2] &&
+            ide_get_geometry(arg->idebus[i / 2], i % 2,
                              &cylinders, &heads, &sectors) >= 0) {
             trans = ide_get_bios_chs_trans(arg->idebus[i / 2], i % 2) - 1;
             assert((trans & ~3) == 0);
@@ -2191,6 +2192,7 @@ static void pc_machine_initfn(Object *obj)
                              pc_machine_set_nvdimm, &error_abort);
 
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SMBUS, smbus, true);
+    PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SATA, sata, true);
 }
 
 static void pc_machine_reset(void)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 5bb19c1..88da970 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -231,16 +231,21 @@ static void pc_q35_init(MachineState *machine)
     /* connect pm stuff to lpc */
     ich9_lpc_pm_init(lpc, pc_machine_is_smm_enabled(pcms));
 
-    /* ahci and SATA device, for q35 1 ahci controller is built-in */
-    ahci = pci_create_simple_multifunction(host_bus,
-                                           PCI_DEVFN(ICH9_SATA1_DEV,
-                                                     ICH9_SATA1_FUNC),
-                                           true, "ich9-ahci");
-    idebus[0] = qdev_get_child_bus(&ahci->qdev, "ide.0");
-    idebus[1] = qdev_get_child_bus(&ahci->qdev, "ide.1");
-    g_assert(MAX_SATA_PORTS == ICH_AHCI(ahci)->ahci.ports);
-    ide_drive_get(hd, ICH_AHCI(ahci)->ahci.ports);
-    ahci_ide_create_devs(ahci, hd);
+    if (pcms->sata) {
+        /* ahci and SATA device, for q35 1 ahci controller is built-in */
+        ahci = pci_create_simple_multifunction(host_bus,
+                                               PCI_DEVFN(ICH9_SATA1_DEV,
+                                                         ICH9_SATA1_FUNC),
+                                               true, "ich9-ahci");
+        idebus[0] = qdev_get_child_bus(&ahci->qdev, "ide.0");
+        idebus[1] = qdev_get_child_bus(&ahci->qdev, "ide.1");
+        g_assert(MAX_SATA_PORTS == ICH_AHCI(ahci)->ahci.ports);
+        ide_drive_get(hd, ICH_AHCI(ahci)->ahci.ports);
+        ahci_ide_create_devs(ahci, hd);
+    } else {
+        idebus[0] = idebus[1] = NULL;
+    }
+
 
     if (machine_usb(machine)) {
         /* Should we create 6 UHCI according to ich9 spec? */
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index aec809c..f5be478 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -78,6 +78,7 @@ struct PCMachineState {
     AddressSpace *ioapic_as;
 
     bool smbus;
+    bool sata;
 };
 
 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
@@ -87,6 +88,7 @@ struct PCMachineState {
 #define PC_MACHINE_SMM              "smm"
 #define PC_MACHINE_NVDIMM           "nvdimm"
 #define PC_MACHINE_SMBUS            "smbus"
+#define PC_MACHINE_SATA             "sata"
 
 /**
  * PCMachineClass:
-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 03/12] pc: make pic configurable
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 01/12] pc: make smbus configurable Chao Peng
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 02/12] pc: make sata configurable Chao Peng
@ 2016-08-25 10:14 ` Chao Peng
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 04/12] pc: make pit configurable Chao Peng
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 hw/i386/pc.c         |  1 +
 hw/i386/pc_q35.c     | 21 ++++++++++++---------
 include/hw/i386/pc.h |  2 ++
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 99fb9aa..ea81283 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -2193,6 +2193,7 @@ static void pc_machine_initfn(Object *obj)
 
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SMBUS, smbus, true);
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SATA, sata, true);
+    PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_PIC, pic, true);
 }
 
 static void pc_machine_reset(void)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 88da970..1a961cc 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -202,17 +202,20 @@ static void pc_q35_init(MachineState *machine)
     pci_bus_set_route_irq_fn(host_bus, ich9_route_intx_pin_to_irq);
     isa_bus = ich9_lpc->isa_bus;
 
-    if (kvm_pic_in_kernel()) {
-        i8259 = kvm_i8259_init(isa_bus);
-    } else if (xen_enabled()) {
-        i8259 = xen_interrupt_controller_init();
-    } else {
-        i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq());
-    }
+    if (pcms->pic) {
+        if (kvm_pic_in_kernel()) {
+            i8259 = kvm_i8259_init(isa_bus);
+        } else if (xen_enabled()) {
+            i8259 = xen_interrupt_controller_init();
+        } else {
+            i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq());
+        }
 
-    for (i = 0; i < ISA_NUM_IRQS; i++) {
-        gsi_state->i8259_irq[i] = i8259[i];
+        for (i = 0; i < ISA_NUM_IRQS; i++) {
+            gsi_state->i8259_irq[i] = i8259[i];
+        }
     }
+
     if (pcmc->pci_enabled) {
         ioapic_init_gsi(gsi_state, "q35");
     }
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index f5be478..d7972ea 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -79,6 +79,7 @@ struct PCMachineState {
 
     bool smbus;
     bool sata;
+    bool pic;
 };
 
 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
@@ -89,6 +90,7 @@ struct PCMachineState {
 #define PC_MACHINE_NVDIMM           "nvdimm"
 #define PC_MACHINE_SMBUS            "smbus"
 #define PC_MACHINE_SATA             "sata"
+#define PC_MACHINE_PIC              "pic"
 
 /**
  * PCMachineClass:
-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 04/12] pc: make pit configurable
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
                   ` (2 preceding siblings ...)
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 03/12] pc: make pic configurable Chao Peng
@ 2016-08-25 10:14 ` Chao Peng
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 05/12] acpi: build static _PRT Chao Peng
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 hw/i386/pc.c         | 6 ++++--
 hw/i386/pc_piix.c    | 2 +-
 hw/i386/pc_q35.c     | 2 +-
 include/hw/i386/pc.h | 5 ++++-
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index ea81283..1d62957 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1520,7 +1520,8 @@ static const MemoryRegionOps ioportF0_io_ops = {
     },
 };
 
-void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
+void pc_basic_device_init(PCMachineState *pcms,
+                          ISABus *isa_bus, qemu_irq *gsi,
                           ISADevice **rtc_state,
                           bool create_fdctrl,
                           bool no_vmport,
@@ -1577,7 +1578,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
 
     qemu_register_boot_set(pc_boot_set, *rtc_state);
 
-    if (!xen_enabled()) {
+    if (!xen_enabled() && pcms->pit) {
         if (kvm_pit_in_kernel()) {
             pit = kvm_pit_init(isa_bus, 0x40);
         } else {
@@ -2194,6 +2195,7 @@ static void pc_machine_initfn(Object *obj)
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SMBUS, smbus, true);
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SATA, sata, true);
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_PIC, pic, true);
+    PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_PIT, pit, true);
 }
 
 static void pc_machine_reset(void)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index a07dc81..028dc0a 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -235,7 +235,7 @@ static void pc_init1(MachineState *machine,
     }
 
     /* init basic PC hardware */
-    pc_basic_device_init(isa_bus, gsi, &rtc_state, true,
+    pc_basic_device_init(pcms, isa_bus, gsi, &rtc_state, true,
                          (pcms->vmport != ON_OFF_AUTO_ON), 0x4);
 
     pc_nic_init(isa_bus, pci_bus);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 1a961cc..d28b7b6 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -228,7 +228,7 @@ static void pc_q35_init(MachineState *machine)
     }
 
     /* init basic PC hardware */
-    pc_basic_device_init(isa_bus, gsi, &rtc_state, !mc->no_floppy,
+    pc_basic_device_init(pcms, isa_bus, gsi, &rtc_state, !mc->no_floppy,
                          (pcms->vmport != ON_OFF_AUTO_ON), 0xff0104);
 
     /* connect pm stuff to lpc */
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index d7972ea..1dc7954 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -80,6 +80,7 @@ struct PCMachineState {
     bool smbus;
     bool sata;
     bool pic;
+    bool pit;
 };
 
 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
@@ -91,6 +92,7 @@ struct PCMachineState {
 #define PC_MACHINE_SMBUS            "smbus"
 #define PC_MACHINE_SATA             "sata"
 #define PC_MACHINE_PIC              "pic"
+#define PC_MACHINE_PIT              "pit"
 
 /**
  * PCMachineClass:
@@ -262,7 +264,8 @@ void pc_memory_init(PCMachineState *pcms,
                     MemoryRegion **ram_memory);
 qemu_irq pc_allocate_cpu_irq(void);
 DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
-void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
+void pc_basic_device_init(PCMachineState *pcms,
+                          ISABus *isa_bus, qemu_irq *gsi,
                           ISADevice **rtc_state,
                           bool create_fdctrl,
                           bool no_vmport,
-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 05/12] acpi: build static _PRT
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
                   ` (3 preceding siblings ...)
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 04/12] pc: make pit configurable Chao Peng
@ 2016-08-25 10:14 ` Chao Peng
  2016-08-29 17:06   ` Paolo Bonzini
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 06/12] acpi: expose data structurs and functions of BIOS linker loader Chao Peng
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

...to reduce the interpretation burden for guest ACPI component.

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 hw/i386/acpi-build.c | 31 ++++++++++++++++++++++++++++++-
 hw/i386/pc.c         |  1 +
 include/hw/i386/pc.h |  2 ++
 3 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index a26a4bb..60c0896 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1772,6 +1772,31 @@ static void build_q35_pci0_int(Aml *table)
     aml_append(table, sb_scope);
 }
 
+static void build_static_q35_pci0_int(Aml *table)
+{
+    int i, j;
+    Aml *method, *res, *pkg;
+    Aml *sb_scope = aml_scope("_SB");
+    Aml *pci0_scope = aml_scope("PCI0");
+
+    method = aml_method("_PRT", 0, AML_NOTSERIALIZED);
+    res = aml_package(128);
+    for (i = 0; i < 32; i++) {
+        for (j = 0; j < 4; j++) {
+            pkg = aml_package(4);
+            aml_append(pkg, aml_int((i << 16) | 0xffff));
+            aml_append(pkg, aml_int(j));
+            aml_append(pkg, aml_int(0));
+            aml_append(pkg, aml_int(0x10 + j));
+            aml_append(res, pkg);
+        }
+    }
+
+    aml_append(method, aml_return(res));
+    aml_append(pci0_scope, method);
+    aml_append(sb_scope, pci0_scope);
+}
+
 static void build_q35_isa_bridge(Aml *table)
 {
     Aml *dev;
@@ -2007,7 +2032,11 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
         build_hpet_aml(dsdt);
         build_q35_isa_bridge(dsdt);
         build_isa_devices_aml(dsdt);
-        build_q35_pci0_int(dsdt);
+        if (pcms->static_prt) {
+            build_static_q35_pci0_int(dsdt);
+        } else {
+            build_q35_pci0_int(dsdt);
+        }
     }
 
     if (pcmc->legacy_cpu_hotplug) {
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 1d62957..f479697 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -2196,6 +2196,7 @@ static void pc_machine_initfn(Object *obj)
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SATA, sata, true);
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_PIC, pic, true);
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_PIT, pit, true);
+    PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_STATIC_PRT, static_prt, false);
 }
 
 static void pc_machine_reset(void)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 1dc7954..55ab09a 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -81,6 +81,7 @@ struct PCMachineState {
     bool sata;
     bool pic;
     bool pit;
+    bool static_prt;
 };
 
 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
@@ -93,6 +94,7 @@ struct PCMachineState {
 #define PC_MACHINE_SATA             "sata"
 #define PC_MACHINE_PIC              "pic"
 #define PC_MACHINE_PIT              "pit"
+#define PC_MACHINE_STATIC_PRT       "static-prt"
 
 /**
  * PCMachineClass:
-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 06/12] acpi: expose data structurs and functions of BIOS linker loader
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
                   ` (4 preceding siblings ...)
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 05/12] acpi: build static _PRT Chao Peng
@ 2016-08-25 10:14 ` Chao Peng
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 07/12] acpi: expose acpi_checksum() Chao Peng
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

From: Haozhong Zhang <haozhong.zhang@intel.com>

Expose some data structures and functions of BIOS linker loader which
will be used by later commits.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
---
 hw/acpi/bios-linker-loader.c         | 83 +----------------------------------
 include/hw/acpi/bios-linker-loader.h | 85 ++++++++++++++++++++++++++++++++++++
 2 files changed, 86 insertions(+), 82 deletions(-)

diff --git a/hw/acpi/bios-linker-loader.c b/hw/acpi/bios-linker-loader.c
index d963ebe..e9c19cf 100644
--- a/hw/acpi/bios-linker-loader.c
+++ b/hw/acpi/bios-linker-loader.c
@@ -21,91 +21,10 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "hw/acpi/bios-linker-loader.h"
-#include "hw/nvram/fw_cfg.h"
 
 #include "qemu/bswap.h"
 
 /*
- * Linker/loader is a paravirtualized interface that passes commands to guest.
- * The commands can be used to request guest to
- * - allocate memory chunks and initialize them from QEMU FW CFG files
- * - link allocated chunks by storing pointer to one chunk into another
- * - calculate ACPI checksum of part of the chunk and store into same chunk
- */
-#define BIOS_LINKER_LOADER_FILESZ FW_CFG_MAX_FILE_PATH
-
-struct BiosLinkerLoaderEntry {
-    uint32_t command;
-    union {
-        /*
-         * COMMAND_ALLOCATE - allocate a table from @alloc.file
-         * subject to @alloc.align alignment (must be power of 2)
-         * and @alloc.zone (can be HIGH or FSEG) requirements.
-         *
-         * Must appear exactly once for each file, and before
-         * this file is referenced by any other command.
-         */
-        struct {
-            char file[BIOS_LINKER_LOADER_FILESZ];
-            uint32_t align;
-            uint8_t zone;
-        } alloc;
-
-        /*
-         * COMMAND_ADD_POINTER - patch the table (originating from
-         * @dest_file) at @pointer.offset, by adding a pointer to the table
-         * originating from @src_file. 1,2,4 or 8 byte unsigned
-         * addition is used depending on @pointer.size.
-         */
-        struct {
-            char dest_file[BIOS_LINKER_LOADER_FILESZ];
-            char src_file[BIOS_LINKER_LOADER_FILESZ];
-            uint32_t offset;
-            uint8_t size;
-        } pointer;
-
-        /*
-         * COMMAND_ADD_CHECKSUM - calculate checksum of the range specified by
-         * @cksum_start and @cksum_length fields,
-         * and then add the value at @cksum.offset.
-         * Checksum simply sums -X for each byte X in the range
-         * using 8-bit math.
-         */
-        struct {
-            char file[BIOS_LINKER_LOADER_FILESZ];
-            uint32_t offset;
-            uint32_t start;
-            uint32_t length;
-        } cksum;
-
-        /* padding */
-        char pad[124];
-    };
-} QEMU_PACKED;
-typedef struct BiosLinkerLoaderEntry BiosLinkerLoaderEntry;
-
-enum {
-    BIOS_LINKER_LOADER_COMMAND_ALLOCATE     = 0x1,
-    BIOS_LINKER_LOADER_COMMAND_ADD_POINTER  = 0x2,
-    BIOS_LINKER_LOADER_COMMAND_ADD_CHECKSUM = 0x3,
-};
-
-enum {
-    BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH = 0x1,
-    BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG = 0x2,
-};
-
-/*
- * BiosLinkerFileEntry:
- *
- * An internal type used for book-keeping file entries
- */
-typedef struct BiosLinkerFileEntry {
-    char *name; /* file name */
-    GArray *blob; /* data accosiated with @name */
-} BiosLinkerFileEntry;
-
-/*
  * bios_linker_loader_init: allocate a new linker object instance.
  *
  * After initialization, linker commands can be added, and will
@@ -137,7 +56,7 @@ void bios_linker_loader_cleanup(BIOSLinker *linker)
     g_free(linker);
 }
 
-static const BiosLinkerFileEntry *
+const BiosLinkerFileEntry *
 bios_linker_find_file(const BIOSLinker *linker, const char *name)
 {
     int i;
diff --git a/include/hw/acpi/bios-linker-loader.h b/include/hw/acpi/bios-linker-loader.h
index fa1e5d1..52c1e44 100644
--- a/include/hw/acpi/bios-linker-loader.h
+++ b/include/hw/acpi/bios-linker-loader.h
@@ -1,12 +1,93 @@
 #ifndef BIOS_LINKER_LOADER_H
 #define BIOS_LINKER_LOADER_H
 
+#include "hw/nvram/fw_cfg.h"
 
 typedef struct BIOSLinker {
     GArray *cmd_blob;
     GArray *file_list;
 } BIOSLinker;
 
+/*
+ * Linker/loader is a paravirtualized interface that passes commands to guest.
+ * The commands can be used to request guest to
+ * - allocate memory chunks and initialize them from QEMU FW CFG files
+ * - link allocated chunks by storing pointer to one chunk into another
+ * - calculate ACPI checksum of part of the chunk and store into same chunk
+ */
+#define BIOS_LINKER_LOADER_FILESZ FW_CFG_MAX_FILE_PATH
+
+struct BiosLinkerLoaderEntry {
+    uint32_t command;
+    union {
+        /*
+         * COMMAND_ALLOCATE - allocate a table from @alloc.file
+         * subject to @alloc.align alignment (must be power of 2)
+         * and @alloc.zone (can be HIGH or FSEG) requirements.
+         *
+         * Must appear exactly once for each file, and before
+         * this file is referenced by any other command.
+         */
+        struct {
+            char file[BIOS_LINKER_LOADER_FILESZ];
+            uint32_t align;
+            uint8_t zone;
+        } alloc;
+
+        /*
+         * COMMAND_ADD_POINTER - patch the table (originating from
+         * @dest_file) at @pointer.offset, by adding a pointer to the table
+         * originating from @src_file. 1,2,4 or 8 byte unsigned
+         * addition is used depending on @pointer.size.
+         */
+        struct {
+            char dest_file[BIOS_LINKER_LOADER_FILESZ];
+            char src_file[BIOS_LINKER_LOADER_FILESZ];
+            uint32_t offset;
+            uint8_t size;
+        } pointer;
+
+        /*
+         * COMMAND_ADD_CHECKSUM - calculate checksum of the range specified by
+         * @cksum_start and @cksum_length fields,
+         * and then add the value at @cksum.offset.
+         * Checksum simply sums -X for each byte X in the range
+         * using 8-bit math.
+         */
+        struct {
+            char file[BIOS_LINKER_LOADER_FILESZ];
+            uint32_t offset;
+            uint32_t start;
+            uint32_t length;
+        } cksum;
+
+        /* padding */
+        char pad[124];
+    };
+} QEMU_PACKED;
+typedef struct BiosLinkerLoaderEntry BiosLinkerLoaderEntry;
+
+enum {
+    BIOS_LINKER_LOADER_COMMAND_ALLOCATE     = 0x1,
+    BIOS_LINKER_LOADER_COMMAND_ADD_POINTER  = 0x2,
+    BIOS_LINKER_LOADER_COMMAND_ADD_CHECKSUM = 0x3,
+};
+
+enum {
+    BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH = 0x1,
+    BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG = 0x2,
+};
+
+/*
+ * BiosLinkerFileEntry:
+ *
+ * An internal type used for book-keeping file entries
+ */
+typedef struct BiosLinkerFileEntry {
+    char *name; /* file name */
+    GArray *blob; /* data accosiated with @name */
+} BiosLinkerFileEntry;
+
 BIOSLinker *bios_linker_loader_init(void);
 
 void bios_linker_loader_alloc(BIOSLinker *linker,
@@ -27,4 +108,8 @@ void bios_linker_loader_add_pointer(BIOSLinker *linker,
                                     uint32_t src_offset);
 
 void bios_linker_loader_cleanup(BIOSLinker *linker);
+
+const BiosLinkerFileEntry *
+bios_linker_find_file(const BIOSLinker *linker, const char *name);
+
 #endif
-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 07/12] acpi: expose acpi_checksum()
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
                   ` (5 preceding siblings ...)
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 06/12] acpi: expose data structurs and functions of BIOS linker loader Chao Peng
@ 2016-08-25 10:15 ` Chao Peng
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 08/12] acpi: patch guest ACPI when there is no firmware Chao Peng
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

From: Haozhong Zhang <haozhong.zhang@intel.com>

It will be used in later commits.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
---
 hw/acpi/core.c         | 2 +-
 include/hw/acpi/acpi.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index e890a5d..95ba06d 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -69,7 +69,7 @@ static void acpi_register_config(void)
 
 opts_init(acpi_register_config);
 
-static int acpi_checksum(const uint8_t *data, int len)
+int acpi_checksum(const uint8_t *data, int len)
 {
     int sum, i;
     sum = 0;
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index 7b3d93c..fee6606 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -189,4 +189,6 @@ struct AcpiSlicOem {
 };
 int acpi_get_slic_oem(AcpiSlicOem *oem);
 
+int acpi_checksum(const uint8_t *data, int len);
+
 #endif /* QEMU_HW_ACPI_H */
-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 08/12] acpi: patch guest ACPI when there is no firmware
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
                   ` (6 preceding siblings ...)
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 07/12] acpi: expose acpi_checksum() Chao Peng
@ 2016-08-25 10:15 ` Chao Peng
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 09/12] ich9: enable pm registers " Chao Peng
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

From: Haozhong Zhang <haozhong.zhang@intel.com>

Traditionally, guest firmware is responsible to patch ACPI tables
generated by QEMU. However, no firmware is used with pc-lite and
patching ACPI should be done in QEMU for pc-lite.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
---
 hw/acpi/nvdimm.c          |   6 +-
 hw/i386/Makefile.objs     |   2 +-
 hw/i386/acpi-build-nofw.c | 295 ++++++++++++++++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c      |  71 +++++------
 hw/i386/acpi-build.h      |   5 +
 5 files changed, 341 insertions(+), 38 deletions(-)
 create mode 100644 hw/i386/acpi-build-nofw.c

diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
index e486128..a05463e 100644
--- a/hw/acpi/nvdimm.c
+++ b/hw/acpi/nvdimm.c
@@ -770,8 +770,10 @@ void nvdimm_init_acpi_state(AcpiNVDIMMState *state, MemoryRegion *io,
 
     state->dsm_mem = g_array_new(false, true /* clear */, 1);
     acpi_data_push(state->dsm_mem, sizeof(NvdimmDsmIn));
-    fw_cfg_add_file(fw_cfg, NVDIMM_DSM_MEM_FILE, state->dsm_mem->data,
-                    state->dsm_mem->len);
+    if (fw_cfg) {
+        fw_cfg_add_file(fw_cfg, NVDIMM_DSM_MEM_FILE, state->dsm_mem->data,
+                        state->dsm_mem->len);
+    }
 }
 
 #define NVDIMM_COMMON_DSM      "NCAL"
diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 90e94ff..9d81af7 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -6,5 +6,5 @@ obj-y += x86-iommu.o intel_iommu.o
 obj-$(CONFIG_XEN) += ../xenpv/ xen/
 
 obj-y += kvmvapic.o
-obj-y += acpi-build.o
+obj-y += acpi-build.o acpi-build-nofw.o
 obj-y += pci-assign-load-rom.o
diff --git a/hw/i386/acpi-build-nofw.c b/hw/i386/acpi-build-nofw.c
new file mode 100644
index 0000000..8f4fbe3
--- /dev/null
+++ b/hw/i386/acpi-build-nofw.c
@@ -0,0 +1,295 @@
+#include "qemu/osdep.h"
+#include <glib.h>
+#include "qemu-common.h"
+#include "qemu/mmap-alloc.h"
+#include "acpi-build.h"
+#include "hw/i386/pc.h"
+#include "hw/acpi/acpi.h"
+#include "hw/acpi/aml-build.h"
+#include "hw/acpi/bios-linker-loader.h"
+#include "exec/memory.h"
+#include "qapi/error.h"
+
+/* #define DEBUG_ACPI */
+#ifdef DEBUG_ACPI
+#define acpi_dprintf(fmt, ...)                  \
+    do {                                                \
+        printf("ACPI: "fmt, ##__VA_ARGS__);     \
+    } while (0)
+#else
+#define acpi_dprintf(fmt, ...)
+#endif
+
+
+typedef
+struct AcpiZone {
+    MemoryRegion *mr;
+    hwaddr       start;
+    hwaddr       offset;
+} AcpiZone;
+static AcpiZone acpi_himem_zone;
+static AcpiZone acpi_fseg_zone;
+
+#define ACPI_HIMEM_SIZE (256 * 1024)
+#define ACPI_FSEG_SIZE  (0x100000 - 0xe0000)
+
+static AcpiZone *acpi_get_zone(uint8_t zone)
+{
+    if (zone == BIOS_LINKER_LOADER_ALLOC_ZONE_HIGH) {
+        return &acpi_himem_zone;
+    } else if (zone == BIOS_LINKER_LOADER_ALLOC_ZONE_FSEG) {
+        return &acpi_fseg_zone;
+    } else {
+        return NULL;
+    }
+}
+
+static int acpi_zone_init(AcpiZone *zone, const char *name,
+                                  hwaddr start, uint64_t size)
+{
+    void *buf;
+    MemoryRegion *mr;
+
+    buf = qemu_ram_mmap(-1, size, 0x1000, true);
+    if (buf == MAP_FAILED) {
+        return -1;
+    }
+
+    mr = g_malloc(sizeof(*mr));
+    memory_region_init_ram_ptr(mr, NULL, name, size, buf);
+    memory_region_add_subregion_overlap(get_system_memory(), start, mr, 0);
+    e820_add_entry(start, size, E820_RESERVED);
+
+    zone->mr = mr;
+    zone->start = start;
+    zone->offset = 0;
+
+    return 0;
+}
+
+static void acpi_zones_init(PCMachineState *pcms)
+{
+    uint64_t start;
+
+    assert(pcms->below_4g_mem_size >= ACPI_HIMEM_SIZE);
+    start = pcms->below_4g_mem_size - ACPI_HIMEM_SIZE;
+    acpi_zone_init(&acpi_himem_zone, "acpi_himem",
+                           start, ACPI_HIMEM_SIZE);
+    acpi_zone_init(&acpi_fseg_zone, "acpi_fseg",
+                           0xe0000, ACPI_FSEG_SIZE);
+}
+
+/* return the offset within the corresponding zone, or ~0 for failure */
+static hwaddr acpi_zone_alloc(AcpiZone *zone,
+                                      uint64_t size, uint64_t align,
+                                      Error **errp)
+{
+    hwaddr start = zone->start;
+    hwaddr offset = zone->offset;
+    uint64_t max_size = memory_region_size(zone->mr);
+    uint64_t addr;
+    Error *local_err = NULL;
+
+    addr = ROUND_UP(start + offset, align);
+    offset = addr - start;
+    if (size > max_size || max_size - size < offset) {
+        error_setg(&local_err, "Not enough space");
+        goto out;
+    }
+    zone->offset = offset + size;
+
+ out:
+    error_propagate(errp, local_err);
+    return offset;
+}
+
+
+typedef
+struct PCLiteAcpiFileEntry {
+    char         *name;
+    MemoryRegion *mr;
+    hwaddr       offset;
+} PCLiteAcpiFileEntry;
+
+typedef
+struct PCLiteAcpiFiles {
+    GArray *file_list;
+} PCLiteAcpiFiles;
+
+static PCLiteAcpiFiles *acpi_files;
+
+static void acpi_files_init(void)
+{
+    acpi_files = g_new(PCLiteAcpiFiles, 1);
+    acpi_files->file_list = g_array_new(false, true /* clear */,
+                                                sizeof(PCLiteAcpiFileEntry));
+}
+
+static PCLiteAcpiFileEntry *acpi_file_search(const char *name)
+{
+    int i;
+    GArray *file_list = acpi_files->file_list;
+    PCLiteAcpiFileEntry *file;
+
+    for (i = 0; i < file_list->len; i++) {
+        file = &g_array_index(file_list, PCLiteAcpiFileEntry, i);
+        if (!strcmp(file->name, name)) {
+            return file;
+        }
+    }
+    return NULL;
+}
+
+static void acpi_file_add(const char *name,
+                                  MemoryRegion *mr, hwaddr offset)
+{
+    PCLiteAcpiFileEntry file = { g_strdup(name), mr, offset };
+    assert(!acpi_file_search(name));
+    g_array_append_val(acpi_files->file_list, file);
+}
+
+static void *acpi_file_get_ptr(PCLiteAcpiFileEntry *file)
+{
+    void *ptr = memory_region_get_ram_ptr(file->mr);
+    return ptr + file->offset;
+}
+
+static hwaddr acpi_file_get_addr(PCLiteAcpiFileEntry *file)
+{
+    return file->mr->addr + file->offset;
+}
+
+static void acpi_patch_allocate(const BiosLinkerLoaderEntry *cmd,
+                                        const BiosLinkerFileEntry *file,
+                                        Error **errp)
+{
+    AcpiZone *zone = acpi_get_zone(cmd->alloc.zone);
+    MemoryRegion *zone_mr = zone->mr;
+    GArray *data = file->blob;
+    unsigned size = acpi_data_len(data);
+    hwaddr offset;
+    void *dest;
+    Error *local_err = NULL;
+
+    assert(!strncmp(cmd->alloc.file, file->name, BIOS_LINKER_LOADER_FILESZ));
+
+    if (!zone) {
+        error_setg(&local_err, "Unknown zone type %d of file %s",
+                   cmd->alloc.zone, cmd->alloc.file);
+        goto out;
+    }
+
+    offset = acpi_zone_alloc(zone, size, cmd->alloc.align, &local_err);
+    if (local_err) {
+        goto out;
+    }
+
+    dest = memory_region_get_ram_ptr(zone_mr);
+    memcpy(dest + offset, data->data, size);
+    memory_region_set_dirty(zone_mr, offset, size);
+
+    acpi_file_add(cmd->alloc.file, zone_mr, offset);
+
+ out:
+    error_propagate(errp, local_err);
+}
+
+static void acpi_patch_add_pointer(const BiosLinkerLoaderEntry *cmd,
+                                           Error **errp)
+{
+    PCLiteAcpiFileEntry *dest_file, *src_file;
+    void *dest;
+    uint64_t pointer = 0;
+    uint32_t offset = cmd->pointer.offset;
+    uint32_t size = cmd->pointer.size;
+    Error *local_err = NULL;
+
+    dest_file = acpi_file_search(cmd->pointer.dest_file);
+    if (!dest_file) {
+        error_setg(&local_err, "Not found dest_file %s",
+                   cmd->pointer.dest_file);
+        goto out;
+    }
+    src_file = acpi_file_search(cmd->pointer.src_file);
+    if (!src_file) {
+        error_setg(&local_err, "Not found src_file %s",
+                   cmd->pointer.src_file);
+        goto out;
+    }
+
+    dest = acpi_file_get_ptr(dest_file);
+    memcpy(&pointer, dest + offset, size);
+    pointer += acpi_file_get_addr(src_file);
+    memcpy(dest + offset, &pointer, size);
+    memory_region_set_dirty(dest_file->mr, dest_file->offset + offset, size);
+
+ out:
+    error_propagate(errp, local_err);
+}
+
+static void acpi_patch_add_checksum(const BiosLinkerLoaderEntry *cmd,
+                                            Error **errp)
+{
+    PCLiteAcpiFileEntry *file = acpi_file_search(cmd->cksum.file);
+    uint32_t offset = cmd->cksum.offset;
+    uint8_t *dest, *cksum;
+    Error *local_err = NULL;
+
+    if (!file) {
+        error_setg(&local_err, "Not found file %s", cmd->cksum.file);
+        goto out;
+    }
+
+    dest = acpi_file_get_ptr(file);
+    cksum = dest + offset;
+    *cksum = acpi_checksum(dest + cmd->cksum.start, cmd->cksum.length);
+    memory_region_set_dirty(file->mr, file->offset + offset, sizeof(*cksum));
+
+ out:
+    error_propagate(errp, local_err);
+}
+
+static void acpi_patch(BIOSLinker *linker, Error **errp)
+{
+    void *cmd_blob_data = linker->cmd_blob->data;
+    unsigned cmd_blob_len = linker->cmd_blob->len;
+    uint64_t offset;
+    const BiosLinkerLoaderEntry *cmd;
+    const BiosLinkerFileEntry *file;
+    Error *local_err = NULL;
+
+    for (offset = 0; offset < cmd_blob_len; offset += sizeof(*cmd)) {
+        cmd = cmd_blob_data + offset;
+
+        switch (cmd->command) {
+        case BIOS_LINKER_LOADER_COMMAND_ALLOCATE:
+            file = bios_linker_find_file(linker, cmd->alloc.file);
+            acpi_patch_allocate(cmd, file, &local_err);
+            break;
+        case BIOS_LINKER_LOADER_COMMAND_ADD_POINTER:
+            acpi_patch_add_pointer(cmd, &local_err);
+            break;
+        case BIOS_LINKER_LOADER_COMMAND_ADD_CHECKSUM:
+            acpi_patch_add_checksum(cmd, &local_err);
+            break;
+        default:
+            acpi_dprintf("Ignore unknown command 0x%x\n", cmd->command);
+            continue;
+        }
+
+        if (local_err) {
+            goto out;
+        }
+    }
+
+ out:
+    error_propagate(errp, local_err);
+}
+
+
+void acpi_build_nofw(PCMachineState *pcms, BIOSLinker *linker, Error **errp)
+{
+    acpi_zones_init(pcms);
+    acpi_files_init();
+    acpi_patch(linker, errp);
+}
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 60c0896..4daa6ae 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2228,8 +2228,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
     aml_append(scope, aml_name_decl("_S5", pkg));
     aml_append(dsdt, scope);
 
-    /* create fw_cfg node, unconditionally */
-    {
+    if (pcms->fw_cfg) {
         /* when using port i/o, the 8-bit data register *always* overlaps
          * with half of the 16-bit control register. Hence, the total size
          * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the
@@ -2879,11 +2878,6 @@ void acpi_setup(void)
     AcpiBuildTables tables;
     AcpiBuildState *build_state;
 
-    if (!pcms->fw_cfg) {
-        ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n");
-        return;
-    }
-
     if (!pcmc->has_acpi_build) {
         ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
         return;
@@ -2902,41 +2896,48 @@ void acpi_setup(void)
     acpi_build(&tables, MACHINE(pcms));
 
     /* Now expose it all to Guest */
-    build_state->table_mr = acpi_add_rom_blob(build_state, tables.table_data,
-                                               ACPI_BUILD_TABLE_FILE,
-                                               ACPI_BUILD_TABLE_MAX_SIZE);
-    assert(build_state->table_mr != NULL);
-
-    build_state->linker_mr =
-        acpi_add_rom_blob(build_state, tables.linker->cmd_blob,
-                          "etc/table-loader", 0);
-
-    fw_cfg_add_file(pcms->fw_cfg, ACPI_BUILD_TPMLOG_FILE,
-                    tables.tcpalog->data, acpi_data_len(tables.tcpalog));
-
-    if (!pcmc->rsdp_in_ram) {
-        /*
-         * Keep for compatibility with old machine types.
-         * Though RSDP is small, its contents isn't immutable, so
-         * we'll update it along with the rest of tables on guest access.
-         */
-        uint32_t rsdp_size = acpi_data_len(tables.rsdp);
+    if (pcms->fw_cfg) {
+        build_state->table_mr = acpi_add_rom_blob(build_state, tables.table_data,
+                                                  ACPI_BUILD_TABLE_FILE,
+                                                  ACPI_BUILD_TABLE_MAX_SIZE);
+        assert(build_state->table_mr != NULL);
 
-        build_state->rsdp = g_memdup(tables.rsdp->data, rsdp_size);
-        fw_cfg_add_file_callback(pcms->fw_cfg, ACPI_BUILD_RSDP_FILE,
-                                 acpi_build_update, build_state,
-                                 build_state->rsdp, rsdp_size);
-        build_state->rsdp_mr = NULL;
-    } else {
-        build_state->rsdp = NULL;
-        build_state->rsdp_mr = acpi_add_rom_blob(build_state, tables.rsdp,
-                                                  ACPI_BUILD_RSDP_FILE, 0);
+        build_state->linker_mr =
+            acpi_add_rom_blob(build_state, tables.linker->cmd_blob,
+                              "etc/table-loader", 0);
+
+        fw_cfg_add_file(pcms->fw_cfg, ACPI_BUILD_TPMLOG_FILE,
+                        tables.tcpalog->data, acpi_data_len(tables.tcpalog));
+
+        if (!pcmc->rsdp_in_ram) {
+            /*
+             * Keep for compatibility with old machine types.
+             * Though RSDP is small, its contents isn't immutable, so
+             * we'll update it along with the rest of tables on guest access.
+             */
+            uint32_t rsdp_size = acpi_data_len(tables.rsdp);
+
+            build_state->rsdp = g_memdup(tables.rsdp->data, rsdp_size);
+            fw_cfg_add_file_callback(pcms->fw_cfg, ACPI_BUILD_RSDP_FILE,
+                                     acpi_build_update, build_state,
+                                     build_state->rsdp, rsdp_size);
+            build_state->rsdp_mr = NULL;
+        } else {
+            build_state->rsdp = NULL;
+            build_state->rsdp_mr = acpi_add_rom_blob(build_state, tables.rsdp,
+                                                     ACPI_BUILD_RSDP_FILE, 0);
+        }
     }
 
     qemu_register_reset(acpi_build_reset, build_state);
     acpi_build_reset(build_state);
     vmstate_register(NULL, 0, &vmstate_acpi_build, build_state);
 
+    if (!pcms->fw_cfg) {
+        acpi_build_nofw(pcms, tables.linker, &error_abort);
+        build_state->patched = 1;
+    }
+
     /* Cleanup tables but don't free the memory: we track it
      * in build_state.
      */
diff --git a/hw/i386/acpi-build.h b/hw/i386/acpi-build.h
index 007332e..4e5f2e5 100644
--- a/hw/i386/acpi-build.h
+++ b/hw/i386/acpi-build.h
@@ -2,6 +2,11 @@
 #ifndef HW_I386_ACPI_BUILD_H
 #define HW_I386_ACPI_BUILD_H
 
+#include "hw/i386/pc.h"
+#include "hw/acpi/bios-linker-loader.h"
+#include "qapi/error.h"
+
 void acpi_setup(void);
+void acpi_build_nofw(PCMachineState *pcms, BIOSLinker *linker, Error **errp);
 
 #endif
-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 09/12] ich9: enable pm registers when there is no firmware
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
                   ` (7 preceding siblings ...)
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 08/12] acpi: patch guest ACPI when there is no firmware Chao Peng
@ 2016-08-25 10:15 ` Chao Peng
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 10/12] q35: initialize MMCFG base " Chao Peng
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 hw/isa/lpc_ich9.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 10d1ee8..28e9911 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -484,6 +484,9 @@ static void ich9_lpc_reset(DeviceState *qdev)
 {
     PCIDevice *d = PCI_DEVICE(qdev);
     ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
+    PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
+    uint32_t pm_base = ICH9_LPC_PMBASE_DEFAULT;
+    uint8_t lpc_ctlr = ICH9_LPC_ACPI_CTRL_DEFAULT;
     uint32_t rcba_old = pci_get_long(d->config + ICH9_LPC_RCBA);
     int i;
 
@@ -495,9 +498,14 @@ static void ich9_lpc_reset(DeviceState *qdev)
         pci_set_byte(d->config + ICH9_LPC_PIRQE_ROUT + i,
                      ICH9_LPC_PIRQ_ROUT_DEFAULT);
     }
-    pci_set_byte(d->config + ICH9_LPC_ACPI_CTRL, ICH9_LPC_ACPI_CTRL_DEFAULT);
 
-    pci_set_long(d->config + ICH9_LPC_PMBASE, ICH9_LPC_PMBASE_DEFAULT);
+    if (!pcms->fw_cfg) {
+        lpc_ctlr = ICH9_LPC_ACPI_CTRL_ACPI_EN;
+        pm_base = 0x600 | ICH9_LPC_PMBASE_RTE;
+    }
+
+    pci_set_byte(d->config + ICH9_LPC_ACPI_CTRL, lpc_ctlr);
+    pci_set_long(d->config + ICH9_LPC_PMBASE, pm_base);
     pci_set_long(d->config + ICH9_LPC_RCBA, ICH9_LPC_RCBA_DEFAULT);
 
     ich9_cc_reset(lpc);
-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 10/12] q35: initialize MMCFG base when there is no firmware
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
                   ` (8 preceding siblings ...)
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 09/12] ich9: enable pm registers " Chao Peng
@ 2016-08-25 10:15 ` Chao Peng
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 11/12] pc: support direct loading protected/long mode kernel Chao Peng
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 hw/pci-host/q35.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index e33d5a5..c5c5fe2 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -448,9 +448,18 @@ static void mch_reset(DeviceState *qdev)
 {
     PCIDevice *d = PCI_DEVICE(qdev);
     MCHPCIState *mch = MCH_PCI_DEVICE(d);
+    PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
+    uint64_t pciexbar = MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT;
 
-    pci_set_quad(d->config + MCH_HOST_BRIDGE_PCIEXBAR,
-                 MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT);
+    if (!pcms->fw_cfg) {
+        pciexbar |= MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_256M;
+        pciexbar |= MCH_HOST_BRIDGE_PCIEXBAREN;
+
+        e820_add_entry(MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT,
+                       MCH_HOST_BRIDGE_PCIEXBAR_MAX, E820_RESERVED);
+    }
+
+    pci_set_quad(d->config + MCH_HOST_BRIDGE_PCIEXBAR, pciexbar);
 
     d->config[MCH_HOST_BRIDGE_SMRAM] = MCH_HOST_BRIDGE_SMRAM_DEFAULT;
     d->config[MCH_HOST_BRIDGE_ESMRAMC] = MCH_HOST_BRIDGE_ESMRAMC_DEFAULT;
@@ -516,6 +525,8 @@ static void mch_realize(PCIDevice *d, Error **errp)
     init_pam(DEVICE(mch), mch->ram_memory, mch->system_memory,
              mch->pci_address_space, &mch->pam_regions[1],
              PAM_EXPAN_BASE, 12 * PAM_EXPAN_SIZE);
+
+    mch_reset(DEVICE(mch));
 }
 
 uint64_t mch_mcfg_base(void)
-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 11/12] pc: support direct loading protected/long mode kernel
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
                   ` (9 preceding siblings ...)
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 10/12] q35: initialize MMCFG base " Chao Peng
@ 2016-08-25 10:15 ` Chao Peng
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 12/12] pc: skip firmware Chao Peng
  2016-09-02 11:08 ` [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Paolo Bonzini
  12 siblings, 0 replies; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

Traditionally a PC follows the following booting steps:

    QEMU -> BIOS -> bootloader -> kernel realmode code
         -> kernel protected/longmode code.

This process takes lots of time. For light virtualization platform we
let QEMU loads protected/long mode kernel directly, hence skipping
several steps and speeding up the whole booting. We do this by filling
the zero page per Linux booting protocol and then jumping to the kernel
protected/long mode entry. Registers and paging should also be put in
the correct state.

Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 hw/i386/pc.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 163 insertions(+), 3 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f479697..4a368de 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -85,6 +85,31 @@
 #define FW_CFG_E820_TABLE (FW_CFG_ARCH_LOCAL + 3)
 #define FW_CFG_HPET (FW_CFG_ARCH_LOCAL + 4)
 
+#define BOOT_GDT                0x500
+#define BOOT_IDT                0x520
+#define BOOT_GDT_NULL           0
+#define BOOT_GDT_CODE           1
+#define BOOT_GDT_DATA           2
+#define BOOT_GDT_TSS            3
+#define BOOT_GDT_MAX            4
+#define BOOT_GDT_FLAGS_CODE     (DESC_P_MASK | DESC_S_MASK | DESC_CS_MASK | \
+                                 DESC_R_MASK | DESC_A_MASK | DESC_G_MASK )
+#define BOOT_GDT_FLAGS_DATA     (DESC_P_MASK | DESC_S_MASK | DESC_W_MASK |  \
+                                 DESC_A_MASK | DESC_B_MASK | DESC_G_MASK)
+#define BOOT_GDT_FLAGS_TSS      DESC_P_MASK | (11 << DESC_TYPE_SHIFT)
+#define BOOT_PML4               0x9000
+#define BOOT_PDPTE              0xA000
+#define BOOT_LOADER_SP          0x8000
+#define BOOT_CMDLINE_OFFSET     0x20000
+#define BOOT_ZEROPAGE_OFFSET    0x7000
+
+#define GDT_ENTRY(flags, base, limit)               \
+       ((((base)  & 0xff000000ULL) << (56-24)) |    \
+       (((flags) & 0x0000f0ffULL) << 40) |          \
+       (((limit) & 0x000f0000ULL) << (48-16)) |     \
+       (((base)  & 0x00ffffffULL) << 16) |          \
+       (((limit) & 0x0000ffffULL)))
+
 #define E820_NR_ENTRIES		16
 
 struct e820_entry {
@@ -98,6 +123,13 @@ struct e820_table {
     struct e820_entry entry[E820_NR_ENTRIES];
 } QEMU_PACKED __attribute((__aligned__(4)));
 
+struct kernel_boot_info {
+    uint64_t entry;
+    bool protected_mode;
+    bool long_mode;
+};
+
+static struct kernel_boot_info boot_info;
 static struct e820_table e820_reserve;
 static struct e820_entry *e820_table;
 static unsigned e820_entries;
@@ -665,6 +697,124 @@ bool e820_get_entry(int idx, uint32_t type, uint64_t *address, uint64_t *length)
     return false;
 }
 
+static void reset_cpu(CPUX86State *env)
+{
+    unsigned int flags = BOOT_GDT_FLAGS_CODE;
+
+    if (boot_info.long_mode) {
+        flags |= DESC_L_MASK;
+    }
+    cpu_x86_load_seg_cache(env, R_CS, BOOT_GDT_CODE * 8, 0, 0xfffff, flags);
+
+    cpu_x86_load_seg_cache(env, R_DS, BOOT_GDT_DATA * 8, 0, 0xfffff,
+                           BOOT_GDT_FLAGS_DATA);
+    cpu_x86_load_seg_cache(env, R_ES, BOOT_GDT_DATA * 8, 0, 0xfffff,
+                           BOOT_GDT_FLAGS_DATA);
+    cpu_x86_load_seg_cache(env, R_FS, BOOT_GDT_DATA * 8, 0, 0xfffff,
+                           BOOT_GDT_FLAGS_DATA);
+    cpu_x86_load_seg_cache(env, R_GS, BOOT_GDT_DATA * 8, 0, 0xfffff,
+                           BOOT_GDT_FLAGS_DATA);
+    cpu_x86_load_seg_cache(env, R_SS, BOOT_GDT_DATA * 8, 0, 0xfffff,
+                           BOOT_GDT_FLAGS_DATA);
+
+    env->gdt.base = BOOT_GDT;
+    env->gdt.limit = BOOT_GDT_MAX * 8 - 1;
+
+    env->idt.base = BOOT_IDT;
+
+    env->tr.selector = BOOT_GDT_TSS * 8;
+    env->tr.flags = BOOT_GDT_FLAGS_TSS;
+
+    env->cr[3] = BOOT_PML4;
+    env->cr[0] |= (CR0_PG_MASK | CR0_PE_MASK);
+
+    if (boot_info.long_mode) {
+        env->cr[4] |= CR4_PAE_MASK;
+        cpu_load_efer(env, env->efer | MSR_EFER_LME | MSR_EFER_LMA);
+    }
+
+    env->regs[R_ESP] = BOOT_LOADER_SP;
+    env->regs[R_ESI] = BOOT_ZEROPAGE_OFFSET;
+    env->eip = boot_info.entry;
+}
+
+static void setup_seg_desc_tables(void)
+{
+    uint64_t idt = 0;
+    uint64_t gdt[BOOT_GDT_MAX] = {
+             [BOOT_GDT_NULL] = GDT_ENTRY(0, 0, 0),
+             [BOOT_GDT_CODE] = GDT_ENTRY(BOOT_GDT_FLAGS_CODE, 0, 0xFFFFF),
+             [BOOT_GDT_DATA] = GDT_ENTRY(BOOT_GDT_FLAGS_DATA, 0, 0xFFFFF),
+             [BOOT_GDT_TSS ] = GDT_ENTRY(BOOT_GDT_FLAGS_TSS, 0, 0xFFFFF)
+            };
+
+    if (boot_info.long_mode) {
+        gdt[BOOT_GDT_CODE] |= (1UL << (32 + DESC_L_SHIFT));
+    }
+
+    cpu_physical_memory_write((hwaddr)BOOT_GDT, gdt, sizeof(gdt));
+    cpu_physical_memory_write((hwaddr)BOOT_IDT, &idt, sizeof(idt));
+}
+
+static void setup_page_tables(void)
+{
+    void *p;
+    size_t len = 4096;
+
+    p = cpu_physical_memory_map(BOOT_PML4, &len, 1);
+    memset(p, 0, 4096);
+    *(uint64_t*)p = (uint64_t)(BOOT_PDPTE | 3);
+    cpu_physical_memory_unmap(p, len, 1, len);
+
+    len = 4096;
+    p = cpu_physical_memory_map(BOOT_PDPTE, &len, 1);
+    memset(p, 0, 4096);
+    *(uint64_t*)p = 0x83;
+    cpu_physical_memory_unmap(p, len, 1, len);
+}
+
+static void setup_kernel_zero_page(void)
+{
+    int i;
+    uint8_t *zero_page;
+    void *e820_map;
+    size_t zero_page_size = 4096;
+    MachineState *machine = MACHINE(qdev_get_machine());
+    size_t cmdline_size = strlen(machine->kernel_cmdline) + 1;
+
+    cpu_physical_memory_write((hwaddr)BOOT_CMDLINE_OFFSET,
+                               machine->kernel_cmdline, cmdline_size);
+
+    zero_page = cpu_physical_memory_map((hwaddr)BOOT_ZEROPAGE_OFFSET,
+                                        &zero_page_size, 1);
+    memset(zero_page, 0, zero_page_size);
+
+    /* hdr.type_of_loader */
+    zero_page[0x210] = 0xFF;
+    /* hdr.boot_flag */
+    stw_p(zero_page + 0x1fe, 0xAA55);
+    /* hdr.header */
+    stl_p(zero_page + 0x202, 0x53726448);
+    /* hdr.cmd_line_ptr */
+    stl_p(zero_page + 0x228, BOOT_CMDLINE_OFFSET);
+    /* hdr.cmdline_size */
+    stl_p(zero_page + 0x238, cmdline_size);
+    /* e820_entries */
+    zero_page[0x1e8] = e820_entries;
+    /* e820_map */
+    e820_map = zero_page + 0x2d0;
+    for (i = 0; i < e820_entries; i++) {
+        stq_p(e820_map, e820_table[i].address);
+        e820_map += 8;
+        stq_p(e820_map, e820_table[i].length);
+        e820_map += 8;
+        stl_p(e820_map, e820_table[i].type);
+        e820_map += 4;
+    }
+
+    cpu_physical_memory_unmap(zero_page, zero_page_size, 1, zero_page_size);
+}
+
 /* Enables contiguous-apic-ID mode, for compatibility */
 static bool compat_apic_id_mode;
 
@@ -2206,15 +2356,25 @@ static void pc_machine_reset(void)
 
     qemu_devices_reset();
 
-    /* Reset APIC after devices have been reset to cancel
-     * any changes that qemu_devices_reset() might have done.
-     */
     CPU_FOREACH(cs) {
         cpu = X86_CPU(cs);
 
+        /* Reset APIC after devices have been reset to cancel
+         * any changes that qemu_devices_reset() might have done.
+         */
         if (cpu->apic_state) {
             device_reset(cpu->apic_state);
         }
+
+        if (boot_info.protected_mode && cpu_is_bsp(cpu)) {
+            reset_cpu(&cpu->env);
+        }
+    }
+
+    if (boot_info.protected_mode) {
+        setup_seg_desc_tables();
+        setup_page_tables();
+        setup_kernel_zero_page();
     }
 }
 
-- 
1.8.3.1

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

* [Qemu-devel] [RFC PATCH v2 12/12] pc: skip firmware
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
                   ` (10 preceding siblings ...)
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 11/12] pc: support direct loading protected/long mode kernel Chao Peng
@ 2016-08-25 10:15 ` Chao Peng
  2016-08-29 17:08   ` Paolo Bonzini
  2016-09-02 11:08 ` [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Paolo Bonzini
  12 siblings, 1 reply; 26+ messages in thread
From: Chao Peng @ 2016-08-25 10:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

An ELF format kernel must be specified. Only linux is supported.

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 hw/i386/pc.c         | 92 ++++++++++++++++++++++++++++++++++++++--------------
 include/hw/i386/pc.h |  2 ++
 2 files changed, 69 insertions(+), 25 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 4a368de..1362810 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -974,8 +974,43 @@ struct setup_data {
     uint8_t data[0];
 } __attribute__((packed));
 
-static void load_linux(PCMachineState *pcms,
-                       FWCfgState *fw_cfg)
+static void load_linux_efi(PCMachineState *pcms)
+{
+    unsigned char class;
+    MachineState *machine = MACHINE(pcms);
+    FILE *file = fopen(machine->kernel_filename, "rb");
+
+    if (!file) {
+        goto err;
+    }
+
+    if (fseek(file, EI_CLASS, 0) || fread(&class, 1, 1, file) != 1) {
+        fclose(file);
+        goto err;
+    }
+    fclose(file);
+
+    if (load_elf(machine->kernel_filename, NULL, NULL, &boot_info.entry,
+                   NULL, NULL, 0, EM_X86_64, 0, 0) < 0) {
+        goto err;
+    }
+
+    if (class == ELFCLASS64) {
+        boot_info.long_mode = true;
+    } else if (class != ELFCLASS32) {
+        goto err;
+    }
+
+    boot_info.protected_mode = true;
+    return;
+
+err:
+    fprintf(stderr, "qemu: could not load kernel '%s'\n",
+                    machine->kernel_filename);
+    exit(1);
+}
+
+static void load_linux_bzimage(PCMachineState *pcms, FWCfgState *fw_cfg)
 {
     uint16_t protocol;
     int setup_size, kernel_size, initrd_size = 0, cmdline_size;
@@ -1488,7 +1523,7 @@ void xen_load_linux(PCMachineState *pcms)
     fw_cfg = fw_cfg_init_io(FW_CFG_IO_BASE);
     rom_set_fw(fw_cfg);
 
-    load_linux(pcms, fw_cfg);
+    load_linux_bzimage(pcms, fw_cfg);
     for (i = 0; i < nb_option_roms; i++) {
         assert(!strcmp(option_rom[i].name, "linuxboot.bin") ||
                !strcmp(option_rom[i].name, "linuxboot_dma.bin") ||
@@ -1506,7 +1541,7 @@ void pc_memory_init(PCMachineState *pcms,
     int linux_boot, i;
     MemoryRegion *ram, *option_rom_mr;
     MemoryRegion *ram_below_4g, *ram_above_4g;
-    FWCfgState *fw_cfg;
+    FWCfgState *fw_cfg = NULL;
     MachineState *machine = MACHINE(pcms);
     PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
 
@@ -1588,36 +1623,42 @@ void pc_memory_init(PCMachineState *pcms,
                                     &pcms->hotplug_memory.mr);
     }
 
-    /* Initialize PC system firmware */
-    pc_system_firmware_init(rom_memory, !pcmc->pci_enabled);
+    if (pcms->fw) {
+        /* Initialize PC system firmware */
+        pc_system_firmware_init(rom_memory, !pcmc->pci_enabled);
 
-    option_rom_mr = g_malloc(sizeof(*option_rom_mr));
-    memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
-                           &error_fatal);
-    vmstate_register_ram_global(option_rom_mr);
-    memory_region_add_subregion_overlap(rom_memory,
-                                        PC_ROM_MIN_VGA,
-                                        option_rom_mr,
-                                        1);
+        option_rom_mr = g_malloc(sizeof(*option_rom_mr));
+        memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE,
+                               &error_fatal);
+        vmstate_register_ram_global(option_rom_mr);
+        memory_region_add_subregion_overlap(rom_memory,
+                                            PC_ROM_MIN_VGA,
+                                            option_rom_mr,
+                                            1);
 
-    fw_cfg = bochs_bios_init(&address_space_memory, pcms);
+        fw_cfg = bochs_bios_init(&address_space_memory, pcms);
 
-    rom_set_fw(fw_cfg);
+        rom_set_fw(fw_cfg);
 
-    if (pcmc->has_reserved_memory && pcms->hotplug_memory.base) {
-        uint64_t *val = g_malloc(sizeof(*val));
-        PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
-        uint64_t res_mem_end = pcms->hotplug_memory.base;
+        if (pcmc->has_reserved_memory && pcms->hotplug_memory.base) {
+            uint64_t *val = g_malloc(sizeof(*val));
+            PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
+            uint64_t res_mem_end = pcms->hotplug_memory.base;
 
-        if (!pcmc->broken_reserved_end) {
-            res_mem_end += memory_region_size(&pcms->hotplug_memory.mr);
+            if (!pcmc->broken_reserved_end) {
+                res_mem_end += memory_region_size(&pcms->hotplug_memory.mr);
+            }
+            *val = cpu_to_le64(ROUND_UP(res_mem_end, 0x1ULL << 30));
+            fw_cfg_add_file(fw_cfg, "etc/reserved-memory-end", val, sizeof(*val));
         }
-        *val = cpu_to_le64(ROUND_UP(res_mem_end, 0x1ULL << 30));
-        fw_cfg_add_file(fw_cfg, "etc/reserved-memory-end", val, sizeof(*val));
     }
 
     if (linux_boot) {
-        load_linux(pcms, fw_cfg);
+        if (pcms->fw) {
+            load_linux_bzimage(pcms, fw_cfg);
+        } else {
+            load_linux_efi(pcms);
+        }
     }
 
     for (i = 0; i < nb_option_roms; i++) {
@@ -2347,6 +2388,7 @@ static void pc_machine_initfn(Object *obj)
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_PIC, pic, true);
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_PIT, pit, true);
     PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_STATIC_PRT, static_prt, false);
+    PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_FW, fw, true);
 }
 
 static void pc_machine_reset(void)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 55ab09a..f5e01e1 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -82,6 +82,7 @@ struct PCMachineState {
     bool pic;
     bool pit;
     bool static_prt;
+    bool fw;
 };
 
 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
@@ -95,6 +96,7 @@ struct PCMachineState {
 #define PC_MACHINE_PIC              "pic"
 #define PC_MACHINE_PIT              "pit"
 #define PC_MACHINE_STATIC_PRT       "static-prt"
+#define PC_MACHINE_FW               "fw"
 
 /**
  * PCMachineClass:
-- 
1.8.3.1

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

* Re: [Qemu-devel] [RFC PATCH v2 05/12] acpi: build static _PRT
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 05/12] acpi: build static _PRT Chao Peng
@ 2016-08-29 17:06   ` Paolo Bonzini
  0 siblings, 0 replies; 26+ messages in thread
From: Paolo Bonzini @ 2016-08-29 17:06 UTC (permalink / raw)
  To: Chao Peng, qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang



On 25/08/2016 12:14, Chao Peng wrote:
> ...to reduce the interpretation burden for guest ACPI component.
> 
> Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
> ---
>  hw/i386/acpi-build.c | 31 ++++++++++++++++++++++++++++++-
>  hw/i386/pc.c         |  1 +
>  include/hw/i386/pc.h |  2 ++
>  3 files changed, 33 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index a26a4bb..60c0896 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1772,6 +1772,31 @@ static void build_q35_pci0_int(Aml *table)
>      aml_append(table, sb_scope);
>  }
>  
> +static void build_static_q35_pci0_int(Aml *table)
> +{
> +    int i, j;
> +    Aml *method, *res, *pkg;
> +    Aml *sb_scope = aml_scope("_SB");
> +    Aml *pci0_scope = aml_scope("PCI0");
> +
> +    method = aml_method("_PRT", 0, AML_NOTSERIALIZED);
> +    res = aml_package(128);
> +    for (i = 0; i < 32; i++) {
> +        for (j = 0; j < 4; j++) {
> +            pkg = aml_package(4);
> +            aml_append(pkg, aml_int((i << 16) | 0xffff));
> +            aml_append(pkg, aml_int(j));
> +            aml_append(pkg, aml_int(0));
> +            aml_append(pkg, aml_int(0x10 + j));
> +            aml_append(res, pkg);
> +        }
> +    }
> +
> +    aml_append(method, aml_return(res));
> +    aml_append(pci0_scope, method);
> +    aml_append(sb_scope, pci0_scope);
> +}
> +
>  static void build_q35_isa_bridge(Aml *table)
>  {
>      Aml *dev;
> @@ -2007,7 +2032,11 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
>          build_hpet_aml(dsdt);
>          build_q35_isa_bridge(dsdt);
>          build_isa_devices_aml(dsdt);
> -        build_q35_pci0_int(dsdt);
> +        if (pcms->static_prt) {
> +            build_static_q35_pci0_int(dsdt);
> +        } else {
> +            build_q35_pci0_int(dsdt);
> +        }
>      }
>  
>      if (pcmc->legacy_cpu_hotplug) {
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 1d62957..f479697 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -2196,6 +2196,7 @@ static void pc_machine_initfn(Object *obj)
>      PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SATA, sata, true);
>      PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_PIC, pic, true);
>      PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_PIT, pit, true);
> +    PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_STATIC_PRT, static_prt, false);
>  }
>  
>  static void pc_machine_reset(void)
> diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
> index 1dc7954..55ab09a 100644
> --- a/include/hw/i386/pc.h
> +++ b/include/hw/i386/pc.h
> @@ -81,6 +81,7 @@ struct PCMachineState {
>      bool sata;
>      bool pic;
>      bool pit;
> +    bool static_prt;
>  };
>  
>  #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
> @@ -93,6 +94,7 @@ struct PCMachineState {
>  #define PC_MACHINE_SATA             "sata"
>  #define PC_MACHINE_PIC              "pic"
>  #define PC_MACHINE_PIT              "pit"
> +#define PC_MACHINE_STATIC_PRT       "static-prt"
>  
>  /**
>   * PCMachineClass:
> 

You can do this unconditionally, but it should match the contents of the
q35 PRT.

Paolo

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

* Re: [Qemu-devel] [RFC PATCH v2 12/12] pc: skip firmware
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 12/12] pc: skip firmware Chao Peng
@ 2016-08-29 17:08   ` Paolo Bonzini
  0 siblings, 0 replies; 26+ messages in thread
From: Paolo Bonzini @ 2016-08-29 17:08 UTC (permalink / raw)
  To: Chao Peng, qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang



On 25/08/2016 12:15, Chao Peng wrote:
> -static void load_linux(PCMachineState *pcms,
> -                       FWCfgState *fw_cfg)
> +static void load_linux_efi(PCMachineState *pcms)

ELF, not EFI.

Paolo

> +{
> +    unsigned char class;
> +    MachineState *machine = MACHINE(pcms);
> +    FILE *file = fopen(machine->kernel_filename, "rb");
> +
> +    if (!file) {
> +        goto err;
> +    }
> +
> +    if (fseek(file, EI_CLASS, 0) || fread(&class, 1, 1, file) != 1) {
> +        fclose(file);
> +        goto err;
> +    }
> +    fclose(file);
> +
> +    if (load_elf(machine->kernel_filename, NULL, NULL, &boot_info.entry,
> +                   NULL, NULL, 0, EM_X86_64, 0, 0) < 0) {
> +        goto err;
> +    }
> +
> +    if (class == ELFCLASS64) {
> +        boot_info.long_mode = true;
> +    } else if (class != ELFCLASS32) {
> +        goto err;
> +    }
> +
> +    boot_info.protected_mode = true;
> +    return;
> +
> +err:
> +    fprintf(stderr, "qemu: could not load kernel '%s'\n",
> +                    machine->kernel_filename);
> +    exit(1);
> +}

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

* Re: [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization
  2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
                   ` (11 preceding siblings ...)
  2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 12/12] pc: skip firmware Chao Peng
@ 2016-09-02 11:08 ` Paolo Bonzini
  2016-09-05  2:37   ` Michael S. Tsirkin
  2016-09-06 10:48   ` Chao Peng
  12 siblings, 2 replies; 26+ messages in thread
From: Paolo Bonzini @ 2016-09-02 11:08 UTC (permalink / raw)
  To: Chao Peng, qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang



On 25/08/2016 12:14, Chao Peng wrote:
> This patchset is trying to optimize guest startup time by disabling
> or simplifying some features in QEMU. The version 1 can be found at:
> https://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg04842.html
> 
> Unlike version 1, this version optimizes Q35 directly instead of
> introducing a totally new platform. But we still keep the design of
> skipping firmware as till now we don't have good idea to optimize
> firmware to get the comparable boot time.
> 
> The patchset is against commit 5f0e775 (Update version for v2.7.0-rc3
> release) on master branch.
> 
> Basically this patchset introduces several switches to qemu comandline
> so that several features can be turned off in some use cases. The
> default behavior will not change in case no switches are provided.
> 
> Performance data:
> feature(switches)       time saved in guest
> -nosmbus                4ms
> -nosata                 6ms
> -nopic                  2ms
> -nopit                  5ms
> -static-prt             8ms
> -nofw                   62ms
> 
> Thanks,
> Chao
> 
> Chao Peng (9):
>   pc: make smbus configurable
>   pc: make sata configurable
>   pc: make pic configurable
>   pc: make pit configurable
>   acpi: build static _PRT
>   ich9: enable pm registers when there is no firmware
>   q35: initialize MMCFG base when there is no firmware
>   pc: support direct loading protected/long mode kernel
>   pc: skip firmware
> 
> Haozhong Zhang (3):
>   acpi: expose data structurs and functions of BIOS linker loader
>   acpi: expose acpi_checksum()
>   acpi: patch guest ACPI when there is no firmware
> 
>  hw/acpi/bios-linker-loader.c         |  83 +---------
>  hw/acpi/core.c                       |   2 +-
>  hw/acpi/nvdimm.c                     |   6 +-
>  hw/i386/Makefile.objs                |   2 +-
>  hw/i386/acpi-build-nofw.c            | 295 ++++++++++++++++++++++++++++++++++
>  hw/i386/acpi-build.c                 | 102 +++++++-----
>  hw/i386/acpi-build.h                 |   5 +
>  hw/i386/pc.c                         | 301 +++++++++++++++++++++++++++++++----
>  hw/i386/pc_piix.c                    |   2 +-
>  hw/i386/pc_q35.c                     |  60 ++++---
>  hw/isa/lpc_ich9.c                    |  12 +-
>  hw/pci-host/q35.c                    |  15 +-
>  include/hw/acpi/acpi.h               |   2 +
>  include/hw/acpi/bios-linker-loader.h |  85 ++++++++++
>  include/hw/i386/pc.h                 |  16 +-
>  15 files changed, 800 insertions(+), 188 deletions(-)
>  create mode 100644 hw/i386/acpi-build-nofw.c

Patches 1-4 are okay, though I think it would be easier to add a -M
q35-lite too that just removes the legacy devices.  The -M q35-lite
machine doesn't have to support versioning for now.

As you might expect, I don't agree with removing the firmware.  There's
room for much more optimization before duplicating firmware code in
QEMU.  I'd rather see numbers for:

1) qboot optimizations: adopt the fw_cfg DMA interface instead of the
cbfs flash hack (so that -kernel works), drop PCI bridge initialization,
copy less than 64K of memory from ROM to 0xf0000;

2) Linux optimizations: using an uncompressed image to avoid the cost of
copying and decompressing.  QEMU can already load the image at the right
place and the real mode stub can do little more than GDT/IDT setup.

3) PAM optimizations: for -M q35-lite initialize the machine with RAM
from 0xc0000 to 1MB.

I know that you ultimately would like to mmap the kernel, but I would
like to have a better understanding of where the time is spent.

Thanks,

Paolo

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

* Re: [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization
  2016-09-02 11:08 ` [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Paolo Bonzini
@ 2016-09-05  2:37   ` Michael S. Tsirkin
  2016-09-06 10:48   ` Chao Peng
  1 sibling, 0 replies; 26+ messages in thread
From: Michael S. Tsirkin @ 2016-09-05  2:37 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Chao Peng, qemu-devel, gor Mammedov, Xiao Guangrong,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang

On Fri, Sep 02, 2016 at 01:08:29PM +0200, Paolo Bonzini wrote:
> 
> 
> On 25/08/2016 12:14, Chao Peng wrote:
> > This patchset is trying to optimize guest startup time by disabling
> > or simplifying some features in QEMU. The version 1 can be found at:
> > https://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg04842.html
> > 
> > Unlike version 1, this version optimizes Q35 directly instead of
> > introducing a totally new platform. But we still keep the design of
> > skipping firmware as till now we don't have good idea to optimize
> > firmware to get the comparable boot time.
> > 
> > The patchset is against commit 5f0e775 (Update version for v2.7.0-rc3
> > release) on master branch.
> > 
> > Basically this patchset introduces several switches to qemu comandline
> > so that several features can be turned off in some use cases. The
> > default behavior will not change in case no switches are provided.
> > 
> > Performance data:
> > feature(switches)       time saved in guest
> > -nosmbus                4ms
> > -nosata                 6ms
> > -nopic                  2ms
> > -nopit                  5ms
> > -static-prt             8ms
> > -nofw                   62ms
> > 
> > Thanks,
> > Chao
> > 
> > Chao Peng (9):
> >   pc: make smbus configurable
> >   pc: make sata configurable
> >   pc: make pic configurable
> >   pc: make pit configurable
> >   acpi: build static _PRT
> >   ich9: enable pm registers when there is no firmware
> >   q35: initialize MMCFG base when there is no firmware
> >   pc: support direct loading protected/long mode kernel
> >   pc: skip firmware
> > 
> > Haozhong Zhang (3):
> >   acpi: expose data structurs and functions of BIOS linker loader
> >   acpi: expose acpi_checksum()
> >   acpi: patch guest ACPI when there is no firmware
> > 
> >  hw/acpi/bios-linker-loader.c         |  83 +---------
> >  hw/acpi/core.c                       |   2 +-
> >  hw/acpi/nvdimm.c                     |   6 +-
> >  hw/i386/Makefile.objs                |   2 +-
> >  hw/i386/acpi-build-nofw.c            | 295 ++++++++++++++++++++++++++++++++++
> >  hw/i386/acpi-build.c                 | 102 +++++++-----
> >  hw/i386/acpi-build.h                 |   5 +
> >  hw/i386/pc.c                         | 301 +++++++++++++++++++++++++++++++----
> >  hw/i386/pc_piix.c                    |   2 +-
> >  hw/i386/pc_q35.c                     |  60 ++++---
> >  hw/isa/lpc_ich9.c                    |  12 +-
> >  hw/pci-host/q35.c                    |  15 +-
> >  include/hw/acpi/acpi.h               |   2 +
> >  include/hw/acpi/bios-linker-loader.h |  85 ++++++++++
> >  include/hw/i386/pc.h                 |  16 +-
> >  15 files changed, 800 insertions(+), 188 deletions(-)
> >  create mode 100644 hw/i386/acpi-build-nofw.c
> 
> Patches 1-4 are okay, though I think it would be easier to add a -M
> q35-lite too that just removes the legacy devices.  The -M q35-lite
> machine doesn't have to support versioning for now.

Where q35-lite will be same as q35 with different defaults?
Sure, I don't have a problem with this.
In particular this will allow things like "q35-lite but with sata" etc.

> As you might expect, I don't agree with removing the firmware.  There's
> room for much more optimization before duplicating firmware code in
> QEMU.  I'd rather see numbers for:
> 
> 1) qboot optimizations: adopt the fw_cfg DMA interface instead of the
> cbfs flash hack (so that -kernel works), drop PCI bridge initialization,
> copy less than 64K of memory from ROM to 0xf0000;
> 
> 2) Linux optimizations: using an uncompressed image to avoid the cost of
> copying and decompressing.  QEMU can already load the image at the right
> place and the real mode stub can do little more than GDT/IDT setup.
> 
> 3) PAM optimizations: for -M q35-lite initialize the machine with RAM
> from 0xc0000 to 1MB.
> 
> I know that you ultimately would like to mmap the kernel, but I would
> like to have a better understanding of where the time is spent.
> 
> Thanks,
> 
> Paolo

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

* Re: [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization
  2016-09-02 11:08 ` [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Paolo Bonzini
  2016-09-05  2:37   ` Michael S. Tsirkin
@ 2016-09-06 10:48   ` Chao Peng
  2016-09-06 11:53     ` Michael S. Tsirkin
  2016-09-06 14:21     ` [Qemu-devel] " Paolo Bonzini
  1 sibling, 2 replies; 26+ messages in thread
From: Chao Peng @ 2016-09-06 10:48 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel
  Cc: Michael S. Tsirkin, gor Mammedov, Xiao Guangrong,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang, Amnon Ilan


> Patches 1-4 are okay, though I think it would be easier to add a -M
> q35-lite too that just removes the legacy devices.  The -M q35-lite
> machine doesn't have to support versioning for now.

Okay, this is also good to have in my mind.

> 
> As you might expect, I don't agree with removing the
> firmware.  There's
> room for much more optimization before duplicating firmware code in
> QEMU.  I'd rather see numbers for:
> 
> 1) qboot optimizations: adopt the fw_cfg DMA interface instead of the
> cbfs flash hack (so that -kernel works), drop PCI bridge
> initialization,
> copy less than 64K of memory from ROM to 0xf0000;

I can do the evaluation on qboot. Also adding Amnon Ilan, to see if
there is some thing we can do for SeaBios.
 
> 
> 2) Linux optimizations: using an uncompressed image to avoid the cost
> of
> copying and decompressing.  QEMU can already load the image at the
> right
> place and the real mode stub can do little more than GDT/IDT setup.

This works surely. I actually followed your suggestion in v1 to make
kernel multiboot-compatible and then load that kernel in QEMU directly
(Also skipped firmware but some changes in patch 11 would move from
QEMU to guest kernel). This way we also gain benefit of doing mmap
kernel as you talked below. Not sure if this is something you can
accpet.

> 
> 3) PAM optimizations: for -M q35-lite initialize the machine with RAM
> from 0xc0000 to 1MB.
> 
> I know that you ultimately would like to mmap the kernel, but I would
> like to have a better understanding of where the time is spent.
> 
> Thanks,
> 
> Paolo

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

* Re: [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization
  2016-09-06 10:48   ` Chao Peng
@ 2016-09-06 11:53     ` Michael S. Tsirkin
  2016-09-06 14:28       ` Chao Peng
  2016-09-06 14:21     ` [Qemu-devel] " Paolo Bonzini
  1 sibling, 1 reply; 26+ messages in thread
From: Michael S. Tsirkin @ 2016-09-06 11:53 UTC (permalink / raw)
  To: Chao Peng
  Cc: Paolo Bonzini, qemu-devel, gor Mammedov, Xiao Guangrong,
	Richard Henderson, Eduardo Habkost, Haozhong Zhang, Amnon Ilan

On Tue, Sep 06, 2016 at 06:48:57PM +0800, Chao Peng wrote:
> 
> > Patches 1-4 are okay, though I think it would be easier to add a -M
> > q35-lite too that just removes the legacy devices.  The -M q35-lite
> > machine doesn't have to support versioning for now.
> 
> Okay, this is also good to have in my mind.
> 
> > 
> > As you might expect, I don't agree with removing the
> > firmware.  There's
> > room for much more optimization before duplicating firmware code in
> > QEMU.  I'd rather see numbers for:
> > 
> > 1) qboot optimizations: adopt the fw_cfg DMA interface instead of the
> > cbfs flash hack (so that -kernel works), drop PCI bridge
> > initialization,
> > copy less than 64K of memory from ROM to 0xf0000;
> 
> I can do the evaluation on qboot. Also adding Amnon Ilan, to see if
> there is some thing we can do for SeaBios.

AFAIK latest seabios already supports DMA.
It's easy to add more config options for seabios
if you are so inclined.

> > 
> > 2) Linux optimizations: using an uncompressed image to avoid the cost
> > of
> > copying and decompressing.  QEMU can already load the image at the
> > right
> > place and the real mode stub can do little more than GDT/IDT setup.
> 
> This works surely. I actually followed your suggestion in v1 to make
> kernel multiboot-compatible and then load that kernel in QEMU directly
> (Also skipped firmware but some changes in patch 11 would move from
> QEMU to guest kernel). This way we also gain benefit of doing mmap
> kernel as you talked below. Not sure if this is something you can
> accpet.

I'm not sure I understand the question here. Accept what?


> > 
> > 3) PAM optimizations: for -M q35-lite initialize the machine with RAM
> > from 0xc0000 to 1MB.
> > 
> > I know that you ultimately would like to mmap the kernel, but I would
> > like to have a better understanding of where the time is spent.
> > 
> > Thanks,
> > 
> > Paolo

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

* Re: [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization
  2016-09-06 10:48   ` Chao Peng
  2016-09-06 11:53     ` Michael S. Tsirkin
@ 2016-09-06 14:21     ` Paolo Bonzini
  2016-09-06 14:31       ` Chao Peng
  2016-09-06 14:45       ` Michael S. Tsirkin
  1 sibling, 2 replies; 26+ messages in thread
From: Paolo Bonzini @ 2016-09-06 14:21 UTC (permalink / raw)
  To: Chao Peng, qemu-devel
  Cc: Haozhong Zhang, Xiao Guangrong, Eduardo Habkost,
	Michael S. Tsirkin, gor Mammedov, Amnon Ilan, Richard Henderson



On 06/09/2016 12:48, Chao Peng wrote:
>> As you might expect, I don't agree with removing the
>> firmware.  There's
>> room for much more optimization before duplicating firmware code in
>> QEMU.  I'd rather see numbers for:
>>
>> 1) qboot optimizations: adopt the fw_cfg DMA interface instead of the
>> cbfs flash hack (so that -kernel works), drop PCI bridge
>> initialization, copy less than 64K of memory from ROM to 0xf0000;
> 
> I can do the evaluation on qboot. Also adding Amnon Ilan, to see if
> there is some thing we can do for SeaBios.

For SeaBIOS we can try dropping PAM and PCI, but not much more.

I've pushed fw_cfg DMA support and some PAM  optimizations to qboot (it
doesn't setup PAM if QEMU doesn't configure 0xf0000-0x100000 as ROM).
I've left it for you to figure out which parts of PCI initialization can
be removed.

>> 2) Linux optimizations: using an uncompressed image to avoid the
>> cost of copying and decompressing.  QEMU can already load the image
>> at the right place and the real mode stub can do little more than
>> GDT/IDT setup.
> 
> This works surely. I actually followed your suggestion in v1 to make
> kernel multiboot-compatible and then load that kernel in QEMU directly

Please try posting the multiboot patches to the upstream x86 Linux
mailing list.  I am very interested in them, because I think it's the
simplest way to compare qboot with direct kernel load.  And as you say,
it might make patch 11 a little smaller and possibly more acceptable.

Paolo

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

* Re: [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization
  2016-09-06 11:53     ` Michael S. Tsirkin
@ 2016-09-06 14:28       ` Chao Peng
  2016-09-12 15:15         ` Gerd Hoffmann
  0 siblings, 1 reply; 26+ messages in thread
From: Chao Peng @ 2016-09-06 14:28 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Haozhong Zhang, Xiao Guangrong, Eduardo Habkost, qemu-devel,
	gor Mammedov, Paolo Bonzini, Amnon Ilan, Richard Henderson


> > > 1) qboot optimizations: adopt the fw_cfg DMA interface instead of
> > > the
> > > cbfs flash hack (so that -kernel works), drop PCI bridge
> > > initialization,
> > > copy less than 64K of memory from ROM to 0xf0000;
> > 
> > I can do the evaluation on qboot. Also adding Amnon Ilan, to see if
> > there is some thing we can do for SeaBios.
> 
> AFAIK latest seabios already supports DMA.
> It's easy to add more config options for seabios
> if you are so inclined.

Yes, I tried that, the fw_cfg overhead in SeaBios/linuxboot optrom is
already not a big issue for us. However, there are still some other
code in SeaBIOS needs to be investigated.
> 
> > 
> > > 
> > > 
> > > 2) Linux optimizations: using an uncompressed image to avoid the
> > > cost
> > > of
> > > copying and decompressing.  QEMU can already load the image at
> > > the
> > > right
> > > place and the real mode stub can do little more than GDT/IDT
> > > setup.
> > 
> > This works surely. I actually followed your suggestion in v1 to
> > make
> > kernel multiboot-compatible and then load that kernel in QEMU
> > directly
> > (Also skipped firmware but some changes in patch 11 would move from
> > QEMU to guest kernel). This way we also gain benefit of doing mmap
> > kernel as you talked below. Not sure if this is something you can
> > accpet.
> 
> I'm not sure I understand the question here. Accept what?
> 

I mean loading a multiboot kernel without the need for firmaware.

Thanks,
Chao

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

* Re: [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization
  2016-09-06 14:21     ` [Qemu-devel] " Paolo Bonzini
@ 2016-09-06 14:31       ` Chao Peng
  2016-09-06 14:45       ` Michael S. Tsirkin
  1 sibling, 0 replies; 26+ messages in thread
From: Chao Peng @ 2016-09-06 14:31 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel
  Cc: Haozhong Zhang, Xiao Guangrong, Eduardo Habkost,
	Michael S. Tsirkin, gor Mammedov, Amnon Ilan, Richard Henderson


> > > 2) Linux optimizations: using an uncompressed image to avoid the
> > > cost of copying and decompressing.  QEMU can already load the
> > > image
> > > at the right place and the real mode stub can do little more than
> > > GDT/IDT setup.
> > 
> > This works surely. I actually followed your suggestion in v1 to
> > make
> > kernel multiboot-compatible and then load that kernel in QEMU
> > directly
> 
> Please try posting the multiboot patches to the upstream x86 Linux
> mailing list.  I am very interested in them, because I think it's the
> simplest way to compare qboot with direct kernel load.  And as you
> say,
> it might make patch 11 a little smaller and possibly more acceptable.
> 
OK, I will do that (and to see their feedbacks).

Thanks,
Chao

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

* Re: [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization
  2016-09-06 14:21     ` [Qemu-devel] " Paolo Bonzini
  2016-09-06 14:31       ` Chao Peng
@ 2016-09-06 14:45       ` Michael S. Tsirkin
  1 sibling, 0 replies; 26+ messages in thread
From: Michael S. Tsirkin @ 2016-09-06 14:45 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Chao Peng, qemu-devel, Haozhong Zhang, Xiao Guangrong,
	Eduardo Habkost, gor Mammedov, Amnon Ilan, Richard Henderson

On Tue, Sep 06, 2016 at 04:21:25PM +0200, Paolo Bonzini wrote:
> 
> 
> On 06/09/2016 12:48, Chao Peng wrote:
> >> As you might expect, I don't agree with removing the
> >> firmware.  There's
> >> room for much more optimization before duplicating firmware code in
> >> QEMU.  I'd rather see numbers for:
> >>
> >> 1) qboot optimizations: adopt the fw_cfg DMA interface instead of the
> >> cbfs flash hack (so that -kernel works), drop PCI bridge
> >> initialization, copy less than 64K of memory from ROM to 0xf0000;
> > 
> > I can do the evaluation on qboot. Also adding Amnon Ilan, to see if
> > there is some thing we can do for SeaBios.
> 
> For SeaBIOS we can try dropping PAM and PCI, but not much more.
> 
> I've pushed fw_cfg DMA support and some PAM  optimizations to qboot (it
> doesn't setup PAM if QEMU doesn't configure 0xf0000-0x100000 as ROM).
> I've left it for you to figure out which parts of PCI initialization can
> be removed.

I think we can expose the plug an play OS flag to guest,
upon seeing it, seabios can limit self to only
enumerating boot devices. No boot devices ->
skip pci init completely.


> >> 2) Linux optimizations: using an uncompressed image to avoid the
> >> cost of copying and decompressing.  QEMU can already load the image
> >> at the right place and the real mode stub can do little more than
> >> GDT/IDT setup.
> > 
> > This works surely. I actually followed your suggestion in v1 to make
> > kernel multiboot-compatible and then load that kernel in QEMU directly
> 
> Please try posting the multiboot patches to the upstream x86 Linux
> mailing list.  I am very interested in them, because I think it's the
> simplest way to compare qboot with direct kernel load.  And as you say,
> it might make patch 11 a little smaller and possibly more acceptable.
> 
> Paolo

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

* Re: [Qemu-devel] [RFC PATCH v2 01/12] pc: make smbus configurable
  2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 01/12] pc: make smbus configurable Chao Peng
@ 2016-09-06 20:18   ` Eduardo Habkost
  0 siblings, 0 replies; 26+ messages in thread
From: Eduardo Habkost @ 2016-09-06 20:18 UTC (permalink / raw)
  To: Chao Peng
  Cc: qemu-devel, Michael S. Tsirkin, gor Mammedov, Xiao Guangrong,
	Paolo Bonzini, Richard Henderson, Haozhong Zhang

On Thu, Aug 25, 2016 at 06:14:54AM -0400, Chao Peng wrote:
> Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
> ---
>  hw/i386/pc.c         | 23 +++++++++++++++++++++++
>  hw/i386/pc_q35.c     | 12 +++++++-----
>  include/hw/i386/pc.h |  3 +++
>  3 files changed, 33 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 022dd1b..66e1961 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -2005,6 +2005,27 @@ static HotplugHandler *pc_get_hotpug_handler(MachineState *machine,
>          pcmc->get_hotplug_handler(machine, dev) : NULL;
>  }
>  
> +static void pc_machine_get_prop_bool(Object *obj, Visitor *v, const char *name,
> +                                     void *opaque, Error **errp)
> +{
> +    bool value = *(bool *)opaque;
> +
> +    visit_type_bool(v, name, &value, errp);
> +}
> +
> +static void pc_machine_set_prop_bool(Object *obj, Visitor *v, const char *name,
> +                                     void *opaque, Error **errp)
> +{
> +    visit_type_bool(v, name, (bool *)opaque, errp);
> +}
> +
> +#define PC_MACHINE_DEFINE_PROP_BOOL(pcms, prop, field, defval)      \
> +        pcms->field = defval;                                       \
> +        object_property_add(OBJECT(pcms), prop, "bool",             \
> +                            pc_machine_get_prop_bool,               \
> +                            pc_machine_set_prop_bool,               \
> +                            NULL, &pcms->field, &error_abort);

This is triggers checkpatch.pl error:

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#76: FILE: hw/i386/pc.c:2022:
+#define PC_MACHINE_DEFINE_PROP_BOOL(pcms, prop, field, defval)      \
+        pcms->field = defval;                                       \
+        object_property_add(OBJECT(pcms), prop, "bool",             \
+                            pc_machine_get_prop_bool,               \
+                            pc_machine_set_prop_bool,               \
+                            NULL, &pcms->field, &error_abort);


> +
>  static void
>  pc_machine_get_hotplug_memory_region_size(Object *obj, Visitor *v,
>                                            const char *name, void *opaque,
> @@ -2168,6 +2189,8 @@ static void pc_machine_initfn(Object *obj)
>      pcms->acpi_nvdimm_state.is_enabled = false;
>      object_property_add_bool(obj, PC_MACHINE_NVDIMM, pc_machine_get_nvdimm,
>                               pc_machine_set_nvdimm, &error_abort);
> +
> +    PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SMBUS, smbus, true);

I suggest using object_class_property_add_bool() and registering
properties at class_init.

>  }
>  
[...]

-- 
Eduardo

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

* Re: [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization
  2016-09-06 14:28       ` Chao Peng
@ 2016-09-12 15:15         ` Gerd Hoffmann
  2016-09-12 17:57           ` [Qemu-devel] [SeaBIOS] " Peter Stuge
  0 siblings, 1 reply; 26+ messages in thread
From: Gerd Hoffmann @ 2016-09-12 15:15 UTC (permalink / raw)
  To: Chao Peng
  Cc: Michael S. Tsirkin, Haozhong Zhang, Xiao Guangrong,
	Eduardo Habkost, qemu-devel, Paolo Bonzini, gor Mammedov,
	Amnon Ilan, Richard Henderson, seabios

  Hi,

> > AFAIK latest seabios already supports DMA.
> > It's easy to add more config options for seabios
> > if you are so inclined.
> 
> Yes, I tried that, the fw_cfg overhead in SeaBios/linuxboot optrom is
> already not a big issue for us. However, there are still some other
> code in SeaBIOS needs to be investigated.

What exactly?

Also a few suggestions:
 * Try the seabios master branch.  There have been some improvements
   recently which are not in the 1.9 release.
 * Use a stripped down config.  When booting a kernel directly you
   don't need storage and usb drivers, also no keyboard.  That all
   reduces init time.
 * Initializing all pci devices (placing bars in address space and
   programming them) can probably be skipped and left to the linux
   kernel to handle.  But when trying take care that the effect might
   be that we shift just startup time from seabios to linux kernel,
   the placement needs to happen somewhere after all.
 * When discussing these things add the seabios list
   (seabios@seabios.org) to cc:  Added the list now.

cheers,
  Gerd

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

* Re: [Qemu-devel] [SeaBIOS] [RFC PATCH v2 00/12] Guest startup time optimization
  2016-09-12 15:15         ` Gerd Hoffmann
@ 2016-09-12 17:57           ` Peter Stuge
  0 siblings, 0 replies; 26+ messages in thread
From: Peter Stuge @ 2016-09-12 17:57 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Chao Peng, Xiao Guangrong, Michael S. Tsirkin, seabios,
	qemu-devel, Paolo Bonzini, Amnon Ilan, Richard Henderson

Gerd Hoffmann wrote:
>  * Initializing all pci devices (placing bars in address space and
>    programming them) can probably be skipped and left to the linux
>    kernel to handle.

When the coreboot project started out, in 1999, that turned out not
to be the case. I don't know if the situation has improved since then.


//Peter

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

end of thread, other threads:[~2016-09-12 17:08 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 01/12] pc: make smbus configurable Chao Peng
2016-09-06 20:18   ` Eduardo Habkost
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 02/12] pc: make sata configurable Chao Peng
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 03/12] pc: make pic configurable Chao Peng
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 04/12] pc: make pit configurable Chao Peng
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 05/12] acpi: build static _PRT Chao Peng
2016-08-29 17:06   ` Paolo Bonzini
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 06/12] acpi: expose data structurs and functions of BIOS linker loader Chao Peng
2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 07/12] acpi: expose acpi_checksum() Chao Peng
2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 08/12] acpi: patch guest ACPI when there is no firmware Chao Peng
2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 09/12] ich9: enable pm registers " Chao Peng
2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 10/12] q35: initialize MMCFG base " Chao Peng
2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 11/12] pc: support direct loading protected/long mode kernel Chao Peng
2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 12/12] pc: skip firmware Chao Peng
2016-08-29 17:08   ` Paolo Bonzini
2016-09-02 11:08 ` [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Paolo Bonzini
2016-09-05  2:37   ` Michael S. Tsirkin
2016-09-06 10:48   ` Chao Peng
2016-09-06 11:53     ` Michael S. Tsirkin
2016-09-06 14:28       ` Chao Peng
2016-09-12 15:15         ` Gerd Hoffmann
2016-09-12 17:57           ` [Qemu-devel] [SeaBIOS] " Peter Stuge
2016-09-06 14:21     ` [Qemu-devel] " Paolo Bonzini
2016-09-06 14:31       ` Chao Peng
2016-09-06 14:45       ` Michael S. Tsirkin

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.