diff options
-rw-r--r-- | .gitmodules | 2 | ||||
-rw-r--r-- | blockdev.c | 6 | ||||
-rwxr-xr-x | configure | 14 | ||||
-rw-r--r-- | hmp-commands.hx | 13 | ||||
-rw-r--r-- | hw/Makefile.objs | 3 | ||||
-rw-r--r-- | hw/acpi_piix4.c | 79 | ||||
-rw-r--r-- | hw/cirrus_vga.c | 2 | ||||
-rw-r--r-- | hw/i386/Makefile.objs | 2 | ||||
-rw-r--r-- | hw/i8254_common.c | 2 | ||||
-rw-r--r-- | hw/pc.c | 18 | ||||
-rw-r--r-- | hw/pc_piix.c | 30 | ||||
-rw-r--r-- | hw/testdev.c | 154 | ||||
-rw-r--r-- | hw/vga-isa.c | 2 | ||||
-rw-r--r-- | monitor.c | 21 | ||||
-rw-r--r-- | pc-bios/vgabios-cirrus.bin | bin | 35840 -> 35840 bytes | |||
-rw-r--r-- | pc-bios/vgabios-stdvga.bin | bin | 40448 -> 40448 bytes | |||
-rw-r--r-- | pc-bios/vgabios-vmware.bin | bin | 40448 -> 40448 bytes | |||
-rw-r--r-- | pc-bios/vgabios.bin | bin | 40448 -> 40448 bytes | |||
-rw-r--r-- | qemu-config.c | 4 | ||||
-rw-r--r-- | qemu-options.hx | 16 | ||||
m--------- | roms/vgabios | 0 | ||||
-rwxr-xr-x | scripts/qemu-kvm/make-release | 81 | ||||
-rw-r--r-- | sysemu.h | 3 | ||||
-rw-r--r-- | target-i386/cpu.h | 1 | ||||
-rw-r--r-- | vl.c | 35 |
25 files changed, 464 insertions, 24 deletions
diff --git a/.gitmodules b/.gitmodules index eca876f85..533dcad8e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "roms/vgabios"] path = roms/vgabios - url = git://git.qemu.org/vgabios.git/ + url = git://git.kernel.org/pub/scm/virt/kvm/vgabios.git/ [submodule "roms/seabios"] path = roms/seabios url = git://git.qemu.org/seabios.git/ diff --git a/blockdev.c b/blockdev.c index 63307154b..ae9c137f8 100644 --- a/blockdev.c +++ b/blockdev.c @@ -433,6 +433,12 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi) return NULL; } + if (qemu_opt_get(opts, "boot") != NULL) { + fprintf(stderr, "qemu-kvm: boot=on|off is deprecated and will be " + "ignored. Future versions will reject this parameter. Please " + "update your scripts.\n"); + } + on_write_error = BLOCKDEV_ON_ERROR_ENOSPC; if ((buf = qemu_opt_get(opts, "werror")) != NULL) { if (type != IF_IDE && type != IF_SCSI && type != IF_VIRTIO && type != IF_NONE) { @@ -125,7 +125,16 @@ cc_i386=i386-pc-linux-gnu-gcc libs_qga="" debug_info="yes" -target_list="" +target_list="x86_64-softmmu" +kvm_version() { + local fname="$(dirname "$0")/KVM_VERSION" + + if test -f "$fname"; then + cat "$fname" + else + echo "qemu-kvm-devel" + fi +} # Default value for a variable defining feature "foo". # * foo="no" feature will only be used if --enable-foo arg is given @@ -202,7 +211,7 @@ uname_release="" mixemu="no" aix="no" blobs="yes" -pkgversion="" +pkgversion=" ($(kvm_version))" pie="" zero_malloc="" trace_backend="nop" @@ -3918,6 +3927,7 @@ case "$target_arch2" in \( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \) -o \ \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then echo "CONFIG_KVM=y" >> $config_target_mak + echo "CONFIG_KVM_OPTIONS=y" >> $config_host_mak if test "$vhost_net" = "yes" ; then echo "CONFIG_VHOST_NET=y" >> $config_target_mak fi diff --git a/hmp-commands.hx b/hmp-commands.hx index 27d90a24a..c6aa564a6 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1354,6 +1354,19 @@ Set the encrypted device @var{device} password to @var{password} ETEXI { + .name = "cpu_set", + .args_type = "cpu:i,state:s", + .params = "cpu [online|offline]", + .help = "change cpu state", + .mhandler.cmd = do_cpu_set_nr, + }, + +STEXI +@item cpu_set @var{cpu} [online|offline] +Set CPU @var{cpu} online or offline. +ETEXI + + { .name = "set_password", .args_type = "protocol:s,password:s,connected:s?", .params = "protocol password action-if-connected", diff --git a/hw/Makefile.objs b/hw/Makefile.objs index 6dfebd297..850b87b02 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -26,7 +26,8 @@ hw-obj-$(CONFIG_I8254) += i8254_common.o i8254.o hw-obj-$(CONFIG_PCSPK) += pcspk.o hw-obj-$(CONFIG_PCKBD) += pckbd.o hw-obj-$(CONFIG_FDC) += fdc.o -hw-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o +# needs fixes for cpu hotplug, so moved to Makefile.target: +# hw-obj-$(CONFIG_ACPI) += acpi.o acpi_piix4.o hw-obj-$(CONFIG_APM) += pm_smbus.o apm.o hw-obj-$(CONFIG_DMA) += dma.o hw-obj-$(CONFIG_I82374) += i82374.o diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 15275cf3e..a48187fa7 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -40,14 +40,20 @@ #define ACPI_DBG_IO_ADDR 0xb044 #define GPE_BASE 0xafe0 +#define PROC_BASE 0xaf00 #define GPE_LEN 4 #define PCI_UP_BASE 0xae00 #define PCI_DOWN_BASE 0xae04 #define PCI_EJ_BASE 0xae08 #define PCI_RMV_BASE 0xae0c +#define PIIX4_CPU_HOTPLUG_STATUS 4 #define PIIX4_PCI_HOTPLUG_STATUS 2 +struct gpe_regs { + uint8_t cpus_sts[32]; +}; + struct pci_status { uint32_t up; /* deprecated, maintained for migration compatibility */ uint32_t down; @@ -70,6 +76,7 @@ typedef struct PIIX4PMState { Notifier powerdown_notifier; /* for pci hotplug */ + struct gpe_regs gpe_cpu; struct pci_status pci0_status; uint32_t pci0_hotplug_enable; uint32_t pci0_slot_device_present; @@ -235,10 +242,9 @@ static int vmstate_acpi_post_load(void *opaque, int version_id) { \ .name = (stringify(_field)), \ .version_id = 0, \ - .num = GPE_LEN, \ .info = &vmstate_info_uint16, \ .size = sizeof(uint16_t), \ - .flags = VMS_ARRAY | VMS_POINTER, \ + .flags = VMS_SINGLE | VMS_POINTER, \ .offset = vmstate_offset_pointer(_state, _field, uint8_t), \ } @@ -384,11 +390,16 @@ static void piix4_pm_machine_ready(Notifier *n, void *opaque) } +static PIIX4PMState *global_piix4_pm_state; /* cpu hotadd */ + static int piix4_pm_initfn(PCIDevice *dev) { PIIX4PMState *s = DO_UPCAST(PIIX4PMState, dev, dev); uint8_t *pci_conf; + /* for cpu hotadd */ + global_piix4_pm_state = s; + pci_conf = s->dev.config; pci_conf[0x06] = 0x80; pci_conf[0x07] = 0x02; @@ -501,7 +512,16 @@ type_init(piix4_pm_register_types) static uint32_t gpe_readb(void *opaque, uint32_t addr) { PIIX4PMState *s = opaque; - uint32_t val = acpi_gpe_ioport_readb(&s->ar, addr); + uint32_t val = 0; + struct gpe_regs *g = &s->gpe_cpu; + + switch (addr) { + case PROC_BASE ... PROC_BASE+31: + val = g->cpus_sts[addr - PROC_BASE]; + break; + default: + val = acpi_gpe_ioport_readb(&s->ar, addr); + } PIIX4_DPRINTF("gpe read %x == %x\n", addr, val); return val; @@ -560,16 +580,27 @@ static uint32_t pcirmv_read(void *opaque, uint32_t addr) return s->pci0_hotplug_enable; } +extern const char *global_cpu_model; + static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev, PCIHotplugState state); static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s) { + int i = 0, cpus = smp_cpus; + + while (cpus > 0) { + s->gpe_cpu.cpus_sts[i++] = (cpus < 8) ? (1 << cpus) - 1 : 0xff; + cpus -= 8; + } register_ioport_write(GPE_BASE, GPE_LEN, 1, gpe_writeb, s); register_ioport_read(GPE_BASE, GPE_LEN, 1, gpe_readb, s); acpi_gpe_blk(&s->ar, GPE_BASE); + register_ioport_write(PROC_BASE, 32, 1, gpe_writeb, s); + register_ioport_read(PROC_BASE, 32, 1, gpe_readb, s); + register_ioport_read(PCI_UP_BASE, 4, 4, pci_up_read, s); register_ioport_read(PCI_DOWN_BASE, 4, 4, pci_down_read, s); @@ -581,6 +612,48 @@ static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s) pci_bus_hotplug(bus, piix4_device_hotplug, &s->dev.qdev); } +#if defined(TARGET_I386) +static void enable_processor(PIIX4PMState *s, int cpu) +{ + struct gpe_regs *g = &s->gpe_cpu; + ACPIGPE *gpe = &s->ar.gpe; + + *gpe->sts = *gpe->sts | PIIX4_CPU_HOTPLUG_STATUS; + g->cpus_sts[cpu/8] |= (1 << (cpu%8)); +} + +static void disable_processor(PIIX4PMState *s, int cpu) +{ + struct gpe_regs *g = &s->gpe_cpu; + ACPIGPE *gpe = &s->ar.gpe; + + *gpe->sts = *gpe->sts | PIIX4_CPU_HOTPLUG_STATUS; + g->cpus_sts[cpu/8] &= ~(1 << (cpu%8)); +} + +void qemu_system_cpu_hot_add(int cpu, int state) +{ + X86CPU *env; + PIIX4PMState *s = global_piix4_pm_state; + + if (state && !qemu_get_cpu(cpu)) { + env = pc_new_cpu(global_cpu_model); + if (!env) { + fprintf(stderr, "cpu %d creation failed\n", cpu); + return; + } + env->env.cpuid_apic_id = cpu; + } + + if (state) + enable_processor(s, cpu); + else + disable_processor(s, cpu); + + pm_update_sci(s); +} +#endif + static void enable_device(PIIX4PMState *s, int slot) { s->ar.gpe.sts[0] |= PIIX4_PCI_HOTPLUG_STATUS; diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index 9a0a56572..4284c1e2a 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c @@ -43,7 +43,7 @@ //#define DEBUG_CIRRUS //#define DEBUG_BITBLT -#define VGA_RAM_SIZE (8192 * 1024) +#define VGA_RAM_SIZE (16384 * 1024) /*************************************** * diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs index 8c764bbfe..523e224ac 100644 --- a/hw/i386/Makefile.objs +++ b/hw/i386/Makefile.objs @@ -11,5 +11,7 @@ obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_msi.o obj-y += kvm/ obj-$(CONFIG_SPICE) += qxl.o qxl-logger.o qxl-render.o +obj-y += testdev.o +obj-y += acpi.o acpi_piix4.o obj-y := $(addprefix ../,$(obj-y)) diff --git a/hw/i8254_common.c b/hw/i8254_common.c index a03d7cd45..b01ad70d5 100644 --- a/hw/i8254_common.c +++ b/hw/i8254_common.c @@ -275,7 +275,7 @@ static const VMStateDescription vmstate_pit_common = { .pre_save = pit_dispatch_pre_save, .post_load = pit_dispatch_post_load, .fields = (VMStateField[]) { - VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3), + VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), /* qemu-kvm's v2 had 'flags' here */ VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2, vmstate_pit_channel, PITChannelState), VMSTATE_INT64(channels[0].next_transition_time, @@ -885,11 +885,19 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int level) } } -static X86CPU *pc_new_cpu(const char *cpu_model) +X86CPU *pc_new_cpu(const char *cpu_model) { X86CPU *cpu; CPUX86State *env; + if (cpu_model == NULL) { +#ifdef TARGET_X86_64 + cpu_model = "qemu64"; +#else + cpu_model = "qemu32"; +#endif + } + cpu = cpu_x86_init(cpu_model); if (cpu == NULL) { fprintf(stderr, "Unable to find x86 CPU definition\n"); @@ -908,14 +916,6 @@ void pc_cpus_init(const char *cpu_model) int i; /* init CPUs */ - if (cpu_model == NULL) { -#ifdef TARGET_X86_64 - cpu_model = "qemu64"; -#else - cpu_model = "qemu32"; -#endif - } - for(i = 0; i < smp_cpus; i++) { pc_new_cpu(cpu_model); } diff --git a/hw/pc_piix.c b/hw/pc_piix.c index fd5898fba..1fc20cda9 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -53,6 +53,8 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 }; static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 }; static const int ide_irq[MAX_IDE_BUS] = { 14, 15 }; +const char *global_cpu_model; /* cpu hotadd */ + static void kvm_piix3_setup_irq_routing(bool pci_enabled) { #ifdef CONFIG_KVM @@ -149,6 +151,8 @@ static void pc_init1(MemoryRegion *system_memory, MemoryRegion *rom_memory; void *fw_cfg = NULL; + global_cpu_model = cpu_model; + pc_cpus_init(cpu_model); if (kvmclock_enabled) { @@ -239,7 +243,7 @@ static void pc_init1(MemoryRegion *system_memory, if (!pci_enabled || (nd->model && strcmp(nd->model, "ne2k_isa") == 0)) pc_init_ne2k_isa(isa_bus, nd); else - pci_nic_init_nofail(nd, "e1000", NULL); + pci_nic_init_nofail(nd, "rtl8139", NULL); } ide_drive_get(hd, MAX_IDE_BUS); @@ -349,6 +353,12 @@ static void pc_xen_hvm_init(ram_addr_t ram_size, } #endif +#ifdef CONFIG_KVM_OPTIONS +#define KVM_MACHINE_OPTIONS "accel=kvm" +#else +#define KVM_MACHINE_OPTIONS "" +#endif + static QEMUMachine pc_machine_v1_3 = { .name = "pc-1.3", .alias = "pc", @@ -356,6 +366,7 @@ static QEMUMachine pc_machine_v1_3 = { .init = pc_init_pci, .max_cpus = 255, .is_default = 1, + .default_machine_opts = KVM_MACHINE_OPTIONS, }; #define PC_COMPAT_1_2 \ @@ -397,19 +408,19 @@ static QEMUMachine pc_machine_v1_2 = { },{\ .driver = "VGA",\ .property = "vgamem_mb",\ - .value = stringify(8),\ + .value = stringify(16),\ },{\ .driver = "vmware-svga",\ .property = "vgamem_mb",\ - .value = stringify(8),\ + .value = stringify(16),\ },{\ .driver = "qxl-vga",\ .property = "vgamem_mb",\ - .value = stringify(8),\ + .value = stringify(16),\ },{\ .driver = "qxl",\ .property = "vgamem_mb",\ - .value = stringify(8),\ + .value = stringify(16),\ },{\ .driver = "virtio-blk-pci",\ .property = "config-wce",\ @@ -421,6 +432,7 @@ static QEMUMachine pc_machine_v1_1 = { .desc = "Standard PC", .init = pc_init_pci, .max_cpus = 255, + .default_machine_opts = KVM_MACHINE_OPTIONS, .compat_props = (GlobalProperty[]) { PC_COMPAT_1_1, { /* end of list */ } @@ -456,6 +468,7 @@ static QEMUMachine pc_machine_v1_0 = { .desc = "Standard PC", .init = pc_init_pci, .max_cpus = 255, + .default_machine_opts = KVM_MACHINE_OPTIONS, .compat_props = (GlobalProperty[]) { PC_COMPAT_1_0, { /* end of list */ } @@ -471,6 +484,7 @@ static QEMUMachine pc_machine_v0_15 = { .desc = "Standard PC", .init = pc_init_pci, .max_cpus = 255, + .default_machine_opts = KVM_MACHINE_OPTIONS, .compat_props = (GlobalProperty[]) { PC_COMPAT_0_15, { /* end of list */ } @@ -503,6 +517,7 @@ static QEMUMachine pc_machine_v0_14 = { .desc = "Standard PC", .init = pc_init_pci, .max_cpus = 255, + .default_machine_opts = KVM_MACHINE_OPTIONS, .compat_props = (GlobalProperty[]) { PC_COMPAT_0_14, { @@ -536,6 +551,7 @@ static QEMUMachine pc_machine_v0_13 = { .desc = "Standard PC", .init = pc_init_pci_no_kvmclock, .max_cpus = 255, + .default_machine_opts = KVM_MACHINE_OPTIONS, .compat_props = (GlobalProperty[]) { PC_COMPAT_0_13, { @@ -573,6 +589,7 @@ static QEMUMachine pc_machine_v0_12 = { .desc = "Standard PC", .init = pc_init_pci_no_kvmclock, .max_cpus = 255, + .default_machine_opts = KVM_MACHINE_OPTIONS, .compat_props = (GlobalProperty[]) { PC_COMPAT_0_12, { @@ -606,6 +623,7 @@ static QEMUMachine pc_machine_v0_11 = { .desc = "Standard PC, qemu 0.11", .init = pc_init_pci_no_kvmclock, .max_cpus = 255, + .default_machine_opts = KVM_MACHINE_OPTIONS, .compat_props = (GlobalProperty[]) { PC_COMPAT_0_11, { @@ -627,6 +645,7 @@ static QEMUMachine pc_machine_v0_10 = { .desc = "Standard PC, qemu 0.10", .init = pc_init_pci_no_kvmclock, .max_cpus = 255, + .default_machine_opts = KVM_MACHINE_OPTIONS, .compat_props = (GlobalProperty[]) { PC_COMPAT_0_11, { @@ -660,6 +679,7 @@ static QEMUMachine isapc_machine = { .desc = "ISA-only PC", .init = pc_init_isa, .max_cpus = 1, + .default_machine_opts = KVM_MACHINE_OPTIONS, .compat_props = (GlobalProperty[]) { { .driver = "pc-sysfw", diff --git a/hw/testdev.c b/hw/testdev.c new file mode 100644 index 000000000..21125d54e --- /dev/null +++ b/hw/testdev.c @@ -0,0 +1,154 @@ +#include <sys/mman.h> +#include "hw.h" +#include "qdev.h" +#include "isa.h" + +struct testdev { + ISADevice dev; + MemoryRegion iomem; + CharDriverState *chr; +}; + +#define TYPE_TESTDEV "testdev" +#define TESTDEV(obj) \ + OBJECT_CHECK(struct testdev, (obj), TYPE_TESTDEV) + +static void test_device_serial_write(void *opaque, uint32_t addr, uint32_t data) +{ + struct testdev *dev = opaque; + uint8_t buf[1] = { data }; + + if (dev->chr) { + qemu_chr_fe_write(dev->chr, buf, 1); + } +} + +static void test_device_exit(void *opaque, uint32_t addr, uint32_t data) +{ + exit(data); +} + +static uint32_t test_device_memsize_read(void *opaque, uint32_t addr) +{ + return ram_size; +} + +static void test_device_irq_line(void *opaque, uint32_t addr, uint32_t data) +{ + struct testdev *dev = opaque; + + qemu_set_irq(isa_get_irq(&dev->dev, addr - 0x2000), !!data); +} + +static uint32 test_device_ioport_data; + +static void test_device_ioport_write(void *opaque, uint32_t addr, uint32_t data) +{ + test_device_ioport_data = data; +} + +static uint32_t test_device_ioport_read(void *opaque, uint32_t addr) +{ + return test_device_ioport_data; +} + +static void test_device_flush_page(void *opaque, uint32_t addr, uint32_t data) +{ + target_phys_addr_t len = 4096; + void *a = cpu_physical_memory_map(data & ~0xffful, &len, 0); + + mprotect(a, 4096, PROT_NONE); + mprotect(a, 4096, PROT_READ|PROT_WRITE); + cpu_physical_memory_unmap(a, len, 0, 0); +} + +static char *iomem_buf; + +static uint32_t test_iomem_readb(void *opaque, target_phys_addr_t addr) +{ + return iomem_buf[addr]; +} + +static uint32_t test_iomem_readw(void *opaque, target_phys_addr_t addr) +{ + return *(uint16_t*)(iomem_buf + addr); +} + +static uint32_t test_iomem_readl(void *opaque, target_phys_addr_t addr) +{ + return *(uint32_t*)(iomem_buf + addr); +} + +static void test_iomem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val) +{ + iomem_buf[addr] = val; +} + +static void test_iomem_writew(void *opaque, target_phys_addr_t addr, uint32_t val) +{ + *(uint16_t*)(iomem_buf + addr) = val; +} + +static void test_iomem_writel(void *opaque, target_phys_addr_t addr, uint32_t val) +{ + *(uint32_t*)(iomem_buf + addr) = val; +} + +static const MemoryRegionOps test_iomem_ops = { + .old_mmio = { + .read = { test_iomem_readb, test_iomem_readw, test_iomem_readl, }, + .write = { test_iomem_writeb, test_iomem_writew, test_iomem_writel, }, + }, + .endianness = DEVICE_LITTLE_ENDIAN, +}; + +static int init_test_device(ISADevice *isa) +{ + struct testdev *dev = DO_UPCAST(struct testdev, dev, isa); + + register_ioport_write(0xf1, 1, 1, test_device_serial_write, dev); + register_ioport_write(0xf4, 1, 4, test_device_exit, dev); + register_ioport_read(0xd1, 1, 4, test_device_memsize_read, dev); + register_ioport_read(0xe0, 1, 1, test_device_ioport_read, dev); + register_ioport_write(0xe0, 1, 1, test_device_ioport_write, dev); + register_ioport_read(0xe0, 1, 2, test_device_ioport_read, dev); + register_ioport_write(0xe0, 1, 2, test_device_ioport_write, dev); + register_ioport_read(0xe0, 1, 4, test_device_ioport_read, dev); + register_ioport_write(0xe0, 1, 4, test_device_ioport_write, dev); + register_ioport_write(0xe4, 1, 4, test_device_flush_page, dev); + register_ioport_write(0x2000, 24, 1, test_device_irq_line, NULL); + iomem_buf = g_malloc0(0x10000); + memory_region_init_io(&dev->iomem, &test_iomem_ops, dev, + "testdev", 0x10000); + memory_region_add_subregion(isa_address_space(&dev->dev), 0xff000000, + &dev->iomem); + return 0; +} + +static Property testdev_isa_properties[] = { + DEFINE_PROP_CHR("chardev", struct testdev, chr), + DEFINE_PROP_END_OF_LIST(), +}; + +static void testdev_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + ISADeviceClass *k = ISA_DEVICE_CLASS(klass); + + k->init = init_test_device; + dc->props = testdev_isa_properties; +} + +static TypeInfo testdev_info = { + .name = "testdev", + .parent = TYPE_ISA_DEVICE, + .instance_size = sizeof(struct testdev), + .class_init = testdev_class_init, +}; + +static void testdev_register_types(void) +{ + type_register_static(&testdev_info); +} + +type_init(testdev_register_types) diff --git a/hw/vga-isa.c b/hw/vga-isa.c index d2904737b..d2414069e 100644 --- a/hw/vga-isa.c +++ b/hw/vga-isa.c @@ -70,7 +70,7 @@ static int vga_initfn(ISADevice *dev) } static Property vga_isa_properties[] = { - DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 8), + DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 16), DEFINE_PROP_END_OF_LIST(), }; @@ -906,6 +906,27 @@ static void do_info_registers(Monitor *mon) #endif } +static void do_cpu_set_nr(Monitor *mon, const QDict *qdict) +{ + int state, value; + const char *status; + + status = qdict_get_str(qdict, "state"); + value = qdict_get_int(qdict, "cpu"); + + if (!strcmp(status, "online")) + state = 1; + else if (!strcmp(status, "offline")) + state = 0; + else { + monitor_printf(mon, "invalid status: %s\n", status); + return; + } +#if defined(TARGET_I386) || defined(TARGET_X86_64) + qemu_system_cpu_hot_add(value, state); +#endif +} + static void do_info_jit(Monitor *mon) { dump_exec_info((FILE *)mon, monitor_fprintf); diff --git a/pc-bios/vgabios-cirrus.bin b/pc-bios/vgabios-cirrus.bin Binary files differindex 424dd0c70..7626ea551 100644 --- a/pc-bios/vgabios-cirrus.bin +++ b/pc-bios/vgabios-cirrus.bin diff --git a/pc-bios/vgabios-stdvga.bin b/pc-bios/vgabios-stdvga.bin Binary files differindex 5123c5fd0..1e4fc33cc 100644 --- a/pc-bios/vgabios-stdvga.bin +++ b/pc-bios/vgabios-stdvga.bin diff --git a/pc-bios/vgabios-vmware.bin b/pc-bios/vgabios-vmware.bin Binary files differindex 5e8c06b22..9633d9af9 100644 --- a/pc-bios/vgabios-vmware.bin +++ b/pc-bios/vgabios-vmware.bin diff --git a/pc-bios/vgabios.bin b/pc-bios/vgabios.bin Binary files differindex 892a2b537..d04033ea1 100644 --- a/pc-bios/vgabios.bin +++ b/pc-bios/vgabios.bin diff --git a/qemu-config.c b/qemu-config.c index cd1ec2165..a5b33cc2f 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -114,6 +114,10 @@ static QemuOptsList qemu_drive_opts = { .name = "copy-on-read", .type = QEMU_OPT_BOOL, .help = "copy read data from backing file into image file", + },{ + .name = "boot", + .type = QEMU_OPT_BOOL, + .help = "(deprecated, ignored)", }, { /* end of list */ } }, diff --git a/qemu-options.hx b/qemu-options.hx index 7d97f9692..3cd9243fd 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2856,6 +2856,22 @@ STEXI Enable FIPS 140-2 compliance mode. ETEXI +DEF("no-kvm", 0, QEMU_OPTION_no_kvm, + "-no-kvm disable KVM hardware virtualization\n", + QEMU_ARCH_ALL) +DEF("no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip, + "-no-kvm-irqchip disable KVM kernel mode PIC/IOAPIC/LAPIC\n", + QEMU_ARCH_I386) +DEF("no-kvm-pit", 0, QEMU_OPTION_no_kvm_pit, + "-no-kvm-pit disable KVM kernel mode PIT\n", + QEMU_ARCH_I386) +DEF("no-kvm-pit-reinjection", 0, QEMU_OPTION_no_kvm_pit_reinjection, + "-no-kvm-pit-reinjection\n" + " disable KVM kernel mode PIT interrupt reinjection\n", + QEMU_ARCH_I386) +HXCOMM -tdf is deprecated and ignored today +DEF("tdf", 0, QEMU_OPTION_tdf, "", QEMU_ARCH_ALL) + HXCOMM This is the last statement. Insert new options before this line! STEXI @end table diff --git a/roms/vgabios b/roms/vgabios -Subproject 19ea12c230ded95928ecaef0db47a82231c2e48 +Subproject ca056d8e77a534f4f90548bc8cee166a378c145 diff --git a/scripts/qemu-kvm/make-release b/scripts/qemu-kvm/make-release new file mode 100755 index 000000000..2d050fcc7 --- /dev/null +++ b/scripts/qemu-kvm/make-release @@ -0,0 +1,81 @@ +#!/bin/bash -e + +usage() { + echo "usage: $0 [--upload] [--formal] commit [name] [tarball] [user]" + exit 1 +} + +[[ -f ~/.kvmreleaserc ]] && . ~/.kvmreleaserc + +upload= +formal= + +releasedir=~/sf-release +[[ -z "$TMP" ]] && TMP="/tmp" +tmpdir=`mktemp -d "$TMP/qemu-kvm-make-release.XXXXXXXXXX"` +while [[ "$1" = -* ]]; do + opt="$1" + shift + case "$opt" in + --upload) + upload="yes" + ;; + --formal) + formal="yes" + ;; + *) + usage + ;; + esac +done + +commit="$1" +name="$2" + +if [[ -z "$commit" ]]; then + usage +fi + +if [[ -z "$name" ]]; then + name="$commit" +fi + +tarball="$3" +if [[ -z "$tarball" ]]; then + tarball="$releasedir/$name.tar.gz" +fi +#strip trailing .gz if any +tarball=${tarball/%.gz/} + +cd "$(dirname "$0")"/../.. +mkdir -p "$(dirname "$tarball")" +git archive --prefix="$name/" --format=tar "$commit" > "$tarball" + +mtime=`git show --pretty=format:%ct "$commit""^{commit}" -- | head -n 1` +tarargs="--owner=root --group=root" + +mkdir -p "$tmpdir/$name" +git cat-file -p "${commit}:roms" | awk ' { print $4, $3 } ' \ + > "$tmpdir/$name/EXTERNAL_DEPENDENCIES" +touch -d "@$mtime" "$tmpdir/$name/EXTERNAL_DEPENDENCIES" +tar -rf "$tarball" -C "$tmpdir" \ + $tarargs \ + "$name/EXTERNAL_DEPENDENCIES" +rm -rf "$tmpdir" + +if [[ -n "$formal" ]]; then + mkdir -p "$tmpdir/$name" + echo "$name" > "$tmpdir/$name/KVM_VERSION" + touch -d "@$mtime" "$tmpdir/$name/KVM_VERSION" + tar -rf "$tarball" -C "$tmpdir" "$name/KVM_VERSION" \ + $tarargs + rm -rf "$tmpdir" +fi + +rm -f "$tarball.gz" +gzip -9 "$tarball" +tarball="$tarball.gz" + +if [[ -n "$upload" ]]; then + rsync --progress -h "$tarball" avik@frs.sourceforge.net:uploads/ +fi @@ -152,6 +152,9 @@ extern int nb_option_roms; extern const char *prom_envs[MAX_PROM_ENVS]; extern unsigned int nb_prom_envs; +/* acpi */ +void qemu_system_cpu_hot_add(int cpu, int state); + /* pci-hotplug */ void pci_device_hot_add(Monitor *mon, const QDict *qdict); int pci_drive_hot_add(Monitor *mon, const QDict *qdict, diff --git a/target-i386/cpu.h b/target-i386/cpu.h index d7ea2f92a..f78535bcc 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -968,6 +968,7 @@ void cpu_x86_update_cr4(CPUX86State *env, uint32_t new_cr4); /* hw/pc.c */ void cpu_smm_update(CPUX86State *env); uint64_t cpu_get_tsc(CPUX86State *env); +X86CPU *pc_new_cpu(const char *cpu_model); /* used to debug */ #define X86_DUMP_FPU 0x0001 /* dump FPU state too */ @@ -3072,6 +3072,37 @@ int main(int argc, char **argv, char **envp) machine = machine_parse(optarg); } break; + case QEMU_OPTION_no_kvm: + olist = qemu_find_opts("machine"); + qemu_opts_parse(olist, "accel=tcg", 0); + break; +#ifdef CONFIG_KVM_OPTIONS + case QEMU_OPTION_no_kvm_irqchip: { + olist = qemu_find_opts("machine"); + qemu_opts_parse(olist, "kernel_irqchip=off", 0); + break; + } + case QEMU_OPTION_no_kvm_pit: { + fprintf(stderr, "Warning: KVM PIT can no longer be disabled " + "separately.\n"); + break; + } + case QEMU_OPTION_no_kvm_pit_reinjection: { + static GlobalProperty kvm_pit_lost_tick_policy[] = { + { + .driver = "kvm-pit", + .property = "lost_tick_policy", + .value = "discard", + }, + { /* end of list */ } + }; + + fprintf(stderr, "Warning: option deprecated, use " + "lost_tick_policy property of kvm-pit instead.\n"); + qdev_prop_register_global_list(kvm_pit_lost_tick_policy); + break; + } +#endif case QEMU_OPTION_usb: usb_enabled = 1; break; @@ -3155,6 +3186,10 @@ int main(int argc, char **argv, char **envp) case QEMU_OPTION_semihosting: semihosting_enabled = 1; break; + case QEMU_OPTION_tdf: + fprintf(stderr, "Warning: user space PIT time drift fix " + "is no longer supported.\n"); + break; case QEMU_OPTION_name: qemu_name = g_strdup(optarg); { |