Trivial patches for 14 to 21 July 2012
The following changes since commit 61dc008f3529fa74a63aad1907438dad857e255a:
Revert "audio: Make PC speaker audio card available by default" (2012-07-19 18:25:52 -0500)
are available in the git repository at:
git://github.com/stefanha/qemu.git trivial-patches
for you to fetch changes up to 43ffe61f9cc22f9ad4d05a18a304b1095fa1f2b3:
Fix some more Qemus in documentation and help text (2012-07-21 10:54:40 +0100)
----------------------------------------------------------------
Alexey Kardashevskiy (1):
powerpc pci: fixed packing of ranges[]
Mao, Junjie (1):
Recognize PCID feature
Peter Maydell (1):
cpus.c: Make all_cpu_threads_idle() static
Stefan Weil (3):
Use macro QEMU_PACKED for new packed structures
qdev: Fix Open Firmware comment
Fix some more Qemus in documentation and help text
cpus.c | 52 ++++++++++++++-------------- docs/usb-storage.txt | 2 +- hw/mfi.h | 92 +++++++++++++++++++++++++------------------------- hw/ppce500_spin.c | 2 +- hw/qdev.h | 11 +++--- hw/spapr_pci.c | 2 +- qemu-common.h | 1 - qemu-options.hx | 4 +-- target-i386/cpu.c | 2 +- 9 files changed, 83 insertions(+), 85 deletions(-)
Signature · 1 line
1.7.10.4
PATCH 2/6 Recognize PCID feature
From: "Mao, Junjie" <[email protected]>
This patch makes Qemu recognize the PCID feature specified from configuration or command line options.
--- target-i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/cpu.c +1 -1
@@ -50,7 +50,7 @@ static const char *ext_feature_name[] = {"ds_cpl" ,"vmx" ,"smx" ,"est" ,"tm2" ,"ssse3" ,"cid" ,NULL ,"fma" ,"cx16" ,"xtpr" ,"pdcm" , -NULL ,NULL ,"dca" ,"sse4.1|sse4_1" , +NULL ,"pcid" ,"dca" ,"sse4.1|sse4_1" ,"sse4.2|sse4_2" ,"x2apic" ,"movbe" ,"popcnt" ,"tsc-deadline" ,"aes" ,"xsave" ,"osxsave" , "avx", NULL, NULL, "hypervisor",
Signature · 1 line
1.7.10.4
PATCH 1/6 powerpc pci: fixed packing of ranges[]
In reply to Stefan HajnocziFrom: Alexey Kardashevskiy <[email protected]>
By default mingw-gcc is trying to pack structures the way to preserve binary compatibility with MS Visual C what leads to incorrect and unexpected padding in the PCI bus ranges property of the sPAPR PHB.
The patch replaces __attribute__((packed)) with more strict QEMU_PACKED which actually is __attribute__((gcc_struct, packed)) on Windows.
--- hw/spapr_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/spapr_pci.c +1 -1
@@ -418,7 +418,7 @@ int spapr_populate_pci_devices(sPAPRPHBState *phb,uint64_t child;uint64_t parent;uint64_t size; - } __attribute__((packed)) ranges[] = { + }QEMU_PACKED ranges[] = { {cpu_to_be32 (b_ss (1 )),cpu_to_be64 (0 ),cpu_to_be64 (phb->io_win_addr),
Signature · 1 line
1.7.10.4
PATCH 3/6 Use macro QEMU_PACKED for new packed structures
In reply to Stefan HajnocziFrom: Stefan Weil <[email protected]>
Since commit 541dc0d47f10973c241e9955afc2aefc96adec51, some new packed structures were added without using QEMU_PACKED.
QEMU_PACKED is needed for compilations with MinGW. For other platforms nothing changes.
The code was fixed using this command:
git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'
--- hw/mfi.h | 92 ++++++++++++++++++++++++++--------------------------- hw/ppce500_spin.c | 2 +- 2 files changed, 47 insertions(+), 47 deletions(-)
hw/mfi.h +46 -46
@@ -435,24 +435,24 @@ typedef enum {struct mfi_sg32 {uint32_t addr;uint32_t len; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_sg64 {uint64_t addr;uint32_t len; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_sg_skinny {uint64_t addr;uint32_t len;uint32_t flag; -} __attribute__ ((packed)); +}QEMU_PACKED ;union mfi_sgl {struct mfi_sg32 sg32[1 ];struct mfi_sg64 sg64[1 ];struct mfi_sg_skinny sg_skinny[1 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* Message frames. All messages have a common header */ struct mfi_frame_header {
@@ -468,7 +468,7 @@ struct mfi_frame_header {uint16_t flags;uint16_t timeout;uint32_t data_len; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_init_frame {struct mfi_frame_header header;
@@ -487,7 +487,7 @@ struct mfi_io_frame {uint32_t lba_lo;uint32_t lba_hi;union mfi_sgl sgl; -} __attribute__ ((packed)); +}QEMU_PACKED ;#define MFI_PASS_FRAME_SIZE 48struct mfi_pass_frame {
@@ -496,7 +496,7 @@ struct mfi_pass_frame {uint32_t sense_addr_hi;uint8_t cdb[16 ];union mfi_sgl sgl; -} __attribute__ ((packed)); +}QEMU_PACKED ;#define MFI_DCMD_FRAME_SIZE 40struct mfi_dcmd_frame {
@@ -504,7 +504,7 @@ struct mfi_dcmd_frame {uint32_t opcode;uint8_t mbox[MFI_MBOX_SIZE ];union mfi_sgl sgl; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_abort_frame {struct mfi_frame_header header;
@@ -512,7 +512,7 @@ struct mfi_abort_frame {uint32_t abort_mfi_addr_lo;uint32_t abort_mfi_addr_hi;uint32_t reserved1[6 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_smp_frame {struct mfi_frame_header header;
@@ -521,7 +521,7 @@ struct mfi_smp_frame {struct mfi_sg32 sg32[2 ];struct mfi_sg64 sg64[2 ]; } sgl; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_stp_frame {struct mfi_frame_header header;
@@ -531,7 +531,7 @@ struct mfi_stp_frame {struct mfi_sg32 sg32[2 ];struct mfi_sg64 sg64[2 ]; } sgl; -} __attribute__ ((packed)); +}QEMU_PACKED ;union mfi_frame {struct mfi_frame_header header;
@@ -563,7 +563,7 @@ struct mfi_init_qinfo {uint32_t pi_addr_hi;uint32_t ci_addr_lo;uint32_t ci_addr_hi; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* Controller properties */ struct mfi_ctrl_props {
@@ -626,7 +626,7 @@ struct mfi_ctrl_props {* is spun down (0=use FW defaults) */ uint8_t reserved[24 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* PCI information about the card. */ struct mfi_info_pci {
@@ -635,7 +635,7 @@ struct mfi_info_pci {uint16_t subvendor;uint16_t subdevice;uint8_t reserved[24 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* Host (front end) interface information */ struct mfi_info_host {
@@ -647,7 +647,7 @@ struct mfi_info_host {uint8_t reserved[6 ];uint8_t port_count;uint64_t port_addr[8 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* Device (back end) interface information */ struct mfi_info_device {
@@ -659,7 +659,7 @@ struct mfi_info_device {uint8_t reserved[6 ];uint8_t port_count;uint64_t port_addr[8 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* Firmware component information */ struct mfi_info_component {
@@ -667,7 +667,7 @@ struct mfi_info_component {char version[32 ];char build_date[16 ];char build_time[16 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* Controller default settings */ struct mfi_defaults {
@@ -710,7 +710,7 @@ struct mfi_defaults {uint8_t fde_only;uint8_t delay_during_post;uint8_t resv[19 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* Controller default settings */ struct mfi_bios_data {
@@ -722,7 +722,7 @@ struct mfi_bios_data {uint8_t expose_all_drives;uint8_t reserved[56 ];uint8_t check_sum; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* SAS (?) controller info, returned from MFI_DCMD_CTRL_GETINFO. */ struct mfi_ctrl_info {
@@ -807,7 +807,7 @@ struct mfi_ctrl_info {uint8_t min;uint8_t max;uint8_t reserved[2 ]; - } __attribute__ ((packed)) stripe_sz_ops; + }QEMU_PACKED stripe_sz_ops;uint32_t pd_ops;#define MFI_INFO_PDOPS_FORCE_ONLINE 0x01
@@ -826,7 +826,7 @@ struct mfi_ctrl_info {struct mfi_ctrl_props properties;char package_version[0x60 ];uint8_t pad[0x800 -0x6a0 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* keep track of an event. */ union mfi_evt {
@@ -836,7 +836,7 @@ union mfi_evt {int8_t class; } members;uint32_t word; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* event log state. */ struct mfi_evt_log_state {
@@ -845,24 +845,24 @@ struct mfi_evt_log_state {uint32_t clear_seq_num;uint32_t shutdown_seq_num;uint32_t boot_seq_num; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_progress {uint16_t progress;uint16_t elapsed_seconds; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_evt_ld {uint16_t target_id;uint8_t ld_index;uint8_t reserved; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_evt_pd {uint16_t device_id;uint8_t enclosure_index;uint8_t slot_number; -} __attribute__ ((packed)); +}QEMU_PACKED ;/* event detail, returned from MFI_DCMD_CTRL_EVENT_WAIT. */ struct mfi_evt_detail {
@@ -982,13 +982,13 @@ struct mfi_evt_detail { } args;char description[128 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_evt_list {uint32_t count;uint32_t reserved;struct mfi_evt_detail event[1 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ; union mfi_pd_ref { struct {
@@ -996,7 +996,7 @@ union mfi_pd_ref {uint16_t seq_num; } v;uint32_t ref; -} __attribute__ ((packed)); +}QEMU_PACKED ; union mfi_pd_ddf_type { struct {
@@ -1016,7 +1016,7 @@ union mfi_pd_ddf_type {uint32_t reserved; } non_disk;uint32_t type; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_pd_progress {uint32_t active;
@@ -1027,7 +1027,7 @@ struct mfi_pd_progress {struct mfi_progress patrol;struct mfi_progress clear;struct mfi_progress reserved[4 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_pd_info {union mfi_pd_ref ref;
@@ -1062,7 +1062,7 @@ struct mfi_pd_info {uint8_t unusable_in_current_config;uint8_t vpd_page83_ext[64 ];uint8_t reserved[512 -358 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_pd_address {uint16_t device_id;
@@ -1072,14 +1072,14 @@ struct mfi_pd_address {uint8_t scsi_dev_type;uint8_t connect_port_bitmap;uint64_t sas_addr[2 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;#define MFI_MAX_SYS_PDS 240struct mfi_pd_list {uint32_t size;uint32_t count;struct mfi_pd_address addr[MFI_MAX_SYS_PDS ]; -} __attribute__ ((packed)); +}QEMU_PACKED ; union mfi_ld_ref { struct {
@@ -1088,7 +1088,7 @@ union mfi_ld_ref {uint16_t seq; } v;uint32_t ref; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_ld_list {uint32_t ld_count;
@@ -1099,7 +1099,7 @@ struct mfi_ld_list {uint8_t reserved2[3 ];uint64_t size; } ld_list[MFI_MAX_LD ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;enum mfi_ld_access {MFI_LD_ACCESS_RW =0 ,
@@ -1136,7 +1136,7 @@ struct mfi_ld_props {uint8_t current_cache_policy;uint8_t no_bgi;uint8_t reserved[7 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_ld_params {uint8_t primary_raid_level;
@@ -1149,7 +1149,7 @@ struct mfi_ld_params {uint8_t init_state;uint8_t is_consistent;uint8_t reserved[23 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_ld_progress {uint32_t active;
@@ -1162,21 +1162,21 @@ struct mfi_ld_progress {struct mfi_progress fgi;struct mfi_progress recon;struct mfi_progress reserved[4 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_span {uint64_t start_block;uint64_t num_blocks;uint16_t array_ref;uint8_t reserved[6 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;#define MFI_MAX_SPAN_DEPTH 8struct mfi_ld_config {struct mfi_ld_props properties;struct mfi_ld_params params;struct mfi_span span[MFI_MAX_SPAN_DEPTH ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_ld_info {struct mfi_ld_config ld_config;
@@ -1187,7 +1187,7 @@ struct mfi_ld_info {uint8_t reserved1[1 ];uint8_t vpd_page83[64 ];uint8_t reserved2[16 ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;union mfi_spare_type {uint8_t flags;
@@ -1195,7 +1195,7 @@ union mfi_spare_type {#define MFI_SPARE_IS_REVERTABLE (1 << 1)#define MFI_SPARE_IS_ENCL_AFFINITY (1 << 2)uint8_t type; -} __attribute__ ((packed)); +}QEMU_PACKED ;#define MFI_MAX_ARRAYS 16struct mfi_spare {
@@ -1204,7 +1204,7 @@ struct mfi_spare {uint8_t reserved[2 ];uint8_t array_count;uint16_t array_refd[MFI_MAX_ARRAYS ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;#define MFI_MAX_ROW_SIZE 32struct mfi_array {
@@ -1221,7 +1221,7 @@ struct mfi_array {uint8_t slot; } encl; } pd[MFI_MAX_ROW_SIZE ]; -} __attribute__ ((packed)); +}QEMU_PACKED ;struct mfi_config_data {uint32_t size;
@@ -1237,7 +1237,7 @@ struct mfi_config_data {struct mfi_ld_config ld[]; struct mfi_spare spare[]; */ -} __attribute__ ((packed)); +}QEMU_PACKED ;#define MFI_SCSI_MAX_TARGETS 128#define MFI_SCSI_MAX_LUNS 8
hw/ppce500_spin.c +1 -1
@@ -40,7 +40,7 @@ typedef struct spin_info {uint32_t resv;uint32_t pir;uint64_t reserved; -} __attribute__ ((packed)) SpinInfo; +}QEMU_PACKED SpinInfo; typedef struct spin_state { SysBusDevice busdev;
Signature · 1 line
1.7.10.4
PATCH 5/6 qdev: Fix Open Firmware comment
In reply to Stefan HajnocziFrom: Stefan Weil <[email protected]>
Commit 0d936928ef87ca1bb7b41b5b89c400c699a7691c removed code, but left the related comment at a location where it no longer belongs to.
The patch moves the comment to the correct callback and improves the text.
--- hw/qdev.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
hw/qdev.h +5 -6
@@ -78,12 +78,6 @@ struct DeviceState {int alias_required_for_version; }; -/* -* This callback is used to create Open Firmware device path in accordance with -* OF spec http://forthworks.com/standards/of1275.pdf. Indicidual bus bindings -* can be found here http://playground.sun.com/1275/bindings/. -*/ -#define TYPE_BUS "bus"#define BUS (obj) OBJECT_CHECK(BusState, (obj), TYPE_BUS)#define BUS_CLASS (klass) OBJECT_CLASS_CHECK(BusClass, (klass), TYPE_BUS)
@@ -95,6 +89,11 @@ struct BusClass {/* FIXME first arg should be BusState */ void (*print_dev)(Monitor *mon,DeviceState *dev,int indent);char *(*get_dev_path)(DeviceState *dev); +/* +* This callback is used to create Open Firmware device path in accordance +* with OF spec http://forthworks.com/standards/of1275.pdf. Individual bus +* bindings can be found at http://playground.sun.com/1275/bindings/. +*/ char *(*get_fw_dev_path)(DeviceState *dev);int (*reset)(BusState *bus); };
Signature · 1 line
1.7.10.4
PATCH 6/6 Fix some more Qemus in documentation and help text
In reply to Stefan HajnocziFrom: Stefan Weil <[email protected]>
Hopefully they will be eliminated one day.
--- docs/usb-storage.txt | 2 +- qemu-options.hx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
docs/usb-storage.txt +1 -1
@@ -2,7 +2,7 @@ qemu usb storage emulation -------------------------- -Qemu has two emulations for usb storage devices. +QEMU has two emulations for usb storage devices. Number one emulates the classic bulk-only transport protocol which is used by 99% of the usb sticks on the marked today and is called
qemu-options.hx +2 -2
@@ -1439,7 +1439,7 @@ Forward guest TCP connections to the IP address @var{server} on port @var{port} to the character device @var{dev} or to a program executed by @var{cmd:command} which gets spawned for each connection. This option can be given multiple times. -You can either use a chardev directly and have that one used throughout Qemu's +You can either use a chardev directly and have that one used throughout QEMU's lifetime, like in the following example: @example
@@ -1449,7 +1449,7 @@ qemu -net user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 [...] @end example Or you can execute a command on every TCP connection established by the guest, -so that Qemu behaves similar to an inetd process for that virtual server: +so that QEMU behaves similar to an inetd process for that virtual server: @example # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
Signature · 1 line
1.7.10.4
PATCH 4/6 cpus.c: Make all_cpu_threads_idle() static
In reply to Stefan HajnocziFrom: Peter Maydell <[email protected]>
Commit 946fb27c1 moved all the uses of all_cpu_threads_idle() into cpus.c. This means we can mark the function 'static' (again), if we shuffle it a bit earlier in the source file.
--- cpus.c | 52 ++++++++++++++++++++++++++-------------------------- qemu-common.h | 1 - 2 files changed, 26 insertions(+), 27 deletions(-)
cpus.c +26 -26
@@ -61,6 +61,32 @@static CPUArchState *next_cpu; +static bool cpu_thread_is_idle (CPUArchState *env) +{ +if (env->stop || env->queued_work_first) { +return false; + } +if (env->stopped || !runstate_is_running ()) { +return true; + } +if (!env->halted ||qemu_cpu_has_work (env) ||kvm_irqchip_in_kernel ()) { +return false; + } +return true; +} + +static bool all_cpu_threads_idle (void ) +{ +CPUArchState *env; + +for (env = first_cpu; env !=NULL ; env = env->next_cpu) { +if (!cpu_thread_is_idle (env)) { +return false; + } + } +return true; +} +/***********************************************************/ /* guest cycle counter */
@@ -433,32 +459,6 @@ static int cpu_can_run(CPUArchState *env)return 1 ; } -static bool cpu_thread_is_idle (CPUArchState *env) -{ -if (env->stop || env->queued_work_first) { -return false; - } -if (env->stopped || !runstate_is_running ()) { -return true; - } -if (!env->halted ||qemu_cpu_has_work (env) ||kvm_irqchip_in_kernel ()) { -return false; - } -return true; -} - -bool all_cpu_threads_idle (void ) -{ -CPUArchState *env; - -for (env = first_cpu; env !=NULL ; env = env->next_cpu) { -if (!cpu_thread_is_idle (env)) { -return false; - } - } -return true; -} -static void cpu_handle_guest_debug (CPUArchState *env) {gdb_set_stop_cpu (env);
qemu-common.h +0 -1
@@ -293,7 +293,6 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id);void qemu_cpu_kick (void *env);void qemu_cpu_kick_self (void );int qemu_cpu_is_self (void *env); -bool all_cpu_threads_idle (void );/* work queue */ struct qemu_work_item {
Signature · 1 line
1.7.10.4