1 | The following changes since commit 15ef89d2a1a7b93845a6b09c2ee8e1979f6eb30b: | 1 | The following changes since commit bec9c64ef7be8063f1192608b83877bc5c9ea217: |
---|---|---|---|
2 | 2 | ||
3 | Update version for v7.0.0-rc1 release (2022-03-22 22:58:44 +0000) | 3 | Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2018-02-13 18:24:08 +0000) |
4 | 4 | ||
5 | are available in the Git repository at: | 5 | are available in the Git repository at: |
6 | 6 | ||
7 | https://gitlab.com/stefanha/qemu.git tags/block-pull-request | 7 | git://github.com/stefanha/qemu.git tags/block-pull-request |
8 | 8 | ||
9 | for you to fetch changes up to 2539eade4f689eda7e9fe45486f18334bfbafaf0: | 9 | for you to fetch changes up to d2f668b74907cbd96d9df0774971768ed06de2f0: |
10 | 10 | ||
11 | hw: Fix misleading hexadecimal format (2022-03-24 10:38:42 +0000) | 11 | misc: fix spelling (2018-02-15 09:39:49 +0000) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | Pull request | 14 | Pull request |
15 | 15 | ||
16 | Philippe found cases where the 0x%d format string was used, leading to | 16 | v2: |
17 | misleading output. The patches look harmless and could save people time, so I | 17 | * Dropped Fam's git-publish series because there is still ongoing discussion |
18 | think it's worth including them in 7.0. | ||
19 | 18 | ||
20 | ---------------------------------------------------------------- | 19 | ---------------------------------------------------------------- |
21 | 20 | ||
22 | Philippe Mathieu-Daudé (2): | 21 | Marc-André Lureau (1): |
23 | block: Fix misleading hexadecimal format | 22 | misc: fix spelling |
24 | hw: Fix misleading hexadecimal format | ||
25 | 23 | ||
26 | block/parallels-ext.c | 2 +- | 24 | Stefan Hajnoczi (1): |
27 | hw/i386/sgx.c | 2 +- | 25 | vl: pause vcpus before stopping iothreads |
28 | hw/i386/trace-events | 6 +++--- | 26 | |
29 | hw/misc/trace-events | 4 ++-- | 27 | Wolfgang Bumiller (1): |
30 | hw/scsi/trace-events | 4 ++-- | 28 | ratelimit: don't align wait time with slices |
31 | 5 files changed, 9 insertions(+), 9 deletions(-) | 29 | |
30 | include/qemu/ratelimit.h | 11 +++++------ | ||
31 | util/qemu-coroutine-lock.c | 2 +- | ||
32 | vl.c | 12 ++++++++++-- | ||
33 | 3 files changed, 16 insertions(+), 9 deletions(-) | ||
32 | 34 | ||
33 | -- | 35 | -- |
34 | 2.35.1 | 36 | 2.14.3 |
35 | 37 | ||
38 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Commit dce8921b2baaf95974af8176406881872067adfa ("iothread: Stop threads | ||
2 | before main() quits") introduced iothread_stop_all() to avoid the | ||
3 | following virtio-scsi assertion failure: | ||
1 | 4 | ||
5 | assert(blk_get_aio_context(d->conf.blk) == s->ctx); | ||
6 | |||
7 | Back then the assertion failed because when bdrv_close_all() made | ||
8 | d->conf.blk NULL, blk_get_aio_context() returned the global AioContext | ||
9 | instead of s->ctx. | ||
10 | |||
11 | The same assertion can still fail today when vcpus submit new I/O | ||
12 | requests after iothread_stop_all() has moved the BDS to the global | ||
13 | AioContext. | ||
14 | |||
15 | This patch hardens the iothread_stop_all() approach by pausing vcpus | ||
16 | before calling iothread_stop_all(). | ||
17 | |||
18 | Note that the assertion failure is a race condition. It is not possible | ||
19 | to reproduce it reliably. | ||
20 | |||
21 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
22 | Message-id: 20180201110708.8080-1-stefanha@redhat.com | ||
23 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
24 | --- | ||
25 | vl.c | 12 ++++++++++-- | ||
26 | 1 file changed, 10 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/vl.c b/vl.c | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/vl.c | ||
31 | +++ b/vl.c | ||
32 | @@ -XXX,XX +XXX,XX @@ int main(int argc, char **argv, char **envp) | ||
33 | |||
34 | main_loop(); | ||
35 | replay_disable_events(); | ||
36 | + | ||
37 | + /* The ordering of the following is delicate. Stop vcpus to prevent new | ||
38 | + * I/O requests being queued by the guest. Then stop IOThreads (this | ||
39 | + * includes a drain operation and completes all request processing). At | ||
40 | + * this point emulated devices are still associated with their IOThreads | ||
41 | + * (if any) but no longer have any work to do. Only then can we close | ||
42 | + * block devices safely because we know there is no more I/O coming. | ||
43 | + */ | ||
44 | + pause_all_vcpus(); | ||
45 | iothread_stop_all(); | ||
46 | - | ||
47 | - pause_all_vcpus(); | ||
48 | bdrv_close_all(); | ||
49 | + | ||
50 | res_free(); | ||
51 | |||
52 | /* vhost-user must be cleaned up before chardevs. */ | ||
53 | -- | ||
54 | 2.14.3 | ||
55 | |||
56 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Wolfgang Bumiller <w.bumiller@proxmox.com> |
---|---|---|---|
2 | 2 | ||
3 | "0x%u" format is very misleading, replace by "0x%x". | 3 | It is possible for rate limited writes to keep overshooting a slice's |
4 | quota by a tiny amount causing the slice-aligned waiting period to | ||
5 | effectively halve the rate. | ||
4 | 6 | ||
5 | Found running: | 7 | Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com> |
6 | 8 | Reviewed-by: Alberto Garcia <berto@igalia.com> | |
7 | $ git grep -E '0x%[0-9]*([lL]*|" ?PRI)[dDuU]' hw/ | 9 | Message-id: 20180207071758.6818-1-w.bumiller@proxmox.com |
8 | |||
9 | Inspired-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
11 | Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> | ||
12 | Message-id: 20220323114718.58714-3-philippe.mathieu.daude@gmail.com | ||
13 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 10 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
14 | --- | 11 | --- |
15 | hw/i386/sgx.c | 2 +- | 12 | include/qemu/ratelimit.h | 11 +++++------ |
16 | hw/i386/trace-events | 6 +++--- | 13 | 1 file changed, 5 insertions(+), 6 deletions(-) |
17 | hw/misc/trace-events | 4 ++-- | ||
18 | hw/scsi/trace-events | 4 ++-- | ||
19 | 4 files changed, 8 insertions(+), 8 deletions(-) | ||
20 | 14 | ||
21 | diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c | 15 | diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h |
22 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
23 | --- a/hw/i386/sgx.c | 17 | --- a/include/qemu/ratelimit.h |
24 | +++ b/hw/i386/sgx.c | 18 | +++ b/include/qemu/ratelimit.h |
25 | @@ -XXX,XX +XXX,XX @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) | 19 | @@ -XXX,XX +XXX,XX @@ typedef struct { |
20 | static inline int64_t ratelimit_calculate_delay(RateLimit *limit, uint64_t n) | ||
21 | { | ||
22 | int64_t now = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); | ||
23 | - uint64_t delay_slices; | ||
24 | + double delay_slices; | ||
25 | |||
26 | assert(limit->slice_quota && limit->slice_ns); | ||
27 | |||
28 | @@ -XXX,XX +XXX,XX @@ static inline int64_t ratelimit_calculate_delay(RateLimit *limit, uint64_t n) | ||
29 | return 0; | ||
26 | } | 30 | } |
27 | 31 | ||
28 | if ((sgx_epc->base + sgx_epc->size) < sgx_epc->base) { | 32 | - /* Quota exceeded. Calculate the next time slice we may start |
29 | - error_report("Size of all 'sgx-epc' =0x%"PRIu64" causes EPC to wrap", | 33 | - * sending data again. */ |
30 | + error_report("Size of all 'sgx-epc' =0x%"PRIx64" causes EPC to wrap", | 34 | - delay_slices = (limit->dispatched + limit->slice_quota - 1) / |
31 | sgx_epc->size); | 35 | - limit->slice_quota; |
32 | exit(EXIT_FAILURE); | 36 | + /* Quota exceeded. Wait based on the excess amount and then start a new |
33 | } | 37 | + * slice. */ |
34 | diff --git a/hw/i386/trace-events b/hw/i386/trace-events | 38 | + delay_slices = (double)limit->dispatched / limit->slice_quota; |
35 | index XXXXXXX..XXXXXXX 100644 | 39 | limit->slice_end_time = limit->slice_start_time + |
36 | --- a/hw/i386/trace-events | 40 | - delay_slices * limit->slice_ns; |
37 | +++ b/hw/i386/trace-events | 41 | + (uint64_t)(delay_slices * limit->slice_ns); |
38 | @@ -XXX,XX +XXX,XX @@ vtd_fault_disabled(void) "Fault processing disabled for context entry" | 42 | return limit->slice_end_time - now; |
39 | vtd_replay_ce_valid(const char *mode, uint8_t bus, uint8_t dev, uint8_t fn, uint16_t domain, uint64_t hi, uint64_t lo) "%s: replay valid context device %02"PRIx8":%02"PRIx8".%02"PRIx8" domain 0x%"PRIx16" hi 0x%"PRIx64" lo 0x%"PRIx64 | 43 | } |
40 | vtd_replay_ce_invalid(uint8_t bus, uint8_t dev, uint8_t fn) "replay invalid context device %02"PRIx8":%02"PRIx8".%02"PRIx8 | 44 | |
41 | vtd_page_walk_level(uint64_t addr, uint32_t level, uint64_t start, uint64_t end) "walk (base=0x%"PRIx64", level=%"PRIu32") iova range 0x%"PRIx64" - 0x%"PRIx64 | ||
42 | -vtd_page_walk_one(uint16_t domain, uint64_t iova, uint64_t gpa, uint64_t mask, int perm) "domain 0x%"PRIu16" iova 0x%"PRIx64" -> gpa 0x%"PRIx64" mask 0x%"PRIx64" perm %d" | ||
43 | +vtd_page_walk_one(uint16_t domain, uint64_t iova, uint64_t gpa, uint64_t mask, int perm) "domain 0x%"PRIx16" iova 0x%"PRIx64" -> gpa 0x%"PRIx64" mask 0x%"PRIx64" perm %d" | ||
44 | vtd_page_walk_one_skip_map(uint64_t iova, uint64_t mask, uint64_t translated) "iova 0x%"PRIx64" mask 0x%"PRIx64" translated 0x%"PRIx64 | ||
45 | vtd_page_walk_one_skip_unmap(uint64_t iova, uint64_t mask) "iova 0x%"PRIx64" mask 0x%"PRIx64 | ||
46 | vtd_page_walk_skip_read(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to unable to read" | ||
47 | vtd_page_walk_skip_reserve(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to rsrv set" | ||
48 | vtd_switch_address_space(uint8_t bus, uint8_t slot, uint8_t fn, bool on) "Device %02x:%02x.%x switching address space (iommu enabled=%d)" | ||
49 | vtd_as_unmap_whole(uint8_t bus, uint8_t slot, uint8_t fn, uint64_t iova, uint64_t size) "Device %02x:%02x.%x start 0x%"PRIx64" size 0x%"PRIx64 | ||
50 | -vtd_translate_pt(uint16_t sid, uint64_t addr) "source id 0x%"PRIu16", iova 0x%"PRIx64 | ||
51 | -vtd_pt_enable_fast_path(uint16_t sid, bool success) "sid 0x%"PRIu16" %d" | ||
52 | +vtd_translate_pt(uint16_t sid, uint64_t addr) "source id 0x%"PRIx16", iova 0x%"PRIx64 | ||
53 | +vtd_pt_enable_fast_path(uint16_t sid, bool success) "sid 0x%"PRIx16" %d" | ||
54 | vtd_irq_generate(uint64_t addr, uint64_t data) "addr 0x%"PRIx64" data 0x%"PRIx64 | ||
55 | vtd_reg_read(uint64_t addr, uint64_t size) "addr 0x%"PRIx64" size 0x%"PRIx64 | ||
56 | vtd_reg_write(uint64_t addr, uint64_t size, uint64_t val) "addr 0x%"PRIx64" size 0x%"PRIx64" value 0x%"PRIx64 | ||
57 | diff --git a/hw/misc/trace-events b/hw/misc/trace-events | ||
58 | index XXXXXXX..XXXXXXX 100644 | ||
59 | --- a/hw/misc/trace-events | ||
60 | +++ b/hw/misc/trace-events | ||
61 | @@ -XXX,XX +XXX,XX @@ | ||
62 | # See docs/devel/tracing.rst for syntax documentation. | ||
63 | |||
64 | # allwinner-cpucfg.c | ||
65 | -allwinner_cpucfg_cpu_reset(uint8_t cpu_id, uint32_t reset_addr) "id %u, reset_addr 0x%" PRIu32 | ||
66 | +allwinner_cpucfg_cpu_reset(uint8_t cpu_id, uint32_t reset_addr) "id %u, reset_addr 0x%" PRIx32 | ||
67 | allwinner_cpucfg_read(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32 | ||
68 | allwinner_cpucfg_write(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32 | ||
69 | |||
70 | @@ -XXX,XX +XXX,XX @@ imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" PRIx64 "value 0x%08 | ||
71 | |||
72 | # mos6522.c | ||
73 | mos6522_set_counter(int index, unsigned int val) "T%d.counter=%d" | ||
74 | -mos6522_get_next_irq_time(uint16_t latch, int64_t d, int64_t delta) "latch=%d counter=0x%"PRId64 " delta_next=0x%"PRId64 | ||
75 | +mos6522_get_next_irq_time(uint16_t latch, int64_t d, int64_t delta) "latch=%d counter=0x%"PRIx64 " delta_next=0x%"PRIx64 | ||
76 | mos6522_set_sr_int(void) "set sr_int" | ||
77 | mos6522_write(uint64_t addr, const char *name, uint64_t val) "reg=0x%"PRIx64 " [%s] val=0x%"PRIx64 | ||
78 | mos6522_read(uint64_t addr, const char *name, unsigned val) "reg=0x%"PRIx64 " [%s] val=0x%x" | ||
79 | diff --git a/hw/scsi/trace-events b/hw/scsi/trace-events | ||
80 | index XXXXXXX..XXXXXXX 100644 | ||
81 | --- a/hw/scsi/trace-events | ||
82 | +++ b/hw/scsi/trace-events | ||
83 | @@ -XXX,XX +XXX,XX @@ lsi_bad_phase_interrupt(void) "Phase mismatch interrupt" | ||
84 | lsi_bad_selection(uint32_t id) "Selected absent target %"PRIu32 | ||
85 | lsi_do_dma_unavailable(void) "DMA no data available" | ||
86 | lsi_do_dma(uint64_t addr, int len) "DMA addr=0x%"PRIx64" len=%d" | ||
87 | -lsi_queue_command(uint32_t tag) "Queueing tag=0x%"PRId32 | ||
88 | +lsi_queue_command(uint32_t tag) "Queueing tag=0x%"PRIx32 | ||
89 | lsi_add_msg_byte_error(void) "MSG IN data too long" | ||
90 | lsi_add_msg_byte(uint8_t data) "MSG IN 0x%02x" | ||
91 | lsi_reselect(int id) "Reselected target %d" | ||
92 | @@ -XXX,XX +XXX,XX @@ lsi_do_msgout_noop(void) "MSG: No Operation" | ||
93 | lsi_do_msgout_extended(uint8_t msg, uint8_t len) "Extended message 0x%x (len %d)" | ||
94 | lsi_do_msgout_ignored(const char *msg) "%s (ignored)" | ||
95 | lsi_do_msgout_simplequeue(uint8_t select_tag) "SIMPLE queue tag=0x%x" | ||
96 | -lsi_do_msgout_abort(uint32_t tag) "MSG: ABORT TAG tag=0x%"PRId32 | ||
97 | +lsi_do_msgout_abort(uint32_t tag) "MSG: ABORT TAG tag=0x%"PRIx32 | ||
98 | lsi_do_msgout_clearqueue(uint32_t tag) "MSG: CLEAR QUEUE tag=0x%"PRIx32 | ||
99 | lsi_do_msgout_busdevicereset(uint32_t tag) "MSG: BUS DEVICE RESET tag=0x%"PRIx32 | ||
100 | lsi_do_msgout_select(int id) "Select LUN %d" | ||
101 | -- | 45 | -- |
102 | 2.35.1 | 46 | 2.14.3 |
103 | 47 | ||
104 | 48 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> | 1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | "0x%u" format is very misleading, replace by "0x%x". | 3 | s/pupulate/populate |
4 | 4 | ||
5 | Found running: | 5 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> |
6 | 6 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | |
7 | $ git grep -E '0x%[0-9]*([lL]*|" ?PRI)[dDuU]' block/ | 7 | Message-id: 20180208162447.10851-1-marcandre.lureau@redhat.com |
8 | |||
9 | Inspired-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
11 | Reviewed-by: Hanna Reitz <hreitz@redhat.com> | ||
12 | Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> | ||
13 | Reviewed-by: Denis V. Lunev <den@openvz.org> | ||
14 | Message-id: 20220323114718.58714-2-philippe.mathieu.daude@gmail.com | ||
15 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 8 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
16 | --- | 9 | --- |
17 | block/parallels-ext.c | 2 +- | 10 | util/qemu-coroutine-lock.c | 2 +- |
18 | 1 file changed, 1 insertion(+), 1 deletion(-) | 11 | 1 file changed, 1 insertion(+), 1 deletion(-) |
19 | 12 | ||
20 | diff --git a/block/parallels-ext.c b/block/parallels-ext.c | 13 | diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c |
21 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/block/parallels-ext.c | 15 | --- a/util/qemu-coroutine-lock.c |
23 | +++ b/block/parallels-ext.c | 16 | +++ b/util/qemu-coroutine-lock.c |
24 | @@ -XXX,XX +XXX,XX @@ static int parallels_parse_format_extension(BlockDriverState *bs, | 17 | @@ -XXX,XX +XXX,XX @@ void qemu_co_queue_run_restart(Coroutine *co) |
25 | break; | 18 | * invalid memory. Therefore, use a temporary queue and do not touch |
26 | 19 | * the "co" coroutine as soon as you enter another one. | |
27 | default: | 20 | * |
28 | - error_setg(errp, "Unknown feature: 0x%" PRIu64, fh.magic); | 21 | - * In its turn resumed "co" can pupulate "co_queue_wakeup" queue with |
29 | + error_setg(errp, "Unknown feature: 0x%" PRIx64, fh.magic); | 22 | + * In its turn resumed "co" can populate "co_queue_wakeup" queue with |
30 | goto fail; | 23 | * new coroutines to be woken up. The caller, who has resumed "co", |
31 | } | 24 | * will be responsible for traversing the same queue, which may cause |
32 | 25 | * a different wakeup order but not any missing wakeups. | |
33 | -- | 26 | -- |
34 | 2.35.1 | 27 | 2.14.3 |
35 | 28 | ||
36 | 29 | diff view generated by jsdifflib |