mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 18:05:37 +00:00
memory: Log access direction for invalid accesses
In memory_region_access_valid() invalid accesses are logged to help debugging but the log message does not say if it was a read or write. Log that too to better identify the access causing the problem. Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Message-Id: <20211011173616.F1DE0756022@zero.eik.bme.hu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
ee26ce674a
commit
7a7142f025
|
@ -1378,17 +1378,17 @@ bool memory_region_access_valid(MemoryRegion *mr,
|
||||||
{
|
{
|
||||||
if (mr->ops->valid.accepts
|
if (mr->ops->valid.accepts
|
||||||
&& !mr->ops->valid.accepts(mr->opaque, addr, size, is_write, attrs)) {
|
&& !mr->ops->valid.accepts(mr->opaque, addr, size, is_write, attrs)) {
|
||||||
qemu_log_mask(LOG_GUEST_ERROR, "Invalid access at addr "
|
qemu_log_mask(LOG_GUEST_ERROR, "Invalid %s at addr 0x%" HWADDR_PRIX
|
||||||
"0x%" HWADDR_PRIX ", size %u, "
|
", size %u, region '%s', reason: rejected\n",
|
||||||
"region '%s', reason: rejected\n",
|
is_write ? "write" : "read",
|
||||||
addr, size, memory_region_name(mr));
|
addr, size, memory_region_name(mr));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mr->ops->valid.unaligned && (addr & (size - 1))) {
|
if (!mr->ops->valid.unaligned && (addr & (size - 1))) {
|
||||||
qemu_log_mask(LOG_GUEST_ERROR, "Invalid access at addr "
|
qemu_log_mask(LOG_GUEST_ERROR, "Invalid %s at addr 0x%" HWADDR_PRIX
|
||||||
"0x%" HWADDR_PRIX ", size %u, "
|
", size %u, region '%s', reason: unaligned\n",
|
||||||
"region '%s', reason: unaligned\n",
|
is_write ? "write" : "read",
|
||||||
addr, size, memory_region_name(mr));
|
addr, size, memory_region_name(mr));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1400,10 +1400,10 @@ bool memory_region_access_valid(MemoryRegion *mr,
|
||||||
|
|
||||||
if (size > mr->ops->valid.max_access_size
|
if (size > mr->ops->valid.max_access_size
|
||||||
|| size < mr->ops->valid.min_access_size) {
|
|| size < mr->ops->valid.min_access_size) {
|
||||||
qemu_log_mask(LOG_GUEST_ERROR, "Invalid access at addr "
|
qemu_log_mask(LOG_GUEST_ERROR, "Invalid %s at addr 0x%" HWADDR_PRIX
|
||||||
"0x%" HWADDR_PRIX ", size %u, "
|
", size %u, region '%s', reason: invalid size "
|
||||||
"region '%s', reason: invalid size "
|
"(min:%u max:%u)\n",
|
||||||
"(min:%u max:%u)\n",
|
is_write ? "write" : "read",
|
||||||
addr, size, memory_region_name(mr),
|
addr, size, memory_region_name(mr),
|
||||||
mr->ops->valid.min_access_size,
|
mr->ops->valid.min_access_size,
|
||||||
mr->ops->valid.max_access_size);
|
mr->ops->valid.max_access_size);
|
||||||
|
|
Loading…
Reference in a new issue