From nobody Thu Oct 31 23:13:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674407314155355.9619846175375; Sun, 22 Jan 2023 09:08:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJdop-00023T-8s; Sun, 22 Jan 2023 12:07:47 -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 1pJdon-00022o-Oc for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:45 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJdom-0005TU-6U for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:45 -0500 Received: by mail-ej1-x631.google.com with SMTP id hw16so25048211ejc.10 for ; Sun, 22 Jan 2023 09:07:43 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id kw4-20020a170907770400b0084d397e0938sm19670453ejc.195.2023.01.22.09.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Jan 2023 09:07:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kuM8mwAgpa0Pup/G43XnuFRa7bBjpEX8hFtFhv41d40=; b=QssRFAGvcBSMUqxTHjamJfOB1vbt3GaJgq1VYHnoFMgEz2LqyWldp0RTEcWhPHSMqF bBBlPXAZVnDC55ITAOSXsx7Qfe0rNwC1PjOYdjuPTulKevZoU+iLt7sBLJlJGkgoD/8o KrWh7qfPyJ2Yw7TfRLoU41pykAJrTJGWgpC7pKqQxDXxI/d71PqdTn7zw67VP4LK1uCV asa5eYia1LC4SwqYTaqmHMEYpD5Yx83tjTA6HMPuYbqM9Ftb748VFjUTmukxLwsGZEjg RD6pedR8XRj5yU/fgQarzeFAvs0PQgOdaZeQMzz1IPrZtw7bkHmDzL5kLLeOe87xBivz z+2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kuM8mwAgpa0Pup/G43XnuFRa7bBjpEX8hFtFhv41d40=; b=7cW42W/F9t5qDBmRhQeOfNVpn5X17sTpnKrSeyc71hd//5YMZUve/u0H4eARbfDB/6 CdoIDD9Qiym7KcmM1WZJsHFUe4HlNyXXLSIW5c4HRXqg4CZJrokoy1BbgEmCsLRSsM8w MT40Krs7nba5ytO9TJokHjHt0vloLB7CGfDiEh5bAvKAq3eFhswYx5/4qafPvo0XA6nP OxomEuYowG62K3bO76xvPcUnTLlzTKACEtQMWX0DIrB1HjPt11SbUa1ZtJn16MJg/jiI Zq1UdXJdXDz48q8etqF614vSYFCbGdnfUoFuCOtp//Hn3spHJws0VJ+Pt1vqwz3G/S8Z XUXA== X-Gm-Message-State: AFqh2kq0FbLmX84BRjy8z5/iv6G5Go9M9gSlSTsJG8wH6ZzzzcM3LIHH iFYIVLMSSR6pyAHHFFVQikfd0LAJ39dvEw== X-Google-Smtp-Source: AMrXdXsHm8eIyklvLGeaBKzdbz3xSOQNRARUKgIXhcEngNre2A1QGww7TSAtZx36HCTLUuqnXnTWyA== X-Received: by 2002:a17:906:52d0:b0:870:5496:26c0 with SMTP id w16-20020a17090652d000b00870549626c0mr22514977ejn.34.1674407262391; Sun, 22 Jan 2023 09:07:42 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , "Michael S. Tsirkin" , Aurelien Jarno , Bernhard Beschow Subject: [PATCH 1/7] hw/acpi/{ich9, piix4}: Reuse existing attributes for QOM properties Date: Sun, 22 Jan 2023 18:07:18 +0100 Message-Id: <20230122170724.21868-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230122170724.21868-1-shentey@gmail.com> References: <20230122170724.21868-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::631; envelope-from=shentey@gmail.com; helo=mail-ej1-x631.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1674407315143100003 Content-Type: text/plain; charset="utf-8" The QOM properties are accessed after the device models have been realized. This means that the constants are redundant. Remove them. Signed-off-by: Bernhard Beschow --- hw/acpi/ich9.c | 5 ++--- hw/acpi/piix4.c | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index a93c470e9d..2050af67b9 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -433,7 +433,6 @@ static void ich9_pm_set_keep_pci_slot_hpc(Object *obj, = bool value, Error **errp) =20 void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) { - static const uint32_t gpe0_len =3D ICH9_PMIO_GPE0_LEN; pm->acpi_memory_hotplug.is_enabled =3D true; pm->cpu_hotplug_legacy =3D true; pm->disable_s3 =3D 0; @@ -448,8 +447,8 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs = *pm) object_property_add(obj, ACPI_PM_PROP_GPE0_BLK, "uint32", ich9_pm_get_gpe0_blk, NULL, NULL, pm); - object_property_add_uint32_ptr(obj, ACPI_PM_PROP_GPE0_BLK_LEN, - &gpe0_len, OBJ_PROP_FLAG_READ); + object_property_add_uint8_ptr(obj, ACPI_PM_PROP_GPE0_BLK_LEN, + &pm->acpi_regs.gpe.len, OBJ_PROP_FLAG_RE= AD); object_property_add_bool(obj, "memory-hotplug-support", ich9_pm_get_memory_hotplug_support, ich9_pm_set_memory_hotplug_support); diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 0a81f1ad93..370b34eacf 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -421,18 +421,16 @@ static void piix4_pm_add_properties(PIIX4PMState *s) { static const uint8_t acpi_enable_cmd =3D ACPI_ENABLE; static const uint8_t acpi_disable_cmd =3D ACPI_DISABLE; - static const uint32_t gpe0_blk =3D GPE_BASE; - static const uint32_t gpe0_blk_len =3D GPE_LEN; static const uint16_t sci_int =3D 9; =20 object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_ENABLE_CMD, &acpi_enable_cmd, OBJ_PROP_FLAG_READ); object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_DISABLE_CMD, &acpi_disable_cmd, OBJ_PROP_FLAG_READ); - object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK, - &gpe0_blk, OBJ_PROP_FLAG_READ); - object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK_LEN, - &gpe0_blk_len, OBJ_PROP_FLAG_READ); + object_property_add_uint64_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK, + &s->io_gpe.addr, OBJ_PROP_FLAG_READ); + object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK_LEN, + &s->ar.gpe.len, OBJ_PROP_FLAG_READ); object_property_add_uint16_ptr(OBJECT(s), ACPI_PM_PROP_SCI_INT, &sci_int, OBJ_PROP_FLAG_READ); object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_PM_IO_BASE, --=20 2.39.1 From nobody Thu Oct 31 23:13:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674407315; cv=none; d=zohomail.com; s=zohoarc; b=JQrjpUcpoPFSH6ne6yj6pXq2mDyHh7nwbzvyp0DiuYr2Bymk7i2VCCp/1JWykDMPV+EE+SsSeWi0Ev2/IeR5r53DkZI8VFcFkp2X2gNEQNQoN9NeW4rdTA11pTPnO85iz+K7Z0H/RFik/hjxXAnzEvWQtj9HsXz0vbZwj22/m0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674407315; h=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=nQaQHWQNI3vzwZ2uav7kTtN2xFmzRbqZJRcUDlV+tKU=; b=lTFodEEeAoCQsjkD0QtsHsUbERP6Uy0jrHZQMeftykwNIuqq38l2i8V13SWyVzZx8Q3jF0CsxY/LXOpa/aTi1FTLXY2rlQzxsvu7MODXhd9vzTKjUkY6tuAmgSa08RP+uWu6jOVR4nndZ8umYrLlHfe6QnA4QWa3LT1ekUfMeic= 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 1674407315296625.8589295194396; Sun, 22 Jan 2023 09:08:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJdoq-00024C-5Q; Sun, 22 Jan 2023 12:07:48 -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 1pJdop-00023B-0c for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:47 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJdon-0005Ta-Gz for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:46 -0500 Received: by mail-ed1-x531.google.com with SMTP id b4so12137363edf.0 for ; Sun, 22 Jan 2023 09:07:45 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id kw4-20020a170907770400b0084d397e0938sm19670453ejc.195.2023.01.22.09.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Jan 2023 09:07:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nQaQHWQNI3vzwZ2uav7kTtN2xFmzRbqZJRcUDlV+tKU=; b=V5+mgXm7FOW/YqdOf0Co/pdeI2jZ0v69bo1lBPE9Aej53Nagy7okB8jjRU3jyuLzYx sFNlh2CSVVBy+aSa5aqM1EHkBl6SKBEJtW4DjKIHkSjEtX6IuNaJHiDxaWvVVB2AxAee +2+jpgYugmCBDLKqZi5XNwDj6Q63v0VsjYpnPu5OhxRgGJTprw0YlPQnL0e5UfgTosp5 yNAGFG8nwR5Ht9FqZicN0AxKNg+QEVAj92UH55kGeqp5mkwk3WKZ3/kUO1K8h8bhkRb8 ZqWXosqWzhFarpBX2v9qmyrdWEVja5q15pQIlcemx8PvpCA7xmFkhAJVx/5DWtRxJ2Aw cldQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nQaQHWQNI3vzwZ2uav7kTtN2xFmzRbqZJRcUDlV+tKU=; b=r/tJLzoP154XLwLB/7VlcgN5BQFTJgEQ1sgP95fB9GvxPXXRF1KiERtIEowcVqNoIn xY1tdsC5AVFWIvBGaEcBt4NhRR5G2c8Ux9NOPiK7Wi6gr9fPNX0bNacV7dpKbgLJIsV7 /N3E7k5epjgFL86iokNDuuSVrfOpryWvp4YbwRO9YF/jdY6pwUKLl2DTF/SNtlYsbANU nW42uN8CB6uIikuclrwY/9qGM2iKnhhS91bNGXJV/aj5s2e7sAsZ3c27JbFTLxYx0gwB trsN2r3tEKLAvOK9XhaDekbpdGv0YL6gIX3LqkD9cPqVyIsFOmPQTCCvp687egGqdXCx aq9g== X-Gm-Message-State: AFqh2krQGvKKTAKBHTOkOh6b1y9cydizGB99DQFLiDEd8SBP6xdXc72m cWjb8O6MADIQQQLXxOws5ZINwocRBsVF3g== X-Google-Smtp-Source: AMrXdXv506+V6jB++L8H10OMD5QGDrKck2+JgLRQRqqXLrlLPkSrE5ZttwnGAyPDcCk8+LnIqM2rTg== X-Received: by 2002:a05:6402:189:b0:499:376e:6b27 with SMTP id r9-20020a056402018900b00499376e6b27mr22608397edv.5.1674407263487; Sun, 22 Jan 2023 09:07:43 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , "Michael S. Tsirkin" , Aurelien Jarno , Bernhard Beschow Subject: [PATCH 2/7] hw/acpi/ich9: Remove unneeded assignments Date: Sun, 22 Jan 2023 18:07:19 +0100 Message-Id: <20230122170724.21868-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230122170724.21868-1-shentey@gmail.com> References: <20230122170724.21868-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::531; envelope-from=shentey@gmail.com; helo=mail-ed1-x531.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 @gmail.com) X-ZM-MESSAGEID: 1674407316733100007 Content-Type: text/plain; charset="utf-8" The first thing ich9_pm_iospace_update() does is to set pm->pm_io_base to the pm_io_base parameter. The pm_io_base parameter's value is the old one of pm->pm_io_base. Signed-off-by: Bernhard Beschow --- hw/acpi/ich9.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 2050af67b9..0313e71e74 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -136,9 +136,7 @@ void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t= pm_io_base) static int ich9_pm_post_load(void *opaque, int version_id) { ICH9LPCPMRegs *pm =3D opaque; - uint32_t pm_io_base =3D pm->pm_io_base; - pm->pm_io_base =3D 0; - ich9_pm_iospace_update(pm, pm_io_base); + ich9_pm_iospace_update(pm, pm->pm_io_base); return 0; } =20 --=20 2.39.1 From nobody Thu Oct 31 23:13:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674407366115566.6403427935967; Sun, 22 Jan 2023 09:09:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJdor-00024X-19; Sun, 22 Jan 2023 12:07:49 -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 1pJdop-00023z-P2 for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:47 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJdoo-0005TS-28 for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:47 -0500 Received: by mail-ej1-x634.google.com with SMTP id qx13so25024970ejb.13 for ; Sun, 22 Jan 2023 09:07:45 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id kw4-20020a170907770400b0084d397e0938sm19670453ejc.195.2023.01.22.09.07.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Jan 2023 09:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H2vClOyHfJHGHWScoT9CS6UO1o8J5b4Lv9/t/Xz8pGc=; b=QvEl3alJ0pvEJG9+cVl2fAToHCUBafyXW0v/+p7mGXC8kusrQYFVKNyI8zOkQWyVkE FFjI13QiZmmdIHuOIINMw6nnHZ11KM2q83zAjgBwdVBBMfX66ikLHe+8BZ/BVOtnDz3x NT3m/gFH6WQsHgRD6Awzmijxf23+3DJmbd4177Ky07vI6hRsBoV+qGLl2rMMbw6CDHQR CxVW1zv/VILO+FLOSyefZAPRMeEXPDQFSeir6FUbOFeQhQ5lu5+Z3rFcVwO39iqBlL9t Cu+NFdyAujItqhPFCymMt/u/FAhE9pY39StQ0AEjkLdfBZbdqAi/GURCH7zjsCVLDIWJ MI3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H2vClOyHfJHGHWScoT9CS6UO1o8J5b4Lv9/t/Xz8pGc=; b=Ja7VBH8uv+G91QpOKGpMkjN/SMRuvO5+5eLeVD5Ql/8EbSk/wcbaJ+24ESPS7cZAZv kk3JX773eMBoDYEPqjxF7EAAHwWon5sMTFAQj9buQkYKWuu/rCP+HZt44N1ycLmZhCHf yNgeFA4hEa0ghtRjzMBMLFOpDVYgc2KSUGEzZQtqgom1xe4CbqmaiZjiaOzrs0NmAjB2 vqfS4mArhE0hKeb77cyoMSA7lL3rMBK57sHYqHSarD1tV40feqI053HDtiVhWSCoZUTH DepmnkwNE+1OkBgoi8gpfEq4AROpngIHRBZRlAzRr9NpYYuat0Oj4IusTnUyXO0OJ0wM QkpQ== X-Gm-Message-State: AFqh2krSta6KqFz9keUJu4AzgJv/d0ZIVZOds/HLK1aqooc0VddSfRnm S7hN5VKRVq6v+Wwx7/T///cGZd4DOg24og== X-Google-Smtp-Source: AMrXdXtCxPG1TJZibWxXp3eVhatJAfPK7cU8Uyg1xwvkA2T0BDPHnyY+oUOqdTk6btTOoUzgP06v1g== X-Received: by 2002:a17:906:b14b:b0:864:1902:7050 with SMTP id bt11-20020a170906b14b00b0086419027050mr21343843ejb.69.1674407265215; Sun, 22 Jan 2023 09:07:45 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , "Michael S. Tsirkin" , Aurelien Jarno , Bernhard Beschow Subject: [PATCH 3/7] hw/acpi/{ich9, piix4}: Resolve redundant io_base address attributes Date: Sun, 22 Jan 2023 18:07:20 +0100 Message-Id: <20230122170724.21868-4-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230122170724.21868-1-shentey@gmail.com> References: <20230122170724.21868-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::634; envelope-from=shentey@gmail.com; helo=mail-ej1-x634.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1674407366949100001 Content-Type: text/plain; charset="utf-8" A MemoryRegion has an addr attribute which gets set to the same values as the redundant io_addr attributes. Signed-off-by: Bernhard Beschow --- include/hw/acpi/ich9.h | 1 - include/hw/acpi/piix4.h | 2 -- hw/acpi/ich9.c | 17 ++++++++--------- hw/acpi/piix4.c | 11 ++++++----- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index d41866a229..22471a1b9d 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -49,7 +49,6 @@ typedef struct ICH9LPCPMRegs { =20 qemu_irq irq; /* SCI */ =20 - uint32_t pm_io_base; Notifier powerdown_notifier; =20 bool cpu_hotplug_legacy; diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h index be1f8ea80e..62e1925a1f 100644 --- a/include/hw/acpi/piix4.h +++ b/include/hw/acpi/piix4.h @@ -39,8 +39,6 @@ struct PIIX4PMState { /*< public >*/ =20 MemoryRegion io; - uint32_t io_base; - MemoryRegion io_gpe; ACPIREGS ar; =20 diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 0313e71e74..f8af238974 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -126,17 +126,16 @@ void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32= _t pm_io_base) =20 assert((pm_io_base & ICH9_PMIO_MASK) =3D=3D 0); =20 - pm->pm_io_base =3D pm_io_base; memory_region_transaction_begin(); - memory_region_set_enabled(&pm->io, pm->pm_io_base !=3D 0); - memory_region_set_address(&pm->io, pm->pm_io_base); + memory_region_set_enabled(&pm->io, pm_io_base !=3D 0); + memory_region_set_address(&pm->io, pm_io_base); memory_region_transaction_commit(); } =20 static int ich9_pm_post_load(void *opaque, int version_id) { ICH9LPCPMRegs *pm =3D opaque; - ich9_pm_iospace_update(pm, pm->pm_io_base); + ich9_pm_iospace_update(pm, pm->io.addr); return 0; } =20 @@ -349,9 +348,9 @@ static void ich9_pm_get_gpe0_blk(Object *obj, Visitor *= v, const char *name, void *opaque, Error **errp) { ICH9LPCPMRegs *pm =3D opaque; - uint32_t value =3D pm->pm_io_base + ICH9_PMIO_GPE0_STS; + uint64_t value =3D pm->io.addr + ICH9_PMIO_GPE0_STS; =20 - visit_type_uint32(v, name, &value, errp); + visit_type_uint64(v, name, &value, errp); } =20 static bool ich9_pm_get_memory_hotplug_support(Object *obj, Error **errp) @@ -440,9 +439,9 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs = *pm) 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); - object_property_add(obj, ACPI_PM_PROP_GPE0_BLK, "uint32", + object_property_add_uint64_ptr(obj, ACPI_PM_PROP_PM_IO_BASE, + &pm->io.addr, OBJ_PROP_FLAG_READ); + object_property_add(obj, ACPI_PM_PROP_GPE0_BLK, "uint64", ich9_pm_get_gpe0_blk, NULL, NULL, pm); object_property_add_uint8_ptr(obj, ACPI_PM_PROP_GPE0_BLK_LEN, diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 370b34eacf..2e9bc63fca 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -91,13 +91,14 @@ static void apm_ctrl_changed(uint32_t val, void *arg) static void pm_io_space_update(PIIX4PMState *s) { PCIDevice *d =3D PCI_DEVICE(s); + uint32_t io_base; =20 - s->io_base =3D le32_to_cpu(*(uint32_t *)(d->config + 0x40)); - s->io_base &=3D 0xffc0; + io_base =3D le32_to_cpu(*(uint32_t *)(d->config + 0x40)); + io_base &=3D 0xffc0; =20 memory_region_transaction_begin(); memory_region_set_enabled(&s->io, d->config[0x80] & 1); - memory_region_set_address(&s->io, s->io_base); + memory_region_set_address(&s->io, io_base); memory_region_transaction_commit(); } =20 @@ -433,8 +434,8 @@ static void piix4_pm_add_properties(PIIX4PMState *s) &s->ar.gpe.len, OBJ_PROP_FLAG_READ); object_property_add_uint16_ptr(OBJECT(s), ACPI_PM_PROP_SCI_INT, &sci_int, OBJ_PROP_FLAG_READ); - object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_PM_IO_BASE, - &s->io_base, OBJ_PROP_FLAG_READ); + object_property_add_uint64_ptr(OBJECT(s), ACPI_PM_PROP_PM_IO_BASE, + &s->io.addr, OBJ_PROP_FLAG_READ); } =20 static void piix4_pm_realize(PCIDevice *dev, Error **errp) --=20 2.39.1 From nobody Thu Oct 31 23:13:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674407340; cv=none; d=zohomail.com; s=zohoarc; b=LhOA0+g6iLwQxdkSpsQufwqb7OlFtHRzHjv7KuKDiDrVJGup3DCURwh16LE1UBpRe21x12YtuK3mDG66/y+De1yxz1kxEk2zrnj7bGsqKZefx2O3mNtWUTErbrmAWZr8rYNDmB2g6cMpOn4aeBql4piEGfBvdLZ1++YJO/8h3k4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674407340; h=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=yNV6Luq8syOfSpRqKm0ADXQJug9isKXJJADcOVA5Ux0=; b=bkrQ2PuVry/oOB8bN+aNUVBxeeiOnexb3karo1DE9Qzl11KZB24QR20dnOunzbOMaW3WlXJJFVKKPas9zO29MI9a1buObqOUCeMPNOfzlJ4DB+CW4UKvxqn97ngajGhIy9R2ILevBCbxqtkBD2yloEoi7Azz9IN0DK89UIbSr24= 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 1674407340249597.5880384165307; Sun, 22 Jan 2023 09:09:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJdor-00024f-Jh; Sun, 22 Jan 2023 12:07:49 -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 1pJdoq-00024W-UT for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:48 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJdop-0005UN-HW for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:48 -0500 Received: by mail-ej1-x631.google.com with SMTP id tz11so25222377ejc.0 for ; Sun, 22 Jan 2023 09:07:47 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id kw4-20020a170907770400b0084d397e0938sm19670453ejc.195.2023.01.22.09.07.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Jan 2023 09:07:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yNV6Luq8syOfSpRqKm0ADXQJug9isKXJJADcOVA5Ux0=; b=caW6mi1ohgqp2yEKlFZundMAn+Ll1ggZcRNmwy0ogwvXNEY9yAT/uLXMq5NpnLNUKq f06Ayp6LDVUZXmIssG6v+1hqNWbH3Fdkz0Qa6Asl4dsrvH9ESrdNPWO8r+VhN0KcUqg3 pTSdAQ7fycGUG9Tat0EbBEH8d6VxNiBxRfpdUOVhL6+S4xyljuTIbEB95iqxAk8p8p3u 2XW6KpLud9d7OZJnfwSNdhtbwpr4s0A4E/loqLgHu/I1t2jz8qaQxUmCJv/tOVOP1iC8 0MfoZIuTXrJKI0nfSpjFIPTLO9enOZIkztCzYRxe7i/zOP/G25mhWwdFkEoGlBUulJSl d3lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yNV6Luq8syOfSpRqKm0ADXQJug9isKXJJADcOVA5Ux0=; b=eOIA63KFyzO4KaxhJgMQ2dpyemaEsr3m1pRYaycjFC72cCSly6EEhD+eaGIOHvGN++ Fd29Zeae+BYfA1mt2hgVpWiNeantgGbRF3GF25UowZ1OqlJ7V7nyQADcU5ALdTEQCQ0G GjKqIiLgC870mby4FJjj57Wj5cI4lLL7Lg4rhkKNHXqulTgAfc7PLw+/ozg966kbNmpL S7I/KE1gSmtZhI+P4tg+UsfiXxgBPn5RPqUhE65IDl1uT4+l/SWEiFvJ1sFj0aWRRxSV bZt2OnHYIlfOh9s3/+lvg1MR6zMx+lwifVL0guS0nCvGZb3VG86WQ1qldYUS9JN1jIF4 k5Ag== X-Gm-Message-State: AFqh2krVz6wGnNJSWWOHA5v/sEolDMKNyj58ih25pnLBIX5FYJaLhbHS PPulNvV7rhSYDqJbwqtvguqB1mD0YQcqDQ== X-Google-Smtp-Source: AMrXdXtw6Tn2+Jme9sKZ5QYtBiHeX9tkcvCWYNBeKGbgMFrGx3/Gb56jTLY+WYde1Rd02JPwQwcdgg== X-Received: by 2002:a17:906:4f93:b0:877:61e8:915a with SMTP id o19-20020a1709064f9300b0087761e8915amr15642627eju.75.1674407265986; Sun, 22 Jan 2023 09:07:45 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , "Michael S. Tsirkin" , Aurelien Jarno , Bernhard Beschow Subject: [PATCH 4/7] hw/acpi/ich9: Use ICH9_PMIO_GPE0_STS just once Date: Sun, 22 Jan 2023 18:07:21 +0100 Message-Id: <20230122170724.21868-5-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230122170724.21868-1-shentey@gmail.com> References: <20230122170724.21868-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::631; envelope-from=shentey@gmail.com; helo=mail-ej1-x631.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 @gmail.com) X-ZM-MESSAGEID: 1674407340997100003 Content-Type: text/plain; charset="utf-8" Cosmetic change emphasizing that always the actual address of the gpe0 block is returned. Signed-off-by: Bernhard Beschow --- hw/acpi/ich9.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index f8af238974..40a20e01ea 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -348,7 +348,9 @@ static void ich9_pm_get_gpe0_blk(Object *obj, Visitor *= v, const char *name, void *opaque, Error **errp) { ICH9LPCPMRegs *pm =3D opaque; - uint64_t value =3D pm->io.addr + ICH9_PMIO_GPE0_STS; + uint64_t value =3D pm->io.addr + pm->io_gpe.addr; + + assert(&pm->io =3D=3D pm->io_gpe.container); =20 visit_type_uint64(v, name, &value, errp); } --=20 2.39.1 From nobody Thu Oct 31 23:13:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674407377; cv=none; d=zohomail.com; s=zohoarc; b=DgkxxSwoWJ88KbhyjLfKSZs04VziSgN6eLjYLzgjASUmpULdhfYH3xmajWnkU/J+Z9WDgnk7RlMqkYPHq0Kfeds5w6D/Y+NU/3uL7AeN4mHKbKk3Zr8Y36Mghk/x5su+Axlh38Dw1/HoUSyXHE1HPcClzn7Ov/FcQ3tpbpicRE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674407377; h=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=WTp/1FVQ9VbeB7B8kOXkxftyXCVa8a/9MHE3WMaJPHc=; b=gpUBLdsIlTBIx3wHhfrcEEOFrPuWbPg4S/C94OhLV58OCVpX4A0ZB2cKEFTCWqnvzjA+a3rwvmx5M5ozX4JgfQ8EOBvghjMBNtbetNiUQkdBujFDkucV2K7kK3eAjqTMp/Tz38EKa9EMYLDc1WuGfyriZP1+PznwL/G8DLlVQtw= 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 1674407377213903.470235772198; Sun, 22 Jan 2023 09:09:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJdou-00025x-4c; Sun, 22 Jan 2023 12:07:52 -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 1pJdos-000250-8O for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:50 -0500 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJdoq-0005Uj-LS for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:50 -0500 Received: by mail-ej1-x629.google.com with SMTP id ss4so25036152ejb.11 for ; Sun, 22 Jan 2023 09:07:48 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id kw4-20020a170907770400b0084d397e0938sm19670453ejc.195.2023.01.22.09.07.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Jan 2023 09:07:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WTp/1FVQ9VbeB7B8kOXkxftyXCVa8a/9MHE3WMaJPHc=; b=n2KujdI0uAbwEGMLjp4i665qKt5CT+qZuvrd7vXEikI4T8QJBBO+2d+29tQ6CNZlXE oQZyNO1HwpGv4hbCeusgWq/lDUKOrW+sRWSdVH5v8s4AG56mIjJND+/3QMWj1NKmAOJV pdEePQ0/ATK3DewazwiI38Uz3xxIZ2Uk3nqOc7kkl/m3XjVmpfmKokmjo7mpM0pmokuV OzsLYiTpQixGMfhvP7t7eXx5ptO4LcT0y/fzCRDo6VhUJvMbRJ0QilI+/SMEWomH/OOW ghJF5imWCg1CDPacS4d/I/jz5DJs/MEYiDdImpkxYcvb8gtQey7ik6K9T+x2So9Y5M0i AGXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WTp/1FVQ9VbeB7B8kOXkxftyXCVa8a/9MHE3WMaJPHc=; b=UvosXh4V2HG8viZ3ClVgplnDTeu7GdX/yliNpiWciGnxR1EWyCFHyCl+bbxuToqLMp /UXX0PKwMpcrD1AAogJtaNjW1jRkoR+6WKSfahAHXtflfJrPcJUY74+uJXFKkDSrn/ud vLmZzKehgmYq3zkfpAt80IfMU0jxuud7rFIverVDR+0n4sPyVCE7VKujZ/rCv0qGAwXJ w/yFNMJf3lBx5anVm9zDRvmbtSkisSIgvVvrWb9v8WcLnu3w8fwrAdCML8ojJ231Vdnt 3adQltdXVTYK6LbekD6xAg1vuNM9O0EV8kk0H9l1AQ6oRuDGWNrd9s4sVxtGQU7fWE0Q RFGw== X-Gm-Message-State: AFqh2kr4RYOCI19+u4LRJ9VAGPr3n8lf3TcFDR+wynpzIFyzQwMpDq03 jPfALw0Ncj3soHXMJ4+9vHlx4ZFA9boQCA== X-Google-Smtp-Source: AMrXdXukWhvVYcgJun4PclDz0IZUSXMj8PEx1xiMgS1J6ax7mb+UbLqj0DWjukMVBl0T6ryd+EBooQ== X-Received: by 2002:a17:906:7188:b0:7c1:eb:b2a7 with SMTP id h8-20020a170906718800b007c100ebb2a7mr36578381ejk.13.1674407266947; Sun, 22 Jan 2023 09:07:46 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , "Michael S. Tsirkin" , Aurelien Jarno , Bernhard Beschow Subject: [PATCH 5/7] hw/acpi/piix4: Fix offset of GPE0 registers Date: Sun, 22 Jan 2023 18:07:22 +0100 Message-Id: <20230122170724.21868-6-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230122170724.21868-1-shentey@gmail.com> References: <20230122170724.21868-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::629; envelope-from=shentey@gmail.com; helo=mail-ej1-x629.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 @gmail.com) X-ZM-MESSAGEID: 1674407378982100006 Content-Type: text/plain; charset="utf-8" The PIIX4 datasheet defines the GPSTS register to be at offset 0x0c of the power management I/O register block. This register block is represented in the device model by the io attribute. So make io_gpe a child memory region of io at offset 0x0c. Note that SeaBIOS sets the base address of the register block to 0x600, resulting in the io_gpe block to start at 0x60c. GPE_BASE is defined as 0xafe0 which is 0xa9d4 bytes off. In order to preserve compatibilty, create an io_gpe_qemu memory region alias at GPE_BASE. Signed-off-by: Bernhard Beschow --- include/hw/acpi/piix4.h | 1 + hw/acpi/piix4.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h index 62e1925a1f..4e6cad9e8c 100644 --- a/include/hw/acpi/piix4.h +++ b/include/hw/acpi/piix4.h @@ -40,6 +40,7 @@ struct PIIX4PMState { =20 MemoryRegion io; MemoryRegion io_gpe; + MemoryRegion io_gpe_qemu; ACPIREGS ar; =20 APMState apm; diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 2e9bc63fca..836f9026b1 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -49,6 +49,7 @@ #include "qom/object.h" =20 #define GPE_BASE 0xafe0 +#define GPE_OFS 0xc #define GPE_LEN 4 =20 #define ACPI_PCIHP_ADDR_PIIX4 0xae00 @@ -429,7 +430,7 @@ static void piix4_pm_add_properties(PIIX4PMState *s) object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_DISABLE_CMD, &acpi_disable_cmd, OBJ_PROP_FLAG_READ); object_property_add_uint64_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK, - &s->io_gpe.addr, OBJ_PROP_FLAG_READ); + &s->io_gpe_qemu.addr, OBJ_PROP_FLAG_REA= D); object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK_LEN, &s->ar.gpe.len, OBJ_PROP_FLAG_READ); object_property_add_uint16_ptr(OBJECT(s), ACPI_PM_PROP_SCI_INT, @@ -558,7 +559,11 @@ static void piix4_acpi_system_hot_add_init(MemoryRegio= n *parent, { memory_region_init_io(&s->io_gpe, OBJECT(s), &piix4_gpe_ops, s, "acpi-gpe0", GPE_LEN); - memory_region_add_subregion(parent, GPE_BASE, &s->io_gpe); + memory_region_add_subregion(&s->io, GPE_OFS, &s->io_gpe); + + memory_region_init_alias(&s->io_gpe_qemu, OBJECT(s), "acpi-gpe0-qemu", + &s->io_gpe, 0, memory_region_size(&s->io_gpe)= ); + memory_region_add_subregion(parent, GPE_BASE, &s->io_gpe_qemu); =20 if (s->use_acpi_hotplug_bridge || s->use_acpi_root_pci_hotplug) { acpi_pcihp_init(OBJECT(s), &s->acpi_pci_hotplug, bus, parent, --=20 2.39.1 From nobody Thu Oct 31 23:13:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674407375; cv=none; d=zohomail.com; s=zohoarc; b=KzBsgUuIFZuf/uB/4cW1liuuSwhwX7GRFttdH/lhQh7s3zgll3El/NOLZijPCKGHQFi6nVjNnnZ5+FE+vdQde8/JN6xX53h790qKNbQqxn/9YPNL4JPBXy+eVHdqFZbBXV4yOb+eldSD5/q4Q1x4fCLJEEjJVSD/YGuZ6UcGZlQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674407375; h=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=eI89IUN7RUUfOnazKDFhGcoR2byoRpvGz9uEt6uTd/4=; b=B47Rga9Xau7pyc+0b7alY7kqZzhwwJbWLOutD+C76nuER6EkSAgdN5wWmjju5aF+c5pB/OSJCH9GuucxQfzzi6W1oXoOi4FCTFjeDVPZmuFoupuf02Z367L1TeTr0Gpq5lCzBYCVgpHcRW6QsdfnatrSlRSOSkyr6xaYhtBJVpk= 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 1674407375010952.5499070057998; Sun, 22 Jan 2023 09:09:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJdou-000266-Lg; Sun, 22 Jan 2023 12:07:52 -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 1pJdos-00025J-KX for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:50 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJdor-0005TS-1P for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:50 -0500 Received: by mail-ej1-x634.google.com with SMTP id qx13so25025160ejb.13 for ; Sun, 22 Jan 2023 09:07:48 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id kw4-20020a170907770400b0084d397e0938sm19670453ejc.195.2023.01.22.09.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Jan 2023 09:07:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eI89IUN7RUUfOnazKDFhGcoR2byoRpvGz9uEt6uTd/4=; b=KcEMhD9Ocq0RhW4sOjxD92H4y8Y/S8rCWBodI/SHp4rj26SDQio/QtpQMU+U+dGYWJ rKfAvRGUkj99F0R9swfYiwX0zJrlFVDa5a8TkzzqeQWgrYHr+rNRW0u3UF2vo6RRj1c+ 0hNTq3qXXAwsBOwdJyZUCAUAydLmyiDjHG5FWidwxh4P96p6Le8ZHC6ioH7rAIJNcimU /diBI4t+NrMoZJx28iOgLQVGVs7hyeGOtOCdUvhTvQz+jUtS9mZc5I7kUqx5Rj1mSklb yPC+Tse7wmZdYshhyzV3bBoR/I9GYuiuI4+xxeQoc9b5v5SqR/GzTs1WZs1CZgxZ79Y2 DvdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eI89IUN7RUUfOnazKDFhGcoR2byoRpvGz9uEt6uTd/4=; b=flswteq6so29A1hM+4mfZTB/HkQ9mzuqOL3lAX/duUoKOdvxtC6vMKDfQbMCZLJscR lh4giH8GlSJaEBG8IhS1Tdmf5RnB1G/oMY0fABiVSgS0DV9pHGKBjJza9xe7o3a/Q70Y WhVgjg7wJz01BX+voqbFlQTNZHW78XGd8qDX9ZtdVt7+hKSbLzTcm5/F3XlGPKDEM/nE 3T8pISHT+JBtCCFVtCXZHipDVscqEJN3Wuhx0EXdQ95CubcqTFKjmGa+1MZVb851qGGH r4IITpYpsa8lC4sO9lGhtUsjr6mIOgpJG3Tn/TY7d6CjS1UUemSZY4ef0ENaENckmscN dFuQ== X-Gm-Message-State: AFqh2kpAjoSr5mZVEqcx4HI7s7bvmbCYbyh3ppBBpFMEB/saLrcmm1Rt wi919aBHCIszejZFi97DoEa94SWoSasSdQ== X-Google-Smtp-Source: AMrXdXu40VdWxBunHDZGLJ14lcKQ3Ao6DdZsTeQt+4RyWXDlp+YvjRDDSA7V7sOuN6uhbCff83pabg== X-Received: by 2002:a17:906:6844:b0:86e:f478:f598 with SMTP id a4-20020a170906684400b0086ef478f598mr22331066ejs.44.1674407268141; Sun, 22 Jan 2023 09:07:48 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , "Michael S. Tsirkin" , Aurelien Jarno , Bernhard Beschow Subject: [PATCH 6/7] hw/acpi: Trace GPE access in all device models, not just PIIX4 Date: Sun, 22 Jan 2023 18:07:23 +0100 Message-Id: <20230122170724.21868-7-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230122170724.21868-1-shentey@gmail.com> References: <20230122170724.21868-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::634; envelope-from=shentey@gmail.com; helo=mail-ej1-x634.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 @gmail.com) X-ZM-MESSAGEID: 1674407376970100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bernhard Beschow Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/core.c | 5 +++++ hw/acpi/piix4.c | 3 --- hw/acpi/trace-events | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index 6da275c599..a33e410e69 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -32,6 +32,7 @@ #include "qemu/module.h" #include "qemu/option.h" #include "sysemu/runstate.h" +#include "trace.h" =20 struct acpi_table_header { uint16_t _length; /* our length, not actual part of the hdr */ @@ -686,6 +687,8 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr= , uint32_t val) { uint8_t *cur; =20 + trace_acpi_gpe_ioport_writeb(addr, val); + cur =3D acpi_gpe_ioport_get_ptr(ar, addr); if (addr < ar->gpe.len / 2) { /* GPE_STS */ @@ -709,6 +712,8 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t a= ddr) val =3D *cur; } =20 + trace_acpi_gpe_ioport_readb(addr, val); + return val; } =20 diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 836f9026b1..b65ddb8e44 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -45,7 +45,6 @@ #include "hw/acpi/acpi_dev_interface.h" #include "migration/vmstate.h" #include "hw/core/cpu.h" -#include "trace.h" #include "qom/object.h" =20 #define GPE_BASE 0xafe0 @@ -510,7 +509,6 @@ static uint64_t gpe_readb(void *opaque, hwaddr addr, un= signed width) PIIX4PMState *s =3D opaque; uint32_t val =3D acpi_gpe_ioport_readb(&s->ar, addr); =20 - trace_piix4_gpe_readb(addr, width, val); return val; } =20 @@ -519,7 +517,6 @@ static void gpe_writeb(void *opaque, hwaddr addr, uint6= 4_t val, { PIIX4PMState *s =3D opaque; =20 - trace_piix4_gpe_writeb(addr, width, val); acpi_gpe_ioport_writeb(&s->ar, addr, val); acpi_update_sci(&s->ar, s->irq); } diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index 78e0a8670e..159937ddb9 100644 --- a/hw/acpi/trace-events +++ b/hw/acpi/trace-events @@ -17,6 +17,10 @@ mhp_acpi_clear_remove_evt(uint32_t slot) "slot[0x%"PRIx3= 2"] clear remove event" mhp_acpi_pc_dimm_deleted(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm deleted" mhp_acpi_pc_dimm_delete_failed(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm d= elete failed" =20 +# core.c +acpi_gpe_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " =3D= =3D> 0x%" PRIx8 +acpi_gpe_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " <= =3D=3D 0x%" PRIx8 + # cpu.c cpuhp_acpi_invalid_idx_selected(uint32_t idx) "0x%"PRIx32 cpuhp_acpi_read_flags(uint32_t idx, uint8_t flags) "idx[0x%"PRIx32"] flags= : 0x%"PRIx8 @@ -48,10 +52,6 @@ acpi_pci_sel_read(uint32_t val) "%" PRIu32 acpi_pci_ej_write(uint64_t addr, uint64_t data) "0x%" PRIx64 " <=3D=3D %" = PRIu64 acpi_pci_sel_write(uint64_t addr, uint64_t data) "0x%" PRIx64 " <=3D=3D %"= PRIu64 =20 -# piix4.c -piix4_gpe_readb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" P= RIx64 " width: %d =3D=3D> 0x%" PRIx64 -piix4_gpe_writeb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" = PRIx64 " width: %d <=3D=3D 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" --=20 2.39.1 From nobody Thu Oct 31 23:13:24 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1674407335; cv=none; d=zohomail.com; s=zohoarc; b=Q0d35l0fgudBvws8ktVQ3Ti3Pjo7N+jeqmVcUqzUkrACqBQXNLiqczmCSR7AeL8vOuPbDOnGiGEXx9tbbe5fHzJbmIj3W+w49WvLULSGY4+BLJYBZEShRvtIEunJzQ8iIGWv00Iig/dtSHsFJEiY3AyYeDGz6NFUVuKlb3bLmOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674407335; h=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=55nP5nNHv1CqBBrsvggBWBrAdo4oEubQ3LLGbVvXnaI=; b=V5WuA7NqLkfog0B7WZrGx1R4YwmCmXluSORo31jl6w3z3NbfHfXS37NCDBqFCKLz5nXAHoJknyT4ZTKJU59KrF7NxWGjbmvLNzMl2xIuuy63uGTCUshhahN5REXFU5R6uzNhy6wn3cjA6CPbYHRph/tgO7EXwZOdaLrztBqUl6A= 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 1674407335581289.01987801319603; Sun, 22 Jan 2023 09:08:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJdov-00026E-RK; Sun, 22 Jan 2023 12:07:53 -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 1pJdou-00025y-7i for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:52 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJdos-0005V5-Mc for qemu-devel@nongnu.org; Sun, 22 Jan 2023 12:07:52 -0500 Received: by mail-ej1-x633.google.com with SMTP id qx13so25025203ejb.13 for ; Sun, 22 Jan 2023 09:07:50 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf0bb2009c4947838afc41b6.dip0.t-ipconnect.de. [2003:fa:af0b:b200:9c49:4783:8afc:41b6]) by smtp.gmail.com with ESMTPSA id kw4-20020a170907770400b0084d397e0938sm19670453ejc.195.2023.01.22.09.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Jan 2023 09:07:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=55nP5nNHv1CqBBrsvggBWBrAdo4oEubQ3LLGbVvXnaI=; b=Zq2A7M6RXabHrttR39XiFU3gWSLZNFH2yydlttFAzWFdvdFEsZt7QBmkKgCCqazxIL zy+7Sf8wDBUXw74kP+M+aBcfN+6w8knjihsQjIoJIjJucZ4IA6/Mop/CuYnVZ7Q7ESR/ EQFJsdSG/h/KZPdMByU4vEaKwqTSaT+b0aGyB/sS/uoPPLhbDXMElX4f4k6kpgYy4pqW 0Xs7DW4x9XygNDpow42jHJ9vWV8q70Ze57Y+7s5eQ2GZ6oivwXaiXfqzEqa0+2QBOwG/ IaYYaU7e+zEGjgBkTmxCqx5vA2uhrKVZPUfWg2nMKstrMoDpfx9ztLqhjViO9ro5leja 1CIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=55nP5nNHv1CqBBrsvggBWBrAdo4oEubQ3LLGbVvXnaI=; b=hA2qmbhF9MWebYMZ1bhMcItbWgP70ISUdsPv/UfhAKRbvdsMu6srUo7s8GebjXGt3d H4nyG9duLhLe8rI4R4ZeGVvX78lxRTMwq6IQJNFDOH7gANceTB0dy5qUNeyUwejIy2Nv FzTOf2PBdDY6OGtk/83Zco0yiWck36jPfhauvQUxPLzRaG5zCRDygZ+AA7qilUyWePFp W9yVkpsjIdJaQyMcFGhPwIXi8CrST8pyO8ucVG/CPH/JaPmvb56630GuhTVvBLqXH/qe NYZCV9kVGMy313nRawlSgJUrC/6gVaZO3wipc47ltEqn+jfFbHtr08UOnAZ2KU2LVDIR XLWQ== X-Gm-Message-State: AFqh2kr9bNSOg4khaMuPOehU+KZJbHgmiDd0LurVJhjDBuYprGZEAJfQ fXh+gVTWLnjVIuxhzfScvMylfpixLYHLDg== X-Google-Smtp-Source: AMrXdXskVSqK1IHroQcrP0p6vic9KS4gJ7VHSMHkLoJe5d/yYzuAElhSiU7oPUlnwFvknZ5G76SG/g== X-Received: by 2002:a17:906:df49:b0:84c:f9b0:b54a with SMTP id if9-20020a170906df4900b0084cf9b0b54amr18957784ejc.58.1674407268982; Sun, 22 Jan 2023 09:07:48 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Igor Mammedov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ani Sinha , "Michael S. Tsirkin" , Aurelien Jarno , Bernhard Beschow Subject: [PATCH 7/7] hw/acpi/core: Trace enable and status registers of GPE separately Date: Sun, 22 Jan 2023 18:07:24 +0100 Message-Id: <20230122170724.21868-8-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230122170724.21868-1-shentey@gmail.com> References: <20230122170724.21868-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::633; envelope-from=shentey@gmail.com; helo=mail-ej1-x633.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 @gmail.com) X-ZM-MESSAGEID: 1674407336775100001 Content-Type: text/plain; charset="utf-8" The bit positions of both registers are related. Tracing the registers independently results in the same offsets across these registers which eases debugging. Signed-off-by: Bernhard Beschow Acked-by: Igor Mammedov --- hw/acpi/core.c | 10 +++++++--- hw/acpi/trace-events | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hw/acpi/core.c b/hw/acpi/core.c index a33e410e69..cc33605d61 100644 --- a/hw/acpi/core.c +++ b/hw/acpi/core.c @@ -687,13 +687,13 @@ void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t ad= dr, uint32_t val) { uint8_t *cur; =20 - trace_acpi_gpe_ioport_writeb(addr, val); - cur =3D acpi_gpe_ioport_get_ptr(ar, addr); if (addr < ar->gpe.len / 2) { + trace_acpi_gpe_sts_ioport_writeb(addr, val); /* GPE_STS */ *cur =3D (*cur) & ~val; } else if (addr < ar->gpe.len) { + trace_acpi_gpe_en_ioport_writeb(addr - (ar->gpe.len / 2), val); /* GPE_EN */ *cur =3D val; } else { @@ -712,7 +712,11 @@ uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t = addr) val =3D *cur; } =20 - trace_acpi_gpe_ioport_readb(addr, val); + if (addr < ar->gpe.len / 2) { + trace_acpi_gpe_sts_ioport_readb(addr, val); + } else { + trace_acpi_gpe_en_ioport_readb(addr - (ar->gpe.len / 2), val); + } =20 return val; } diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index 159937ddb9..d387adfb0b 100644 --- a/hw/acpi/trace-events +++ b/hw/acpi/trace-events @@ -18,8 +18,10 @@ mhp_acpi_pc_dimm_deleted(uint32_t slot) "slot[0x%"PRIx32= "] pc-dimm deleted" mhp_acpi_pc_dimm_delete_failed(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm d= elete failed" =20 # core.c -acpi_gpe_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " =3D= =3D> 0x%" PRIx8 -acpi_gpe_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " <= =3D=3D 0x%" PRIx8 +acpi_gpe_sts_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 "= =3D=3D> 0x%" PRIx8 +acpi_gpe_en_ioport_readb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 " = =3D=3D> 0x%" PRIx8 +acpi_gpe_sts_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 = " <=3D=3D 0x%" PRIx8 +acpi_gpe_en_ioport_writeb(uint32_t addr, uint8_t val) "addr: 0x%" PRIx32 "= <=3D=3D 0x%" PRIx8 =20 # cpu.c cpuhp_acpi_invalid_idx_selected(uint32_t idx) "0x%"PRIx32 --=20 2.39.1