Re: [Qemu-devel] virtio-blk performance regression and qemu-kvm
On Tue, Mar 6, 2012 at 10:07 PM, Reeted wrote: > On 03/06/12 13:59, Stefan Hajnoczi wrote: >> >> On Mon, Mar 5, 2012 at 4:44 PM, Martin Mailand >> wrote: >>> >>> Am 05.03.2012 17:35, schrieb Stefan Hajnoczi: >>> > 1. Test on i7 Laptop with Cpu governor "ondemand". >> >> v0.14.1 >> bw=63492KB/s iops=15873 >> bw=63221KB/s iops=15805 >> >> v1.0 >> bw=36696KB/s iops=9173 >> bw=37404KB/s iops=9350 >> >> master >> bw=36396KB/s iops=9099 >> bw=34182KB/s iops=8545 >> >> Change the Cpu governor to "performance" >> master >> bw=81756KB/s iops=20393 >> bw=81453KB/s iops=20257 Interesting finding. Did you show the 0.14.1 results with "performance" governor? >>> >>> >>> >>> Hi Stefan, >>> all results are with "ondemand" except the one where I changed it to >>> "performance" >>> >>> Do you want a v0.14.1 test with the governor on "performance"? >> >> Yes, the reason why that would be interesting is because it allows us >> to put the performance gain with master+"performance" into >> perspective. We could see how much of a change we get. > > > > Me too, I would be interested in seeing 0.14.1 being tested with performance > governor so to compare it to master with performance governor, to make sure > that this is not a regression. > > BTW, I'll take the opportunity to say that 15.8 or 20.3 k IOPS are very low > figures compared to what I'd instinctively expect from a paravirtualized > block driver. > There are now PCIe SSD cards that do 240 k IOPS (e.g. "OCZ RevoDrive 3 x2 > max iops") which is 12-15 times higher, for something that has to go through > a real driver and a real PCI-express bus, and can't use zero-copy > techniques. > The IOPS we can give to a VM is currently less than half that of a single > SSD SATA drive (60 k IOPS or so, these days). > That's why I consider this topic of virtio-blk performances very important. > I hope there can be improvements in this sector... It depends on the benchmark configuration. virtio-blk is capable of doing 100,000s of iops, I've seen results. My guess is that you can do >100,000 read iops with virtio-blk on a good machine and stock qemu-kvm. Stefan
Re: [Qemu-devel] [1/6 V2 PATCH] rtl8139: limit transmission buffer size in c+ mode
On Wed, Mar 07, 2012 at 11:17:48AM +0800, Jason Wang wrote: > The tx buffer would be re-allocated for tx descriptor with big size > and without LS bit set, this would make guest driver could easily let > qemu to allocate unlimited. > > In linux host, a glib failure were easy to be triggered: > > GLib-ERROR **: gmem.c:176: failed to allocate 18446744071562067968 bytes > > This patch fix this by adding a limit. As the spec didn't tell the maximum > size > of buffer allowed, stick it to current CP_TX_BUFFER_SIZE (65536). > > Changes from V1: > > Drop the while statement and s->cplus_txbuffer check. > > Signed-off-by: Jason Wang > --- > hw/rtl8139.c | 11 +-- > 1 files changed, 5 insertions(+), 6 deletions(-) Reviewed-by: Stefan Hajnoczi
Re: [Qemu-devel] How can I make serial console works
Sorry for resend this mail, for I can't see it untill now, I thought I had failed send to the mailist. On Wed, Mar 7, 2012 at 3:35 PM, Andreas Färber wrote: > > How do you know? :) > I added a function in op_helper.c, then every insn will dump all the registers when it runs. I traced the log and was sure that we had get to the rest_init(). > > > but there is no any message to the console.What should I do? > > Does timer and pic must implement first? Need I implement a serial port > > or just setup IO address? > > For a serial console you need a serial port, yes. Whether you can reuse, > e.g., the memory-mapped serial port or need to write your own device > depends on the hardware you're trying to match and that also determines > what dependencies you have - timer and PIC are likely. > > I want to use 8250, it seems it needs PIC and timer. I have finished openrisc's timer(there is still some pits), and want to use 8259. But I don't how to start. > Have you checked http://repo.or.cz/w/qemu/openrisc.git? > > No, we did it from zero. I will check it for reference. -- Regards, Zhizhou Zhang
[Qemu-devel] [PATCH 1/2] add qemu_unregister_suspend_notifier
Allow to unregister suspend notifiers. Needed when hot-unplugging devices. No in-tree user (yet), but qemu-kvm needs it for pci device assignment. Signed-off-by: Gerd Hoffmann --- sysemu.h |1 + vl.c |5 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/sysemu.h b/sysemu.h index 98118cc..ef604aa 100644 --- a/sysemu.h +++ b/sysemu.h @@ -47,6 +47,7 @@ typedef enum WakeupReason { void qemu_system_reset_request(void); void qemu_system_suspend_request(void); void qemu_register_suspend_notifier(Notifier *notifier); +void qemu_unregister_suspend_notifier(Notifier *notifier); void qemu_system_wakeup_request(WakeupReason reason); void qemu_system_wakeup_enable(WakeupReason reason, bool enabled); void qemu_register_wakeup_notifier(Notifier *notifier); diff --git a/vl.c b/vl.c index 97ab2b9..06658a8 100644 --- a/vl.c +++ b/vl.c @@ -1436,6 +1436,11 @@ void qemu_register_suspend_notifier(Notifier *notifier) notifier_list_add(&suspend_notifiers, notifier); } +void qemu_unregister_suspend_notifier(Notifier *notifier) +{ +notifier_list_remove(&suspend_notifiers, notifier); +} + void qemu_system_wakeup_request(WakeupReason reason) { if (!is_suspended) { -- 1.7.1
[Qemu-devel] [PATCH 2/2] add qemu_unregister_wakeup_notifier
While being at it complement qemu_register_wakeup_notifier with qemu_unregister_wakeup_notifier too. Signed-off-by: Gerd Hoffmann --- sysemu.h |1 + vl.c |5 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/sysemu.h b/sysemu.h index ef604aa..031df88 100644 --- a/sysemu.h +++ b/sysemu.h @@ -51,6 +51,7 @@ void qemu_unregister_suspend_notifier(Notifier *notifier); void qemu_system_wakeup_request(WakeupReason reason); void qemu_system_wakeup_enable(WakeupReason reason, bool enabled); void qemu_register_wakeup_notifier(Notifier *notifier); +void qemu_unregister_wakeup_notifier(Notifier *notifier); void qemu_system_shutdown_request(void); void qemu_system_powerdown_request(void); void qemu_system_debug_request(void); diff --git a/vl.c b/vl.c index 06658a8..e8c4af1 100644 --- a/vl.c +++ b/vl.c @@ -1470,6 +1470,11 @@ void qemu_register_wakeup_notifier(Notifier *notifier) notifier_list_add(&wakeup_notifiers, notifier); } +void qemu_unregister_wakeup_notifier(Notifier *notifier) +{ +notifier_list_remove(&wakeup_notifiers, notifier); +} + void qemu_system_killed(int signal, pid_t pid) { shutdown_signal = signal; -- 1.7.1
Re: [Qemu-devel] [PATCH 2/2] add qemu_unregister_wakeup_notifier
Il 07/03/2012 09:52, Gerd Hoffmann ha scritto: > While being at it complement qemu_register_wakeup_notifier with > qemu_unregister_wakeup_notifier too. > > Signed-off-by: Gerd Hoffmann > --- > sysemu.h |1 + > vl.c |5 + > 2 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/sysemu.h b/sysemu.h > index ef604aa..031df88 100644 > --- a/sysemu.h > +++ b/sysemu.h > @@ -51,6 +51,7 @@ void qemu_unregister_suspend_notifier(Notifier *notifier); > void qemu_system_wakeup_request(WakeupReason reason); > void qemu_system_wakeup_enable(WakeupReason reason, bool enabled); > void qemu_register_wakeup_notifier(Notifier *notifier); > +void qemu_unregister_wakeup_notifier(Notifier *notifier); > void qemu_system_shutdown_request(void); > void qemu_system_powerdown_request(void); > void qemu_system_debug_request(void); > diff --git a/vl.c b/vl.c > index 06658a8..e8c4af1 100644 > --- a/vl.c > +++ b/vl.c > @@ -1470,6 +1470,11 @@ void qemu_register_wakeup_notifier(Notifier *notifier) > notifier_list_add(&wakeup_notifiers, notifier); > } > > +void qemu_unregister_wakeup_notifier(Notifier *notifier) > +{ > +notifier_list_remove(&wakeup_notifiers, notifier); > +} > + > void qemu_system_killed(int signal, pid_t pid) > { > shutdown_signal = signal; Upstream has notifier_remove, not notifier_list_remove. You could just use it directly instead of adding wrappers. Paolo
Re: [Qemu-devel] [PATCH 3/6] pci: Add notifier for device probing
Il 07/03/2012 01:14, Alex Williamson ha scritto: > +void pci_host_remove_dev_probe_notifier(Notifier *notify) > +{ > +notifier_list_remove(&pci_host_dev_probe_notifiers, notify); > +} > + Looks like qemu-kvm needs a merge. :) Upstream has notifier_remove, not notifier_list_remove. Paolo
[Qemu-devel] Live migration qed
Hi all can anyone tell how i can migrate a VM (qed disk format)? what is the process by which can we migrate the image from one KVM to another ? -- *Pankaj Rawat*
[Qemu-devel] [PATCH 1/4] block: add image fragmentation statistics to qemu-img
From: Dong Xu Wang Discussion can be found at: http://patchwork.ozlabs.org/patch/128730/ This patch add image fragmentation statistics while using qemu-img info. Signed-off-by: Dong Xu Wang --- block.c | 13 + block.h |7 +++ block_int.h |1 + qemu-img.c |9 + 4 files changed, 30 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 52ffe14..947607b 100644 --- a/block.c +++ b/block.c @@ -2588,6 +2588,19 @@ int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) return drv->bdrv_get_info(bs, bdi); } +int bdrv_get_fragment(BlockDriverState *bs, BlockFragInfo *bfi) +{ +BlockDriver *drv = bs->drv; +if (!drv) { +return -ENOMEDIUM; +} +if (!drv->bdrv_get_fragment) { +return -ENOTSUP; +} +memset(bfi, 0, sizeof(*bfi)); +return drv->bdrv_get_fragment(bs, bfi); +} + int bdrv_save_vmstate(BlockDriverState *bs, const uint8_t *buf, int64_t pos, int size) { diff --git a/block.h b/block.h index 48d0bf3..d76d386 100644 --- a/block.h +++ b/block.h @@ -17,6 +17,12 @@ typedef struct BlockDriverInfo { int64_t vm_state_offset; } BlockDriverInfo; +typedef struct BlockFragInfo { +uint64_t allocated_clusters; +uint64_t total_clusters; +uint64_t fragmented_clusters; +} BlockFragInfo; + typedef struct QEMUSnapshotInfo { char id_str[128]; /* unique snapshot id */ /* the following fields are informative. They are not needed for @@ -290,6 +296,7 @@ const char *bdrv_get_device_name(BlockDriverState *bs); int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors); int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi); +int bdrv_get_fragment(BlockDriverState *bs, BlockFragInfo *bfi); const char *bdrv_get_encrypted_filename(BlockDriverState *bs); void bdrv_get_backing_filename(BlockDriverState *bs, diff --git a/block_int.h b/block_int.h index b460c36..339a5ac 100644 --- a/block_int.h +++ b/block_int.h @@ -179,6 +179,7 @@ struct BlockDriver { int (*bdrv_snapshot_load_tmp)(BlockDriverState *bs, const char *snapshot_name); int (*bdrv_get_info)(BlockDriverState *bs, BlockDriverInfo *bdi); +int (*bdrv_get_fragment)(BlockDriverState *bs, BlockFragInfo *bdi); int (*bdrv_save_vmstate)(BlockDriverState *bs, const uint8_t *buf, int64_t pos, int size); diff --git a/qemu-img.c b/qemu-img.c index 8df3564..17731a9 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1075,6 +1075,7 @@ static int img_info(int argc, char **argv) char backing_filename[1024]; char backing_filename2[1024]; BlockDriverInfo bdi; +BlockFragInfo bfi; fmt = NULL; for(;;) { @@ -1126,6 +1127,14 @@ static int img_info(int argc, char **argv) printf("cluster_size: %d\n", bdi.cluster_size); } } +if (bdrv_get_fragment(bs, &bfi) >= 0) { +if (bfi.total_clusters != 0 && bfi.allocated_clusters != 0) { +printf("%lld/%lld = %0.2f%% allocated, %0.2f%% fragmented\n", +bfi.allocated_clusters, bfi.total_clusters, +bfi.allocated_clusters * 100.0 / bfi.total_clusters, +bfi.fragmented_clusters * 100.0 / bfi.allocated_clusters); +} +} bdrv_get_backing_filename(bs, backing_filename, sizeof(backing_filename)); if (backing_filename[0] != '\0') { path_combine(backing_filename2, sizeof(backing_filename2), -- 1.7.5.4
[Qemu-devel] [PATCH 2/4] block: image fragmentation statistics for qed
From: Dong Xu Wang Add fragmentation statistics for qed file format. Signed-off-by: Dong Xu Wang --- block/qed.c | 41 + 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/block/qed.c b/block/qed.c index a041d31..eb4dd90 100644 --- a/block/qed.c +++ b/block/qed.c @@ -1444,6 +1444,46 @@ static int bdrv_qed_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) return 0; } +static int bdrv_qed_get_fragment(BlockDriverState *bs, BlockFragInfo *bfi) +{ +BDRVQEDState *s = bs->opaque; +uint32_t cluster_size = s->header.cluster_size; +uint64_t table_noffsets = s->header.table_size * cluster_size / sizeof(uint64_t); +uint64_t i, j; +uint64_t l2_offset; +int ret = 0; +uint64_t last_offset = 0; +uint64_t size = s->header.table_size * cluster_size; +uint64_t *table = qemu_blockalign(s->bs, size); + +for (i = 0; i < table_noffsets; i++) { +l2_offset = s->l1_table->offsets[i]; +if (l2_offset == 0) { +continue; +} +ret = bdrv_pread(bs->file, l2_offset, table, size); +if (ret < 0) { +qemu_vfree(table); +return ret; +} +for (j = 0; j < size/sizeof(uint64_t); j++) { +uint64_t *offset = (uint64_t *)(table + j); +if (*offset < cluster_size) { +continue; +} +bfi->allocated_clusters++; +if (last_offset && (last_offset + cluster_size) != *offset) { +bfi->fragmented_clusters++; +} +last_offset = *offset; +} +} +bfi->total_clusters = (s->header.image_size + s->header.cluster_size - 1) / +s->header.cluster_size; +qemu_vfree(table); +return ret; +} + static int bdrv_qed_change_backing_file(BlockDriverState *bs, const char *backing_file, const char *backing_fmt) @@ -1569,6 +1609,7 @@ static BlockDriver bdrv_qed = { .bdrv_get_info= bdrv_qed_get_info, .bdrv_change_backing_file = bdrv_qed_change_backing_file, .bdrv_check = bdrv_qed_check, +.bdrv_get_fragment= bdrv_qed_get_fragment, }; static void bdrv_qed_init(void) -- 1.7.5.4
[Qemu-devel] [PATCH 3/4 v2 RESEND] block: add dirty flag status to qemu-img
From: Dong Xu Wang Some block drivers can verify their image files are clean or not. So we can show it while using "qemu-img info. Signed-off-by: Dong Xu Wang --- block.c | 14 ++ block.h |2 ++ block_int.h |1 + qemu-img.c |3 +++ 4 files changed, 20 insertions(+), 0 deletions(-) diff --git a/block.c b/block.c index 947607b..17e9ba8 100644 --- a/block.c +++ b/block.c @@ -193,6 +193,20 @@ static void bdrv_io_limits_intercept(BlockDriverState *bs, qemu_co_queue_next(&bs->throttled_reqs); } +/* check if the image was cleanly shut down */ +bool bdrv_not_cleanly_down(BlockDriverState *bs) +{ +BlockDriver *drv = bs->drv; + +if (!drv) { +return 0; +} +if (!drv->bdrv_not_cleanly_down) { +return 0; +} +return drv->bdrv_not_cleanly_down(bs); +} + /* check if the path starts with ":" */ static int path_has_protocol(const char *path) { diff --git a/block.h b/block.h index d76d386..00dc2a5 100644 --- a/block.h +++ b/block.h @@ -110,6 +110,8 @@ void bdrv_io_limits_enable(BlockDriverState *bs); void bdrv_io_limits_disable(BlockDriverState *bs); bool bdrv_io_limits_enabled(BlockDriverState *bs); +bool bdrv_not_cleanly_down(BlockDriverState *bs); + void bdrv_init(void); void bdrv_init_with_whitelist(void); BlockDriver *bdrv_find_protocol(const char *filename); diff --git a/block_int.h b/block_int.h index 339a5ac..e28787c 100644 --- a/block_int.h +++ b/block_int.h @@ -114,6 +114,7 @@ struct BlockDriver { int (*bdrv_create)(const char *filename, QEMUOptionParameter *options); int (*bdrv_set_key)(BlockDriverState *bs, const char *key); int (*bdrv_make_empty)(BlockDriverState *bs); +bool (*bdrv_not_cleanly_down)(BlockDriverState *bs); /* aio */ BlockDriverAIOCB *(*bdrv_aio_readv)(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, diff --git a/qemu-img.c b/qemu-img.c index 17731a9..c84527b 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1122,6 +1122,9 @@ static int img_info(int argc, char **argv) if (bdrv_is_encrypted(bs)) { printf("encrypted: yes\n"); } +if (bdrv_not_cleanly_down(bs)) { +printf("cleanly shut down: no\n"); +} if (bdrv_get_info(bs, &bdi) >= 0) { if (bdi.cluster_size != 0) { printf("cluster_size: %d\n", bdi.cluster_size); -- 1.7.5.4
[Qemu-devel] [PATCH 4/4 v2 RESEND] block: track dirty flag status in qed
From: Dong Xu Wang qed driver use QED_F_NEED_CHECK to mark if the image is clean. Signed-off-by: Dong Xu Wang --- block/qed.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/block/qed.c b/block/qed.c index eb4dd90..d45d5c5 100644 --- a/block/qed.c +++ b/block/qed.c @@ -1563,6 +1563,12 @@ static int bdrv_qed_check(BlockDriverState *bs, BdrvCheckResult *result) return qed_check(s, result, false); } +static bool bdrv_qed_not_cleanly_down(BlockDriverState *bs) +{ +BDRVQEDState *s = bs->opaque; +return s->header.features & QED_F_NEED_CHECK; +} + static QEMUOptionParameter qed_create_options[] = { { .name = BLOCK_OPT_SIZE, @@ -1610,6 +1616,7 @@ static BlockDriver bdrv_qed = { .bdrv_change_backing_file = bdrv_qed_change_backing_file, .bdrv_check = bdrv_qed_check, .bdrv_get_fragment= bdrv_qed_get_fragment, +.bdrv_not_cleanly_down= bdrv_qed_not_cleanly_down, }; static void bdrv_qed_init(void) -- 1.7.5.4
[Qemu-devel] New assertion failed for USB
Hi Gerd, there are new assertion failed when plugging in a USB security dongle at guest runtime. They occur on the current GIT master + your async patch. /home/erik/qemu/hw/usb.c:352 usb_packet_complete: Assertion '((&ep->queue)->tqh_first) == p' failed. I got this only once and I'm currently not able to reproduce that. Next one is: Same security dongle (I tested two different hardware versions, both show the same behaviour): - They get detected at runtime (beside this one crash above) but it takes quite long - When being plugged in before guest startup I get the following assertion - this seems to happen in BIOS before the guest OS actually boots: /home/erik/qemu/hw/usb-uhci.c:967: uhci_fill_queue: Assertion 'ret == 2' failed. If you need further information, just let me know how to produce it. Best regards, Erik
Re: [Qemu-devel] buildbot failure in qemu on block_openbsd_4.9
Am 07.03.2012 03:57, schrieb q...@buildbot.b1-systems.de: > The Buildbot has detected a new failure on builder block_openbsd_4.9 while > building qemu. > Full details are available at: > http://buildbot.b1-systems.de/qemu/builders/block_openbsd_4.9/builds/148 > > Buildbot URL: http://buildbot.b1-systems.de/qemu/ > > Buildslave for this Build: kraxel_openbsd49 > > Build Reason: The Nightly scheduler named 'nightly_block' triggered this build > Build Source Stamp: [branch block] HEAD > Blamelist: > > BUILD FAILED: failed compile > > sincerely, > -The Buildbot Hi Alex, this is a problem with signrom.sh. master has failed in the same way recently: ASoptionrom/kvmvapic.o Building optionrom/kvmvapic.img Building optionrom/kvmvapic.raw Signing optionrom/kvmvapic.bin /home/buildbot/slave-public/block_openbsd_4.9/build/scripts/signrom.sh[31]: 018 * 512 - 1 : bad number `018' gmake[1]: *** [kvmvapic.bin] Error 1 gmake: *** [romsubdir-optionrom] Error 2 Kevin
Re: [Qemu-devel] [PATCH v2] deal with guest paniced event
On 2012-03-07 02:58, Wen Congyang wrote: > When the host knows the guest is paniced, it will set > exit_reason to KVM_EXIT_GUEST_PANICED. So if qemu receive > this exit_reason, we can send a event to tell management > application that the guest is paniced and set the guest > status to RUN_STATE_PANICED. > > Signed-off-by: Wen Congyang > --- > kvm-all.c |4 > linux-headers/linux/kvm.h |1 + > monitor.c |3 +++ > monitor.h |1 + > qapi-schema.json |2 +- > qmp.c |3 ++- > vl.c |1 + > 7 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/kvm-all.c b/kvm-all.c > index c4babda..d356948 100644 > --- a/kvm-all.c > +++ b/kvm-all.c > @@ -1190,6 +1190,10 @@ int kvm_cpu_exec(CPUState *env) > (uint64_t)run->hw.hardware_exit_reason); > ret = -1; > break; > +case KVM_EXIT_GUEST_PANICED: > +monitor_protocol_event(QEVENT_GUEST_PANICED, NULL); > +vm_stop(RUN_STATE_PANICED); > +break; This cannot work. You missed to set ret to -1 to break out of loop. > case KVM_EXIT_INTERNAL_ERROR: > ret = kvm_handle_internal_error(env, run); > break; > diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h > index f6b5343..ddc9716 100644 > --- a/linux-headers/linux/kvm.h > +++ b/linux-headers/linux/kvm.h > @@ -163,6 +163,7 @@ struct kvm_pit_config { > #define KVM_EXIT_OSI 18 > #define KVM_EXIT_PAPR_HCALL19 > #define KVM_EXIT_S390_UCONTROL 20 > +#define KVM_EXIT_GUEST_PANICED 21 Linux header must be sync'ed in a separate patch, referencing the upstream (typically kvm.git) commit hash that was used as base. Make sure to use the update-linux-headers.sh script for this. So the ordering is: Get the kernel changes accepted, then push the (final) user space patches. That said, a patch like this can still be posted in advance for informational purposes, but not for application. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Re: [Qemu-devel] [PATCH v2] deal with guest paniced event
At 03/07/2012 05:53 PM, Jan Kiszka Wrote: > On 2012-03-07 02:58, Wen Congyang wrote: >> When the host knows the guest is paniced, it will set >> exit_reason to KVM_EXIT_GUEST_PANICED. So if qemu receive >> this exit_reason, we can send a event to tell management >> application that the guest is paniced and set the guest >> status to RUN_STATE_PANICED. >> >> Signed-off-by: Wen Congyang >> --- >> kvm-all.c |4 >> linux-headers/linux/kvm.h |1 + >> monitor.c |3 +++ >> monitor.h |1 + >> qapi-schema.json |2 +- >> qmp.c |3 ++- >> vl.c |1 + >> 7 files changed, 13 insertions(+), 2 deletions(-) >> >> diff --git a/kvm-all.c b/kvm-all.c >> index c4babda..d356948 100644 >> --- a/kvm-all.c >> +++ b/kvm-all.c >> @@ -1190,6 +1190,10 @@ int kvm_cpu_exec(CPUState *env) >> (uint64_t)run->hw.hardware_exit_reason); >> ret = -1; >> break; >> +case KVM_EXIT_GUEST_PANICED: >> +monitor_protocol_event(QEVENT_GUEST_PANICED, NULL); >> +vm_stop(RUN_STATE_PANICED); >> +break; > > This cannot work. You missed to set ret to -1 to break out of loop. I fotgot to do it. But it works fine while I test this patch. I think ret has set to 0 before I guest is panicked. > >> case KVM_EXIT_INTERNAL_ERROR: >> ret = kvm_handle_internal_error(env, run); >> break; >> diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h >> index f6b5343..ddc9716 100644 >> --- a/linux-headers/linux/kvm.h >> +++ b/linux-headers/linux/kvm.h >> @@ -163,6 +163,7 @@ struct kvm_pit_config { >> #define KVM_EXIT_OSI 18 >> #define KVM_EXIT_PAPR_HCALL 19 >> #define KVM_EXIT_S390_UCONTROL20 >> +#define KVM_EXIT_GUEST_PANICED21 > > Linux header must be sync'ed in a separate patch, referencing the > upstream (typically kvm.git) commit hash that was used as base. Make > sure to use the update-linux-headers.sh script for this. > > So the ordering is: Get the kernel changes accepted, then push the > (final) user space patches. That said, a patch like this can still be > posted in advance for informational purposes, but not for application. OK. Thanks Wen Congyang > > Jan >
Re: [Qemu-devel] [PATCH v2] qom: Introduce object_class_get_list()
Am 25.02.2012 23:07, schrieb Andreas Färber: > This function allows to obtain a singly-linked list of classes, which > can be sorted by the caller. > > Signed-off-by: Andreas Färber > Cc: Anthony Liguori Ping? You requested me to do it via GSList instead of GTree, and the qom-cpu branch has been successfully rebased onto it. Andreas > --- > v1 -> v2: > * Instead of [object_class_foreach_ordered()] using a GCompareFunc with a > GTree internally, >return a GSList so that the caller can sort herself (suggested by Anthony). > * Add documentation. > > include/qemu/object.h | 11 +++ > qom/object.c | 17 + > 2 files changed, 28 insertions(+), 0 deletions(-) > > diff --git a/include/qemu/object.h b/include/qemu/object.h > index 69e4b7b..ddc3b81 100644 > --- a/include/qemu/object.h > +++ b/include/qemu/object.h > @@ -560,6 +560,17 @@ ObjectClass *object_class_by_name(const char *typename); > void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque), >const char *implements_type, bool include_abstract, >void *opaque); > + > +/** > + * object_class_get_list: > + * @implements_type: The type to filter for, including its derivatives. > + * @include_abstract: Whether to include abstract classes. > + * > + * Returns: A singly-linked list of the classes in reverse hashtable order. > + */ > +GSList *object_class_get_list(const char *implements_type, > + bool include_abstract); > + > /** > * object_ref: > * @obj: the object > diff --git a/qom/object.c b/qom/object.c > index aa037d2..eef0b22 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -572,6 +572,23 @@ void object_class_foreach(void (*fn)(ObjectClass *klass, > void *opaque), > g_hash_table_foreach(type_table_get(), object_class_foreach_tramp, > &data); > } > > +static void object_class_get_list_tramp(ObjectClass *klass, void *opaque) > +{ > +GSList **list = opaque; > + > +*list = g_slist_prepend(*list, klass); > +} > + > +GSList *object_class_get_list(const char *implements_type, > + bool include_abstract) > +{ > +GSList *list = NULL; > + > +object_class_foreach(object_class_get_list_tramp, > + implements_type, include_abstract, &list); > +return list; > +} > + > void object_ref(Object *obj) > { > obj->ref++; -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Re: [Qemu-devel] [PATCH v3 0/4] uq/master: Introduce KVM PIT support
On 03/02/2012 09:28 PM, Jan Kiszka wrote: > This adds another piece of qemu-kvm to upstream: The accelerated > in-kernel model of the i8254. It does this in the same fashion as the > interrupt controllers were already introduced. And it even has one bug > less than qemu-kvm: PC speaker output still works with KVM acceleration > enabled. > > Changes in v3: > - Rebased over recent upstream master > - Aligned license of hw/kvm/i8254.c to the other PIT files > Applied to uq/master, thanks. -- error compiling committee.c: too many arguments to function
Re: [Qemu-devel] [PATCH] configure: ignore spice libraries on 32 bit.
On 8 February 2012 15:22, Gerd Hoffmann wrote: > On 02/08/12 01:17, Rusty Russell wrote: >> As featured on: >> https://bugs.launchpad.net/qemu-linaro/+bug/928432 >> >> Since we compile with -Werror, the presence of spice headers breaks >> compile. Yet except for x86-64, it doesn't compile, doesn't work, isn't >> supported. See: http://spice-space.org/faq.html > > Outdated. 64bit restrictions are gone, spice server works on 32bit too. > Thats why 32bit spice packages exist in the first place ;) > > Attached patch fixes the warnings. Ping -- there seem to have been a couple of spice patch queue pulls since but did this warning fix patch get lost? thanks -- PMM
Re: [Qemu-devel] [PATCH] kvm: fill in padding to help valgrind
On 02/29/2012 05:54 PM, Michael S. Tsirkin wrote: > valgrind warns about padding fields which are passed > to vcpu ioctls uninitialized. > This is not an error in practice because kvm ignored padding. > Since the ioctls in question are off data path and > the cost is zero anyway, initialize padding to 0 > to suppress these errors. > Applied to uq/master, thanks. -- error compiling committee.c: too many arguments to function
Re: [Qemu-devel] virtio-blk performance regression and qemu-kvm
Am 06.03.2012 13:59, schrieb Stefan Hajnoczi: Yes, the reason why that would be interesting is because it allows us to put the performance gain with master+"performance" into perspective. We could see how much of a change we get. Does the CPU governor also affect the result when you benchmark with real disks instead of ramdisk? I can see how the governor would affect ramdisk, but would expect real disk I/O to be impacted much less. Hi, here my results. I tested with "fio -name iops -rw=read -size=1G -iodepth 1 -filename /dev/vdb -ioengine libaio -direct 1 -bs 4k" The qemu command was. qemu-system-x86_64 --enable-kvm -m 512 -boot c \ -drive file=/home/martin/vmware/bisect_kvm/hda.img,cache=none,if=virtio -drive file=/dev/ram0,cache=none,if=virtio -drive file=/dev/sda2,cache=none,if=virtio Host Kernel 3.3.0+rc4 Guest Kernel 3.0.0-16-generic ubuntu kernel On the host I use a raw partition sda2 for the disk test, in qemu I write with fio to /dev/vdc, though there is no fs involved. The host disk can at max. 13K iops, in qemu I get at max 6,5K iops, that's around about 50% overhead. All the test were with 4k reads, so I think we are mostly latency bound. -martin log: ** v0.14.1 ondemand ** ram bw=61038KB/s iops=15259 bw=66190KB/s iops=16547 disk bw=18105KB/s iops=4526 bw=17625KB/s iops=4406 ** v0.14.1 performance ** ram bw=72356KB/s iops=18088 bw=72390KB/s iops=18097 disk bw=27886KB/s iops=6971 bw=27915KB/s iops=6978 ** master ondemand ** ram bw=24833KB/s iops=6208 bw=27275KB/s iops=6818 disk bw=14980KB/s iops=3745 bw=14881KB/s iops=3720 ** master performance ** ram bw=64318KB/s iops=16079 bw=63523KB/s iops=15880 disk bw=27043KB/s iops=6760 bw=27211KB/s iops=6802 Host Disk Test (SanDisk SSD U100) host disk ondemand bw=48823KB/s iops=12205 bw=49086KB/s iops=12271 host disk performance bw=55156KB/s iops=13789 bw=54980KB/s iops=13744
[Qemu-devel] Reminder about your invitation from Carter Cheng
LinkedIn This invitation is awaiting your response: From Carter Cheng -- (c) 2012, LinkedIn Corporation
Re: [Qemu-devel] virtio-blk performance regression and qemu-kvm
Il 07/03/2012 11:39, Martin Mailand ha scritto: > The host disk can at max. 13K iops, in qemu I get at max 6,5K iops, > that's around about 50% overhead. All the test were with 4k reads, so I > think we are mostly latency bound. For latency tests, running without ioeventfd could give slightly better results (-global virtio-blk-pci.ioeventfd=off). Paolo
Re: [Qemu-devel] buildbot failure in qemu on block_openbsd_4.9
On 03/07/2012 10:51 AM, Kevin Wolf wrote: Am 07.03.2012 03:57, schrieb q...@buildbot.b1-systems.de: The Buildbot has detected a new failure on builder block_openbsd_4.9 while building qemu. Full details are available at: http://buildbot.b1-systems.de/qemu/builders/block_openbsd_4.9/builds/148 Buildbot URL: http://buildbot.b1-systems.de/qemu/ Buildslave for this Build: kraxel_openbsd49 Build Reason: The Nightly scheduler named 'nightly_block' triggered this build Build Source Stamp: [branch block] HEAD Blamelist: BUILD FAILED: failed compile sincerely, -The Buildbot Hi Alex, this is a problem with signrom.sh. master has failed in the same way recently: ASoptionrom/kvmvapic.o Building optionrom/kvmvapic.img Building optionrom/kvmvapic.raw Signing optionrom/kvmvapic.bin /home/buildbot/slave-public/block_openbsd_4.9/build/scripts/signrom.sh[31]: 018 * 512 - 1 : bad number `018' gmake[1]: *** [kvmvapic.bin] Error 1 gmake: *** [romsubdir-optionrom] Error 2 Hrm, does it work with Jan's python script? If so, maybe the appropriate fix would be to just commit that one. Alex
Re: [Qemu-devel] New assertion failed for USB
On 03/07/12 10:46, Erik Rull wrote: > Hi Gerd, > > there are new assertion failed when plugging in a USB security dongle at > guest runtime. > They occur on the current GIT master + your async patch. > > /home/erik/qemu/hw/usb.c:352 usb_packet_complete: Assertion > '((&ep->queue)->tqh_first) == p' failed. > I got this only once and I'm currently not able to reproduce that. Strange. > Next one is: > Same security dongle (I tested two different hardware versions, both show > the same behaviour): > - They get detected at runtime (beside this one crash above) but it takes > quite long > - When being plugged in before guest startup I get the following assertion > - this seems to happen in BIOS before the guest OS actually boots: > /home/erik/qemu/hw/usb-uhci.c:967: uhci_fill_queue: Assertion 'ret == 2' > failed. Might be related. In both cases the packet queue somehow isn't in the state we expecting it to be. > If you need further information, just let me know how to produce it. Enable tracing for these events ... usb_packet_state_change usb_host_req_* usb_host_urb_* ... and try to reproduce. Hopefully that gives a clue. cheers, Gerd
Re: [Qemu-devel] [PATCH] configure: ignore spice libraries on 32 bit.
On 03/07/12 11:30, Peter Maydell wrote: > On 8 February 2012 15:22, Gerd Hoffmann wrote: >> On 02/08/12 01:17, Rusty Russell wrote: >>> As featured on: >>> https://bugs.launchpad.net/qemu-linaro/+bug/928432 >>> >>> Since we compile with -Werror, the presence of spice headers breaks >>> compile. Yet except for x86-64, it doesn't compile, doesn't work, isn't >>> supported. See: http://spice-space.org/faq.html >> >> Outdated. 64bit restrictions are gone, spice server works on 32bit too. >> Thats why 32bit spice packages exist in the first place ;) >> >> Attached patch fixes the warnings. > > Ping -- there seem to have been a couple of spice patch queue > pulls since but did this warning fix patch get lost? commit f4a8a424fceb0f79bbd9f7ae4285c8a58eb5598e But it still doesn't build indeed. Looks like new warnings sneaked in ... cheers, Gerd
Re: [Qemu-devel] [PATCH] configure: ignore spice libraries on 32 bit.
On 7 March 2012 11:38, Gerd Hoffmann wrote: > On 03/07/12 11:30, Peter Maydell wrote: >> Ping -- there seem to have been a couple of spice patch queue >> pulls since but did this warning fix patch get lost? > > commit f4a8a424fceb0f79bbd9f7ae4285c8a58eb5598e Yeah, I just spotted this, not sure why I thought the patch hadn't been applied. Sorry about the noise. > But it still doesn't build indeed. > Looks like new warnings sneaked in ... Hohum :-( -- PMM
Re: [Qemu-devel] New assertion failed for USB
On March 7, 2012 at 12:30 PM Gerd Hoffmann wrote: > On 03/07/12 10:46, Erik Rull wrote: > > Hi Gerd, > > > > there are new assertion failed when plugging in a USB security dongle at > > guest runtime. > > They occur on the current GIT master + your async patch. > > > > /home/erik/qemu/hw/usb.c:352 usb_packet_complete: Assertion > > '((&ep->queue)->tqh_first) == p' failed. > > I got this only once and I'm currently not able to reproduce that. > > Strange. > > > Next one is: > > Same security dongle (I tested two different hardware versions, both show > > the same behaviour): > > - They get detected at runtime (beside this one crash above) but it takes > > quite long > > - When being plugged in before guest startup I get the following assertion > > - this seems to happen in BIOS before the guest OS actually boots: > > /home/erik/qemu/hw/usb-uhci.c:967: uhci_fill_queue: Assertion 'ret == 2' > > failed. > > Might be related. In both cases the packet queue somehow isn't in the > state we expecting it to be. > > > If you need further information, just let me know how to produce it. > > Enable tracing for these events ... > > usb_packet_state_change > usb_host_req_* > usb_host_urb_* > > ... and try to reproduce. Hopefully that gives a clue. > > cheers, > Gerd Hi Gerd, thanks for the quick reply. File is attached. Best regards, Erik usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7ea0d50, state undef -> setup usb_host_req_control dev 2:22, req 0x5, value 1, index 0 usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7ea0d50, state setup -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7ea0d70, state undef -> setup usb_host_req_control dev 2:22, req 0x8006, value 256, index 0 usb_host_urb_submit dev 2:22, aurb 0xb7e740c8, length 16, more 0 usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7ea0d70, state setup -> async uhci_fill_queue: -- 12d usb_host_urb_complete dev 2:22, aurb 0xb7e740c8, status 0, length 8, more 0 usb_host_req_complete dev 2:22, status 16 usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7ea0d70, state async -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_host_req_control dev 2:22, req 0x8006, value 512, index 0 usb_host_urb_submit dev 2:22, aurb 0xb7e740c8, length 17, more 0 usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> async uhci_fill_queue: -- 12d usb_host_urb_complete dev 2:22, aurb 0xb7e740c8, status 0, length 9, more 0 usb_host_req_complete dev 2:22, status 17 usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state async -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_host_req_control dev 2:22, req 0x8006, value 512, index 0 usb_host_urb_submit dev 2:22, aurb 0xb7e740c8, length 40, more 0 usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> async uhci_fill_queue: -- 12d usb_host_urb_complete dev 2:22, aurb 0xb7e740c8, status 0, length 32, more 0 usb_host_req_complete dev 2:22, status 40 usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state async -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> complete usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state undef -> setup usb_host_req_control dev 2:22, req 0x9, value 1, index 0 usb_packet_state_change bus 0, port 1, ep 0, packet 0xb7e134f0, state setup -> complete usb_pac
[Qemu-devel] [PATCH] configure: Quote the configure args printed in config.log
Use the same mechanism we use for printing the configure command line to config-host.mak to print it to config.log. This fixes a bug where the config.log version didn't quote arguments with spaces. Signed-off-by: Peter Maydell --- If I'd noticed when I was adding the banner to config.log that we already printed this in config-host.mak I'd have done it this way to start with... configure |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/configure b/configure index a5eb832..1b63436 100755 --- a/configure +++ b/configure @@ -22,7 +22,9 @@ rm -f config.log # Print a helpful header at the top of config.log echo "# QEMU configure log $(date)" >> config.log -echo "# produced by $0 $*" >> config.log +printf "# Configured with:" >> config.log +printf " '%s'" "$0" "$@" >> config.log +echo >> config.log echo "#" >> config.log compile_object() { -- 1.7.1
Re: [Qemu-devel] [PATCH] configure: ignore spice libraries on 32 bit.
On 7 March 2012 11:38, Gerd Hoffmann wrote: > But it still doesn't build indeed. > Looks like new warnings sneaked in ... Actually I get an outright compile error: CCui/spice-display.o ui/spice-display.c: In function ‘qemu_spice_add_memslot’: ui/spice-display.c:79:42: error: ‘QXL_IO_MEMSLOT_ADD_ASYNC’ undeclared (first use in this function) ui/spice-display.c:79:42: note: each undeclared identifier is reported only once for each function it appears in ui/spice-display.c: In function ‘qemu_spice_create_primary_surface’: ui/spice-display.c:97:42: error: ‘QXL_IO_CREATE_PRIMARY_ASYNC’ undeclared (first use in this function) ui/spice-display.c: In function ‘qemu_spice_destroy_primary_surface’: ui/spice-display.c:110:42: error: ‘QXL_IO_DESTROY_PRIMARY_ASYNC’ undeclared (first use in this function) make: *** [ui/spice-display.o] Error 1 git bisect blames commit 2e1a98c9c "qxl: introduce QXLCookie". Do we need a preprocessor guard so we don't try to use these if the host's spice headers don't support them? (My host is Ubuntu Oneiric with libspice-server-dev 0.8.2-2 and spice-protocol-dev 0.8.0-0ubuntu1.) -- PMM
Re: [Qemu-devel] [PATCH] configure: Quote the configure args printed in config.log
On Wed, Mar 7, 2012 at 12:16 PM, Peter Maydell wrote: > Use the same mechanism we use for printing the configure command > line to config-host.mak to print it to config.log. This fixes a > bug where the config.log version didn't quote arguments with spaces. > > Signed-off-by: Peter Maydell > --- > If I'd noticed when I was adding the banner to config.log that we already > printed this in config-host.mak I'd have done it this way to start with... > > configure | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/configure b/configure > index a5eb832..1b63436 100755 > --- a/configure > +++ b/configure > @@ -22,7 +22,9 @@ rm -f config.log > > # Print a helpful header at the top of config.log > echo "# QEMU configure log $(date)" >> config.log > -echo "# produced by $0 $*" >> config.log > +printf "# Configured with:" >> config.log > +printf " '%s'" "$0" "$@" >> config.log You use an interesting feature of printf(1)- it applies the (short) format string as long as there are arguments. I checked that this is in the specification: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html Thanks, applied to the trivial patches tree: https://github.com/stefanha/qemu/commits/trivial-patches Stefan
Re: [Qemu-devel] [PATCH 0/6] PCI hotplug improvements
On Tue, Mar 06, 2012 at 05:13:36PM -0700, Alex Williamson wrote: > Here's a re-work of the patch that added _STA for the purpose of > using it as an ack from the guest. Instead of that, add a notifier > for device access. Once the guest reads from device config space, > it owns it. Until that point, we can remove it directly. As pointed > out by MST, this passes test b) below, which the _STA method would not. > As a bonus, no bios change is required for this. Patches 5 & 6 are > just cleanups that can be applied independently. Thanks, > While I agree with Michael that using _STA as ack is a hack I think this approach is not less of a hack. It is unlikely that this is how it work on bare metal and we should follow real HW if possible. > Alex > > Tested using Linux guest: > a) without acpiphp loaded: > - device_add (nothing happens) > - device_del (device removed directly) How it works on real HW? On non ACPI compliant guest hot plug unplug is not suppose to work. > b) without acpiphp loaded: > - device_add (nothing happens) > - echo 1 > /sys/bus/pci/rescan (device discovered) > - device_del (nothing happens, guest owns device) So guest can block a device from being ever removed? > - modprobe acpiphp > - device_del (guest releases device) > c) with acpiphp loaded: > - device_add/del behave as expected (automatic add + coordinated removal) > Tested using WinXP guest: > - device_add/del behave as expected (automatic add + coordinated removal) > > --- > > Alex Williamson (6): > api_piix4: Remove PCI_RMV_BASE write code > acpi_piix4: Use pci_get/set_byte > acpi_piix4: Track PCI hotplug status and allow non-ACPI remove path > pci: Add notifier for device probing > acpi_piix4: Only allow writes to PCI hotplug eject register > acpi_piix4: Disallow write to up/down PCI hotplug registers > > > hw/acpi_piix4.c | 175 > --- > hw/pci_host.c | 19 ++ > hw/pci_host.h |2 + > 3 files changed, 111 insertions(+), 85 deletions(-) -- Gleb.
Re: [Qemu-devel] [PATCH] configure: ignore spice libraries on 32 bit.
Hi, > git bisect blames commit 2e1a98c9c "qxl: introduce QXLCookie". > Do we need a preprocessor guard so we don't try to use these > if the host's spice headers don't support them? > (My host is Ubuntu Oneiric with libspice-server-dev 0.8.2-2 > and spice-protocol-dev 0.8.0-0ubuntu1.) Hmm, spice-protocol 0.8.1 adds them. qemu configure has a hard dependency on spice-server 0.8.2 or newer, and I through that automagically pulls in a recent enougth spice-protocol too because it is needed to build spice-server in the first place. Alon? Did I mix up the versioning? Or is this a bug in the ubuntu package dependencies? cheers, Gerd
[Qemu-devel] [PATCH 03/13] qom: Fix spelling in documentation
From: Stefan Weil This fixes a new spelling issue which was detected by codespell. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- include/qemu/object.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/qemu/object.h b/include/qemu/object.h index 69e4b7b..dd7f3c0 100644 --- a/include/qemu/object.h +++ b/include/qemu/object.h @@ -288,7 +288,7 @@ struct Object * implementing an explicit class type if they are not adding additional * virtual functions. * @class_init: This function is called after all parent class initialization - * has occured to allow a class to set its default virtual method pointers. + * has occurred to allow a class to set its default virtual method pointers. * This is also the function to use to override virtual methods from a parent * class. * @class_finalize: This function is called during class destruction and is -- 1.7.9.1
[Qemu-devel] [PATCH 09/13] vnc: Add break statement
From: Stefan Weil This was not a bug, but it is not common practice to omit the break statement from the last case statement before an empty default case. Any change of the default case would introduce a bug. This was reported as a warning by splint. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- ui/vnc-enc-hextile-template.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/ui/vnc-enc-hextile-template.h b/ui/vnc-enc-hextile-template.h index b9f9f5e..a7310e1 100644 --- a/ui/vnc-enc-hextile-template.h +++ b/ui/vnc-enc-hextile-template.h @@ -175,6 +175,7 @@ static void CONCAT(send_hextile_tile_, NAME)(VncState *vs, /* we really don't have to invalidate either the bg or fg but we've lost the old values. oh well. */ } +break; default: break; } -- 1.7.9.1
[Qemu-devel] [PATCH 13/13] configure: Quote the configure args printed in config.log
From: Peter Maydell Use the same mechanism we use for printing the configure command line to config-host.mak to print it to config.log. This fixes a bug where the config.log version didn't quote arguments with spaces. Signed-off-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- configure |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/configure b/configure index ed3d907..66a65d9 100755 --- a/configure +++ b/configure @@ -22,7 +22,9 @@ rm -f config.log # Print a helpful header at the top of config.log echo "# QEMU configure log $(date)" >> config.log -echo "# produced by $0 $*" >> config.log +printf "# Configured with:" >> config.log +printf " '%s'" "$0" "$@" >> config.log +echo >> config.log echo "#" >> config.log compile_object() { -- 1.7.9.1
[Qemu-devel] [PATCH 07/13] vnc: Fix packed boolean struct members
From: Stefan Weil This patch fixes warnings reported by splint: For variables which are packed in a single bit, a signed data type like 'int' does not make much sense. There is no obvious reason why the two values should be packed, so I removed the packing and changed the data type to bool because both are used as boolean values. Cc: Anthony Liguori Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- ui/vnc-auth-sasl.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/vnc-auth-sasl.h b/ui/vnc-auth-sasl.h index fd9b18a..ee243a9 100644 --- a/ui/vnc-auth-sasl.h +++ b/ui/vnc-auth-sasl.h @@ -37,9 +37,9 @@ typedef struct VncDisplaySASL VncDisplaySASL; struct VncStateSASL { sasl_conn_t *conn; /* If we want to negotiate an SSF layer with client */ -int wantSSF :1; +bool wantSSF; /* If we are now running the SSF layer */ -int runSSF :1; +bool runSSF; /* * If this is non-zero, then wait for that many bytes * to be written plain, before switching to SSF encoding -- 1.7.9.1
Re: [Qemu-devel] [PATCH] configure: ignore spice libraries on 32 bit.
On Wed, Mar 07, 2012 at 01:43:36PM +0100, Gerd Hoffmann wrote: > Hi, > > > git bisect blames commit 2e1a98c9c "qxl: introduce QXLCookie". > > Do we need a preprocessor guard so we don't try to use these > > if the host's spice headers don't support them? > > > (My host is Ubuntu Oneiric with libspice-server-dev 0.8.2-2 > > and spice-protocol-dev 0.8.0-0ubuntu1.) > > Hmm, spice-protocol 0.8.1 adds them. qemu configure has a hard > dependency on spice-server 0.8.2 or newer, and I through that > automagically pulls in a recent enougth spice-protocol too because it is > needed to build spice-server in the first place. > > Alon? Did I mix up the versioning? Or is this a bug in the ubuntu > package dependencies? There is no spice-protocol requires in spice-server.pc from 0.8 branch (took the 0.8.2 commit f0e5a3cb77625b32050f052a8ede7ab0ca008224), This is the Requires line: Requires: pixman-1 >= 0.17.7 celt051 >= 0.5.1.1 alsa openssl xrandr xfixes x11 xext xrender so I think we need to add our own. diff --git a/configure b/configure index a5eb832..ecdfe9a 100755 --- a/configure +++ b/configure @@ -2544,6 +2544,7 @@ EOF spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \ + $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \ compile_prog "$spice_cflags" "$spice_libs" ; then spice="yes" libs_softmmu="$libs_softmmu $spice_libs" > > cheers, > Gerd >
[Qemu-devel] [PATCH 03/20] usb-ehci: split our qh queue into async and periodic queues
From: Hans de Goede qhs can be part of both the async and the periodic schedule, as is shown in later patches in this series it is useful to keep track of the qhs on a per schedule basis. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c | 62 ++--- 1 files changed, 37 insertions(+), 25 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index d41b80e..840022d 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -347,7 +347,6 @@ enum async_state { struct EHCIQueue { EHCIState *ehci; QTAILQ_ENTRY(EHCIQueue) next; -bool async_schedule; uint32_t seen; uint64_t ts; @@ -367,6 +366,8 @@ struct EHCIQueue { int usb_status; }; +typedef QTAILQ_HEAD(EHCIQueueHead, EHCIQueue) EHCIQueueHead; + struct EHCIState { PCIDevice dev; USBBus bus; @@ -410,7 +411,8 @@ struct EHCIState { USBPort ports[NB_PORTS]; USBPort *companion_ports[NB_PORTS]; uint32_t usbsts_pending; -QTAILQ_HEAD(, EHCIQueue) queues; +EHCIQueueHead aqueues; +EHCIQueueHead pqueues; uint32_t a_fetch_addr; // which address to look at next uint32_t p_fetch_addr; // which address to look at next @@ -660,31 +662,34 @@ static void ehci_trace_sitd(EHCIState *s, target_phys_addr_t addr, static EHCIQueue *ehci_alloc_queue(EHCIState *ehci, int async) { +EHCIQueueHead *head = async ? &ehci->aqueues : &ehci->pqueues; EHCIQueue *q; q = g_malloc0(sizeof(*q)); q->ehci = ehci; -q->async_schedule = async; -QTAILQ_INSERT_HEAD(&ehci->queues, q, next); +QTAILQ_INSERT_HEAD(head, q, next); trace_usb_ehci_queue_action(q, "alloc"); return q; } -static void ehci_free_queue(EHCIQueue *q) +static void ehci_free_queue(EHCIQueue *q, int async) { +EHCIQueueHead *head = async ? &q->ehci->aqueues : &q->ehci->pqueues; trace_usb_ehci_queue_action(q, "free"); if (q->async == EHCI_ASYNC_INFLIGHT) { usb_cancel_packet(&q->packet); } -QTAILQ_REMOVE(&q->ehci->queues, q, next); +QTAILQ_REMOVE(head, q, next); g_free(q); } -static EHCIQueue *ehci_find_queue_by_qh(EHCIState *ehci, uint32_t addr) +static EHCIQueue *ehci_find_queue_by_qh(EHCIState *ehci, uint32_t addr, +int async) { +EHCIQueueHead *head = async ? &ehci->aqueues : &ehci->pqueues; EHCIQueue *q; -QTAILQ_FOREACH(q, &ehci->queues, next) { +QTAILQ_FOREACH(q, head, next) { if (addr == q->qhaddr) { return q; } @@ -692,11 +697,12 @@ static EHCIQueue *ehci_find_queue_by_qh(EHCIState *ehci, uint32_t addr) return NULL; } -static void ehci_queues_rip_unused(EHCIState *ehci) +static void ehci_queues_rip_unused(EHCIState *ehci, int async) { +EHCIQueueHead *head = async ? &ehci->aqueues : &ehci->pqueues; EHCIQueue *q, *tmp; -QTAILQ_FOREACH_SAFE(q, &ehci->queues, next, tmp) { +QTAILQ_FOREACH_SAFE(q, head, next, tmp) { if (q->seen) { q->seen = 0; q->ts = ehci->last_run_ns; @@ -706,29 +712,31 @@ static void ehci_queues_rip_unused(EHCIState *ehci) /* allow 0.25 sec idle */ continue; } -ehci_free_queue(q); +ehci_free_queue(q, async); } } -static void ehci_queues_rip_device(EHCIState *ehci, USBDevice *dev) +static void ehci_queues_rip_device(EHCIState *ehci, USBDevice *dev, int async) { +EHCIQueueHead *head = async ? &ehci->aqueues : &ehci->pqueues; EHCIQueue *q, *tmp; -QTAILQ_FOREACH_SAFE(q, &ehci->queues, next, tmp) { +QTAILQ_FOREACH_SAFE(q, head, next, tmp) { if (!usb_packet_is_inflight(&q->packet) || q->packet.ep->dev != dev) { continue; } -ehci_free_queue(q); +ehci_free_queue(q, async); } } -static void ehci_queues_rip_all(EHCIState *ehci) +static void ehci_queues_rip_all(EHCIState *ehci, int async) { +EHCIQueueHead *head = async ? &ehci->aqueues : &ehci->pqueues; EHCIQueue *q, *tmp; -QTAILQ_FOREACH_SAFE(q, &ehci->queues, next, tmp) { -ehci_free_queue(q); +QTAILQ_FOREACH_SAFE(q, head, next, tmp) { +ehci_free_queue(q, async); } } @@ -773,7 +781,8 @@ static void ehci_detach(USBPort *port) return; } -ehci_queues_rip_device(s, port->dev); +ehci_queues_rip_device(s, port->dev, 0); +ehci_queues_rip_device(s, port->dev, 1); *portsc &= ~(PORTSC_CONNECT|PORTSC_PED); *portsc |= PORTSC_CSC; @@ -793,7 +802,8 @@ static void ehci_child_detach(USBPort *port, USBDevice *child) return; } -ehci_queues_rip_device(s, child); +ehci_queues_rip_device(s, child, 0); +ehci_queues_rip_device(s, child, 1); } static void ehci_wakeup(USBPort *port) @@ -911,7 +921,8 @@ static void ehci_reset(void *opaque) usb_device_reset(devs[i]); } } -ehci_queues_rip_all(s); +ehci_queu
[Qemu-devel] [PATCH 02/20] usb-ehci: Never follow table entries with the T-bit set
From: Hans de Goede Before this patch the T-bit was not checked in 2 places, while it should be. Once we properly check the T-bit everywhere we no longer need the weird entry < 0x1000 and entry > 0x1000 checks, so this patch removes them. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index afc8ccf..d41b80e 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -1568,8 +1568,7 @@ static int ehci_state_fetchentry(EHCIState *ehci, int async) int again = 0; uint32_t entry = ehci_get_fetch_addr(ehci, async); -if (entry < 0x1000) { -DPRINTF("fetchentry: entry invalid (0x%08x)\n", entry); +if (NLPTR_TBIT(entry)) { ehci_set_state(ehci, async, EST_ACTIVE); goto out; } @@ -1677,7 +1676,8 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async) if (q->qh.token & QTD_TOKEN_HALT) { ehci_set_state(ehci, async, EST_HORIZONTALQH); -} else if ((q->qh.token & QTD_TOKEN_ACTIVE) && (q->qh.current_qtd > 0x1000)) { +} else if ((q->qh.token & QTD_TOKEN_ACTIVE) && + (NLPTR_TBIT(q->qh.current_qtd) == 0)) { q->qtdaddr = q->qh.current_qtd; ehci_set_state(ehci, async, EST_FETCHQTD); @@ -1756,7 +1756,6 @@ static int ehci_state_advqueue(EHCIQueue *q, int async) * want data and alt-next qTD is valid */ if (((q->qh.token & QTD_TOKEN_TBYTES_MASK) != 0) && -(q->qh.altnext_qtd > 0x1000) && (NLPTR_TBIT(q->qh.altnext_qtd) == 0)) { q->qtdaddr = q->qh.altnext_qtd; ehci_set_state(q->ehci, async, EST_FETCHQTD); @@ -1764,8 +1763,7 @@ static int ehci_state_advqueue(EHCIQueue *q, int async) /* * next qTD is valid */ -} else if ((q->qh.next_qtd > 0x1000) && - (NLPTR_TBIT(q->qh.next_qtd) == 0)) { +} else if (NLPTR_TBIT(q->qh.next_qtd) == 0) { q->qtdaddr = q->qh.next_qtd; ehci_set_state(q->ehci, async, EST_FETCHQTD); -- 1.7.1
[Qemu-devel] [PATCH 01/20] usb-redir: Set ep type and interface
From: Hans de Goede Since we don't use usb_desc.c we need to do this ourselves. This fixes iso transfers no longer working for USB 2 devices due to the ep->type check in ehci.c Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- usb-redir.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/usb-redir.c b/usb-redir.c index 755492f..a87de6e 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -1122,6 +1122,7 @@ static void usbredir_device_disconnect(void *priv) for (i = 0; i < MAX_ENDPOINTS; i++) { QTAILQ_INIT(&dev->endpoint[i].bufpq); } +usb_ep_init(&dev->dev); dev->interface_info.interface_count = 0; } @@ -1148,6 +1149,7 @@ static void usbredir_ep_info(void *priv, struct usb_redir_ep_info_header *ep_info) { USBRedirDevice *dev = priv; +struct USBEndpoint *usb_ep; int i; for (i = 0; i < MAX_ENDPOINTS; i++) { @@ -1172,7 +1174,13 @@ static void usbredir_ep_info(void *priv, default: ERROR("Received invalid endpoint type\n"); usbredir_device_disconnect(dev); +return; } +usb_ep = usb_ep_get(&dev->dev, +(i & 0x10) ? USB_TOKEN_IN : USB_TOKEN_OUT, +i & 0x0f); +usb_ep->type = dev->endpoint[i].type; +usb_ep->ifnum = dev->endpoint[i].interface; } } -- 1.7.1
[Qemu-devel] [PATCH 18/20] usb: add shortcut for control transfers
Add a more direct code path to submit control transfers. Instead of feeding three usb packets (setup, data, ack) to usb_handle_packet and have the do_token_* functions in usb.c poke the control transfer parameters out of it just submit a single packet carrying the actual data with the control xfer parameters filled into USBPacket->parameters. Signed-off-by: Gerd Hoffmann --- hw/usb.c | 59 +++ hw/usb.h |1 + 2 files changed, 60 insertions(+), 0 deletions(-) diff --git a/hw/usb.c b/hw/usb.c index 800d912..1ec2e90 100644 --- a/hw/usb.c +++ b/hw/usb.c @@ -95,6 +95,7 @@ void usb_wakeup(USBEndpoint *ep) #define SETUP_STATE_SETUP 1 #define SETUP_STATE_DATA 2 #define SETUP_STATE_ACK 3 +#define SETUP_STATE_PARAM 4 static int do_token_setup(USBDevice *s, USBPacket *p) { @@ -226,6 +227,50 @@ static int do_token_out(USBDevice *s, USBPacket *p) } } +static int do_parameter(USBDevice *s, USBPacket *p) +{ +int request, value, index; +int i, ret = 0; + +for (i = 0; i < 8; i++) { +s->setup_buf[i] = p->parameter >> (i*8); +} + +s->setup_state = SETUP_STATE_PARAM; +s->setup_len = (s->setup_buf[7] << 8) | s->setup_buf[6]; +s->setup_index = 0; + +request = (s->setup_buf[0] << 8) | s->setup_buf[1]; +value = (s->setup_buf[3] << 8) | s->setup_buf[2]; +index = (s->setup_buf[5] << 8) | s->setup_buf[4]; + +if (s->setup_len > sizeof(s->data_buf)) { +fprintf(stderr, +"usb_generic_handle_packet: ctrl buffer too small (%d > %zu)\n", +s->setup_len, sizeof(s->data_buf)); +return USB_RET_STALL; +} + +if (p->pid == USB_TOKEN_OUT) { +usb_packet_copy(p, s->data_buf, s->setup_len); +} + +ret = usb_device_handle_control(s, p, request, value, index, +s->setup_len, s->data_buf); +if (ret < 0) { +return ret; +} + +if (ret < s->setup_len) { +s->setup_len = ret; +} +if (p->pid == USB_TOKEN_IN) { +usb_packet_copy(p, s->data_buf, s->setup_len); +} + +return ret; +} + /* ctrl complete function for devices which use usb_generic_handle_packet and may return USB_RET_ASYNC from their handle_control callback. Device code which does this *must* call this function instead of the normal @@ -250,6 +295,16 @@ void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p) p->result = 0; break; +case SETUP_STATE_PARAM: +if (p->result < s->setup_len) { +s->setup_len = p->result; +} +if (p->pid == USB_TOKEN_IN) { +p->result = 0; +usb_packet_copy(p, s->data_buf, s->setup_len); +} +break; + default: break; } @@ -292,6 +347,9 @@ static int usb_process_one(USBPacket *p) if (p->ep->nr == 0) { /* control pipe */ +if (p->parameter) { +return do_parameter(dev, p); +} switch (p->pid) { case USB_TOKEN_SETUP: return do_token_setup(dev, p); @@ -416,6 +474,7 @@ void usb_packet_setup(USBPacket *p, int pid, USBEndpoint *ep) p->pid = pid; p->ep = ep; p->result = 0; +p->parameter = 0; qemu_iovec_reset(&p->iov); usb_packet_set_state(p, USB_PACKET_SETUP); } diff --git a/hw/usb.h b/hw/usb.h index f6df0ad..d60d03d 100644 --- a/hw/usb.h +++ b/hw/usb.h @@ -327,6 +327,7 @@ struct USBPacket { int pid; USBEndpoint *ep; QEMUIOVector iov; +uint64_t parameter; /* control transfers */ int result; /* transfer length or USB_RET_* status code */ /* Internal use by the USB layer. */ USBPacketState state; -- 1.7.1
[Qemu-devel] [PATCH 15/20] usb: queue can have async packets
This can happen today in case the ->complete() callback queues up the next packet. Also we'll support pipelining soon, which allows to have multiple packets per queue in flight (aka ASYNC) state. Signed-off-by: Gerd Hoffmann --- hw/usb.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/usb.c b/hw/usb.c index 57fc5e3..fc41d62 100644 --- a/hw/usb.c +++ b/hw/usb.c @@ -356,6 +356,9 @@ void usb_packet_complete(USBDevice *dev, USBPacket *p) while (!QTAILQ_EMPTY(&ep->queue)) { p = QTAILQ_FIRST(&ep->queue); +if (p->state == USB_PACKET_ASYNC) { +break; +} assert(p->state == USB_PACKET_QUEUED); ret = usb_process_one(p); if (ret == USB_RET_ASYNC) { -- 1.7.1
[Qemu-devel] [PATCH 05/13] block/vmdk: Fix warning from splint (comparision of unsigned value)
From: Stefan Weil l1_entry_sectors will never be less than 0. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- block/vmdk.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 5623ac1..45c003a 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -453,7 +453,7 @@ static int vmdk_open_vmdk4(BlockDriverState *bs, } l1_entry_sectors = le32_to_cpu(header.num_gtes_per_gte) * le64_to_cpu(header.granularity); -if (l1_entry_sectors <= 0) { +if (l1_entry_sectors == 0) { return -EINVAL; } l1_size = (le64_to_cpu(header.capacity) + l1_entry_sectors - 1) -- 1.7.9.1
[Qemu-devel] [PATCH 08/13] libcacard: Use format specifier %u instead of %d for unsigned values
From: Stefan Weil splint reported warnings for those code statements. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- libcacard/vscclient.c | 20 ++-- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c index e317a25..0adae13 100644 --- a/libcacard/vscclient.c +++ b/libcacard/vscclient.c @@ -66,7 +66,7 @@ send_msg( qemu_mutex_lock(&write_lock); if (verbose > 10) { -printf("sending type=%d id=%d, len =%d (0x%x)\n", +printf("sending type=%d id=%u, len =%u (0x%x)\n", type, reader_id, length, length); } @@ -167,7 +167,7 @@ event_thread(void *arg) case VEVENT_READER_REMOVE: /* future, tell qemu that an old CCID reader has been removed */ if (verbose > 10) { -printf(" READER REMOVE: %d\n", reader_id); +printf(" READER REMOVE: %u\n", reader_id); } send_msg(VSC_ReaderRemove, reader_id, NULL, 0); break; @@ -178,7 +178,7 @@ event_thread(void *arg) vreader_power_on(event->reader, atr, &atr_len); /* ATR call functions as a Card Insert event */ if (verbose > 10) { -printf(" CARD INSERT %d: ", reader_id); +printf(" CARD INSERT %u: ", reader_id); print_byte_array(atr, atr_len); } send_msg(VSC_ATR, reader_id, atr, atr_len); @@ -186,7 +186,7 @@ event_thread(void *arg) case VEVENT_CARD_REMOVE: /* Card removed */ if (verbose > 10) { -printf(" CARD REMOVE %d:\n", reader_id); +printf(" CARD REMOVE %u:\n", reader_id); } send_msg(VSC_CardRemove, reader_id, NULL, 0); break; @@ -256,7 +256,7 @@ do_command(void) reader ? vreader_get_name(reader) : "invalid reader", error); } else { -printf("no reader by id %d found\n", reader_id); +printf("no reader by id %u found\n", reader_id); } } else if (strncmp(string, "remove", 6) == 0) { if (string[6] == ' ') { @@ -269,7 +269,7 @@ do_command(void) reader ? vreader_get_name(reader) : "invalid reader", error); } else { -printf("no reader by id %d found\n", reader_id); +printf("no reader by id %u found\n", reader_id); } } else if (strncmp(string, "select", 6) == 0) { if (string[6] == ' ') { @@ -280,11 +280,11 @@ do_command(void) reader = vreader_get_reader_by_id(reader_id); } if (reader) { -printf("Selecting reader %d, %s\n", reader_id, +printf("Selecting reader %u, %s\n", reader_id, vreader_get_name(reader)); default_reader_id = reader_id; } else { -printf("Reader with id %d not found\n", reader_id); +printf("Reader with id %u not found\n", reader_id); } } else if (strncmp(string, "debug", 5) == 0) { if (string[5] == ' ') { @@ -303,7 +303,7 @@ do_command(void) if (reader_id == -1) { continue; } -printf("%3d %s %s\n", reader_id, +printf("%3u %s %s\n", reader_id, vreader_card_is_present(reader) == VREADER_OK ? "CARD_PRESENT" : "", vreader_get_name(reader)); @@ -563,7 +563,7 @@ main( mhHeader.reader_id = ntohl(mhHeader.reader_id); mhHeader.length = ntohl(mhHeader.length); if (verbose) { -printf("Header: type=%d, reader_id=%d length=%d (0x%x)\n", +printf("Header: type=%d, reader_id=%u length=%d (0x%x)\n", mhHeader.type, mhHeader.reader_id, mhHeader.length, mhHeader.length); } -- 1.7.9.1
Re: [Qemu-devel] [PATCH 2/2] block: add-cow support snapshot_blkdev
On Thu, Mar 1, 2012 at 2:49 AM, Dong Xu Wang wrote: > From: Dong Xu Wang > > We can not use raw to support snapshot_file, but add-cow can do this. > > CC: Marcelo Tosatti > CC: Kevin Wolf > CC: Stefan Hajnoczi > Signed-off-by: Dong Xu Wang > --- > blockdev.c | 53 ++ > docs/live-block-ops.txt | 8 ++- > 2 files changed, 55 insertions(+), 6 deletions(-) > > diff --git a/blockdev.c b/blockdev.c > index d78aa51..c820fcb 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -687,12 +687,55 @@ void qmp_blockdev_snapshot_sync(const char *device, > const char *snapshot_file, > return; > } > > - ret = bdrv_img_create(snapshot_file, format, bs->filename, > - bs->drv->format_name, NULL, -1, flags); > - if (ret) { > - error_set(errp, QERR_UNDEFINED_ERROR); > - return; > + if (strcmp(format, "add-cow")) { > + ret = bdrv_img_create(snapshot_file, format, bs->filename, > + bs->drv->format_name, NULL, -1, flags); > + if (ret) { > + error_set(errp, QERR_UNDEFINED_ERROR); > + return; > + } I'm confused here because I thought we need three files: 1. The .add-cow file containing the bitmap 2. The cow image file containing allocated sectors 3. The backing file containing the original image We're only passing in snapshot_file and bs->filename. How will #2, the cow file, be created? Stefan
[Qemu-devel] [PATCH 17/20] usb-host: enable pipelineing for bulk endpoints.
We really don't want to wait for packets finish before submitting the next, we want keep the data flow running. Signed-off-by: Gerd Hoffmann --- usb-linux.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/usb-linux.c b/usb-linux.c index 050ea7a..90919c2 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -1192,6 +1192,9 @@ static int usb_linux_update_endp_table(USBHostDevice *s) USB_ENDPOINT_XFER_INVALID); usb_ep_set_type(&s->dev, pid, ep, type); usb_ep_set_ifnum(&s->dev, pid, ep, interface); +if (type == USB_ENDPOINT_XFER_BULK) { +usb_ep_set_pipeline(&s->dev, pid, ep, true); +} epd = get_endp(s, pid, ep); epd->halted = 0; -- 1.7.1
[Qemu-devel] [PATCH 04/13] qmp: Fix spelling fourty -> forty
From: Stefan Weil This was found by codespell. Signed-off-by: Stefan Weil Acked-by: Luiz Capitulino Signed-off-by: Stefan Hajnoczi --- test-qmp-output-visitor.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test-qmp-output-visitor.c b/test-qmp-output-visitor.c index c94c208..5452cd4 100644 --- a/test-qmp-output-visitor.c +++ b/test-qmp-output-visitor.c @@ -221,8 +221,8 @@ static void test_visitor_out_struct_nested(TestOutputVisitorData *data, QObject *obj; QDict *qdict, *dict1, *dict2, *dict3, *userdef; const char *string = "user def string"; -const char *strings[] = { "fourty two", "fourty three", "fourty four", - "fourty five" }; +const char *strings[] = { "forty two", "forty three", "forty four", + "forty five" }; ud2 = g_malloc0(sizeof(*ud2)); ud2->string0 = g_strdup(strings[0]); -- 1.7.9.1
[Qemu-devel] [PATCH 09/20] usb-ehci: Remove dead nakcnt code
From: Hans de Goede This patch removes 2 bits of dead nakcnt code: 1) usb_ehci_execute calls ehci_qh_do_overlay which does: nakcnt = reload; and then has a block of code which is conditional on: if (reload && !nakcnt) { which ofcourse is never true now as nakcnt == reload. 2) ehci_state_fetchqh does: nakcnt = reload; but before nakcnt is ever used ehci_state_fetchqh is always followed by a ehci_qh_do_overlay call which also does: nakcnt = reload; So doing this from ehci_state_fetchqh is redundant. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c | 20 1 files changed, 0 insertions(+), 20 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index 2685adc..07bcd1f 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -1615,7 +1615,6 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async) { uint32_t entry; EHCIQueue *q; -int reload; entry = ehci_get_fetch_addr(ehci, async); q = ehci_find_queue_by_qh(ehci, entry, async); @@ -1673,11 +1672,6 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async) } #endif -reload = get_field(q->qh.epchar, QH_EPCHAR_RL); -if (reload) { -set_field(&q->qh.altnext_qtd, reload, QH_ALTNEXT_NAKCNT); -} - if (q->qh.token & QTD_TOKEN_HALT) { ehci_set_state(ehci, async, EST_HORIZONTALQH); @@ -1837,25 +1831,11 @@ static void ehci_flush_qh(EHCIQueue *q) static int ehci_state_execute(EHCIQueue *q, int async) { int again = 0; -int reload, nakcnt; -int smask; if (ehci_qh_do_overlay(q) != 0) { return -1; } -smask = get_field(q->qh.epcap, QH_EPCAP_SMASK); - -if (!smask) { -reload = get_field(q->qh.epchar, QH_EPCHAR_RL); -nakcnt = get_field(q->qh.altnext_qtd, QH_ALTNEXT_NAKCNT); -if (reload && !nakcnt) { -ehci_set_state(q->ehci, async, EST_HORIZONTALQH); -again = 1; -goto out; -} -} - // TODO verify enough time remains in the uframe as in 4.4.1.1 // TODO write back ptr to async list when done or out of time // TODO Windows does not seem to ever set the MULT field -- 1.7.1
[Qemu-devel] [PATCH 11/20] usb-ehci: Cleanup itd error handling
From: Hans de Goede All error statuses except for NAK are handled in a switch case, move the handling of NAK into the same switch case. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c | 28 ++-- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index 9197298..825fcc0 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -1466,20 +1466,7 @@ static int ehci_process_itd(EHCIState *ehci, } qemu_sglist_destroy(&ehci->isgl); -if (ret == USB_RET_NAK) { -/* no data for us, so do a zero-length transfer */ -ret = 0; -} - -if (ret >= 0) { -if (!dir) { -/* OUT */ -set_field(&itd->transact[i], len - ret, ITD_XACT_LENGTH); -} else { -/* IN */ -set_field(&itd->transact[i], ret, ITD_XACT_LENGTH); -} -} else { +if (ret < 0) { switch (ret) { default: fprintf(stderr, "Unexpected iso usb result: %d\n", ret); @@ -1495,6 +1482,19 @@ static int ehci_process_itd(EHCIState *ehci, itd->transact[i] |= ITD_XACT_BABBLE; ehci_record_interrupt(ehci, USBSTS_ERRINT); break; +case USB_RET_NAK: +/* no data for us, so do a zero-length transfer */ +ret = 0; +break; +} +} +if (ret >= 0) { +if (!dir) { +/* OUT */ +set_field(&itd->transact[i], len - ret, ITD_XACT_LENGTH); +} else { +/* IN */ +set_field(&itd->transact[i], ret, ITD_XACT_LENGTH); } } if (itd->transact[i] & ITD_XACT_IOC) { -- 1.7.1
[Qemu-devel] [PATCH 11/13] libcacard: Spelling and grammar fixes in documentation
From: Stefan Weil * it's -> its * it's -> it is (that's no fix, but makes future checks easier) * this functions -> this function * replacable -> replaceable * reader's -> readers * logins into -> logs into v2: Also replace 'aid' by 'AID' (thanks to Peter Maydell for this hint). v3: Fix sentence (contributed by Alon Levy / Robert Relyea). Cc: Alon Levy Cc: Robert Relyea Cc: Peter Maydell Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- docs/libcacard.txt | 26 +- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/libcacard.txt b/docs/libcacard.txt index f7d7519..8db421d 100644 --- a/docs/libcacard.txt +++ b/docs/libcacard.txt @@ -10,7 +10,7 @@ such as signing, card removal/insertion, etc. are mapped to real, physical cards which are shared with the client machine the emulator is running on, or the cards could be pure software constructs. -The emulator is structured to allow multiple replacable or additional pieces, +The emulator is structured to allow multiple replaceable or additional pieces, so it can be easily modified for future requirements. The primary envisioned modifications are: @@ -32,7 +32,7 @@ be emulated as well, including PIV, newer versions of CAC, PKCS #15, etc. Replacing the Socket Based Virtual Reader Interface. -The current implementation contains a replacable module vscclient.c. The +The current implementation contains a replaceable module vscclient.c. The current vscclient.c implements a sockets interface to the virtual ccid reader on the guest. CCID commands that are pertinent to emulation are passed across the socket, and their responses are passed back along that same socket. @@ -42,7 +42,7 @@ implements a program with a main entry. It also handles argument parsing for the emulator. An application that wants to use the virtual reader can replace vscclient.c -with it's own implementation that connects to it's own CCID reader. The calls +with its own implementation that connects to its own CCID reader. The calls that the CCID reader can call are: VReaderList * vreader_get_reader_list(); @@ -72,12 +72,12 @@ that the CCID reader can call are: VReader * vreader_list_get_reader(VReaderListEntry *) This function returns the reader stored in the reader List entry. Caller gets - a new reference to a reader. The caller must free it's reference when it is + a new reference to a reader. The caller must free its reference when it is finished with vreader_free(). void vreader_free(VReader *reader); - This function frees a reference to a reader. Reader's are reference counted + This function frees a reference to a reader. Readers are reference counted and are automatically deleted when the last reference is freed. void vreader_list_delete(VReaderList *list); @@ -87,7 +87,7 @@ that the CCID reader can call are: VReaderStatus vreader_power_on(VReader *reader, char *atr, int *len); - This functions simulates a card power on. Virtual cards do not care about + This function simulates a card power on. A virtual card does not care about the actual voltage and other physical parameters, but it does care that the card is actually on or off. Cycling the card causes the card to reset. If the caller provides enough space, vreader_power_on will return the ATR of @@ -104,7 +104,7 @@ that the CCID reader can call are: unsigned char *receive_buf, int receive_buf_len); - This functions send a raw apdu to a card and returns the card's response. + This function sends a raw apdu to a card and returns the card's response. The CCID front end should return the response back. Most of the emulation is driven from these APDUs. @@ -217,10 +217,10 @@ the card using the following functions: VCardStatus vcard_add_applet(VCard *card, VCardApplet *applet); Add an applet onto the list of applets attached to the card. Once an applet - has been added, it can be selected by it's aid, and then commands will be - routed to it VCardProcessAPDU function. This function adopts the applet the - passed int applet. Note: 2 applets with the same AID should not be added to - the same card. It's permissible to add more than one applet. Multiple applets + has been added, it can be selected by its AID, and then commands will be + routed to it VCardProcessAPDU function. This function adopts the applet that + is passed into it. Note: 2 applets with the same AID should not be added to + the same card. It is permissible to add more than one applet. Multiple applets may have the same VCardPRocessAPDU entry point. The certs and keys should be attached to private data associated with one or @@ -335,7 +335,7 @@ and applet. VCard7816Status vcard_emul_login(VCard *card, unsigned char *pin, in
[Qemu-devel] [PATCH] ui/spice-display.c: Fix compilation warnings on 32 bit hosts
Fix compilation failures ("cast from pointer to integer of different size [-Werror=pointer-to-int-cast]") by using uintptr_t instead. Signed-off-by: Peter Maydell --- NB: compile tested only but should be safe :-) ui/spice-display.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index ab266ae..35499e2 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -75,8 +75,8 @@ void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot, { if (async != QXL_SYNC) { spice_qxl_add_memslot_async(&ssd->qxl, memslot, -(uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, - QXL_IO_MEMSLOT_ADD_ASYNC)); +(uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, + QXL_IO_MEMSLOT_ADD_ASYNC)); } else { ssd->worker->add_memslot(ssd->worker, memslot); } @@ -93,8 +93,8 @@ void qemu_spice_create_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id, { if (async != QXL_SYNC) { spice_qxl_create_primary_surface_async(&ssd->qxl, id, surface, -(uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, - QXL_IO_CREATE_PRIMARY_ASYNC)); +(uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, + QXL_IO_CREATE_PRIMARY_ASYNC)); } else { ssd->worker->create_primary_surface(ssd->worker, id, surface); } @@ -106,8 +106,8 @@ void qemu_spice_destroy_primary_surface(SimpleSpiceDisplay *ssd, { if (async != QXL_SYNC) { spice_qxl_destroy_primary_surface_async(&ssd->qxl, id, -(uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, - QXL_IO_DESTROY_PRIMARY_ASYNC)); +(uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, + QXL_IO_DESTROY_PRIMARY_ASYNC)); } else { ssd->worker->destroy_primary_surface(ssd->worker, id); } -- 1.7.5.4
[Qemu-devel] [PATCH 07/20] usb-ehci: Any packet completion except for NAK should set the interrupt
From: Hans de Goede As clearly stated in the 2.3.2 of the EHCI spec, any time USBERRINT get sets then if the td has its IOC bit set USBINT should be set as well. This means that for any status except for USB_RET_NAK we should set USBINT if the IOC bit is set. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index d386b84..507e4a8 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -1360,7 +1360,7 @@ err: q->qh.token ^= QTD_TOKEN_DTOGGLE; q->qh.token &= ~QTD_TOKEN_ACTIVE; -if ((q->usb_status >= 0) && (q->qh.token & QTD_TOKEN_IOC)) { +if ((q->usb_status != USB_RET_NAK) && (q->qh.token & QTD_TOKEN_IOC)) { ehci_record_interrupt(q->ehci, USBSTS_INT); } } -- 1.7.1
Re: [Qemu-devel] Regression: more 0.12 regression (SeaBIOS related?)
On Tue, Mar 06, 2012 at 09:00:55AM -0800, Alain Ribière wrote: > Hello, > > I'm reacting a bit later but I have a trouble with an old DOS OS from Digital > Research called Concurrent DOS. > It worked fine till Qemu v0.11.1. > I tried it with a lot of versions from 0.12.0 to 1.0.1 and it boot correctly. > But after a key pressed, I can't use the keyboard any more. The system is not > freezed (there is a clock in the bottom side of the screen which is running) > but I can't use the keyboard any more. > It worked also with 0.12.0-rc1 and the PC-BIOS. It seems that with Seabios it > doesn't work any more but PC-BIOS is no longer supported by QEMU (from > v0.12.0). > > Do you know what can I do ? You can help debug the issue so it can be fixed in SeaBIOS. Start with producing a log from SeaBIOS by adding (on a recent qemu) the following to the command-line: -chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios Also, if there is an image available for download, other developers can take a look at it as well. -Kevin
Re: [Qemu-devel] [PATCH] ui/spice-display.c: Fix compilation warnings on 32 bit hosts
On Wed, Mar 07, 2012 at 01:36:48PM +, Peter Maydell wrote: > Fix compilation failures ("cast from pointer to integer of > different size [-Werror=pointer-to-int-cast]") by using > uintptr_t instead. > Looks good, Thanks. > Signed-off-by: Peter Maydell > --- > NB: compile tested only but should be safe :-) > > ui/spice-display.c | 12 ++-- > 1 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/ui/spice-display.c b/ui/spice-display.c > index ab266ae..35499e2 100644 > --- a/ui/spice-display.c > +++ b/ui/spice-display.c > @@ -75,8 +75,8 @@ void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, > QXLDevMemSlot *memslot, > { > if (async != QXL_SYNC) { > spice_qxl_add_memslot_async(&ssd->qxl, memslot, > -(uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, > - QXL_IO_MEMSLOT_ADD_ASYNC)); > +(uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, > + QXL_IO_MEMSLOT_ADD_ASYNC)); > } else { > ssd->worker->add_memslot(ssd->worker, memslot); > } > @@ -93,8 +93,8 @@ void qemu_spice_create_primary_surface(SimpleSpiceDisplay > *ssd, uint32_t id, > { > if (async != QXL_SYNC) { > spice_qxl_create_primary_surface_async(&ssd->qxl, id, surface, > -(uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, > - QXL_IO_CREATE_PRIMARY_ASYNC)); > +(uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, > + QXL_IO_CREATE_PRIMARY_ASYNC)); > } else { > ssd->worker->create_primary_surface(ssd->worker, id, surface); > } > @@ -106,8 +106,8 @@ void > qemu_spice_destroy_primary_surface(SimpleSpiceDisplay *ssd, > { > if (async != QXL_SYNC) { > spice_qxl_destroy_primary_surface_async(&ssd->qxl, id, > -(uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, > - QXL_IO_DESTROY_PRIMARY_ASYNC)); > +(uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, > + QXL_IO_DESTROY_PRIMARY_ASYNC)); > } else { > ssd->worker->destroy_primary_surface(ssd->worker, id); > } > -- > 1.7.5.4 > >
[Qemu-devel] [PULL 00/20] usb patch queue
Hi, Here comes the next usb update. It carries a bunch of ehci fixes and adds pipelining for usb packets. please pull, Gerd Gerd Hoffmann (7): uhci_fill_queue: zap debug printf usb: queue can have async packets usb: add pipelining option to usb endpoints usb-host: enable pipelineing for bulk endpoints. usb: add shortcut for control transfers xhci: fix control xfers xhci: fix port status Hans de Goede (13): usb-redir: Set ep type and interface usb-ehci: Never follow table entries with the T-bit set usb-ehci: split our qh queue into async and periodic queues usb-ehci: always call ehci_queues_rip_unused for period queues usb-ehci: Drop cached qhs when the doorbell gets rung usb-ehci: Rip the queues when the async or period schedule is halted usb-ehci: Any packet completion except for NAK should set the interrupt usb-ehci: Fix cerr tracking usb-ehci: Remove dead nakcnt code usb-ehci: Fix and simplify nakcnt handling usb-ehci: Cleanup itd error handling usb: return BABBLE rather then NAK when we receive too much data usb: add USB_RET_IOERROR hw/usb-ehci.c | 204 - hw/usb-ohci.c |2 + hw/usb-uhci.c |2 +- hw/usb-xhci.c | 15 ++--- hw/usb.c | 73 - hw/usb.h | 14 +++-- usb-linux.c | 15 - usb-redir.c | 21 +-- 8 files changed, 203 insertions(+), 143 deletions(-) The following changes since commit 27a9476cf75c4e147cb7d8c10c415928b3791b91: Merge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf (2012-03-05 18:55:11 +) are available in the git repository at: git://git.kraxel.org/qemu usb.42 Gerd Hoffmann (7): uhci_fill_queue: zap debug printf usb: queue can have async packets usb: add pipelining option to usb endpoints usb-host: enable pipelineing for bulk endpoints. usb: add shortcut for control transfers xhci: fix control xfers xhci: fix port status Hans de Goede (13): usb-redir: Set ep type and interface usb-ehci: Never follow table entries with the T-bit set usb-ehci: split our qh queue into async and periodic queues usb-ehci: always call ehci_queues_rip_unused for period queues usb-ehci: Drop cached qhs when the doorbell gets rung usb-ehci: Rip the queues when the async or period schedule is halted usb-ehci: Any packet completion except for NAK should set the interrupt usb-ehci: Fix cerr tracking usb-ehci: Remove dead nakcnt code usb-ehci: Fix and simplify nakcnt handling usb-ehci: Cleanup itd error handling usb: return BABBLE rather then NAK when we receive too much data usb: add USB_RET_IOERROR hw/usb-ehci.c | 204 - hw/usb-ohci.c |2 + hw/usb-uhci.c |2 +- hw/usb-xhci.c | 15 ++--- hw/usb.c | 73 - hw/usb.h | 14 +++-- usb-linux.c | 15 - usb-redir.c | 21 +-- 8 files changed, 203 insertions(+), 143 deletions(-)
[Qemu-devel] [PATCH 20/20] xhci: fix port status
Don't signal port status change if the usb device isn't in attached state. Happens with usb-host devices with the pass-through device being plugged out at the host. Signed-off-by: Gerd Hoffmann --- hw/usb-xhci.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/usb-xhci.c b/hw/usb-xhci.c index 8305489..e8f1b6e 100644 --- a/hw/usb-xhci.c +++ b/hw/usb-xhci.c @@ -2279,7 +2279,7 @@ static void xhci_update_port(XHCIState *xhci, XHCIPort *port, int is_detach) int nr = port->port.index + 1; port->portsc = PORTSC_PP; -if (port->port.dev && !is_detach) { +if (port->port.dev && port->port.dev->attached && !is_detach) { port->portsc |= PORTSC_CCS; switch (port->port.dev->speed) { case USB_SPEED_LOW: -- 1.7.1
[Qemu-devel] [PATCH 06/20] usb-ehci: Rip the queues when the async or period schedule is halted
From: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index b349003..d386b84 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -1076,7 +1076,8 @@ static void ehci_mem_writel(void *ptr, target_phys_addr_t addr, uint32_t val) if (!(val & USBCMD_RUNSTOP) && (s->usbcmd & USBCMD_RUNSTOP)) { qemu_del_timer(s->frame_timer); -// TODO - should finish out some stuff before setting halt +ehci_queues_rip_all(s, 0); +ehci_queues_rip_all(s, 1); ehci_set_usbsts(s, USBSTS_HALT); } @@ -2088,6 +2089,7 @@ static void ehci_advance_async_state(EHCIState *ehci) case EST_ACTIVE: if ( !(ehci->usbcmd & USBCMD_ASE)) { +ehci_queues_rip_all(ehci, async); ehci_clear_usbsts(ehci, USBSTS_ASS); ehci_set_state(ehci, async, EST_INACTIVE); break; @@ -2148,6 +2150,7 @@ static void ehci_advance_periodic_state(EHCIState *ehci) case EST_ACTIVE: if ( !(ehci->frindex & 7) && !(ehci->usbcmd & USBCMD_PSE)) { +ehci_queues_rip_all(ehci, async); ehci_clear_usbsts(ehci, USBSTS_PSS); ehci_set_state(ehci, async, EST_INACTIVE); break; -- 1.7.1
[Qemu-devel] Is qemu (version 1.0) support to emulate the CPU feture "x2APIC"?
Hi, I want to use qemu (version 1.0) to emulate guest systems with x2APIC enabled. But when I use qemu to emulate CPU's feture "x2APIC", I didn't find it in /proc/cpuinfo. And I saw the source code of qemu. I only find a single define (#define CPUID_EXE_X2APIC (1<<21) ) but no other places use this this define. Does this mean qemu now doesn't support to emulate the CPU's feture of "x2APIC"? Our host machine is running Debian 6, and the host system has x2APIC support. I use the following command to run qemu: qemu-system-x86_64 -nographic -cpu qemu64,+x2apic -serial mon:/dev/tty -hda ~/debian6.qcow2 After the guest (also Debian 6) boots up, I can't see x2apic in /proc/cpuinfo. Our host machine's CPU features: model name : Intel(R) Xeon(R) CPU E7- 4850 @ 2.00GHz flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt aes lahf_lm ida arat dts tpr_shadow vnmi flexpriority ept vpid The CPU feature from the guest emulated by QEMU: model name : QEMU Virtual CPU version 1.0,1 flags : fpu pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm up pni cx16 popcnt hypervisor lahf_lm svm abm sse4a
Re: [Qemu-devel] [PATCH] configure: ignore spice libraries on 32 bit.
On 7 March 2012 13:01, Alon Levy wrote: > > diff --git a/configure b/configure > index a5eb832..ecdfe9a 100755 > --- a/configure > +++ b/configure > @@ -2544,6 +2544,7 @@ EOF > spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) > spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) > if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \ > + $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \ > compile_prog "$spice_cflags" "$spice_libs" ; then > spice="yes" > libs_softmmu="$libs_softmmu $spice_libs" I've confirmed that this change (a) disables spice on the Oneiric system that was failing to compile and (b) doesn't disable spice on Precise. Could you submit it as a proper patch with a commit message and a signed-off-by line? Thanks -- PMM
[Qemu-devel] [PATCH 12/13] osdep: Remove local definition of macro offsetof
From: Stefan Weil The macro offsetof is defined in stddef.h. It is conforming to the standards C89, C99 and POSIX.1-2001 (see man page), so it is a sufficiently old standard. Therefore chances are very high that QEMU never needs a local definition of this macro. osdep.h already includes stddef.h, so this patch simply removes the unneeded code from the files configure and osdep.h. If we ever need the local definition again, it should be added to compiler.h (the macro is usually provided with the compiler, it is not OS specific). Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 14 -- osdep.h |3 --- 2 files changed, 0 insertions(+), 17 deletions(-) diff --git a/configure b/configure index e19b6e3..ed3d907 100755 --- a/configure +++ b/configure @@ -2524,17 +2524,6 @@ if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \ fi ## -# check if the compiler defines offsetof - -need_offsetof=yes -cat > $TMPC << EOF -#include -int main(void) { struct s { int f; }; return offsetof(struct s, f); } -EOF -if compile_prog "" "" ; then -need_offsetof=no -fi - # spice probe if test "$spice" != "no" ; then cat > $TMPC << EOF @@ -3199,9 +3188,6 @@ fi if test "$tcg_interpreter" = "yes" ; then echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak fi -if test "$need_offsetof" = "yes" ; then - echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak -fi if test "$fdatasync" = "yes" ; then echo "CONFIG_FDATASYNC=y" >> $config_host_mak fi diff --git a/osdep.h b/osdep.h index 432b91e..0350383 100644 --- a/osdep.h +++ b/osdep.h @@ -26,9 +26,6 @@ #define unlikely(x) __builtin_expect(!!(x), 0) #endif -#ifdef CONFIG_NEED_OFFSETOF -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER) -#endif #ifndef container_of #define container_of(ptr, type, member) ({ \ const typeof(((type *) 0)->member) *__mptr = (ptr); \ -- 1.7.9.1
[Qemu-devel] PC BIOS Flash emulation
Hi, I'm trying to emulate BIOS Flash chip (something Intel FWH compatible) on PC target (i386-softmmu) and to verify possibility of such emulation I first tried to use pflash_cfi02 example from PPC platform. Trying to use if following way: in hw/pc.c in pc_memory_init() after bios.bin is loaded and mapped to ISA space: cpu_register_physical_memory(0x10 - isa_bios_size, isa_bios_size, (bios_offset + bios_size - isa_bios_size) | IO_MEM_ROM); option_rom_offset = qemu_ram_alloc(NULL, "pc.rom", PC_ROM_SIZE); cpu_register_physical_memory(PC_ROM_MIN_VGA, PC_ROM_SIZE, option_rom_offset); /* map all the bios at the top of memory */ //cpu_register_physical_memory((uint32_t)(-bios_size), // bios_size, bios_offset | IO_MEM_ROM); Instead of mapping all the bios at the top of memory I'm using following piece of code to init pflash device and load bios into it: dinfo = drive_get(IF_PFLASH, 0, 0); if (dinfo) { bios_size = bdrv_getlength(dinfo->bdrv); bios_offset = qemu_ram_alloc(NULL, "fwh.bios", bios_size); fl_sectors = (bios_size + 65535) >> 16; printf("Register parallel flash %d size %lx" " at offset %08lx addr %lx '%s' %d\n", 0, bios_size, bios_offset, -bios_size, bdrv_get_device_name(dinfo->bdrv), fl_sectors); pflash_cfi02_register((uint32_t)(-bios_size), bios_offset, dinfo->bdrv, 65536, fl_sectors, 1, 2, 0x0020, 0x002E, 0x, 0x, 0x555, 0x2AA, 0); } On QEMU command line I'm passing -pflash flash.bin, where flash.bin is 2Mb in size with last 128Kb corresponding to bios.bin - thus replicating original bios top memory mapping. The problem is, that with pflash code, mapping to ISA space is lost! So when execution starts at address 0xFFF0 it correctly jumps to "ISA space" and there are only zeros. Here is example from qemu.log: 0xfff0: ljmp $0xf000,$0xe05b 0x000fe05b: add%al,(%bx,%si)<--- This essentially decoded zero 0x000fe05d: add%al,(%bx,%si) 0x000fe05f: add%al,(%bx,%si) Without pflash code, there is data in "ISA space" and in top of memory. Output from monitor (started with -nographic -S): QEMU 0.14.50 monitor - type 'help' for more information (qemu) x /16h 0xF 000f: 0x8b09 0x0119 0x01c3 0x8313 0x04c1 0xf981 0x4128 0x000e 000f0010: 0xef72 0xd689 0xdef7 0x28b9 0x0e41 0xeb00 0x8b09 0x0119 (qemu) x /16h 0x : 0x8b09 0x0119 0x01c3 0x8313 0x04c1 0xf981 0x4128 0x000e 0010: 0xef72 0xd689 0xdef7 0x28b9 0x0e41 0xeb00 0x8b09 0x0119 (qemu) QEMU: Terminated But if I add pflash initialization (started with -nographic -S -pflash flash.bin), ISA space contains only zeros, while top of memory still valid: QEMU 0.14.50 monitor - type 'help' for more information (qemu) x /16h 0xF 000f: 0x 0x 0x 0x 0x 0x 0x 0x 000f0010: 0x 0x 0x 0x 0x 0x 0x 0x (qemu) x /16h 0x : 0x8b09 0x0119 0x01c3 0x8313 0x04c1 0xf981 0x4128 0x000e 0010: 0xef72 0xd689 0xdef7 0x28b9 0x0e41 0xeb00 0x8b09 0x0119 (qemu) QEMU: Terminated May be some one already experimented with BIOS flash emulation, or could show me what I'm doing wrong? wbr, Dmitry.
[Qemu-devel] [PULL 00/13] Trivial patches for 25 February to 7 March 2012
The following changes since commit e32605062cd62c2a958ad28a6ad7de4eeab12027: xilinx_zynq: machine model initial version (2012-03-07 02:20:19 +0100) are available in the git repository at: git://github.com/stefanha/qemu.git trivial-patches for you to fetch changes up to 3b0e25e61d8e7a9f1557d4a2d9f67a7ef267993a: configure: Quote the configure args printed in config.log (2012-03-07 12:38:16 +) Peter Maydell (1): configure: Quote the configure args printed in config.log Stefan Weil (12): ppc: Add missing 'static' to spin_rw_ops sh7750: Remove redundant 'struct' from MemoryRegionOps qom: Fix spelling in documentation qmp: Fix spelling fourty -> forty block/vmdk: Fix warning from splint (comparision of unsigned value) Fix sign of sscanf format specifiers vnc: Fix packed boolean struct members libcacard: Use format specifier %u instead of %d for unsigned values vnc: Add break statement Spelling fixes in comments (it's -> its) libcacard: Spelling and grammar fixes in documentation osdep: Remove local definition of macro offsetof block/vmdk.c |2 +- configure | 20 cursor.c |3 ++- docs/libcacard.txt| 26 +- hw/exynos4210_mct.c |2 +- hw/ppce500_spin.c |2 +- hw/sh7750.c |2 +- hw/sh_intc.c |2 +- hw/usb-ccid.c |2 +- include/qemu/object.h |6 +++--- kvm-all.c |2 +- libcacard/vscclient.c | 22 +++--- linux-user/signal.c |2 +- osdep.h |3 --- qemu-file.h |2 +- target-mips/op_helper.c |2 +- test-qmp-output-visitor.c |4 ++-- ui/vnc-auth-sasl.h|4 ++-- ui/vnc-enc-hextile-template.h |1 + 19 files changed, 48 insertions(+), 61 deletions(-) -- 1.7.9.1
Re: [Qemu-devel] Is qemu (version 1.0) support to emulate the CPU feture "x2APIC"?
On Wed, Mar 07, 2012 at 09:54:28PM +0800, developer wang wrote: > Hi, > > I want to use qemu (version 1.0) to emulate guest systems with x2APIC > enabled. > > But when I use qemu to emulate CPU's feture "x2APIC", I didn't find > it in /proc/cpuinfo. > x2apic is supported only if kvm is used and only with in kernel irqchip emulation (which is still not default in qemu upstream IIRC). Try with qemu-kvm. > And I saw the source code of qemu. > > I only find a single define (#define CPUID_EXE_X2APIC (1<<21) ) > > but no other places use this this define. > > Does this mean qemu now doesn't support to emulate the CPU's feture > of "x2APIC"? > > > > Our host machine is running Debian 6, and the host system has x2APIC > support. > > I use the following command to run qemu: > > qemu-system-x86_64 -nographic -cpu qemu64,+x2apic -serial > mon:/dev/tty -hda ~/debian6.qcow2 > > After the guest (also Debian 6) boots up, I can't see x2apic in /proc/cpuinfo. > > Our host machine's CPU features: > > model name : Intel(R) Xeon(R) CPU E7- 4850 @ 2.00GHz > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr > pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe > syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts > rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 > monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 > x2apic popcnt aes lahf_lm ida arat dts tpr_shadow vnmi flexpriority > ept vpid > > The CPU feature from the guest emulated by QEMU: > > model name : QEMU Virtual CPU version 1.0,1 > flags : fpu pse tsc msr pae mce cx8 apic sep mtrr pge > mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm up pni cx16 > popcnt hypervisor lahf_lm svm abm sse4a -- Gleb.
[Qemu-devel] [PATCH 04/20] usb-ehci: always call ehci_queues_rip_unused for period queues
From: Hans de Goede Before this patch USB 2 devices with interrupt endpoints were not working properly. The problem is that to avoid loops we stop processing as soon as we encounter a queue-head (qh) we've already seen since qhs can be linked in a circular fashion, this is tracked by the seen flag in our qh struct. The resetting of the seen flag is done from ehci_queues_rip_unused which before this patch was only called when executing the statemachine for the async schedule. But packets for interrupt endpoints are part of the periodic schedule! So what would happen is that when there were no ctrl or bulk packets for a USB 2 device with an interrupt endpoint, the async schedule would become non active, then ehci_queues_rip_unused would no longer get called and when processing the qhs for the interrupt endpoints from the periodic schedule their seen bit would still be 1 and they would be skipped. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index 840022d..d384fcc 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -2167,6 +2167,7 @@ static void ehci_advance_periodic_state(EHCIState *ehci) ehci_set_fetch_addr(ehci, async,entry); ehci_set_state(ehci, async, EST_FETCHENTRY); ehci_advance_state(ehci, async); +ehci_queues_rip_unused(ehci, async); break; default: -- 1.7.1
[Qemu-devel] [PATCH 05/20] usb-ehci: Drop cached qhs when the doorbell gets rung
From: Hans de Goede The purpose of the IAAD bit / the doorbell is to make the ehci controller forget about cached qhs, this is mainly used when cancelling transactions, the qh is unlinked from the async schedule and then the doorbell gets rung, once the doorbell is acked by the controller the hcd knows that the qh is no longer in use and that it can do something else with the memory, such as re-use it for a new qh! But we keep our struct representing this qh around for circa 250 ms. This allows for a (mightily large) race window where the following could happen: -hcd submits a qh at address 0xdeadbeef -our ehci code sees the qh, sends a request to a usb-device, gets a result of USB_RET_ASYNC, sets the async_state of the qh to EHCI_ASYNC_INFLIGHT -hcd unlinks the qh at address 0xdeadbeef -hcd rings the doorbell, wait for us to ack it -hcd re-uses the qh at address 0xdeadbeef -our ehci code sees the qh, looks in the async_queue, sees there already is a qh at address 0xdeadbeef there with async_state of EHCI_ASYNC_INFLIGHT, does nothing -the *original* (which the hcd thinks it has cancelled) transaction finishes -our ehci code sees the qh on yet another pass through the async list, looks in the async_queue, sees there already is a qh at address 0xdeadbeef there with async_state of EHCI_ASYNC_COMPLETED, and finished the transaction with the results of the *original* transaction. Not good (tm), this patch fixes this race by removing all qhs which have not been seen during the last cycle through the async list immidiately when the doorbell is rung. Note this patch does not fix any actually observed problem, but upon reading of the EHCI spec it became apparent to me that the above race could happen and the usb-ehci behavior from before this patch is not good. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c | 33 + 1 files changed, 17 insertions(+), 16 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index d384fcc..b349003 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -697,7 +697,7 @@ static EHCIQueue *ehci_find_queue_by_qh(EHCIState *ehci, uint32_t addr, return NULL; } -static void ehci_queues_rip_unused(EHCIState *ehci, int async) +static void ehci_queues_rip_unused(EHCIState *ehci, int async, int flush) { EHCIQueueHead *head = async ? &ehci->aqueues : &ehci->pqueues; EHCIQueue *q, *tmp; @@ -708,7 +708,7 @@ static void ehci_queues_rip_unused(EHCIState *ehci, int async) q->ts = ehci->last_run_ns; continue; } -if (ehci->last_run_ns < q->ts + 25000) { +if (!flush && ehci->last_run_ns < q->ts + 25000) { /* allow 0.25 sec idle */ continue; } @@ -1537,7 +1537,7 @@ static int ehci_state_waitlisthead(EHCIState *ehci, int async) ehci_set_usbsts(ehci, USBSTS_REC); } -ehci_queues_rip_unused(ehci, async); +ehci_queues_rip_unused(ehci, async, 0); /* Find the head of the list (4.9.1.1) */ for(i = 0; i < MAX_QH; i++) { @@ -2093,18 +2093,7 @@ static void ehci_advance_async_state(EHCIState *ehci) break; } -/* If the doorbell is set, the guest wants to make a change to the - * schedule. The host controller needs to release cached data. - * (section 4.8.2) - */ -if (ehci->usbcmd & USBCMD_IAAD) { -DPRINTF("ASYNC: doorbell request acknowledged\n"); -ehci->usbcmd &= ~USBCMD_IAAD; -ehci_set_interrupt(ehci, USBSTS_IAA); -break; -} - -/* make sure guest has acknowledged */ +/* make sure guest has acknowledged the doorbell interrupt */ /* TO-DO: is this really needed? */ if (ehci->usbsts & USBSTS_IAA) { DPRINTF("IAA status bit still set.\n"); @@ -2118,6 +2107,18 @@ static void ehci_advance_async_state(EHCIState *ehci) ehci_set_state(ehci, async, EST_WAITLISTHEAD); ehci_advance_state(ehci, async); + +/* If the doorbell is set, the guest wants to make a change to the + * schedule. The host controller needs to release cached data. + * (section 4.8.2) + */ +if (ehci->usbcmd & USBCMD_IAAD) { +/* Remove all unseen qhs from the async qhs queue */ +ehci_queues_rip_unused(ehci, async, 1); +DPRINTF("ASYNC: doorbell request acknowledged\n"); +ehci->usbcmd &= ~USBCMD_IAAD; +ehci_set_interrupt(ehci, USBSTS_IAA); +} break; default: @@ -2167,7 +2168,7 @@ static void ehci_advance_periodic_state(EHCIState *ehci) ehci_set_fetch_addr(ehci, async,entry); ehci_set_state(ehci, async, EST_FETCHENTRY); ehci_advance_state(ehci, async); -ehci_queues_rip_unused(ehci, async); +ehci_queues_rip_unused(ehci, async, 0); break; default: -- 1.7.1
Re: [Qemu-devel] [PATCH v4 3/3] qom: Add QOM support to user emulators
On Sun, 4 Mar 2012 21:32:36 +0100 Andreas Färber wrote: > Link the Object base class and the module infrastructure for class > registration. Introduce $(universal-obj-y) for objects that are more > common than $(common-obj-y), so that those only get built once. > > Call QOM module init for type registration. > > Signed-off-by: Andreas Färber > Cc: Anthony Liguori Never looked how user emulators work in detail, but looks good to me.
[Qemu-devel] [PATCH 01/13] ppc: Add missing 'static' to spin_rw_ops
From: Stefan Weil spin_rw_ops is only used in hw/ppce500_spin.c. Cc: Alexander Graf Signed-off-by: Stefan Weil Acked-by: Andreas Färber Signed-off-by: Stefan Hajnoczi --- hw/ppce500_spin.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/ppce500_spin.c b/hw/ppce500_spin.c index 6b8a189..6ed676b 100644 --- a/hw/ppce500_spin.c +++ b/hw/ppce500_spin.c @@ -182,7 +182,7 @@ static uint64_t spin_read(void *opaque, target_phys_addr_t addr, unsigned len) } } -const MemoryRegionOps spin_rw_ops = { +static const MemoryRegionOps spin_rw_ops = { .read = spin_read, .write = spin_write, .endianness = DEVICE_BIG_ENDIAN, -- 1.7.9.1
[Qemu-devel] [PATCH 10/20] usb-ehci: Fix and simplify nakcnt handling
From: Hans de Goede The nakcnt code in ehci_execute_complete() marked transactions as finished when a packet completed with a result of USB_RET_NAK, but USB_RET_NAK means that the device cannot receive / send data at that time and that the transaction should be retried later, which is also what the usb-uhci and usb-ohci code does. Note that there already was some special code in place to handle this for interrupt endpoints in the form of doing a return from ehci_execute_complete() when reload == 0, but that for bulk transactions this was not handled correctly (where as for example the usb-ccid device does return USB_RET_NAK for bulk packets). Besides that the code in ehci_execute_complete() decrement nakcnt by 1 on a packet result of USB_RET_NAK, but -since the transaction got marked as finished, nakcnt would never be decremented again -there is no code checking for nakcnt becoming 0 -there is no use in re-trying the transaction within the same usb frame / usb-ehci frame-timer call, since the status of emulated devices won't change as long as the usb-ehci frame-timer is running So we should simply set the nakcnt to 0 when we get a USB_RET_NAK, thus claiming that we've tried reload times (or as many times as possible if reload is 0). Besides the code in ehci_execute_complete() handling USB_RET_NAK there was also code handling it in ehci_state_executing(), which calls ehci_execute_complete(), and then does its own handling on top of the handling in ehci_execute_complete(), this code would decrement nakcnt *again* (if not already 0), or restore the reload value (which was never changed) on success. Since the double decrement was wrong to begin with, and is no longer needed now that we set nakcnt directly to 0 on USB_RET_NAK, and the restore of reload is not needed either, this patch simply removes all nakcnt handling from ehci_state_executing(). Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c | 32 1 files changed, 4 insertions(+), 28 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index 07bcd1f..9197298 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -1291,8 +1291,6 @@ static void ehci_async_complete_packet(USBPort *port, USBPacket *packet) static void ehci_execute_complete(EHCIQueue *q) { -int reload; - assert(q->async != EHCI_ASYNC_INFLIGHT); q->async = EHCI_ASYNC_NONE; @@ -1311,16 +1309,8 @@ static void ehci_execute_complete(EHCIQueue *q) ehci_record_interrupt(q->ehci, USBSTS_ERRINT); break; case USB_RET_NAK: -/* 4.10.3 */ -reload = get_field(q->qh.epchar, QH_EPCHAR_RL); -if ((q->pid == USB_TOKEN_IN) && reload) { -int nakcnt = get_field(q->qh.altnext_qtd, QH_ALTNEXT_NAKCNT); -nakcnt--; -set_field(&q->qh.altnext_qtd, nakcnt, QH_ALTNEXT_NAKCNT); -} else if (!reload) { -return; -} -break; +set_field(&q->qh.altnext_qtd, 0, QH_ALTNEXT_NAKCNT); +return; /* We're not done yet with this transaction */ case USB_RET_BABBLE: q->qh.token |= (QTD_TOKEN_HALT | QTD_TOKEN_BABBLE); ehci_record_interrupt(q->ehci, USBSTS_ERRINT); @@ -1353,7 +1343,7 @@ static void ehci_execute_complete(EHCIQueue *q) q->qh.token ^= QTD_TOKEN_DTOGGLE; q->qh.token &= ~QTD_TOKEN_ACTIVE; -if ((q->usb_status != USB_RET_NAK) && (q->qh.token & QTD_TOKEN_IOC)) { +if (q->qh.token & QTD_TOKEN_IOC) { ehci_record_interrupt(q->ehci, USBSTS_INT); } } @@ -1877,7 +1867,6 @@ out: static int ehci_state_executing(EHCIQueue *q, int async) { int again = 0; -int reload, nakcnt; ehci_execute_complete(q); if (q->usb_status == USB_RET_ASYNC) { @@ -1897,21 +1886,8 @@ static int ehci_state_executing(EHCIQueue *q, int async) // counter decrements to 0 } -reload = get_field(q->qh.epchar, QH_EPCHAR_RL); -if (reload) { -nakcnt = get_field(q->qh.altnext_qtd, QH_ALTNEXT_NAKCNT); -if (q->usb_status == USB_RET_NAK) { -if (nakcnt) { -nakcnt--; -} -} else { -nakcnt = reload; -} -set_field(&q->qh.altnext_qtd, nakcnt, QH_ALTNEXT_NAKCNT); -} - /* 4.10.5 */ -if ((q->usb_status == USB_RET_NAK) || (q->qh.token & QTD_TOKEN_ACTIVE)) { +if (q->usb_status == USB_RET_NAK) { ehci_set_state(q->ehci, async, EST_HORIZONTALQH); } else { ehci_set_state(q->ehci, async, EST_WRITEBACK); -- 1.7.1
Re: [Qemu-devel] [libvirt] Qemu, libvirt, and CPU models
On Tue, Mar 06, 2012 at 03:27:53PM -0300, Eduardo Habkost wrote: > Hi, > > Sorry for the long message, but I didn't find a way to summarize the > questions and issues and make it shorter. > > For people who don't know me: I have started to work recently on the > Qemu CPU model code. I have been looking at how things work on > libvirt+Qemu today w.r.t. CPU models, and I have some points I would > like to understand better and see if they can be improved. > > I have two main points I would like to understand/discuss: > > 1) The relationship between libvirt's cpu_map.xml and the Qemu CPU model >definitions. We have several areas of code in which we use CPU definitions - Reporting the host CPU definition (virsh capabilities) - Calculating host CPU compatibility / baseline definitions - Checking guest / host CPU compatibility - Configuring the guest CPU definition libvirt targets multiple platforms, and our CPU handling code is designed to be common & sharable across all the libvirt drivers, VMWare, Xen, KVM, LXC, etc. Obviously for container based virt, only the host side of things is relevant. The libvirt CPU XML definition consists of - Model name - Vendor name - zero or more feature flags added/removed. A model name is basically just an alias for a bunch of feature flags, so that the CPU XML definitions are a) reasonably short b) have some sensible default baselines. The cpu_map.xml is the database of the CPU models that libvirt supports. We use this database to transform the CPU definition from the guest XML, into the hypervisor's own format. As luck would have it, the cpu_map.xml file contents match what QEMU has. This need not be the case though. If there is a model in the libvirt cpu_map.xml that QEMU doesn't know, we'll just pick the nearest matching QEMU cpu model & specify the fature flags to compensate. We could go one step further and just write out a cpu.conf file that we load in QEMU with -loadconfig. On Xen we would use the cpu_map.xml to generate the CPUID masks that Xen expects. Similarly for VMWare. > 2) How we could properly allow CPU models to be changed without breaking >existing virtual machines? What is the scope of changes expected to CPU models ? > 1) Qemu and cpu_map.xml > > I would like to understand how cpu_map.xml is supposed to be used, and > how it is supposed to interact with the CPU model definitions provided > by Qemu. More precisely: > > 1.1) Do we want to eliminate the duplication between the Qemu CPU > definitions and cpu_map.xml? It isn't possible for us to the libvirt cpu_map.xml, since we need that across all our hypervisor targets. > 1.1.1) If we want to eliminate the duplication, how can we accomplish > that? What interfaces you miss, that Qemu could provide? > > 1.1.2) If the duplication has a purpose and you want to keep > cpu_map.xml, then: > - First, I would like to understand why libvirt needs cpu_map.xml? Is > it part of the "public" interface of libvirt, or is it just an > internal file where libvirt stores non-user-visible data? > - How can we make sure there is no confusion between libvirt and Qemu > about the CPU models? For example, what if cpu_map.xml says model > 'Moo' has the flag 'foo' enabled, but Qemu disagrees? How do we > guarantee that libvirt gets exactly what it expects from Qemu when > it asks for a CPU model? We have "-cpu ?dump" today, but it's not > the better interface we could have. Do you miss something in special > in the Qemu<->libvirt interface, to help on that? > > 1.2) About the probing of available features on the host system: Qemu > has code specialized to query KVM about the available features, and to > check what can be enabled and what can't be enabled in a VM. On many > cases, the available features match exactly what is returned by the > CPUID instruction on the host system, but there are some > exceptions: > - Some features can be enabled even when the host CPU doesn't support > it (because they are completely emulated by KVM, e.g. x2apic). > - On many other cases, the feature may be available but we have to > check if Qemu+KVM are really able to expose it to the guest (many > features work this way, as many depend on specific support by the > KVM kernel module and/or Qemu). > > I suppose libvirt does want to check which flags can be enabled in a > VM, as it already have checks for host CPU features (e.g. > src/cpu/cpu_x86.c:x86Compute()). But I also suppose that libvirt > doesn't want to duplicate the KVM feature probing code present on > Qemu, and in this case we could have an interface where libvirt could > query for the actually-available CPU features. Would it be useful for > libvirt? What's the best way to expose this interface? > > 1.3) Some features are not plain CPU feature bits: e.g. level=X can be > set in "-cpu" argument, and other features are enabled/disabled by > exposing specific CPU
[Qemu-devel] [PATCH] spice: require spice-protocol >= 0.8.1
Requiring spice-server >= 0.8.2 is not enough since spice-server.pc doesn't require spice-protocol (any version). Until that is fixed upstream an explicit requirement in qemu fixes compilation broken since commit 2e1a98c9c1b90ca093278c6b43244dc46604d7b7 Author: Alon Levy Date: Fri Feb 24 23:19:30 2012 +0200 qxl: introduce QXLCookie Reported-by: Peter Maydell Signed-off-by: Alon Levy --- configure |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure b/configure index a5eb832..ecdfe9a 100755 --- a/configure +++ b/configure @@ -2544,6 +2544,7 @@ EOF spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \ + $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \ compile_prog "$spice_cflags" "$spice_libs" ; then spice="yes" libs_softmmu="$libs_softmmu $spice_libs" -- 1.7.9.1
[Qemu-devel] [PATCH 12/20] usb: return BABBLE rather then NAK when we receive too much data
From: Hans de Goede Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- usb-linux.c |8 +++- usb-redir.c |4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/usb-linux.c b/usb-linux.c index 47994f3..38df9e6 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -364,6 +364,10 @@ static void async_complete(void *opaque) p->result = USB_RET_STALL; break; +case -EOVERFLOW: +p->result = USB_RET_BABBLE; +break; + default: p->result = USB_RET_NAK; break; @@ -722,6 +726,8 @@ static int urb_status_to_usb_ret(int status) switch (status) { case -EPIPE: return USB_RET_STALL; +case -EOVERFLOW: +return USB_RET_BABBLE; default: return USB_RET_NAK; } @@ -759,7 +765,7 @@ static int usb_host_handle_iso_data(USBHostDevice *s, USBPacket *p, int in) } else if (aurb[i].urb.iso_frame_desc[j].actual_length > p->iov.size) { printf("husb: received iso data is larger then packet\n"); -len = USB_RET_NAK; +len = USB_RET_BABBLE; /* All good copy data over */ } else { len = aurb[i].urb.iso_frame_desc[j].actual_length; diff --git a/usb-redir.c b/usb-redir.c index a87de6e..c52311a 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -447,7 +447,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p, ERROR("received iso data is larger then packet ep %02X (%d > %d)\n", ep, len, (int)p->iov.size); bufp_free(dev, isop, ep); -return USB_RET_NAK; +return USB_RET_BABBLE; } usb_packet_copy(p, isop->data, len); bufp_free(dev, isop, ep); @@ -566,7 +566,7 @@ static int usbredir_handle_interrupt_data(USBRedirDevice *dev, if (len > p->iov.size) { ERROR("received int data is larger then packet ep %02X\n", ep); bufp_free(dev, intp, ep); -return USB_RET_NAK; +return USB_RET_BABBLE; } usb_packet_copy(p, intp->data, len); bufp_free(dev, intp, ep); -- 1.7.1
Re: [Qemu-devel] virtio-blk performance regression and qemu-kvm
On 03/07/12 09:04, Stefan Hajnoczi wrote: On Tue, Mar 6, 2012 at 10:07 PM, Reeted wrote: On 03/06/12 13:59, Stefan Hajnoczi wrote: BTW, I'll take the opportunity to say that 15.8 or 20.3 k IOPS are very low figures compared to what I'd instinctively expect from a paravirtualized block driver. There are now PCIe SSD cards that do 240 k IOPS (e.g. "OCZ RevoDrive 3 x2 max iops") which is 12-15 times higher, for something that has to go through a real driver and a real PCI-express bus, and can't use zero-copy techniques. The IOPS we can give to a VM is currently less than half that of a single SSD SATA drive (60 k IOPS or so, these days). That's why I consider this topic of virtio-blk performances very important. I hope there can be improvements in this sector... It depends on the benchmark configuration. virtio-blk is capable of doing 100,000s of iops, I've seen results. My guess is that you can do>100,000 read iops with virtio-blk on a good machine and stock qemu-kvm. It's very difficult to configure, then. I also did benchmarks in the past, and I can confirm Martin and Dongsu findings of about 15 k IOPS with: qemu-kvm 0.14.1, Intel Westmere CPU, virtio-blk (kernel 2.6.38 on the guest, 3.0 on the host), fio, 4k random *reads* from the Host page cache (backend LVM device was fully in cache on the Host), writeback setting, cache dropped on the guest prior to benchmark (and insufficient guest memory to cache a significant portion of the device). If you can teach us how to reach 100 k IOPS, I think everyone would be grateful :-)
Re: [Qemu-devel] Configuring QEMU to translate x86 instructions to native ARM instructions
Thank you both. The --CPU option worked like a charm. Roger On Mar 6, 2012, at 11:14 AM, Peter Maydell wrote: > On 6 March 2012 16:09, Roger wrote: >> I will try the --cross-prefix option. I have a feeling this >> will do it. I know that the prologue is being initialized with >> the i386 target backend > >> I'll also try the --cpu option recommended by the previous poster. > > Yes, this should force the host CPU detection correctly, but > really it ought to be able to autodetect it, at least in current > versions of QEMU. This might possibly have been broken in 0.15, > I suppose. > > -- PMM
[Qemu-devel] [PATCH 10/13] Spelling fixes in comments (it's -> its)
From: Stefan Weil * it's -> its (fixed for all files) * dont -> don't (only fixed in a line which was touched by the previous fix) * distrub -> disturb (fixed in the same line) Reviewed-by: Andreas Färber Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure |2 +- hw/exynos4210_mct.c |2 +- hw/usb-ccid.c |2 +- include/qemu/object.h |4 ++-- kvm-all.c |2 +- libcacard/vscclient.c |2 +- linux-user/signal.c |2 +- qemu-file.h |2 +- target-mips/op_helper.c |2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configure b/configure index a5eb832..e19b6e3 100755 --- a/configure +++ b/configure @@ -232,7 +232,7 @@ for opt do done # OS specific # Using uname is really, really broken. Once we have the right set of checks -# we can eliminate it's usage altogether +# we can eliminate its usage altogether. cc="${CC-${cross_prefix}gcc}" ar="${AR-${cross_prefix}ar}" diff --git a/hw/exynos4210_mct.c b/hw/exynos4210_mct.c index 01e3fb8..7474fcf 100644 --- a/hw/exynos4210_mct.c +++ b/hw/exynos4210_mct.c @@ -888,7 +888,7 @@ static void exynos4210_ltick_event(void *opaque) static uint64_t time2[2] = {0}; #endif -/* Call tick_timer event handler, it will update it's tcntb and icntb */ +/* Call tick_timer event handler, it will update its tcntb and icntb. */ exynos4210_ltick_timer_event(&s->tick_timer); /* get tick_timer cnt */ diff --git a/hw/usb-ccid.c b/hw/usb-ccid.c index ce01e34..ced687f 100644 --- a/hw/usb-ccid.c +++ b/hw/usb-ccid.c @@ -5,7 +5,7 @@ * * Written by Alon Levy, with contributions from Robert Relyea. * - * Based on usb-serial.c, see it's copyright and attributions below. + * Based on usb-serial.c, see its copyright and attributions below. * * This work is licensed under the terms of the GNU GPL, version 2.1 or later. * See the COPYING file in the top-level directory. diff --git a/include/qemu/object.h b/include/qemu/object.h index dd7f3c0..ec2d294 100644 --- a/include/qemu/object.h +++ b/include/qemu/object.h @@ -124,7 +124,7 @@ typedef struct InterfaceInfo InterfaceInfo; * * Once all of the parent classes have been initialized, #TypeInfo::class_init * is called to let the class being instantiated provide default initialize for - * it's virtual functions. Here is how the above example might be modified + * its virtual functions. Here is how the above example might be modified * to introduce an overridden virtual function: * * @@ -527,7 +527,7 @@ Type type_register_static(const TypeInfo *info); * type_register: * @info: The #TypeInfo of the new type * - * Unlike type_register_static(), this call does not require @info or it's + * Unlike type_register_static(), this call does not require @info or its * string members to continue to exist after the call returns. * * Returns: 0 on failure, the new #Type on success. diff --git a/kvm-all.c b/kvm-all.c index 77eadf6..549828a 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -35,7 +35,7 @@ #include #endif -/* KVM uses PAGE_SIZE in it's definition of COALESCED_MMIO_MAX */ +/* KVM uses PAGE_SIZE in its definition of COALESCED_MMIO_MAX */ #define PAGE_SIZE TARGET_PAGE_SIZE //#define DEBUG_KVM diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c index 0adae13..b64c93d 100644 --- a/libcacard/vscclient.c +++ b/libcacard/vscclient.c @@ -129,7 +129,7 @@ event_thread(void *arg) vevent_delete(event); continue; } -/* this reader hasn't been told it's status from qemu yet, wait for +/* this reader hasn't been told its status from qemu yet, wait for * that status */ while (pending_reader != NULL) { qemu_cond_wait(&pending_reader_condition, &pending_reader_lock); diff --git a/linux-user/signal.c b/linux-user/signal.c index 79a39dc..cefd2ff 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -2700,7 +2700,7 @@ get_sigframe(struct target_sigaction *ka, CPUState *regs, size_t frame_size) sp = regs->active_tc.gpr[29]; /* - * FPU emulator may have it's own trampoline active just + * FPU emulator may have its own trampoline active just * above the user stack, 16-bytes before the next lowest * 16 byte boundary. Try to avoid trashing it. */ diff --git a/qemu-file.h b/qemu-file.h index 8da1021..31b83f6 100644 --- a/qemu-file.h +++ b/qemu-file.h @@ -47,7 +47,7 @@ typedef int (QEMUFileGetBufferFunc)(void *opaque, uint8_t *buf, */ typedef int (QEMUFileCloseFunc)(void *opaque); -/* Called to determine if the file has exceeded it's bandwidth allocation. The +/* Called to determine if the file has exceeded its bandwidth allocation. The * bandwidth capping is a soft limit, not a hard limit. */ typedef int (QEMUFileRateLimit)(void *opaque); diff --git a/target-mips/op_helper.c b/target-mips/op_helpe
[Qemu-devel] Re : Regression: more 0.12 regression (SeaBIOS related?)
I ran qemu 1.0.1 and the latest SeaBIOS (from the git) with the following options : qemu-system-i386 -L git/bios -fda disk.img -no-fd-bootchk -boot a -m 16 Here is the log : https://docs.google.com/open?id=0B7mz0vq6Rpb7UE1ibjJDcEhTRWlNV050QnMyMWwtZw Here is the floppy disk image I used : https://docs.google.com/open?id=0B7mz0vq6Rpb7bHpYaEt2SnVUUi1KaWE3a3lBQUJpQQ The floppy disk is simply a C-DOS 720 Ko floppy created by "format a: /s". So it's quite empty. Qemu doesn't crash or freeze. But I can just type a single character and the nothing else. But the system is still running (there is a clock at the bottom right of the screen). Thanks, Alain De : Kevin O'Connor À : Alain Ribière Cc : "qemu-devel@nongnu.org" ; seab...@seabios.org Envoyé le : Mercredi 7 mars 2012 14h38 Objet : Re: [Qemu-devel] Regression: more 0.12 regression (SeaBIOS related?) On Tue, Mar 06, 2012 at 09:00:55AM -0800, Alain Ribière wrote: > Hello, > > I'm reacting a bit later but I have a trouble with an old DOS OS from Digital > Research called Concurrent DOS. > It worked fine till Qemu v0.11.1. > I tried it with a lot of versions from 0.12.0 to 1.0.1 and it boot correctly. > But after a key pressed, I can't use the keyboard any more. The system is not > freezed (there is a clock in the bottom side of the screen which is running) > but I can't use the keyboard any more. > It worked also with 0.12.0-rc1 and the PC-BIOS. It seems that with Seabios it > doesn't work any more but PC-BIOS is no longer supported by QEMU (from > v0.12.0). > > Do you know what can I do ? You can help debug the issue so it can be fixed in SeaBIOS. Start with producing a log from SeaBIOS by adding (on a recent qemu) the following to the command-line: -chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios Also, if there is an image available for download, other developers can take a look at it as well. -Kevin
Re: [Qemu-devel] virtio-blk performance regression and qemu-kvm
On Wed, Mar 7, 2012 at 2:21 PM, Reeted wrote: > On 03/07/12 09:04, Stefan Hajnoczi wrote: >> >> On Tue, Mar 6, 2012 at 10:07 PM, Reeted wrote: >>> >>> On 03/06/12 13:59, Stefan Hajnoczi wrote: BTW, I'll take the opportunity to say that 15.8 or 20.3 k IOPS are very low figures compared to what I'd instinctively expect from a paravirtualized block driver. There are now PCIe SSD cards that do 240 k IOPS (e.g. "OCZ RevoDrive 3 x2 max iops") which is 12-15 times higher, for something that has to go through a real driver and a real PCI-express bus, and can't use zero-copy techniques. The IOPS we can give to a VM is currently less than half that of a single SSD SATA drive (60 k IOPS or so, these days). That's why I consider this topic of virtio-blk performances very important. I hope there can be improvements in this sector... >> >> It depends on the benchmark configuration. virtio-blk is capable of >> doing 100,000s of iops, I've seen results. My guess is that you can >> do>100,000 read iops with virtio-blk on a good machine and stock >> qemu-kvm. > > > It's very difficult to configure, then. > I also did benchmarks in the past, and I can confirm Martin and Dongsu > findings of about 15 k IOPS with: > qemu-kvm 0.14.1, Intel Westmere CPU, virtio-blk (kernel 2.6.38 on the guest, > 3.0 on the host), fio, 4k random *reads* from the Host page cache (backend > LVM device was fully in cache on the Host), writeback setting, cache dropped > on the guest prior to benchmark (and insufficient guest memory to cache a > significant portion of the device). > If you can teach us how to reach 100 k IOPS, I think everyone would be > grateful :-) Sorry for being vague, I don't have the details. I have CCed Khoa, who might have time to describe a >100,000 iops virtio-blk configuration. Stefan
[Qemu-devel] [PATCH 19/20] xhci: fix control xfers
Use the new, direct control transfer submission method instead of bypassing the usb core by calling usb_device_handle_control directly. The later fails for async control transfers. This patch gets xhci + usb-host combo going. --- hw/usb-xhci.c | 13 + 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/usb-xhci.c b/hw/usb-xhci.c index fc5b542..8305489 100644 --- a/hw/usb-xhci.c +++ b/hw/usb-xhci.c @@ -1470,8 +1470,8 @@ static USBDevice *xhci_find_device(XHCIPort *port, uint8_t addr) static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer) { XHCITRB *trb_setup, *trb_status; -uint8_t bmRequestType, bRequest; -uint16_t wValue, wLength, wIndex; +uint8_t bmRequestType; +uint16_t wLength; XHCIPort *port; USBDevice *dev; int ret; @@ -1508,9 +1508,6 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer) } bmRequestType = trb_setup->parameter; -bRequest = trb_setup->parameter >> 8; -wValue = trb_setup->parameter >> 16; -wIndex = trb_setup->parameter >> 32; wLength = trb_setup->parameter >> 48; if (xfer->data && xfer->data_alloced < wLength) { @@ -1537,12 +1534,12 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer) xfer->iso_xfer = false; xhci_setup_packet(xfer, dev); +xfer->packet.parameter = trb_setup->parameter; if (!xfer->in_xfer) { xhci_xfer_data(xfer, xfer->data, wLength, 0, 1, 0); } -ret = usb_device_handle_control(dev, &xfer->packet, -(bmRequestType << 8) | bRequest, -wValue, wIndex, wLength, xfer->data); + +ret = usb_handle_packet(dev, &xfer->packet); xhci_complete_packet(xfer, ret); if (!xfer->running_async && !xfer->running_retry) { -- 1.7.1
[Qemu-devel] [PATCH 06/13] Fix sign of sscanf format specifiers
From: Stefan Weil All values read by sscanf are unsigned, so replace %d by %u. This signed / unsigned mismatch was detected by splint. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- cursor.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/cursor.c b/cursor.c index efc5917..76e262c 100644 --- a/cursor.c +++ b/cursor.c @@ -15,7 +15,8 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[]) uint8_t idx; /* parse header line: width, height, #colors, #chars */ -if (sscanf(xpm[line], "%d %d %d %d", &width, &height, &colors, &chars) != 4) { +if (sscanf(xpm[line], "%u %u %u %u", + &width, &height, &colors, &chars) != 4) { fprintf(stderr, "%s: header parse error: \"%s\"\n", __FUNCTION__, xpm[line]); return NULL; -- 1.7.9.1
[Qemu-devel] [PATCH 14/20] uhci_fill_queue: zap debug printf
--- hw/usb-uhci.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c index 2c6ed38..304b84b 100644 --- a/hw/usb-uhci.c +++ b/hw/usb-uhci.c @@ -951,7 +951,6 @@ static void uhci_fill_queue(UHCIState *s, UHCI_TD *td) UHCI_TD ptd; int ret; -fprintf(stderr, "%s: -- %x\n", __func__, token); while (is_valid(plink)) { pci_dma_read(&s->dev, plink & ~0xf, &ptd, sizeof(ptd)); le32_to_cpus(&ptd.link); -- 1.7.1
[Qemu-devel] [PATCH 16/20] usb: add pipelining option to usb endpoints
With this patch applied USB drivers can enable pipelining per endpoint. With pipelining enabled the usb core will continue submitting packets even when there are still async transfers in flight instead of passing them on one by one. Signed-off-by: Gerd Hoffmann --- hw/usb.c | 11 ++- hw/usb.h |2 ++ 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/hw/usb.c b/hw/usb.c index fc41d62..800d912 100644 --- a/hw/usb.c +++ b/hw/usb.c @@ -323,7 +323,7 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p) assert(p->state == USB_PACKET_SETUP); assert(p->ep != NULL); -if (QTAILQ_EMPTY(&p->ep->queue)) { +if (QTAILQ_EMPTY(&p->ep->queue) || p->ep->pipeline) { ret = usb_process_one(p); if (ret == USB_RET_ASYNC) { usb_packet_set_state(p, USB_PACKET_ASYNC); @@ -468,6 +468,7 @@ void usb_ep_init(USBDevice *dev) dev->ep_ctl.type = USB_ENDPOINT_XFER_CONTROL; dev->ep_ctl.ifnum = 0; dev->ep_ctl.dev = dev; +dev->ep_ctl.pipeline = false; QTAILQ_INIT(&dev->ep_ctl.queue); for (ep = 0; ep < USB_MAX_ENDPOINTS; ep++) { dev->ep_in[ep].nr = ep + 1; @@ -480,6 +481,8 @@ void usb_ep_init(USBDevice *dev) dev->ep_out[ep].ifnum = 0; dev->ep_in[ep].dev = dev; dev->ep_out[ep].dev = dev; +dev->ep_in[ep].pipeline = false; +dev->ep_out[ep].pipeline = false; QTAILQ_INIT(&dev->ep_in[ep].queue); QTAILQ_INIT(&dev->ep_out[ep].queue); } @@ -593,3 +596,9 @@ int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep) struct USBEndpoint *uep = usb_ep_get(dev, pid, ep); return uep->max_packet_size; } + +void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled) +{ +struct USBEndpoint *uep = usb_ep_get(dev, pid, ep); +uep->pipeline = enabled; +} diff --git a/hw/usb.h b/hw/usb.h index 1a30ebb..f6df0ad 100644 --- a/hw/usb.h +++ b/hw/usb.h @@ -177,6 +177,7 @@ struct USBEndpoint { uint8_t type; uint8_t ifnum; int max_packet_size; +bool pipeline; USBDevice *dev; QTAILQ_HEAD(, USBPacket) queue; }; @@ -364,6 +365,7 @@ void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum); void usb_ep_set_max_packet_size(USBDevice *dev, int pid, int ep, uint16_t raw); int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep); +void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled); void usb_attach(USBPort *port); void usb_detach(USBPort *port); -- 1.7.1
[Qemu-devel] [PATCH 08/20] usb-ehci: Fix cerr tracking
From: Hans de Goede cerr should only be decremented on errors which cause XactErr to be set, and when that happens the failing transaction should be retried until cerr reaches 0 and only then should USBSTS_ERRINT be set (and inactive cleared and USBSTS_INT set if requested). Since we don't have any hardware level errors (and in case of redirection the real hardware has already retried), re-trying makes no sense, so immediately set cerr to 0 on errors which set XactErr. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c | 19 ++- 1 files changed, 6 insertions(+), 13 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index 507e4a8..2685adc 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -1291,7 +1291,7 @@ static void ehci_async_complete_packet(USBPort *port, USBPacket *packet) static void ehci_execute_complete(EHCIQueue *q) { -int c_err, reload; +int reload; assert(q->async != EHCI_ASYNC_INFLIGHT); q->async = EHCI_ASYNC_NONE; @@ -1300,15 +1300,10 @@ static void ehci_execute_complete(EHCIQueue *q) q->qhaddr, q->qh.next, q->qtdaddr, q->usb_status); if (q->usb_status < 0) { -err: -/* TO-DO: put this is in a function that can be invoked below as well */ -c_err = get_field(q->qh.token, QTD_TOKEN_CERR); -c_err--; -set_field(&q->qh.token, c_err, QTD_TOKEN_CERR); - switch(q->usb_status) { case USB_RET_NODEV: q->qh.token |= (QTD_TOKEN_HALT | QTD_TOKEN_XACTERR); +set_field(&q->qh.token, 0, QTD_TOKEN_CERR); ehci_record_interrupt(q->ehci, USBSTS_ERRINT); break; case USB_RET_STALL: @@ -1336,15 +1331,13 @@ err: assert(0); break; } +} else if ((q->usb_status > q->tbytes) && (q->pid == USB_TOKEN_IN)) { +q->usb_status = USB_RET_BABBLE; +q->qh.token |= (QTD_TOKEN_HALT | QTD_TOKEN_BABBLE); +ehci_record_interrupt(q->ehci, USBSTS_ERRINT); } else { -// DPRINTF("Short packet condition\n"); // TODO check 4.12 for splits -if ((q->usb_status > q->tbytes) && (q->pid == USB_TOKEN_IN)) { -q->usb_status = USB_RET_BABBLE; -goto err; -} - if (q->tbytes && q->pid == USB_TOKEN_IN) { q->tbytes -= q->usb_status; } else { -- 1.7.1
[Qemu-devel] [PATCH 02/13] sh7750: Remove redundant 'struct' from MemoryRegionOps
From: Stefan Weil The 'struct' is not needed, and all other MemoryRegionOps don't use it. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- hw/sh7750.c |2 +- hw/sh_intc.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sh7750.c b/hw/sh7750.c index 4f4d8e7..e712928 100644 --- a/hw/sh7750.c +++ b/hw/sh7750.c @@ -712,7 +712,7 @@ static void sh7750_mmct_write(void *opaque, target_phys_addr_t addr, } } -static const struct MemoryRegionOps sh7750_mmct_ops = { +static const MemoryRegionOps sh7750_mmct_ops = { .read = sh7750_mmct_read, .write = sh7750_mmct_write, .endianness = DEVICE_NATIVE_ENDIAN, diff --git a/hw/sh_intc.c b/hw/sh_intc.c index b24ec77..7d31ced 100644 --- a/hw/sh_intc.c +++ b/hw/sh_intc.c @@ -283,7 +283,7 @@ static void sh_intc_write(void *opaque, target_phys_addr_t offset, #endif } -static const struct MemoryRegionOps sh_intc_ops = { +static const MemoryRegionOps sh_intc_ops = { .read = sh_intc_read, .write = sh_intc_write, .endianness = DEVICE_NATIVE_ENDIAN, -- 1.7.9.1
[Qemu-devel] [PATCH 13/20] usb: add USB_RET_IOERROR
From: Hans de Goede We already have USB_RET_NAK, but that means that a device does not want to send/receive right now. But with host / network redirection we can actually have a transaction fail due to some io error, rather then ie the device just not having any data atm. This patch adds a new error code named USB_RET_IOERROR for this, and uses it were appropriate. Notes: -Currently all usb-controllers handle this the same as NODEV, but that may change in the future, OHCI could indicate a CRC error instead for example. -This patch does not touch hw/usb-musb.c, that is because the code in there handles STALL and NAK specially and has a if status < 0 generic catch all for all other errors Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-ehci.c |2 ++ hw/usb-ohci.c |2 ++ hw/usb-uhci.c |1 + hw/usb.h | 11 ++- usb-linux.c |4 ++-- usb-redir.c |9 ++--- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index 825fcc0..df742f7 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -1299,6 +1299,7 @@ static void ehci_execute_complete(EHCIQueue *q) if (q->usb_status < 0) { switch(q->usb_status) { +case USB_RET_IOERROR: case USB_RET_NODEV: q->qh.token |= (QTD_TOKEN_HALT | QTD_TOKEN_XACTERR); set_field(&q->qh.token, 0, QTD_TOKEN_CERR); @@ -1471,6 +1472,7 @@ static int ehci_process_itd(EHCIState *ehci, default: fprintf(stderr, "Unexpected iso usb result: %d\n", ret); /* Fall through */ +case USB_RET_IOERROR: case USB_RET_NODEV: /* 3.3.2: XACTERR is only allowed on IN transactions */ if (dir) { diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c index 7aa19fe..20aaa74 100644 --- a/hw/usb-ohci.c +++ b/hw/usb-ohci.c @@ -837,6 +837,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed, OHCI_CC_DATAUNDERRUN); } else { switch (ret) { +case USB_RET_IOERROR: case USB_RET_NODEV: OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC, OHCI_CC_DEVICENOTRESPONDING); @@ -1052,6 +1053,7 @@ static int ohci_service_td(OHCIState *ohci, struct ohci_ed *ed) OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_DATAUNDERRUN); } else { switch (ret) { +case USB_RET_IOERROR: case USB_RET_NODEV: OHCI_SET_BM(td.flags, TD_CC, OHCI_CC_DEVICENOTRESPONDING); case USB_RET_NAK: diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c index 70e3881..2c6ed38 100644 --- a/hw/usb-uhci.c +++ b/hw/usb-uhci.c @@ -765,6 +765,7 @@ out: break; return 1; +case USB_RET_IOERROR: case USB_RET_NODEV: default: break; diff --git a/hw/usb.h b/hw/usb.h index 8e83697..1a30ebb 100644 --- a/hw/usb.h +++ b/hw/usb.h @@ -39,11 +39,12 @@ #define USB_TOKEN_IN0x69 /* device -> host */ #define USB_TOKEN_OUT 0xe1 /* host -> device */ -#define USB_RET_NODEV (-1) -#define USB_RET_NAK(-2) -#define USB_RET_STALL (-3) -#define USB_RET_BABBLE (-4) -#define USB_RET_ASYNC (-5) +#define USB_RET_NODEV (-1) +#define USB_RET_NAK (-2) +#define USB_RET_STALL (-3) +#define USB_RET_BABBLE (-4) +#define USB_RET_IOERROR (-5) +#define USB_RET_ASYNC (-6) #define USB_SPEED_LOW 0 #define USB_SPEED_FULL 1 diff --git a/usb-linux.c b/usb-linux.c index 38df9e6..050ea7a 100644 --- a/usb-linux.c +++ b/usb-linux.c @@ -369,7 +369,7 @@ static void async_complete(void *opaque) break; default: -p->result = USB_RET_NAK; +p->result = USB_RET_IOERROR; break; } @@ -729,7 +729,7 @@ static int urb_status_to_usb_ret(int status) case -EOVERFLOW: return USB_RET_BABBLE; default: -return USB_RET_NAK; +return USB_RET_IOERROR; } } diff --git a/usb-redir.c b/usb-redir.c index c52311a..8e9f175 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -431,7 +431,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p, /* Check iso_error for stream errors, otherwise its an underrun */ status = dev->endpoint[EP2I(ep)].iso_error; dev->endpoint[EP2I(ep)].iso_error = 0; -return status ? USB_RET_NAK : 0; +return status ? USB_RET_IOERROR : 0; } DPRINTF2("iso-token-in ep %02X status %d len %d queue-size: %d\n", ep, isop->status, isop->len, dev->endpoint[EP2I(ep)].bufpq_size); @@ -439,7 +439,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p, status = isop->status; if (status != usb_redir_success) { bufp_free(dev, isop, ep); -return USB_RET_NAK; +
Re: [Qemu-devel] XP install cores with SCSI LSI 53C895A disks
On Wed, 07 Mar 2012 00:41:39 -0600, Gerhard Wiesinger wrote: Ping. Any comments? Thnx. Ciao, Gerhard -- http://www.wiesinger.com/ On Sun, 4 Mar 2012, Gerhard Wiesinger wrote: Hello, Clean XP install cores with SCSI LSI 53C89A disk when copying files. Reproduceable. Driver used is sym_hi. Details are below. I think most people trying to use qemu for anything useful have given up on if=scsi. Some distros even disable support because they don't want to QA it. That should be a decent sign that you may want to avoid it. Tried also old versions 1.0, 0.15.1, cores too. Any ideas? Thnx. Ciao, Gerhard -- http://www.wiesinger.com/ Image created with: qemu-img create -f qcow2 XP-TEST.qcow2 10G Command line: Version: git b5ed4b6f6f0d31e0d8210f4b444ba67bfa5d6de2 /root/download/qemu/git/qemu-kvm/x86_64-softmmu/qemu-system-x86_64 -drive file=VM-XP-TEST/XP-TEST.qcow2,media=disk,if=scsi,bus=0,unit=0 -cdrom ISO/XP.iso -boot order=cad,menu=on -m 2048 -k de -vga vmware -vnc :0 -bios /root/download/seabios/git/seabios/out/bios.bin -chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios -option-rom BIOS/V4.19/8xx_64.rom -device pcnet,mac=1a:46:0b:ca:bc:7e,vlan=1,romfile= -net tap,ifname=tap1,script=no,downscript=no,vlan=1 #0 0x7f66a29e5117 in malloc_consolidate.part.3 () from /lib64/libc.so.6 #1 0x7f66a29e5e99 in _int_free () from /lib64/libc.so.6 #2 0x7f66a64a1444 in scsi_req_unref (req=0x7f66a9791f70) at /root/download/qemu/git/qemu-kvm/hw/scsi-bus.c:1272 #3 scsi_req_unref (req=0x7f66a9791f70) at /root/download/qemu/git/qemu-kvm/hw/scsi-bus.c:1268 #4 0x7f66a64a2445 in scsi_device_purge_requests (sdev=0x7f66a9616160, sense=...) at /root/download/qemu/git/qemu-kvm/hw/scsi-bus.c:1421 #5 0x7f66a64a2d27 in scsi_disk_reset (dev=0x7f66a9616160) at /root/download/qemu/git/qemu-kvm/hw/scsi-disk.c:1498 #6 0x7f66a643dd60 in lsi_reg_writeb (s=0x7f66a95fa140, offset=, val=)at /root/download/qemu/git/qemu-kvm/hw/lsi53c895a.c:1684 #7 0x7f66a65187a0 in access_with_adjusted_size (addr=1, value=0x7f669f3ecbb0, size=1, access_size_min=, access_size_max=, access=0x7f66a65186c0 , opaque=0x7f66a95fa5a8)at /root/download/qemu/git/qemu-kvm/memory.c:304 #8 0x7f66a651d1a0 in memory_region_dispatch_write (size=1, data=8, addr=1, mr=0x7f66a95fa5a8) at /root/download/qemu/git/qemu-kvm/memory.c:982 #9 io_mem_write (io_index=, addr=1, val=out>, size=1) at /root/download/qemu/git/qemu-kvm/memory.c:1564 #10 0x7f66a65187a0 in access_with_adjusted_size (addr=1, value=0x7f669f3ecc60, size=1, access_size_min=, access_size_max=, access=0x7f66a65186c0 , opaque=0x7f669801bae0)at /root/download/qemu/git/qemu-kvm/memory.c:304 #11 0x7f66a651d1a0 in memory_region_dispatch_write (size=1, data=8, addr=1, mr=0x7f669801bae0) at /root/download/qemu/git/qemu-kvm/memory.c:982 #12 io_mem_write (io_index=, addr=1, val=out>, size=1) at /root/download/qemu/git/qemu-kvm/memory.c:1564 #13 0x7f66a64efe58 in cpu_physical_memory_rw (addr=4273938433, buf=0x7f66a6319028 , len=1, is_write=1) at /root/download/qemu/git/qemu-kvm/exec.c:3594 #14 0x7f66a650d195 in kvm_cpu_exec (env=0x7f66a8d52900) at /root/download/qemu/git/qemu-kvm/kvm-all.c:1192 #15 0x7f66a64e3201 in qemu_kvm_cpu_thread_fn (arg=0x7f66a8d52900) at /root/download/qemu/git/qemu-kvm/cpus.c:732 #16 0x7f66a47bbd90 in start_thread () from /lib64/libpthread.so.0 #17 0x7f66a2a57f5d in clone () from /lib64/libc.so.6 (gdb) back #0 0x7f66efb81285 in raise () from /lib64/libc.so.6 #1 0x7f66efb82b9b in abort () from /lib64/libc.so.6 #2 0x7f66efbc2a7e in __libc_message () from /lib64/libc.so.6 #3 0x7f66efbc8da6 in malloc_printerr () from /lib64/libc.so.6 #4 0x7f66efbc9279 in malloc_consolidate.part.3 () from /lib64/libc.so.6 #5 0x7f66efbc9e99 in _int_free () from /lib64/libc.so.6 #6 0x7f66f3685444 in scsi_req_unref (req=0x7f66f6db1bc0) at /root/download/qemu/git/qemu-kvm/hw/scsi-bus.c:1272 #7 scsi_req_unref (req=0x7f66f6db1bc0) at /root/download/qemu/git/qemu-kvm/hw/scsi-bus.c:1268 #8 0x7f66f3686445 in scsi_device_purge_requests (sdev=0x7f66f6b8e160, sense=...) at /root/download/qemu/git/qemu-kvm/hw/scsi-bus.c:1421 #9 0x7f66f3686d27 in scsi_disk_reset (dev=0x7f66f6b8e160) at /root/download/qemu/git/qemu-kvm/hw/scsi-disk.c:1498 #10 0x7f66f3621d60 in lsi_reg_writeb (s=0x7f66f6b72140, offset=, val=)at /root/download/qemu/git/qemu-kvm/hw/lsi53c895a.c:1684 #11 0x7f66f36fc7a0 in access_with_adjusted_size (addr=1, value=0x7f66ec5d0bb0, size=1, access_size_min=, acces
Re: [Qemu-devel] [RFC][PATCH 05/16 v8] Add API to get memory mapping
From: Wen Congyang Subject: [RFC][PATCH 05/16 v8] Add API to get memory mapping Date: Fri, 02 Mar 2012 18:18:23 +0800 > Add API to get all virtual address and physical address mapping. > If there is no virtual address for some physical address, the virtual > address is 0. > > Signed-off-by: Wen Congyang > --- > memory_mapping.c | 88 > ++ > memory_mapping.h |8 + > 2 files changed, 96 insertions(+), 0 deletions(-) > > diff --git a/memory_mapping.c b/memory_mapping.c > index 718f271..f74c5d0 100644 > --- a/memory_mapping.c > +++ b/memory_mapping.c > @@ -164,3 +164,91 @@ void memory_mapping_list_init(MemoryMappingList *list) > list->last_mapping = NULL; > QTAILQ_INIT(&list->head); > } > + > +int qemu_get_guest_memory_mapping(MemoryMappingList *list) > +{ > +CPUState *env; > +MemoryMapping *memory_mapping; > +RAMBlock *block; > +ram_addr_t offset, length, m_length; > +target_phys_addr_t m_phys_addr; > +int ret; > +bool paging_mode; > + > +#if defined(CONFIG_HAVE_GET_MEMORY_MAPPING) > +paging_mode = cpu_paging_enabled(first_cpu); > +if (paging_mode) { > +for (env = first_cpu; env != NULL; env = env->next_cpu) { > +ret = cpu_get_memory_mapping(list, env); > +if (ret < 0) { > +return -1; > +} > +} > +} > +#else > +return -2; > +#endif > + > +/* > + * some memory may be not in the memory mapping's list: > + * 1. the guest doesn't use paging > + * 2. the guest is in 2nd kernel, and the memory used by 1st kernel is > not > + *in paging table > + * add them into memory mapping's list > + */ > +QLIST_FOREACH(block, &ram_list.blocks, next) { How does the memory portion referenced by PT_LOAD program headers with p_vaddr == 0 looks through gdb? If we cannot access such portions, part not referenced by the page table CR3 has is unnecessary, isn't it? Thanks. HATAYAMA, Daisuke
[Qemu-devel] [PATCH] Remove type field in ModuleEntry as it's not used.
Signed-off-by: Chen Yufei --- module.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/module.c b/module.c index 106a969..c3a6da7 100644 --- a/module.c +++ b/module.c @@ -19,7 +19,6 @@ typedef struct ModuleEntry { -module_init_type type; void (*init)(void); QTAILQ_ENTRY(ModuleEntry) node; } ModuleEntry; -- 1.7.3.2
Re: [Qemu-devel] [PATCH] PPC: Add PIR register to POWER7 CPU
On 03/03/2012 07:06 PM, Andreas Färber wrote: Am 03.03.2012 17:36, schrieb Nathan Whitehorn: The POWER7 emulation is missing the Processor Identification Register, mandatory in recent POWER CPUs, that is required for SMP on at least some operating systems (e.g. FreeBSD) to function properly. This patch copies the existing PIR code from the other CPUs that implement it. Signed-off-by: Nathan Whitehorn Please always cc the respective maintainers (and lists) according to MAINTAINERS. CC'ing Alex and qemu-ppc. --- target-ppc/translate_init.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 8a7233f..01f4030 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -6537,6 +6537,11 @@ static void init_proc_POWER7 (CPUPPCState *env) /* Time base */ gen_tbl(env); #if !defined(CONFIG_USER_ONLY) +/* Processor identification */ +spr_register(env, SPR_PIR, "PIR", + SPR_NOACCESS, SPR_NOACCESS, +&spr_read_generic,&spr_write_pir, Indentation looks weird here. Stray tab maybe? No tab, just a broken patch. I fixed the whitespace and applied it to ppc-next. Alex
Re: [Qemu-devel] [PATCH] PPC: Fix large page support in TCG
On 03/03/2012 07:07 PM, Andreas Färber wrote: Am 03.03.2012 17:39, schrieb Nathan Whitehorn: Fix large page support in TCG. The old code would overwrite the large page table entry with the fake 4 KB one generated here whenever the ref/change bits were updated, causing it to point to the wrong area of memory. Instead of creating a fake PTE, just update the real address at the end. Signed-off-by: Nathan Whitehorn cc'ing Alex and qemu-ppc. David? Could you please ack? Alex /-F --- target-ppc/helper.c | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/target-ppc/helper.c b/target-ppc/helper.c index 928fbcf..0f5ad2e 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -597,12 +597,6 @@ static inline int _find_pte(CPUState *env, mmu_ctx_t *ctx, int is_64b, int h, pte1 = ldq_phys(env->htab_base + pteg_off + (i * 16) + 8); } -/* We have a TLB that saves 4K pages, so let's - * split a huge page to 4k chunks */ -if (target_page_bits != TARGET_PAGE_BITS) -pte1 |= (ctx->eaddr& (( 1<< target_page_bits ) - 1)) -& TARGET_PAGE_MASK; - r = pte64_check(ctx, pte0, pte1, h, rw, type); LOG_MMU("Load pte from " TARGET_FMT_lx " => " TARGET_FMT_lx "" TARGET_FMT_lx " %d %d %d " TARGET_FMT_lx "\n", @@ -678,6 +672,11 @@ static inline int _find_pte(CPUState *env, mmu_ctx_t *ctx, int is_64b, int h, } } +/* We have a TLB that saves 4K pages, so let's + * split a huge page to 4k chunks */ +if (target_page_bits != TARGET_PAGE_BITS) + ctx->raddr |= (ctx->eaddr& (( 1<< target_page_bits ) - 1)) +& TARGET_PAGE_MASK; return ret; } -- 1.7.9
[Qemu-devel] [PATCH v3] VMXNET3 paravirtual NIC device implementation
Changes in V3: Fixed crash when net device that is used as network fronted has no virtio HDR support. Task offloads emulation for cases when net device that is used as network fronted has no virtio HDR support. Changes in V2: License text changed accoring to community suggestions Standard license header from GPLv2+ - licensed QEMU files used Dmitry Fleytman (1): VMXNET3 paravirtual NIC device implementation Makefile.objs |1 + default-configs/pci.mak |1 + hw/pci.c|2 + hw/pci.h|1 + hw/virtio-net.h | 13 +- hw/vmware_utils.h | 131 +++ hw/vmxnet3.c| 2744 +++ hw/vmxnet3.h| 727 + hw/vmxnet3_debug.h | 104 ++ hw/vmxnet_utils.c | 202 hw/vmxnet_utils.h | 263 + iov.c | 27 + iov.h |3 + net.c |2 +- net/checksum.h |7 + 15 files changed, 4221 insertions(+), 7 deletions(-) create mode 100644 hw/vmware_utils.h create mode 100644 hw/vmxnet3.c create mode 100644 hw/vmxnet3.h create mode 100644 hw/vmxnet3_debug.h create mode 100644 hw/vmxnet_utils.c create mode 100644 hw/vmxnet_utils.h -- 1.7.7.6
Re: [Qemu-devel] PC BIOS Flash emulation
On Wed, Mar 7, 2012 at 6:32 PM, Avi Kivity wrote: > On 03/07/2012 03:59 PM, Dmitry Zamaruev wrote: >> Hi, >> >> I'm trying to emulate BIOS Flash chip (something Intel FWH compatible) >> on PC target (i386-softmmu) and to verify possibility of such >> emulation I first tried to use pflash_cfi02 example from PPC platform. > > So is Jordan (copied). > >> Trying to use if following way: >> in hw/pc.c in pc_memory_init() after bios.bin is loaded and mapped to ISA >> space: >> >> cpu_register_physical_memory(0x10 - isa_bios_size, >> isa_bios_size, >> (bios_offset + bios_size - >> isa_bios_size) | IO_MEM_ROM); >> >> option_rom_offset = qemu_ram_alloc(NULL, "pc.rom", PC_ROM_SIZE); >> cpu_register_physical_memory(PC_ROM_MIN_VGA, PC_ROM_SIZE, >> option_rom_offset); >> >> /* map all the bios at the top of memory */ >> // cpu_register_physical_memory((uint32_t)(-bios_size), >> // bios_size, bios_offset | IO_MEM_ROM); >> >> Instead of mapping all the bios at the top of memory I'm using >> following piece of code to init pflash device and load bios into it: >> >> dinfo = drive_get(IF_PFLASH, 0, 0); >> if (dinfo) { >> bios_size = bdrv_getlength(dinfo->bdrv); >> bios_offset = qemu_ram_alloc(NULL, "fwh.bios", bios_size); > > You're using a really old version of qemu. Please use qemu.git instead, > the APIs have changed. I'm using Q35 "version" from Isaku Yamahata, the only available version is 0.14.50. So I cannot use HEAD because Q35 support not in mainstream yet. But I will try this particular problem with HEAD to see if this approach works there. Thanks. wbr, Dmitry.
Re: [Qemu-devel] [PATCH] Remove type field in ModuleEntry as it's not used.
Am 07.03.2012 16:36, schrieb Chen Yufei: > Signed-off-by: Chen Yufei There's separate init_type_list[]s per type and the type field is not even initialized, so: Acked-by: Andreas Färber Thanks, Andreas > --- > module.c |1 - > 1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/module.c b/module.c > index 106a969..c3a6da7 100644 > --- a/module.c > +++ b/module.c > @@ -19,7 +19,6 @@ > > typedef struct ModuleEntry > { > -module_init_type type; > void (*init)(void); > QTAILQ_ENTRY(ModuleEntry) node; > } ModuleEntry; -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Re: [Qemu-devel] VirtIO 9p mount_tag (bogus?) limit of 32 bytes
Hi Anthony, When I tried with ldconfig version 2.14.90, ldconfig successfully completed QEMU version: 1.0.50 Kernel version: 3.3.0-rc6+ Could you please try with recent ldconfig? On 02/22/2012 09:28 AM, C Anthony Risinger wrote: On Sat, Feb 18, 2012 at 11:38 AM, Aneesh Kumar K.V wrote: On Thu, 16 Feb 2012 06:20:21 -0600, C Anthony Risinger wrote: a) mapped FS security policy (xattrs) causes `ldconfig` to abort()? root or normal user ... somehow `ldconfig` gets a duplicate inode while constructing the cache, even though it already de-duped (confirmed via gdb and grep -- only a single abort() in the source) b) unable to run `locale-gen` on *any* virtfs configuration? (strace) [...] mmap(NULL, 536870912, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb3aac63000 mmap(0x7fb3aac63000, 103860, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, 3, 0) = -1 EINVAL (Invalid argument) cannot map archive header: Invalid argument c) package files containing device nodes fail (maybe this is expected ...); specifically `/lib/udev/devices/loop0` Is this with 9p2000.L ?. What is the guest kernel version ? (not sure if list will accept this ... too much traffic! had to remove myself) yes this is with 9p2000.L, both host and guests run kernel 3.2.5. i'm happy to provide/try additional information/tests if useful. ... is there really no chance of upping the max path? seems like config space will be a big constraint, forever :-( and i'm very much willing to do additional testing for the other issues as well (i had to revert to qemu-as-root to get passthru working 100% on rootfs ... ldconfig is kind of critical :-). are these known issues?
[Qemu-devel] QEMU RX offload issues with net device frontend that does not support virtio extensions
Hello, It looks like there is a problem in QEMU related to usage of frontends without virtio extensions. Normally on RX path QEMU receives packet metadata with offloads information in virtio header. In particular there is an information about checksumming state. For example, when packet is being transferred from guest to guest with offloads enabled on transmitter side, checksums won't be calculated, special flag will be set instead in virtio header indicating that the checksum is ok. Based on this flag device may notify guest that checksum verification for this packet is not required. Now, when virtio header is not supported on receiver side, there is no way device may be notified about the checksum state. Packet will be indicated to the guest as is and will be dropped by guest's network stack. I've tested this scenario with virtio devices and observed the issue described. Do I miss something? Is there any configuration option or something I'm not aware about? Thanks in advance, Dmitry Fleytman.
Re: [Qemu-devel] regarding qcow2metadata
Hi... On Wed, Mar 7, 2012 at 14:11, PANKAJ RAWAT wrote: > [root@t06 p]# ls -lh > total 1.4M > -rw-r--r-- 1 root root 8.1G Mar 7 12:43 guest > > is there is any way to allocate metadata to half size or predefined size ? > i.e 4GB will be allocated and rest 4GB can be allocated dynamically have you double checked by using "ls -lsh" command? :) -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Re: [Qemu-devel] [PATCH] configure: Quote the configure args printed in config.log
On 03/07/2012 05:40 AM, Stefan Hajnoczi wrote: > On Wed, Mar 7, 2012 at 12:16 PM, Peter Maydell > wrote: >> Use the same mechanism we use for printing the configure command >> line to config-host.mak to print it to config.log. This fixes a >> bug where the config.log version didn't quote arguments with spaces. >> >> Signed-off-by: Peter Maydell >> --- >> If I'd noticed when I was adding the banner to config.log that we already >> printed this in config-host.mak I'd have done it this way to start with... >> >> configure |4 +++- >> 1 files changed, 3 insertions(+), 1 deletions(-) >> >> diff --git a/configure b/configure >> index a5eb832..1b63436 100755 >> --- a/configure >> +++ b/configure >> @@ -22,7 +22,9 @@ rm -f config.log >> >> # Print a helpful header at the top of config.log >> echo "# QEMU configure log $(date)" >> config.log >> -echo "# produced by $0 $*" >> config.log This left a trailing newline, >> +printf "# Configured with:" >> config.log >> +printf " '%s'" "$0" "$@" >> config.log but this does not. You probably want to add another echo afterwards, so that the next line of the log doesn't look like another configure argument. -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature
Re: [Qemu-devel] [PATCH] configure: Quote the configure args printed in config.log
On 7 March 2012 17:06, Eric Blake wrote: >>> # Print a helpful header at the top of config.log >>> echo "# QEMU configure log $(date)" >> config.log >>> -echo "# produced by $0 $*" >> config.log > > This left a trailing newline, > >>> +printf "# Configured with:" >> config.log >>> +printf " '%s'" "$0" "$@" >> config.log > > but this does not. You probably want to add another echo afterwards, so > that the next line of the log doesn't look like another configure argument. If you look at the whole change, rather than just the fragment Stefan quoted to comment on: # Print a helpful header at the top of config.log echo "# QEMU configure log $(date)" >> config.log -echo "# produced by $0 $*" >> config.log +printf "# Configured with:" >> config.log +printf " '%s'" "$0" "$@" >> config.log +echo >> config.log echo "#" >> config.log ...you'll see that it does exactly what you suggest. -- PMM
Re: [Qemu-devel] [PATCH] configure: Quote the configure args printed in config.log
On 7 March 2012 12:40, Stefan Hajnoczi wrote: >> +printf "# Configured with:" >> config.log >> +printf " '%s'" "$0" "$@" >> config.log > > You use an interesting feature of printf(1)- it applies the (short) > format string as long as there are arguments. I checked that this is > in the specification: > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html Yes, I had to look up the spec to figure out why it worked too :-) -- PMM
[Qemu-devel] QAPI conversion status and async commands support
Hi there, In the last few weeks we've had some proposals for new QMP commands that need to be asynchronous. As we lack a standard asynchronous API today, each command ends up adding its own way to execute in the background. This multiplies the API complexity as each command has to be implemented and learned by clients separately, with their own way of doing more or less the same things. The solution for this, envisioned for us for a long time now, is to introduce an unified QMP API for asynchronous commands. But before doing this we have to: 1. Finish the commands conversion to the QAPI This is almost done, the only missing commands are: add_graphics_client, do_closefd, do_device_add, do_device_del, do_getfd, do_migrate, do_netdev_add, do_netdev_del, do_qmp_capabilities and do_screen_dump. Note that do_migrate has already been posted to the list, and I have the screendump more or less done. Also, Anthony has an old branch where most of the conversions are already done, they just need to be rebased & tested. 2. Integrate the new QAPI server Implemented by Anthony, may have missing pieces. 3. Implement async command support I think the missing commands to be converted can be done in around one week, but unfortunately I've been busy at other things and will need a few days to resume this work. Then there's the new QAPI server & async support, which I'm not sure how much time we'll need to integrate them, but we should have this done for 1.1. The main question is: what should we do for the already posted async commands? Should we hold them until we finish this work?
Re: [Qemu-devel] [PATCH] configure: Quote the configure args printed in config.log
On 03/07/2012 02:16 PM, Peter Maydell wrote: > Use the same mechanism we use for printing the configure command > line to config-host.mak to print it to config.log. This fixes a > bug where the config.log version didn't quote arguments with spaces. > > # Print a helpful header at the top of config.log > echo "# QEMU configure log $(date)" >> config.log > -echo "# produced by $0 $*" >> config.log > +printf "# Configured with:" >> config.log > +printf " '%s'" "$0" "$@" >> config.log > +echo >> config.log > echo "#" >> config.log > This still breaks if an argument has a single quote. bash's printf's %q deals with this correctly, but not sure how portable it is. -- error compiling committee.c: too many arguments to function