aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-07-11 18:49:25 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-07-11 18:49:25 +0100
commit86108e23d798bcd3fce35ad271b198f8a8611746 (patch)
tree6309ee9f735760ddb608294008bb41837dfdf5f2
parent9516034d05a8c71ef157a59f525e4c4f7ed79827 (diff)
parente28ffe90fde5702aa8716ac2fa1b4116cdcc9e61 (diff)
Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-6.1-pull-request' into staging
Trivial patches pull request 20210709 # gpg: Signature made Fri 09 Jul 2021 21:26:52 BST # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/trivial-branch-for-6.1-pull-request: util/guest-random: Fix size arg to tail memcpy migration: fix typo in mig_throttle_guest_down comment target/xtensa/xtensa-semi: Fix compilation problem on Haiku hw/virtio: Document *_should_notify() are called within rcu_read_lock() misc: Remove redundant new line in perror() virtiofsd: Add missing newline in error message misc: Fix "havn't" typo memory: Display MemoryRegion name in read/write ops trace events qemu-option: Drop dead assertion Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/usb/desc-msos.c2
-rw-r--r--hw/virtio/virtio.c2
-rw-r--r--migration/ram.c2
-rw-r--r--migration/rdma.c2
-rw-r--r--softmmu/cpus.c2
-rw-r--r--softmmu/memory.c12
-rw-r--r--softmmu/trace-events4
-rw-r--r--target/s390x/translate.c6
-rw-r--r--target/xtensa/xtensa-semi.c84
-rw-r--r--tcg/arm/tcg-target.c.inc6
-rw-r--r--tcg/sparc/tcg-target.c.inc6
-rw-r--r--tcg/tcg-op.c2
-rw-r--r--tools/virtiofsd/fuse_virtio.c2
-rw-r--r--util/guest-random.c2
-rw-r--r--util/qemu-option.c2
15 files changed, 70 insertions, 66 deletions
diff --git a/hw/usb/desc-msos.c b/hw/usb/desc-msos.c
index 3a5ad7c8d0..836e38c67e 100644
--- a/hw/usb/desc-msos.c
+++ b/hw/usb/desc-msos.c
@@ -181,7 +181,7 @@ static int usb_desc_msos_prop(const USBDesc *desc, uint8_t *dest)
if (desc->msos->Label) {
/*
- * Given as example in the specs. Havn't figured yet where
+ * Given as example in the specs. Haven't figured yet where
* this label shows up in the windows gui.
*/
length += usb_desc_msos_prop_str(dest+length, MSOS_REG_SZ,
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 6dcf3baf56..874377f37a 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2447,6 +2447,7 @@ static void virtio_set_isr(VirtIODevice *vdev, int value)
}
}
+/* Called within rcu_read_lock(). */
static bool virtio_split_should_notify(VirtIODevice *vdev, VirtQueue *vq)
{
uint16_t old, new;
@@ -2483,6 +2484,7 @@ static bool vring_packed_need_event(VirtQueue *vq, bool wrap,
return vring_need_event(off, new, old);
}
+/* Called within rcu_read_lock(). */
static bool virtio_packed_should_notify(VirtIODevice *vdev, VirtQueue *vq)
{
VRingPackedDescEvent e;
diff --git a/migration/ram.c b/migration/ram.c
index 723af67c2e..88ff34f574 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -600,7 +600,7 @@ static size_t save_page_header(RAMState *rs, QEMUFile *f, RAMBlock *block,
}
/**
- * mig_throttle_guest_down: throotle down the guest
+ * mig_throttle_guest_down: throttle down the guest
*
* Reduce amount of guest cpu execution to hopefully slow down memory
* writes. If guest dirty memory rate is reduced below the rate at
diff --git a/migration/rdma.c b/migration/rdma.c
index b6cc4bef4a..38a099f7ee 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -1131,7 +1131,7 @@ static int qemu_rdma_reg_whole_ram_blocks(RDMAContext *rdma)
IBV_ACCESS_REMOTE_WRITE
);
if (!local->block[i].mr) {
- perror("Failed to register local dest ram block!\n");
+ perror("Failed to register local dest ram block!");
break;
}
rdma->total_registrations++;
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index c3caaeb26e..071085f840 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -325,7 +325,7 @@ static void sigbus_reraise(void)
sigaddset(&set, SIGBUS);
pthread_sigmask(SIG_UNBLOCK, &set, NULL);
}
- perror("Failed to re-raise SIGBUS!\n");
+ perror("Failed to re-raise SIGBUS!");
abort();
}
diff --git a/softmmu/memory.c b/softmmu/memory.c
index cea2f622c9..bfedaf9c4d 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -442,7 +442,8 @@ static MemTxResult memory_region_read_accessor(MemoryRegion *mr,
trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size);
} else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_READ)) {
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
- trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size);
+ trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size,
+ memory_region_name(mr));
}
memory_region_shift_read_access(value, shift, mask, tmp);
return MEMTX_OK;
@@ -464,7 +465,8 @@ static MemTxResult memory_region_read_with_attrs_accessor(MemoryRegion *mr,
trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size);
} else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_READ)) {
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
- trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size);
+ trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, size,
+ memory_region_name(mr));
}
memory_region_shift_read_access(value, shift, mask, tmp);
return r;
@@ -484,7 +486,8 @@ static MemTxResult memory_region_write_accessor(MemoryRegion *mr,
trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);
} else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_WRITE)) {
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
- trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size);
+ trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size,
+ memory_region_name(mr));
}
mr->ops->write(mr->opaque, addr, tmp, size);
return MEMTX_OK;
@@ -504,7 +507,8 @@ static MemTxResult memory_region_write_with_attrs_accessor(MemoryRegion *mr,
trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, size);
} else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_WRITE)) {
hwaddr abs_addr = memory_region_to_absolute_addr(mr, addr);
- trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size);
+ trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, size,
+ memory_region_name(mr));
}
return mr->ops->write_with_attrs(mr->opaque, addr, tmp, size, attrs);
}
diff --git a/softmmu/trace-events b/softmmu/trace-events
index d18ac41e4e..7b278590a0 100644
--- a/softmmu/trace-events
+++ b/softmmu/trace-events
@@ -9,8 +9,8 @@ cpu_in(unsigned int addr, char size, unsigned int val) "addr 0x%x(%c) value %u"
cpu_out(unsigned int addr, char size, unsigned int val) "addr 0x%x(%c) value %u"
# memory.c
-memory_region_ops_read(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64" size %u"
-memory_region_ops_write(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64" size %u"
+memory_region_ops_read(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size, const char *name) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64" size %u name '%s'"
+memory_region_ops_write(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size, const char *name) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64" size %u name '%s'"
memory_region_subpage_read(int cpu_index, void *mr, uint64_t offset, uint64_t value, unsigned size) "cpu %d mr %p offset 0x%"PRIx64" value 0x%"PRIx64" size %u"
memory_region_subpage_write(int cpu_index, void *mr, uint64_t offset, uint64_t value, unsigned size) "cpu %d mr %p offset 0x%"PRIx64" value 0x%"PRIx64" size %u"
memory_region_ram_device_read(int cpu_index, void *mr, uint64_t addr, uint64_t value, unsigned size) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64" size %u"
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index 03dab9f350..8822603a6e 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -6270,8 +6270,10 @@ static void extract_field(DisasFields *o, const DisasField *f, uint64_t insn)
abort();
}
- /* Validate that the "compressed" encoding we selected above is valid.
- I.e. we havn't make two different original fields overlap. */
+ /*
+ * Validate that the "compressed" encoding we selected above is valid.
+ * I.e. we haven't made two different original fields overlap.
+ */
assert(((o->presentC >> f->indexC) & 1) == 0);
o->presentC |= 1 << f->indexC;
o->presentO |= 1 << f->indexO;
diff --git a/target/xtensa/xtensa-semi.c b/target/xtensa/xtensa-semi.c
index 79f2b043f2..fa21b7e11f 100644
--- a/target/xtensa/xtensa-semi.c
+++ b/target/xtensa/xtensa-semi.c
@@ -95,59 +95,53 @@ enum {
static uint32_t errno_h2g(int host_errno)
{
- static const uint32_t guest_errno[] = {
- [EPERM] = TARGET_EPERM,
- [ENOENT] = TARGET_ENOENT,
- [ESRCH] = TARGET_ESRCH,
- [EINTR] = TARGET_EINTR,
- [EIO] = TARGET_EIO,
- [ENXIO] = TARGET_ENXIO,
- [E2BIG] = TARGET_E2BIG,
- [ENOEXEC] = TARGET_ENOEXEC,
- [EBADF] = TARGET_EBADF,
- [ECHILD] = TARGET_ECHILD,
- [EAGAIN] = TARGET_EAGAIN,
- [ENOMEM] = TARGET_ENOMEM,
- [EACCES] = TARGET_EACCES,
- [EFAULT] = TARGET_EFAULT,
+ switch (host_errno) {
+ case 0: return 0;
+ case EPERM: return TARGET_EPERM;
+ case ENOENT: return TARGET_ENOENT;
+ case ESRCH: return TARGET_ESRCH;
+ case EINTR: return TARGET_EINTR;
+ case EIO: return TARGET_EIO;
+ case ENXIO: return TARGET_ENXIO;
+ case E2BIG: return TARGET_E2BIG;
+ case ENOEXEC: return TARGET_ENOEXEC;
+ case EBADF: return TARGET_EBADF;
+ case ECHILD: return TARGET_ECHILD;
+ case EAGAIN: return TARGET_EAGAIN;
+ case ENOMEM: return TARGET_ENOMEM;
+ case EACCES: return TARGET_EACCES;
+ case EFAULT: return TARGET_EFAULT;
#ifdef ENOTBLK
- [ENOTBLK] = TARGET_ENOTBLK,
+ case ENOTBLK: return TARGET_ENOTBLK;
#endif
- [EBUSY] = TARGET_EBUSY,
- [EEXIST] = TARGET_EEXIST,
- [EXDEV] = TARGET_EXDEV,
- [ENODEV] = TARGET_ENODEV,
- [ENOTDIR] = TARGET_ENOTDIR,
- [EISDIR] = TARGET_EISDIR,
- [EINVAL] = TARGET_EINVAL,
- [ENFILE] = TARGET_ENFILE,
- [EMFILE] = TARGET_EMFILE,
- [ENOTTY] = TARGET_ENOTTY,
+ case EBUSY: return TARGET_EBUSY;
+ case EEXIST: return TARGET_EEXIST;
+ case EXDEV: return TARGET_EXDEV;
+ case ENODEV: return TARGET_ENODEV;
+ case ENOTDIR: return TARGET_ENOTDIR;
+ case EISDIR: return TARGET_EISDIR;
+ case EINVAL: return TARGET_EINVAL;
+ case ENFILE: return TARGET_ENFILE;
+ case EMFILE: return TARGET_EMFILE;
+ case ENOTTY: return TARGET_ENOTTY;
#ifdef ETXTBSY
- [ETXTBSY] = TARGET_ETXTBSY,
+ case ETXTBSY: return TARGET_ETXTBSY;
#endif
- [EFBIG] = TARGET_EFBIG,
- [ENOSPC] = TARGET_ENOSPC,
- [ESPIPE] = TARGET_ESPIPE,
- [EROFS] = TARGET_EROFS,
- [EMLINK] = TARGET_EMLINK,
- [EPIPE] = TARGET_EPIPE,
- [EDOM] = TARGET_EDOM,
- [ERANGE] = TARGET_ERANGE,
- [ENOSYS] = TARGET_ENOSYS,
+ case EFBIG: return TARGET_EFBIG;
+ case ENOSPC: return TARGET_ENOSPC;
+ case ESPIPE: return TARGET_ESPIPE;
+ case EROFS: return TARGET_EROFS;
+ case EMLINK: return TARGET_EMLINK;
+ case EPIPE: return TARGET_EPIPE;
+ case EDOM: return TARGET_EDOM;
+ case ERANGE: return TARGET_ERANGE;
+ case ENOSYS: return TARGET_ENOSYS;
#ifdef ELOOP
- [ELOOP] = TARGET_ELOOP,
+ case ELOOP: return TARGET_ELOOP;
#endif
};
- if (host_errno == 0) {
- return 0;
- } else if (host_errno > 0 && host_errno < ARRAY_SIZE(guest_errno) &&
- guest_errno[host_errno]) {
- return guest_errno[host_errno];
- } else {
- return TARGET_EINVAL;
- }
+ return TARGET_EINVAL;
}
typedef struct XtensaSimConsole {
diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc
index 7a761a602e..007ceee68e 100644
--- a/tcg/arm/tcg-target.c.inc
+++ b/tcg/arm/tcg-target.c.inc
@@ -2407,8 +2407,10 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op)
static void tcg_target_init(TCGContext *s)
{
- /* Only probe for the platform and capabilities if we havn't already
- determined maximum values at compile time. */
+ /*
+ * Only probe for the platform and capabilities if we haven't already
+ * determined maximum values at compile time.
+ */
#if !defined(use_idiv_instructions) || !defined(use_neon_instructions)
{
unsigned long hwcap = qemu_getauxval(AT_HWCAP);
diff --git a/tcg/sparc/tcg-target.c.inc b/tcg/sparc/tcg-target.c.inc
index a6ec94a094..688827968b 100644
--- a/tcg/sparc/tcg-target.c.inc
+++ b/tcg/sparc/tcg-target.c.inc
@@ -1690,8 +1690,10 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op)
static void tcg_target_init(TCGContext *s)
{
- /* Only probe for the platform and capabilities if we havn't already
- determined maximum values at compile time. */
+ /*
+ * Only probe for the platform and capabilities if we haven't already
+ * determined maximum values at compile time.
+ */
#ifndef use_vis3_instructions
{
unsigned long hwcap = qemu_getauxval(AT_HWCAP);
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 44d711c0fc..58a34b5147 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -2741,7 +2741,7 @@ void tcg_gen_goto_tb(unsigned idx)
/* We only support two chained exits. */
tcg_debug_assert(idx <= TB_EXIT_IDXMAX);
#ifdef CONFIG_DEBUG_TCG
- /* Verify that we havn't seen this numbered exit before. */
+ /* Verify that we haven't seen this numbered exit before. */
tcg_debug_assert((tcg_ctx->goto_tb_issue_mask & (1 << idx)) == 0);
tcg_ctx->goto_tb_issue_mask |= 1 << idx;
#endif
diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
index fa4aff9b0e..fc2564a603 100644
--- a/tools/virtiofsd/fuse_virtio.c
+++ b/tools/virtiofsd/fuse_virtio.c
@@ -917,7 +917,7 @@ static bool fv_socket_lock(struct fuse_session *se)
dir = qemu_get_local_state_pathname("run/virtiofsd");
if (g_mkdir_with_parents(dir, S_IRWXU) < 0) {
- fuse_log(FUSE_LOG_ERR, "%s: Failed to create directory %s: %s",
+ fuse_log(FUSE_LOG_ERR, "%s: Failed to create directory %s: %s\n",
__func__, dir, strerror(errno));
return false;
}
diff --git a/util/guest-random.c b/util/guest-random.c
index 086115bd67..23643f86cc 100644
--- a/util/guest-random.c
+++ b/util/guest-random.c
@@ -38,7 +38,7 @@ static int glib_random_bytes(void *buf, size_t len)
}
if (i < len) {
x = g_rand_int(rand);
- __builtin_memcpy(buf + i, &x, i - len);
+ __builtin_memcpy(buf + i, &x, len - i);
}
return 0;
}
diff --git a/util/qemu-option.c b/util/qemu-option.c
index ee78e42216..61cb4a97bd 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -997,8 +997,6 @@ QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict,
return NULL;
}
- assert(opts != NULL);
-
for (entry = qdict_first(qdict);
entry;
entry = qdict_next(qdict, entry)) {