From nobody Sat May 18 13:36:47 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=1676309533; cv=none; d=zohomail.com; s=zohoarc; b=gHdz6AE183V6plBFa1/kQxAGgJ4XFggCAtAT1/ZneBKN9FyEfmPavlbikguWdBkS7bFRpUjblEHf8R5ERaygv1TCa90e1uSoSEGOBPQj24Gg5mf64fTW0wQfKCDm1gFRMpFEP+mVlL5ITRrtldtlzjQdvHyHhGP74jkb1n3aCPU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309533; 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=P5KmASiCB+obTTVXGwbVR7k9DInJvjUYQUnuzL1m818=; b=gPL+dGlP0b0h2xRnNkDHW5bH+xYd8VW5DUnBUOUmbLroCVF4+EnST4V4KxcxjXRH1oFSCmW7E7gdkjNymAxbT4s7aZ96kSxO07l3uALmVY2i/pMjJG5sedgbbUCB3Zbzb6e3zh/NtlZgFDmqkmbkPXbnFS45HP2wwnfupsZpJmU= 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 1676309533641525.323629506616; Mon, 13 Feb 2023 09:32:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcfd-00084y-Mv; Mon, 13 Feb 2023 12:31:18 -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 1pRcfW-00083E-SB for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:11 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRcfO-0005NU-5M for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:04 -0500 Received: by mail-ej1-x636.google.com with SMTP id lf10so1859914ejc.5 for ; Mon, 13 Feb 2023 09:31:01 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:00 -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=P5KmASiCB+obTTVXGwbVR7k9DInJvjUYQUnuzL1m818=; b=SsovkVUlXzTpRbwDLwIl0Ik9Yl3ewxGRionB2FYwXuqRo6wVY7EH0M69lteR1JL1Qj T3xY7ahd3ZQWm1bhf2J1AFDUIRnH7jE69rLK8r84BOn7xdd8HhFobwkTUhGE3UaYMfDC 33Jo4dDPmGzrhT96gxHwR6TlvOPkEMSSbe1kIuICc3lMG9Ni7b2C3avyU08RWgmaZhk6 BL3QHdly5MA9PvnMXY1tdB+z3ZWX68HtKN7plqPq27MaEGB5rSIGUju96kc9LDjV7Hiy NAcKGa9Bk6kIXCcjUZM6b5IhwPxd1Z+nHLkfi6QCeeJVHdg53FjyGzHz7c/wotNwoeKF wviQ== 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=P5KmASiCB+obTTVXGwbVR7k9DInJvjUYQUnuzL1m818=; b=o43C/PeGGUsURTfJesFQu/KlFD3oXMXw8DslY4pOUyrOH8RP+opc18tv576F6UvH+i T0HMl09ArEXYVOS3OMAtigZtlQG71/0rJQKt+gD7ELfZMstSgwFFd2vx5sglKJ/6Y1cI I7VyH8wiR937fLVDbs24sHznb+xPOvrcoLBsc/wloRTpzvJfSUafl5qpFHq5zpPKMAq5 kAABLd6hQE1PF8TW8suudK636xK1WbE4HCJxMOVAZZdsbHItUJDhK3smajDnCnlRpiFq HjQBhqUWnIkSrCeym/MkUbZECm4/YDUjaYxYB1RQ9V60SBC0nwvbFBv2o4H44YcFauAe 9xRQ== X-Gm-Message-State: AO0yUKUi5nj+StZruw8db7sKS+B3vu62EBSTW+xtAMcN0yxLN0MSJ2yV Z464xicwPz3Raf2pbsW3Swk3EDqRtYs= X-Google-Smtp-Source: AK7set+3z/SAQbnMjfH3vk9THCdCNjZknJ2ltrrKBmZwuyaOxk9vbZlTIWFL8NTMQdKlDCZ1YtG66A== X-Received: by 2002:a17:906:a0d7:b0:812:d53e:1222 with SMTP id bh23-20020a170906a0d700b00812d53e1222mr22303373ejb.31.1676309460508; Mon, 13 Feb 2023 09:31:00 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 01/12] hw/i386/ich9: Rename Q35_MASK to ICH9_MASK Date: Mon, 13 Feb 2023 18:30:22 +0100 Message-Id: <20230213173033.98762-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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::636; envelope-from=shentey@gmail.com; helo=mail-ej1-x636.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: 1676309535346100003 Content-Type: text/plain; charset="utf-8" The Q35_MASK macro is already defined by TYPE_Q35_HOST_DEVICE, so let TYPE_ICH9_LPC_DEVICE have its own one to prevent potential name clash. Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i386/ich9.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 222781e8b9..36e0ccd16a 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -75,7 +75,7 @@ struct ICH9LPCState { qemu_irq gsi[GSI_NUM_PINS]; }; =20 -#define Q35_MASK(bit, ms_bit, ls_bit) \ +#define ICH9_MASK(bit, ms_bit, ls_bit) \ ((uint##bit##_t)(((1ULL << ((ms_bit) + 1)) - 1) & ~((1ULL << ls_bit) - 1))) =20 /* ICH9: Chipset Configuration Registers */ @@ -137,13 +137,13 @@ struct ICH9LPCState { #define ICH9_LPC_NB_PIRQS 8 /* PCI A-H */ =20 #define ICH9_LPC_PMBASE 0x40 -#define ICH9_LPC_PMBASE_BASE_ADDRESS_MASK Q35_MASK(32, 15, 7) +#define ICH9_LPC_PMBASE_BASE_ADDRESS_MASK ICH9_MASK(32, 15, 7) #define ICH9_LPC_PMBASE_RTE 0x1 #define ICH9_LPC_PMBASE_DEFAULT 0x1 =20 #define ICH9_LPC_ACPI_CTRL 0x44 #define ICH9_LPC_ACPI_CTRL_ACPI_EN 0x80 -#define ICH9_LPC_ACPI_CTRL_SCI_IRQ_SEL_MASK Q35_MASK(8, 2, 0) +#define ICH9_LPC_ACPI_CTRL_SCI_IRQ_SEL_MASK ICH9_MASK(8, 2, 0) #define ICH9_LPC_ACPI_CTRL_9 0x0 #define ICH9_LPC_ACPI_CTRL_10 0x1 #define ICH9_LPC_ACPI_CTRL_11 0x2 @@ -162,7 +162,7 @@ struct ICH9LPCState { #define ICH9_LPC_PIRQH_ROUT 0x6b =20 #define ICH9_LPC_PIRQ_ROUT_IRQEN 0x80 -#define ICH9_LPC_PIRQ_ROUT_MASK Q35_MASK(8, 3, 0) +#define ICH9_LPC_PIRQ_ROUT_MASK ICH9_MASK(8, 3, 0) #define ICH9_LPC_PIRQ_ROUT_DEFAULT 0x80 =20 #define ICH9_LPC_GEN_PMCON_1 0xa0 @@ -172,7 +172,7 @@ struct ICH9LPCState { #define ICH9_LPC_GEN_PMCON_LOCK 0xa6 =20 #define ICH9_LPC_RCBA 0xf0 -#define ICH9_LPC_RCBA_BA_MASK Q35_MASK(32, 31, 14) +#define ICH9_LPC_RCBA_BA_MASK ICH9_MASK(32, 31, 14) #define ICH9_LPC_RCBA_EN 0x1 #define ICH9_LPC_RCBA_DEFAULT 0x0 =20 --=20 2.39.1 From nobody Sat May 18 13:36:47 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=1676309518; cv=none; d=zohomail.com; s=zohoarc; b=ZgP5lKhwwHrXuBA0bQNtVrxX7b91XzWepoytRFGi94dS3Mu4PfUdMiG6NYwZfor7NGO8xKB2PS75Cs+N/9bWSV89D0HZnUc6z5+Jic+SqPLMUwSNmHLbeX7cl3mW4eQEKvqJXhS870yOww9OXWZnavhgoV3uQgnsJxuEI3HQcPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309518; 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=LUO1RVxI9YOpR9tc8Hfr8OfiAA+aO4xFIe2WjYm2GSQ=; b=lcBLrZadycHaYuGaGD7EtR7Agsvrw2XL+EYUX2BwqmqvkRhSV90cjPz91x3wxt+Mj4/WBjZT/g4golr6ABVXMeDyJpa9qpESicAGjP3gddWgh79n7RWmgaYc2JA1S66zEMLRix7UkXEL1Etr+AiSflOGU2kxHPY+HnOhwVv/1as= 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 1676309518105690.1616086786313; Mon, 13 Feb 2023 09:31:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcff-000871-Lc; Mon, 13 Feb 2023 12:31:19 -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 1pRcfY-00083g-VB for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:13 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRcfW-0005Na-6u for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:11 -0500 Received: by mail-ej1-x62b.google.com with SMTP id jg8so33735246ejc.6 for ; Mon, 13 Feb 2023 09:31:03 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:01 -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=LUO1RVxI9YOpR9tc8Hfr8OfiAA+aO4xFIe2WjYm2GSQ=; b=k+udukDwlvk+u3HjkuQqdgYg5t1HrGjbWI4PQumwt2fxL7zT9k7yl3jmSXk09oM0g/ cOJXstqCWeTf504mZa1kr099WRdED43rvYA3xaECRrO/7fIBtMhchpj8BuzfbXS+snCL qMjLog4ALkMwJmaRDuya5IJ+phKfVeVmI7IGASSYwQoSmok7PpZBBEYoFc5Z4fc8Z78V loB4C0G4y8AwLYZdn8VJB3g8j1T9CJqPMEeQ50Xo2LPWY2k4AbxNDtVS+sxvbZXtUWE+ d6oVsfcEs8UZzE9WNCqnszQ+0C7VGtMuD/3+FZw9c0bdi8+ga/gWTlfAciDQoHSy15zj G6vA== 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=LUO1RVxI9YOpR9tc8Hfr8OfiAA+aO4xFIe2WjYm2GSQ=; b=QJ9rjgZ0z64rg93TGnYj2ZF1VcMmhlDcyrn1F5YOlzw6jPIqg1QkiSZbyAfxwRDqZ7 jzEqNjS37Q6jvsneSH/gl+W92hFVRwoS0EgJILn4jyYb3iktZgtg/+a6FnyWT5Rd19Fc ExXEJuGyuwb7Z8GlxzF+CDUkq5ZjFXy652R8lDhIRtzptmx76KalAtQoi4gJ23bRKFsY TM2vvntcreuv8AteyXjtpXzeEjM8MOIS9MOasx8s85R9B/GgqJFH9sDR2gAeMqIzyHsQ 87hpF62xHAslX0i24gm64oSKS/is6QcLv1BvSpA/eN9whEAqsC2DI1+jmxJdAt8gCjya V/xA== X-Gm-Message-State: AO0yUKWxQYIBgQ2IUVzoFbSQn6kjbtlvYJtvLooJpEC3Ufc5m/rMIj63 I9XFIuKmQD8iaNsmsdaAmZwphZTqO3Q= X-Google-Smtp-Source: AK7set+EGaCeqf8htnJSWAJKWuQo6wKncAI73RTtut48Jmk6JVfNKvG/n0m5bw+Q3gXlwOMubR8vow== X-Received: by 2002:a17:907:7292:b0:8ae:b008:9b5a with SMTP id dt18-20020a170907729200b008aeb0089b5amr24836080ejc.69.1676309461713; Mon, 13 Feb 2023 09:31:01 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 02/12] hw/isa/lpc_ich9: Unexport PIRQ functions Date: Mon, 13 Feb 2023 18:30:23 +0100 Message-Id: <20230213173033.98762-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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::62b; envelope-from=shentey@gmail.com; helo=mail-ej1-x62b.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: 1676309519336100001 Content-Type: text/plain; charset="utf-8" No need to rely on the board to wire up the ICH9 PCI IRQs. All functions access private state of the LPC device which suggests that it should wire up the IRQs. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i386/ich9.h | 3 --- hw/i386/pc_q35.c | 3 --- hw/isa/lpc_ich9.c | 11 ++++++++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 36e0ccd16a..921e4c7ef6 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -9,9 +9,6 @@ #include "hw/acpi/ich9.h" #include "qom/object.h" =20 -void ich9_lpc_set_irq(void *opaque, int irq_num, int level); -int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx); -PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin); void ich9_lpc_pm_init(PCIDevice *pci_lpc, bool smm_enabled); I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base); =20 diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index a5ffb77ed8..8fac0e57bc 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -271,9 +271,6 @@ static void pc_q35_init(MachineState *machine) for (i =3D 0; i < GSI_NUM_PINS; i++) { qdev_connect_gpio_out_named(lpc_dev, ICH9_GPIO_GSI, i, x86ms->gsi[= i]); } - pci_bus_irqs(host_bus, ich9_lpc_set_irq, ich9_lpc, ICH9_LPC_NB_PIRQS); - pci_bus_map_irqs(host_bus, ich9_lpc_map_irq); - pci_bus_set_route_irq_fn(host_bus, ich9_route_intx_pin_to_irq); isa_bus =3D ich9_lpc->isa_bus; =20 if (x86ms->pic =3D=3D ON_OFF_AUTO_ON || x86ms->pic =3D=3D ON_OFF_AUTO_= AUTO) { diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 1fba3c210c..54a8839cd2 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -259,7 +259,7 @@ static void ich9_lpc_update_apic(ICH9LPCState *lpc, int= gsi) qemu_set_irq(lpc->gsi[gsi], level); } =20 -void ich9_lpc_set_irq(void *opaque, int pirq, int level) +static void ich9_lpc_set_irq(void *opaque, int pirq, int level) { ICH9LPCState *lpc =3D opaque; int pic_irq, pic_dis; @@ -275,7 +275,7 @@ void ich9_lpc_set_irq(void *opaque, int pirq, int level) /* return the pirq number (PIRQ[A-H]:0-7) corresponding to * a given device irq pin. */ -int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx) +static int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx) { BusState *bus =3D qdev_get_parent_bus(&pci_dev->qdev); PCIBus *pci_bus =3D PCI_BUS(bus); @@ -286,7 +286,7 @@ int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx) return lpc->irr[PCI_SLOT(pci_dev->devfn)][intx]; } =20 -PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin) +static PCIINTxRoute ich9_route_intx_pin_to_irq(void *opaque, int pirq_pin) { ICH9LPCState *lpc =3D opaque; PCIINTxRoute route; @@ -680,6 +680,7 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) { ICH9LPCState *lpc =3D ICH9_LPC_DEVICE(d); DeviceState *dev =3D DEVICE(d); + PCIBus *pci_bus =3D pci_get_bus(d); ISABus *isa_bus; =20 if ((lpc->smi_host_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BI= T)) && @@ -728,6 +729,10 @@ static void ich9_lpc_realize(PCIDevice *d, Error **err= p) isa_bus_irqs(isa_bus, lpc->gsi); =20 i8257_dma_init(isa_bus, 0); + + pci_bus_irqs(pci_bus, ich9_lpc_set_irq, d, ICH9_LPC_NB_PIRQS); + pci_bus_map_irqs(pci_bus, ich9_lpc_map_irq); + pci_bus_set_route_irq_fn(pci_bus, ich9_route_intx_pin_to_irq); } =20 static bool ich9_rst_cnt_needed(void *opaque) --=20 2.39.1 From nobody Sat May 18 13:36:47 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=1676309632; cv=none; d=zohomail.com; s=zohoarc; b=fnV6G0FJmHhwdP2BQwJtRjh5TUPRtgOnCTdkeynATRHj2cVeGLghw15Qfokv42Yk0r8iUcjdzoFzgeeOnTISMYGIklMi+mONj6GyV6EG71y6IKI70QNcnB7ojMsQUsgXYaR3I7s3OvRVxHJO8Afbz/SwPvjrUR7lj654TTsc4MU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309632; 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=eUEabPiKS1nzMr3CTC+5qhFJDRFizzS1WojL6re5JSk=; b=YPHb3DRJovozletu66uQLWDw/HXazcTADx7KCqDkFOR58MfkwOXJ6n0KGtD1CFSgR/GrHzj584LgrrDyh8BYkcNGA/Hn8inLxOcJ+a4TMU9NtO1+RJXubjqrh25CbXDvnD6iEhi7y77mTLvV/BVR3gJ9yqN9peYMN5PlQrajRC8= 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 1676309632013728.9283470681249; Mon, 13 Feb 2023 09:33:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcfh-00087B-BJ; Mon, 13 Feb 2023 12:31:21 -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 1pRcfb-00084r-IZ for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:17 -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 1pRcfY-0005P7-Cv for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:15 -0500 Received: by mail-ej1-x629.google.com with SMTP id sb24so9763079ejb.8 for ; Mon, 13 Feb 2023 09:31:04 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:02 -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=eUEabPiKS1nzMr3CTC+5qhFJDRFizzS1WojL6re5JSk=; b=hrbHKeeIfq6DW1Rhktr1w6gJNrjwCE5OT1YzVYDK/MV99aNZQHN31VB8L8fjRo8qVa IddTZi71sczvg1En3AtyF+itVM7FSr2e88lNWLJxNKMVnMPt1sJcgbykIEtMOCjNjdCH WWxqOzbonDkBosAuwLG/4IEyOjEuvHwUTXiU2Wdi7VwcCZXhRNQHCWgNfe0c9KMmOcr7 VQC/SFCrB61/j39zZh6FxQgMsGM3nxpithSvQ+zRfxSlpvNCIqZAnM5ynJZ9wd+FhokS DIDbwrEtrPS/dnw3rJhHH3L1zUMJiXrdOO1AjSLWm5ctiDDqhm7Lt6cCb/X3RHX8VUm2 1EQw== 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=eUEabPiKS1nzMr3CTC+5qhFJDRFizzS1WojL6re5JSk=; b=z1PqPdEUrBHqGyNFOLNghWutE/oOcqcaOoKN3HeeekyeBDRtuDlLkO51L8ZIeOXOjO SicpFceNxu52iR1KBtbAY6ZLMngS39hEwdKyHxRObzCZGYePBVAt0N+8lvKtDnm0+ZYC YGy4q5LTSkxaVM+FdpqbnFpFL1e2gt47srZvhU2UsglvpPp8lN35ut5ZgevuZCXITvHz 0pyrNg7+LhlL58/NHX9Tnnsf22M4r5TO1yxaHWiFI0Th46+YeJt9J38jHySDDP5aZKE6 HVrpEBdhUVop8ubQQu8RdrhF79PdaEEFtpHw35uyD9ak7M+RiTLEfnvpV8Z5etWfdyqr pJHg== X-Gm-Message-State: AO0yUKULhM8ln0SOUuumyouU3IFUyyteOUCC5CV7+VhQ8LmbwABwP/cZ dSLeTtrdIVSc0nLHJsJ/HSQtrWPHtpA= X-Google-Smtp-Source: AK7set9xin4u0U/+nP6wSa8u6zgPgmucyDc5fSYdI2drNNT7UBQaOtx/PssilhZATuEs88wBvDumWA== X-Received: by 2002:a17:906:4f83:b0:87a:542e:53b4 with SMTP id o3-20020a1709064f8300b0087a542e53b4mr26002882eju.64.1676309463205; Mon, 13 Feb 2023 09:31:03 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 03/12] hw/isa/lpc_ich9: Eliminate ICH9LPCState::isa_bus Date: Mon, 13 Feb 2023 18:30:24 +0100 Message-Id: <20230213173033.98762-4-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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: 1676309633837100005 Content-Type: text/plain; charset="utf-8" By using qdev_get_child_bus() we can eliminate ICH9LPCState::isa_bus and spare the ich9_lpc variable in pc_q35, too. Signed-off-by: Bernhard Beschow Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i386/ich9.h | 3 --- hw/i386/pc_q35.c | 4 +--- hw/isa/lpc_ich9.c | 5 +---- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 921e4c7ef6..05464f6965 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -1,7 +1,6 @@ #ifndef HW_ICH9_H #define HW_ICH9_H =20 -#include "hw/isa/isa.h" #include "hw/sysbus.h" #include "hw/i386/pc.h" #include "hw/isa/apm.h" @@ -64,8 +63,6 @@ struct ICH9LPCState { * triggers feature lockdown */ uint64_t smi_negotiated_features; /* guest-invisible, host endian */ =20 - /* isa bus */ - ISABus *isa_bus; MemoryRegion rcrb_mem; /* root complex register block */ Notifier machine_ready; =20 diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 8fac0e57bc..4af8474f31 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -132,7 +132,6 @@ static void pc_q35_init(MachineState *machine) GSIState *gsi_state; ISABus *isa_bus; int i; - ICH9LPCState *ich9_lpc; PCIDevice *ahci; ram_addr_t lowmem; DriveInfo *hd[MAX_SATA_PORTS]; @@ -266,12 +265,11 @@ static void pc_q35_init(MachineState *machine) /* irq lines */ gsi_state =3D pc_gsi_create(&x86ms->gsi, pcmc->pci_enabled); =20 - ich9_lpc =3D ICH9_LPC_DEVICE(lpc); lpc_dev =3D DEVICE(lpc); for (i =3D 0; i < GSI_NUM_PINS; i++) { qdev_connect_gpio_out_named(lpc_dev, ICH9_GPIO_GSI, i, x86ms->gsi[= i]); } - isa_bus =3D ich9_lpc->isa_bus; + isa_bus =3D ISA_BUS(qdev_get_child_bus(lpc_dev, "isa.0")); =20 if (x86ms->pic =3D=3D ON_OFF_AUTO_ON || x86ms->pic =3D=3D ON_OFF_AUTO_= AUTO) { pc_i8259_create(isa_bus, gsi_state->i8259_irq); diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 54a8839cd2..71f7c18a2e 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -710,8 +710,6 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) memory_region_init_io(&lpc->rcrb_mem, OBJECT(d), &rcrb_mmio_ops, lpc, "lpc-rcrb-mmio", ICH9_CC_SIZE); =20 - lpc->isa_bus =3D isa_bus; - ich9_cc_init(lpc); apm_init(d, &lpc->apm, ich9_apm_ctrl_changed, lpc); =20 @@ -818,8 +816,7 @@ static void ich9_send_gpe(AcpiDeviceIf *adev, AcpiEvent= StatusBits ev) static void build_ich9_isa_aml(AcpiDevAmlIf *adev, Aml *scope) { Aml *field; - ICH9LPCState *s =3D ICH9_LPC_DEVICE(adev); - BusState *bus =3D BUS(s->isa_bus); + BusState *bus =3D qdev_get_child_bus(DEVICE(adev), "isa.0"); Aml *sb_scope =3D aml_scope("\\_SB"); =20 /* ICH9 PCI to ISA irq remapping */ --=20 2.39.1 From nobody Sat May 18 13:36:47 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=1676309628; cv=none; d=zohomail.com; s=zohoarc; b=hN1qHHd4kZ1rLZCj1XQTcbJHb1fg9OxuZ3WQBHgCEuIhL+L51QKDyT+Z0vTgOaUYyAzIgcuK/iNn6QhVlrPommgakTM8m13dY7kOFcYsANj6m7zpYYSqOaAJxzXlomo8qU0klHuKHU8bqGr7Zc4etutKiTZzj1FutJSGmp0hh20= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309628; 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=pG41OOUa5g/2wKwnqxkkUEWtIRp2Dll0QKlkKRVDIKI=; b=MrM+VkyziwMVA7xAbzaPtiA/dkj+ytGDIFQNacHykkWHs0DTQItVyogFj3QQ0Mk+wXWxg1mxp/86+OfOf1oTE6C1O4NIW7u3TVbic3kmQhF0nDMaB2Po1vlv/q1Cdwd+MABDR6Bg6wr3NNeLJJD5/HqAba0IUYhKiGh40xNxdQc= 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 1676309628419492.1502612519556; Mon, 13 Feb 2023 09:33:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcfg-00087A-Hw; Mon, 13 Feb 2023 12:31:20 -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 1pRcfb-00084u-Iu for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:17 -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 1pRcfY-0005PC-BN for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:14 -0500 Received: by mail-ej1-x633.google.com with SMTP id n10so6785603ejc.4 for ; Mon, 13 Feb 2023 09:31:05 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.31.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:03 -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=pG41OOUa5g/2wKwnqxkkUEWtIRp2Dll0QKlkKRVDIKI=; b=GvXamY+5Vf5u6rKFYPWnAEl5MLXe1o9Qv16h2YqGLhrx2sxyKsHQmLBEF+GoDx7hzJ Y0B23/1OlnmpjipJ+iZUH9L+Sv3moJpdQwNDanAvgC6DuFem1qs5hIt5amyJjg7llr5P EGtv9IiGkzruEljJiYaokuvhKyjvx0/cBYSRgiJTzdZKAa63OBqyV06LFtWc1n8Bpa0c N2goc7H7Ta8tCU8i+vsa7jJD+HHka/jiX3EK+o2r+5UhopeZk7DAvd14erIIMkpITuTE 20iYjrMzfyCDQxTyLXn60BSgeydZkWu6/cFgOW5cKwSxsJsM1646+ZWkUXkRXIhAkitm Uh8A== 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=pG41OOUa5g/2wKwnqxkkUEWtIRp2Dll0QKlkKRVDIKI=; b=o9EqCgyxsM8wTxMC3+RoLOJa1ncRX8zuGRww2BQZt/mnQWTWdH+qSYisX8vjOYyEpf i4RFIcIHcipKielz3WKhuxmZ2JMi6Vd4tmUj2CLbFuK/KZf5BLNSlhoJbr1liy72y1vM dXyt9H4qk5U3RQTSL6WOX0tye8tBfmNDRlNZELDAYkF6mIBxxbM4iDDxaS2Ohmq5iNLO rxHNIP6iHcMuKNOObG82beXSWwoYh0i27bVfnvjGMkxeyP2M4KMYaV6aaW2Xs1x+G381 L/mibS4zAtcdnApCtd/nSM/XM9Aaz15kUFnhrPyeRt+bo+VqfjwnwVN4Ba2T5dd6Lg0i vj6A== X-Gm-Message-State: AO0yUKXhW+JJq12x38b/puUJQjF/ihsc2VX+5YtrdWATNp0T30l7DxBx eBtgxyXWJtGJQzNqci9iuOebDHC3vos= X-Google-Smtp-Source: AK7set/yTdp7pu9lfDAlvU1jT2pYj5pPtRS1Ehd9dmC5nROsbux2Jn531457LvoBgtbRGxZhR3qKvA== X-Received: by 2002:a17:906:f293:b0:8b1:2687:51b1 with SMTP id gu19-20020a170906f29300b008b1268751b1mr500875ejb.56.1676309464200; Mon, 13 Feb 2023 09:31:04 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 04/12] hw/i2c/smbus_ich9: Move ich9_smb_set_irq() in front of ich9_smbus_realize() Date: Mon, 13 Feb 2023 18:30:25 +0100 Message-Id: <20230213173033.98762-5-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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: 1676309629842100003 Content-Type: text/plain; charset="utf-8" This is a preparation for the next commit to make it cleaner. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i2c/smbus_ich9.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index 52ba77f3fc..d29c0f6ffa 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -80,6 +80,18 @@ static void ich9_smbus_write_config(PCIDevice *d, uint32= _t address, } } =20 +static void ich9_smb_set_irq(PMSMBus *pmsmb, bool enabled) +{ + ICH9SMBState *s =3D pmsmb->opaque; + + if (enabled =3D=3D s->irq_enabled) { + return; + } + + s->irq_enabled =3D enabled; + pci_set_irq(&s->dev, enabled); +} + static void ich9_smbus_realize(PCIDevice *d, Error **errp) { ICH9SMBState *s =3D ICH9_SMB_DEVICE(d); @@ -125,18 +137,6 @@ static void ich9_smb_class_init(ObjectClass *klass, vo= id *data) adevc->build_dev_aml =3D build_ich9_smb_aml; } =20 -static void ich9_smb_set_irq(PMSMBus *pmsmb, bool enabled) -{ - ICH9SMBState *s =3D pmsmb->opaque; - - if (enabled =3D=3D s->irq_enabled) { - return; - } - - s->irq_enabled =3D enabled; - pci_set_irq(&s->dev, enabled); -} - I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base) { PCIDevice *d =3D --=20 2.39.1 From nobody Sat May 18 13:36:47 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=1676309521; cv=none; d=zohomail.com; s=zohoarc; b=nmeRXurBGI54g9nbK++YBG9rIrRXxuBcyeZQiEvLA8weOFgkQFRi7MeuR6ZLtNx6W00YTQyhPK7aYj30hKcUeUWVpqlP2I+ZFkgB3koQnrPNM9RI/JsGwjVd86ahChuKSI+pRRzVqfPtLjO3SoY4cCELjMwQyOAU8/E6flPxw0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309521; 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=ES3rZ+wS/sLzeljvEM8y7WcbeHN4SQhGHmzgHvaetII=; b=YL5zb/7aEMnq8HY+17khfLBSd+HLBihBLUKivPC6NC52cDOwijtt9iNan8M6BTSYwHN9bxtPFDSnBGEzs65KdL1ThLhguvn3On70q0C8N+BnFYAx29f43mnomzWO2Gh10gpc8CenYHDuLscQNE/KIpSSCJ0xi7U3gOOaDaATpKw= 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 1676309521309118.1681483550359; Mon, 13 Feb 2023 09:32:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcfi-00088W-Rf; Mon, 13 Feb 2023 12:31:22 -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 1pRcfb-00084t-Ij for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:17 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRcfY-0005PI-B2 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:14 -0500 Received: by mail-ej1-x62d.google.com with SMTP id rp23so33691096ejb.7 for ; Mon, 13 Feb 2023 09:31:06 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:05 -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=ES3rZ+wS/sLzeljvEM8y7WcbeHN4SQhGHmzgHvaetII=; b=dtiXkthQUr7lYAlW+t9NTvWCTES1kHou+P4kptKsqtxl5eVQ0adjI9LIqFzFRg4qyS qMwtUzZd9IvG715eQPQvIU7l5x+TwWE3Szy0dgH6/tICC+iKEb5Cwke7zx9UjWdzqesO xeBtAeBnIWKxYIzatEu64NXNzAo1/LxmpWi/RyiNX4k9/bDGyKBOwIpPpstutNIeHORD H37rw8RDAZPhVRCo8BdzVOqCk9wuOMK5HxHk0Aq7J+Y4THhWHHm7vOume0AoOC/ROvj4 WyRt0yye4WcOPDHZzkjU3AerC/KF5YQZSBGY+8REBhustYae1Q7uJCYLfcAQofIMexSH FCiw== 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=ES3rZ+wS/sLzeljvEM8y7WcbeHN4SQhGHmzgHvaetII=; b=R8XMSZIqyDJcJW88tSQp3yzx8+8EGFb3ruSh82igTZpfojbApxH/eX4LFVlA419pvG mtwpRHWkWAawKn7SxoZS61jj0PKvhoT94e3bPzNeRCzj14RYrCTRPusbVOiYKXfv0deV Sh9cS+A2kOHIaYkYpBIgL5Mf8e2Febb4lJkOXlk6jTfLtGKlQfY28t52yTlMxey/9dza E8+Y7G0OjavBl/LUI8Y+RHkwvyoNDBim3N5+dfiIQqErNZM/rHC/nGJU59/05fX5hBvA GSNYCjTiaa5pzLwRDaKNysNv7LEhX2pkwYi9mI5T6jb+LjK2teXa5bePijeQQJNUl9HD PSJg== X-Gm-Message-State: AO0yUKUejMwMPbgLNudGwvA9ShzE7jNU0MX1ZpPkcSfluJmdFSHnwMZI B8DGMUtOzYOXWtwzWOGZRbxtIUzY0To= X-Google-Smtp-Source: AK7set8vFm+YAXG94jhN2BZR8XrWBezC/25PgENnIH5gperkXScpwHoF5qaLQlSR2Ctkh1/AXdyw+A== X-Received: by 2002:a17:906:b807:b0:889:5861:ad1e with SMTP id dv7-20020a170906b80700b008895861ad1emr28269678ejb.72.1676309465512; Mon, 13 Feb 2023 09:31:05 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 05/12] hw/i2c/smbus_ich9: Inline ich9_smb_init() and remove it Date: Mon, 13 Feb 2023 18:30:26 +0100 Message-Id: <20230213173033.98762-6-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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::62d; envelope-from=shentey@gmail.com; helo=mail-ej1-x62d.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: 1676309523331100003 Content-Type: text/plain; charset="utf-8" ich9_smb_init() is a legacy init function, so modernize the code. Note that the smb_io_base parameter was unused. Signed-off-by: Bernhard Beschow Acked-by: Corey Minyard Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i386/ich9.h | 1 - hw/i2c/smbus_ich9.c | 13 +++---------- hw/i386/pc_q35.c | 11 ++++++++--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 05464f6965..52ea116f44 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -9,7 +9,6 @@ #include "qom/object.h" =20 void ich9_lpc_pm_init(PCIDevice *pci_lpc, bool smm_enabled); -I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base); =20 void ich9_generate_smi(void); =20 diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index d29c0f6ffa..f0dd3cb147 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -105,6 +105,9 @@ static void ich9_smbus_realize(PCIDevice *d, Error **er= rp) pm_smbus_init(&d->qdev, &s->smb, false); pci_register_bar(d, ICH9_SMB_SMB_BASE_BAR, PCI_BASE_ADDRESS_SPACE_IO, &s->smb.io); + + s->smb.set_irq =3D ich9_smb_set_irq; + s->smb.opaque =3D s; } =20 static void build_ich9_smb_aml(AcpiDevAmlIf *adev, Aml *scope) @@ -137,16 +140,6 @@ static void ich9_smb_class_init(ObjectClass *klass, vo= id *data) adevc->build_dev_aml =3D build_ich9_smb_aml; } =20 -I2CBus *ich9_smb_init(PCIBus *bus, int devfn, uint32_t smb_io_base) -{ - PCIDevice *d =3D - pci_create_simple_multifunction(bus, devfn, true, TYPE_ICH9_SMB_DE= VICE); - ICH9SMBState *s =3D ICH9_SMB_DEVICE(d); - s->smb.set_irq =3D ich9_smb_set_irq; - s->smb.opaque =3D s; - return s->smb.smbus; -} - static const TypeInfo ich9_smb_info =3D { .name =3D TYPE_ICH9_SMB_DEVICE, .parent =3D TYPE_PCI_DEVICE, diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 4af8474f31..85ba8ed951 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -316,10 +316,15 @@ static void pc_q35_init(MachineState *machine) } =20 if (pcms->smbus_enabled) { + PCIDevice *smb; + /* TODO: Populate SPD eeprom data. */ - pcms->smbus =3D ich9_smb_init(host_bus, - PCI_DEVFN(ICH9_SMB_DEV, ICH9_SMB_FUNC), - 0xb100); + smb =3D pci_create_simple_multifunction(host_bus, + PCI_DEVFN(ICH9_SMB_DEV, + ICH9_SMB_FUNC), + true, TYPE_ICH9_SMB_DEVICE); + pcms->smbus =3D I2C_BUS(qdev_get_child_bus(DEVICE(smb), "i2c")); + smbus_eeprom_init(pcms->smbus, 8, NULL, 0); } =20 --=20 2.39.1 From nobody Sat May 18 13:36:47 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=1676309574; cv=none; d=zohomail.com; s=zohoarc; b=VVE9e3UTSOEsH4cLKnYJMGWXOMcMcnLvmU/FNyU4bkSo4eMJuW06CtY0R3Wuc1RbL3REJeQAC/MHhfTbGt6eltyjCp9mG6NfHAiCZuldjUgkwWamcqPo3XsV4SygdcnZPfWq7xNpyzKszSqtp7q2GTwFxHNP5z0xaQMI3rYVHUM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309574; 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=Y0842IyvHR5+exwrxY6bfCMS76td+5avfT/jT1Uqcfw=; b=XxK46GGaz3F4v0hOZHNAwEUt5iGueKJDGUq8+e9OjunZi/ltmWwPN2VSgNBw5fAfQVlNrf5UUcD2FerWNh6D2QDx3Lo8NYNEBCv//kOC2zBOTIT7pgZn1N589kbyTwa/71LJmYQfuOKt+8TdhC+cdJvJiyRdtej3pBFkTroMLAY= 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 1676309574714548.0278471001138; Mon, 13 Feb 2023 09:32:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcfh-00087E-Es; Mon, 13 Feb 2023 12:31:21 -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 1pRcfZ-00084e-H6 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:14 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRcfW-0005Pe-Cv for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:13 -0500 Received: by mail-ej1-x635.google.com with SMTP id k16so2176189ejv.10 for ; Mon, 13 Feb 2023 09:31:07 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.31.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:06 -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=Y0842IyvHR5+exwrxY6bfCMS76td+5avfT/jT1Uqcfw=; b=EjUQhK6rUF+tSFEdAAMElpipDQV9bIloTPGroMEtEkjlp4GhMin/m+14Q+ygRHMJoD xcJSp6Oe74UVoSZ+LOP5zLiVELy961y64/5moPgufoaQXw8P65J8CVuzHxqeYswtK48Q v6gu5qIm9yiOjFYlChA9Ba8UenrkxOGX4pJeizMp03HKSDdElzbZ9TqZ1SP1l7Wb0ADg 4vrx/vQ3hhcaA5XGR7JtvUHek5nSiWLYBOIRIlGb+lSysyJNPgzmtGRICqfKMVm/V+Ne WI2HLcV6xDbuo9kZJkrco2ky9zZAHpvc9oj7ZhT0E4eGCUggjwVQHoECHkriSNQuYyoL 1R7g== 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=Y0842IyvHR5+exwrxY6bfCMS76td+5avfT/jT1Uqcfw=; b=vpWMP1yxz28rGe3U9TiB/zhwtznQFhWNKdC+VjVtRxvtZI2GXZUdMSubDCj/34WuDG kWd37J+RSlmywqID399DHqqrxBtkI9sC5CSv/3ugQzMyS2ZnLybJuHUGf1MBlRS5ugl/ tEi1XJHlf61UBqNlA8LkxVPVQXur3I5TRtUcyhT78EcpOTudZFJEMJlf578BHtj8Iku8 y13uMRWR3b5qd2+co1GnsyDjYPD1TNHO3Ue7CleNeF9PKkjZUFeHy5nc4D7K8XBzu9Cg HiDsCyNtnQycM9GCVSEP5wY6OYxLcl6WXO1FFcganIXEmhZjicqCtaYJgVNaeQGUBiwm tHVA== X-Gm-Message-State: AO0yUKUCBpgLWK3F1sisdLoSmKa19daR9cDkxJCxKoTEg/DsMSE7WEyP oxkJObHJ4Zh1XbyL1pnIQWrKLnOxv8M= X-Google-Smtp-Source: AK7set/IJJEaYre7sLBZeEvFFtyhLCBOvha63vEVcvK0JKaWAA29K4uamsLkN9j7aTpo5pFwqnb0AA== X-Received: by 2002:a17:907:6e8f:b0:88a:d760:19ac with SMTP id sh15-20020a1709076e8f00b0088ad76019acmr34659999ejc.1.1676309466572; Mon, 13 Feb 2023 09:31:06 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 06/12] hw/i386/pc_q35: Allow for setting properties before realizing TYPE_ICH9_LPC_DEVICE Date: Mon, 13 Feb 2023 18:30:27 +0100 Message-Id: <20230213173033.98762-7-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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::635; envelope-from=shentey@gmail.com; helo=mail-ej1-x635.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: 1676309575604100005 Content-Type: text/plain; charset="utf-8" This is a preparation to make the next patch cleaner. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/pc_q35.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 85ba8ed951..dbd2160d4e 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -236,9 +236,9 @@ static void pc_q35_init(MachineState *machine) phb =3D PCI_HOST_BRIDGE(q35_host); host_bus =3D phb->bus; /* create ISA bus */ - lpc =3D pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_LPC_D= EV, - ICH9_LPC_FUNC), true, - TYPE_ICH9_LPC_DEVICE); + lpc =3D pci_new_multifunction(PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC), = true, + TYPE_ICH9_LPC_DEVICE); + pci_realize_and_unref(lpc, host_bus, &error_fatal); =20 object_property_add_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP, TYPE_HOTPLUG_HANDLER, --=20 2.39.1 From nobody Sat May 18 13:36:47 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=1676309632; cv=none; d=zohomail.com; s=zohoarc; b=nB4osSOBa6DQxdL/MyYMWuzprjrxlMyCBmADxTcSKRWDi4oCi84TWiVZ/kk6XD45LxSisCXddmsrc9A9pCExbCsLl7teRYGy12tKpg59omomcW+TIFr7dwliBPv/aFOKNMMHPJw6JAEU6cGPT2xpQunjjqB4aw+GL8I694d/p1c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309632; 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=X7QGZE7TtQnYK90iN8/7q50ZxZ1Yw3q9go392CrOw1Q=; b=TG8rNg4lSH4znXmg5FM/a1LM7EVoCQhhAbjZnlbJoIgl6AyYc8+5dClCRHgvTMLnaq0Wjy/ZqFWQzvcX6SxUz2bxHgPgiynYwz8r5PiCwlqZY0T1swVWpqJBqePPW3K4Q+T0LsQtP8JpQobS8zh0l8dI1NhzriYHY+0qF/0Dt1E= 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 1676309632193186.47846264812085; Mon, 13 Feb 2023 09:33:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcfh-00087C-E0; Mon, 13 Feb 2023 12:31:21 -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 1pRcfa-00084f-7W for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:14 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRcfW-0005Pi-FI for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:13 -0500 Received: by mail-ej1-x630.google.com with SMTP id lu11so33748868ejb.3 for ; Mon, 13 Feb 2023 09:31:09 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.31.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:07 -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=X7QGZE7TtQnYK90iN8/7q50ZxZ1Yw3q9go392CrOw1Q=; b=WK8M9OM6Lw33i4+Z0ji9vYVI5dMWUo3jpnLo1rSejIzY0em9nj9+vqnIRytH12XDoR cwNnBM8FMskYPNFmOBzuP4zSJ28TG6X302kBuvq+lYBfR3GijXevkRIXeChkmumwO8TW RByvcJpb8u0zfSD36ISovUxpTyc3LC5ZhiHFyyGt/r49zPLNFOzwSlymFnp7s9I+vfmB 9Dcqt6OcnWufozhdPfg5SXR7Zqi5DEhmbg30oCYgB9UXBpAl8vydEaFoJ0+2ICiU/blz 0Hp31tCVWqh7li4ENn8LkdPLJVgIoCKA+DzoNtiaLW1RaIvZeA3Tx9ac71ZyoLqbQNk9 JOeQ== 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=X7QGZE7TtQnYK90iN8/7q50ZxZ1Yw3q9go392CrOw1Q=; b=pO//ErCVCdmavXaxHyCyOPwcVf957btETAvws6VUrKFrTTXr/jCPLSv2nTkdi0T6fq aUPNJ/HovlGaSZLwOP/13KZ7xoJR/ImSdBTm4Qq00ETWj7/PGhzTUXQ+rPKMcFlE6AHV 1ScKZlWsiN14V30DV/a9PnqpCfh1/3vx/InUVT7BJ9QB5p5lnpjd23XY7JZgNbLq6SR4 6MJMMk9bGG37/GR9BoTVhSo0ORWFVu/b4mcvAQVybDvgk5Wc1YsUUNd2Egj3A+Ki+Gt9 tuPbYQwlNBu+yl41zl2J3iGbp57g1EpnHAvxewlql/h287BoojgheIQ1vuaFz+5fgT09 hPMQ== X-Gm-Message-State: AO0yUKWrZGfAEqPULZJMHVmm+IvFjroIVWPPCKFybDFx+fUbZZKqwOC8 Wse0zhWnwNvdKAvOLVOecVsdOezJ/vs= X-Google-Smtp-Source: AK7set89CDgrB4wPVduqq1HW74f47/7jwiiCa3bvHkX+K3hktFzWVEhYGdSG3ZbjPU1+7M+UYQBhpA== X-Received: by 2002:a17:906:704f:b0:878:955e:b4a4 with SMTP id r15-20020a170906704f00b00878955eb4a4mr24743645ejj.33.1676309468022; Mon, 13 Feb 2023 09:31:08 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 07/12] hw/isa/lpc_ich9: Connect pm stuff to lpc internally Date: Mon, 13 Feb 2023 18:30:28 +0100 Message-Id: <20230213173033.98762-8-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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::630; envelope-from=shentey@gmail.com; helo=mail-ej1-x630.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: 1676309633853100006 Content-Type: text/plain; charset="utf-8" Make TYPE_ICH9_LPC_DEVICE more self-contained by moving the call to ich9_lpc_pm_init() from board code to its realize function. In order to propagate x86_machine_is_smm_enabled(), introduce an "smm-enabled" property like we have in piix4. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/acpi/ich9.h | 6 ++---- include/hw/i386/ich9.h | 2 -- hw/acpi/ich9.c | 8 ++------ hw/i386/pc_q35.c | 5 ++--- hw/isa/lpc_ich9.c | 8 +++++--- 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index d41866a229..57a542c4b8 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -64,7 +64,7 @@ typedef struct ICH9LPCPMRegs { uint8_t disable_s3; uint8_t disable_s4; uint8_t s4_val; - uint8_t smm_enabled; + bool smm_enabled; bool smm_compat; bool enable_tco; TCOIORegs tco_regs; @@ -72,9 +72,7 @@ typedef struct ICH9LPCPMRegs { =20 #define ACPI_PM_PROP_TCO_ENABLED "enable_tco" =20 -void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, - bool smm_enabled, - qemu_irq sci_irq); +void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, qemu_irq sci_irq); =20 void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base); extern const VMStateDescription vmstate_ich9_pm; diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 52ea116f44..433c8942c9 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -8,8 +8,6 @@ #include "hw/acpi/ich9.h" #include "qom/object.h" =20 -void ich9_lpc_pm_init(PCIDevice *pci_lpc, bool smm_enabled); - void ich9_generate_smi(void); =20 #define ICH9_CC_SIZE (16 * 1024) /* 16KB. Chipset configuration registers = */ diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index a93c470e9d..54bb3d83b3 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -291,9 +291,7 @@ static void pm_powerdown_req(Notifier *n, void *opaque) acpi_pm1_evt_power_down(&pm->acpi_regs); } =20 -void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, - bool smm_enabled, - qemu_irq sci_irq) +void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, qemu_irq sci_irq) { memory_region_init(&pm->io, OBJECT(lpc_pci), "ich9-pm", ICH9_PMIO_SIZE= ); memory_region_set_enabled(&pm->io, false); @@ -303,7 +301,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io); acpi_pm1_evt_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io); acpi_pm1_cnt_init(&pm->acpi_regs, &pm->io, pm->disable_s3, pm->disable= _s4, - pm->s4_val, !pm->smm_compat && !smm_enabled); + pm->s4_val, !pm->smm_compat && !pm->smm_enabled); =20 acpi_gpe_init(&pm->acpi_regs, ICH9_PMIO_GPE0_LEN); memory_region_init_io(&pm->io_gpe, OBJECT(lpc_pci), &ich9_gpe_ops, pm, @@ -314,8 +312,6 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, "acpi-smi", 8); memory_region_add_subregion(&pm->io, ICH9_PMIO_SMI_EN, &pm->io_smi); =20 - pm->smm_enabled =3D smm_enabled; - if (pm->enable_tco) { acpi_pm_tco_init(&pm->tco_regs, &pm->io); } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index dbd2160d4e..f13b516f2e 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -238,6 +238,8 @@ static void pc_q35_init(MachineState *machine) /* create ISA bus */ lpc =3D pci_new_multifunction(PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC), = true, TYPE_ICH9_LPC_DEVICE); + qdev_prop_set_bit(DEVICE(lpc), "smm-enabled", + x86_machine_is_smm_enabled(x86ms)); pci_realize_and_unref(lpc, host_bus, &error_fatal); =20 object_property_add_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP, @@ -292,9 +294,6 @@ static void pc_q35_init(MachineState *machine) pc_basic_device_init(pcms, isa_bus, x86ms->gsi, &rtc_state, !mc->no_fl= oppy, 0xff0104); =20 - /* connect pm stuff to lpc */ - ich9_lpc_pm_init(lpc, x86_machine_is_smm_enabled(x86ms)); - if (pcms->sata_enabled) { /* ahci and SATA device, for q35 1 ahci controller is built-in */ ahci =3D pci_create_simple_multifunction(host_bus, diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 71f7c18a2e..c5060d145f 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -407,14 +407,13 @@ static void smi_features_ok_callback(void *opaque) lpc->smi_features_ok =3D 1; } =20 -void ich9_lpc_pm_init(PCIDevice *lpc_pci, bool smm_enabled) +static void ich9_lpc_pm_init(ICH9LPCState *lpc) { - ICH9LPCState *lpc =3D ICH9_LPC_DEVICE(lpc_pci); qemu_irq sci_irq; FWCfgState *fw_cfg =3D fw_cfg_find(); =20 sci_irq =3D qemu_allocate_irq(ich9_set_sci, lpc, 0); - ich9_pm_init(lpc_pci, &lpc->pm, smm_enabled, sci_irq); + ich9_pm_init(PCI_DEVICE(lpc), &lpc->pm, sci_irq); =20 if (lpc->smi_host_features && fw_cfg) { uint64_t host_features_le; @@ -731,6 +730,8 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) pci_bus_irqs(pci_bus, ich9_lpc_set_irq, d, ICH9_LPC_NB_PIRQS); pci_bus_map_irqs(pci_bus, ich9_lpc_map_irq); pci_bus_set_route_irq_fn(pci_bus, ich9_route_intx_pin_to_irq); + + ich9_lpc_pm_init(lpc); } =20 static bool ich9_rst_cnt_needed(void *opaque) @@ -797,6 +798,7 @@ static const VMStateDescription vmstate_ich9_lpc =3D { static Property ich9_lpc_properties[] =3D { DEFINE_PROP_BOOL("noreboot", ICH9LPCState, pin_strap.spkr_hi, false), DEFINE_PROP_BOOL("smm-compat", ICH9LPCState, pm.smm_compat, false), + DEFINE_PROP_BOOL("smm-enabled", ICH9LPCState, pm.smm_enabled, false), DEFINE_PROP_BIT64("x-smi-broadcast", ICH9LPCState, smi_host_features, ICH9_LPC_SMI_F_BROADCAST_BIT, true), DEFINE_PROP_BIT64("x-smi-cpu-hotplug", ICH9LPCState, smi_host_features, --=20 2.39.1 From nobody Sat May 18 13:36:47 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=1676309619; cv=none; d=zohomail.com; s=zohoarc; b=WM9EYYJL1TXqM+voPQoAT6vAIOuHdEycImkbJ/Vu7bXMnZUHjcalp1JJA0s1LP6V+oQo4PYsz5K90vWlPo5HTfBbmUWLJPdYe5QYCKGQuxGYueAE6F6IzAjacZjinC3LuPYGEvWsEn2W2stPBczoMqgA4Efi5nBk2U6VvGzAd8s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309619; 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=i5Dhi2NHN2PG2x1FBdEMPbc7SBgsKBo5zgjP3kO7nnE=; b=EW183C/BsVxgH7BZ3b7BwlD25u38/WCk3PpSI5hTVxKVvI/zYRKoDqDa7RmPW5yWIEBiDtSkh49RyqubMNzoTpkPncawIzqKgNtQzd+ERxlOU95G7gWwU6zGPSZGC+E6emzGuTE9TM79fFtIH8+VBAfDpbd1yalr91TwcHu1UVw= 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 1676309619181738.3632490005987; Mon, 13 Feb 2023 09:33:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcfi-00087i-3Z; Mon, 13 Feb 2023 12:31:22 -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 1pRcfb-00084v-J4 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:17 -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 1pRcfY-0005Pl-DD for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:14 -0500 Received: by mail-ej1-x634.google.com with SMTP id lu11so33748971ejb.3 for ; Mon, 13 Feb 2023 09:31:10 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:08 -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=i5Dhi2NHN2PG2x1FBdEMPbc7SBgsKBo5zgjP3kO7nnE=; b=OdBpL2zs3kDOF6tzp32vJ+92n7romHYUt5pDe+85QrGw6b93ku8iKttIUQ5DpO8ANf qZ3BzuF0x1yZ6wssbC1u6UWtk2ieUtr8mm887K71e9wYqIuNJ11SP2+Rsc5ZIunxZtJE d/S0tlVUJYapzLaIbu96BotikAcS7tAUzayK8jiix0S3tp0YKfS7y9b+zjw1pDPmVTWI xtZBEHlVZJpNIikhM/DpS/oD6jgdjKBjQoVax8tgk0ZiuB+UYBrTUEGHQBz/8DHIWW5/ c2DVmAHVZGm07XzJqPrSa5YTeh8zkf9R2CcM9U2yUTsv2eH10HPGhMvWC34zKixWIMPz 6dVg== 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=i5Dhi2NHN2PG2x1FBdEMPbc7SBgsKBo5zgjP3kO7nnE=; b=p1mwMTQHNoh8EfQgfxJXFWKZeYwK994Ef2hDV7i79B9ZdxbQTjvx0t1p7obY019i7P Kh4LzSNObhc6kCNvEEk/oPyq4L4hTQxB6Sbf1VvVaaIGeQkk0YX+fWQKVPZRpoOc8sE1 WfY+wYBQ93YTy2E6o1NZYYIJCvXbYtsBnmKKFaWX3ATj1XTK9NWjXVFMEl7AwoigTRri bigYHdVXU9WRD3dizOpnn25SD2Bgs7GFmS3D2+Nm8xVGEuVWhK6TZ0CKDvBAQDBwpVRI DFxvjhkoGmtrZust4ChR6McDnj/FFZSwM4vicYv/bhXU5vY79kGir/Biv2ErNVTovMw2 +waQ== X-Gm-Message-State: AO0yUKWOlzoUfv/lCyDgICuCzCpNFTPBaTgIFFDC1Scio0cbPQrqeumF uDMsWP2aXEl98raLOQ5xooPUk8Ltss8= X-Google-Smtp-Source: AK7set88gk3ZUro22nxIQqcH/RD5VZokv3dXPhGQEAA+StsshqbykSYkD0SaTJ5yQ0BiEvV7uAYuuw== X-Received: by 2002:a17:907:804:b0:8a9:fa2f:e440 with SMTP id wv4-20020a170907080400b008a9fa2fe440mr29856570ejb.55.1676309469016; Mon, 13 Feb 2023 09:31:09 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 08/12] hw/isa/lpc_ich9: Remove redundant ich9_lpc_reset() invocation Date: Mon, 13 Feb 2023 18:30:29 +0100 Message-Id: <20230213173033.98762-9-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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: 1676309619753100001 Content-Type: text/plain; charset="utf-8" ich9_lpc_reset() is the dc->reset callback which is called automatically. No need to call it explicitly during k->realize. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/isa/lpc_ich9.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index c5060d145f..2a4baac129 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -57,8 +57,6 @@ /*************************************************************************= ****/ /* ICH9 LPC PCI to ISA bridge */ =20 -static void ich9_lpc_reset(DeviceState *qdev); - /* chipset configuration register * to access chipset configuration registers, pci_[sg]et_{byte, word, long} * are used. @@ -439,8 +437,6 @@ static void ich9_lpc_pm_init(ICH9LPCState *lpc) sizeof lpc->smi_features_ok, true); } - - ich9_lpc_reset(DEVICE(lpc)); } =20 /* APM */ --=20 2.39.1 From nobody Sat May 18 13:36:47 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=1676309510; cv=none; d=zohomail.com; s=zohoarc; b=Vtivm8rqH/KHt8XE3+VvUHVp/uWOh64X33ZjAkoska7qqrJpCsCmyUQTD504pcJDv4HNpVDUAg9FEgfxPZjnvC+Cf5xtI+oVi7De+u6vv84Z5VzR8Dk/N+GooXqFp4YbrhNmi14a9d9JfyBqW0Xwb9qrvEh757p9r+o6AMww2pc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309510; 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=QFEl1SbZY1EEn4SVcGwifuDKtFpy/mikqpDm15Zavs0=; b=guq7rKiv5gT6nkPwre+ctiS0E9xSwSw4QyuAuj1Ph76O96YrJIK6AxAqEcwCYP1ZD23kzrR1quPobrjfN+1Scfyp+ikrPoMf2Jz+kYhfreE+Vs7q2IyU7T1eW3QjqkVA8+Jf6ValwrBSeAeGJbYVg1lnjmilrHVN6YdJkziW+L4= 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 1676309510890782.4346624720037; Mon, 13 Feb 2023 09:31:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcfi-00087k-4n; Mon, 13 Feb 2023 12:31:22 -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 1pRcfb-00084s-IF for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:17 -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 1pRcfY-0005Py-DM for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:14 -0500 Received: by mail-ej1-x629.google.com with SMTP id jg8so33736270ejc.6 for ; Mon, 13 Feb 2023 09:31:11 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:09 -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=QFEl1SbZY1EEn4SVcGwifuDKtFpy/mikqpDm15Zavs0=; b=Ygg1p5BbHakLXMB/Z+TL+/2YT2mTIEfSlRNdJ4uMANu7WsV4XS0Utq683zIdsUuojU u+2am02lNe+YzR11MxWDNqeexpxZUgaCsfKGgfbO3fnn8NmrnymBS85nPXvi0lNUJ/E5 GRdMrd00LlklcniaHaEXquhWBVKijOcubIxfBIYfLHvnlfl/lIKXy4lUP/l9ApOijx+9 /xD7jtK9hv8APvwmhyxMPQuwbC1WkoDu7SOg5wF7FnhNmpMGbiHRCGdltNdptcNhiFVY hJWD2F0uTMAXZ9OqRudAMX6LlpG8CGzvdxVG7iWh+vvl3WSkRz2RkZeUCLqXhZPTg9Fr 82XA== 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=QFEl1SbZY1EEn4SVcGwifuDKtFpy/mikqpDm15Zavs0=; b=4797vWktVp5Gy7LBafJofDAJHypi+tLr9k+VzMFOnotH4rny/z7owH/Vtufs3k46Ex YysBaFT6AZ/cAlAAKrTMYlr12BH8TBZXvonVUzNrdOkaSUk9/EqHvtaFbj3JxiBiWqOu EkAoLhEqMI80dgRUiBkuTzT6UH0ftDYj9Fr+n6nPj2+a6VlfEI6yrQCUy8xOO0wMkvqN 1WN17/h3Nz19Ua9aYQcM0+rfokbApxKnTWnNtktAlG3n+CXmN0qR5uvhRdD5thlJNXX6 dvQ1vfVc+RcwzKOpaAklWYtNbUXcvPXxdpzAHwU0FPXkNEfVwLr0yU4zgFWcrmxG2eDW xPpw== X-Gm-Message-State: AO0yUKV2qFrkfWqdC8fQhEGMbo5jTMmQfcJswtKxeiapje7i91hwjbUO lvqa6HsfnfIKU36G8n7gRTGZGW5jcAs= X-Google-Smtp-Source: AK7set9qb22J/pvgk392h0/tnOOW6zkf2EswZlBsyESQsOqvOwpN6MGaI/C6DXmnDxAYENDLTAF/qg== X-Received: by 2002:a17:906:a0d1:b0:883:be32:cd33 with SMTP id bh17-20020a170906a0d100b00883be32cd33mr30870294ejb.35.1676309470217; Mon, 13 Feb 2023 09:31:10 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 09/12] hw/i386/ich9: Remove redundant GSI_NUM_PINS Date: Mon, 13 Feb 2023 18:30:30 +0100 Message-Id: <20230213173033.98762-10-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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: 1676309511313100001 Content-Type: text/plain; charset="utf-8" Most code uses IOAPIC_NUM_PINS. The only place where GSI_NUM_PINS defines the size of an array is ICH9LPCState::gsi which needs to match IOAPIC_NUM_PINS. Remove GSI_NUM_PINS for consistency. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i386/ich9.h | 2 +- include/hw/i386/x86.h | 1 - hw/i386/pc.c | 6 +++--- hw/i386/pc_q35.c | 3 ++- hw/isa/lpc_ich9.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index 433c8942c9..d29090a9b7 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -63,7 +63,7 @@ struct ICH9LPCState { MemoryRegion rcrb_mem; /* root complex register block */ Notifier machine_ready; =20 - qemu_irq gsi[GSI_NUM_PINS]; + qemu_irq gsi[IOAPIC_NUM_PINS]; }; =20 #define ICH9_MASK(bit, ms_bit, ls_bit) \ diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index ba6912b721..6f52f8fe95 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -136,7 +136,6 @@ bool x86_machine_is_acpi_enabled(const X86MachineState = *x86ms); =20 /* Global System Interrupts */ =20 -#define GSI_NUM_PINS IOAPIC_NUM_PINS #define ACPI_BUILD_PCI_IRQS ((1<<5) | (1<<9) | (1<<10) | (1<<11)) =20 typedef struct GSIState { diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 8898cc9961..cbca3f5db5 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -28,7 +28,7 @@ #include "hw/i386/pc.h" #include "hw/char/serial.h" #include "hw/char/parallel.h" -#include "hw/i386/apic.h" +#include "hw/i386/ioapic.h" #include "hw/i386/topology.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/vmport.h" @@ -406,7 +406,7 @@ GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabl= ed) if (kvm_ioapic_in_kernel()) { kvm_pc_setup_irq_routing(pci_enabled); } - *irqs =3D qemu_allocate_irqs(gsi_handler, s, GSI_NUM_PINS); + *irqs =3D qemu_allocate_irqs(gsi_handler, s, IOAPIC_NUM_PINS); =20 return s; } @@ -1295,7 +1295,7 @@ void pc_basic_device_init(struct PCMachineState *pcms, sysbus_realize_and_unref(SYS_BUS_DEVICE(hpet), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(hpet), 0, HPET_BASE); =20 - for (i =3D 0; i < GSI_NUM_PINS; i++) { + for (i =3D 0; i < IOAPIC_NUM_PINS; i++) { sysbus_connect_irq(SYS_BUS_DEVICE(hpet), i, gsi[i]); } pit_isa_irq =3D -1; diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index f13b516f2e..28434612af 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -43,6 +43,7 @@ #include "hw/i386/ich9.h" #include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" +#include "hw/i386/ioapic.h" #include "hw/display/ramfb.h" #include "hw/firmware/smbios.h" #include "hw/ide/pci.h" @@ -268,7 +269,7 @@ static void pc_q35_init(MachineState *machine) gsi_state =3D pc_gsi_create(&x86ms->gsi, pcmc->pci_enabled); =20 lpc_dev =3D DEVICE(lpc); - for (i =3D 0; i < GSI_NUM_PINS; i++) { + for (i =3D 0; i < IOAPIC_NUM_PINS; i++) { qdev_connect_gpio_out_named(lpc_dev, ICH9_GPIO_GSI, i, x86ms->gsi[= i]); } isa_bus =3D ISA_BUS(qdev_get_child_bus(lpc_dev, "isa.0")); diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 2a4baac129..e3385ca7be 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -717,7 +717,7 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) ICH9_RST_CNT_IOPORT, &lpc->rst_cnt= _mem, 1); =20 - qdev_init_gpio_out_named(dev, lpc->gsi, ICH9_GPIO_GSI, GSI_NUM_PINS); + qdev_init_gpio_out_named(dev, lpc->gsi, ICH9_GPIO_GSI, IOAPIC_NUM_PINS= ); =20 isa_bus_irqs(isa_bus, lpc->gsi); =20 --=20 2.39.1 From nobody Sat May 18 13:36:47 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=1676309572; cv=none; d=zohomail.com; s=zohoarc; b=aiF3XNRLMqauydO58PDMzUCXoSokHdjP2Y99pkF17V+2+hkEP8oi3eZqwJfZ4XmVSfxzYuh4vCSSorYZk7aiap+ZI33TUmjXJUtvk84dsKaqEjxdQLA8QgGCCXvB7rmETzyBARdJPhELy6B2mXUFrkeGau96LhsConZxNhLkBVY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309572; 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=TXFY8RzSCMNNu6cwNWQKcxAMCKvEa/Y+pT6lemvRtLU=; b=Gh29RuC8LN3sZIVo6WZ4em7q7vNKC/yIjH6oUwc/1YFzshZ2VsCH0Epgp5KCUZC71fYEpc+0SqJ1/LJAkp/RUc5qxkk/DA/jhzeJYhEll7k9aEJYvGl38KkVBkUAU7T4P0r3bdiFQFB4itF/hierXVvU1KvD1J7nEoshStQO/gk= 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 1676309572117719.8689225186562; Mon, 13 Feb 2023 09:32:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcff-000873-R1; Mon, 13 Feb 2023 12:31:19 -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 1pRcfd-000850-6K for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:17 -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 1pRcfY-0005Q6-Q2 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:16 -0500 Received: by mail-ej1-x629.google.com with SMTP id hx15so33658600ejc.11 for ; Mon, 13 Feb 2023 09:31:12 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:10 -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=TXFY8RzSCMNNu6cwNWQKcxAMCKvEa/Y+pT6lemvRtLU=; b=HSu9aVASCy33as6Gci59JyPmVnoREyGgy2X7ZPSsNKYXrX5zZ0GE9ODYeffvXHOzeh /aLee2Tu73e03nFWrKBRUKt1Njjeq9YfScw2GZY7Zf8yZ/MXvK8tS1D3aofBB3/piFNu 5Ld1FTJnE0SDYSrSBHQVYWsIDJi/+3ZpudnR7Xjtj97FdW7bAlgeYsUCbMf7y94MnFa4 kt0+Aisc6PzGGIsXbK+hbkKBEA7Hz9db39x8CuovaMRXRkqVZsT/sIWLKRC8Ef5uGjIc 8yHTUsU/Fa3p9De9xyzZRXFwBh7OtF5WuX7NFGyxILLXq/moatwfc/zrMGRqVUGe8PkQ 89Aw== 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=TXFY8RzSCMNNu6cwNWQKcxAMCKvEa/Y+pT6lemvRtLU=; b=c0CeuY9evASMs5WpanJqsNR3I3Ur93/9//WIZTgyySMJYtuQa1jAogxziVNmus1CbU gmMPbEL+7mzh4oTNUpKWz+Z4WhLLfeLLJ7Po2PRZm6pMNlyr/pXS5DCH1vUha4dSRKvB nR0j8WnJYSnfk2ktKFiEwTwHMA0w/AALbG7IGKGiWhNVox1yWwWxe4Q79AnA6QOaOnV3 7d9xKMwYBg+EThuQ4N5YrZeIPsy+LZvg9X6MvXhXNTvMmc9lHQGm6PbraaAdwFc/PvBv 9qAWzn/BePIVtHz0cm/VW/JEPBqCCISIFUJUTJVHiecqapLpqPkYMzMfQzMbO7soriIs dL5w== X-Gm-Message-State: AO0yUKXWvFUitgvA66gJSfU5+AMhaCe1jduFgAoSHPAfFoFTcSXsV7CS dwPhyd/Fc4duAC/0KHYPrC4t69/rDjY= X-Google-Smtp-Source: AK7set/eLZDpZYy5XRrXvGif2uTrK6ywzH79HeuRN7Up3CIq7hTRaTjwjMTaaj5z+yvoxujmiDenAg== X-Received: by 2002:a17:906:4483:b0:84d:4e4f:1f85 with SMTP id y3-20020a170906448300b0084d4e4f1f85mr25789059ejo.59.1676309471228; Mon, 13 Feb 2023 09:31:11 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 10/12] hw: Move ioapic*.h to intc/ Date: Mon, 13 Feb 2023 18:30:31 +0100 Message-Id: <20230213173033.98762-11-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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: 1676309573626100003 Content-Type: text/plain; charset="utf-8" The ioapic sources reside in hw/intc already. Move the headers there as well. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 1 + include/hw/i386/x86.h | 2 +- include/hw/{i386 =3D> intc}/ioapic.h | 6 +++--- include/hw/{i386 =3D> intc}/ioapic_internal.h | 8 ++++---- hw/i386/kvm/ioapic.c | 3 +-- hw/i386/pc.c | 2 +- hw/i386/pc_q35.c | 2 +- hw/intc/apic.c | 2 +- hw/intc/ioapic.c | 4 ++-- hw/intc/ioapic_common.c | 4 ++-- target/i386/whpx/whpx-all.c | 2 +- 11 files changed, 18 insertions(+), 18 deletions(-) rename include/hw/{i386 =3D> intc}/ioapic.h (93%) rename include/hw/{i386 =3D> intc}/ioapic_internal.h (96%) diff --git a/MAINTAINERS b/MAINTAINERS index 96e25f62ac..20460ce254 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1708,6 +1708,7 @@ F: include/hw/char/parallel.h F: include/hw/dma/i8257.h F: include/hw/i2c/pm_smbus.h F: include/hw/input/i8042.h +F: include/hw/intc/ioapic* F: include/hw/isa/i8259_internal.h F: include/hw/isa/superio.h F: include/hw/timer/hpet.h diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 6f52f8fe95..5256c1e848 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -23,8 +23,8 @@ #include "hw/i386/topology.h" #include "hw/boards.h" #include "hw/nmi.h" +#include "hw/intc/ioapic.h" #include "hw/isa/isa.h" -#include "hw/i386/ioapic.h" #include "qom/object.h" =20 struct X86MachineClass { diff --git a/include/hw/i386/ioapic.h b/include/hw/intc/ioapic.h similarity index 93% rename from include/hw/i386/ioapic.h rename to include/hw/intc/ioapic.h index ef37b8a9fd..aa122e25e3 100644 --- a/include/hw/i386/ioapic.h +++ b/include/hw/intc/ioapic.h @@ -17,8 +17,8 @@ * License along with this library; if not, see . */ =20 -#ifndef HW_IOAPIC_H -#define HW_IOAPIC_H +#ifndef HW_INTC_IOAPIC_H +#define HW_INTC_IOAPIC_H =20 #define IOAPIC_NUM_PINS 24 #define IO_APIC_DEFAULT_ADDRESS 0xfec00000 @@ -30,4 +30,4 @@ =20 void ioapic_eoi_broadcast(int vector); =20 -#endif /* HW_IOAPIC_H */ +#endif /* HW_INTC_IOAPIC_H */ diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/intc/ioapic_int= ernal.h similarity index 96% rename from include/hw/i386/ioapic_internal.h rename to include/hw/intc/ioapic_internal.h index e8ff338d7f..37b8565539 100644 --- a/include/hw/i386/ioapic_internal.h +++ b/include/hw/intc/ioapic_internal.h @@ -19,11 +19,11 @@ * License along with this library; if not, see . */ =20 -#ifndef QEMU_IOAPIC_INTERNAL_H -#define QEMU_IOAPIC_INTERNAL_H +#ifndef HW_INTC_IOAPIC_INTERNAL_H +#define HW_INTC_IOAPIC_INTERNAL_H =20 #include "exec/memory.h" -#include "hw/i386/ioapic.h" +#include "hw/intc/ioapic.h" #include "hw/sysbus.h" #include "qemu/notify.h" #include "qom/object.h" @@ -115,4 +115,4 @@ void ioapic_reset_common(DeviceState *dev); =20 void ioapic_stat_update_irq(IOAPICCommonState *s, int irq, int level); =20 -#endif /* QEMU_IOAPIC_INTERNAL_H */ +#endif /* HW_INTC_IOAPIC_INTERNAL_H */ diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c index 272e26b4a2..cd5ea5d60b 100644 --- a/hw/i386/kvm/ioapic.c +++ b/hw/i386/kvm/ioapic.c @@ -12,9 +12,8 @@ =20 #include "qemu/osdep.h" #include "monitor/monitor.h" -#include "hw/i386/x86.h" #include "hw/qdev-properties.h" -#include "hw/i386/ioapic_internal.h" +#include "hw/intc/ioapic_internal.h" #include "hw/intc/kvm_irqcount.h" #include "sysemu/kvm.h" =20 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index cbca3f5db5..b6c353346c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -28,7 +28,6 @@ #include "hw/i386/pc.h" #include "hw/char/serial.h" #include "hw/char/parallel.h" -#include "hw/i386/ioapic.h" #include "hw/i386/topology.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/vmport.h" @@ -47,6 +46,7 @@ #include "multiboot.h" #include "hw/rtc/mc146818rtc.h" #include "hw/intc/i8259.h" +#include "hw/intc/ioapic.h" #include "hw/timer/i8254.h" #include "hw/input/i8042.h" #include "hw/irq.h" diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 28434612af..da2fa11b6f 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -43,11 +43,11 @@ #include "hw/i386/ich9.h" #include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" -#include "hw/i386/ioapic.h" #include "hw/display/ramfb.h" #include "hw/firmware/smbios.h" #include "hw/ide/pci.h" #include "hw/ide/ahci.h" +#include "hw/intc/ioapic.h" #include "hw/usb.h" #include "hw/usb/hcd-uhci.h" #include "qapi/error.h" diff --git a/hw/intc/apic.c b/hw/intc/apic.c index 2d3e55f4e2..0ff060f721 100644 --- a/hw/intc/apic.c +++ b/hw/intc/apic.c @@ -20,7 +20,7 @@ #include "qemu/thread.h" #include "hw/i386/apic_internal.h" #include "hw/i386/apic.h" -#include "hw/i386/ioapic.h" +#include "hw/intc/ioapic.h" #include "hw/intc/i8259.h" #include "hw/intc/kvm_irqcount.h" #include "hw/pci/msi.h" diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index 264262959d..6364ecab1b 100644 --- a/hw/intc/ioapic.c +++ b/hw/intc/ioapic.c @@ -24,10 +24,10 @@ #include "qapi/error.h" #include "monitor/monitor.h" #include "hw/i386/apic.h" -#include "hw/i386/ioapic.h" -#include "hw/i386/ioapic_internal.h" #include "hw/i386/x86.h" #include "hw/intc/i8259.h" +#include "hw/intc/ioapic.h" +#include "hw/intc/ioapic_internal.h" #include "hw/pci/msi.h" #include "hw/qdev-properties.h" #include "sysemu/kvm.h" diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c index aa5f760871..b05f436dac 100644 --- a/hw/intc/ioapic_common.c +++ b/hw/intc/ioapic_common.c @@ -24,9 +24,9 @@ #include "qemu/module.h" #include "migration/vmstate.h" #include "monitor/monitor.h" -#include "hw/i386/ioapic.h" -#include "hw/i386/ioapic_internal.h" #include "hw/intc/intc.h" +#include "hw/intc/ioapic.h" +#include "hw/intc/ioapic_internal.h" #include "hw/sysbus.h" =20 /* ioapic_no count start from 0 to MAX_IOAPICS, diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index e738d83e81..3d0c0b375f 100644 --- a/target/i386/whpx/whpx-all.c +++ b/target/i386/whpx/whpx-all.c @@ -19,7 +19,7 @@ #include "sysemu/runstate.h" #include "qemu/main-loop.h" #include "hw/boards.h" -#include "hw/i386/ioapic.h" +#include "hw/intc/ioapic.h" #include "hw/i386/apic_internal.h" #include "qemu/error-report.h" #include "qapi/error.h" --=20 2.39.1 From nobody Sat May 18 13:36:47 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=1676309614; cv=none; d=zohomail.com; s=zohoarc; b=CWCQ7x8QAGPxfu//9CXiLfJNqFgIrMqVWpYxnbgGTJqfsyDzqe3QSOEjqET1xA8xs2Av7jeaJo58vrkfKb83ZR37a7u9Q7dMwDfKlNmstrkTclKyyLyWSk0H5esmrKSh+eP9y//Ui1G5WyJamQP5CtzAUZpl670jnuWW/dkuBqM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309614; 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=xYV5QNqikJXvVa9yuB52tQumknaV5O5E9rgc+0ATyx8=; b=W0hk0JcOZXYVLJL4JYu+HsjfEbAsh12/yT2grp1WkMrXxCN9ri1fH2rnobFBGqb/ILe45YUX6C+slEs+3XB5iQvcNdPBOgFMS50aegrkMomcy/V2UOh2HKX+G4TIa2SD3Ft4FbWJRVdl0gObAaip9HpbyW8qbsgQX79+fG7CfEk= 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 167630961462448.553797058002374; Mon, 13 Feb 2023 09:33:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcfi-00087m-5S; Mon, 13 Feb 2023 12:31:22 -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 1pRcfd-00084z-67 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:17 -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 1pRcfZ-0005NO-W5 for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:16 -0500 Received: by mail-ej1-x634.google.com with SMTP id sa10so33659496ejc.9 for ; Mon, 13 Feb 2023 09:31:13 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:12 -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=xYV5QNqikJXvVa9yuB52tQumknaV5O5E9rgc+0ATyx8=; b=cnLErfY8oSWZXtJLgXyGEFkF7RGwHZ6YqjUWtvt7BvV/DGYNEg0QsqwZQBatDpFZrq KqqTcSvs3+sBInrMCCvK8pZElSEdD4d2WCDbvllOEmXn7V8bND1Eyfd1zWoYRoP1fitW ZP2XZgB6cCSV9sQOOLckXCwAguOzfpPFvtIADF17pM4BSJ3eUsH+SPSupnkC5haSJrgk LidsiJZW0GEvVb8EuiVKkzjREqu5GUfTnDgfO2roeoz+rAB5QsDEJUHZIzpBNP+n1LWT mKhpjgH+mS2vdiG6mUx5aopZTpKLKPK9DJzvcKLaxHXVVjwmPzO3HWacmbTaknG3LuEo Af7A== 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=xYV5QNqikJXvVa9yuB52tQumknaV5O5E9rgc+0ATyx8=; b=xzHITatsRwsa29Hkn3boKazi1B5YTvOPQmElvA6fRVswboSLVujlugzP6vDVdk0vcf YgOThF/ewuhMItiCmD7VX+xdTNahyz7FuHdoKE7YKPD5R1o3Nky9BgDOd9tBKwGCBryM l5SP+YhiyGcRiFaZF0GSAaTPCC5wpcIXmRNJH5De0sXlnN3rynLAmWhtf+ilYfxwio2o gI6EfNblDfM+ITgHR0ifzRthc8AQJ/QAj2xXRSeb8LJOghBVrBQDFfZFqnUKhYKHMg+W vp0ZeI3SSHYJmuDqgRQx0ISxaI1036rq9XT9STIS0WbRc+ZyRecAd9sX2VNCpH1wuv2w gzRg== X-Gm-Message-State: AO0yUKUIKvlhlMGZniTWMv7evcy5ElXbmGH+IgaXHaHUlJsvVvLLDgJh C2xJ0lNgaE5kkjlfhbSSK/G1DliwNfc= X-Google-Smtp-Source: AK7set/kf/vhzwM/pO/361hYVCqZ3Oe8Rec90OPNPb3EkTfGyZl3nbmWsY1ANXQydNP9e3iolU5+8A== X-Received: by 2002:a17:906:3896:b0:87b:db53:3829 with SMTP id q22-20020a170906389600b0087bdb533829mr26588391ejd.46.1676309472841; Mon, 13 Feb 2023 09:31:12 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 11/12] hw/i386/ich9: Clean up includes Date: Mon, 13 Feb 2023 18:30:32 +0100 Message-Id: <20230213173033.98762-12-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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: 1676309615712100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i386/ich9.h | 8 +++++--- hw/i386/acpi-build.c | 1 + hw/isa/lpc_ich9.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/hw/i386/ich9.h b/include/hw/i386/ich9.h index d29090a9b7..3125863049 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/i386/ich9.h @@ -1,11 +1,13 @@ #ifndef HW_ICH9_H #define HW_ICH9_H =20 -#include "hw/sysbus.h" -#include "hw/i386/pc.h" #include "hw/isa/apm.h" -#include "hw/acpi/acpi.h" #include "hw/acpi/ich9.h" +#include "hw/intc/ioapic.h" +#include "hw/pci/pci.h" +#include "hw/pci/pci_device.h" +#include "exec/memory.h" +#include "qemu/notify.h" #include "qom/object.h" =20 void ich9_generate_smi(void); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index b67dcbbb37..1bb73c3e9a 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -59,6 +59,7 @@ #include "hw/acpi/pcihp.h" #include "hw/i386/fw_cfg.h" #include "hw/i386/ich9.h" +#include "hw/i386/pc.h" #include "hw/pci/pci_bus.h" #include "hw/pci-host/i440fx.h" #include "hw/pci-host/q35.h" diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index e3385ca7be..ce946760bb 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -40,8 +40,8 @@ #include "hw/irq.h" #include "hw/isa/apm.h" #include "hw/pci/pci.h" -#include "hw/pci/pci_bridge.h" #include "hw/i386/ich9.h" +#include "hw/i386/pc.h" #include "hw/acpi/acpi.h" #include "hw/acpi/ich9.h" #include "hw/pci/pci_bus.h" --=20 2.39.1 From nobody Sat May 18 13:36:47 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=1676309568; cv=none; d=zohomail.com; s=zohoarc; b=KsJ/9xOahbtqpOOVpZEc5W96L3QHeIV2+bZdJSiUjNQgCbm1QRCmuu2QxHjtSDQCfzcNWBfck7LkFkfpdwRM6tR6e5P0yQpSB6OYdEg1gO6ccyWRy3aRNAbd6YNxE8tldw9IcgT5rQAPAp9IecRipp+a3TpmRs6aORgVU8L1l5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676309568; 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=TU1PpxK9OSQXC2RqSlQQjQ/LkwGSLSRxhnmXFwkVco8=; b=UZeuvIHdkYZYUQNuu0LldSmfYQHzt/jb/sUGYa0KLE5MkPDfwb4H7nMD3sdZ+6LJL2YGBmv27xKy7htS2SsGGl5FfSb9Z7zG7dQLziQEiZ3EItDeXohc1KRrKNn49e1Dfj882FQgFctuwdMIVGDSt3GJmw2HEXm3HFZf+SY2SKY= 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 1676309568529159.64856700137727; Mon, 13 Feb 2023 09:32:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRcfi-00088X-SD; Mon, 13 Feb 2023 12:31:22 -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 1pRcfe-000865-Rp for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:18 -0500 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRcfc-0005Qk-LK for qemu-devel@nongnu.org; Mon, 13 Feb 2023 12:31:18 -0500 Received: by mail-ej1-x62e.google.com with SMTP id n10so6786834ejc.4 for ; Mon, 13 Feb 2023 09:31:15 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-133-198.78.55.pool.telefonica.de. [78.55.133.198]) by smtp.gmail.com with ESMTPSA id a11-20020a170906684b00b008aea5e0938esm6988699ejs.183.2023.02.13.09.31.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:31:14 -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=TU1PpxK9OSQXC2RqSlQQjQ/LkwGSLSRxhnmXFwkVco8=; b=dYhITBocUZCJEtN5btT02wrN/IhE5b6/2cjkRrevuzZL3Khqenw/4drMJll3oWejLN ZV69K78MQfKK1DhMt+rHwEHzOqem6QubKAVhM6sxXSEAIAhnrdkRDSUPY/P3JrPAnePB aGwxAgwrNpOtKgf9P2YulkjqnZWg1R1u4M3YeweyZQck81cJeHDmfyTYtBLLDrZjqVBp k1FxmLIJZv9He7FXOIitn3rURLXdnhtseT2eFdhH/V19tcnnLoqSpFhcfczVYK4r6Btx VKTyguC0Ru4mpLsMyL1g5c6pPtEzTa0kWiNI/Dohj341U4KR7i06BH5uuFf29ekIuGHk oTow== 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=TU1PpxK9OSQXC2RqSlQQjQ/LkwGSLSRxhnmXFwkVco8=; b=AsCJRCpstQtzmr0nWOf32Jgts3qACZHTCjnTsauBb7v+Y8s46c2r1dbX8CCb+OAswz dvHel/5gcYi/wnV+Q+WyMNqCMhx+Wuj79xuxmdhrEf+onCnXWVzAHOWAh6GyXD9YNh2n KLT1YhvAEbzfYmad9Tq3OsoQNZ+Fuz5OKRz0LObyAzgwoDSk1lPXHyvWmVU7xRDDcW5z xteHM2rAa78R5BtHp5ovXdZOzpf1E0twBfPgXd04knFGYva49WqHVORIViBht6bsvLXF qgVk+SZabMEdmfTX8ESLgIjKHqr6+llifPdjGz5CrTjdlcgLQQsXWhzdHHLXN5MFKglL rRjw== X-Gm-Message-State: AO0yUKX4zxwJiosV6CtU50WQVkyFFlclD8tjGjiNR70ZJAHP8BcfkOLe Zeb46P+pqSYbu2yK1dEreeGzl5uttv0= X-Google-Smtp-Source: AK7set9gzOOKCZAZFTGYLU4Dp9AzC/2LY2NM+cxuL8F2wX+31ZHGDCyQEFQphsYvz+j4lJmFqQ7W5Q== X-Received: by 2002:a17:906:3ecf:b0:879:9c05:f5e8 with SMTP id d15-20020a1709063ecf00b008799c05f5e8mr24195951ejj.62.1676309474576; Mon, 13 Feb 2023 09:31:14 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Richard Henderson , "Michael S. Tsirkin" , Ani Sinha , Eduardo Habkost , Igor Mammedov , Paolo Bonzini , Laurent Vivier , Marcel Apfelbaum , Sunil Muthuswamy , Thomas Huth , Bernhard Beschow Subject: [PATCH 12/12] hw: Move ich9.h to southbridge/ Date: Mon, 13 Feb 2023 18:30:33 +0100 Message-Id: <20230213173033.98762-13-shentey@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213173033.98762-1-shentey@gmail.com> References: <20230213173033.98762-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::62e; envelope-from=shentey@gmail.com; helo=mail-ej1-x62e.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: 1676309569611100001 Content-Type: text/plain; charset="utf-8" ICH9 is a south bridge which doesn't necessarily depend on x86, so move it into the southbridge folder, analoguous to PIIX. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- MAINTAINERS | 1 + include/hw/{i386 =3D> southbridge}/ich9.h | 6 +++--- hw/acpi/ich9.c | 2 +- hw/acpi/ich9_tco.c | 2 +- hw/i2c/smbus_ich9.c | 2 +- hw/i386/acpi-build.c | 2 +- hw/i386/pc_q35.c | 2 +- hw/isa/lpc_ich9.c | 2 +- hw/pci-bridge/i82801b11.c | 2 +- tests/qtest/tco-test.c | 2 +- 10 files changed, 12 insertions(+), 11 deletions(-) rename include/hw/{i386 =3D> southbridge}/ich9.h (99%) diff --git a/MAINTAINERS b/MAINTAINERS index 20460ce254..eb9ee6178a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1675,6 +1675,7 @@ F: hw/i2c/smbus_ich9.c F: hw/acpi/piix4.c F: hw/acpi/ich9*.c F: include/hw/acpi/ich9*.h +F: include/hw/southbridge/ich9.h F: include/hw/southbridge/piix.h F: hw/misc/sga.c F: hw/isa/apm.c diff --git a/include/hw/i386/ich9.h b/include/hw/southbridge/ich9.h similarity index 99% rename from include/hw/i386/ich9.h rename to include/hw/southbridge/ich9.h index 3125863049..7004eecbf9 100644 --- a/include/hw/i386/ich9.h +++ b/include/hw/southbridge/ich9.h @@ -1,5 +1,5 @@ -#ifndef HW_ICH9_H -#define HW_ICH9_H +#ifndef HW_SOUTHBRIDGE_ICH9_H +#define HW_SOUTHBRIDGE_ICH9_H =20 #include "hw/isa/apm.h" #include "hw/acpi/ich9.h" @@ -242,4 +242,4 @@ struct ICH9LPCState { #define ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT 1 #define ICH9_LPC_SMI_F_CPU_HOT_UNPLUG_BIT 2 =20 -#endif /* HW_ICH9_H */ +#endif /* HW_SOUTHBRIDGE_ICH9_H */ diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 54bb3d83b3..d23bfcaa6b 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -36,7 +36,7 @@ #include "hw/acpi/acpi.h" #include "hw/acpi/ich9_tco.h" =20 -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" #include "hw/mem/pc-dimm.h" #include "hw/mem/nvdimm.h" =20 diff --git a/hw/acpi/ich9_tco.c b/hw/acpi/ich9_tco.c index fbf97f81f4..1540f4fd46 100644 --- a/hw/acpi/ich9_tco.c +++ b/hw/acpi/ich9_tco.c @@ -9,7 +9,7 @@ =20 #include "qemu/osdep.h" #include "sysemu/watchdog.h" -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" #include "migration/vmstate.h" =20 #include "hw/acpi/ich9_tco.h" diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index f0dd3cb147..18d40e93c1 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -27,7 +27,7 @@ #include "migration/vmstate.h" #include "qemu/module.h" =20 -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" #include "qom/object.h" #include "hw/acpi/acpi_aml_interface.h" =20 diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 1bb73c3e9a..d27921fd8f 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -55,10 +55,10 @@ #include "hw/hyperv/vmbus-bridge.h" =20 /* Supported chipsets: */ +#include "hw/southbridge/ich9.h" #include "hw/southbridge/piix.h" #include "hw/acpi/pcihp.h" #include "hw/i386/fw_cfg.h" -#include "hw/i386/ich9.h" #include "hw/i386/pc.h" #include "hw/pci/pci_bus.h" #include "hw/pci-host/i440fx.h" diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index da2fa11b6f..93b34027a3 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -40,7 +40,6 @@ #include "hw/qdev-properties.h" #include "hw/i386/x86.h" #include "hw/i386/pc.h" -#include "hw/i386/ich9.h" #include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" #include "hw/display/ramfb.h" @@ -48,6 +47,7 @@ #include "hw/ide/pci.h" #include "hw/ide/ahci.h" #include "hw/intc/ioapic.h" +#include "hw/southbridge/ich9.h" #include "hw/usb.h" #include "hw/usb/hcd-uhci.h" #include "qapi/error.h" diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index ce946760bb..96fd500502 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -40,7 +40,7 @@ #include "hw/irq.h" #include "hw/isa/apm.h" #include "hw/pci/pci.h" -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" #include "hw/i386/pc.h" #include "hw/acpi/acpi.h" #include "hw/acpi/ich9.h" diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c index f3b4a14611..0e83cd11b2 100644 --- a/hw/pci-bridge/i82801b11.c +++ b/hw/pci-bridge/i82801b11.c @@ -45,7 +45,7 @@ #include "hw/pci/pci_bridge.h" #include "migration/vmstate.h" #include "qemu/module.h" -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" =20 /*************************************************************************= ****/ /* ICH9 DMI-to-PCI bridge */ diff --git a/tests/qtest/tco-test.c b/tests/qtest/tco-test.c index d865e95dfc..0547d41173 100644 --- a/tests/qtest/tco-test.c +++ b/tests/qtest/tco-test.c @@ -14,7 +14,7 @@ #include "libqos/pci-pc.h" #include "qapi/qmp/qdict.h" #include "hw/pci/pci_regs.h" -#include "hw/i386/ich9.h" +#include "hw/southbridge/ich9.h" #include "hw/acpi/ich9.h" #include "hw/acpi/ich9_tco.h" =20 --=20 2.39.1