1
The following changes since commit 15ef89d2a1a7b93845a6b09c2ee8e1979f6eb30b:
1
The following changes since commit da1034094d375afe9e3d8ec8980550ea0f06f7e0:
2
2
3
Update version for v7.0.0-rc1 release (2022-03-22 22:58:44 +0000)
3
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2023-10-03 07:43:44 -0400)
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
https://gitlab.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 9afa888ce0f816d0f2cfc95eebe4f49244c518af:
10
10
11
hw: Fix misleading hexadecimal format (2022-03-24 10:38:42 +0000)
11
osdep: set _FORTIFY_SOURCE=2 when optimization is enabled (2023-10-04 09:52:06 -0400)
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
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
20
----------------------------------------------------------------
16
----------------------------------------------------------------
21
17
22
Philippe Mathieu-Daudé (2):
18
Daniel P. Berrangé (1):
23
block: Fix misleading hexadecimal format
19
osdep: set _FORTIFY_SOURCE=2 when optimization is enabled
24
hw: Fix misleading hexadecimal format
25
20
26
block/parallels-ext.c | 2 +-
21
meson.build | 10 ----------
27
hw/i386/sgx.c | 2 +-
22
include/qemu/osdep.h | 4 ++++
28
hw/i386/trace-events | 6 +++---
23
util/coroutine-sigaltstack.c | 4 ++--
29
hw/misc/trace-events | 4 ++--
24
util/coroutine-ucontext.c | 4 ++--
30
hw/scsi/trace-events | 4 ++--
25
4 files changed, 8 insertions(+), 14 deletions(-)
31
5 files changed, 9 insertions(+), 9 deletions(-)
32
26
33
--
27
--
34
2.35.1
28
2.41.0
35
29
30
diff view generated by jsdifflib
Deleted patch
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
1
3
"0x%u" format is very misleading, replace by "0x%x".
4
5
Found running:
6
7
$ git grep -E '0x%[0-9]*([lL]*|" ?PRI)[dDuU]' block/
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>
16
---
17
block/parallels-ext.c | 2 +-
18
1 file changed, 1 insertion(+), 1 deletion(-)
19
20
diff --git a/block/parallels-ext.c b/block/parallels-ext.c
21
index XXXXXXX..XXXXXXX 100644
22
--- a/block/parallels-ext.c
23
+++ b/block/parallels-ext.c
24
@@ -XXX,XX +XXX,XX @@ static int parallels_parse_format_extension(BlockDriverState *bs,
25
break;
26
27
default:
28
- error_setg(errp, "Unknown feature: 0x%" PRIu64, fh.magic);
29
+ error_setg(errp, "Unknown feature: 0x%" PRIx64, fh.magic);
30
goto fail;
31
}
32
33
--
34
2.35.1
35
36
diff view generated by jsdifflib
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
1
From: Daniel P. Berrangé <berrange@redhat.com>
2
2
3
"0x%u" format is very misleading, replace by "0x%x".
3
Currently we set _FORTIFY_SOURCE=2 as a compiler argument when the
4
meson 'optimization' setting is non-zero, the compiler is GCC and
5
the target is Linux.
4
6
5
Found running:
7
While the default QEMU optimization level is 2, user could override
8
this by setting CFLAGS="-O0" or --extra-cflags="-O0" when running
9
configure and this won't be reflected in the meson 'optimization'
10
setting. As a result we try to enable _FORTIFY_SOURCE=2 and then the
11
user gets compile errors as it only works with optimization.
6
12
7
$ git grep -E '0x%[0-9]*([lL]*|" ?PRI)[dDuU]' hw/
13
Rather than trying to improve detection in meson, it is simpler to
14
just check the __OPTIMIZE__ define from osdep.h.
8
15
9
Inspired-by: Richard Henderson <richard.henderson@linaro.org>
16
The comment about being incompatible with clang appears to be
10
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
17
outdated, as compilation works fine without excluding clang.
11
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
18
12
Message-id: 20220323114718.58714-3-philippe.mathieu.daude@gmail.com
19
In the coroutine code we must set _FORTIFY_SOURCE=0 to stop the
20
logic in osdep.h then enabling it.
21
22
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
23
Message-id: 20231003091549.223020-1-berrange@redhat.com
13
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
24
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
14
---
25
---
15
hw/i386/sgx.c | 2 +-
26
meson.build | 10 ----------
16
hw/i386/trace-events | 6 +++---
27
include/qemu/osdep.h | 4 ++++
17
hw/misc/trace-events | 4 ++--
28
util/coroutine-sigaltstack.c | 4 ++--
18
hw/scsi/trace-events | 4 ++--
29
util/coroutine-ucontext.c | 4 ++--
19
4 files changed, 8 insertions(+), 8 deletions(-)
30
4 files changed, 8 insertions(+), 14 deletions(-)
20
31
21
diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c
32
diff --git a/meson.build b/meson.build
22
index XXXXXXX..XXXXXXX 100644
33
index XXXXXXX..XXXXXXX 100644
23
--- a/hw/i386/sgx.c
34
--- a/meson.build
24
+++ b/hw/i386/sgx.c
35
+++ b/meson.build
25
@@ -XXX,XX +XXX,XX @@ void pc_machine_init_sgx_epc(PCMachineState *pcms)
36
@@ -XXX,XX +XXX,XX @@ if 'cpp' in all_languages
26
}
37
qemu_cxxflags = ['-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', '-D__STDC_FORMAT_MACROS'] + qemu_cflags
27
38
endif
28
if ((sgx_epc->base + sgx_epc->size) < sgx_epc->base) {
39
29
- error_report("Size of all 'sgx-epc' =0x%"PRIu64" causes EPC to wrap",
40
-# clang does not support glibc + FORTIFY_SOURCE (is it still true?)
30
+ error_report("Size of all 'sgx-epc' =0x%"PRIx64" causes EPC to wrap",
41
-if get_option('optimization') != '0' and targetos == 'linux'
31
sgx_epc->size);
42
- if cc.get_id() == 'gcc'
32
exit(EXIT_FAILURE);
43
- qemu_cflags += ['-U_FORTIFY_SOURCE', '-D_FORTIFY_SOURCE=2']
33
}
44
- endif
34
diff --git a/hw/i386/trace-events b/hw/i386/trace-events
45
- if 'cpp' in all_languages and cxx.get_id() == 'gcc'
46
- qemu_cxxflags += ['-U_FORTIFY_SOURCE', '-D_FORTIFY_SOURCE=2']
47
- endif
48
-endif
49
-
50
add_project_arguments(qemu_cflags, native: false, language: 'c')
51
add_project_arguments(cc.get_supported_arguments(warn_flags), native: false, language: 'c')
52
if 'cpp' in all_languages
53
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
35
index XXXXXXX..XXXXXXX 100644
54
index XXXXXXX..XXXXXXX 100644
36
--- a/hw/i386/trace-events
55
--- a/include/qemu/osdep.h
37
+++ b/hw/i386/trace-events
56
+++ b/include/qemu/osdep.h
38
@@ -XXX,XX +XXX,XX @@ vtd_fault_disabled(void) "Fault processing disabled for context entry"
57
@@ -XXX,XX +XXX,XX @@
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
58
#ifndef QEMU_OSDEP_H
40
vtd_replay_ce_invalid(uint8_t bus, uint8_t dev, uint8_t fn) "replay invalid context device %02"PRIx8":%02"PRIx8".%02"PRIx8
59
#define QEMU_OSDEP_H
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
60
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"
61
+#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ && defined __linux__
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"
62
+# define _FORTIFY_SOURCE 2
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
63
+#endif
45
vtd_page_walk_one_skip_unmap(uint64_t iova, uint64_t mask) "iova 0x%"PRIx64" mask 0x%"PRIx64
64
+
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"
65
#include "config-host.h"
47
vtd_page_walk_skip_reserve(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to rsrv set"
66
#ifdef NEED_CPU_H
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)"
67
#include CONFIG_TARGET
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
68
diff --git a/util/coroutine-sigaltstack.c b/util/coroutine-sigaltstack.c
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
69
index XXXXXXX..XXXXXXX 100644
59
--- a/hw/misc/trace-events
70
--- a/util/coroutine-sigaltstack.c
60
+++ b/hw/misc/trace-events
71
+++ b/util/coroutine-sigaltstack.c
61
@@ -XXX,XX +XXX,XX @@
72
@@ -XXX,XX +XXX,XX @@
62
# See docs/devel/tracing.rst for syntax documentation.
73
*/
63
74
64
# allwinner-cpucfg.c
75
/* XXX Is there a nicer way to disable glibc's stack check for longjmp? */
65
-allwinner_cpucfg_cpu_reset(uint8_t cpu_id, uint32_t reset_addr) "id %u, reset_addr 0x%" PRIu32
76
-#ifdef _FORTIFY_SOURCE
66
+allwinner_cpucfg_cpu_reset(uint8_t cpu_id, uint32_t reset_addr) "id %u, reset_addr 0x%" PRIx32
77
#undef _FORTIFY_SOURCE
67
allwinner_cpucfg_read(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32
78
-#endif
68
allwinner_cpucfg_write(uint64_t offset, uint64_t data, unsigned size) "offset 0x%" PRIx64 " data 0x%" PRIx64 " size %" PRIu32
79
+#define _FORTIFY_SOURCE 0
69
80
+
70
@@ -XXX,XX +XXX,XX @@ imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" PRIx64 "value 0x%08
81
#include "qemu/osdep.h"
71
82
#include <pthread.h>
72
# mos6522.c
83
#include "qemu/coroutine_int.h"
73
mos6522_set_counter(int index, unsigned int val) "T%d.counter=%d"
84
diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c
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
85
index XXXXXXX..XXXXXXX 100644
81
--- a/hw/scsi/trace-events
86
--- a/util/coroutine-ucontext.c
82
+++ b/hw/scsi/trace-events
87
+++ b/util/coroutine-ucontext.c
83
@@ -XXX,XX +XXX,XX @@ lsi_bad_phase_interrupt(void) "Phase mismatch interrupt"
88
@@ -XXX,XX +XXX,XX @@
84
lsi_bad_selection(uint32_t id) "Selected absent target %"PRIu32
89
*/
85
lsi_do_dma_unavailable(void) "DMA no data available"
90
86
lsi_do_dma(uint64_t addr, int len) "DMA addr=0x%"PRIx64" len=%d"
91
/* XXX Is there a nicer way to disable glibc's stack check for longjmp? */
87
-lsi_queue_command(uint32_t tag) "Queueing tag=0x%"PRId32
92
-#ifdef _FORTIFY_SOURCE
88
+lsi_queue_command(uint32_t tag) "Queueing tag=0x%"PRIx32
93
#undef _FORTIFY_SOURCE
89
lsi_add_msg_byte_error(void) "MSG IN data too long"
94
-#endif
90
lsi_add_msg_byte(uint8_t data) "MSG IN 0x%02x"
95
+#define _FORTIFY_SOURCE 0
91
lsi_reselect(int id) "Reselected target %d"
96
+
92
@@ -XXX,XX +XXX,XX @@ lsi_do_msgout_noop(void) "MSG: No Operation"
97
#include "qemu/osdep.h"
93
lsi_do_msgout_extended(uint8_t msg, uint8_t len) "Extended message 0x%x (len %d)"
98
#include <ucontext.h>
94
lsi_do_msgout_ignored(const char *msg) "%s (ignored)"
99
#include "qemu/coroutine_int.h"
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
--
100
--
102
2.35.1
101
2.41.0
103
102
104
103
diff view generated by jsdifflib