qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Laurent Vivier <lvivier@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Ani Sinha <ani@anisinha.ca>, Igor Mammedov <imammedo@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Eduardo Habkost <eduardo@habkost.net>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Subject: Re: [PATCH 1/4] hw/acpi: add trace events for TCO watchdog register access
Date: Mon, 31 Oct 2022 13:34:59 +0000	[thread overview]
Message-ID: <20221031133459.GG7636@redhat.com> (raw)
In-Reply-To: <20221031131934.425448-2-berrange@redhat.com>

On Mon, Oct 31, 2022 at 01:19:31PM +0000, Daniel P. Berrangé wrote:
> These tracepoints aid in understanding and debugging the guest drivers
> for the TCO watchdog.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  hw/acpi/tco.c        | 41 ++++++++++++++++++++++++++++-------------
>  hw/acpi/trace-events |  2 ++
>  2 files changed, 30 insertions(+), 13 deletions(-)
> 
> diff --git a/hw/acpi/tco.c b/hw/acpi/tco.c
> index 4783721e4e..9ebd3e5e64 100644
> --- a/hw/acpi/tco.c
> +++ b/hw/acpi/tco.c
> @@ -86,6 +86,7 @@ static inline int can_start_tco_timer(TCOIORegs *tr)
>  static uint32_t tco_ioport_readw(TCOIORegs *tr, uint32_t addr)
>  {
>      uint16_t rld;
> +    uint32_t ret = 0;
>  
>      switch (addr) {
>      case TCO_RLD:
> @@ -96,35 +97,49 @@ static uint32_t tco_ioport_readw(TCOIORegs *tr, uint32_t addr)
>          } else {
>              rld = tr->tco.rld;
>          }
> -        return rld;
> +        ret = rld;
> +        break;
>      case TCO_DAT_IN:
> -        return tr->tco.din;
> +        ret = tr->tco.din;
> +        break;
>      case TCO_DAT_OUT:
> -        return tr->tco.dout;
> +        ret = tr->tco.dout;
> +        break;
>      case TCO1_STS:
> -        return tr->tco.sts1;
> +        ret = tr->tco.sts1;
> +        break;
>      case TCO2_STS:
> -        return tr->tco.sts2;
> +        ret = tr->tco.sts2;
> +        break;
>      case TCO1_CNT:
> -        return tr->tco.cnt1;
> +        ret = tr->tco.cnt1;
> +        break;
>      case TCO2_CNT:
> -        return tr->tco.cnt2;
> +        ret = tr->tco.cnt2;
> +        break;
>      case TCO_MESSAGE1:
> -        return tr->tco.msg1;
> +        ret = tr->tco.msg1;
> +        break;
>      case TCO_MESSAGE2:
> -        return tr->tco.msg2;
> +        ret = tr->tco.msg2;
> +        break;
>      case TCO_WDCNT:
> -        return tr->tco.wdcnt;
> +        ret = tr->tco.wdcnt;
> +        break;
>      case TCO_TMR:
> -        return tr->tco.tmr;
> +        ret = tr->tco.tmr;
> +        break;
>      case SW_IRQ_GEN:
> -        return tr->sw_irq_gen;
> +        ret = tr->sw_irq_gen;
> +        break;
>      }
> -    return 0;
> +    trace_tco_io_read(addr, ret);
> +    return ret;
>  }
>  
>  static void tco_ioport_writew(TCOIORegs *tr, uint32_t addr, uint32_t val)
>  {
> +    trace_tco_io_write(addr, val);
>      switch (addr) {
>      case TCO_RLD:
>          tr->timeouts_no = 0;
> diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events
> index eb60b04f9b..78e0a8670e 100644
> --- a/hw/acpi/trace-events
> +++ b/hw/acpi/trace-events
> @@ -55,6 +55,8 @@ piix4_gpe_writeb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" PRIx64
>  # tco.c
>  tco_timer_reload(int ticks, int msec) "ticks=%d (%d ms)"
>  tco_timer_expired(int timeouts_no, bool strap, bool no_reboot) "timeouts_no=%d no_reboot=%d/%d"
> +tco_io_write(uint64_t addr, uint32_t val) "addr=0x%" PRIx64 " val=0x%" PRIx32
> +tco_io_read(uint64_t addr, uint32_t val) "addr=0x%" PRIx64 " val=0x%" PRIx32
>  
>  # erst.c
>  acpi_erst_reg_write(uint64_t addr, uint64_t val, unsigned size) "addr: 0x%04" PRIx64 " <== 0x%016" PRIx64 " (size: %u)"

Reviewed-by: Richard W.M. Jones <rjones@redhat.com>

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html



  reply	other threads:[~2022-10-31 13:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31 13:19 [PATCH 0/4] hw: make TCO watchdog actually work by default for Q35 Daniel P. Berrangé
2022-10-31 13:19 ` [PATCH 1/4] hw/acpi: add trace events for TCO watchdog register access Daniel P. Berrangé
2022-10-31 13:34   ` Richard W.M. Jones [this message]
2022-10-31 13:19 ` [PATCH 2/4] hw/isa: add trace events for ICH9 LPC chip config access Daniel P. Berrangé
2022-10-31 13:36   ` Richard W.M. Jones
2022-10-31 13:19 ` [PATCH 3/4] hw/watchdog: add trace events for watchdog action handling Daniel P. Berrangé
2022-10-31 13:36   ` Richard W.M. Jones
2022-10-31 15:46   ` Philippe Mathieu-Daudé
2022-10-31 13:19 ` [PATCH 4/4] hw/isa: enable TCO watchdog reboot pin strap by default Daniel P. Berrangé
2022-10-31 13:40   ` Richard W.M. Jones
2022-10-31 13:50 ` [PATCH 0/4] hw: make TCO watchdog actually work by default for Q35 Daniel P. Berrangé
2022-10-31 15:48   ` Michael S. Tsirkin
2022-11-01 12:57     ` Igor Mammedov
2022-11-01 13:03       ` Daniel P. Berrangé
2022-11-10 16:29         ` Michael S. Tsirkin
2022-11-10 18:21           ` Daniel P. Berrangé
2022-11-10 16:30 ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221031133459.GG7636@redhat.com \
    --to=rjones@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=berrange@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=imammedo@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).