1 | The following changes since commit ab08440a4ee09032d1a9cb22fdcab23bc7e1c656: | 1 | The following changes since commit 15ef89d2a1a7b93845a6b09c2ee8e1979f6eb30b: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20180702' into staging (2018-07-02 17:57:46 +0100) | 3 | Update version for v7.0.0-rc1 release (2022-03-22 22:58:44 +0000) |
4 | 4 | ||
5 | are available in the Git repository at: | 5 | are available in the Git repository at: |
6 | 6 | ||
7 | git://github.com/codyprime/qemu-kvm-jtc.git tags/block-pull-request | 7 | https://gitlab.com/stefanha/qemu.git tags/block-pull-request |
8 | 8 | ||
9 | for you to fetch changes up to 9ded4a0114968e98b41494fc035ba14f84cdf700: | 9 | for you to fetch changes up to 2539eade4f689eda7e9fe45486f18334bfbafaf0: |
10 | 10 | ||
11 | backup: Use copy offloading (2018-07-02 23:23:45 -0400) | 11 | hw: Fix misleading hexadecimal format (2022-03-24 10:38:42 +0000) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | Block backup patches | 14 | Pull request |
15 | |||
16 | Philippe found cases where the 0x%d format string was used, leading to | ||
17 | misleading output. The patches look harmless and could save people time, so I | ||
18 | think it's worth including them in 7.0. | ||
19 | |||
15 | ---------------------------------------------------------------- | 20 | ---------------------------------------------------------------- |
16 | 21 | ||
17 | Fam Zheng (3): | 22 | Philippe Mathieu-Daudé (2): |
18 | block: Fix parameter checking in bdrv_co_copy_range_internal | 23 | block: Fix misleading hexadecimal format |
19 | block: Honour BDRV_REQ_NO_SERIALISING in copy range | 24 | hw: Fix misleading hexadecimal format |
20 | backup: Use copy offloading | ||
21 | 25 | ||
22 | block/backup.c | 150 ++++++++++++++++++++++++++++++------------ | 26 | block/parallels-ext.c | 2 +- |
23 | block/io.c | 35 +++++----- | 27 | hw/i386/sgx.c | 2 +- |
24 | block/trace-events | 1 + | 28 | hw/i386/trace-events | 6 +++--- |
25 | include/block/block.h | 5 +- | 29 | hw/misc/trace-events | 4 ++-- |
26 | 4 files changed, 132 insertions(+), 59 deletions(-) | 30 | hw/scsi/trace-events | 4 ++-- |
31 | 5 files changed, 9 insertions(+), 9 deletions(-) | ||
27 | 32 | ||
28 | -- | 33 | -- |
29 | 2.17.1 | 34 | 2.35.1 |
30 | 35 | ||
31 | diff view generated by jsdifflib |
1 | From: Fam Zheng <famz@redhat.com> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | src may be NULL if BDRV_REQ_ZERO_WRITE flag is set, in this case only | 3 | "0x%u" format is very misleading, replace by "0x%x". |
4 | check dst and dst->bs. This bug was introduced when moving in the | ||
5 | request tracking code from bdrv_co_copy_range, in 37aec7d75eb. | ||
6 | 4 | ||
7 | This especially fixes the possible segfault when initializing src_bs | 5 | Found running: |
8 | with a NULL src. | ||
9 | 6 | ||
10 | Signed-off-by: Fam Zheng <famz@redhat.com> | 7 | $ git grep -E '0x%[0-9]*([lL]*|" ?PRI)[dDuU]' block/ |
11 | Message-id: 20180703023758.14422-2-famz@redhat.com | 8 | |
12 | Reviewed-by: Jeff Cody <jcody@redhat.com> | 9 | Inspired-by: Richard Henderson <richard.henderson@linaro.org> |
13 | Signed-off-by: Jeff Cody <jcody@redhat.com> | 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> | ||
14 | --- | 16 | --- |
15 | block/io.c | 29 +++++++++++++++-------------- | 17 | block/parallels-ext.c | 2 +- |
16 | 1 file changed, 15 insertions(+), 14 deletions(-) | 18 | 1 file changed, 1 insertion(+), 1 deletion(-) |
17 | 19 | ||
18 | diff --git a/block/io.c b/block/io.c | 20 | diff --git a/block/parallels-ext.c b/block/parallels-ext.c |
19 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/block/io.c | 22 | --- a/block/parallels-ext.c |
21 | +++ b/block/io.c | 23 | +++ b/block/parallels-ext.c |
22 | @@ -XXX,XX +XXX,XX @@ static int coroutine_fn bdrv_co_copy_range_internal(BdrvChild *src, | 24 | @@ -XXX,XX +XXX,XX @@ static int parallels_parse_format_extension(BlockDriverState *bs, |
23 | bool recurse_src) | 25 | break; |
24 | { | 26 | |
25 | BdrvTrackedRequest src_req, dst_req; | 27 | default: |
26 | - BlockDriverState *src_bs = src->bs; | 28 | - error_setg(errp, "Unknown feature: 0x%" PRIu64, fh.magic); |
27 | - BlockDriverState *dst_bs = dst->bs; | 29 | + error_setg(errp, "Unknown feature: 0x%" PRIx64, fh.magic); |
28 | int ret; | 30 | goto fail; |
29 | 31 | } | |
30 | - if (!src || !dst || !src->bs || !dst->bs) { | ||
31 | + if (!dst || !dst->bs) { | ||
32 | return -ENOMEDIUM; | ||
33 | } | ||
34 | - ret = bdrv_check_byte_request(src->bs, src_offset, bytes); | ||
35 | - if (ret) { | ||
36 | - return ret; | ||
37 | - } | ||
38 | - | ||
39 | ret = bdrv_check_byte_request(dst->bs, dst_offset, bytes); | ||
40 | if (ret) { | ||
41 | return ret; | ||
42 | @@ -XXX,XX +XXX,XX @@ static int coroutine_fn bdrv_co_copy_range_internal(BdrvChild *src, | ||
43 | return bdrv_co_pwrite_zeroes(dst, dst_offset, bytes, flags); | ||
44 | } | ||
45 | |||
46 | + if (!src || !src->bs) { | ||
47 | + return -ENOMEDIUM; | ||
48 | + } | ||
49 | + ret = bdrv_check_byte_request(src->bs, src_offset, bytes); | ||
50 | + if (ret) { | ||
51 | + return ret; | ||
52 | + } | ||
53 | + | ||
54 | if (!src->bs->drv->bdrv_co_copy_range_from | ||
55 | || !dst->bs->drv->bdrv_co_copy_range_to | ||
56 | || src->bs->encrypted || dst->bs->encrypted) { | ||
57 | return -ENOTSUP; | ||
58 | } | ||
59 | - bdrv_inc_in_flight(src_bs); | ||
60 | - bdrv_inc_in_flight(dst_bs); | ||
61 | - tracked_request_begin(&src_req, src_bs, src_offset, | ||
62 | + bdrv_inc_in_flight(src->bs); | ||
63 | + bdrv_inc_in_flight(dst->bs); | ||
64 | + tracked_request_begin(&src_req, src->bs, src_offset, | ||
65 | bytes, BDRV_TRACKED_READ); | ||
66 | - tracked_request_begin(&dst_req, dst_bs, dst_offset, | ||
67 | + tracked_request_begin(&dst_req, dst->bs, dst_offset, | ||
68 | bytes, BDRV_TRACKED_WRITE); | ||
69 | |||
70 | wait_serialising_requests(&src_req); | ||
71 | @@ -XXX,XX +XXX,XX @@ static int coroutine_fn bdrv_co_copy_range_internal(BdrvChild *src, | ||
72 | } | ||
73 | tracked_request_end(&src_req); | ||
74 | tracked_request_end(&dst_req); | ||
75 | - bdrv_dec_in_flight(src_bs); | ||
76 | - bdrv_dec_in_flight(dst_bs); | ||
77 | + bdrv_dec_in_flight(src->bs); | ||
78 | + bdrv_dec_in_flight(dst->bs); | ||
79 | return ret; | ||
80 | } | ||
81 | 32 | ||
82 | -- | 33 | -- |
83 | 2.17.1 | 34 | 2.35.1 |
84 | 35 | ||
85 | 36 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Fam Zheng <famz@redhat.com> | ||
2 | 1 | ||
3 | This semantics is needed by drive-backup so implement it before using | ||
4 | this API there. | ||
5 | |||
6 | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
7 | Signed-off-by: Fam Zheng <famz@redhat.com> | ||
8 | Message-id: 20180703023758.14422-3-famz@redhat.com | ||
9 | Signed-off-by: Jeff Cody <jcody@redhat.com> | ||
10 | --- | ||
11 | block/io.c | 6 ++++-- | ||
12 | include/block/block.h | 5 +++-- | ||
13 | 2 files changed, 7 insertions(+), 4 deletions(-) | ||
14 | |||
15 | diff --git a/block/io.c b/block/io.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/block/io.c | ||
18 | +++ b/block/io.c | ||
19 | @@ -XXX,XX +XXX,XX @@ static int coroutine_fn bdrv_co_copy_range_internal(BdrvChild *src, | ||
20 | tracked_request_begin(&dst_req, dst->bs, dst_offset, | ||
21 | bytes, BDRV_TRACKED_WRITE); | ||
22 | |||
23 | - wait_serialising_requests(&src_req); | ||
24 | - wait_serialising_requests(&dst_req); | ||
25 | + if (!(flags & BDRV_REQ_NO_SERIALISING)) { | ||
26 | + wait_serialising_requests(&src_req); | ||
27 | + wait_serialising_requests(&dst_req); | ||
28 | + } | ||
29 | if (recurse_src) { | ||
30 | ret = src->bs->drv->bdrv_co_copy_range_from(src->bs, | ||
31 | src, src_offset, | ||
32 | diff --git a/include/block/block.h b/include/block/block.h | ||
33 | index XXXXXXX..XXXXXXX 100644 | ||
34 | --- a/include/block/block.h | ||
35 | +++ b/include/block/block.h | ||
36 | @@ -XXX,XX +XXX,XX @@ void bdrv_unregister_buf(BlockDriverState *bs, void *host); | ||
37 | * @dst: Destination child to copy data to | ||
38 | * @dst_offset: offset in @dst image to write data | ||
39 | * @bytes: number of bytes to copy | ||
40 | - * @flags: request flags. Must be one of: | ||
41 | - * 0 - actually read data from src; | ||
42 | + * @flags: request flags. Supported flags: | ||
43 | * BDRV_REQ_ZERO_WRITE - treat the @src range as zero data and do zero | ||
44 | * write on @dst as if bdrv_co_pwrite_zeroes is | ||
45 | * called. Used to simplify caller code, or | ||
46 | * during BlockDriver.bdrv_co_copy_range_from() | ||
47 | * recursion. | ||
48 | + * BDRV_REQ_NO_SERIALISING - do not serialize with other overlapping | ||
49 | + * requests currently in flight. | ||
50 | * | ||
51 | * Returns: 0 if succeeded; negative error code if failed. | ||
52 | **/ | ||
53 | -- | ||
54 | 2.17.1 | ||
55 | |||
56 | diff view generated by jsdifflib |
1 | From: Fam Zheng <famz@redhat.com> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | The implementation is similar to the 'qemu-img convert'. In the | 3 | "0x%u" format is very misleading, replace by "0x%x". |
4 | beginning of the job, offloaded copy is attempted. If it fails, further | ||
5 | I/O will go through the existing bounce buffer code path. | ||
6 | 4 | ||
7 | Then, as Kevin pointed out, both this and qemu-img convert can benefit | 5 | Found running: |
8 | from a local check if one request fails because of, for example, the | ||
9 | offset is beyond EOF, but another may well be accepted by the protocol | ||
10 | layer. This will be implemented separately. | ||
11 | 6 | ||
12 | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> | 7 | $ git grep -E '0x%[0-9]*([lL]*|" ?PRI)[dDuU]' hw/ |
13 | Signed-off-by: Fam Zheng <famz@redhat.com> | 8 | |
14 | Message-id: 20180703023758.14422-4-famz@redhat.com | 9 | Inspired-by: Richard Henderson <richard.henderson@linaro.org> |
15 | Signed-off-by: Jeff Cody <jcody@redhat.com> | 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> | ||
16 | --- | 14 | --- |
17 | block/backup.c | 150 ++++++++++++++++++++++++++++++++------------- | 15 | hw/i386/sgx.c | 2 +- |
18 | block/trace-events | 1 + | 16 | hw/i386/trace-events | 6 +++--- |
19 | 2 files changed, 110 insertions(+), 41 deletions(-) | 17 | hw/misc/trace-events | 4 ++-- |
18 | hw/scsi/trace-events | 4 ++-- | ||
19 | 4 files changed, 8 insertions(+), 8 deletions(-) | ||
20 | 20 | ||
21 | diff --git a/block/backup.c b/block/backup.c | 21 | diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c |
22 | index XXXXXXX..XXXXXXX 100644 | 22 | index XXXXXXX..XXXXXXX 100644 |
23 | --- a/block/backup.c | 23 | --- a/hw/i386/sgx.c |
24 | +++ b/block/backup.c | 24 | +++ b/hw/i386/sgx.c |
25 | @@ -XXX,XX +XXX,XX @@ typedef struct BackupBlockJob { | 25 | @@ -XXX,XX +XXX,XX @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) |
26 | QLIST_HEAD(, CowRequest) inflight_reqs; | ||
27 | |||
28 | HBitmap *copy_bitmap; | ||
29 | + bool use_copy_range; | ||
30 | + int64_t copy_range_size; | ||
31 | } BackupBlockJob; | ||
32 | |||
33 | static const BlockJobDriver backup_job_driver; | ||
34 | @@ -XXX,XX +XXX,XX @@ static void cow_request_end(CowRequest *req) | ||
35 | qemu_co_queue_restart_all(&req->wait_queue); | ||
36 | } | ||
37 | |||
38 | +/* Copy range to target with a bounce buffer and return the bytes copied. If | ||
39 | + * error occured, return a negative error number */ | ||
40 | +static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job, | ||
41 | + int64_t start, | ||
42 | + int64_t end, | ||
43 | + bool is_write_notifier, | ||
44 | + bool *error_is_read, | ||
45 | + void **bounce_buffer) | ||
46 | +{ | ||
47 | + int ret; | ||
48 | + struct iovec iov; | ||
49 | + QEMUIOVector qiov; | ||
50 | + BlockBackend *blk = job->common.blk; | ||
51 | + int nbytes; | ||
52 | + | ||
53 | + hbitmap_reset(job->copy_bitmap, start / job->cluster_size, 1); | ||
54 | + nbytes = MIN(job->cluster_size, job->len - start); | ||
55 | + if (!*bounce_buffer) { | ||
56 | + *bounce_buffer = blk_blockalign(blk, job->cluster_size); | ||
57 | + } | ||
58 | + iov.iov_base = *bounce_buffer; | ||
59 | + iov.iov_len = nbytes; | ||
60 | + qemu_iovec_init_external(&qiov, &iov, 1); | ||
61 | + | ||
62 | + ret = blk_co_preadv(blk, start, qiov.size, &qiov, | ||
63 | + is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0); | ||
64 | + if (ret < 0) { | ||
65 | + trace_backup_do_cow_read_fail(job, start, ret); | ||
66 | + if (error_is_read) { | ||
67 | + *error_is_read = true; | ||
68 | + } | ||
69 | + goto fail; | ||
70 | + } | ||
71 | + | ||
72 | + if (qemu_iovec_is_zero(&qiov)) { | ||
73 | + ret = blk_co_pwrite_zeroes(job->target, start, | ||
74 | + qiov.size, BDRV_REQ_MAY_UNMAP); | ||
75 | + } else { | ||
76 | + ret = blk_co_pwritev(job->target, start, | ||
77 | + qiov.size, &qiov, | ||
78 | + job->compress ? BDRV_REQ_WRITE_COMPRESSED : 0); | ||
79 | + } | ||
80 | + if (ret < 0) { | ||
81 | + trace_backup_do_cow_write_fail(job, start, ret); | ||
82 | + if (error_is_read) { | ||
83 | + *error_is_read = false; | ||
84 | + } | ||
85 | + goto fail; | ||
86 | + } | ||
87 | + | ||
88 | + return nbytes; | ||
89 | +fail: | ||
90 | + hbitmap_set(job->copy_bitmap, start / job->cluster_size, 1); | ||
91 | + return ret; | ||
92 | + | ||
93 | +} | ||
94 | + | ||
95 | +/* Copy range to target and return the bytes copied. If error occured, return a | ||
96 | + * negative error number. */ | ||
97 | +static int coroutine_fn backup_cow_with_offload(BackupBlockJob *job, | ||
98 | + int64_t start, | ||
99 | + int64_t end, | ||
100 | + bool is_write_notifier) | ||
101 | +{ | ||
102 | + int ret; | ||
103 | + int nr_clusters; | ||
104 | + BlockBackend *blk = job->common.blk; | ||
105 | + int nbytes; | ||
106 | + | ||
107 | + assert(QEMU_IS_ALIGNED(job->copy_range_size, job->cluster_size)); | ||
108 | + nbytes = MIN(job->copy_range_size, end - start); | ||
109 | + nr_clusters = DIV_ROUND_UP(nbytes, job->cluster_size); | ||
110 | + hbitmap_reset(job->copy_bitmap, start / job->cluster_size, | ||
111 | + nr_clusters); | ||
112 | + ret = blk_co_copy_range(blk, start, job->target, start, nbytes, | ||
113 | + is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0); | ||
114 | + if (ret < 0) { | ||
115 | + trace_backup_do_cow_copy_range_fail(job, start, ret); | ||
116 | + hbitmap_set(job->copy_bitmap, start / job->cluster_size, | ||
117 | + nr_clusters); | ||
118 | + return ret; | ||
119 | + } | ||
120 | + | ||
121 | + return nbytes; | ||
122 | +} | ||
123 | + | ||
124 | static int coroutine_fn backup_do_cow(BackupBlockJob *job, | ||
125 | int64_t offset, uint64_t bytes, | ||
126 | bool *error_is_read, | ||
127 | bool is_write_notifier) | ||
128 | { | ||
129 | - BlockBackend *blk = job->common.blk; | ||
130 | CowRequest cow_request; | ||
131 | - struct iovec iov; | ||
132 | - QEMUIOVector bounce_qiov; | ||
133 | - void *bounce_buffer = NULL; | ||
134 | int ret = 0; | ||
135 | int64_t start, end; /* bytes */ | ||
136 | - int n; /* bytes */ | ||
137 | + void *bounce_buffer = NULL; | ||
138 | |||
139 | qemu_co_rwlock_rdlock(&job->flush_rwlock); | ||
140 | |||
141 | @@ -XXX,XX +XXX,XX @@ static int coroutine_fn backup_do_cow(BackupBlockJob *job, | ||
142 | wait_for_overlapping_requests(job, start, end); | ||
143 | cow_request_begin(&cow_request, job, start, end); | ||
144 | |||
145 | - for (; start < end; start += job->cluster_size) { | ||
146 | + while (start < end) { | ||
147 | if (!hbitmap_get(job->copy_bitmap, start / job->cluster_size)) { | ||
148 | trace_backup_do_cow_skip(job, start); | ||
149 | + start += job->cluster_size; | ||
150 | continue; /* already copied */ | ||
151 | } | ||
152 | - hbitmap_reset(job->copy_bitmap, start / job->cluster_size, 1); | ||
153 | |||
154 | trace_backup_do_cow_process(job, start); | ||
155 | |||
156 | - n = MIN(job->cluster_size, job->len - start); | ||
157 | - | ||
158 | - if (!bounce_buffer) { | ||
159 | - bounce_buffer = blk_blockalign(blk, job->cluster_size); | ||
160 | - } | ||
161 | - iov.iov_base = bounce_buffer; | ||
162 | - iov.iov_len = n; | ||
163 | - qemu_iovec_init_external(&bounce_qiov, &iov, 1); | ||
164 | - | ||
165 | - ret = blk_co_preadv(blk, start, bounce_qiov.size, &bounce_qiov, | ||
166 | - is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0); | ||
167 | - if (ret < 0) { | ||
168 | - trace_backup_do_cow_read_fail(job, start, ret); | ||
169 | - if (error_is_read) { | ||
170 | - *error_is_read = true; | ||
171 | + if (job->use_copy_range) { | ||
172 | + ret = backup_cow_with_offload(job, start, end, is_write_notifier); | ||
173 | + if (ret < 0) { | ||
174 | + job->use_copy_range = false; | ||
175 | } | ||
176 | - hbitmap_set(job->copy_bitmap, start / job->cluster_size, 1); | ||
177 | - goto out; | ||
178 | } | ||
179 | - | ||
180 | - if (buffer_is_zero(iov.iov_base, iov.iov_len)) { | ||
181 | - ret = blk_co_pwrite_zeroes(job->target, start, | ||
182 | - bounce_qiov.size, BDRV_REQ_MAY_UNMAP); | ||
183 | - } else { | ||
184 | - ret = blk_co_pwritev(job->target, start, | ||
185 | - bounce_qiov.size, &bounce_qiov, | ||
186 | - job->compress ? BDRV_REQ_WRITE_COMPRESSED : 0); | ||
187 | + if (!job->use_copy_range) { | ||
188 | + ret = backup_cow_with_bounce_buffer(job, start, end, is_write_notifier, | ||
189 | + error_is_read, &bounce_buffer); | ||
190 | } | ||
191 | if (ret < 0) { | ||
192 | - trace_backup_do_cow_write_fail(job, start, ret); | ||
193 | - if (error_is_read) { | ||
194 | - *error_is_read = false; | ||
195 | - } | ||
196 | - hbitmap_set(job->copy_bitmap, start / job->cluster_size, 1); | ||
197 | - goto out; | ||
198 | + break; | ||
199 | } | ||
200 | |||
201 | /* Publish progress, guest I/O counts as progress too. Note that the | ||
202 | * offset field is an opaque progress value, it is not a disk offset. | ||
203 | */ | ||
204 | - job->bytes_read += n; | ||
205 | - job_progress_update(&job->common.job, n); | ||
206 | + start += ret; | ||
207 | + job->bytes_read += ret; | ||
208 | + job_progress_update(&job->common.job, ret); | ||
209 | + ret = 0; | ||
210 | } | 26 | } |
211 | 27 | ||
212 | -out: | 28 | if ((sgx_epc->base + sgx_epc->size) < sgx_epc->base) { |
213 | if (bounce_buffer) { | 29 | - error_report("Size of all 'sgx-epc' =0x%"PRIu64" causes EPC to wrap", |
214 | qemu_vfree(bounce_buffer); | 30 | + error_report("Size of all 'sgx-epc' =0x%"PRIx64" causes EPC to wrap", |
31 | sgx_epc->size); | ||
32 | exit(EXIT_FAILURE); | ||
215 | } | 33 | } |
216 | @@ -XXX,XX +XXX,XX @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs, | 34 | diff --git a/hw/i386/trace-events b/hw/i386/trace-events |
217 | } else { | ||
218 | job->cluster_size = MAX(BACKUP_CLUSTER_SIZE_DEFAULT, bdi.cluster_size); | ||
219 | } | ||
220 | + job->use_copy_range = true; | ||
221 | + job->copy_range_size = MIN_NON_ZERO(blk_get_max_transfer(job->common.blk), | ||
222 | + blk_get_max_transfer(job->target)); | ||
223 | + job->copy_range_size = MAX(job->cluster_size, | ||
224 | + QEMU_ALIGN_UP(job->copy_range_size, | ||
225 | + job->cluster_size)); | ||
226 | |||
227 | /* Required permissions are already taken with target's blk_new() */ | ||
228 | block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL, | ||
229 | diff --git a/block/trace-events b/block/trace-events | ||
230 | index XXXXXXX..XXXXXXX 100644 | 35 | index XXXXXXX..XXXXXXX 100644 |
231 | --- a/block/trace-events | 36 | --- a/hw/i386/trace-events |
232 | +++ b/block/trace-events | 37 | +++ b/hw/i386/trace-events |
233 | @@ -XXX,XX +XXX,XX @@ backup_do_cow_skip(void *job, int64_t start) "job %p start %"PRId64 | 38 | @@ -XXX,XX +XXX,XX @@ vtd_fault_disabled(void) "Fault processing disabled for context entry" |
234 | backup_do_cow_process(void *job, int64_t start) "job %p start %"PRId64 | 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 |
235 | backup_do_cow_read_fail(void *job, int64_t start, int ret) "job %p start %"PRId64" ret %d" | 40 | vtd_replay_ce_invalid(uint8_t bus, uint8_t dev, uint8_t fn) "replay invalid context device %02"PRIx8":%02"PRIx8".%02"PRIx8 |
236 | backup_do_cow_write_fail(void *job, int64_t start, int ret) "job %p start %"PRId64" ret %d" | 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 |
237 | +backup_do_cow_copy_range_fail(void *job, int64_t start, int ret) "job %p start %"PRId64" ret %d" | 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" |
238 | 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" | |
239 | # blockdev.c | 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 |
240 | qmp_block_job_cancel(void *job) "job %p" | 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" | ||
241 | -- | 101 | -- |
242 | 2.17.1 | 102 | 2.35.1 |
243 | 103 | ||
244 | 104 | diff view generated by jsdifflib |