[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 1/4] hw/acpi/ich9: Trace ich9_gpe_readb()/writeb()
From: |
Julia Suvorova |
Subject: |
Re: [RFC PATCH v2 1/4] hw/acpi/ich9: Trace ich9_gpe_readb()/writeb() |
Date: |
Tue, 25 Aug 2020 15:14:17 +0200 |
On Wed, Aug 19, 2020 at 5:14 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> On 8/18/20 11:52 PM, Julia Suvorova wrote:
> > Add trace events similar to piix4_gpe_readb() to check gpe status.
> >
> > Signed-off-by: Julia Suvorova <jusual@redhat.com>
> > Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> > ---
> > hw/acpi/ich9.c | 7 ++++++-
> > hw/acpi/trace-events | 4 ++++
> > 2 files changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
> > index 6a19070cec..a2a1742aa6 100644
> > --- a/hw/acpi/ich9.c
> > +++ b/hw/acpi/ich9.c
> > @@ -36,6 +36,7 @@
> > #include "hw/acpi/acpi.h"
> > #include "hw/acpi/tco.h"
> > #include "exec/address-spaces.h"
> > +#include "trace.h"
> >
> > #include "hw/i386/ich9.h"
> > #include "hw/mem/pc-dimm.h"
> > @@ -59,13 +60,17 @@ static void ich9_pm_update_sci_fn(ACPIREGS *regs)
> > static uint64_t ich9_gpe_readb(void *opaque, hwaddr addr, unsigned width)
> > {
> > ICH9LPCPMRegs *pm = opaque;
> > - return acpi_gpe_ioport_readb(&pm->acpi_regs, addr);
> > + uint64_t val = acpi_gpe_ioport_readb(&pm->acpi_regs, addr);
> > +
> > + trace_ich9_gpe_readb(addr, width, val);
> > + return val;
> > }
> >
> > static void ich9_gpe_writeb(void *opaque, hwaddr addr, uint64_t val,
> > unsigned width)
> > {
> > ICH9LPCPMRegs *pm = opaque;
> > + trace_ich9_gpe_writeb(addr, width, val);
> > acpi_gpe_ioport_writeb(&pm->acpi_regs, addr, val);
> > acpi_update_sci(&pm->acpi_regs, pm->irq);
> > }
> > diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events
> > index afbc77de1c..b9f4827afc 100644
> > --- a/hw/acpi/trace-events
> > +++ b/hw/acpi/trace-events
> > @@ -32,6 +32,10 @@ cpuhp_acpi_ejecting_cpu(uint32_t idx) "0x%"PRIx32
> > cpuhp_acpi_write_ost_ev(uint32_t slot, uint32_t ev) "idx[0x%"PRIx32"] OST
> > EVENT: 0x%"PRIx32
> > cpuhp_acpi_write_ost_status(uint32_t slot, uint32_t st) "idx[0x%"PRIx32"]
> > OST STATUS: 0x%"PRIx32
> >
> > +# ich9.c
> > +ich9_gpe_readb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%"
> > PRIx64 " width: %d ==> 0x%" PRIx64
> > +ich9_gpe_writeb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%"
> > PRIx64 " width: %d <== 0x%" PRIx64
>
> Nitpick, val could be uint8_t.
Since 'val' is an argument and its type is uint64_t it's better to
avoid implicit cast to a smaller type. Also, acpi_gpe_ioport_readb()
does not return uint8_t.
- [RFC PATCH v2 0/4] Use ACPI PCI hot-plug for q35, Julia Suvorova, 2020/08/18
- [RFC PATCH v2 1/4] hw/acpi/ich9: Trace ich9_gpe_readb()/writeb(), Julia Suvorova, 2020/08/18
- [RFC PATCH v2 2/4] hw/i386/acpi-build: Add ACPI PCI hot-plug methods to q35, Julia Suvorova, 2020/08/18
- [RFC PATCH v2 3/4] hw/i386/acpi-build: Turn off support of PCIe native hot-plug and SHPC in _OSC, Julia Suvorova, 2020/08/18
- [RFC PATCH v2 4/4] hw/acpi/ich9: Enable ACPI PCI hot-plug, Julia Suvorova, 2020/08/18
- Re: [RFC PATCH v2 0/4] Use ACPI PCI hot-plug for q35, no-reply, 2020/08/18
- Re: [RFC PATCH v2 0/4] Use ACPI PCI hot-plug for q35, Michael S. Tsirkin, 2020/08/20
- Re: [RFC PATCH v2 0/4] Use ACPI PCI hot-plug for q35, Igor Mammedov, 2020/08/21