Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for…
Browse files Browse the repository at this point in the history
…-5.1-pull-request' into staging

Trivial branch pull request 20200610

Convert DPRINTF() to traces or qemu_logs
Use IEC binary prefix definitions
Use qemu_semihosting_log_out() in target/unicore32
Some code and doc cleanup

# gpg: Signature made Wed 10 Jun 2020 14:08:36 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <[email protected]>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/trivial-branch-for-5.1-pull-request:
  semihosting: remove the pthread include which seems unused
  hw/openrisc/openrisc_sim: Add assertion to silence GCC warning
  target/unicore32: Prefer qemu_semihosting_log_out() over curses
  target/unicore32: Replace DPRINTF() by qemu_log_mask(GUEST_ERROR)
  target/unicore32: Remove unused headers
  target/i386/cpu: Use the IEC binary prefix definitions
  hw/i386/xen/xen-hvm: Use the IEC binary prefix definitions
  hw/hppa/dino: Use the IEC binary prefix definitions
  hw/arm/aspeed: Correct DRAM container region size
  qemu-img: Fix doc typo for 'bitmap' subcommand
  hw/misc/auxbus: Use qemu_log_mask(UNIMP) instead of debug printf
  hw/isa/apm: Convert debug printf()s to trace events
  hw/unicore32/puv3: Use qemu_log_mask(ERROR) instead of debug printf()
  .mailmap: Update Fred Konrad email address
  net: Do not include a newline in the id of -nic devices
  Fix parameter type in vhost migration log path

Signed-off-by: Peter Maydell <[email protected]>

# Conflicts:
#	.mailmap
  • Loading branch information
pm215 committed Jun 11, 2020
2 parents 3666f68 + fe18e6e commit 77c9e07
Show file tree
Hide file tree
Showing 20 changed files with 73 additions and 92 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Aleksandar Rikalo <[email protected]> <[email protected]>
Aleksandar Rikalo <[email protected]> <[email protected]>
Anthony Liguori <[email protected]> Anthony Liguori <[email protected]>
Filip Bozuta <[email protected]> <[email protected]>
Frederic Konrad <[email protected]> <[email protected]>
James Hogan <[email protected]> <[email protected]>
Leif Lindholm <[email protected]> <[email protected]>
Paul Burton <[email protected]> <[email protected]>
Expand Down
1 change: 1 addition & 0 deletions default-configs/unicore32-softmmu.mak
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
# Boards:
#
CONFIG_PUV3=y
CONFIG_SEMIHOSTING=y
2 changes: 1 addition & 1 deletion hw/arm/aspeed.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ static void aspeed_machine_init(MachineState *machine)
bmc = g_new0(AspeedBoardState, 1);

memory_region_init(&bmc->ram_container, NULL, "aspeed-ram-container",
UINT32_MAX);
4 * GiB);
memory_region_add_subregion(&bmc->ram_container, 0, machine->ram);

object_initialize_child(OBJECT(machine), "soc", &bmc->soc,
Expand Down
9 changes: 7 additions & 2 deletions hw/dma/puv3_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#undef DEBUG_PUV3
#include "hw/unicore32/puv3.h"
#include "qemu/module.h"
#include "qemu/log.h"

#define PUV3_DMA_CH_NR (6)
#define PUV3_DMA_CH_MASK (0xff)
Expand Down Expand Up @@ -43,7 +44,9 @@ static uint64_t puv3_dma_read(void *opaque, hwaddr offset,
ret = s->reg_CFG[PUV3_DMA_CH(offset)];
break;
default:
DPRINTF("Bad offset 0x%x\n", offset);
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad read offset 0x%"HWADDR_PRIx"\n",
__func__, offset);
}
DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);

