From nobody Wed May 15 18:06:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667222570; cv=none; d=zohomail.com; s=zohoarc; b=OoIXpT7itJi7/EdPZPIHl0s7HYQJwNlIrD07VgD8GmIKGRhXlVUoF7Lo2bIPoEPTPQD18shsnQ+v04LI+CD0G40WWUmFAFApaX6UkDYiAi7AIRgVkouP0xwcd18y7kOAXq0TpoLxoyILdReTHvNumkG6bkGh5qi7SeySXl90c+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667222570; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XZUQ3henDFgnMFrrXT3Km/I+vpTCPA4n2ELWiUbQ8yw=; b=lolVtjYCr2KQqaNXRkqoVgQrr2YE7MKkP6ugtuEp9z+rXPhwG9izofveQEtNJ0qoxVs5SI6GdLlBsQ5aqQ9sT4rTVQYgAqmzj5xhJ22FUUC1r7ctPWlF0kGeM4k6kdJ+afDxq8qVnIoLlr3bNbunGV3zL+isopun0IePBdtcn8w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667222570219427.9451565099224; Mon, 31 Oct 2022 06:22:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opUi0-00038T-V2; Mon, 31 Oct 2022 09:20:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opUhh-0002Qm-QX for qemu-devel@nongnu.org; Mon, 31 Oct 2022 09:19:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opUhf-0005MH-Fw for qemu-devel@nongnu.org; Mon, 31 Oct 2022 09:19:48 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-cISkij2-NnGxMYnG7p2J_Q-1; Mon, 31 Oct 2022 09:19:43 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 63E3B29DD994; Mon, 31 Oct 2022 13:19:43 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 517A0477F5C; Mon, 31 Oct 2022 13:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667222386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XZUQ3henDFgnMFrrXT3Km/I+vpTCPA4n2ELWiUbQ8yw=; b=CjqjUB2ZkmYKAy088PN4frVmYjYtvouLy60MTtc4ZE4NW3Gr0ixNwcKUhhIMuEi6DaiEl8 0WUx49Rth9AjGnx9GJfgVy4/nmQEcxdp0SVBAlrIZOVRDayQrFaI0GKeJHOl95JrKQe+qW 5fJC6fVWVXDe6+sQRjTYTM2TAODcbv0= X-MC-Unique: cISkij2-NnGxMYnG7p2J_Q-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Ani Sinha , Igor Mammedov , "Michael S. Tsirkin" , Thomas Huth , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , "Richard W.M. Jones" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 1/4] hw/acpi: add trace events for TCO watchdog register access Date: Mon, 31 Oct 2022 13:19:31 +0000 Message-Id: <20221031131934.425448-2-berrange@redhat.com> In-Reply-To: <20221031131934.425448-1-berrange@redhat.com> References: <20221031131934.425448-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.048, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667222572471100003 These tracepoints aid in understanding and debugging the guest drivers for the TCO watchdog. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Richard W.M. Jones --- 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 =3D 0; =20 switch (addr) { case TCO_RLD: @@ -96,35 +97,49 @@ static uint32_t tco_ioport_readw(TCOIORegs *tr, uint32_= t addr) } else { rld =3D tr->tco.rld; } - return rld; + ret =3D rld; + break; case TCO_DAT_IN: - return tr->tco.din; + ret =3D tr->tco.din; + break; case TCO_DAT_OUT: - return tr->tco.dout; + ret =3D tr->tco.dout; + break; case TCO1_STS: - return tr->tco.sts1; + ret =3D tr->tco.sts1; + break; case TCO2_STS: - return tr->tco.sts2; + ret =3D tr->tco.sts2; + break; case TCO1_CNT: - return tr->tco.cnt1; + ret =3D tr->tco.cnt1; + break; case TCO2_CNT: - return tr->tco.cnt2; + ret =3D tr->tco.cnt2; + break; case TCO_MESSAGE1: - return tr->tco.msg1; + ret =3D tr->tco.msg1; + break; case TCO_MESSAGE2: - return tr->tco.msg2; + ret =3D tr->tco.msg2; + break; case TCO_WDCNT: - return tr->tco.wdcnt; + ret =3D tr->tco.wdcnt; + break; case TCO_TMR: - return tr->tco.tmr; + ret =3D tr->tco.tmr; + break; case SW_IRQ_GEN: - return tr->sw_irq_gen; + ret =3D tr->sw_irq_gen; + break; } - return 0; + trace_tco_io_read(addr, ret); + return ret; } =20 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 =3D 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=3D%d (%d ms)" tco_timer_expired(int timeouts_no, bool strap, bool no_reboot) "timeouts_n= o=3D%d no_reboot=3D%d/%d" +tco_io_write(uint64_t addr, uint32_t val) "addr=3D0x%" PRIx64 " val=3D0x%"= PRIx32 +tco_io_read(uint64_t addr, uint32_t val) "addr=3D0x%" PRIx64 " val=3D0x%" = PRIx32 =20 # erst.c acpi_erst_reg_write(uint64_t addr, uint64_t val, unsigned size) "addr: 0x%= 04" PRIx64 " <=3D=3D 0x%016" PRIx64 " (size: %u)" --=20 2.37.3 From nobody Wed May 15 18:06:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667222630; cv=none; d=zohomail.com; s=zohoarc; b=iZjVBXlEKm6k1ebnLYC79QsrRvIqF4ezpLAa5QFBJpa8qfxY1emsk21Ove9TfYuWx3Fqh3l+sJD5wG+6lpSyG5L8N7NJxx6zniXTUwp5kpegt7MWpc9PxVdX7g+ZfGPv/2spGWN2PAmELbjFIavokG83h/+wrPmSlsgEtCKVyOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667222630; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VFdbS4xgEJzjazrbo4GSOQemc4ocXbeTbKoKAwqOYMQ=; b=JbsPUNaQIoT6D1tYzWk7smbCkzG9yKjfGF/oTVjdloHf3CcDvJbTA+JSnjQ8j2neIxgDYQayVFL3CIrG8jcUeptRtOSmg9cXsH8MqVAjMwDq5sCJhTt8zWv/i1OEbZoPmY4qJ7MZhEGW5SGTgJGzIyZ19U623DJTVA+xfv92q68= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667222630427481.1219901903431; Mon, 31 Oct 2022 06:23:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opUi4-0003Xt-0n; Mon, 31 Oct 2022 09:20:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opUho-0002ik-2O for qemu-devel@nongnu.org; Mon, 31 Oct 2022 09:19:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opUhj-0005OC-SZ for qemu-devel@nongnu.org; Mon, 31 Oct 2022 09:19:54 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-519-RFV7cLLaOnaFkEOqNlK-dw-1; Mon, 31 Oct 2022 09:19:46 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BB47F8027EC; Mon, 31 Oct 2022 13:19:45 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6A01477F5C; Mon, 31 Oct 2022 13:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667222390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VFdbS4xgEJzjazrbo4GSOQemc4ocXbeTbKoKAwqOYMQ=; b=DTGbj4jGj0OMhF0I+LXyRVUS93r0GfFlPMHEj4NFzoERmbVRUBy9ilfxo6BtwOQwEE7gcH RN5CXzasW/zNDKk+pn+EzsXUJxQOLCeVOQcVFf+vE4sHUGneq23k2vOqGddbxsos/INqxQ U4OMcKTHHAWpPCejxxzgMqrNaKCjG1E= X-MC-Unique: RFV7cLLaOnaFkEOqNlK-dw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Ani Sinha , Igor Mammedov , "Michael S. Tsirkin" , Thomas Huth , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , "Richard W.M. Jones" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 2/4] hw/isa: add trace events for ICH9 LPC chip config access Date: Mon, 31 Oct 2022 13:19:32 +0000 Message-Id: <20221031131934.425448-3-berrange@redhat.com> In-Reply-To: <20221031131934.425448-1-berrange@redhat.com> References: <20221031131934.425448-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.048, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667222632729100003 These tracepoints aid in understanding and debugging the guest drivers for the TCO watchdog. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Richard W.M. Jones --- hw/isa/lpc_ich9.c | 3 +++ hw/isa/trace-events | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 4553b5925b..66062a344c 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -51,6 +51,7 @@ #include "hw/nvram/fw_cfg.h" #include "qemu/cutils.h" #include "hw/acpi/acpi_aml_interface.h" +#include "trace.h" =20 /*************************************************************************= ****/ /* ICH9 LPC PCI to ISA bridge */ @@ -161,6 +162,7 @@ static void ich9_cc_write(void *opaque, hwaddr addr, { ICH9LPCState *lpc =3D (ICH9LPCState *)opaque; =20 + trace_ich9_cc_write(addr, val, len); ich9_cc_addr_len(&addr, &len); memcpy(lpc->chip_config + addr, &val, len); pci_bus_fire_intx_routing_notifier(pci_get_bus(&lpc->d)); @@ -176,6 +178,7 @@ static uint64_t ich9_cc_read(void *opaque, hwaddr addr, uint32_t val =3D 0; ich9_cc_addr_len(&addr, &len); memcpy(&val, lpc->chip_config + addr, len); + trace_ich9_cc_read(addr, val, len); return val; } =20 diff --git a/hw/isa/trace-events b/hw/isa/trace-events index b8f877e1ed..c4567a9b47 100644 --- a/hw/isa/trace-events +++ b/hw/isa/trace-events @@ -21,3 +21,7 @@ via_pm_io_read(uint32_t addr, uint32_t val, int len) "add= r 0x%x val 0x%x len 0x% via_pm_io_write(uint32_t addr, uint32_t val, int len) "addr 0x%x val 0x%x = len 0x%x" via_superio_read(uint8_t addr, uint8_t val) "addr 0x%x val 0x%x" via_superio_write(uint8_t addr, uint32_t val) "addr 0x%x val 0x%x" + +# lpc_ich9.c +ich9_cc_write(uint64_t addr, uint64_t val, unsigned len) "addr=3D0x%"PRIx6= 4 " val=3D0x%"PRIx64 " len=3D%u" +ich9_cc_read(uint64_t addr, uint64_t val, unsigned len) "addr=3D0x%"PRIx64= " val=3D0x%"PRIx64 " len=3D%u" --=20 2.37.3 From nobody Wed May 15 18:06:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667222464; cv=none; d=zohomail.com; s=zohoarc; b=cAuf++OVMA3MmrmkkMC81e2SQcuG1Qag86vcK8IR64VbEl7ufP/79IenkhGHBgoDCTHsdgIGphE187tBgkbB1OP4yPFzy7ZwlUFSq7wJbhfaVIUslNqUvPVnIzan9SeonP0Fs2CKHulZ0uQMZ5gT/Rudjzl7fhMVsysnqA/pRT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667222464; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pwlt14ABo4s0tRH6Aet8hetcqXHwT0mR2iSVpf7bJNo=; b=PVHT3QmqA9L4GOujCv4dv6t2r/eoHuQOaVNZfEDfJGx/jbAHfX0X58WvJwja0ZSuYPWrDnHwAvnEC1zgI+cosuobxGHezFoRJIUJP3dYV8N/9s3S8+lmenmKTQ95+QcXOQ55mujV4b4sxY4iYZW2fJsWr7pBOQ2t5o1mIZioHTA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667222464974889.6186692932722; Mon, 31 Oct 2022 06:21:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opUi5-0003ku-DY; Mon, 31 Oct 2022 09:20:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opUho-0002mL-HF for qemu-devel@nongnu.org; Mon, 31 Oct 2022 09:19:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opUhl-0005Oz-V3 for qemu-devel@nongnu.org; Mon, 31 Oct 2022 09:19:56 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-600-0H-kmCAqP5eqC_esvxLyjQ-1; Mon, 31 Oct 2022 09:19:49 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0F83E3C0F661; Mon, 31 Oct 2022 13:19:49 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11BF0477F5C; Mon, 31 Oct 2022 13:19:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667222392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pwlt14ABo4s0tRH6Aet8hetcqXHwT0mR2iSVpf7bJNo=; b=bVrco9tYYaKlZ4WKQRYQLhqC0JFOJ4plwoNW0Xan/b3g23KezUlW5K/lRVM483gXkQPYmX z30StyJmcljwlc+Dg/63nhXVaHU20yGWZDAUbEkWHhrdXIjYAMDPjKrXXARogZaIOMNNYR WNNShO2zSpOTYccYjM+nUVHuFE+UjSM= X-MC-Unique: 0H-kmCAqP5eqC_esvxLyjQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Ani Sinha , Igor Mammedov , "Michael S. Tsirkin" , Thomas Huth , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , "Richard W.M. Jones" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 3/4] hw/watchdog: add trace events for watchdog action handling Date: Mon, 31 Oct 2022 13:19:33 +0000 Message-Id: <20221031131934.425448-4-berrange@redhat.com> In-Reply-To: <20221031131934.425448-1-berrange@redhat.com> References: <20221031131934.425448-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.048, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667222465341100001 The tracepoints aid in debugging the triggering of watchdog devices. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard W.M. Jones --- hw/watchdog/trace-events | 4 ++++ hw/watchdog/watchdog.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/hw/watchdog/trace-events b/hw/watchdog/trace-events index 89ccbcfdfd..fc1d048702 100644 --- a/hw/watchdog/trace-events +++ b/hw/watchdog/trace-events @@ -16,3 +16,7 @@ spapr_watchdog_stop(uint64_t num, uint64_t ret) "num=3D%"= PRIu64 " ret=3D%" PRId64 spapr_watchdog_query(uint64_t caps) "caps=3D0x%" PRIx64 spapr_watchdog_query_lpm(uint64_t caps) "caps=3D0x%" PRIx64 spapr_watchdog_expired(uint64_t num, unsigned action) "num=3D%" PRIu64 " a= ction=3D%u" + +# watchdog.c +watchdog_perform_action(unsigned int action) "action=3D%d" +watchdog_set_action(unsigned int action) "action=3D%d" diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c index 6c082a3263..955046161b 100644 --- a/hw/watchdog/watchdog.c +++ b/hw/watchdog/watchdog.c @@ -30,6 +30,7 @@ #include "sysemu/watchdog.h" #include "hw/nmi.h" #include "qemu/help_option.h" +#include "trace.h" =20 static WatchdogAction watchdog_action =3D WATCHDOG_ACTION_RESET; =20 @@ -43,6 +44,8 @@ WatchdogAction get_watchdog_action(void) */ void watchdog_perform_action(void) { + trace_watchdog_perform_action(watchdog_action); + switch (watchdog_action) { case WATCHDOG_ACTION_RESET: /* same as 'system_reset' in monitor */ qapi_event_send_watchdog(WATCHDOG_ACTION_RESET); @@ -89,4 +92,5 @@ void watchdog_perform_action(void) void qmp_watchdog_set_action(WatchdogAction action, Error **errp) { watchdog_action =3D action; + trace_watchdog_set_action(watchdog_action); } --=20 2.37.3 From nobody Wed May 15 18:06:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1667222466; cv=none; d=zohomail.com; s=zohoarc; b=SOCUAlAzrdUyqnKcKbNRazzWRkAqiiz0AuKkzLRMw4dAyS2sxQJWESneQBsTa3SsHfl9/gPqXjgS9Uunty226d3STkP186hUi18v4uBFuFPC8TPRUTYUICSxR0MJ8k0kOUziJyR43Te889y5beKeda7zd1x6HfWWFoIDsdzEEK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667222466; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MiUUE/UfEijUftx7FO6aFz3Ujsm+rfjWtXq1o42Mwbs=; b=TddcJUxJEsCndVhRpOd/3Wx9RZkfthrmk40JyoYkET1oxmU8j13LmcVL0IfRCI5mm7byxGRz0aN9IrEyLek6oavPLZzWlwGoysRWsJRBxdJwalNRe6YXcWDLvwPrdy6C8cd7gNj6Lnng14Ip2LAWL+iXmwCmQIM9HpzNem/3eiw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667222466404508.4570328378211; Mon, 31 Oct 2022 06:21:06 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opUiH-0004gb-2x; Mon, 31 Oct 2022 09:20:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opUhx-00034S-Rw for qemu-devel@nongnu.org; Mon, 31 Oct 2022 09:20:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opUhp-0005R9-Lh for qemu-devel@nongnu.org; Mon, 31 Oct 2022 09:20:03 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-626-aRuA7RNuNsKbk-LM1AYfmA-1; Mon, 31 Oct 2022 09:19:52 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BF3413C0F661; Mon, 31 Oct 2022 13:19:51 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62327477F5C; Mon, 31 Oct 2022 13:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667222396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MiUUE/UfEijUftx7FO6aFz3Ujsm+rfjWtXq1o42Mwbs=; b=JoN/aQRepG50JKn6tBT7z/eecZckvZnsJoRRYotFsR8wINc884xg9xp1tDufnQ3T59sqNG fjFYMYLouBwGB85d2Li0LCCwOxIc9/Of8zjh8Hc+b/YPJj1ANO6oaXLuRpzPuxb5zl9ENG l1NNIXF1uKd8V6adNREk+XK6EDKBPSA= X-MC-Unique: aRuA7RNuNsKbk-LM1AYfmA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Richard Henderson , Ani Sinha , Igor Mammedov , "Michael S. Tsirkin" , Thomas Huth , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , "Richard W.M. Jones" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 4/4] hw/isa: enable TCO watchdog reboot pin strap by default Date: Mon, 31 Oct 2022 13:19:34 +0000 Message-Id: <20221031131934.425448-5-berrange@redhat.com> In-Reply-To: <20221031131934.425448-1-berrange@redhat.com> References: <20221031131934.425448-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.048, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1667222467354100007 The TCO watchdog implementation default behaviour from POV of the guest OS relies on the initial values for two I/O ports: * TCO1_CNT =3D=3D 0x0 Since bit 11 (TCO Timer Halt) is clear, the watchdog state is considered to be initially running * GCS =3D=3D 0x20 Since bit 5 (No Reboot) is set, the watchdog will not trigger when the timer expires This is a safe default, because the No Reboot bit will prevent the watchdog from triggering if the guest OS is unaware of its existance, or is slow in configuring it. When a Linux guest initializes the TCO watchdog, it will attempt to clear the "No Reboot" flag, and read the value back. If the clear was honoured, the driver will treat this as an indicator that the watchdog is functional and create the geust watchdog device. QEMU implements a second "no reboot" flag, however, via pin straps which overrides the behaviour of the guest controlled "no reboot" flag: commit 5add35bec1e249bb5345a47008c8f298d4760be4 Author: Paulo Alcantara Date: Sun Jun 28 14:58:58 2015 -0300 ich9: implement strap SPKR pin logic This second 'noreboot' pin was defaulted to high, which also inhibits triggering of the requested watchdog actions, unless QEMU is launched with the magic flag "-global ICH9-LPC.noreboot=3Dfalse". This is a bad default as we are exposing a watchdog to every guest OS using the q35 machine type, but preventing it from actually doing what it is designed to do. What is worse is that the guest OS and its apps have no way to know that the watchdog is never going to fire, due to this second 'noreboot' pin. If a guest OS had no watchdog device at all, then apps whose operation and/or data integrity relies on a watchdog can refuse to launch, and alert the administrator of the problematic deployment. With Q35 machines unconditionally exposing a watchdog though, apps will think their deployment is correct but in fact have no protection at all. This patch flips the default of the second 'no reboot' flag, so that configured watchdog actions will be honoured out of the box for the 7.2 Q35 machine type onwards, if the guest enables use of the watchdog. Signed-off-by: Daniel P. Berrang=C3=A9 Acked-by: Richard W.M. Jones --- hw/i386/pc.c | 4 +++- hw/isa/lpc_ich9.c | 2 +- tests/qtest/tco-test.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 3e86083db3..e814f62fc6 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -108,7 +108,9 @@ { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }= ,\ { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, =20 -GlobalProperty pc_compat_7_1[] =3D {}; +GlobalProperty pc_compat_7_1[] =3D { + { "ICH9-LPC", "noreboot", "true" }, +}; const size_t pc_compat_7_1_len =3D G_N_ELEMENTS(pc_compat_7_1); =20 GlobalProperty pc_compat_7_0[] =3D {}; diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 66062a344c..f9ce2ee1dc 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -789,7 +789,7 @@ static const VMStateDescription vmstate_ich9_lpc =3D { }; =20 static Property ich9_lpc_properties[] =3D { - DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, true), + DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, false), DEFINE_PROP_BOOL("smm-compat", ICH9LPCState, pm.smm_compat, false), DEFINE_PROP_BIT64("x-smi-broadcast", ICH9LPCState, smi_host_features, ICH9_LPC_SMI_F_BROADCAST_BIT, true), diff --git a/tests/qtest/tco-test.c b/tests/qtest/tco-test.c index 254f735370..caabcac6e5 100644 --- a/tests/qtest/tco-test.c +++ b/tests/qtest/tco-test.c @@ -60,7 +60,7 @@ static void test_init(TestData *d) QTestState *qs; =20 qs =3D qtest_initf("-machine q35 %s %s", - d->noreboot ? "" : "-global ICH9-LPC.noreboot=3Dfalse= ", + d->noreboot ? "-global ICH9-LPC.noreboot=3Dtrue" : "", !d->args ? "" : d->args); qtest_irq_intercept_in(qs, "ioapic"); =20 --=20 2.37.3