summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* target-i386: Break CPUID feature definition linesEduardo Habkost2013-05-021-90/+180
| | | | | | | | | | Break lines on kvm_check_features_against_host(), kvm_cpu_fill_host(), and builtin_x86_defs, so they don't get too long once the *_features fields are replaced by an array. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386/kvm.c: Code formatting changesEduardo Habkost2013-05-011-1/+2
| | | | | | | | | | Add appropriate spaces around operators, and break line where it needs to be broken to allow feature-words array to be introduced without having too-long lines. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Group together level, xlevel, xlevel2 fieldsEduardo Habkost2013-05-012-4/+4
| | | | | | | | Consolidate level, xlevel, xlevel2 fields in x86_def_t and CPUX86State. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* pc: Implement QEMUMachine::hot_add_cpu hookIgor Mammedov2013-05-014-0/+29
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* QMP: Add cpu-add commandIgor Mammedov2013-05-013-0/+46
| | | | | | | | | | | | | | | | Adds "cpu-add id=xxx" QMP command. cpu-add's "id" argument is a CPU number in a range [0..max-cpus) Example QMP command: -> { "execute": "cpu-add", "arguments": { "id": 2 } } <- { "return": {} } Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* Add hot_add_cpu hook to QEMUMachineIgor Mammedov2013-05-011-0/+3
| | | | | | | | | Hook should be set by machines that implement CPU hot-add via cpu-add QMP command. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Move APIC to ICC busIgor Mammedov2013-05-016-24/+42
| | | | | | | | | | | It allows APIC to be hotplugged. * map APIC's mmio at board level if it is present * do not register mmio region for each APIC, since only one is used/mapped Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Attach ICC bus to CPU on its creationIgor Mammedov2013-05-016-10/+24
| | | | | | | X86CPU should have parent bus so it could provide bus for child APIC. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Introduce ICC bus/device/bridgeIgor Mammedov2013-05-018-0/+211
| | | | | | | | | | | | Provides a hotpluggable bus for APIC and CPU. * icc-bridge will serve as a parent for icc-bus and provide mmio mapping services to child icc-devices. * icc-device will replace SysBusDevice as a parent of APIC and IOAPIC devices. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move cpu_write_elfXX_note() functions to CPUStateJens Freimann2013-05-018-57/+153
| | | | | | | | | Convert cpu_write_elfXX_note() functions to CPUClass methods and pass CPUState as argument. Update target-i386 accordingly. Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> [AF: Retain stubs as CPUClass' default method implementation; style changes] Signed-off-by: Andreas Färber <afaerber@suse.de>
* kvmvapic: Make dependency on sysbus.h explicitIgor Mammedov2013-05-011-0/+1
| | | | | | | | | | Allows kvmvapic to compile if sysbus.h is removed from apic_internal.h, from which it is indirectly included. sysbus.h will be removed from apic_internal.h after converting APICs to ICCDevice. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Replace MSI_SPACE_SIZE with APIC_SPACE_SIZEIgor Mammedov2013-05-015-5/+4
| | | | | | | | Put APIC_SPACE_SIZE in a public header so that it can be reused elsewhere later. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Do not allow to set apic-id once CPU is realizedIgor Mammedov2013-05-011-0/+7
| | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Introduce apic-id CPU propertyIgor Mammedov2013-05-012-1/+68
| | | | | | | | | The property is used from board level to set APIC ID for CPUs it creates. Do so in a new pc_new_cpu() helper, to be reused for hot-plug. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-i386: Introduce feat2prop() for CPU propertiesIgor Mammedov2013-05-011-4/+15
| | | | | | | | | This helper replaces '_' with '-' in a uniform way. As a side effect, even custom mappings must use '-' now. Signed-off-by: Igor Mammedov <imammedo@redhat.com> [AF: Split off; operate on NUL-terminated string rather than '=' delimiter] Signed-off-by: Andreas Färber <afaerber@suse.de>
* acpi_piix4: Add infrastructure to send CPU hot-plug GPE to guestIgor Mammedov2013-05-012-2/+110
| | | | | | | | | | | * introduce processor status bitmask visible to guest at 0xaf00 addr, where ACPI asl code expects it * set bit corresponding to APIC ID in processor status bitmask on receiving CPU hot-plug notification * trigger CPU hot-plug SCI, to notify guest about CPU hot-plug event Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Add helper cpu_exists(), to check if CPU with specified id existsIgor Mammedov2013-05-012-0/+36
| | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpus: Use qemu_for_each_cpu() in TCG threadIgor Mammedov2013-05-011-6/+7
| | | | | | | Replaces an open-coded loop and hides unused CPUArchState. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Add qemu_for_each_cpu()Michael S. Tsirkin2013-05-012-0/+19
| | | | | | | | | Wrapper to avoid open-coded loops and to make CPUState iteration independent of CPUArchState. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Introduce get_arch_id() method and override it for X86CPUIgor Mammedov2013-05-013-0/+18
| | | | | | | | | | | | | | get_arch_id() adds possibility for generic code to get a guest-visible CPU ID without accessing CPUArchState. If derived classes don't override it, it will return cpu_index. Override it on target-i386 in X86CPU to return the APIC ID. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* pc: Update rtc_cmos on CPU hot-plugIgor Mammedov2013-05-013-0/+28
| | | | | | | It provides updated currently available CPUs count to BIOS on reboot. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Introduce CPU hot-plug notifierIgor Mammedov2013-05-012-0/+15
| | | | | | | Hot-add CPU event will be distributed to acpi_piix4 and rtc_cmos. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Resume CPU from DeviceClass::realize() if hot-pluggedIgor Mammedov2013-05-011-0/+1
| | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Introduce cpu_resume(), for single CPUIgor Mammedov2013-05-014-3/+21
| | | | | | | | Also add a stub for it, to make possible to use it in qom/cpu.c, which is shared with user emulators. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Call cpu_synchronize_post_init() from DeviceClass::realize()Igor Mammedov2013-05-015-11/+18
| | | | | | | | If hotplugged, synchronize CPU state to KVM. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Make kvm-stub.o available outside softmmuIgor Mammedov2013-05-013-10/+15
| | | | | | | | | It will provide stubs for *-user targets once softmmu-specific calls are attempted from common CPU code. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* virtio-net: count VIRTIO_NET_F_MAC when calculating config_lenJason Wang2013-04-301-0/+1
| | | | | | | | | | | | | | | | | | | Commit 14f9b664 (hw/virtio-net.c: set config size using host features) tries to calculate config size based on the host features. But it forgets the VIRTIO_NET_F_MAC were always set for qemu later. This will lead a zero config len for virtio-net device when both VIRTIO_NET_F_STATUS and VIRTIO_NET_F_MQ were disabled form command line. Then qemu will crash when user tries to read the config of virtio-net. Fix this by counting VIRTIO_NET_F_MAC and make sure the config at least contains the mac address. Cc: Jesse Larrew <jlarrew@linux.vnet.ibm.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1366874814-2658-1-git-send-email-jasowang@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sysemu: drop register_devices from headerMichael S. Tsirkin2013-04-301-2/+0
| | | | | | | | | No user in sight. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-id: 20130430094149.GA29094@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* libqtest: only call fclose() on open filesJesse Larrew2013-04-301-1/+1
| | | | | | | | | | libqtest.c can segfault when calling fclose() if the pidfile wasn't opened successfully. This patch fixes the issue. Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1367250772-17928-1-git-send-email-jlarrew@linux.vnet.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Wire up disabled wait a panicked event on s390Christian Borntraeger2013-04-301-3/+14
| | | | | | | | | | | | | | | On s390 the disabled wait state indicates a state of attention. For example Linux uses that state after a panic. Lets put the system into panicked state. An alternative implementation would be to state disabled-wait <address> instead of pause in the action field. (e.g. z/OS, z/VM and other classic OSes use the address of the disabled wait to indicate an error code). Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 6cf41156322e27e81a727b69f03728dbc225d5bb.1366945969.git.hutao@cn.fujitsu.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pvpanic: create pvpanic by default for machine 1.5Hu Tao2013-04-304-0/+29
| | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: f840042f0e1205041f8feaf0d39ca639884f3a00.1366945969.git.hutao@cn.fujitsu.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pvpanic: add document of pvpanicHu Tao2013-04-301-0/+39
| | | | | | | Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: a5db4ce406647e8f4663b639eae62d880531df8b.1366945969.git.hutao@cn.fujitsu.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pvpanic: pass configurable ioport to seabiosHu Tao2013-04-302-1/+21
| | | | | | | | | | | | This lets seabios patch the corresponding SSDT entry. Also add fw_cfg object to /machine/fw_cfg so we can reference it elsewhere. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 60c65d95fe2b23b12bea67099126566010a11a1a.1366945969.git.hutao@cn.fujitsu.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* fw_cfg: add required header filesHu Tao2013-04-301-0/+7
| | | | | | | | | | | | | | If fw_cfg.h is included alone, gcc gives error messages like these: error: unknown type name ‘uint32_t’ error: unknown type name ‘size_t’ error: unknown type name ‘hwaddr’ ... Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: d63f8bcdbfbec8135b1b57f9247c513a3e25762c.1366945969.git.hutao@cn.fujitsu.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* introduce a new qom device to deal with panicked eventHu Tao2013-04-304-0/+127
| | | | | | | | | | | | | | | pvpanic device is used to send guest panic event from guest to qemu. When guest panic happens, pvpanic device driver will write a event number to IO port 0x505(which is the IO port occupied by pvpanic device, by default). On receiving the event, pvpanic device will pause guest cpu(s), and send a qmp event QEVENT_GUEST_PANICKED. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: b66077a40235b3531632a05a6ff373850afc7d2e.1366945969.git.hutao@cn.fujitsu.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add a new qevent: QEVENT_GUEST_PANICKEDHu Tao2013-04-303-0/+16
| | | | | | | | | | This event will be emited when qemu detects guest panic. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: cf0bc45ecf9ecd3699bc72dc39f8cbab8ed79d8c.1366945969.git.hutao@cn.fujitsu.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* add a new runstate: RUN_STATE_GUEST_PANICKEDHu Tao2013-04-304-5/+17
| | | | | | | | | | The guest will be in this state when it is panicked. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 0255f263ffdc2a3716f73e89098b96fd79a235b3.1366945969.git.hutao@cn.fujitsu.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: Report errors collected during device realizationJan Kiszka2013-04-301-0/+1
| | | | | | | | | Better than just releasing the error object silently. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Message-id: 517E68FC.6030400@siemens.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rules.mk: Fix build breakageDunrong Huang2013-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The following error occurs when building dtc module: CHK version_gen.h CC libfdt/fdt.o cc1: error: dtc: No such file or directory [-Werror] cc1: all warnings being treated as errors make[1]: *** [libfdt/fdt.o] Error 1 make: *** [subdir-dtc] Error 2 In rules.mak, "-I$(<D) -I$(@D)" was expanded to "-Idtc -I." when building submodule dct. Due to the using of "-Wmissing-include-dirs, a warning would be rarsed. To avoid it, add "-I$(<D) -I$(@D)" to QEMU_INCLUDES instead of QEMU_CFLAGS so that QEMU_CFLAGS does not contain the "-Idtc". Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Dunrong Huang <riegamaths@gmail.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1367247132-19622-1-git-send-email-riegamaths@gmail.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* QOM: Fail casts for unknown typesAlexander Graf2013-04-301-0/+5
| | | | | | | | | | | | | When we try to cast an object to an unknown type, fail the cast. Today we would simply run into an assert(). This fixes a bug on qemu-system-s390x for me that gets triggered by the audio code looking for PCI and ISA buses. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1367326936-28539-1-git-send-email-agraf@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pc_piix: remove undesired change in pc_init1Paolo Bonzini2013-04-301-0/+1
| | | | | | | | | Introduced when applying commit f81222b (audio: look for the ISA and PCI buses, 2013-04-18). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1367330432-14417-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* audio: enable PCI audio cards for all PCI-enabled targetsPaolo Bonzini2013-04-298-14/+5
| | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366303444-24620-9-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* audio: look for the ISA and PCI busesPaolo Bonzini2013-04-297-12/+17
| | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366303444-24620-8-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qom: do not return root for empty pathPaolo Bonzini2013-04-291-10/+2
| | | | | | | | | An empty path will return the sole object of that type in the QOM tree. This is different from "/", which returns the root. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366303444-24620-7-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* audio: replace audio card configuration with default-configsPaolo Bonzini2013-04-2912-25/+23
| | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366303444-24620-6-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* audio: remove CONFIG_* symbolsPaolo Bonzini2013-04-291-9/+0
| | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366303444-24620-5-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* audio: remove HAS_AUDIOPaolo Bonzini2013-04-296-41/+0
| | | | | | | | | Several targets can have wavcapture/-soundhw support via PCI cards. HAS_AUDIO is a useless limitation, remove it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366303444-24620-4-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* audio: remove the need for audio card CONFIG_* symbolsPaolo Bonzini2013-04-2913-144/+62
| | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366303444-24620-3-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* adlib: qdev-ifyPaolo Bonzini2013-04-291-17/+66
| | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366303444-24620-2-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* doc: document the Pseudo-encoding of LED stateLei Li2013-04-291-0/+50
| | | | | | | Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366867752-11578-5-git-send-email-lilei@linux.vnet.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud