[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/18] hw/pci-host/bonito: Trace PCI config accesses smaller than
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 05/18] hw/pci-host/bonito: Trace PCI config accesses smaller than 32-bit |
Date: |
Fri, 2 Jul 2021 15:35:44 +0200 |
Per the datasheet section "5.7.5. Accessing PCI configuration space"
the address must be 32-bit aligned. Trace eventual accesses not
aligned to 32-bit.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210624202747.1433023-3-f4bug@amsat.org>
---
hw/pci-host/bonito.c | 8 ++++++++
hw/pci-host/trace-events | 3 +++
2 files changed, 11 insertions(+)
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index afb3d1f81d5..751fdcec689 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -52,6 +52,7 @@
#include "hw/misc/unimp.h"
#include "hw/registerfields.h"
#include "qom/object.h"
+#include "trace.h"
/* #define DEBUG_BONITO */
@@ -185,6 +186,7 @@ FIELD(BONGENCFG, PCIQUEUE, 12, 1)
#define BONITO_PCICONF_IDSEL_OFFSET 11
#define BONITO_PCICONF_FUN_MASK 0x700 /* [10:8] */
#define BONITO_PCICONF_FUN_OFFSET 8
+#define BONITO_PCICONF_REG_MASK_DS (~3) /* Per datasheet */
#define BONITO_PCICONF_REG_MASK 0xFC
#define BONITO_PCICONF_REG_OFFSET 0
@@ -495,6 +497,9 @@ static void bonito_spciconf_write(void *opaque, hwaddr
addr, uint64_t val,
if (pciaddr == 0xffffffff) {
return;
}
+ if (addr & ~BONITO_PCICONF_REG_MASK_DS) {
+ trace_bonito_spciconf_small_access(addr, size);
+ }
/* set the pci address in s->config_reg */
phb->config_reg = (pciaddr) | (1u << 31);
@@ -521,6 +526,9 @@ static uint64_t bonito_spciconf_read(void *opaque, hwaddr
addr, unsigned size)
if (pciaddr == 0xffffffff) {
return MAKE_64BIT_MASK(0, size * 8);
}
+ if (addr & ~BONITO_PCICONF_REG_MASK_DS) {
+ trace_bonito_spciconf_small_access(addr, size);
+ }
/* set the pci address in s->config_reg */
phb->config_reg = (pciaddr) | (1u << 31);
diff --git a/hw/pci-host/trace-events b/hw/pci-host/trace-events
index f4b3a50cb0b..630e9fcc5e7 100644
--- a/hw/pci-host/trace-events
+++ b/hw/pci-host/trace-events
@@ -1,5 +1,8 @@
# See docs/devel/tracing.rst for syntax documentation.
+# bonito.c
+bonito_spciconf_small_access(uint64_t addr, unsigned size) "PCI config address
is smaller then 32-bit, addr: 0x%"PRIx64", size: %u"
+
# grackle.c
grackle_set_irq(int irq_num, int level) "set_irq num %d level %d"
--
2.31.1
- [PULL 00/18] MIPS patches for 2021-07-02, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 01/18] target/mips: Add declarations for generic TCG helpers, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 02/18] target/mips: Extract Code Compaction ASE translation routines, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 03/18] target/mips: Extract the microMIPS ISA translation routines, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 04/18] target/mips: Extract nanoMIPS ISA translation routines, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 05/18] hw/pci-host/bonito: Trace PCI config accesses smaller than 32-bit,
Philippe Mathieu-Daudé <=
- [PULL 06/18] hw/pci-host/bonito: Allow PCI config accesses smaller than 32-bit, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 07/18] tests/acceptance: Test Linux on the Fuloong 2E machine, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 08/18] g364fb: use RAM memory region for framebuffer, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 09/18] g364fb: add VMStateDescription for G364SysBusState, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 10/18] dp8393x: checkpatch fixes, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 11/18] dp8393x: convert to trace-events, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 12/18] hw/mips/jazz: move PROM and checksum calculation from dp8393x device to board, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 13/18] hw/m68k/q800: move PROM and checksum calculation from dp8393x device to board, Philippe Mathieu-Daudé, 2021/07/02
- [PULL 14/18] dp8393x: remove onboard PROM containing MAC address and checksum, Philippe Mathieu-Daudé, 2021/07/02