From patchwork Mon Feb 26 16:49:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 775872 Delivered-To: patch@linaro.org Received: by 2002:a5d:6103:0:b0:33d:da16:65b6 with SMTP id v3csp427125wrt; Mon, 26 Feb 2024 08:49:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVxGNyXe/yQtixh7+npAqo85WeZVVc2lAUoMzbOwI8zuklifzqXm8f1CowNDS9YAt0c2eE5KNNjvezTHM1zOJ0v X-Google-Smtp-Source: AGHT+IFI2VO8w9pvAWloirGgttIM2DYQWdltxlzcll9JotKq4QfixcnG+SF/uftMPix7xOKNar0V X-Received: by 2002:a0c:e113:0:b0:68f:44eb:b944 with SMTP id w19-20020a0ce113000000b0068f44ebb944mr7443445qvk.15.1708966196531; Mon, 26 Feb 2024 08:49:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708966196; cv=none; d=google.com; s=arc-20160816; b=QuE0gsho4Wk+4RSuOCH4ZwO8I+LqV+K3d9Tw1jkYaQ0Th8kcohUm5jHVcKDTNK0Fa3 MbZ5CClGuoI2ER+oJKLZLmQYRBg/ZA09U2biOcmQWcCq/oCn7vHCfyEmyOpa8vkrIXIP iNEmvb9HeyR6apabLZ5e/ENBhGkkKb1xn11S/KUFPaFgvdfquOmr/AwEwE+icZy471Px zWBLOALc1MiDNKFh58stkZ8CMJyQAlBkprb9fmeRohgVLkxTOGz8ciW174GeAVZhqGWU P8gnP/RJT1skWPfBgnW+gB6FStxikJUCSgFqb3HY6QvRANtrlgcdJe8V7fesrnWjccuu 0bbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=g6KcXi7ub1LWF1H0fHJ1E8fzi9Cbgex9iIz41HyRMbc=; fh=afD/k2HZXMBaufC+DpUvb9x31uKmY7+wEY31QP4pBTk=; b=C4rIXXH4hzSH23ZP7ueIggUxk8DRk8JvAXHtBzENHzcdKMf5ya3f4ELuNZ6BJg+zk3 qMBGrDvWwlIIwT84Op68I3AWv1LmribHPU9BGJOlvEWNk30VPvSUnda1Lqhs48CC1RrS j1OdEuYKQhvVnlro3pQ7Tpt4UxFjqK4tzS4aEwe62+KJrUzyD5QHr98P0V3EGmkUfUWQ oPL7LOfFx91qF0oWTKY2GOrR3N9Opt4yqdgiP8eMT0L0BWsDp/RRPlj3EYFxB5dRKSpm xMj1ByZJAa/I8jCHHV8AXSsDyWQiVc1IPGoRKMzNnHWCWrtx2L44S88B4bTjj2X5llYt 77aw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EsJYmrfl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 3-20020a05621420a300b0068f8b9e1ad4si5457371qvd.388.2024.02.26.08.49.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Feb 2024 08:49:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EsJYmrfl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Benn=C3=A9e?= , Paolo Bonzini , "Michael S. Tsirkin" , Laszlo Ersek , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Use the CPU "SMI" IRQ, removing a call to cpu_interrupt() from hw/. Signed-off-by: Philippe Mathieu-Daudé --- 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_enabled); /* pc.c */ extern int fd_bootchk; -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; } -void pc_acpi_smi_interrupt(void *opaque, int irq, int level) -{ - X86CPU *cpu = 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); if (piix4_pm) { - smi_irq = qemu_allocate_irq(pc_acpi_smi_interrupt, first_cpu, 0); - + smi_irq = qdev_get_gpio_in_named(DEVICE(first_cpu), "SMI", 0); qdev_connect_gpio_out_named(DEVICE(piix4_pm), "smi-irq", 0, smi_irq); + pcms->smbus = I2C_BUS(qdev_get_child_bus(DEVICE(piix4_pm), "i2c")); /* TODO: Populate SPD eeprom data. */ smbus_eeprom_init(pcms->smbus, 8, NULL, 0);