2007-11-17 20:14:51 +03:00
|
|
|
#ifndef HW_PC_H
|
|
|
|
#define HW_PC_H
|
2009-03-06 02:01:23 +03:00
|
|
|
|
|
|
|
#include "qemu-common.h"
|
2012-12-17 21:19:49 +04:00
|
|
|
#include "exec/memory.h"
|
2013-02-05 20:06:20 +04:00
|
|
|
#include "hw/isa/isa.h"
|
|
|
|
#include "hw/block/fdc.h"
|
2012-10-24 10:43:34 +04:00
|
|
|
#include "net/net.h"
|
2013-02-05 20:06:20 +04:00
|
|
|
#include "hw/i386/ioapic.h"
|
2009-03-06 02:01:23 +03:00
|
|
|
|
2013-05-30 13:57:26 +04:00
|
|
|
#include "qemu/range.h"
|
2013-07-24 19:56:09 +04:00
|
|
|
#include "qemu/bitmap.h"
|
|
|
|
#include "sysemu/sysemu.h"
|
|
|
|
#include "hw/pci/pci.h"
|
2013-05-30 13:57:26 +04:00
|
|
|
|
2013-12-08 13:38:17 +04:00
|
|
|
#define HPET_INTCAP "hpet-intcap"
|
|
|
|
|
2007-11-17 20:14:51 +03:00
|
|
|
/* PC-style peripherals (also used by other machines). */
|
|
|
|
|
2013-05-30 13:57:26 +04:00
|
|
|
typedef struct PcPciInfo {
|
|
|
|
Range w32;
|
|
|
|
Range w64;
|
|
|
|
} PcPciInfo;
|
|
|
|
|
2013-09-16 19:09:11 +04:00
|
|
|
#define ACPI_PM_PROP_S3_DISABLED "disable_s3"
|
|
|
|
#define ACPI_PM_PROP_S4_DISABLED "disable_s4"
|
|
|
|
#define ACPI_PM_PROP_S4_VAL "s4_val"
|
|
|
|
#define ACPI_PM_PROP_SCI_INT "sci_int"
|
|
|
|
#define ACPI_PM_PROP_ACPI_ENABLE_CMD "acpi_enable_cmd"
|
|
|
|
#define ACPI_PM_PROP_ACPI_DISABLE_CMD "acpi_disable_cmd"
|
|
|
|
#define ACPI_PM_PROP_PM_IO_BASE "pm_io_base"
|
|
|
|
#define ACPI_PM_PROP_GPE0_BLK "gpe0_blk"
|
|
|
|
#define ACPI_PM_PROP_GPE0_BLK_LEN "gpe0_blk_len"
|
|
|
|
|
2013-05-30 13:57:26 +04:00
|
|
|
struct PcGuestInfo {
|
2013-05-13 21:00:23 +04:00
|
|
|
bool has_pci_info;
|
2013-08-09 21:35:02 +04:00
|
|
|
bool isapc_ram_fw;
|
2013-07-24 19:56:09 +04:00
|
|
|
hwaddr ram_size;
|
|
|
|
unsigned apic_id_limit;
|
|
|
|
bool apic_xrupt_override;
|
|
|
|
uint64_t numa_nodes;
|
|
|
|
uint64_t *node_mem;
|
|
|
|
uint64_t *node_cpu;
|
2013-05-30 13:57:26 +04:00
|
|
|
FWCfgState *fw_cfg;
|
i386: ACPI table generation code from seabios
This adds C code for generating ACPI tables at runtime,
imported from seabios git tree
commit 51684b7ced75fb76776e8ee84833fcfb6ecf12dd
Although ACPI tables come from a system BIOS on real hw,
it makes sense that the ACPI tables are coupled with the
virtual machine, since they have to abstract the x86 machine to
the OS's.
This is widely desired as a way to avoid the churn
and proliferation of QEMU-specific interfaces
associated with ACPI tables in bios code.
Notes:
As BIOS can reprogram devices prior to loading
ACPI tables, we pre-format ACPI tables but defer loading
hardware configuration there until tables are loaded.
The code structure was intentionally kept as close
to the seabios original as possible, to simplify
comparison and making sure we didn't lose anything
in translation.
Minor code duplication results, to help ensure there are no functional
regressions, I think it's better to merge it like this and do more code
changes in follow-up patches.
Cross-version compatibility concerns have been addressed:
ACPI tables are exposed to guest as FW_CFG entries.
When running with -M 1.5 and older, this patch disables ACPI
table generation, and doesn't expose ACPI
tables to guest.
As table content is likely to change over time,
the following measures are taken to simplify
cross-version migration:
- All tables besides the RSDP are packed in a single FW CFG entry.
This entry size is currently 23K. We round it up to 64K
to avoid too much churn there.
- Tables are placed in special ROM blob (not mapped into guest memory)
which is automatically migrated together with the guest, same
as BIOS code.
- Offsets where hardware configuration is loaded in ACPI tables
are also migrated, this is in case future ACPI changes make us
rearrange the tables in memory.
This patch reuses some code from SeaBIOS, which was originally under
LGPLv2 and then relicensed to GPLv3 or LGPLv3, in QEMU under GPLv2+. This
relicensing has been acked by all contributors that had contributed to the
code since the v2->v3 relicense. ACKs approving the v2+ relicensing are
listed below. The list might include ACKs from people not holding
copyright on any parts of the reused code, but it's better to err on the
side of caution and include them.
Affected SeaBIOS files (GPLv2+ license headers added)
<http://thread.gmane.org/gmane.comp.bios.coreboot.seabios/5949>:
src/acpi-dsdt-cpu-hotplug.dsl
src/acpi-dsdt-dbug.dsl
src/acpi-dsdt-hpet.dsl
src/acpi-dsdt-isa.dsl
src/acpi-dsdt-pci-crs.dsl
src/acpi.c
src/acpi.h
src/ssdt-misc.dsl
src/ssdt-pcihp.dsl
src/ssdt-proc.dsl
tools/acpi_extract.py
tools/acpi_extract_preprocess.py
Each one of the listed people agreed to the following:
> If you allow the use of your contribution in QEMU under the
> terms of GPLv2 or later as proposed by this patch,
> please respond to this mail including the line:
>
> Acked-by: Name <email address>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Jason Baron <jbaron@akamai.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Gleb Natapov <gleb@redhat.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Acked-by: Dave Frodin <dave.frodin@se-eng.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Kevin O'Connor <kevin@koconnor.net>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Magnus Christensson <magnus.christensson@intel.com>
Acked-by: Hu Tao <hutao@cn.fujitsu.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Tested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-24 19:56:14 +04:00
|
|
|
bool has_acpi_build;
|
2013-05-30 13:57:26 +04:00
|
|
|
};
|
|
|
|
|
2007-11-17 20:14:51 +03:00
|
|
|
/* parallel.c */
|
2011-12-16 01:09:51 +04:00
|
|
|
static inline bool parallel_init(ISABus *bus, int index, CharDriverState *chr)
|
2011-02-05 17:51:57 +03:00
|
|
|
{
|
2013-06-07 15:49:13 +04:00
|
|
|
DeviceState *dev;
|
|
|
|
ISADevice *isadev;
|
2011-02-05 17:51:57 +03:00
|
|
|
|
2013-06-07 15:49:13 +04:00
|
|
|
isadev = isa_try_create(bus, "isa-parallel");
|
|
|
|
if (!isadev) {
|
2011-02-05 17:56:53 +03:00
|
|
|
return false;
|
|
|
|
}
|
2013-06-07 15:49:13 +04:00
|
|
|
dev = DEVICE(isadev);
|
|
|
|
qdev_prop_set_uint32(dev, "index", index);
|
|
|
|
qdev_prop_set_chr(dev, "chardev", chr);
|
|
|
|
if (qdev_init(dev) < 0) {
|
2011-02-05 17:51:57 +03:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-10-06 18:44:26 +04:00
|
|
|
bool parallel_mm_init(MemoryRegion *address_space,
|
2012-10-23 14:30:10 +04:00
|
|
|
hwaddr base, int it_shift, qemu_irq irq,
|
2011-02-05 17:51:57 +03:00
|
|
|
CharDriverState *chr);
|
2007-11-17 20:14:51 +03:00
|
|
|
|
|
|
|
/* i8259.c */
|
|
|
|
|
2012-01-10 19:31:16 +04:00
|
|
|
extern DeviceState *isa_pic;
|
2011-12-16 01:09:51 +04:00
|
|
|
qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq);
|
2011-10-16 17:30:27 +04:00
|
|
|
qemu_irq *kvm_i8259_init(ISABus *bus);
|
2012-01-10 19:31:16 +04:00
|
|
|
int pic_read_irq(DeviceState *d);
|
|
|
|
int pic_get_output(DeviceState *d);
|
2013-01-14 10:06:25 +04:00
|
|
|
void pic_info(Monitor *mon, const QDict *qdict);
|
|
|
|
void irq_info(Monitor *mon, const QDict *qdict);
|
2007-11-17 20:14:51 +03:00
|
|
|
|
2011-10-07 11:19:35 +04:00
|
|
|
/* Global System Interrupts */
|
2010-06-19 11:41:43 +04:00
|
|
|
|
2011-10-07 11:19:35 +04:00
|
|
|
#define GSI_NUM_PINS IOAPIC_NUM_PINS
|
2010-05-14 11:29:15 +04:00
|
|
|
|
2011-10-07 11:19:35 +04:00
|
|
|
typedef struct GSIState {
|
2011-10-07 11:19:36 +04:00
|
|
|
qemu_irq i8259_irq[ISA_NUM_IRQS];
|
2011-10-07 11:19:35 +04:00
|
|
|
qemu_irq ioapic_irq[IOAPIC_NUM_PINS];
|
|
|
|
} GSIState;
|
|
|
|
|
|
|
|
void gsi_handler(void *opaque, int n, int level);
|
2010-05-14 11:29:15 +04:00
|
|
|
|
2007-11-17 20:14:51 +03:00
|
|
|
/* vmport.c */
|
2013-06-22 10:07:06 +04:00
|
|
|
typedef uint32_t (VMPortReadFunc)(void *opaque, uint32_t address);
|
|
|
|
|
2011-12-16 01:09:51 +04:00
|
|
|
static inline void vmport_init(ISABus *bus)
|
2011-02-05 17:34:41 +03:00
|
|
|
{
|
2011-12-16 01:09:51 +04:00
|
|
|
isa_create_simple(bus, "vmport");
|
2011-02-05 17:34:41 +03:00
|
|
|
}
|
2013-06-22 10:07:06 +04:00
|
|
|
|
|
|
|
void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque);
|
2011-02-05 17:34:52 +03:00
|
|
|
void vmmouse_get_data(uint32_t *data);
|
|
|
|
void vmmouse_set_data(const uint32_t *data);
|
2007-11-17 20:14:51 +03:00
|
|
|
|
|
|
|
/* pckbd.c */
|
|
|
|
|
|
|
|
void i8042_init(qemu_irq kbd_irq, qemu_irq mouse_irq, uint32_t io_base);
|
|
|
|
void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
|
2011-08-11 02:28:17 +04:00
|
|
|
MemoryRegion *region, ram_addr_t size,
|
2012-10-23 14:30:10 +04:00
|
|
|
hwaddr mask);
|
2010-05-22 11:59:01 +04:00
|
|
|
void i8042_isa_mouse_fake_event(void *opaque);
|
|
|
|
void i8042_setup_a20_line(ISADevice *dev, qemu_irq *a20_out);
|
2007-11-17 20:14:51 +03:00
|
|
|
|
|
|
|
/* pc.c */
|
|
|
|
extern int fd_bootchk;
|
|
|
|
|
2010-05-14 11:29:09 +04:00
|
|
|
void pc_register_ferr_irq(qemu_irq irq);
|
2010-05-14 11:29:15 +04:00
|
|
|
void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
|
|
|
|
|
2013-04-29 20:54:13 +04:00
|
|
|
void pc_cpus_init(const char *cpu_model, DeviceState *icc_bridge);
|
2013-04-30 20:00:53 +04:00
|
|
|
void pc_hot_add_cpu(const int64_t id, Error **errp);
|
2012-12-03 13:47:27 +04:00
|
|
|
void pc_acpi_init(const char *default_dsdt);
|
2013-05-30 13:57:26 +04:00
|
|
|
|
|
|
|
PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size,
|
|
|
|
ram_addr_t above_4g_mem_size);
|
|
|
|
|
2013-07-29 18:47:57 +04:00
|
|
|
#define PCI_HOST_PROP_PCI_HOLE_START "pci-hole-start"
|
|
|
|
#define PCI_HOST_PROP_PCI_HOLE_END "pci-hole-end"
|
|
|
|
#define PCI_HOST_PROP_PCI_HOLE64_START "pci-hole64-start"
|
|
|
|
#define PCI_HOST_PROP_PCI_HOLE64_END "pci-hole64-end"
|
|
|
|
#define PCI_HOST_PROP_PCI_HOLE64_SIZE "pci-hole64-size"
|
2013-08-27 09:37:26 +04:00
|
|
|
#define DEFAULT_PCI_HOLE64_SIZE (~0x0ULL)
|
|
|
|
|
2013-07-29 18:47:57 +04:00
|
|
|
|
2013-10-29 16:57:34 +04:00
|
|
|
void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
|
|
|
|
MemoryRegion *pci_address_space);
|
2013-07-29 18:47:57 +04:00
|
|
|
|
2013-04-16 04:24:08 +04:00
|
|
|
FWCfgState *pc_memory_init(MemoryRegion *system_memory,
|
|
|
|
const char *kernel_filename,
|
|
|
|
const char *kernel_cmdline,
|
|
|
|
const char *initrd_filename,
|
|
|
|
ram_addr_t below_4g_mem_size,
|
|
|
|
ram_addr_t above_4g_mem_size,
|
|
|
|
MemoryRegion *rom_memory,
|
2013-05-30 13:57:26 +04:00
|
|
|
MemoryRegion **ram_memory,
|
|
|
|
PcGuestInfo *guest_info);
|
2010-05-14 11:29:15 +04:00
|
|
|
qemu_irq *pc_allocate_cpu_irq(void);
|
2011-12-16 01:09:51 +04:00
|
|
|
DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
|
|
|
|
void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
|
2011-05-03 20:06:54 +04:00
|
|
|
ISADevice **rtc_state,
|
2011-10-20 18:37:26 +04:00
|
|
|
ISADevice **floppy,
|
2013-12-08 13:38:17 +04:00
|
|
|
bool no_vmport,
|
|
|
|
uint32 hpet_irqs);
|
2011-12-16 01:09:51 +04:00
|
|
|
void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd);
|
2010-05-14 11:29:15 +04:00
|
|
|
void pc_cmos_init(ram_addr_t ram_size, ram_addr_t above_4g_mem_size,
|
2010-06-24 21:58:20 +04:00
|
|
|
const char *boot_device,
|
2011-10-20 18:37:26 +04:00
|
|
|
ISADevice *floppy, BusState *ide0, BusState *ide1,
|
2011-02-05 19:32:23 +03:00
|
|
|
ISADevice *s);
|
2012-11-15 00:54:01 +04:00
|
|
|
void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus);
|
2010-05-14 11:29:15 +04:00
|
|
|
void pc_pci_device_init(PCIBus *pci_bus);
|
2010-05-14 11:29:09 +04:00
|
|
|
|
2010-05-14 11:29:04 +04:00
|
|
|
typedef void (*cpu_set_smm_t)(int smm, void *arg);
|
|
|
|
void cpu_smm_register(cpu_set_smm_t callback, void *arg);
|
|
|
|
|
2012-11-15 00:54:01 +04:00
|
|
|
void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name);
|
|
|
|
|
2009-06-18 14:57:00 +04:00
|
|
|
/* acpi_piix.c */
|
2010-03-29 23:23:52 +04:00
|
|
|
|
2008-03-18 09:53:05 +03:00
|
|
|
i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
|
2012-02-23 16:45:20 +04:00
|
|
|
qemu_irq sci_irq, qemu_irq smi_irq,
|
2013-04-16 04:24:08 +04:00
|
|
|
int kvm_enabled, FWCfgState *fw_cfg);
|
2007-11-17 20:14:51 +03:00
|
|
|
void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
|
|
|
|
|
2008-12-18 02:28:44 +03:00
|
|
|
/* hpet.c */
|
|
|
|
extern int no_hpet;
|
|
|
|
|
2007-11-17 20:14:51 +03:00
|
|
|
/* piix_pci.c */
|
2009-08-28 17:28:15 +04:00
|
|
|
struct PCII440FXState;
|
|
|
|
typedef struct PCII440FXState PCII440FXState;
|
|
|
|
|
2011-07-26 15:26:19 +04:00
|
|
|
PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn,
|
2011-12-16 01:09:54 +04:00
|
|
|
ISABus **isa_bus, qemu_irq *pic,
|
2011-08-08 17:09:04 +04:00
|
|
|
MemoryRegion *address_space_mem,
|
|
|
|
MemoryRegion *address_space_io,
|
2011-08-15 18:17:38 +04:00
|
|
|
ram_addr_t ram_size,
|
2013-07-29 18:47:57 +04:00
|
|
|
ram_addr_t above_4g_mem_size,
|
2011-08-15 18:17:38 +04:00
|
|
|
MemoryRegion *pci_memory,
|
|
|
|
MemoryRegion *ram_memory);
|
2007-11-17 20:14:51 +03:00
|
|
|
|
2013-07-24 19:56:11 +04:00
|
|
|
PCIBus *find_i440fx(void);
|
2009-08-28 17:28:13 +04:00
|
|
|
/* piix4.c */
|
2008-10-26 16:43:07 +03:00
|
|
|
extern PCIDevice *piix4_dev;
|
2011-12-16 01:09:58 +04:00
|
|
|
int piix4_init(PCIBus *bus, ISABus **isa_bus, int devfn);
|
2007-11-17 20:14:51 +03:00
|
|
|
|
|
|
|
/* vga.c */
|
2008-09-28 04:42:12 +04:00
|
|
|
enum vga_retrace_method {
|
|
|
|
VGA_RETRACE_DUMB,
|
|
|
|
VGA_RETRACE_PRECISE
|
|
|
|
};
|
|
|
|
|
|
|
|
extern enum vga_retrace_method vga_retrace_method;
|
2007-11-17 20:14:51 +03:00
|
|
|
|
2012-10-23 14:30:10 +04:00
|
|
|
int isa_vga_mm_init(hwaddr vram_base,
|
|
|
|
hwaddr ctrl_base, int it_shift,
|
2011-08-15 18:17:37 +04:00
|
|
|
MemoryRegion *address_space);
|
2007-11-17 20:14:51 +03:00
|
|
|
|
|
|
|
/* ne2000.c */
|
2011-12-16 01:09:51 +04:00
|
|
|
static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
|
2011-02-05 18:39:57 +03:00
|
|
|
{
|
2013-06-07 15:49:13 +04:00
|
|
|
DeviceState *dev;
|
|
|
|
ISADevice *isadev;
|
2007-11-17 20:14:51 +03:00
|
|
|
|
2011-02-05 18:39:57 +03:00
|
|
|
qemu_check_nic_model(nd, "ne2k_isa");
|
|
|
|
|
2013-06-07 15:49:13 +04:00
|
|
|
isadev = isa_try_create(bus, "ne2k_isa");
|
|
|
|
if (!isadev) {
|
2011-02-05 18:44:45 +03:00
|
|
|
return false;
|
|
|
|
}
|
2013-06-07 15:49:13 +04:00
|
|
|
dev = DEVICE(isadev);
|
|
|
|
qdev_prop_set_uint32(dev, "iobase", base);
|
|
|
|
qdev_prop_set_uint32(dev, "irq", irq);
|
|
|
|
qdev_set_nic_properties(dev, nd);
|
|
|
|
qdev_init_nofail(dev);
|
2011-02-05 18:44:45 +03:00
|
|
|
return true;
|
2011-02-05 18:39:57 +03:00
|
|
|
}
|
2007-11-17 20:14:51 +03:00
|
|
|
|
2012-02-22 11:18:51 +04:00
|
|
|
/* pc_sysfw.c */
|
2013-08-09 21:35:02 +04:00
|
|
|
void pc_system_firmware_init(MemoryRegion *rom_memory,
|
|
|
|
bool isapc_ram_fw);
|
2012-02-22 11:18:51 +04:00
|
|
|
|
2013-04-26 07:24:46 +04:00
|
|
|
/* pvpanic.c */
|
2013-07-24 19:56:12 +04:00
|
|
|
uint16_t pvpanic_port(void);
|
2013-04-26 07:24:46 +04:00
|
|
|
|
2010-02-15 20:33:46 +03:00
|
|
|
/* e820 types */
|
|
|
|
#define E820_RAM 1
|
|
|
|
#define E820_RESERVED 2
|
|
|
|
#define E820_ACPI 3
|
|
|
|
#define E820_NVS 4
|
|
|
|
#define E820_UNUSABLE 5
|
|
|
|
|
|
|
|
int e820_add_entry(uint64_t, uint64_t, uint32_t);
|
|
|
|
|
2013-12-08 13:38:17 +04:00
|
|
|
#define PC_Q35_COMPAT_1_7 \
|
|
|
|
{\
|
|
|
|
.driver = "hpet",\
|
|
|
|
.property = HPET_INTCAP,\
|
|
|
|
.value = stringify(4),\
|
|
|
|
}
|
|
|
|
|
|
|
|
#define PC_Q35_COMPAT_1_6 \
|
|
|
|
PC_COMPAT_1_6, \
|
|
|
|
PC_Q35_COMPAT_1_7
|
|
|
|
|
|
|
|
#define PC_Q35_COMPAT_1_5 \
|
|
|
|
PC_COMPAT_1_5, \
|
|
|
|
PC_Q35_COMPAT_1_6
|
|
|
|
|
|
|
|
#define PC_Q35_COMPAT_1_4 \
|
|
|
|
PC_COMPAT_1_4, \
|
|
|
|
PC_Q35_COMPAT_1_5
|
|
|
|
|
e1000: add interrupt mitigation support
This patch partially implements the e1000 interrupt mitigation mechanisms.
Using a single QEMUTimer, it emulates the ITR register (which is the newer
mitigation register, recommended by Intel) and approximately emulates
RADV and TADV registers. TIDV and RDTR register functionalities are not
emulated (RDTR is only used to validate RADV, according to the e1000 specs).
RADV, TADV, TIDV and RDTR registers make up the older e1000 mitigation
mechanism and would need a timer each to be completely emulated. However,
a single timer has been used in order to reach a good compromise between
emulation accuracy and simplicity/efficiency.
The implemented mechanism can be enabled/disabled specifying the command
line e1000-specific boolean parameter "mitigation", e.g.
qemu-system-x86_64 -device e1000,mitigation=on,... ...
For more information, see the Software developer's manual at
http://download.intel.com/design/network/manuals/8254x_GBe_SDM.pdf.
Interrupt mitigation boosts performance when the guest suffers from
an high interrupt rate (i.e. receiving short UDP packets at high packet
rate). For some numerical results see the following link
http://info.iet.unipi.it/~luigi/papers/20130520-rizzo-vm.pdf
Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de> (for pc-* machines)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-02 20:30:52 +04:00
|
|
|
#define PC_COMPAT_1_6 \
|
|
|
|
{\
|
|
|
|
.driver = "e1000",\
|
|
|
|
.property = "mitigation",\
|
|
|
|
.value = "off",\
|
2013-09-11 00:48:59 +04:00
|
|
|
},{\
|
|
|
|
.driver = "qemu64-" TYPE_X86_CPU,\
|
|
|
|
.property = "model",\
|
|
|
|
.value = stringify(2),\
|
|
|
|
},{\
|
|
|
|
.driver = "qemu32-" TYPE_X86_CPU,\
|
|
|
|
.property = "model",\
|
|
|
|
.value = stringify(3),\
|
2013-11-06 03:46:27 +04:00
|
|
|
},{\
|
|
|
|
.driver = "i440FX-pcihost",\
|
|
|
|
.property = "short_root_bus",\
|
|
|
|
.value = stringify(1),\
|
|
|
|
},{\
|
|
|
|
.driver = "q35-pcihost",\
|
|
|
|
.property = "short_root_bus",\
|
|
|
|
.value = stringify(1),\
|
e1000: add interrupt mitigation support
This patch partially implements the e1000 interrupt mitigation mechanisms.
Using a single QEMUTimer, it emulates the ITR register (which is the newer
mitigation register, recommended by Intel) and approximately emulates
RADV and TADV registers. TIDV and RDTR register functionalities are not
emulated (RDTR is only used to validate RADV, according to the e1000 specs).
RADV, TADV, TIDV and RDTR registers make up the older e1000 mitigation
mechanism and would need a timer each to be completely emulated. However,
a single timer has been used in order to reach a good compromise between
emulation accuracy and simplicity/efficiency.
The implemented mechanism can be enabled/disabled specifying the command
line e1000-specific boolean parameter "mitigation", e.g.
qemu-system-x86_64 -device e1000,mitigation=on,... ...
For more information, see the Software developer's manual at
http://download.intel.com/design/network/manuals/8254x_GBe_SDM.pdf.
Interrupt mitigation boosts performance when the guest suffers from
an high interrupt rate (i.e. receiving short UDP packets at high packet
rate). For some numerical results see the following link
http://info.iet.unipi.it/~luigi/papers/20130520-rizzo-vm.pdf
Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de> (for pc-* machines)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-02 20:30:52 +04:00
|
|
|
}
|
|
|
|
|
2013-05-28 00:23:54 +04:00
|
|
|
#define PC_COMPAT_1_5 \
|
e1000: add interrupt mitigation support
This patch partially implements the e1000 interrupt mitigation mechanisms.
Using a single QEMUTimer, it emulates the ITR register (which is the newer
mitigation register, recommended by Intel) and approximately emulates
RADV and TADV registers. TIDV and RDTR register functionalities are not
emulated (RDTR is only used to validate RADV, according to the e1000 specs).
RADV, TADV, TIDV and RDTR registers make up the older e1000 mitigation
mechanism and would need a timer each to be completely emulated. However,
a single timer has been used in order to reach a good compromise between
emulation accuracy and simplicity/efficiency.
The implemented mechanism can be enabled/disabled specifying the command
line e1000-specific boolean parameter "mitigation", e.g.
qemu-system-x86_64 -device e1000,mitigation=on,... ...
For more information, see the Software developer's manual at
http://download.intel.com/design/network/manuals/8254x_GBe_SDM.pdf.
Interrupt mitigation boosts performance when the guest suffers from
an high interrupt rate (i.e. receiving short UDP packets at high packet
rate). For some numerical results see the following link
http://info.iet.unipi.it/~luigi/papers/20130520-rizzo-vm.pdf
Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de> (for pc-* machines)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-08-02 20:30:52 +04:00
|
|
|
PC_COMPAT_1_6, \
|
2013-05-28 00:23:54 +04:00
|
|
|
{\
|
|
|
|
.driver = "Conroe-" TYPE_X86_CPU,\
|
|
|
|
.property = "model",\
|
|
|
|
.value = stringify(2),\
|
2013-05-28 00:23:55 +04:00
|
|
|
},{\
|
|
|
|
.driver = "Conroe-" TYPE_X86_CPU,\
|
|
|
|
.property = "level",\
|
|
|
|
.value = stringify(2),\
|
2013-05-28 00:23:54 +04:00
|
|
|
},{\
|
|
|
|
.driver = "Penryn-" TYPE_X86_CPU,\
|
|
|
|
.property = "model",\
|
|
|
|
.value = stringify(2),\
|
2013-05-28 00:23:55 +04:00
|
|
|
},{\
|
|
|
|
.driver = "Penryn-" TYPE_X86_CPU,\
|
|
|
|
.property = "level",\
|
|
|
|
.value = stringify(2),\
|
2013-05-28 00:23:54 +04:00
|
|
|
},{\
|
|
|
|
.driver = "Nehalem-" TYPE_X86_CPU,\
|
|
|
|
.property = "model",\
|
|
|
|
.value = stringify(2),\
|
2013-05-28 00:23:55 +04:00
|
|
|
},{\
|
|
|
|
.driver = "Nehalem-" TYPE_X86_CPU,\
|
|
|
|
.property = "level",\
|
|
|
|
.value = stringify(2),\
|
2013-07-11 17:06:46 +04:00
|
|
|
},{\
|
|
|
|
.driver = "virtio-net-pci",\
|
|
|
|
.property = "any_layout",\
|
|
|
|
.value = "off",\
|
2013-07-27 00:09:36 +04:00
|
|
|
},{\
|
|
|
|
.driver = TYPE_X86_CPU,\
|
|
|
|
.property = "pmu",\
|
|
|
|
.value = "on",\
|
2013-11-06 03:46:27 +04:00
|
|
|
},{\
|
|
|
|
.driver = "i440FX-pcihost",\
|
|
|
|
.property = "short_root_bus",\
|
|
|
|
.value = stringify(0),\
|
|
|
|
},{\
|
|
|
|
.driver = "q35-pcihost",\
|
|
|
|
.property = "short_root_bus",\
|
|
|
|
.value = stringify(0),\
|
2013-05-28 00:23:54 +04:00
|
|
|
}
|
|
|
|
|
2013-02-08 17:06:15 +04:00
|
|
|
#define PC_COMPAT_1_4 \
|
2013-05-28 00:23:54 +04:00
|
|
|
PC_COMPAT_1_5, \
|
2013-02-08 17:06:15 +04:00
|
|
|
{\
|
|
|
|
.driver = "scsi-hd",\
|
|
|
|
.property = "discard_granularity",\
|
|
|
|
.value = stringify(0),\
|
|
|
|
},{\
|
|
|
|
.driver = "scsi-cd",\
|
|
|
|
.property = "discard_granularity",\
|
|
|
|
.value = stringify(0),\
|
|
|
|
},{\
|
|
|
|
.driver = "scsi-disk",\
|
|
|
|
.property = "discard_granularity",\
|
|
|
|
.value = stringify(0),\
|
|
|
|
},{\
|
|
|
|
.driver = "ide-hd",\
|
|
|
|
.property = "discard_granularity",\
|
|
|
|
.value = stringify(0),\
|
|
|
|
},{\
|
|
|
|
.driver = "ide-cd",\
|
|
|
|
.property = "discard_granularity",\
|
|
|
|
.value = stringify(0),\
|
|
|
|
},{\
|
|
|
|
.driver = "ide-drive",\
|
|
|
|
.property = "discard_granularity",\
|
|
|
|
.value = stringify(0),\
|
2013-02-26 20:46:11 +04:00
|
|
|
},{\
|
2013-02-08 17:06:15 +04:00
|
|
|
.driver = "virtio-blk-pci",\
|
|
|
|
.property = "discard_granularity",\
|
|
|
|
.value = stringify(0),\
|
2013-02-27 17:15:31 +04:00
|
|
|
},{\
|
|
|
|
.driver = "virtio-serial-pci",\
|
|
|
|
.property = "vectors",\
|
|
|
|
/* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
|
|
|
|
.value = stringify(0xFFFFFFFF),\
|
2013-05-20 12:18:14 +04:00
|
|
|
},{ \
|
|
|
|
.driver = "virtio-net-pci", \
|
|
|
|
.property = "ctrl_guest_offloads", \
|
|
|
|
.value = "off", \
|
2013-02-26 20:46:11 +04:00
|
|
|
},{\
|
|
|
|
.driver = "e1000",\
|
|
|
|
.property = "romfile",\
|
|
|
|
.value = "pxe-e1000.rom",\
|
|
|
|
},{\
|
|
|
|
.driver = "ne2k_pci",\
|
|
|
|
.property = "romfile",\
|
|
|
|
.value = "pxe-ne2k_pci.rom",\
|
|
|
|
},{\
|
|
|
|
.driver = "pcnet",\
|
|
|
|
.property = "romfile",\
|
|
|
|
.value = "pxe-pcnet.rom",\
|
|
|
|
},{\
|
|
|
|
.driver = "rtl8139",\
|
|
|
|
.property = "romfile",\
|
|
|
|
.value = "pxe-rtl8139.rom",\
|
|
|
|
},{\
|
|
|
|
.driver = "virtio-net-pci",\
|
|
|
|
.property = "romfile",\
|
|
|
|
.value = "pxe-virtio.rom",\
|
2013-05-01 19:30:51 +04:00
|
|
|
},{\
|
|
|
|
.driver = "486-" TYPE_X86_CPU,\
|
|
|
|
.property = "model",\
|
|
|
|
.value = stringify(0),\
|
2013-02-26 20:46:11 +04:00
|
|
|
}
|
2013-02-08 17:06:15 +04:00
|
|
|
|
2013-08-27 10:48:06 +04:00
|
|
|
#define PC_COMMON_MACHINE_OPTIONS \
|
|
|
|
.default_boot_order = "cad"
|
|
|
|
|
|
|
|
#define PC_DEFAULT_MACHINE_OPTIONS \
|
|
|
|
PC_COMMON_MACHINE_OPTIONS, \
|
|
|
|
.hot_add_cpu = pc_hot_add_cpu, \
|
|
|
|
.max_cpus = 255
|
|
|
|
|
2007-11-17 20:14:51 +03:00
|
|
|
#endif
|