* [PULL 1/7] i386: assert 'cs->kvm_state' is not null
2021-07-29 12:47 [PULL 0/7] Misc patches for QEMU 6.1-rc2 Paolo Bonzini
@ 2021-07-29 12:47 ` Paolo Bonzini
2021-07-29 12:47 ` [PULL 2/7] Makefile: ignore long options Paolo Bonzini
` (6 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2021-07-29 12:47 UTC (permalink / raw)
To: qemu-devel; +Cc: Vitaly Kuznetsov
From: Vitaly Kuznetsov <vkuznets@redhat.com>
Coverity reports potential NULL pointer dereference in
get_supported_hv_cpuid_legacy() when 'cs->kvm_state' is NULL. While
'cs->kvm_state' can indeed be NULL in hv_cpuid_get_host(),
kvm_hyperv_expand_features() makes sure that it only happens when
KVM_CAP_SYS_HYPERV_CPUID is supported and KVM_CAP_SYS_HYPERV_CPUID
implies KVM_CAP_HYPERV_CPUID so get_supported_hv_cpuid_legacy() is
never really called. Add asserts to strengthen the protection against
broken KVM behavior.
Coverity: CID 1458243
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20210716115852.418293-1-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/kvm/kvm.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 59ed8327ac..e69abe48e3 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -974,6 +974,12 @@ static struct kvm_cpuid2 *get_supported_hv_cpuid(CPUState *cs)
do_sys_ioctl =
kvm_check_extension(kvm_state, KVM_CAP_SYS_HYPERV_CPUID) > 0;
+ /*
+ * Non-empty KVM context is needed when KVM_CAP_SYS_HYPERV_CPUID is
+ * unsupported, kvm_hyperv_expand_features() checks for that.
+ */
+ assert(do_sys_ioctl || cs->kvm_state);
+
/*
* When the buffer is too small, KVM_GET_SUPPORTED_HV_CPUID fails with
* -E2BIG, however, it doesn't report back the right size. Keep increasing
@@ -1105,6 +1111,14 @@ static uint32_t hv_cpuid_get_host(CPUState *cs, uint32_t func, int reg)
if (kvm_check_extension(kvm_state, KVM_CAP_HYPERV_CPUID) > 0) {
cpuid = get_supported_hv_cpuid(cs);
} else {
+ /*
+ * 'cs->kvm_state' may be NULL when Hyper-V features are expanded
+ * before KVM context is created but this is only done when
+ * KVM_CAP_SYS_HYPERV_CPUID is supported and it implies
+ * KVM_CAP_HYPERV_CPUID.
+ */
+ assert(cs->kvm_state);
+
cpuid = get_supported_hv_cpuid_legacy(cs);
}
hv_cpuid_cache = cpuid;
--
2.31.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 2/7] Makefile: ignore long options
2021-07-29 12:47 [PULL 0/7] Misc patches for QEMU 6.1-rc2 Paolo Bonzini
2021-07-29 12:47 ` [PULL 1/7] i386: assert 'cs->kvm_state' is not null Paolo Bonzini
@ 2021-07-29 12:47 ` Paolo Bonzini
2021-07-29 12:47 ` [PULL 3/7] configure: Add -Werror to avx2, avx512 tests Paolo Bonzini
` (5 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2021-07-29 12:47 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexey Neyman
From: Alexey Neyman <stilor@att.net>
When searching for options like -n in MAKEFLAGS, current code may result
in a false positive match when make is invoked with long options like
--no-print-directory. This has been observed with certain versions of
host make (e.g. 3.82) while building the Qemu package in buildroot.
Filter out such long options before searching for one-character options.
Signed-off-by: Alexey Neyman <stilor@att.net>
Message-Id: <20210722020846.3678817-1-stilor@att.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 6c36330eef..401c623a65 100644
--- a/Makefile
+++ b/Makefile
@@ -129,9 +129,11 @@ endif
# 4. Rules to bridge to other makefiles
ifneq ($(NINJA),)
-MAKE.n = $(findstring n,$(firstword $(MAKEFLAGS)))
-MAKE.k = $(findstring k,$(firstword $(MAKEFLAGS)))
-MAKE.q = $(findstring q,$(firstword $(MAKEFLAGS)))
+# Filter out long options to avoid flags like --no-print-directory which
+# may result in false positive match for MAKE.n
+MAKE.n = $(findstring n,$(firstword $(filter-out --%,$(MAKEFLAGS))))
+MAKE.k = $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS))))
+MAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS))))
MAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq)
NINJAFLAGS = $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \
$(filter-out -j, $(lastword -j1 $(filter -l% -j%, $(MAKEFLAGS)))) \
--
2.31.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 3/7] configure: Add -Werror to avx2, avx512 tests
2021-07-29 12:47 [PULL 0/7] Misc patches for QEMU 6.1-rc2 Paolo Bonzini
2021-07-29 12:47 ` [PULL 1/7] i386: assert 'cs->kvm_state' is not null Paolo Bonzini
2021-07-29 12:47 ` [PULL 2/7] Makefile: ignore long options Paolo Bonzini
@ 2021-07-29 12:47 ` Paolo Bonzini
2021-07-29 12:47 ` [PULL 4/7] target/i386: Added consistency checks for event injection Paolo Bonzini
` (4 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2021-07-29 12:47 UTC (permalink / raw)
To: qemu-devel; +Cc: Richard Henderson
From: Richard Henderson <richard.henderson@linaro.org>
When using clang, we get
ERROR: configure test passed without -Werror but failed with -Werror.
This is probably a bug in the configure script. The failing command
will be at the bottom of config.log.
You can run configure with --disable-werror to bypass this check.
What we really want from these two tests is whether the
entire code sequence is supported, including pragmas.
Adding -Werror makes the test properly fail for clang.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210719200112.295316-1-richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 79e2ddc74e..422a456f0b 100755
--- a/configure
+++ b/configure
@@ -3881,7 +3881,7 @@ static int bar(void *a) {
}
int main(int argc, char *argv[]) { return bar(argv[0]); }
EOF
- if compile_object "" ; then
+ if compile_object "-Werror" ; then
avx2_opt="yes"
else
avx2_opt="no"
@@ -3911,7 +3911,7 @@ int main(int argc, char *argv[])
return bar(argv[0]);
}
EOF
- if ! compile_object "" ; then
+ if ! compile_object "-Werror" ; then
avx512f_opt="no"
fi
else
--
2.31.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 4/7] target/i386: Added consistency checks for event injection
2021-07-29 12:47 [PULL 0/7] Misc patches for QEMU 6.1-rc2 Paolo Bonzini
` (2 preceding siblings ...)
2021-07-29 12:47 ` [PULL 3/7] configure: Add -Werror to avx2, avx512 tests Paolo Bonzini
@ 2021-07-29 12:47 ` Paolo Bonzini
2021-07-29 12:47 ` [PULL 5/7] target/i386: fix typo in ctl_has_irq Paolo Bonzini
` (3 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2021-07-29 12:47 UTC (permalink / raw)
To: qemu-devel; +Cc: Lara Lazier
From: Lara Lazier <laramglazier@gmail.com>
VMRUN exits with SVM_EXIT_ERR if either:
* The event injected has a reserved type.
* When the event injected is of type 3 (exception), and the vector that
has been specified does not correspond to an exception.
This does not fix the entire exc_inj test in kvm-unit-tests.
Signed-off-by: Lara Lazier <laramglazier@gmail.com>
Message-Id: <20210725090855.19713-1-laramglazier@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/sysemu/svm_helper.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c
index 145511d635..90a9de30f8 100644
--- a/target/i386/tcg/sysemu/svm_helper.c
+++ b/target/i386/tcg/sysemu/svm_helper.c
@@ -383,6 +383,9 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend)
cpu_loop_exit(cs);
break;
case SVM_EVTINJ_TYPE_EXEPT:
+ if (vector == EXCP02_NMI || vector >= 31) {
+ cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
+ }
cs->exception_index = vector;
env->error_code = event_inj_err;
env->exception_is_int = 0;
@@ -398,6 +401,9 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend)
qemu_log_mask(CPU_LOG_TB_IN_ASM, "SOFT");
cpu_loop_exit(cs);
break;
+ default:
+ cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
+ break;
}
qemu_log_mask(CPU_LOG_TB_IN_ASM, " %#x %#x\n", cs->exception_index,
env->error_code);
--
2.31.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 5/7] target/i386: fix typo in ctl_has_irq
2021-07-29 12:47 [PULL 0/7] Misc patches for QEMU 6.1-rc2 Paolo Bonzini
` (3 preceding siblings ...)
2021-07-29 12:47 ` [PULL 4/7] target/i386: Added consistency checks for event injection Paolo Bonzini
@ 2021-07-29 12:47 ` Paolo Bonzini
2021-07-29 12:47 ` [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject Paolo Bonzini
` (2 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2021-07-29 12:47 UTC (permalink / raw)
To: qemu-devel; +Cc: Lara Lazier
The shift constant was incorrect, causing int_prio to always be zero.
Signed-off-by: Lara Lazier <laramglazier@gmail.com>
[Rewritten commit message since v1 had already been included. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/tcg/sysemu/svm_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c
index 90a9de30f8..e151104b4e 100644
--- a/target/i386/tcg/sysemu/svm_helper.c
+++ b/target/i386/tcg/sysemu/svm_helper.c
@@ -70,7 +70,7 @@ static inline bool ctl_has_irq(uint32_t int_ctl)
uint32_t int_prio;
uint32_t tpr;
- int_prio = (int_ctl & V_INTR_PRIO_MASK) >> V_INTR_MASKING_SHIFT;
+ int_prio = (int_ctl & V_INTR_PRIO_MASK) >> V_INTR_PRIO_SHIFT;
tpr = int_ctl & V_TPR_MASK;
return (int_ctl & V_IRQ_MASK) && (int_prio >= tpr);
}
--
2.31.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject
2021-07-29 12:47 [PULL 0/7] Misc patches for QEMU 6.1-rc2 Paolo Bonzini
` (4 preceding siblings ...)
2021-07-29 12:47 ` [PULL 5/7] target/i386: fix typo in ctl_has_irq Paolo Bonzini
@ 2021-07-29 12:47 ` Paolo Bonzini
2021-07-29 12:58 ` Peter Maydell
2021-08-19 8:43 ` Christian Borntraeger
2021-07-29 12:47 ` [PULL 7/7] libvhost-user: fix -Werror=format= warnings with __u64 fields Paolo Bonzini
2021-07-29 17:48 ` [PULL 0/7] Misc patches for QEMU 6.1-rc2 Peter Maydell
7 siblings, 2 replies; 16+ messages in thread
From: Paolo Bonzini @ 2021-07-29 12:47 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Meson now checks that subprojects do not access files from parent
project. While we all agree this is best practice, libvhost-user also
want to share a few headers with QEMU, and libvhost-user isn't really a
standalone project at this point (although this is making the dependency
a bit more explicit).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210505151313.203258-1-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
subprojects/libvhost-user/include/atomic.h | 1 +
subprojects/libvhost-user/libvhost-user.c | 2 +-
subprojects/libvhost-user/meson.build | 6 +-----
subprojects/libvhost-user/standard-headers/linux | 1 +
4 files changed, 4 insertions(+), 6 deletions(-)
create mode 120000 subprojects/libvhost-user/include/atomic.h
create mode 120000 subprojects/libvhost-user/standard-headers/linux
diff --git a/subprojects/libvhost-user/include/atomic.h b/subprojects/libvhost-user/include/atomic.h
new file mode 120000
index 0000000000..8c2be64f7b
--- /dev/null
+++ b/subprojects/libvhost-user/include/atomic.h
@@ -0,0 +1 @@
+../../../include/qemu/atomic.h
\ No newline at end of file
diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
index fab7ca17ee..2971ba0112 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -40,7 +40,7 @@
#endif
-#include "qemu/atomic.h"
+#include "include/atomic.h"
#include "libvhost-user.h"
diff --git a/subprojects/libvhost-user/meson.build b/subprojects/libvhost-user/meson.build
index b03446e7cd..39825d9404 100644
--- a/subprojects/libvhost-user/meson.build
+++ b/subprojects/libvhost-user/meson.build
@@ -4,21 +4,17 @@ project('libvhost-user', 'c',
threads = dependency('threads')
glib = dependency('glib-2.0')
-inc = include_directories('../../include', '../../linux-headers')
vhost_user = static_library('vhost-user',
files('libvhost-user.c'),
- include_directories: inc,
dependencies: threads,
c_args: '-D_GNU_SOURCE')
executable('link-test', files('link-test.c'),
- link_whole: vhost_user,
- include_directories: inc)
+ link_whole: vhost_user)
vhost_user_glib = static_library('vhost-user-glib',
files('libvhost-user-glib.c'),
- include_directories: inc,
link_with: vhost_user,
dependencies: glib)
diff --git a/subprojects/libvhost-user/standard-headers/linux b/subprojects/libvhost-user/standard-headers/linux
new file mode 120000
index 0000000000..15a2378139
--- /dev/null
+++ b/subprojects/libvhost-user/standard-headers/linux
@@ -0,0 +1 @@
+../../../include/standard-headers/linux
\ No newline at end of file
--
2.31.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject
2021-07-29 12:47 ` [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject Paolo Bonzini
@ 2021-07-29 12:58 ` Peter Maydell
2021-07-29 14:05 ` Thomas Huth
2021-08-19 8:43 ` Christian Borntraeger
1 sibling, 1 reply; 16+ messages in thread
From: Peter Maydell @ 2021-07-29 12:58 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Marc-André Lureau, QEMU Developers
On Thu, 29 Jul 2021 at 13:56, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Meson now checks that subprojects do not access files from parent
> project. While we all agree this is best practice, libvhost-user also
> want to share a few headers with QEMU, and libvhost-user isn't really a
> standalone project at this point (although this is making the dependency
> a bit more explicit).
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Message-Id: <20210505151313.203258-1-marcandre.lureau@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> subprojects/libvhost-user/include/atomic.h | 1 +
> subprojects/libvhost-user/libvhost-user.c | 2 +-
> subprojects/libvhost-user/meson.build | 6 +-----
> subprojects/libvhost-user/standard-headers/linux | 1 +
> diff --git a/subprojects/libvhost-user/include/atomic.h b/subprojects/libvhost-user/include/atomic.h
> new file mode 120000
> index 0000000000..8c2be64f7b
> --- /dev/null
> +++ b/subprojects/libvhost-user/include/atomic.h
> @@ -0,0 +1 @@
> +../../../include/qemu/atomic.h
> \ No newline at end of file
> diff --git a/subprojects/libvhost-user/standard-headers/linux b/subprojects/libvhost-user/standard-headers/linux
> new file mode 120000
> index 0000000000..15a2378139
> --- /dev/null
> +++ b/subprojects/libvhost-user/standard-headers/linux
> @@ -0,0 +1 @@
> +../../../include/standard-headers/linux
> \ No newline at end of file
Should these really be missing the trailing newline ?
-- PMM
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject
2021-07-29 12:58 ` Peter Maydell
@ 2021-07-29 14:05 ` Thomas Huth
2021-07-29 15:07 ` Peter Maydell
0 siblings, 1 reply; 16+ messages in thread
From: Thomas Huth @ 2021-07-29 14:05 UTC (permalink / raw)
To: Peter Maydell, Paolo Bonzini; +Cc: Marc-André Lureau, QEMU Developers
On 29/07/2021 14.58, Peter Maydell wrote:
> On Thu, 29 Jul 2021 at 13:56, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> Meson now checks that subprojects do not access files from parent
>> project. While we all agree this is best practice, libvhost-user also
>> want to share a few headers with QEMU, and libvhost-user isn't really a
>> standalone project at this point (although this is making the dependency
>> a bit more explicit).
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> Message-Id: <20210505151313.203258-1-marcandre.lureau@redhat.com>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> subprojects/libvhost-user/include/atomic.h | 1 +
>> subprojects/libvhost-user/libvhost-user.c | 2 +-
>> subprojects/libvhost-user/meson.build | 6 +-----
>> subprojects/libvhost-user/standard-headers/linux | 1 +
>
>> diff --git a/subprojects/libvhost-user/include/atomic.h b/subprojects/libvhost-user/include/atomic.h
>> new file mode 120000
>> index 0000000000..8c2be64f7b
>> --- /dev/null
>> +++ b/subprojects/libvhost-user/include/atomic.h
>> @@ -0,0 +1 @@
>> +../../../include/qemu/atomic.h
>> \ No newline at end of file
>
>> diff --git a/subprojects/libvhost-user/standard-headers/linux b/subprojects/libvhost-user/standard-headers/linux
>> new file mode 120000
>> index 0000000000..15a2378139
>> --- /dev/null
>> +++ b/subprojects/libvhost-user/standard-headers/linux
>> @@ -0,0 +1 @@
>> +../../../include/standard-headers/linux
>> \ No newline at end of file
>
>
> Should these really be missing the trailing newline ?
It's a symlink, so yes, there does not need to be a newline in here.
Thomas
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject
2021-07-29 14:05 ` Thomas Huth
@ 2021-07-29 15:07 ` Peter Maydell
2021-07-29 16:50 ` 罗勇刚(Yonggang Luo)
0 siblings, 1 reply; 16+ messages in thread
From: Peter Maydell @ 2021-07-29 15:07 UTC (permalink / raw)
To: Thomas Huth; +Cc: Paolo Bonzini, QEMU Developers, Marc-André Lureau
On Thu, 29 Jul 2021 at 15:05, Thomas Huth <thuth@redhat.com> wrote:
>
> On 29/07/2021 14.58, Peter Maydell wrote:
> > On Thu, 29 Jul 2021 at 13:56, Paolo Bonzini <pbonzini@redhat.com> wrote:
> >>
> >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >>
> >> Meson now checks that subprojects do not access files from parent
> >> project. While we all agree this is best practice, libvhost-user also
> >> want to share a few headers with QEMU, and libvhost-user isn't really a
> >> standalone project at this point (although this is making the dependency
> >> a bit more explicit).
> >>
> >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> >> Message-Id: <20210505151313.203258-1-marcandre.lureau@redhat.com>
> >> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> >> ---
> >> subprojects/libvhost-user/include/atomic.h | 1 +
> >> subprojects/libvhost-user/libvhost-user.c | 2 +-
> >> subprojects/libvhost-user/meson.build | 6 +-----
> >> subprojects/libvhost-user/standard-headers/linux | 1 +
> >
> >> diff --git a/subprojects/libvhost-user/include/atomic.h b/subprojects/libvhost-user/include/atomic.h
> >> new file mode 120000
> >> index 0000000000..8c2be64f7b
> >> --- /dev/null
> >> +++ b/subprojects/libvhost-user/include/atomic.h
> >> @@ -0,0 +1 @@
> >> +../../../include/qemu/atomic.h
> >> \ No newline at end of file
> >
> >> diff --git a/subprojects/libvhost-user/standard-headers/linux b/subprojects/libvhost-user/standard-headers/linux
> >> new file mode 120000
> >> index 0000000000..15a2378139
> >> --- /dev/null
> >> +++ b/subprojects/libvhost-user/standard-headers/linux
> >> @@ -0,0 +1 @@
> >> +../../../include/standard-headers/linux
> >> \ No newline at end of file
> >
> >
> > Should these really be missing the trailing newline ?
>
> It's a symlink, so yes, there does not need to be a newline in here.
Interesting. How does it work on Windows hosts ?
-- PMM
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject
2021-07-29 15:07 ` Peter Maydell
@ 2021-07-29 16:50 ` 罗勇刚(Yonggang Luo)
0 siblings, 0 replies; 16+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2021-07-29 16:50 UTC (permalink / raw)
To: Peter Maydell
Cc: Paolo Bonzini, Thomas Huth, QEMU Developers, Marc-André Lureau
[-- Attachment #1: Type: text/plain, Size: 2355 bytes --]
Relative symlink should work on Windows.
Only symlink that points to non-exist file would file.
On Thu, Jul 29, 2021 at 11:09 PM Peter Maydell <peter.maydell@linaro.org>
wrote:
>
> On Thu, 29 Jul 2021 at 15:05, Thomas Huth <thuth@redhat.com> wrote:
> >
> > On 29/07/2021 14.58, Peter Maydell wrote:
> > > On Thu, 29 Jul 2021 at 13:56, Paolo Bonzini <pbonzini@redhat.com>
wrote:
> > >>
> > >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> > >>
> > >> Meson now checks that subprojects do not access files from parent
> > >> project. While we all agree this is best practice, libvhost-user also
> > >> want to share a few headers with QEMU, and libvhost-user isn't
really a
> > >> standalone project at this point (although this is making the
dependency
> > >> a bit more explicit).
> > >>
> > >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > >> Message-Id: <20210505151313.203258-1-marcandre.lureau@redhat.com>
> > >> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > >> ---
> > >> subprojects/libvhost-user/include/atomic.h | 1 +
> > >> subprojects/libvhost-user/libvhost-user.c | 2 +-
> > >> subprojects/libvhost-user/meson.build | 6 +-----
> > >> subprojects/libvhost-user/standard-headers/linux | 1 +
> > >
> > >> diff --git a/subprojects/libvhost-user/include/atomic.h
b/subprojects/libvhost-user/include/atomic.h
> > >> new file mode 120000
> > >> index 0000000000..8c2be64f7b
> > >> --- /dev/null
> > >> +++ b/subprojects/libvhost-user/include/atomic.h
> > >> @@ -0,0 +1 @@
> > >> +../../../include/qemu/atomic.h
> > >> \ No newline at end of file
> > >
> > >> diff --git a/subprojects/libvhost-user/standard-headers/linux
b/subprojects/libvhost-user/standard-headers/linux
> > >> new file mode 120000
> > >> index 0000000000..15a2378139
> > >> --- /dev/null
> > >> +++ b/subprojects/libvhost-user/standard-headers/linux
> > >> @@ -0,0 +1 @@
> > >> +../../../include/standard-headers/linux
> > >> \ No newline at end of file
> > >
> > >
> > > Should these really be missing the trailing newline ?
> >
> > It's a symlink, so yes, there does not need to be a newline in here.
>
> Interesting. How does it work on Windows hosts ?
>
> -- PMM
>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
[-- Attachment #2: Type: text/html, Size: 3402 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject
2021-07-29 12:47 ` [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject Paolo Bonzini
2021-07-29 12:58 ` Peter Maydell
@ 2021-08-19 8:43 ` Christian Borntraeger
2021-08-19 14:51 ` Christian Borntraeger
1 sibling, 1 reply; 16+ messages in thread
From: Christian Borntraeger @ 2021-08-19 8:43 UTC (permalink / raw)
To: pbonzini
Cc: marcandre.lureau, qemu-devel, Christian Borntraeger, Peter Maydell
Interestingly enough this breaks my rpmbuild (both rpmbuild and mock).
(mostly with a modified f35 spec file):
cc -Isubprojects/libvhost-user/libvhost-user.a.p -Isubprojects/libvhost-user -I../subprojects/libvhost-user -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -std=gnu11 -O2 -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables -fstack-clash-protection -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -DSTAP_SDT_V2 -fPIE -pthread -D_GNU_SOURCE -MD -MQ subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o -MF subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o.d -o subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o -c ../subprojects/libvhost-user/libvhost-user.c
../subprojects/libvhost-user/libvhost-user.c:43:10: fatal error: include/atomic.h: No such file or directory
43 | #include "include/atomic.h"
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
and
DEBUG: FAILED: subprojects/libvhost-user/libvhost-user-glib.a.p/libvhost-user-glib.c.o
DEBUG: cc -Isubprojects/libvhost-user/libvhost-user-glib.a.p -Isubprojects/libvhost-user -I../subprojects/libvhost-user -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -fdiagnostics-color=auto -Wall -Winvalid-pch -std=gnu11 -O2 -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables -fstack-clash-protection -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -DSTAP_SDT_V2 -fPIE -pthread -MD -MQ subprojects/libvhost-user/libvhost-user-glib.a.p/libvhost-user-glib.c.o -MF subprojects/libvhost-user/libvhost-user-glib.a.p/libvhost-user-glib.c.o.d -o subprojects/libvhost-user/libvhost-user-glib.a.p/libvhost-user-glib.c.o -c ../subprojects/libvhost-user/libvhost-user-glib.c
DEBUG: In file included from ../subprojects/libvhost-user/libvhost-user-glib.h:19,
DEBUG: from ../subprojects/libvhost-user/libvhost-user-glib.c:15:
DEBUG: ../subprojects/libvhost-user/libvhost-user.h:23:10: fatal error: standard-headers/linux/virtio_ring.h: No such file or directory
DEBUG: 23 | #include "standard-headers/linux/virtio_ring.h"
DEBUG: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DEBUG: compilation terminated.
DEBUG: [12/10271] /usr/bin/meson --internal exe --capture qemu-version.h -- /builddir/build/BUILD/qemu-6.0.94/scripts/qemu-version.sh /builddir/build/BUILD/qemu-6.0.94 qemu-6.0.94-20210819.0.2e47441a94ba.fc34 6.0.94
DEBUG: [13/10271] /usr/bin/meson --internal exe --capture qemu-img-cmds.h -- /builddir/build/BUILD/qemu-6.0.94/scripts/hxtool -h ../qemu-img-cmds.hx
DEBUG: [14/10271] /usr/bin/meson --internal exe --capture hmp-commands-info.h -- /builddir/build/BUILD/qemu-6.0.94/scripts/hxtool -h ../hmp-commands-info.hx
DEBUG: [15/10271] /usr/bin/meson --internal exe --capture hmp-commands.h -- /builddir/build/BUILD/qemu-6.0.94/scripts/hxtool -h ../hmp-commands.hx
DEBUG: [16/10271] /usr/bin/meson --internal exe --capture qemu-options.def -- /builddir/build/BUILD/qemu-6.0.94/scripts/hxtool -h ../qemu-options.hx
DEBUG: ninja: build stopped: subcommand failed.
DEBUG: make: *** [Makefile:156: run-ninja] Error 1
DEBUG: error: Bad exit status from /var/tmp/rpm-tmp.fgqi3Y (%build)
DEBUG: RPM build errors:
DEBUG: Bad exit status from /var/tmp/rpm-tmp.fgqi3Y (%build)
DEBUG: Child return code was: 1
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject
2021-08-19 8:43 ` Christian Borntraeger
@ 2021-08-19 14:51 ` Christian Borntraeger
2021-08-19 15:11 ` Christian Borntraeger
0 siblings, 1 reply; 16+ messages in thread
From: Christian Borntraeger @ 2021-08-19 14:51 UTC (permalink / raw)
To: pbonzini; +Cc: marcandre.lureau, qemu-devel, Peter Maydell
On 19.08.21 10:43, Christian Borntraeger wrote:
> Interestingly enough this breaks my rpmbuild (both rpmbuild and mock).
> (mostly with a modified f35 spec file):
>
> cc -Isubprojects/libvhost-user/libvhost-user.a.p -Isubprojects/libvhost-user -I../subprojects/libvhost-user -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -std=gnu11 -O2 -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables -fstack-clash-protection -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -DSTAP_SDT_V2 -fPIE -pthread -D_GNU_SOURCE -MD -MQ subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o -MF subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o.d -o subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o -c ../subprojects/libvhost-user/libvhost-user.c
> ../subprojects/libvhost-user/libvhost-user.c:43:10: fatal error: include/atomic.h: No such file or directory
> 43 | #include "include/atomic.h"
> | ^~~~~~~~~~~~~~~~~~
> compilation terminated.
>
Looks like the link in the tar.xz file is broken. We do use scripts/archive-source.sh.
Will look further.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject
2021-08-19 14:51 ` Christian Borntraeger
@ 2021-08-19 15:11 ` Christian Borntraeger
0 siblings, 0 replies; 16+ messages in thread
From: Christian Borntraeger @ 2021-08-19 15:11 UTC (permalink / raw)
To: pbonzini; +Cc: marcandre.lureau, qemu-devel, Peter Maydell
On 19.08.21 16:51, Christian Borntraeger wrote:
>
>
> On 19.08.21 10:43, Christian Borntraeger wrote:
>> Interestingly enough this breaks my rpmbuild (both rpmbuild and mock).
>> (mostly with a modified f35 spec file):
>>
>> cc -Isubprojects/libvhost-user/libvhost-user.a.p -Isubprojects/libvhost-user -I../subprojects/libvhost-user -fdiagnostics-color=auto -pipe -Wall -Winvalid-pch -std=gnu11 -O2 -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -m64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables -fstack-clash-protection -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value
>> -Wno-psabi -fstack-protector-strong -DSTAP_SDT_V2 -fPIE -pthread -D_GNU_SOURCE -MD -MQ subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o -MF subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o.d -o subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o -c ../subprojects/libvhost-user/libvhost-user.c
>> ../subprojects/libvhost-user/libvhost-user.c:43:10: fatal error: include/atomic.h: No such file or directory
>> 43 | #include "include/atomic.h"
>> | ^~~~~~~~~~~~~~~~~~
>> compilation terminated.
>>
>
> Looks like the link in the tar.xz file is broken. We do use scripts/archive-source.sh.
> Will look further.
OK, the build pipeline used tar -xform to prepend a folder name for rpmbuild. adding flags=r solved my issue.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PULL 7/7] libvhost-user: fix -Werror=format= warnings with __u64 fields
2021-07-29 12:47 [PULL 0/7] Misc patches for QEMU 6.1-rc2 Paolo Bonzini
` (5 preceding siblings ...)
2021-07-29 12:47 ` [PULL 6/7] meson: fix meson 0.58 warning with libvhost-user subproject Paolo Bonzini
@ 2021-07-29 12:47 ` Paolo Bonzini
2021-07-29 17:48 ` [PULL 0/7] Misc patches for QEMU 6.1-rc2 Peter Maydell
7 siblings, 0 replies; 16+ messages in thread
From: Paolo Bonzini @ 2021-07-29 12:47 UTC (permalink / raw)
To: qemu-devel; +Cc: Marc-André Lureau
From: Marc-André Lureau <marcandre.lureau@redhat.com>
../subprojects/libvhost-user/libvhost-user.c:1070:12: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘__u64’ {aka ‘long long unsigned int’} [-Werror=format=]
1070 | DPRINT(" desc_user_addr: 0x%016" PRIx64 "\n", vra->desc_user_addr);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
| |
| __u64 {aka long long unsigned int}
Rather than using %llx, which may fail if __u64 is declared differently
elsewhere, let's just cast the values. Feel free to propose a better solution!
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210505151313.203258-2-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
subprojects/libvhost-user/libvhost-user.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
index 2971ba0112..bf09693255 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -1067,10 +1067,10 @@ vu_set_vring_addr_exec(VuDev *dev, VhostUserMsg *vmsg)
DPRINT("vhost_vring_addr:\n");
DPRINT(" index: %d\n", vra->index);
DPRINT(" flags: %d\n", vra->flags);
- DPRINT(" desc_user_addr: 0x%016" PRIx64 "\n", vra->desc_user_addr);
- DPRINT(" used_user_addr: 0x%016" PRIx64 "\n", vra->used_user_addr);
- DPRINT(" avail_user_addr: 0x%016" PRIx64 "\n", vra->avail_user_addr);
- DPRINT(" log_guest_addr: 0x%016" PRIx64 "\n", vra->log_guest_addr);
+ DPRINT(" desc_user_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->desc_user_addr);
+ DPRINT(" used_user_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->used_user_addr);
+ DPRINT(" avail_user_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->avail_user_addr);
+ DPRINT(" log_guest_addr: 0x%016" PRIx64 "\n", (uint64_t)vra->log_guest_addr);
vq->vra = *vra;
vq->vring.flags = vra->flags;
--
2.31.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PULL 0/7] Misc patches for QEMU 6.1-rc2
2021-07-29 12:47 [PULL 0/7] Misc patches for QEMU 6.1-rc2 Paolo Bonzini
` (6 preceding siblings ...)
2021-07-29 12:47 ` [PULL 7/7] libvhost-user: fix -Werror=format= warnings with __u64 fields Paolo Bonzini
@ 2021-07-29 17:48 ` Peter Maydell
7 siblings, 0 replies; 16+ messages in thread
From: Peter Maydell @ 2021-07-29 17:48 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU Developers
On Thu, 29 Jul 2021 at 13:49, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The following changes since commit 69ea12b19a15ae006521cd5cc0f627f27f738746:
>
> Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2021-07-27' into staging (2021-07-28 13:32:12 +0100)
>
> are available in the Git repository at:
>
> https://gitlab.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to 4fe29344bef6c54a6eff7aa0343754f8a9df5715:
>
> libvhost-user: fix -Werror=format= warnings with __u64 fields (2021-07-29 10:15:52 +0200)
>
> ----------------------------------------------------------------
> Bugfixes.
>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/6.1
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 16+ messages in thread