Skip to content

Commit

Permalink
Merge tag 'pull-request-2022-04-01' of https://gitlab.com/thuth/qemu
Browse files Browse the repository at this point in the history
…into staging

* Fix some compilation issues
* Fix overflow calculation in s390x emulation
* Update location of lockdown.yml in MAINTAINERS file

# gpg: Signature made Fri 01 Apr 2022 12:27:38 BST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2022-04-01' of https://gitlab.com/thuth/qemu:
  trace: fix compilation with lttng-ust >= 2.13
  9p: move P9_XATTR_SIZE_MAX from 9p.h to 9p.c
  meson.build: Fix dependency of page-vary-common.c to config-poison.h
  target/s390x: Fix determination of overflow condition code after subtraction
  target/s390x: Fix determination of overflow condition code after addition
  misc: Fixes MAINTAINERS's path .github/workflows/lockdown.yml

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Apr 2, 2022
2 parents ea72ac9 + e32aaa5 commit bc6ec39
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Expand Up @@ -3615,7 +3615,7 @@ M: Thomas Huth <thuth@redhat.com>
R: Wainer dos Santos Moschetta <wainersm@redhat.com>
R: Beraldo Leal <bleal@redhat.com>
S: Maintained
F: .github/lockdown.yml
F: .github/workflows/lockdown.yml
F: .gitlab-ci.yml
F: .gitlab-ci.d/
F: .travis.yml
Expand Down
28 changes: 23 additions & 5 deletions hw/9pfs/9p.c
Expand Up @@ -17,6 +17,11 @@
*/

#include "qemu/osdep.h"
#ifdef CONFIG_LINUX
#include <linux/limits.h>
#else
#include <limits.h>
#endif
#include <glib/gprintf.h>
#include "hw/virtio/virtio.h"
#include "qapi/error.h"
Expand All @@ -33,11 +38,6 @@
#include "migration/blocker.h"
#include "qemu/xxhash.h"
#include <math.h>
#ifdef CONFIG_LINUX
#include <linux/limits.h>
#else
#include <limits.h>
#endif

int open_fd_hw;
int total_open_fd;
Expand Down Expand Up @@ -3925,6 +3925,24 @@ static void coroutine_fn v9fs_xattrwalk(void *opaque)
v9fs_string_free(&name);
}

#if defined(CONFIG_LINUX)
/* Currently, only Linux has XATTR_SIZE_MAX */
#define P9_XATTR_SIZE_MAX XATTR_SIZE_MAX
#elif defined(CONFIG_DARWIN)
/*
* Darwin doesn't seem to define a maximum xattr size in its user
* space header, so manually configure it across platforms as 64k.
*
* Having no limit at all can lead to QEMU crashing during large g_malloc()
* calls. Because QEMU does not currently support macOS guests, the below
* preliminary solution only works due to its being a reflection of the limit of
* Linux guests.
*/
#define P9_XATTR_SIZE_MAX 65536
#else
#error Missing definition for P9_XATTR_SIZE_MAX for this host system
#endif

