From nobody Tue Nov 26 10:42:56 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1708966203; cv=none; d=zohomail.com; s=zohoarc; b=i+jfQ/xZwSsLvk+s8xt872yP9B7nGkVNwPBdYdPIds2BcprTDxck91+O6on8sdBR0iepk2kOGOu4DvuunSSzbChDNNRY/5PLi6/M0+P7b42cundK+1Jg7TWxesr/lVTLtNp9bVf5i5e/XQSfr3hILwOcXVALA/sdveaEEMynjv8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708966203; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=g6KcXi7ub1LWF1H0fHJ1E8fzi9Cbgex9iIz41HyRMbc=; b=TdyLxwXN/OLfJhpBS08LpoDuakhDobPWEX/mFP7x7L16uj2ZvCqSiTo1/8WdLcun9Ukuk226/eqEXfyaOdBiPMq7iV9zL3o+vb1SeE4uuihharNFR7cZZfkauAPsOnS3FQ+S9iR1zIVLpWLwxyEd9cCdZJrQUhR0v9VJfj2swW4= 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 1708966203757309.2339526414862; Mon, 26 Feb 2024 08:50:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reeAi-00069V-IB; Mon, 26 Feb 2024 11:49:44 -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 1reeAg-00065O-Fe for qemu-devel@nongnu.org; Mon, 26 Feb 2024 11:49:42 -0500 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reeAW-0006FU-1e for qemu-devel@nongnu.org; Mon, 26 Feb 2024 11:49:42 -0500 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2d22fa5c822so48223531fa.2 for ; Mon, 26 Feb 2024 08:49:31 -0800 (PST) Received: from m1x-phil.lan ([176.187.223.153]) by smtp.gmail.com with ESMTPSA id l6-20020a1c7906000000b0040fddaf9ff4sm12391603wme.40.2024.02.26.08.49.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Feb 2024 08:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708966170; x=1709570970; darn=nongnu.org; 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=g6KcXi7ub1LWF1H0fHJ1E8fzi9Cbgex9iIz41HyRMbc=; b=EsJYmrflOD26LJS/wXzRlmsdfyjuqIZABXSpJA2z53EEm4cUm21itVZ1g0xdCCRrdW KmSAYNgO1NCaflghcL+PRcCqvENPxTpVj8ANrM/eJfGWcXhimy7EYzE6PWVY779tmSEk rY2wTlD5ZobSVSUy6gHlFaY9rH2W4FpAFKqJJdYJx+D71K75p1knsqkXaE2NmjyMAFLV ZTaPog0o9VKSdNGuFVlD4cqglMdIuK6ePBMg8Ti9POx0gS+GRYyJLGe+fRGkfxa7Utra lNS0ymkqVx+Xy5Ql858uubgNiMPl5HkW/CQayUUN1Vheun+xAidef9VP+c4W06v7ksFU aUEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708966170; x=1709570970; 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=g6KcXi7ub1LWF1H0fHJ1E8fzi9Cbgex9iIz41HyRMbc=; b=OhR8PWq+NeKE0uLTdPD//ZOEVjz7VPlAIEcwDWvW5ZB7VGFKGgbg+1bv+XYCr3p4+c 7+GfuTNgJd2ywpI+uOHgvw3D8EeHV/5F9jq3b7D+KhKfrGcH7SHENhNGc7mgsbRYQTyr sTLv3F05qpe/MVcSYusWmQ5s+tqQIqe10/xdVYxaJhuJJwiDn/24Ml2RySuo3duHPYrp UFCJLraama0YPeO0H+JXroyJ3zedo9mr1NsrfDTjfiv+Tqm4PD115h/4h+TqTqDQ++OL RJFEQ+Tb2MIBZ0OueXFwY1W3Bkz/ugRlUfE50TafRp86glDLNtzwotT8WORnjBBwRipX GiQQ== X-Gm-Message-State: AOJu0Yze2c3uaMUBQOIS09Sb8Qm1NJpMWY6ugYas1O7TNkvwViGsCwRU DXHmGOBpTXpgpl/TeKLJtDf+J/CaWLG8wt3CQLj/xCGjIAFp4e9xoCxPAVngw/Ul9MX+1i4IcHy H X-Google-Smtp-Source: AGHT+IHnpast/mEXTrJrNkX7+tF6NW5v7o3OTkGG3SWMa3Jg87IZlLHPQIBrDGZB/A9izdRwo7aPfA== X-Received: by 2002:a2e:9607:0:b0:2d2:8a6c:3e54 with SMTP id v7-20020a2e9607000000b002d28a6c3e54mr2444119ljh.16.1708966170014; Mon, 26 Feb 2024 08:49:30 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , "Edgar E . Iglesias" , Anton Johansson , Mark Cave-Ayland , Peter Maydell , Zhao Liu , Eduardo Habkost , Marcel Apfelbaum , Igor Mammedov , Richard Henderson , Ani Sinha , Bernhard Beschow , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , "Michael S. Tsirkin" , Laszlo Ersek , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/5] hw/i386/piix: Set CPU SMI# interrupt using QDev GPIO API Date: Mon, 26 Feb 2024 17:49:09 +0100 Message-ID: <20240226164913.94077-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240226164913.94077-1-philmd@linaro.org> References: <20240226164913.94077-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::231; envelope-from=philmd@linaro.org; helo=mail-lj1-x231.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 @linaro.org) X-ZM-MESSAGEID: 1708966208227100004 Use the CPU "SMI" IRQ, removing a call to cpu_interrupt() from hw/. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/i386/pc.h | 2 -- hw/i386/pc.c | 9 --------- hw/i386/pc_piix.c | 4 ++-- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 4bb1899602..c8227e18c3 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -148,8 +148,6 @@ GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabl= ed); /* pc.c */ extern int fd_bootchk; =20 -void pc_acpi_smi_interrupt(void *opaque, int irq, int level); - #define PCI_HOST_PROP_RAM_MEM "ram-mem" #define PCI_HOST_PROP_PCI_MEM "pci-mem" #define PCI_HOST_PROP_SYSTEM_MEM "system-mem" diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 880e95de26..1df9f5ba90 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -651,15 +651,6 @@ static gboolean pc_init_ne2k_isa(ISABus *bus, NICInfo = *nd, Error **errp) return true; } =20 -void pc_acpi_smi_interrupt(void *opaque, int irq, int level) -{ - X86CPU *cpu =3D opaque; - - if (level) { - cpu_interrupt(CPU(cpu), CPU_INTERRUPT_SMI); - } -} - static void pc_machine_done(Notifier *notifier, void *data) { diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ce6aad758d..447130ade1 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -345,9 +345,9 @@ static void pc_init1(MachineState *machine, pc_cmos_init(pcms, x86ms->rtc); =20 if (piix4_pm) { - smi_irq =3D qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); - + smi_irq =3D qdev_get_gpio_in_named(DEVICE(first_cpu), "SMI", 0); qdev_connect_gpio_out_named(DEVICE(piix4_pm), "smi-irq", 0, smi_ir= q); + pcms->smbus =3D I2C_BUS(qdev_get_child_bus(DEVICE(piix4_pm), "i2c"= )); /* TODO: Populate SPD eeprom data. */ smbus_eeprom_init(pcms->smbus, 8, NULL, 0); --=20 2.41.0