Expand All @@ -62,7 +65,9 @@ static void puv3_dma_write(void *opaque, hwaddr offset,
s->reg_CFG[PUV3_DMA_CH(offset)] = value;
break;
default:
DPRINTF("Bad offset 0x%x\n", offset);
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad write offset 0x%"HWADDR_PRIx"\n",
__func__, offset);
}
DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
}
Expand Down
15 changes: 11 additions & 4 deletions hw/gpio/puv3_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#undef DEBUG_PUV3
#include "hw/unicore32/puv3.h"
#include "qemu/module.h"
#include "qemu/log.h"

#define TYPE_PUV3_GPIO "puv3_gpio"
#define PUV3_GPIO(obj) OBJECT_CHECK(PUV3GPIOState, (obj), TYPE_PUV3_GPIO)
Expand Down Expand Up @@ -47,7 +48,9 @@ static uint64_t puv3_gpio_read(void *opaque, hwaddr offset,
ret = s->reg_GPIR;
break;
default:
DPRINTF("Bad offset 0x%x\n", offset);
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad read offset 0x%"HWADDR_PRIx"\n",
__func__, offset);
}
DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);

Expand All @@ -68,14 +71,16 @@ static void puv3_gpio_write(void *opaque, hwaddr offset,
if (s->reg_GPDR & value) {
s->reg_GPLR |= value;
} else {
DPRINTF("Write gpio input port error!");
qemu_log_mask(LOG_GUEST_ERROR, "%s: Write gpio input port\n",
__func__);
}
break;
case 0x0c:
if (s->reg_GPDR & value) {
s->reg_GPLR &= ~value;
} else {
DPRINTF("Write gpio input port error!");
qemu_log_mask(LOG_GUEST_ERROR, "%s: Write gpio input port\n",
__func__);
}
break;
case 0x10: /* GRER */
Expand All @@ -86,7 +91,9 @@ static void puv3_gpio_write(void *opaque, hwaddr offset,
s->reg_GPIR = value;
break;
default:
DPRINTF("Bad offset 0x%x\n", offset);
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad write offset 0x%"HWADDR_PRIx"\n",
__func__, offset);
}
}

Expand Down
4 changes: 2 additions & 2 deletions hw/hppa/dino.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ PCIBus *dino_init(MemoryRegion *addr_space,
&s->parent_obj.data_mem);

/* Dino PCI bus memory. */
memory_region_init(&s->pci_mem, OBJECT(s), "pci-memory", 1ull << 32);
memory_region_init(&s->pci_mem, OBJECT(s), "pci-memory", 4 * GiB);

b = pci_register_root_bus(dev, "pci", dino_set_irq, dino_pci_map_irq, s,
&s->pci_mem, get_system_io(),
Expand All @@ -561,7 +561,7 @@ PCIBus *dino_init(MemoryRegion *addr_space,
}

/* Set up PCI view of memory: Bus master address space. */
memory_region_init(&s->bm, OBJECT(s), "bm-dino", 1ull << 32);
memory_region_init(&s->bm, OBJECT(s), "bm-dino", 4 * GiB);
memory_region_init_alias(&s->bm_ram_alias, OBJECT(s),
"bm-system", addr_space, 0,
0xf0000000 + DINO_MEM_CHUNK_SIZE);
Expand Down
3 changes: 2 additions & 1 deletion hw/i386/xen/xen-hvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

#include "qemu/osdep.h"
#include "qemu/units.h"

#include "cpu.h"
#include "hw/pci/pci.h"
Expand Down Expand Up @@ -230,7 +231,7 @@ static void xen_ram_init(PCMachineState *pcms,
* Xen does not allocate the memory continuously, it keeps a
* hole of the size computed above or passed in.
*/
block_len = (1ULL << 32) + x86ms->above_4g_mem_size;
block_len = (4 * GiB) + x86ms->above_4g_mem_size;
}
memory_region_init_ram(&ram_memory, NULL, "xen.ram", block_len,
&error_fatal);
Expand Down
9 changes: 7 additions & 2 deletions hw/intc/puv3_intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#undef DEBUG_PUV3
#include "hw/unicore32/puv3.h"
#include "qemu/module.h"
#include "qemu/log.h"

#define TYPE_PUV3_INTC "puv3_intc"
#define PUV3_INTC(obj) OBJECT_CHECK(PUV3INTCState, (obj), TYPE_PUV3_INTC)
Expand Down Expand Up @@ -68,7 +69,9 @@ static uint64_t puv3_intc_read(void *opaque, hwaddr offset,
ret = s->reg_ICPR; /* the same value with ICPR */
break;
default:
DPRINTF("Bad offset %x\n", (int)offset);
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad read offset 0x%"HWADDR_PRIx"\n",
__func__, offset);
}
DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
return ret;
Expand All @@ -88,7 +91,9 @@ static void puv3_intc_write(void *opaque, hwaddr offset,
s->reg_ICMR = value;
break;
default:
DPRINTF("Bad offset 0x%x\n", (int)offset);
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad write offset 0x%"HWADDR_PRIx"\n",
__func__, offset);
return;
}
puv3_intc_update(s);
Expand Down
15 changes: 5 additions & 10 deletions hw/isa/apm.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,8 @@
#include "hw/isa/apm.h"
#include "hw/pci/pci.h"
#include "migration/vmstate.h"
#include "trace.h"

//#define DEBUG

#ifdef DEBUG
# define APM_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
#else
# define APM_DPRINTF(format, ...) do { } while (0)
#endif

/* fixed I/O location */
#define APM_STS_IOPORT 0xb3
Expand All @@ -41,8 +35,8 @@ static void apm_ioport_writeb(void *opaque, hwaddr addr, uint64_t val,
{
APMState *apm = opaque;
addr &= 1;
APM_DPRINTF("apm_ioport_writeb addr=0x%" HWADDR_PRIx
" val=0x%02" PRIx64 "\n", addr, val);

trace_apm_io_write(addr, val);
if (addr == 0) {
apm->apmc = val;

Expand All @@ -65,7 +59,8 @@ static uint64_t apm_ioport_readb(void *opaque, hwaddr addr, unsigned size)
} else {
val = apm->apms;
}
APM_DPRINTF("apm_ioport_readb addr=0x%" HWADDR_PRIx " val=0x%02x\n", addr, val);
trace_apm_io_read(addr, val);

return val;
}

Expand Down
4 changes: 4 additions & 0 deletions hw/isa/trace-events
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ superio_create_ide(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x,
# pc87312.c
pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x"
pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x"

# apm.c
apm_io_read(uint8_t addr, uint8_t val) "read addr=0x%x val=0x%02x"
apm_io_write(uint8_t addr, uint8_t val) "write addr=0x%x val=0x%02x"
2 changes: 1 addition & 1 deletion hw/misc/auxbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ AUXReply aux_request(AUXBus *bus, AUXCommand cmd, uint32_t address,
}
break;
default:
DPRINTF("Not implemented!\n");
qemu_log_mask(LOG_UNIMP, "AUX cmd=%u not implemented\n", cmd);
return AUX_NACK;
}

Expand Down
9 changes: 7 additions & 2 deletions hw/misc/puv3_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#undef DEBUG_PUV3
#include "hw/unicore32/puv3.h"
#include "qemu/module.h"
#include "qemu/log.h"

#define TYPE_PUV3_PM "puv3_pm"
#define PUV3_PM(obj) OBJECT_CHECK(PUV3PMState, (obj), TYPE_PUV3_PM)
Expand Down Expand Up @@ -73,7 +74,9 @@ static uint64_t puv3_pm_read(void *opaque, hwaddr offset,
ret = 0x7;
break;
default:
DPRINTF("Bad offset 0x%x\n", offset);
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad read offset 0x%"HWADDR_PRIx"\n",
__func__, offset);
}
DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);

Expand Down Expand Up @@ -105,7 +108,9 @@ static void puv3_pm_write(void *opaque, hwaddr offset,
case 0x38:
break;
default:
DPRINTF("Bad offset 0x%x\n", offset);
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad write offset 0x%"HWADDR_PRIx"\n",
__func__, offset);
}
DPRINTF("offset 0x%x, value 0x%x\n", offset, value);
}
Expand Down
1 change: 1 addition & 0 deletions hw/openrisc/openrisc_sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ static void openrisc_sim_init(MachineState *machine)
int n;
unsigned int smp_cpus = machine->smp.cpus;

assert(smp_cpus >= 1 && smp_cpus <= 2);
for (n = 0; n < smp_cpus; n++) {
cpu = OPENRISC_CPU(cpu_create(machine->cpu_type));
if (cpu == NULL) {
Expand Down
1 change: 0 additions & 1 deletion hw/semihosting/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "exec/exec-all.h"
#include "qemu/log.h"
#include "chardev/char.h"
#include <pthread.h>
#include "chardev/char-fe.h"
#include "sysemu/sysemu.h"
#include "qemu/main-loop.h"
Expand Down
9 changes: 7 additions & 2 deletions hw/timer/puv3_ost.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "hw/irq.h"
#include "hw/ptimer.h"
#include "qemu/module.h"
#include "qemu/log.h"

#undef DEBUG_PUV3
#include "hw/unicore32/puv3.h"
Expand Down Expand Up @@ -52,7 +53,9 @@ static uint64_t puv3_ost_read(void *opaque, hwaddr offset,
ret = s->reg_OIER;
break;
default:
DPRINTF("Bad offset %x\n", (int)offset);
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad read offset 0x%"HWADDR_PRIx"\n",
__func__, offset);
}
DPRINTF("offset 0x%x, value 0x%x\n", offset, ret);
return ret;
Expand Down Expand Up @@ -88,7 +91,9 @@ static void puv3_ost_write(void *opaque, hwaddr offset,
s->reg_OIER = value;
break;
default:
DPRINTF("Bad offset %x\n", (int)offset);
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad write offset 0x%"HWADDR_PRIx"\n",
__func__, offset);
}
}

Expand Down
2 changes: 0 additions & 2 deletions hw/unicore32/puv3.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#include "hw/boards.h"
#include "hw/loader.h"
#include "sysemu/qtest.h"

#undef DEBUG_PUV3
#include "hw/unicore32/puv3.h"
#include "hw/input/i8042.h"
#include "hw/irq.h"
Expand Down
4 changes: 2 additions & 2 deletions hw/virtio/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,12 +834,12 @@ static int vhost_dev_set_log(struct vhost_dev *dev, bool enable_log)
return r;
}

static int vhost_migration_log(MemoryListener *listener, int enable)
static int vhost_migration_log(MemoryListener *listener, bool enable)
{
struct vhost_dev *dev = container_of(listener, struct vhost_dev,
memory_listener);
int r;
if (!!enable == dev->log_enabled) {
if (enable == dev->log_enabled) {
return 0;
}
if (!dev->started) {
Expand Down
2 changes: 1 addition & 1 deletion net/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,7 @@ static int net_param_nic(void *dummy, QemuOpts *opts, Error **errp)
/* Create an ID if the user did not specify one */
nd_id = g_strdup(qemu_opts_id(opts));
if (!nd_id) {
nd_id = g_strdup_printf("__org.qemu.nic%i\n", idx);
nd_id = g_strdup_printf("__org.qemu.nic%i", idx);
qemu_opts_set_id(opts, nd_id);
}

Expand Down
2 changes: 1 addition & 1 deletion target/i386/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6159,7 +6159,7 @@ static void x86_cpu_machine_done(Notifier *n, void *unused)
if (smram) {
cpu->smram = g_new(MemoryRegion, 1);
memory_region_init_alias(cpu->smram, OBJECT(cpu), "smram",
smram, 0, 1ull << 32);
smram, 0, 4 * GiB);
memory_region_set_enabled(cpu->smram, true);
memory_region_add_subregion_overlap(cpu->cpu_as_root, 0, cpu->smram, 1);
}
Expand Down
Loading

0 comments on commit 77c9e07

Please sign in to comment.