mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2015-03-04' into staging
trivial patches for 2015-03-04 # gpg: Signature made Tue Mar 10 05:16:59 2015 GMT using RSA key ID A4C3D7DB # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" * remotes/mjt/tags/pull-trivial-patches-2015-03-04: (44 commits) 9pfs: remove useless return gdbstub: avoid possible NULL pointer dereference milkymist-pfpu: fix GCC 5.0.0 aggressive-loop-optimizations warning fix GCC 5.0.0 logical-not-parentheses warnings migration: Fix coding style (whitespace issues) oslib-posix: Fix compiler warning (-Wclobbered) and simplify the code disas/microblaze: Fix warnings caused by missing 'static' attribute disas/arm: Fix warnings caused by missing 'static' attribute vhost_net: Add missing 'static' attribute e500: fix memory leak gitignore: Ignore new tests gitignore: Track common.env in iotests gitignore sysbus: fix memory leak milkymist.c: fix memory leak macio: fix possible memory leak sparc/leon3.c: fix memory leak nbd: fix resource leak qemu-char: add cyrillic key 'numerosign' to Russian keymap qemu-char: add cyrillic characters 'numerosign' to VNC keysyms qapi-schema: Fix SpiceChannel docs ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -109,4 +109,3 @@ cscope.*
|
||||
tags
|
||||
TAGS
|
||||
*~
|
||||
/tests/qemu-iotests/common.env
|
||||
|
||||
+3
-3
@@ -291,7 +291,7 @@ static int qemu_archipelago_init(BDRVArchipelagoState *s)
|
||||
|
||||
ret = qemu_archipelago_xseg_init(s);
|
||||
if (ret < 0) {
|
||||
error_report("Cannot initialize XSEG. Aborting...\n");
|
||||
error_report("Cannot initialize XSEG. Aborting...");
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
@@ -645,7 +645,7 @@ static int qemu_archipelago_create_volume(Error **errp, const char *volname,
|
||||
|
||||
target = xseg_get_target(xseg, req);
|
||||
if (!target) {
|
||||
error_setg(errp, "Cannot get XSEG target.\n");
|
||||
error_setg(errp, "Cannot get XSEG target.");
|
||||
goto err_exit;
|
||||
}
|
||||
memcpy(target, volname, targetlen);
|
||||
@@ -889,7 +889,7 @@ static BlockAIOCB *qemu_archipelago_aio_rw(BlockDriverState *bs,
|
||||
return &aio_cb->common;
|
||||
|
||||
err_exit:
|
||||
error_report("qemu_archipelago_aio_rw(): I/O Error\n");
|
||||
error_report("qemu_archipelago_aio_rw(): I/O Error");
|
||||
qemu_aio_unref(aio_cb);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -274,6 +274,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
*/
|
||||
sock = nbd_establish_connection(bs, errp);
|
||||
if (sock < 0) {
|
||||
g_free(export);
|
||||
return sock;
|
||||
}
|
||||
|
||||
|
||||
@@ -1474,6 +1474,7 @@ void qmp_memsave(int64_t addr, int64_t size, const char *filename,
|
||||
uint32_t l;
|
||||
CPUState *cpu;
|
||||
uint8_t buf[1024];
|
||||
int64_t orig_addr = addr, orig_size = size;
|
||||
|
||||
if (!has_cpu) {
|
||||
cpu_index = 0;
|
||||
@@ -1497,7 +1498,8 @@ void qmp_memsave(int64_t addr, int64_t size, const char *filename,
|
||||
if (l > size)
|
||||
l = size;
|
||||
if (cpu_memory_rw_debug(cpu, addr, buf, l, 0) != 0) {
|
||||
error_setg(errp, "Invalid addr 0x%016" PRIx64 "specified", addr);
|
||||
error_setg(errp, "Invalid addr 0x%016" PRIx64 "/size %" PRId64
|
||||
" specified", orig_addr, orig_size);
|
||||
goto exit;
|
||||
}
|
||||
if (fwrite(buf, 1, l, f) != l) {
|
||||
|
||||
-128
@@ -1549,10 +1549,6 @@ enum map_type {
|
||||
MAP_DATA
|
||||
};
|
||||
|
||||
enum map_type last_type;
|
||||
int last_mapping_sym = -1;
|
||||
bfd_vma last_mapping_addr = 0;
|
||||
|
||||
/* Decode a bitfield of the form matching regexp (N(-N)?,)*N(-N)?.
|
||||
Returns pointer to following character of the format string and
|
||||
fills in *VALUEP and *WIDTHP with the extracted value and number of
|
||||
@@ -3878,135 +3874,11 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info)
|
||||
int is_data = false;
|
||||
unsigned int size = 4;
|
||||
void (*printer) (bfd_vma, struct disassemble_info *, long);
|
||||
#if 0
|
||||
bfd_boolean found = false;
|
||||
|
||||
if (info->disassembler_options)
|
||||
{
|
||||
parse_disassembler_options (info->disassembler_options);
|
||||
|
||||
/* To avoid repeated parsing of these options, we remove them here. */
|
||||
info->disassembler_options = NULL;
|
||||
}
|
||||
|
||||
/* First check the full symtab for a mapping symbol, even if there
|
||||
are no usable non-mapping symbols for this address. */
|
||||
if (info->symtab != NULL
|
||||
&& bfd_asymbol_flavour (*info->symtab) == bfd_target_elf_flavour)
|
||||
{
|
||||
bfd_vma addr;
|
||||
int n;
|
||||
int last_sym = -1;
|
||||
enum map_type type = MAP_ARM;
|
||||
|
||||
if (pc <= last_mapping_addr)
|
||||
last_mapping_sym = -1;
|
||||
is_thumb = (last_type == MAP_THUMB);
|
||||
found = false;
|
||||
/* Start scanning at the start of the function, or wherever
|
||||
we finished last time. */
|
||||
n = info->symtab_pos + 1;
|
||||
if (n < last_mapping_sym)
|
||||
n = last_mapping_sym;
|
||||
|
||||
/* Scan up to the location being disassembled. */
|
||||
for (; n < info->symtab_size; n++)
|
||||
{
|
||||
addr = bfd_asymbol_value (info->symtab[n]);
|
||||
if (addr > pc)
|
||||
break;
|
||||
if ((info->section == NULL
|
||||
|| info->section == info->symtab[n]->section)
|
||||
&& get_sym_code_type (info, n, &type))
|
||||
{
|
||||
last_sym = n;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
n = info->symtab_pos;
|
||||
if (n < last_mapping_sym - 1)
|
||||
n = last_mapping_sym - 1;
|
||||
|
||||
/* No mapping symbol found at this address. Look backwards
|
||||
for a preceding one. */
|
||||
for (; n >= 0; n--)
|
||||
{
|
||||
if (get_sym_code_type (info, n, &type))
|
||||
{
|
||||
last_sym = n;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
last_mapping_sym = last_sym;
|
||||
last_type = type;
|
||||
is_thumb = (last_type == MAP_THUMB);
|
||||
is_data = (last_type == MAP_DATA);
|
||||
|
||||
/* Look a little bit ahead to see if we should print out
|
||||
two or four bytes of data. If there's a symbol,
|
||||
mapping or otherwise, after two bytes then don't
|
||||
print more. */
|
||||
if (is_data)
|
||||
{
|
||||
size = 4 - (pc & 3);
|
||||
for (n = last_sym + 1; n < info->symtab_size; n++)
|
||||
{
|
||||
addr = bfd_asymbol_value (info->symtab[n]);
|
||||
if (addr > pc)
|
||||
{
|
||||
if (addr - pc < size)
|
||||
size = addr - pc;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* If the next symbol is after three bytes, we need to
|
||||
print only part of the data, so that we can use either
|
||||
.byte or .short. */
|
||||
if (size == 3)
|
||||
size = (pc & 1) ? 1 : 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (info->symbols != NULL)
|
||||
{
|
||||
if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour)
|
||||
{
|
||||
coff_symbol_type * cs;
|
||||
|
||||
cs = coffsymbol (*info->symbols);
|
||||
is_thumb = ( cs->native->u.syment.n_sclass == C_THUMBEXT
|
||||
|| cs->native->u.syment.n_sclass == C_THUMBSTAT
|
||||
|| cs->native->u.syment.n_sclass == C_THUMBLABEL
|
||||
|| cs->native->u.syment.n_sclass == C_THUMBEXTFUNC
|
||||
|| cs->native->u.syment.n_sclass == C_THUMBSTATFUNC);
|
||||
}
|
||||
else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour
|
||||
&& !found)
|
||||
{
|
||||
/* If no mapping symbol has been found then fall back to the type
|
||||
of the function symbol. */
|
||||
elf_symbol_type * es;
|
||||
unsigned int type;
|
||||
|
||||
es = *(elf_symbol_type **)(info->symbols);
|
||||
type = ELF_ST_TYPE (es->internal_elf_sym.st_info);
|
||||
|
||||
is_thumb = (type == STT_ARM_TFUNC) || (type == STT_ARM_16BIT);
|
||||
}
|
||||
}
|
||||
#else
|
||||
int little;
|
||||
|
||||
little = (info->endian == BFD_ENDIAN_LITTLE);
|
||||
is_thumb |= (pc & 1);
|
||||
pc &= ~(bfd_vma)1;
|
||||
#endif
|
||||
|
||||
if (force_thumb)
|
||||
is_thumb = true;
|
||||
|
||||
+7
-6
@@ -275,7 +275,7 @@ enum microblaze_instr_type {
|
||||
|
||||
#define MAX_OPCODES 280
|
||||
|
||||
struct op_code_struct {
|
||||
static struct op_code_struct {
|
||||
const char *name;
|
||||
short inst_type; /* registers and immediate values involved */
|
||||
short inst_offset_type; /* immediate vals offset from PC? (= 1 for branches) */
|
||||
@@ -567,10 +567,9 @@ struct op_code_struct {
|
||||
};
|
||||
|
||||
/* prefix for register names */
|
||||
char register_prefix[] = "r";
|
||||
char special_register_prefix[] = "spr";
|
||||
char fsl_register_prefix[] = "rfsl";
|
||||
char pvr_register_prefix[] = "rpvr";
|
||||
static const char register_prefix[] = "r";
|
||||
static const char fsl_register_prefix[] = "rfsl";
|
||||
static const char pvr_register_prefix[] = "rpvr";
|
||||
|
||||
|
||||
/* #defines for valid immediate range */
|
||||
@@ -738,7 +737,9 @@ get_field_special (long instr, struct op_code_struct * op)
|
||||
default :
|
||||
{
|
||||
if ( ((((instr & IMM_MASK) >> IMM_LOW) ^ op->immval_mask) & 0xE000) == REG_PVR_MASK) {
|
||||
sprintf(tmpstr, "%spvr%d", register_prefix, (unsigned short)(((instr & IMM_MASK) >> IMM_LOW) ^ op->immval_mask) ^ REG_PVR_MASK);
|
||||
sprintf(tmpstr, "%s%u", pvr_register_prefix,
|
||||
(unsigned short)(((instr & IMM_MASK) >> IMM_LOW) ^
|
||||
op->immval_mask) ^ REG_PVR_MASK);
|
||||
return(strdup(tmpstr));
|
||||
} else {
|
||||
strcpy(spr, "pc");
|
||||
|
||||
@@ -1188,7 +1188,7 @@ static void *file_ram_alloc(RAMBlock *block,
|
||||
|
||||
error:
|
||||
if (mem_prealloc) {
|
||||
error_report("%s\n", error_get_pretty(*errp));
|
||||
error_report("%s", error_get_pretty(*errp));
|
||||
exit(1);
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -1443,15 +1443,17 @@ void gdb_exit(CPUArchState *env, int code)
|
||||
if (gdbserver_fd < 0 || s->fd < 0) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (!s->chr) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
snprintf(buf, sizeof(buf), "W%02x", (uint8_t)code);
|
||||
put_packet(s, buf);
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
if (s->chr) {
|
||||
qemu_chr_delete(s->chr);
|
||||
}
|
||||
qemu_chr_delete(s->chr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -332,7 +332,6 @@ static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
|
||||
tsize = read(fd, (void *)buf, bufsz);
|
||||
} while (tsize == -1 && errno == EINTR);
|
||||
close(fd);
|
||||
return tsize;
|
||||
} else if ((fs_ctx->export_flags & V9FS_SM_PASSTHROUGH) ||
|
||||
(fs_ctx->export_flags & V9FS_SM_NONE)) {
|
||||
buffer = rpath(fs_ctx, path);
|
||||
|
||||
@@ -65,7 +65,7 @@ static void digic4_board_init(DigicBoard *board)
|
||||
s->digic = DIGIC(object_new(TYPE_DIGIC));
|
||||
object_property_set_bool(OBJECT(s->digic), true, "realized", &err);
|
||||
if (err != NULL) {
|
||||
error_report("Couldn't realize DIGIC SoC: %s\n",
|
||||
error_report("Couldn't realize DIGIC SoC: %s",
|
||||
error_get_pretty(err));
|
||||
exit(1);
|
||||
}
|
||||
@@ -104,13 +104,13 @@ static void digic_load_rom(DigicBoardState *s, hwaddr addr,
|
||||
char *fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, filename);
|
||||
|
||||
if (!fn) {
|
||||
error_report("Couldn't find rom image '%s'.\n", filename);
|
||||
error_report("Couldn't find rom image '%s'.", filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
rom_size = load_image_targphys(fn, addr, max_size);
|
||||
if (rom_size < 0 || rom_size > max_size) {
|
||||
error_report("Couldn't load rom image '%s'.\n", filename);
|
||||
error_report("Couldn't load rom image '%s'.", filename);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -393,7 +393,7 @@ static void nand_realize(DeviceState *dev, Error **errp)
|
||||
nand_init_2048(s);
|
||||
break;
|
||||
default:
|
||||
error_setg(errp, "Unsupported NAND block size %#x\n",
|
||||
error_setg(errp, "Unsupported NAND block size %#x",
|
||||
1 << s->page_shift);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -91,6 +91,8 @@ bool sysbus_has_irq(SysBusDevice *dev, int n)
|
||||
ObjectProperty *r;
|
||||
|
||||
r = object_property_find(OBJECT(dev), prop, NULL);
|
||||
g_free(prop);
|
||||
|
||||
return (r != NULL);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1566,7 +1566,7 @@ static void pl330_realize(DeviceState *dev, Error **errp)
|
||||
s->cfg[1] |= 5;
|
||||
break;
|
||||
default:
|
||||
error_setg(errp, "Bad value for i-cache_len property: %" PRIx8 "\n",
|
||||
error_setg(errp, "Bad value for i-cache_len property: %" PRIx8,
|
||||
s->i_cache_len);
|
||||
return;
|
||||
}
|
||||
@@ -1601,7 +1601,7 @@ static void pl330_realize(DeviceState *dev, Error **errp)
|
||||
s->cfg[CFG_CRD] |= 0x4;
|
||||
break;
|
||||
default:
|
||||
error_setg(errp, "Bad value for data_width property: %" PRIx8 "\n",
|
||||
error_setg(errp, "Bad value for data_width property: %" PRIx8,
|
||||
s->data_width);
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ static int32_t bmdma_prepare_buf(IDEDMA *dma, int is_write)
|
||||
* This should accommodate the largest ATA transaction
|
||||
* for LBA48 (65,536 sectors) and 32K sector sizes. */
|
||||
if (s->sg.size > INT32_MAX) {
|
||||
error_report("IDE: sglist describes more than 2GiB.\n");
|
||||
error_report("IDE: sglist describes more than 2GiB.");
|
||||
break;
|
||||
}
|
||||
bm->cur_prd_addr += l;
|
||||
|
||||
@@ -155,6 +155,7 @@ milkymist_init(MachineState *machine)
|
||||
bios_name);
|
||||
exit(1);
|
||||
}
|
||||
g_free(bios_filename);
|
||||
|
||||
milkymist_uart_create(0x60000000, irq[0]);
|
||||
milkymist_sysctl_create(0x60001000, irq[1], irq[2], irq[3],
|
||||
|
||||
@@ -185,7 +185,7 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
|
||||
ram_size - initrd_offset);
|
||||
}
|
||||
if (initrd_size < 0) {
|
||||
error_report("qemu: could not load initrd '%s'\n",
|
||||
error_report("qemu: could not load initrd '%s'",
|
||||
initrd_filename);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ static int macio_newworld_initfn(PCIDevice *d)
|
||||
MacIOState *s = MACIO(d);
|
||||
NewWorldMacIOState *ns = NEWWORLD_MACIO(d);
|
||||
SysBusDevice *sysbus_dev;
|
||||
MemoryRegion *timer_memory = g_new(MemoryRegion, 1);
|
||||
MemoryRegion *timer_memory = NULL;
|
||||
int i;
|
||||
int cur_irq = 0;
|
||||
int ret = macio_common_initfn(d);
|
||||
@@ -301,6 +301,7 @@ static int macio_newworld_initfn(PCIDevice *d)
|
||||
}
|
||||
|
||||
/* Timer */
|
||||
timer_memory = g_new(MemoryRegion, 1);
|
||||
memory_region_init_io(timer_memory, OBJECT(s), &timer_ops, NULL, "timer",
|
||||
0x1000);
|
||||
memory_region_add_subregion(&s->bar, 0x15000, timer_memory);
|
||||
|
||||
@@ -362,7 +362,7 @@ static void pfpu_start(MilkymistPFPUState *s)
|
||||
i = 0;
|
||||
while (pfpu_decode_insn(s)) {
|
||||
/* decode at most MICROCODE_WORDS instructions */
|
||||
if (i++ >= MICROCODE_WORDS) {
|
||||
if (++i >= MICROCODE_WORDS) {
|
||||
error_report("milkymist_pfpu: too many instructions "
|
||||
"executed in microcode. No VECTOUT?");
|
||||
break;
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ static const int kernel_feature_bits[] = {
|
||||
};
|
||||
|
||||
/* Features supported by others. */
|
||||
const int user_feature_bits[] = {
|
||||
static const int user_feature_bits[] = {
|
||||
VIRTIO_F_NOTIFY_ON_EMPTY,
|
||||
VIRTIO_RING_F_INDIRECT_DESC,
|
||||
VIRTIO_RING_F_EVENT_IDX,
|
||||
|
||||
+2
-2
@@ -120,8 +120,8 @@ static void virtio_net_vhost_status(VirtIONet *n, uint8_t status)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!!n->vhost_started ==
|
||||
(virtio_net_started(n, status) && !nc->peer->link_down)) {
|
||||
if ((virtio_net_started(n, status) && !nc->peer->link_down) ==
|
||||
!!n->vhost_started) {
|
||||
return;
|
||||
}
|
||||
if (!n->vhost_started) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user