static void coroutine_fn v9fs_xattrcreate(void *opaque)
{
int flags, rflags = 0;
Expand Down
18 changes: 0 additions & 18 deletions hw/9pfs/9p.h
Expand Up @@ -479,22 +479,4 @@ struct V9fsTransport {
void (*push_and_notify)(V9fsPDU *pdu);
};

#if defined(XATTR_SIZE_MAX)
/* Linux */
#define P9_XATTR_SIZE_MAX XATTR_SIZE_MAX
#elif defined(CONFIG_DARWIN)
/*
* Darwin doesn't seem to define a maximum xattr size in its user
* space header, so manually configure it across platforms as 64k.
*
* Having no limit at all can lead to QEMU crashing during large g_malloc()
* calls. Because QEMU does not currently support macOS guests, the below
* preliminary solution only works due to its being a reflection of the limit of
* Linux guests.
*/
#define P9_XATTR_SIZE_MAX 65536
#else
#error Missing definition for P9_XATTR_SIZE_MAX for this host system
#endif

#endif
6 changes: 3 additions & 3 deletions meson.build
Expand Up @@ -455,8 +455,8 @@ if 'CONFIG_GIO' in config_host
endif
lttng = not_found
if 'ust' in get_option('trace_backends')
lttng = dependency('lttng-ust', required: true, method: 'pkg-config',
kwargs: static_kwargs)
lttng = dependency('lttng-ust', required: true, version: '>= 2.1',
method: 'pkg-config', kwargs: static_kwargs)
endif
pixman = not_found
if have_system or have_tools
Expand Down Expand Up @@ -2881,7 +2881,7 @@ if get_option('b_lto')
if get_option('cfi')
pagevary_flags += '-fno-sanitize=cfi-icall'
endif
pagevary = static_library('page-vary-common', sources: pagevary,
pagevary = static_library('page-vary-common', sources: pagevary + genh,
c_args: pagevary_flags)
pagevary = declare_dependency(link_with: pagevary)
endif
Expand Down
4 changes: 2 additions & 2 deletions scripts/tracetool/format/ust_events_h.py
Expand Up @@ -29,8 +29,8 @@ def generate(events, backend, group):
'#undef TRACEPOINT_PROVIDER',
'#define TRACEPOINT_PROVIDER qemu',
'',
'#undef TRACEPOINT_INCLUDE_FILE',
'#define TRACEPOINT_INCLUDE_FILE ./%s' % include,
'#undef TRACEPOINT_INCLUDE',
'#define TRACEPOINT_INCLUDE "./%s"' % include,
'',
'#if !defined (TRACE_%s_GENERATED_UST_H) || \\' % group.upper(),
' defined(TRACEPOINT_HEADER_MULTI_READ)',
Expand Down
8 changes: 4 additions & 4 deletions target/s390x/tcg/cc_helper.c
Expand Up @@ -136,7 +136,7 @@ static uint32_t cc_calc_subu(uint64_t borrow_out, uint64_t result)

static uint32_t cc_calc_add_64(int64_t a1, int64_t a2, int64_t ar)
{
if ((a1 > 0 && a2 > 0 && ar < 0) || (a1 < 0 && a2 < 0 && ar > 0)) {
if ((a1 > 0 && a2 > 0 && ar < 0) || (a1 < 0 && a2 < 0 && ar >= 0)) {
return 3; /* overflow */
} else {
if (ar < 0) {
Expand All @@ -151,7 +151,7 @@ static uint32_t cc_calc_add_64(int64_t a1, int64_t a2, int64_t ar)

static uint32_t cc_calc_sub_64(int64_t a1, int64_t a2, int64_t ar)
{
if ((a1 > 0 && a2 < 0 && ar < 0) || (a1 < 0 && a2 > 0 && ar > 0)) {
if ((a1 >= 0 && a2 < 0 && ar < 0) || (a1 < 0 && a2 > 0 && ar > 0)) {
return 3; /* overflow */
} else {
if (ar < 0) {
Expand Down Expand Up @@ -196,7 +196,7 @@ static uint32_t cc_calc_comp_64(int64_t dst)

static uint32_t cc_calc_add_32(int32_t a1, int32_t a2, int32_t ar)
{
if ((a1 > 0 && a2 > 0 && ar < 0) || (a1 < 0 && a2 < 0 && ar > 0)) {
if ((a1 > 0 && a2 > 0 && ar < 0) || (a1 < 0 && a2 < 0 && ar >= 0)) {
return 3; /* overflow */
} else {
if (ar < 0) {
Expand All @@ -211,7 +211,7 @@ static uint32_t cc_calc_add_32(int32_t a1, int32_t a2, int32_t ar)

static uint32_t cc_calc_sub_32(int32_t a1, int32_t a2, int32_t ar)
{
if ((a1 > 0 && a2 < 0 && ar < 0) || (a1 < 0 && a2 > 0 && ar > 0)) {
if ((a1 >= 0 && a2 < 0 && ar < 0) || (a1 < 0 && a2 > 0 && ar > 0)) {
return 3; /* overflow */
} else {
if (ar < 0) {
Expand Down

0 comments on commit bc6ec39

Please sign in to comment.