Fix memory leak with fdt
cosmetic change in code and logs update mailmap -----BEGIN PGP SIGNATURE----- iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAl5NCtwSHGxhdXJlbnRA dml2aWVyLmV1AAoJEPMMOL0/L748GMMQAIX/UNIKHIIYUYM/5mrBQjQzk/OTZ0F8 7GqsYkOJ3U189iZsbMTCkCo3uQjP1+qKBRGhEq/hWozItTpvKwwfg6V5e8/8UUYn CREUZVBnSj2GcBHCSyK0+h6carG/ThuRc5m6QFPG4OMKDR6FTbvleeUTWhgPAJ3t /jhIj9+MlKYFJ9VmMRYs47ZMGoX0KDX1m9L6fx7pllwHM3DbFF5L1GieHrdnnDYu 7az+KZsFkvIu2yuyonzIApitriRjPmb5DM2udxRoX2ZxhkZU0OARzQVxfx+rsilJ puuD1mc8PwQTbdAFi0y/5IvL7OkX7lV09cxnBk4wLoxKsJFn+2F0YN+iMVkcY+B3 BKr2uwikvolb5BQgfpZg7bJboHABuHy+PGBiX3EC/F93k11bIIF/XM2bEz/Kwt3K cY7DLDxEQfEcyuHeFdmT23qE0xyrQytkgIU6Vefp2YuOvpeNNVC7KNnrnIfo32dt TvoRFCoW2s3ALevoBHBHmbbZzFGjvBV2377kiA8yDTb0aHsnzXeptVYojFVG76Td qpy6e/OWnhh08FB4HTTeWx2VlHMUjC6XiYsbcxvMcmKLd5gNh+fQ5HNYKXseyJ7J I0AYCH6l9lYKFp0/NxzW6m8bPso9m5IxltPy+5Y6HaXjGg6RJgwx2aM/U+GYkrY6 2oN84MPK/PZT =HsOM -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pull-request' into staging Fix memory leak with fdt cosmetic change in code and logs update mailmap # gpg: Signature made Wed 19 Feb 2020 10:15:56 GMT # 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-pull-request: hw/xtensa/xtfpga:fix leak of fdevice tree blob hw/nios2:fix leak of fdevice tree blob hw/net/rocker: Report unimplemented feature with qemu_log_mask(UNIMP) hw/block/pflash_cfi02: Remove unneeded variable assignment hw/display/qxl: Remove unneeded variable assignment contrib/rdmacm-mux: Remove superfluous semicolon tests/qtest/libqos/qgraph: Remove superfluous semicolons target/i386/whpx: Remove superfluous semicolon ui/input-barrier: Remove superfluous semicolon hw/vfio/display: Remove superfluous semicolon hw/scsi/esp: Remove superfluous semicolon hw/m68k/next-cube: Remove superfluous semicolon hw/arm/xlnx-versal: Remove superfluous semicolon audio/alsaaudio: Remove superfluous semicolons scripts/checkpatch.pl: Detect superfluous semicolon in C code Report stringified errno in VFIO related errors mailmap: Add entry for Yu-Chen Lin Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
7afee874f1
3
.mailmap
3
.mailmap
|
@ -152,7 +152,8 @@ Xiaoqiang Zhao <zxq_yx_007@163.com>
|
||||||
Xinhua Cao <caoxinhua@huawei.com>
|
Xinhua Cao <caoxinhua@huawei.com>
|
||||||
Xiong Zhang <xiong.y.zhang@intel.com>
|
Xiong Zhang <xiong.y.zhang@intel.com>
|
||||||
Yin Yin <yin.yin@cs2c.com.cn>
|
Yin Yin <yin.yin@cs2c.com.cn>
|
||||||
yuchenlin <npes87184@gmail.com>
|
Yu-Chen Lin <npes87184@gmail.com>
|
||||||
|
Yu-Chen Lin <npes87184@gmail.com> <yuchenlin@synology.com>
|
||||||
YunQiang Su <syq@debian.org>
|
YunQiang Su <syq@debian.org>
|
||||||
YunQiang Su <ysu@wavecomp.com>
|
YunQiang Su <ysu@wavecomp.com>
|
||||||
Yuri Pudgorodskiy <yur@virtuozzo.com>
|
Yuri Pudgorodskiy <yur@virtuozzo.com>
|
||||||
|
|
|
@ -819,7 +819,7 @@ static size_t alsa_read(HWVoiceIn *hw, void *buf, size_t len)
|
||||||
switch (nread) {
|
switch (nread) {
|
||||||
case 0:
|
case 0:
|
||||||
trace_alsa_read_zero(len);
|
trace_alsa_read_zero(len);
|
||||||
return pos;;
|
return pos;
|
||||||
|
|
||||||
case -EPIPE:
|
case -EPIPE:
|
||||||
if (alsa_recover(alsa->handle)) {
|
if (alsa_recover(alsa->handle)) {
|
||||||
|
@ -835,7 +835,7 @@ static size_t alsa_read(HWVoiceIn *hw, void *buf, size_t len)
|
||||||
default:
|
default:
|
||||||
alsa_logerr(nread, "Failed to read %zu frames to %p\n",
|
alsa_logerr(nread, "Failed to read %zu frames to %p\n",
|
||||||
len, dst);
|
len, dst);
|
||||||
return pos;;
|
return pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -490,7 +490,7 @@ static int read_and_process(int fd)
|
||||||
|
|
||||||
static int accept_all(void)
|
static int accept_all(void)
|
||||||
{
|
{
|
||||||
int fd, rc = 0;;
|
int fd, rc = 0;
|
||||||
|
|
||||||
pthread_rwlock_wrlock(&server.lock);
|
pthread_rwlock_wrlock(&server.lock);
|
||||||
|
|
||||||
|
|
|
@ -350,7 +350,7 @@ static void create_virtio_regions(VersalVirt *s)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
|
for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
|
||||||
char *name = g_strdup_printf("virtio%d", i);;
|
char *name = g_strdup_printf("virtio%d", i);
|
||||||
hwaddr base = MM_TOP_RSVD + i * virtio_mmio_size;
|
hwaddr base = MM_TOP_RSVD + i * virtio_mmio_size;
|
||||||
int irq = VERSAL_RSVD_IRQ_FIRST + i;
|
int irq = VERSAL_RSVD_IRQ_FIRST + i;
|
||||||
MemoryRegion *mr;
|
MemoryRegion *mr;
|
||||||
|
|
|
@ -308,7 +308,6 @@ static uint64_t pflash_read(void *opaque, hwaddr offset, unsigned int width)
|
||||||
hwaddr boff;
|
hwaddr boff;
|
||||||
uint64_t ret;
|
uint64_t ret;
|
||||||
|
|
||||||
ret = -1;
|
|
||||||
/* Lazy reset to ROMD mode after a certain amount of read accesses */
|
/* Lazy reset to ROMD mode after a certain amount of read accesses */
|
||||||
if (!pfl->rom_mode && pfl->wcycle == 0 &&
|
if (!pfl->rom_mode && pfl->wcycle == 0 &&
|
||||||
++pfl->read_counter > PFLASH_LAZY_ROMD_THRESHOLD) {
|
++pfl->read_counter > PFLASH_LAZY_ROMD_THRESHOLD) {
|
||||||
|
|
|
@ -1631,7 +1631,7 @@ static void ioport_write(void *opaque, hwaddr addr,
|
||||||
PCIQXLDevice *d = opaque;
|
PCIQXLDevice *d = opaque;
|
||||||
uint32_t io_port = addr;
|
uint32_t io_port = addr;
|
||||||
qxl_async_io async = QXL_SYNC;
|
qxl_async_io async = QXL_SYNC;
|
||||||
uint32_t orig_io_port = io_port;
|
uint32_t orig_io_port;
|
||||||
|
|
||||||
if (d->guest_bug && io_port != QXL_IO_RESET) {
|
if (d->guest_bug && io_port != QXL_IO_RESET) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -734,7 +734,7 @@ void next_irq(void *opaque, int number, int level)
|
||||||
switch (number) {
|
switch (number) {
|
||||||
/* level 3 - floppy, kbd/mouse, power, ether rx/tx, scsi, clock */
|
/* level 3 - floppy, kbd/mouse, power, ether rx/tx, scsi, clock */
|
||||||
case NEXT_FD_I:
|
case NEXT_FD_I:
|
||||||
shift = 7;;
|
shift = 7;
|
||||||
break;
|
break;
|
||||||
case NEXT_KBD_I:
|
case NEXT_KBD_I:
|
||||||
shift = 3;
|
shift = 3;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "qemu/iov.h"
|
#include "qemu/iov.h"
|
||||||
#include "qemu/module.h"
|
#include "qemu/module.h"
|
||||||
#include "qemu/bitops.h"
|
#include "qemu/bitops.h"
|
||||||
|
#include "qemu/log.h"
|
||||||
|
|
||||||
#include "rocker.h"
|
#include "rocker.h"
|
||||||
#include "rocker_hw.h"
|
#include "rocker_hw.h"
|
||||||
|
@ -207,14 +208,22 @@ static int tx_consume(Rocker *r, DescInfo *info)
|
||||||
|
|
||||||
if (tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]) {
|
if (tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]) {
|
||||||
tx_l3_csum_off = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]);
|
tx_l3_csum_off = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_L3_CSUM_OFF]);
|
||||||
|
qemu_log_mask(LOG_UNIMP, "rocker %s: L3 not implemented"
|
||||||
|
" (cksum off: %u)\n",
|
||||||
|
__func__, tx_l3_csum_off);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tlvs[ROCKER_TLV_TX_TSO_MSS]) {
|
if (tlvs[ROCKER_TLV_TX_TSO_MSS]) {
|
||||||
tx_tso_mss = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_MSS]);
|
tx_tso_mss = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_MSS]);
|
||||||
|
qemu_log_mask(LOG_UNIMP, "rocker %s: TSO not implemented (MSS: %u)\n",
|
||||||
|
__func__, tx_tso_mss);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]) {
|
if (tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]) {
|
||||||
tx_tso_hdr_len = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]);
|
tx_tso_hdr_len = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_TSO_HDR_LEN]);
|
||||||
|
qemu_log_mask(LOG_UNIMP, "rocker %s: TSO not implemented"
|
||||||
|
" (hdr length: %u)\n",
|
||||||
|
__func__, tx_tso_hdr_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
rocker_tlv_for_each_nested(tlv_frag, tlvs[ROCKER_TLV_TX_FRAGS], rem) {
|
rocker_tlv_for_each_nested(tlv_frag, tlvs[ROCKER_TLV_TX_FRAGS], rem) {
|
||||||
|
@ -249,12 +258,6 @@ static int tx_consume(Rocker *r, DescInfo *info)
|
||||||
iovcnt++;
|
iovcnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iovcnt) {
|
|
||||||
/* XXX perform Tx offloads */
|
|
||||||
/* XXX silence compiler for now */
|
|
||||||
tx_l3_csum_off += tx_tso_mss = tx_tso_hdr_len = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = fp_port_eg(r->fp_port[port], iov, iovcnt);
|
err = fp_port_eg(r->fp_port[port], iov, iovcnt);
|
||||||
|
|
||||||
err_too_many_frags:
|
err_too_many_frags:
|
||||||
|
|
|
@ -109,6 +109,7 @@ static int nios2_load_dtb(struct nios2_boot_info bi, const uint32_t ramsize,
|
||||||
}
|
}
|
||||||
|
|
||||||
cpu_physical_memory_write(bi.fdt, fdt, fdt_size);
|
cpu_physical_memory_write(bi.fdt, fdt, fdt_size);
|
||||||
|
g_free(fdt);
|
||||||
return fdt_size;
|
return fdt_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -293,7 +293,7 @@ static void handle_satn_stop(ESPState *s)
|
||||||
s->dma_cb = handle_satn_stop;
|
s->dma_cb = handle_satn_stop;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
s->pdma_cb = satn_stop_pdma_cb;;
|
s->pdma_cb = satn_stop_pdma_cb;
|
||||||
s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf));
|
s->cmdlen = get_cmd(s, s->cmdbuf, sizeof(s->cmdbuf));
|
||||||
if (s->cmdlen) {
|
if (s->cmdlen) {
|
||||||
trace_esp_handle_satn_stop(s->cmdlen);
|
trace_esp_handle_satn_stop(s->cmdlen);
|
||||||
|
|
|
@ -319,7 +319,7 @@ static int vfio_dma_unmap(VFIOContainer *container,
|
||||||
unmap.size -= 1ULL << ctz64(container->pgsizes);
|
unmap.size -= 1ULL << ctz64(container->pgsizes);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
error_report("VFIO_UNMAP_DMA: %d", -errno);
|
error_report("VFIO_UNMAP_DMA failed: %s", strerror(errno));
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,7 +352,7 @@ static int vfio_dma_map(VFIOContainer *container, hwaddr iova,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_report("VFIO_MAP_DMA: %d", -errno);
|
error_report("VFIO_MAP_DMA failed: %s", strerror(errno));
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -287,7 +287,7 @@ static void vfio_display_dmabuf_update(void *opaque)
|
||||||
VFIOPCIDevice *vdev = opaque;
|
VFIOPCIDevice *vdev = opaque;
|
||||||
VFIODisplay *dpy = vdev->dpy;
|
VFIODisplay *dpy = vdev->dpy;
|
||||||
VFIODMABuf *primary, *cursor;
|
VFIODMABuf *primary, *cursor;
|
||||||
bool free_bufs = false, new_cursor = false;;
|
bool free_bufs = false, new_cursor = false;
|
||||||
|
|
||||||
primary = vfio_display_get_dmabuf(vdev, DRM_PLANE_TYPE_PRIMARY);
|
primary = vfio_display_get_dmabuf(vdev, DRM_PLANE_TYPE_PRIMARY);
|
||||||
if (primary == NULL) {
|
if (primary == NULL) {
|
||||||
|
|
|
@ -380,6 +380,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)
|
||||||
cur_tagptr = put_tag(cur_tagptr, BP_TAG_FDT,
|
cur_tagptr = put_tag(cur_tagptr, BP_TAG_FDT,
|
||||||
sizeof(dtb_addr), &dtb_addr);
|
sizeof(dtb_addr), &dtb_addr);
|
||||||
cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4 * KiB);
|
cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4 * KiB);
|
||||||
|
g_free(fdt);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (dtb_filename) {
|
if (dtb_filename) {
|
||||||
|
|
|
@ -1830,6 +1830,11 @@ sub process {
|
||||||
ERROR("suspicious ; after while (0)\n" . $herecurr);
|
ERROR("suspicious ; after while (0)\n" . $herecurr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check superfluous trailing ';'
|
||||||
|
if ($line =~ /;;$/) {
|
||||||
|
ERROR("superfluous trailing semicolon\n" . $herecurr);
|
||||||
|
}
|
||||||
|
|
||||||
# Check relative indent for conditionals and blocks.
|
# Check relative indent for conditionals and blocks.
|
||||||
if ($line =~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) {
|
if ($line =~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) {
|
||||||
my ($s, $c) = ($stat, $cond);
|
my ($s, $c) = ($stat, $cond);
|
||||||
|
|
|
@ -511,7 +511,7 @@ static void whpx_get_registers(CPUState *cpu)
|
||||||
/* WHvX64RegisterPat - Skipped */
|
/* WHvX64RegisterPat - Skipped */
|
||||||
|
|
||||||
assert(whpx_register_names[idx] == WHvX64RegisterSysenterCs);
|
assert(whpx_register_names[idx] == WHvX64RegisterSysenterCs);
|
||||||
env->sysenter_cs = vcxt.values[idx++].Reg64;;
|
env->sysenter_cs = vcxt.values[idx++].Reg64;
|
||||||
assert(whpx_register_names[idx] == WHvX64RegisterSysenterEip);
|
assert(whpx_register_names[idx] == WHvX64RegisterSysenterEip);
|
||||||
env->sysenter_eip = vcxt.values[idx++].Reg64;
|
env->sysenter_eip = vcxt.values[idx++].Reg64;
|
||||||
assert(whpx_register_names[idx] == WHvX64RegisterSysenterEsp);
|
assert(whpx_register_names[idx] == WHvX64RegisterSysenterEsp);
|
||||||
|
|
|
@ -474,7 +474,7 @@ QOSEdgeType qos_graph_edge_get_type(QOSGraphEdge *edge)
|
||||||
if (!edge) {
|
if (!edge) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return edge->type;;
|
return edge->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *qos_graph_edge_get_dest(QOSGraphEdge *edge)
|
char *qos_graph_edge_get_dest(QOSGraphEdge *edge)
|
||||||
|
@ -590,7 +590,7 @@ void qos_add_test(const char *name, const char *interface,
|
||||||
QOSTestFunc test_func, QOSGraphTestOptions *opts)
|
QOSTestFunc test_func, QOSGraphTestOptions *opts)
|
||||||
{
|
{
|
||||||
QOSGraphNode *node;
|
QOSGraphNode *node;
|
||||||
char *test_name = g_strdup_printf("%s-tests/%s", interface, name);;
|
char *test_name = g_strdup_printf("%s-tests/%s", interface, name);
|
||||||
QOSGraphTestOptions def_opts = { };
|
QOSGraphTestOptions def_opts = { };
|
||||||
|
|
||||||
if (!opts) {
|
if (!opts) {
|
||||||
|
|
|
@ -455,7 +455,7 @@ static gboolean writecmd(InputBarrier *ib, struct barrierMsg *msg)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
write_cmd(p, barrierCmdEUnknown, avail);
|
write_cmd(p, barrierCmdEUnknown, avail);
|
||||||
break;;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = MAX_HELLO_LENGTH - avail - sizeof(int);
|
len = MAX_HELLO_LENGTH - avail - sizeof(int);
|
||||||
|
|
|
@ -545,7 +545,7 @@ static int qemu_vfio_do_mapping(QEMUVFIOState *s, void *host, size_t size,
|
||||||
trace_qemu_vfio_do_mapping(s, host, size, iova);
|
trace_qemu_vfio_do_mapping(s, host, size, iova);
|
||||||
|
|
||||||
if (ioctl(s->container, VFIO_IOMMU_MAP_DMA, &dma_map)) {
|
if (ioctl(s->container, VFIO_IOMMU_MAP_DMA, &dma_map)) {
|
||||||
error_report("VFIO_MAP_DMA: %d", -errno);
|
error_report("VFIO_MAP_DMA failed: %s", strerror(errno));
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -570,7 +570,7 @@ static void qemu_vfio_undo_mapping(QEMUVFIOState *s, IOVAMapping *mapping,
|
||||||
assert(QEMU_IS_ALIGNED(mapping->size, qemu_real_host_page_size));
|
assert(QEMU_IS_ALIGNED(mapping->size, qemu_real_host_page_size));
|
||||||
assert(index >= 0 && index < s->nr_mappings);
|
assert(index >= 0 && index < s->nr_mappings);
|
||||||
if (ioctl(s->container, VFIO_IOMMU_UNMAP_DMA, &unmap)) {
|
if (ioctl(s->container, VFIO_IOMMU_UNMAP_DMA, &unmap)) {
|
||||||
error_setg(errp, "VFIO_UNMAP_DMA failed: %d", -errno);
|
error_setg_errno(errp, errno, "VFIO_UNMAP_DMA failed");
|
||||||
}
|
}
|
||||||
memmove(mapping, &s->mappings[index + 1],
|
memmove(mapping, &s->mappings[index + 1],
|
||||||
sizeof(s->mappings[0]) * (s->nr_mappings - index - 1));
|
sizeof(s->mappings[0]) * (s->nr_mappings - index - 1));
|
||||||
|
@ -669,7 +669,7 @@ int qemu_vfio_dma_reset_temporary(QEMUVFIOState *s)
|
||||||
trace_qemu_vfio_dma_reset_temporary(s);
|
trace_qemu_vfio_dma_reset_temporary(s);
|
||||||
qemu_mutex_lock(&s->lock);
|
qemu_mutex_lock(&s->lock);
|
||||||
if (ioctl(s->container, VFIO_IOMMU_UNMAP_DMA, &unmap)) {
|
if (ioctl(s->container, VFIO_IOMMU_UNMAP_DMA, &unmap)) {
|
||||||
error_report("VFIO_UNMAP_DMA: %d", -errno);
|
error_report("VFIO_UNMAP_DMA failed: %s", strerror(errno));
|
||||||
qemu_mutex_unlock(&s->lock);
|
qemu_mutex_unlock(&s->lock);
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue