nubus: add trace-events for empty slot accesses

Increase the max_access_size to 4 bytes for empty Nubus slot and super slot
accesses to allow tracing of the Nubus enumeration process by the guest OS.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210924073808.1041-8-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Mark Cave-Ayland 2021-09-24 08:37:55 +01:00 committed by Laurent Vivier
parent c0ad4eaf44
commit ce0e6a2c55
4 changed files with 16 additions and 3 deletions

View File

@ -19,6 +19,7 @@
#include "qemu/osdep.h"
#include "hw/nubus/nubus.h"
#include "qapi/error.h"
#include "trace.h"
static NubusBus *nubus_find(void)
@ -31,12 +32,13 @@ static void nubus_slot_write(void *opaque, hwaddr addr, uint64_t val,
unsigned int size)
{
/* read only */
trace_nubus_slot_write(addr, val, size);
}
static uint64_t nubus_slot_read(void *opaque, hwaddr addr,
unsigned int size)
{
trace_nubus_slot_read(addr, size);
return 0;
}
@ -46,7 +48,7 @@ static const MemoryRegionOps nubus_slot_ops = {
.endianness = DEVICE_BIG_ENDIAN,
.valid = {
.min_access_size = 1,
.max_access_size = 1,
.max_access_size = 4,
},
};
@ -54,11 +56,13 @@ static void nubus_super_slot_write(void *opaque, hwaddr addr, uint64_t val,
unsigned int size)
{
/* read only */
trace_nubus_super_slot_write(addr, val, size);
}
static uint64_t nubus_super_slot_read(void *opaque, hwaddr addr,
unsigned int size)
{
trace_nubus_super_slot_read(addr, size);
return 0;
}
@ -68,7 +72,7 @@ static const MemoryRegionOps nubus_super_slot_ops = {
.endianness = DEVICE_BIG_ENDIAN,
.valid = {
.min_access_size = 1,
.max_access_size = 1,
.max_access_size = 4,
},
};

7
hw/nubus/trace-events Normal file
View File

@ -0,0 +1,7 @@
# See docs/devel/tracing.txt for syntax documentation.
# nubus-bus.c
nubus_slot_read(uint64_t addr, int size) "reading unassigned addr 0x%"PRIx64 " size %d"
nubus_slot_write(uint64_t addr, uint64_t val, int size) "writing unassigned addr 0x%"PRIx64 " value 0x%"PRIx64 " size %d"
nubus_super_slot_read(uint64_t addr, int size) "reading unassigned addr 0x%"PRIx64 " size %d"
nubus_super_slot_write(uint64_t addr, uint64_t val, int size) "writing unassigned addr 0x%"PRIx64 " value 0x%"PRIx64 " size %d"

1
hw/nubus/trace.h Normal file
View File

@ -0,0 +1 @@
#include "trace/trace-hw_nubus.h"

View File

@ -2142,6 +2142,7 @@ if have_system
'hw/misc/macio',
'hw/net',
'hw/net/can',
'hw/nubus',
'hw/nvme',
'hw/nvram',
'hw/pci',