From nobody Thu May 16 02:15:54 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@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671195528; cv=none; d=zohomail.com; s=zohoarc; b=JeE23HmqlOMx0RAqfUvHRZtVESGuvq3KrqA4M8mv51G35I3CGF+DU9sjIa23rWfKn6PA4wWLOcCc+dJuK6+ShOm11mw6JpDAtHhhvPrqnmAYD9PNvzpwT3NxQfodbdrSbPKPekf/bHo56i+TP3uTJ0yP5g3Kr2OBPhmNMrldK6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671195528; 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=1zpCjZAU0bclMfxFBYAiccs274UHUw9k6xHVPDLlAA0=; b=TSYLxc0470aucVUHCN2E4BVuCcGaUVwk8GsxEzrGLpos+J7uWUASu3F9JJmESYxRO6PCxlL9Csrq4PgvCbH3hi2jdx81g9E6Gk2DSIbKZ1sU61krjpzBhBIwtWsLRtRPWVYReQRE8O8T+0OzZpKkaWz+J4b3egN5WXUhcEq6mzg= 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@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 1671195528610121.58803137443499; Fri, 16 Dec 2022 04:58:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6AHn-0007qK-At; Fri, 16 Dec 2022 07:57:59 -0500 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 1p6AHk-0007pT-SX for qemu-devel@nongnu.org; Fri, 16 Dec 2022 07:57:56 -0500 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 1p6AHj-00063f-EF for qemu-devel@nongnu.org; Fri, 16 Dec 2022 07:57:56 -0500 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-14-5T5jTAE6NSy-B4MUPXg8Sw-1; Fri, 16 Dec 2022 07:57:51 -0500 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 1DD3D1C25E80; Fri, 16 Dec 2022 12:57:51 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2982492C14; Fri, 16 Dec 2022 12:57:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671195474; 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=1zpCjZAU0bclMfxFBYAiccs274UHUw9k6xHVPDLlAA0=; b=iFC0hwLWNmEISHzL/4YzZY7FkBlKxbB2RKNu8V9wUdWtVX7iJ1nEdr4B3Q2A0PKnUUxaHq yvLtpNnTELC8vNqQJypZPnYwk8XVBVUE2xRVtK3jgEqBAPHKTX85Akbp+FUV58+8M9f2hE umdlBbV3IXsN42ekO/HydnVvgDDZCbE= X-MC-Unique: 5T5jTAE6NSy-B4MUPXg8Sw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , "Michael S. Tsirkin" , Marcel Apfelbaum , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Eduardo Habkost , Ani Sinha , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Richard W . M . Jones" Subject: [PATCH 1/5] hw/acpi: add trace events for TCO watchdog register access Date: Fri, 16 Dec 2022 07:57:45 -0500 Message-Id: <20221216125749.596075-2-berrange@redhat.com> In-Reply-To: <20221216125749.596075-1-berrange@redhat.com> References: <20221216125749.596075-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@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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671195529887100010 These tracepoints aid in understanding and debugging the guest drivers for the TCO watchdog. Reviewed-by: Richard W.M. Jones Signed-off-by: Daniel P. Berrang=C3=A9 --- 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.38.1 From nobody Thu May 16 02:15:54 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@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671195510; cv=none; d=zohomail.com; s=zohoarc; b=KAuU6cZnyC1jBj+K4T93zEAQkSwjXKrprxP4z817xU+0IinEu2V5GCY1b6Ng8bIkzRQaDnww84AJIx7if8HzRcbXiS9qBSumkYgeOJ/4OH60YBdrPo+g32YNGAy38SPtBFusSn3hKtXNU6eDHOWaAE8NZQFQUwjDv3uSz+29xgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671195510; 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=d1reKDkzKbu/2P5wIVUeEoIoAgi/Wc1pngBnCH10X70=; b=UTWlGVZtWjICLFQYHdGblzKuZx/eM5C3gUt6ZfETlb4ORperQfceeo4F6xZeMkoZE3oZOxq1GGdT17nlCxoJKjx+0kfjoQumljcIcPoWgn58GFn8lR1n9J9D5x4C11nuoC/5ipS1SY3kIm/gMwQ0AX9ilx2PRkYDegnh9XPAGTg= 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@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 1671195510948290.1643200896618; Fri, 16 Dec 2022 04:58:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6AHo-0007qQ-3j; Fri, 16 Dec 2022 07:58:00 -0500 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 1p6AHl-0007pi-OD for qemu-devel@nongnu.org; Fri, 16 Dec 2022 07:57:57 -0500 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 1p6AHj-00063j-SP for qemu-devel@nongnu.org; Fri, 16 Dec 2022 07:57:57 -0500 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-358-XynEhUcrNqK_6lTuKrqahA-1; Fri, 16 Dec 2022 07:57:51 -0500 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 75E252806055; Fri, 16 Dec 2022 12:57:51 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27472492C14; Fri, 16 Dec 2022 12:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671195475; 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=d1reKDkzKbu/2P5wIVUeEoIoAgi/Wc1pngBnCH10X70=; b=Xx+aQKnyN6P8xhx+Z+leKTh1+Z6riTkqlMRI5s9UNWa1PQMyfgP/ps0KjYx58AzLfB5lhX vSUlKbNTiKqRzJ6cKKflIElocfQMWzS+OZ/72o4+4Z6IB7CuVU1Xd923PFGSEQQxtsjea3 h4q+KgqM+jr1Bveje/XP9RsYBlboYcI= X-MC-Unique: XynEhUcrNqK_6lTuKrqahA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , "Michael S. Tsirkin" , Marcel Apfelbaum , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Eduardo Habkost , Ani Sinha , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Richard W . M . Jones" Subject: [PATCH 2/5] hw/isa: add trace events for ICH9 LPC chip config access Date: Fri, 16 Dec 2022 07:57:46 -0500 Message-Id: <20221216125749.596075-3-berrange@redhat.com> In-Reply-To: <20221216125749.596075-1-berrange@redhat.com> References: <20221216125749.596075-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@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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671195512065100005 These tracepoints aid in understanding and debugging the guest drivers for the TCO watchdog. Reviewed-by: Richard W.M. Jones Signed-off-by: Daniel P. Berrang=C3=A9 --- 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 6c44cc9767..cea73924b4 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -52,6 +52,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 */ @@ -162,6 +163,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)); @@ -177,6 +179,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.38.1 From nobody Thu May 16 02:15:54 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@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671195527; cv=none; d=zohomail.com; s=zohoarc; b=TtVYR4xVYn5xIeZkWW52dXo9pCIJ78vOlolMxdjAW38jzr8F/jSlot7ya4ynz/gTz3WFnuJUCSSuZwY2RrFcM55r1EVhcowjPGyaapYsUhs42LgPFTwzHSIoKx3hgZg9wK2ZDDvoJfPCW/Qqg4L1+mKoiwNDmfOOsyGxvn9gzxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671195527; 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=NUEAwdE9XRlr+4WMqDld8wcprb/TeuVRPIZb1Af6fPg=; b=dMrPkmPCNGm90vxiVkqKODTLduNjCYXMBPECq/1N5MM5d9KH6jY27RsxmPAJHqzXZ76a9Vix+JCtaG4vtOUB7TZA7vpKr3iC8KP/8KbSRwlPcc+EzS7cdMMSUP5wu2vhpYkciiX6WGm/wPrEIswlhnmj7XLh4OZqBzDN2Lhem1A= 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@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 167119552724773.48010327997383; Fri, 16 Dec 2022 04:58:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6AIU-00088K-1L; Fri, 16 Dec 2022 07:58:42 -0500 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 1p6AHz-0007rm-S6 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 07:58:11 -0500 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 1p6AHr-00064D-Lw for qemu-devel@nongnu.org; Fri, 16 Dec 2022 07:58:11 -0500 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-232-_RrAHeevO4iGLrS4fxMZkg-1; Fri, 16 Dec 2022 07:57:52 -0500 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 D3B5B85A588; Fri, 16 Dec 2022 12:57:51 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 801EF492C14; Fri, 16 Dec 2022 12:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671195477; 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=NUEAwdE9XRlr+4WMqDld8wcprb/TeuVRPIZb1Af6fPg=; b=VxM1E510Va7eDKTReZgD2MRGH+7Zm8iVfQxDUp/AV88pjIhdVv+VCGvR7eY+ZGyuqxXw1/ 34qlrp0Zxv5xFjVRt+sL+V7og9mCxKl5KIODswwOYjym7WB6fDOeUP+nCdsOx29nl71mcg FNZ7mlv5xqQmk43pVwkVgBLW/9bBH/w= X-MC-Unique: _RrAHeevO4iGLrS4fxMZkg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , "Michael S. Tsirkin" , Marcel Apfelbaum , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Eduardo Habkost , Ani Sinha , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Richard W . M . Jones" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/5] hw/watchdog: add trace events for watchdog action handling Date: Fri, 16 Dec 2022 07:57:47 -0500 Message-Id: <20221216125749.596075-4-berrange@redhat.com> In-Reply-To: <20221216125749.596075-1-berrange@redhat.com> References: <20221216125749.596075-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@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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671195527905100001 The tracepoints aid in debugging the triggering of watchdog devices. Reviewed-by: Richard W.M. Jones Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Daniel P. Berrang=C3=A9 --- 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..54371ae075 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%u" +watchdog_set_action(unsigned int action) "action=3D%u" 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.38.1 From nobody Thu May 16 02:15:54 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@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671195530; cv=none; d=zohomail.com; s=zohoarc; b=XAcUxkXJ4P5rdgwt0g7ApPfn4w1mYM2EfGIAlXAQKS6s3UBut0XDADIKmVXCnxKiV/kgNb2rKNOKVxEvjecjuJusV1yxdijS/K5rVQ/NGLK8MK7cAhq02lQZvjcmDUZL1l1awBqImJXIYB/wt/5IBMhNNlpb85GXBooXZ+2LwN0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671195530; 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=HcjwYhBG7GG7W91DKtdr3Cncc/EKagw6Yp0luqJu/CI=; b=OoEkLrdBhMamvOHf79MQrXlaLrLre2NcpSbOyrw0BTEax1QVuUFJn1/2B3zPseS2XUSoSY3hVLluWCI89zPKhfjPaJLPqvo1bOC4VoDB0p682+wNrZ/bu114eJUvDadYoxNFNKCz1e2L9OE8UqfG7Gi04Lvu1ZcxvGfO/1Ig76c= 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@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 1671195530603185.98134892845724; Fri, 16 Dec 2022 04:58:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6AI2-0007rw-DA; Fri, 16 Dec 2022 07:58:16 -0500 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 1p6AHy-0007rQ-4q for qemu-devel@nongnu.org; Fri, 16 Dec 2022 07:58:10 -0500 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 1p6AHk-00063s-LX for qemu-devel@nongnu.org; Fri, 16 Dec 2022 07:57:58 -0500 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-127-PmMXIGK7MMmmUDfRoy3VsQ-1; Fri, 16 Dec 2022 07:57:52 -0500 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 38BAC3815D2F; Fri, 16 Dec 2022 12:57:52 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD859492C14; Fri, 16 Dec 2022 12:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671195476; 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=HcjwYhBG7GG7W91DKtdr3Cncc/EKagw6Yp0luqJu/CI=; b=JXC53nVJ3krb4XVxZJZAnnW4TwXnUnymaFT8gyaqwia0QAjPAoMR5ElCquniS6oYC1tzEk ORkQsRZCW923dazMewVj6t/5f1gTjn5ikC4YulVJVX9ENPMjoHShquxhx60k8YhvQctiIE ywYmRtiOt48CJN+eQxjJYaG4wG8kya4= X-MC-Unique: PmMXIGK7MMmmUDfRoy3VsQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , "Michael S. Tsirkin" , Marcel Apfelbaum , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Eduardo Habkost , Ani Sinha , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Richard W . M . Jones" Subject: [PATCH 4/5] hw/isa: enable TCO watchdog reboot pin strap by default Date: Fri, 16 Dec 2022 07:57:48 -0500 Message-Id: <20221216125749.596075-5-berrange@redhat.com> In-Reply-To: <20221216125749.596075-1-berrange@redhat.com> References: <20221216125749.596075-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@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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671195531908100015 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 guest 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. See also related bug reports https://bugzilla.redhat.com/show_bug.cgi?id=3D2080207 https://bugzilla.redhat.com/show_bug.cgi?id=3D2136889 https://bugzilla.redhat.com/show_bug.cgi?id=3D2137346 Reviewed-by: Richard W.M. Jones Signed-off-by: Daniel P. Berrang=C3=A9 --- 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 fa69b6f43e..b2501fa6ab 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -107,7 +107,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 cea73924b4..8d541e2b54 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -792,7 +792,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.38.1 From nobody Thu May 16 02:15:54 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@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1671195528; cv=none; d=zohomail.com; s=zohoarc; b=SVEC7gvCtwA7giRT6pa60OsZWdqlAahNAsAF8HINxhkY5B+e9eS3sxdNfn2wNqEhi2aRxV6rfe+3DMmZ0kVxAGPTNMoatL4cvK+AtkZVdNNCFszYrZObSBT4NWtnbWORmOn1Fkm8+P99YZmrB896lOScCxOGqQtMJestdBhGOVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671195528; 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=Muen1443LeWWa/dZYbIKAnRA8skUYm0Halhqwd8H1QI=; b=QvwwivFqrkD2zrhna4t9DF6p+M1eQ8riGNCSkXWEa4rDHXT9gZOuV3JpNfDg3lW2I8y5H3jiHwiGlLrAQWjQibwSm3Z4AckjOn1hG9D0gmrnzi6GxPIlLGmNa2K7Vs/8oboCRFPZspXmvhJfLOwf6sevDQbQgCA3HiiXrbTnqoE= 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@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 1671195528139118.68854827236362; Fri, 16 Dec 2022 04:58:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6AI0-0007rq-Ob; Fri, 16 Dec 2022 07:58:12 -0500 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 1p6AHy-0007rR-4d for qemu-devel@nongnu.org; Fri, 16 Dec 2022 07:58:10 -0500 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 1p6AHl-00063y-87 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 07:57:58 -0500 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-64-qLqVBN2zO8u_1fyh2Ly91A-1; Fri, 16 Dec 2022 07:57:52 -0500 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 8C18A87A9E2; Fri, 16 Dec 2022 12:57:52 +0000 (UTC) Received: from virtlab420.virt.lab.eng.bos.redhat.com (virtlab420.virt.lab.eng.bos.redhat.com [10.19.152.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4264B492C1B; Fri, 16 Dec 2022 12:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671195476; 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=Muen1443LeWWa/dZYbIKAnRA8skUYm0Halhqwd8H1QI=; b=ONprUWNIdumxqPwOZP7PRdUPjI1EsHBhXyWyqpVokGkRh45DcNs1FMjrCBoAJ2f+ROu7l9 S5ifX5FtIH3PtUqjkhiFJJ1merqviBAtV8WfPrartr3LfkrUTQRqqokyUhiWWvAsaKe/pL lw4ZrAMSVWVvPp5Lw34wBUVZcF1Q3Mg= X-MC-Unique: qLqVBN2zO8u_1fyh2Ly91A-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , "Michael S. Tsirkin" , Marcel Apfelbaum , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Eduardo Habkost , Ani Sinha , Richard Henderson , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 5/5] ich9: honour 'enable_tco' property Date: Fri, 16 Dec 2022 07:57:49 -0500 Message-Id: <20221216125749.596075-6-berrange@redhat.com> In-Reply-To: <20221216125749.596075-1-berrange@redhat.com> References: <20221216125749.596075-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@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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1671195529881100009 An 'ICH9-LPC.enable_tco' property has been exposed for a very long time, but attempts to set it have never been honoured. Originally, any user provided 'enable_tco' value was force replaced by a value passed from the machine type setup code that was determine by machine type compat properties. commit d6b304ba924b95d12edfddaac99777b577301309 Author: Eduardo Habkost Date: Sat Jan 23 14:02:10 2016 -0200 machine: Remove no_tco field The field is always set to zero, so it is not necessary anymore. After legacy Q35 machine types were deleted in: commit 86165b499edf8b03bb2d0e926d116c2f12a95bfe Author: Eduardo Habkost Date: Sat Jan 23 14:02:09 2016 -0200 q35: Remove old machine versions the machine type code ended up just unconditionally passing 'true', all the time, so this was further simplified in commit d6b304ba924b95d12edfddaac99777b577301309 Author: Eduardo Habkost Date: Sat Jan 23 14:02:10 2016 -0200 machine: Remove no_tco field The field is always set to zero, so it is not necessary anymore. commit 18d6abae3ea092950629e5d26aff1dcfc9a2d78e Author: Eduardo Habkost Date: Sat Jan 23 14:02:11 2016 -0200 ich9: Remove enable_tco arguments from init functions The enable_tco arguments are always true, so they are not needed anymore. Leaving the ich9_pm_init to just force set 'enable_tco' to true. This still overrides any user specified property. The initialization of property defaults should be done when properties are first registered, rather than during object construction. Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/acpi/ich9.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index bd9bbade70..ea4182256d 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -316,8 +316,9 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, =20 pm->smm_enabled =3D smm_enabled; =20 - pm->enable_tco =3D true; - acpi_pm_tco_init(&pm->tco_regs, &pm->io); + if (pm->enable_tco) { + acpi_pm_tco_init(&pm->tco_regs, &pm->io); + } =20 if (pm->use_acpi_hotplug_bridge) { acpi_pcihp_init(OBJECT(lpc_pci), @@ -440,6 +441,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs = *pm) pm->s4_val =3D 2; pm->use_acpi_hotplug_bridge =3D true; pm->keep_pci_slot_hpc =3D true; + pm->enable_tco =3D true; =20 object_property_add_uint32_ptr(obj, ACPI_PM_PROP_PM_IO_BASE, &pm->pm_io_base, OBJ_PROP_FLAG_READ); --=20 2.38.1