From patchwork Tue Feb 13 13:03:30 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: 772304 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp241003wre; Tue, 13 Feb 2024 05:04:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKOUX4r3MBAu85/FHvCwMg/AUBemjNnNAIvBEoP79wTyWusTZk1jwtmFaZE494Qx0EDYWm X-Received: by 2002:a67:c989:0:b0:46d:606e:633f with SMTP id y9-20020a67c989000000b0046d606e633fmr7066943vsk.1.1707829457350; Tue, 13 Feb 2024 05:04:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829457; cv=none; d=google.com; s=arc-20160816; b=G6t7SM65BrYUIgtXdCkcTSm8jdyTdMRNmlTEj36VhOGoPVnO/Ogy9Q92mZnfKToD+s Adls8z1lymi/PigV/JDJkorZHWdDmxTR+eZx7+VrJsD50jeDKODQJda0BFsgD0k8RxGJ YkiXo8n3wyGBmE9mxWXFClaIKuO2v8x7uFd+ziVdgoLbW1xvZuzVAUcrQhsN67Z3ATqY xMu6a8xmq8zDwivhSQyc/PxxNoLgEkIC63UEooF5eOHDv4NO+Q4ttC2CnX/pdHmB+P+o 8T/5Sn2SkM3tCbNxugknEaqgAjHBYmp/lzAtwTBzt9InrOR/z6YJ5H8kVbPe3CuJqg8G YoyA== 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=8bjV7XbcteO5mP7y6ZVwmid/dNk1Cnsnez4w9DwRe9k=; fh=dfUMsFwXT7PpyXyLuWsTM6vk9dlw8IGgxeMx/j2VweE=; b=EWtuQM1mjRovR16Q02xv9Pk50SfuIXgBLqBe5O5XZW40DuKhn6Yxb/SNRrpOYVG0jS 0IgyENw1KOoC135e7kkjZYtAaF73WdXPVIcuKesE0nEw0jWKUVXPsncAl84MqIyMkhUk HH6PmIJayqwrzqCmwNImbx10PHIZRxfhtPmaFZVLzGJfdnIR/KCA4igdYnjC+48w3faF L7bo85WxlGsj4haGHChv4a2evbPPqgevICmLLataHQNWGXKjVvAMvmzXOgbf/N8k8shE ur75DM9KrxPoIQjLHrqz4YONZAnc0+vOd+Rg69CUxgaaBhkWE/zk6UO9U++ZBywkfXtU FE8Q==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Iuo2kq4j; 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 X-Forwarded-Encrypted: i=1; AJvYcCWYMbrJrlhYKpTXYZjXxHbVDEWcX/MlxTeCloIVNrjHqZ3MXTlvEwNwoNzkTXNUPRm8QmHEmVa9yrRS6Vpf6+MG Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jc8-20020a056102128800b0046d23340493si941052vsb.67.2024.02.13.05.04.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:04:17 -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=Iuo2kq4j; 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 1rZsSG-0001gN-D7; Tue, 13 Feb 2024 08:04:10 -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 1rZsSD-0001d1-25 for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:05 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsS9-000619-07 for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:03 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-33ce2121d5dso106300f8f.3 for ; Tue, 13 Feb 2024 05:03:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829432; x=1708434232; 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=8bjV7XbcteO5mP7y6ZVwmid/dNk1Cnsnez4w9DwRe9k=; b=Iuo2kq4j8ukTmdnLFLBwVBlv141VbxOiud44j19wChyXANllhtKUI+T//6Sl/QusqI bTjeApXT4e/hEI8XqZbtEQv+XPhmREz2tAgahk7xDqQ+gi/Dbvofat2jLmBZc542dq0T 8r6pZG5UzrAVxqTxF4al2lqLFUyuFVgit/uOm3y/NXIw687Ah7OloGGbpYD5DmYWR1NE s0Ay1DGA1OXkF1AMKzBKIAkRxMILStV3jzDlthvA17tQ09IMKGIbKYYKdw283NaT8mIF hHZtvq0e7YLhuOYyHopoRh9gKami3innso6Xs13+dA2tr5kEZTma9CGo3imif4uhVfwq VDzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829432; x=1708434232; 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=8bjV7XbcteO5mP7y6ZVwmid/dNk1Cnsnez4w9DwRe9k=; b=vvWVHX+mQWn40i8YK+iZ8TeGuzMtNGwqYzo72ucvMMZcUkxAtmHEPssXUnjAbmAna8 Jx13V5pVYUkXFz3SoIf9iR+iwQdwG5otyRGEDPFIebn2fF3RL+ZupfWpyLvYj5Kk02RC RZwWFbjS74gCwWSqKz7o7ALafhyvfK8I98uqcQBjal15lfoLEwDWkSlXKyxmWEBvTQPi I8WoeeZDAnlp0O5H3lkBuVZWtYsJs+ci0VL8xe5BjN3uiQD3CdGpbXuNjPKkqn4T2fWb n1JUjzkW5NUh90MES8pERK9cOPDAoovNxpRToNVWxBWOwxBjkUdIQM4CsOnSWqXTkfcq xrVA== X-Gm-Message-State: AOJu0YwgezkBjWTxs2d3XpinhZI8SWYrEOpUJFK9hn+K2DbJorq+ln77 iCi7DjgUycW65mxeYKt2kw8h4phf9GYZ/2zXkG5AGgEKcQtJ+GrvmWD/hUD1seJfm9Bgj2zvN9K X X-Received: by 2002:adf:f245:0:b0:33b:4908:9bbc with SMTP id b5-20020adff245000000b0033b49089bbcmr8723938wrp.40.1707829432085; Tue, 13 Feb 2024 05:03:52 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXY47e5RknONtOTkkWbiFJ9EVpcCyRgrxnsd/fsLwV/Q5erRYBsZJCd8wguc4lqVNGTqynRqW+lXLbQOx+2QqIckvAqRynoDN0JhflIu7HfMUzfFBLrbHyLxrYOO65ALl0JrLdl43Zv+ivVop/tPheRTaWLT8r6yK5iKrK44N+7co4oOxoXQW5lj8Ru0eMFJfzcr1DOUi5ERdiW8AUYrJo7immmzfb8pKgSsXdZ+qKZ4sk+23oyyeo/abpNGolwangEhaZ5tdAmlgh8SSMNt9dtG2yd2DP0//8+UaUnK0sqb2HNCggRlawgc2as1xW6xbogcVZSM4vRrOzrlx3ROlqa6JZbeVJaxFXNzLroRgpKzWMMwRXSrV0mQfrJXH5ToLiwUA== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id ck13-20020a5d5e8d000000b0033b684d6d5csm9745907wrb.20.2024.02.13.05.03.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:03:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , John Snow Subject: [PATCH v4 01/12] hw/ide/ich9: Use AHCIPCIState typedef Date: Tue, 13 Feb 2024 14:03:30 +0100 Message-ID: <20240213130341.1793-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 QEMU coding style recommend using structure typedefs: https://www.qemu.org/docs/master/devel/style.html#typedefs Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/ide/ich.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ide/ich.c b/hw/ide/ich.c index 49f8eb8a7d..048ea7e509 100644 --- a/hw/ide/ich.c +++ b/hw/ide/ich.c @@ -99,14 +99,14 @@ static void pci_ich9_reset(DeviceState *dev) static void pci_ich9_ahci_init(Object *obj) { - struct AHCIPCIState *d = ICH9_AHCI(obj); + AHCIPCIState *d = ICH9_AHCI(obj); ahci_init(&d->ahci, DEVICE(obj)); } static void pci_ich9_ahci_realize(PCIDevice *dev, Error **errp) { - struct AHCIPCIState *d; + AHCIPCIState *d; int sata_cap_offset; uint8_t *sata_cap; d = ICH9_AHCI(dev); @@ -154,7 +154,7 @@ static void pci_ich9_ahci_realize(PCIDevice *dev, Error **errp) static void pci_ich9_uninit(PCIDevice *dev) { - struct AHCIPCIState *d; + AHCIPCIState *d; d = ICH9_AHCI(dev); msi_uninit(dev); From patchwork Tue Feb 13 13:03:31 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: 772307 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp241972wre; Tue, 13 Feb 2024 05:05:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtxYwYnOeO/Z0OxlEn4DNKovAnGen9xxNZMbB7WntEsWOsKE3rtdNNHseXVheKzRnQ2TDL X-Received: by 2002:a54:460d:0:b0:3bf:f1e9:2199 with SMTP id p13-20020a54460d000000b003bff1e92199mr9925853oip.46.1707829557221; Tue, 13 Feb 2024 05:05:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829557; cv=none; d=google.com; s=arc-20160816; b=DYEWIIPdL98wbSvVJi+oI6R4uwmPJffJvP/90U87q6uA+Is5L5dWumPttQfLXeAyD6 CFQbSgd5JcKMsT8XbZfH33Z9yk1Rik5ebIykThauwRd75NdOSVOEQGhcTsl+BTwEupAf 1JigSzWnxAXQexjOj3LnmxL2qMMAYLo1sVyIVLsvenYtn8KNh62oNYO7U3ykVSozfTRJ LQF1Fqw/PxwhFquptE3rRuxx7Aud9tsYCA3vEj2WidIZ+/k0WsHe6p0Wb/mpdzfiyUTE dV1VqsqTxsw1Ja2BknCTaIArhl2xEn3ALz+3a7xn9qLC0prAXnKWmIqSzLQP+9Bjy5Ng CQrw== 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=4qIxF6fCwa3/mbXSgbpVLHQdzzP18rWcIr6bIztAwaI=; fh=hECoIZeijH7VCJIfaWwXwqn7M+DwWO6LJ0YRIZFRV7M=; b=CdcOOCHinfgdLIp71ig1kBHd+FFza8DV8Mw3advvW7EtaFfcHI/LiMeXTkB6wF4vSX t5LXfkofj2Wy/LnYka34YTxleE62G3lFhyVmSLACXfy5lSig446Y7cMaABeu/XhHzOya paxme+KwWbCLG9/0WgMUp5MvC4YYhfQlGwrvoA8yWXHuurrpQTZpKpQHZ1uOW9igeLdJ 4OgV1LS7fE5WVmDounG5p8U3cvi66guNiT6leOUVHNlLz5R0pzpPdVpBrnG/a/bcTYnE cRTC+J+7CWYDngCDgWJDm/JYxkRZxVQM6MAnorAlHp8kgqeZ4KjqBgX7o/78FNK9czpg rKFg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lu4+GA+3; 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 X-Forwarded-Encrypted: i=1; AJvYcCVIV87ZVQ7Lxa0y06HGsb7IQKqrFVqDzWlde2cICzXj4XKDg78Mxt7zgYIufO+Zyx+6Q3LKnAsxMA35i0XcGDgF Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gw6-20020a056102668600b0046d0188b5e5si1119846vsb.717.2024.02.13.05.05.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:05:57 -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=Lu4+GA+3; 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 1rZsSI-0001iu-L2; Tue, 13 Feb 2024 08:04:10 -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 1rZsSD-0001d2-2P for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:05 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsS9-00061X-0d for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:03 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-411c93e1cd8so2316685e9.0 for ; Tue, 13 Feb 2024 05:03:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829439; x=1708434239; 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=4qIxF6fCwa3/mbXSgbpVLHQdzzP18rWcIr6bIztAwaI=; b=Lu4+GA+3ASVC7t8KFAkw3D7JzHoRTl2653c2mtOHN0yYfDdNmYfUu7V789py2O0Xy3 9dii2az7UQhtv9Fam7tyL3dKwXjPQq1WbdZeTtzj0nVvXWbzqHn+xLnVwAtvakrA3/lV wWYhJJf7/GPWIaL34ND6HfW7pFDPJtc5BeVHwZVKw4TLnTcDJE1s9UliyvthkF4VsSKK /hsj/2fFJX++reICJGFk3S4LzgePlVX+XLKD+5yzdKciUePlYh0biE3jvvRaWDvgk3up W5Dx+ljtJ8ZJiZsxZcfwct37jLXpmiDCKbAFKWwL4gHS8pSQ9iQ0dfVqmRo/39/kYbyx hvZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829439; x=1708434239; 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=4qIxF6fCwa3/mbXSgbpVLHQdzzP18rWcIr6bIztAwaI=; b=KvoNSQAvr5qOInOD44gF9eMQO9js/Calerfs7BdorWDZ1KItH7kKBIgXCU9o2S5Bvm 1a09BVShQ7aW3E/y0KYUmXLn9dtKW9KsOH4FKF3JMDDeCc3YAox+3NrLcw7X5pkbWUKj 8HfbW+wWST6odPXjaTCkMG/KiDsShqDK3EPtsA85mkPWr8/505S9N4h16Qc+FMNKn1dy R1JNlHQtLCvNXTJeN1zEk7hbqENV8cMRaA1jDrT2E78VvH9Wt2FctX6J7TpW0FVHwsVT 78C+8OiG04kSkLmkcO3DdsW6HNJxvDZj+plCgYg11BHmkNn/C9b4vhv9E2LD+sAD+1L4 /Dbg== X-Gm-Message-State: AOJu0YzLCrwzpPDvwvymCA2Mg94cN4YWwM3hNIPRyQxRZYa3r45+x8ds Wr1nqDSSWnuS9w6WURQv7EDfohNSuiwLXEe36HS/igyQdBS/F8MiTFWygPw+0ExF1gHnt8yXylb k X-Received: by 2002:a05:600c:190f:b0:40f:ba02:d172 with SMTP id j15-20020a05600c190f00b0040fba02d172mr2334739wmq.17.1707829438727; Tue, 13 Feb 2024 05:03:58 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUQZTVhRPf9nMd2cUfZQ0L4uq8DAJV3coX+r83bxHjNbI60JM/eTSaxGCThbSwhTVJG/eJOlMii2utBLJzJ6ehwsJWyIt0ubsj2alxHqhH13qqg0yR652nxCERWCLEQBBUkLJ6+PS95Ff05OMb63evgO2xSOay4PUltXFT0xVynI/dBEvjUblxkeaqy5DhEMD8lX/tGkuqI/bkMA9IeWgqCSXlhyRS5hfPkrMMV16GzkoJQrqR3lQAbGguBSNAw/fu1N2XOT7HH94+MnPFBrc880OMrvGW1R230y/g5ZQhQ6Mkz2VtHj9C5xLUC7gfZYzonbVM1U8jYAuI/FrnJe1sp4TfwW8edMZ5b96QINpVkU8EZbALgytjZDL4G2VIFBoPKTJWRxXm8TSOXLKg= Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id ay20-20020a05600c1e1400b00411a6ce0f99sm3368269wmb.24.2024.02.13.05.03.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:03:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , Yoshinori Sato Subject: [PATCH v4 02/12] hw/rx/rx62n: Reduce inclusion of 'qemu/units.h' Date: Tue, 13 Feb 2024 14:03:31 +0100 Message-ID: <20240213130341.1793-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 "qemu/units.h" is not used in the "hw/rx/rx62n.h" header, include it in the source where it is. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Yoshinori Sato --- include/hw/rx/rx62n.h | 1 - hw/rx/rx-gdbsim.c | 1 + hw/rx/rx62n.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/rx/rx62n.h b/include/hw/rx/rx62n.h index 73ceeb58e5..bcda583ab3 100644 --- a/include/hw/rx/rx62n.h +++ b/include/hw/rx/rx62n.h @@ -29,7 +29,6 @@ #include "hw/timer/renesas_tmr.h" #include "hw/timer/renesas_cmt.h" #include "hw/char/renesas_sci.h" -#include "qemu/units.h" #include "qom/object.h" #define TYPE_RX62N_MCU "rx62n-mcu" diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c index 47c17026c7..bb4746c556 100644 --- a/hw/rx/rx-gdbsim.c +++ b/hw/rx/rx-gdbsim.c @@ -20,6 +20,7 @@ #include "qemu/cutils.h" #include "qemu/error-report.h" #include "qemu/guest-random.h" +#include "qemu/units.h" #include "qapi/error.h" #include "hw/loader.h" #include "hw/rx/rx62n.h" diff --git a/hw/rx/rx62n.c b/hw/rx/rx62n.c index 4dc44afd9d..d3f61a6837 100644 --- a/hw/rx/rx62n.c +++ b/hw/rx/rx62n.c @@ -23,6 +23,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "qemu/units.h" #include "hw/rx/rx62n.h" #include "hw/loader.h" #include "hw/sysbus.h" From patchwork Tue Feb 13 13:03:32 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: 772312 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp242803wre; Tue, 13 Feb 2024 05:07:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVPAFmRz4vVrps0uildDFsrtWv+shKwgYn+u59XR3Ei3c/ium+a8qG2Y5PNL9JZCiw7BKs0GZen/qN2CA5h+OEX X-Google-Smtp-Source: AGHT+IEqQOsPwHnlsapEa2meNIyFDjzQHGhRTkIOCOAn2BwblqXNCsg3cffv+jl3kvogvC8cI/Tq X-Received: by 2002:a67:ce95:0:b0:46d:13a3:721 with SMTP id c21-20020a67ce95000000b0046d13a30721mr5407473vse.29.1707829648507; Tue, 13 Feb 2024 05:07:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829648; cv=none; d=google.com; s=arc-20160816; b=AX07xXmyuIaEpyi2yZFLA4gziA5+iXzWsssGV9s62JfiJVb/A3nRlGCo1ySZVgZsZe JPT84kdxRGXv7novv/sWL7EKG5GiZGkpiJBbKj/8Ao0sr3sLk+7bvjcKtMu+zlfqQqlc B3Y/Ap5ZIA5cspoaCs9fm4BCiItEJw+6udCoZV3ALV95WyRDlGKE1cuw3VqVoWSaer3t 7jD5EyniBvGDANYbj/xMFzDv4vbF7lxeHxiwMp50upM6I43kEOrtgXjubuXLDB3c8DNk hq2GS6q8MLTBtnxtPWF/8umCubE8nP5XjbmN5ySZjjoScmhCs8iqVi/1mJvKTt2CzZ4E q2dA== 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=KuZWfpmBZUkGwZKw0Sk+TM4GOlyjT2THjQVZz4qS8UI=; fh=Ce+WshCOdYDZDKTSEmaWfHTy+qPfEI5MJ3Ffrqy6ITI=; b=QHwXZQRLIhfqt6MsA04Y4bHdFlD1hK/Ekc/VUySVlLmgVoUEdN4+a4LX7L7VCgU0DP xYip42QaVucoRleP+WXwEPOpMAnPRzM6W89ixN3bZMu+YJWrFNgiOO4h6ycxuQ/brlmk 66ZguBSTUkB+HyKYE3tR12uRHAyLWyc4k0RCKu6hNXumGwskZKzLLMz6WZJx00pAGt+2 DzeptKSsgFlaa99Kd1vFbU8N5McuGGIO/MPcr2P6timfNwGoVPDeNlHbUhRHFJlooRuG oZVxXiXOxcsMGES+DJ23lQmm5LrIqalaY8rGfqWc28nspde9FVWCE9aZqX88jcheNhH3 8URg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ll17lami; 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 X-Forwarded-Encrypted: i=1; AJvYcCWBipC6Vwb2XFmAK3q3V9pE5DvYj5GA1wNuWxAaRvXV5IpbtZHTNMrDNuWCt3StD6TkcRfopdX4mXrwvfNvIGEP Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m16-20020a67f710000000b0046b3bc67134si985730vso.401.2024.02.13.05.07.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:07:28 -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=ll17lami; 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 1rZsSN-0001lp-3f; Tue, 13 Feb 2024 08:04:15 -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 1rZsSK-0001j3-D6 for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:13 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsSG-00062o-0l for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:10 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-33cdeee752aso208845f8f.1 for ; Tue, 13 Feb 2024 05:04:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829445; x=1708434245; 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=KuZWfpmBZUkGwZKw0Sk+TM4GOlyjT2THjQVZz4qS8UI=; b=ll17lamiTmRm8gBcmVtw/y8CRF2ZcCn+h/OAt6PtBuT67WNHR1ZA79CkFd+jkNGHVG orbMAZcdvH/cJAlr2tzyadzPtxJ75uRM4eg8wFSuWzvulmYOR+DzAS/j2MrCJPCiZEqN iQ2nZEtj7CCj7tFy9okw2trCkNOqX05o0CMv/BSuZ+eL/t2F8UxHtUi3sDeXDC1RmLHQ vCCrSmZs9a9M+1CObt+zAvfwbZPv8DW6QF/G7jEinH8Tat0TOV2v8mksanNYDQNYa+2H 3QY7+GolqI74IqqTlFn/O2HrtqAhuDVWXVp7b8Mxu5rBqFXXC2IhHNjF4K/3kgAIgaiU 5abQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829445; x=1708434245; 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=KuZWfpmBZUkGwZKw0Sk+TM4GOlyjT2THjQVZz4qS8UI=; b=ldBBjK9oNeUaCSRAZk2O2iH6JDIxAZyJIZ9sTCkOnO93c9qcjaFj6uYeOxDtvHeRpR bs3yRNxH2SynVVzZOQldwiOs66bbOs6J+iQWPZUbDBL6T/G0HqwiTklVd6e0lMwiC1Rj fGZfiV+K20Vubnv3juZp870wKcEl3K+jNd2dbcI8C4CMMNeMCvYYf59WZnMVyD6Wy/Zl hlMApVhVfZzkjr/VyNlLmYVaCMqZpxeaXrcHydOCCTaHNTX8ytMaSeRIldoL3mBz9Kr2 LtgIXnIges2EcAm8zKVTu9DaIN7KhShVUpI5fbvHBaNV/C7ykcCDIw2MJU33G+tz7WZL qwzA== X-Gm-Message-State: AOJu0Yw4wJpg0ygJlcLc2FCUKaBMzuGShaK1OiAilCvZKsoPVr9/qa5x ZTfzga26KmJpuDIDPEdqbZKbVR7zPt9cFgcSpAw9HNShkvFUJ8ETmigNtiMOWkxXD6q0SgHCZ9T n X-Received: by 2002:adf:fac2:0:b0:33c:d57e:e7be with SMTP id a2-20020adffac2000000b0033cd57ee7bemr1210769wrs.44.1707829445571; Tue, 13 Feb 2024 05:04:05 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVrTdSGKpiCYf/g9xwm0f9az/F+EUZ/F2AgDRrJtltrJXIYh1HW9FGxApSvV/zH+eyL1QXzBH/GARQtBkxbX7MS0LUhnqgVgbofYX/AilLU+Ho9CzK4naTT9QwMH7WYRhJAqhxt75WHRZW2tLNrdbwDl8ipBdeuMFe5tamZRyBU6rmImPT3wb5VyN3Ev/tui7QBeRhjBJZun/PnNLCWBAhXQjdkwxeukUchfiYIuVoN1tJGGaw2fKegzNeGUQ5+w+pItmvL8f3vvLorWbEH7K2CUlZKqxnWQlU9Y41uA5nIMbTzbKvevzuxl3hvwOMHWmTue0b7qAvDEh50BWnI3GDJN2nYl4BWW0WvKe1PYfX58gjkHoag4CyoZzdcNC0XNfszGniWb0I+KMUDroU= Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id q17-20020a5d61d1000000b0033940016d6esm9459437wrv.93.2024.02.13.05.04.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:04:05 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , Yoshinori Sato Subject: [PATCH v4 03/12] hw/rx/rx62n: Only call qdev_get_gpio_in() when necessary Date: Tue, 13 Feb 2024 14:03:32 +0100 Message-ID: <20240213130341.1793-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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, RCVD_IN_DNSWL_NONE=-0.0001, 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 Instead of filling an array of all the possible IRQs, only call qdev_get_gpio_in() when an IRQ is used. Remove the array from RX62NState. Doing so we avoid calling qdev_get_gpio_in() on an unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Yoshinori Sato --- include/hw/rx/rx62n.h | 1 - hw/rx/rx62n.c | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/hw/rx/rx62n.h b/include/hw/rx/rx62n.h index bcda583ab3..766fe0e435 100644 --- a/include/hw/rx/rx62n.h +++ b/include/hw/rx/rx62n.h @@ -67,7 +67,6 @@ struct RX62NState { MemoryRegion iomem2; MemoryRegion iomem3; MemoryRegion c_flash; - qemu_irq irq[NR_IRQS]; /* Input Clock (XTAL) frequency */ uint32_t xtal_freq_hz; diff --git a/hw/rx/rx62n.c b/hw/rx/rx62n.c index d3f61a6837..560f53a58a 100644 --- a/hw/rx/rx62n.c +++ b/hw/rx/rx62n.c @@ -148,14 +148,11 @@ static void register_icu(RX62NState *s) qlist_append_int(trigger_level, levelirq[i]); } qdev_prop_set_array(DEVICE(icu), "trigger-level", trigger_level); - - for (i = 0; i < NR_IRQS; i++) { - s->irq[i] = qdev_get_gpio_in(DEVICE(icu), i); - } sysbus_realize(icu, &error_abort); + sysbus_connect_irq(icu, 0, qdev_get_gpio_in(DEVICE(&s->cpu), RX_CPU_IRQ)); sysbus_connect_irq(icu, 1, qdev_get_gpio_in(DEVICE(&s->cpu), RX_CPU_FIR)); - sysbus_connect_irq(icu, 2, s->irq[SWI]); + sysbus_connect_irq(icu, 2, qdev_get_gpio_in(DEVICE(&s->icu), SWI)); sysbus_mmio_map(icu, 0, RX62N_ICU_BASE); } @@ -172,7 +169,8 @@ static void register_tmr(RX62NState *s, int unit) irqbase = RX62N_TMR_IRQ + TMR_NR_IRQ * unit; for (i = 0; i < TMR_NR_IRQ; i++) { - sysbus_connect_irq(tmr, i, s->irq[irqbase + i]); + sysbus_connect_irq(tmr, i, + qdev_get_gpio_in(DEVICE(&s->icu), irqbase + i)); } sysbus_mmio_map(tmr, 0, RX62N_TMR_BASE + unit * 0x10); } @@ -190,7 +188,8 @@ static void register_cmt(RX62NState *s, int unit) irqbase = RX62N_CMT_IRQ + CMT_NR_IRQ * unit; for (i = 0; i < CMT_NR_IRQ; i++) { - sysbus_connect_irq(cmt, i, s->irq[irqbase + i]); + sysbus_connect_irq(cmt, i, + qdev_get_gpio_in(DEVICE(&s->icu), irqbase + i)); } sysbus_mmio_map(cmt, 0, RX62N_CMT_BASE + unit * 0x10); } @@ -209,7 +208,8 @@ static void register_sci(RX62NState *s, int unit) irqbase = RX62N_SCI_IRQ + SCI_NR_IRQ * unit; for (i = 0; i < SCI_NR_IRQ; i++) { - sysbus_connect_irq(sci, i, s->irq[irqbase + i]); + sysbus_connect_irq(sci, i, + qdev_get_gpio_in(DEVICE(&s->icu), irqbase + i)); } sysbus_mmio_map(sci, 0, RX62N_SCI_BASE + unit * 0x08); } From patchwork Tue Feb 13 13:03:33 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: 772305 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp241420wre; Tue, 13 Feb 2024 05:05:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUDcEUPwzF2DHgFaeQ7674BCnFCxcbw3JpbMO5lZ/PPMob5nd6DhY7t0mQSL3PtU5fUaIZTentBDXiWzXsVXjbK X-Google-Smtp-Source: AGHT+IF7u/z1UuBu676diPX70dcgtAMaJuHmEsxdVtZW3ouv6xGqvmbaHAG0hDOuCJGjcZtIhxK+ X-Received: by 2002:a05:6870:c18d:b0:214:85d0:b912 with SMTP id h13-20020a056870c18d00b0021485d0b912mr9093414oad.14.1707829500381; Tue, 13 Feb 2024 05:05:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829500; cv=none; d=google.com; s=arc-20160816; b=zTer1+hSUTuUXjVbwN4Kja/pP1iLM7ofcbzzEhUEqqBGSq8/QsLaPRY1daCVk5gHRI DQjelti68rLBjShlNJaopzAlhwF+6ouK+TyU3lZSjcOxKTn5eCW7AkHsGDlMxkQxJG5+ 3I3cphmj3PfpzXaKwgUDl/AL5iI7CZYAIOQwZ6o5PMOwHVrSJWi42sbUSOrXSfet27OD 2ccit1cSVRWb3Y2ySlkAbpeA5W/nptPg9SV96Q8dJthM7sYESom2iSRYIniawIbpKlsC wc74Hlau42Tx2p0ppykZvD1TflyxK6GVVM74U3OVpb26vKL6LyTAR/dDpbgleMH6K+2x 1xzQ== 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=tP5MZohIYd0wVaYtS+mlCIb83dpcfafYILJYWOltnx8=; fh=qj0rgE4H/239xp7mHLV1eUcUoGytWeJ2zsyELN4UN/k=; b=QlIvEmGVwd8vas/6WT8ybSvMS+F65Vg/DIwN787X+oxufaB+EVvLl5Rb0EFnv4GCVu yqcVH1xkWLxaUEeXVTp1EpCg4RY4KdsdVZYATRgFV2FdjC5lVhye7l3alL7ndltUsxgM N2py5O1kjv1p+zoCrbQ7+S2eTkBMZqDeUqLS5rO8gHtVdHM0RSMLaG8rEOXtEenK5DJ3 GRULPH+UseBmDNoGGVX+fmc8YFM57aHeR7u8tsnEbpXODnd33mPhaFClo9S8LEuT0ffz pEwCPytZib9EWdfvMFTwuxHriZV+tudniHrDvRkxSV+bQAtVp8VuChCHkE1UYTbPFT70 mpdA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NR67svxf; 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 X-Forwarded-Encrypted: i=1; AJvYcCWMr0ATSRsX/4wbgDTBIObQ9cstjP/bZ9uJB6zgMs5FuRIzbhHSU56YdpHZ2rIUT1wgNHG48sjGApa+bvVJdr79 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id az18-20020a0561220d1200b004c077185da8si1023258vkb.176.2024.02.13.05.05.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:05:00 -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=NR67svxf; 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 1rZsSc-0001sq-Fq; Tue, 13 Feb 2024 08:04:32 -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 1rZsSQ-0001qP-Lm for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:19 -0500 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsSN-00063x-Np for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:18 -0500 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2d10ae127ffso6304221fa.3 for ; Tue, 13 Feb 2024 05:04:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829452; x=1708434252; 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=tP5MZohIYd0wVaYtS+mlCIb83dpcfafYILJYWOltnx8=; b=NR67svxfy4CVQ9Y3Ufhe2Buu/SXfQph6ViYpwJz9gf3V/ro6EAfhuvsjsTrjF12rK7 Yor3ZLaRqDJuCKuazcdPzojN36oyMXQA0VcOFVxxpkApw/ymarkSKzs7iy1OpxhpOwe0 +MgamQ/jI55QVDcCu9jll4t5cehi6XxMGcCe9IIed/XBMaU2HD27VTeB9RIAWL0JJM7Y JiPmdw6DCTh37skgELUK8DTz/MpE/EL6zzHu2i0P4Y+qGRKFT8CTGIC5bOwoa1z5xZOk cYtvntN3xZAqd+dBSyUMpC3guDyzfvsSsc4XddQjRs6qGFx0/zOveyPJx/OcxaH5q7VM VRNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829452; x=1708434252; 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=tP5MZohIYd0wVaYtS+mlCIb83dpcfafYILJYWOltnx8=; b=q3h6HKA8dAdakW0aWLr+Nc15ydzejM1/JYDBcYbOoFZm2cyAa9HVuG3RXD8pRcA3jW ESpc7g7j6t1yMvmIXAl+miw3QUMYlgGNjQUeUHkSB+Um2StHOV3ruZHtpWQcQIW1xxrd vnrih++jccbRAL0JZiW+Nb3uQVqU+rmJSulqU6UNdOucJAnkYDdJIGfHYiSsf9W6SnKB GGvdNLzD2JsPnm+gQwJGL/l2LZz4odha39y4oJVR7fHaa2yfdb8WOUGCHLPZLvwaQ/Kg HSXX3H/138QCkzLTQrD6xrLIaSSgY4+xxQCuWAVZH26tP77y1suFThTG1lTKRIC9kJ9m 8IGQ== X-Gm-Message-State: AOJu0YzlfjLgRdZNxqQpmKUEYoAAyhSr2jpYFsWLWwjzG7kI3qSX97Vr e0DnUiIyBV1mOWQIgyvgcEchL7N7O0oR7cjDgXnM+PxXgcleh/7TNmr4svnzPI7PwWbeROHL1Xa g X-Received: by 2002:a2e:b8ca:0:b0:2d0:ce3c:5848 with SMTP id s10-20020a2eb8ca000000b002d0ce3c5848mr7125795ljp.51.1707829452257; Tue, 13 Feb 2024 05:04:12 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUNc/1kZ+RlDRWhqliOhyerbcazasaX8PwLsgb/PcmLCzq5tltp5lVOb+0w+3h9qgI+39eNzsHMTrXljpK4ukoRvR9WyKtuY761oWVAL0MDIjcTRPqWwjFpvLmB8H1gkYc7ZKwd2xmfC4BzeZlhZyXazUXCrQc/3a61GiCMxYEOY16gLQTRQeLYaY8bvLJ+Y1l3qcis11l9D7y6CPc05llooWrVnYVQuCklXYDzgPiPtzaJqZXaKeGOC1KH/YUwVs9gC6F7K8UvqPqShtyaMM2UCOGWb8C6tFBW7Y2ekM1UbS1ycYgo7wjp/sk38rhA8nx18k3Th4LyA/KWdrK5fBSdIq6C4czoTAM2Hj793qc5ErovfhDNPPY0EuHyMl4pj1ZmOiapsTMY Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id jv23-20020a05600c571700b0040fdd7cbc8dsm11631611wmb.47.2024.02.13.05.04.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:04:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Marcel Apfelbaum , Eduardo Habkost Subject: [PATCH v4 04/12] hw/i386/q35: Realize LPC PCI function before accessing it Date: Tue, 13 Feb 2024 14:03:33 +0100 Message-ID: <20240213130341.1793-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=philmd@linaro.org; helo=mail-lj1-x22c.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Damien Hedde Reviewed-by: BALATON Zoltan --- 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 7ca3f465e0..b7c69d55d6 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -248,13 +248,13 @@ static void pc_q35_init(MachineState *machine) /* create ISA bus */ lpc = pci_new_multifunction(PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC), TYPE_ICH9_LPC_DEVICE); - qdev_prop_set_bit(DEVICE(lpc), "smm-enabled", - x86_machine_is_smm_enabled(x86ms)); lpc_dev = DEVICE(lpc); + qdev_prop_set_bit(lpc_dev, "smm-enabled", + x86_machine_is_smm_enabled(x86ms)); + pci_realize_and_unref(lpc, host_bus, &error_fatal); for (i = 0; i < IOAPIC_NUM_PINS; i++) { qdev_connect_gpio_out_named(lpc_dev, ICH9_GPIO_GSI, i, x86ms->gsi[i]); } - pci_realize_and_unref(lpc, host_bus, &error_fatal); rtc_state = ISA_DEVICE(object_resolve_path_component(OBJECT(lpc), "rtc")); From patchwork Tue Feb 13 13:03:34 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: 772308 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp241993wre; Tue, 13 Feb 2024 05:06:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXHJzVxINvva6VlRznPC2WYIWC4oPlSmZY3DelF/UFMuE6qNM/6Q5TMqyS6hgLzxzr+l0uQf3JfEmqjgZInalZK X-Google-Smtp-Source: AGHT+IEg6S7k3nXCVWCdEb2KzRxhgYSgWUvfGFjfyZX3H3TBxjh/d7Om9+9vo8DXWzjXXUnY6I0Y X-Received: by 2002:a67:fd87:0:b0:46d:3e3e:c71f with SMTP id k7-20020a67fd87000000b0046d3e3ec71fmr7910427vsq.4.1707829559948; Tue, 13 Feb 2024 05:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829559; cv=none; d=google.com; s=arc-20160816; b=xSLJCiHiiKge5riPkYGPt4lP6lTs+TUat3CSIJo3FJoeddHcaAAOFm5VwOTYZgNsRw Z2OAa3Uz3tekd4Z53S5hXDJL4JVmiL5NT5FMKmAgqd+85VHD/3r9C0pg2488p4MeNgpM pbpNItU568MTscdcMuo4Djwv/9z6pI/ii3XQOayGKMAluAJlxb0SLkGkyl7V5+Av2H0j kYvfz7qi5cPzVWYyprEUUa+ioXjszrjY4lkzAIdSt87BJL5tEYnLruePrcZLw35uIWq2 /OSkNBQQ8AE5iVcFVZZHtuqEubSsyiBCqfBOizoHCAPwNLKRNb+xgUazV7scdr3CVHt1 XxrQ== 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=O7zS4al2xd0Nh3hgWRIRyTwhfz5nLFlDSJ2u8jBzRpc=; fh=GwMoGFNbbKjxtur+XEdW6BGj2snBYtnWOYKACNhO/UQ=; b=YE4hWDIy9zNepA8Cw3uwft8yrnV6WnSxF+76En3Bhcyvk/Z0CpgBKe0WiCui5Vd9On Dc/pAg4CKzSJ8SycqOSYf49qavB6b9N7QnKyLgvKzBeqlmL4LopsX2PI8ysc/62o3iLN jWHVFcTZ4wRqaPQ44AaW9JgQ8OkDKfWnBlMIhLvtVhDFQlfDB01OkxQUuLIm8Ag25RwH qtybEygoIlxV2FdANIawjXpyNACDzZZf3Ntikj+pcyMXXXr2ZaRzLpu+Cph8FKj0eWTm JA+haAfSkEepX4c7o29HuuqVDQ8X2oGa0XzmIwuBTZw4DzHgiZC1L26r2scsOVubpBUt FT6Q==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pfFhyoS8; 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 X-Forwarded-Encrypted: i=1; AJvYcCXezHQsOy90vt7NhIA968EMuu+8WssrP5y490UtvcAoty6AObqN5dtR0PnrrkVaD+HieWKDyxlOoMUrTkxsDgiT Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k3-20020a056102082300b0046afbbbd4ccsi971890vsb.34.2024.02.13.05.05.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:05:59 -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=pfFhyoS8; 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 1rZsTl-0002dY-Bj; Tue, 13 Feb 2024 08:05:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZsSd-00020H-QT for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:32 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsSZ-000658-QA for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:31 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3394bec856fso3155776f8f.0 for ; Tue, 13 Feb 2024 05:04:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829459; x=1708434259; 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=O7zS4al2xd0Nh3hgWRIRyTwhfz5nLFlDSJ2u8jBzRpc=; b=pfFhyoS8RBCBOz+qNft59s7Rj1NCwwvIZOxPlQH5hJPfp2ViXevRuFmvYgXzUBgiwK +BLRDe/2KysYGQnpg+kHqEFgNXPeuaGhmofOXt8lryAirax9YechQ4fBY/LJFoRxKo6b mfnTCAP7Bz7XIMfrTh6GEQYAcC4jJPMdKBURlt2EPaWZtbcPXHVHRDrFvhsxLvrBddd9 mlIUi7F08GxDVpTyz3Ptyjf7LtCfPrxbglpk3obFasve0zR2fuvsGTBxsD8SKQN7am80 dOf2F7VtDkfmMvyzIGd8nVKqtPyKG+qUYsuckeIuog8nwTQUOy9Xh6p6HchiWYoSIYHN 09CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829459; x=1708434259; 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=O7zS4al2xd0Nh3hgWRIRyTwhfz5nLFlDSJ2u8jBzRpc=; b=m5SuRt+DqvoLSKaCHi98lTKX2WsfbMKUZ261D/PMeDWD4Trxx4655i1Yl1l6FXnnMU tWM++exigEAdGpUUt+PYSGdtHutM7Z//CSENO6CJxU8R4kfGKiQyBvLpZdThZXZHy3wV UIBZWhDGE1dUVOFvRNAE3f9fw/HO87w9wAGYXhfVbd1S3A7/2pnVOQ0IfdlZhHdsm7FR L28uRlfZvRoh4o9FjZWthfujP7i8ozlPDv9P6TbaWgBWsVqFtX76Leej1/ZQfuLKaNvw 7CIhy698mUA7T3un7oRS7LKEDlsfKCxQLfa+DaTNg3wZmX10Wtu821JGYF6BFsw0RL+k 3OuA== X-Gm-Message-State: AOJu0YwlBvCWlKoA3ev16K0UkPku8WopT0QmiGxuEFLpkZIdOX/bD/Yq kmTv/oSgErOoUTEei7yZEAVOXC8JP3imIcDV2iiKGlium09UpBbMXbGlMFNsZRy9wwgvZDdFNpC c X-Received: by 2002:adf:f546:0:b0:33c:d852:8e50 with SMTP id j6-20020adff546000000b0033cd8528e50mr1575682wrp.6.1707829458921; Tue, 13 Feb 2024 05:04:18 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXZDPnYR47Ipvqgf5m3G/oOa0hCnEnYFyBtQ+VtnT3GFQRxp8s4QVzZNacjJdQ3pCTbza38kssUxzg+11QrvQCLNzVw0yQbtKYVWNXuDlL9s+W6TTn45FA32DooHtDvv2GxmHOBuUrdp8sn2XBO4YftlhVwhL1htVzAaT+jMAc+5+tgymwwW3BUxmlRmj9yv1FLP0ZIZy5Syz0mJqMC0ezOJu1ACKKaxVtHfp6hm4HvWH3h4+bR8nEfjAPQDBpxadkhHIxa91h/i8a4IEaIWz7Gl1v7QQNi5cSxWveCK7HTDnn6JbLIrT4V+cs2v+FOK3woNsph/e3LahuGkAWty5xQL5fINpOMotMi0fgYZ3s2KukEZUcU0bKXTmpbxn0CFlIUCJoC02A= Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id bj8-20020a0560001e0800b0033b3ca3a255sm9529863wrb.19.2024.02.13.05.04.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:04:18 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , =?utf-8?q?Herv=C3=A9_Poussineau?= Subject: [PATCH v4 05/12] hw/ppc/prep: Realize ISA bridge before accessing it Date: Tue, 13 Feb 2024 14:03:34 +0100 Message-ID: <20240213130341.1793-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Mark Cave-Ayland --- hw/ppc/prep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 1a6cd05c61..4eb5477069 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -278,9 +278,9 @@ static void ibm_40p_init(MachineState *machine) /* PCI -> ISA bridge */ i82378_dev = DEVICE(pci_new(PCI_DEVFN(11, 0), "i82378")); + qdev_realize_and_unref(i82378_dev, BUS(pci_bus), &error_fatal); qdev_connect_gpio_out(i82378_dev, 0, qdev_get_gpio_in(DEVICE(cpu), PPC6xx_INPUT_INT)); - qdev_realize_and_unref(i82378_dev, BUS(pci_bus), &error_fatal); sysbus_connect_irq(pcihost, 0, qdev_get_gpio_in(i82378_dev, 15)); isa_bus = ISA_BUS(qdev_get_child_bus(i82378_dev, "isa.0")); From patchwork Tue Feb 13 13:03:35 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: 772306 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp241969wre; Tue, 13 Feb 2024 05:05:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzKehcgndG58ilDmj8LOKiCOHbvjKg8ol79V7+hD/gMdJ4PV4UMu2cELMNDFIXsooj1l43 X-Received: by 2002:a05:6358:921a:b0:178:f497:ab3f with SMTP id d26-20020a056358921a00b00178f497ab3fmr8162097rwb.14.1707829556487; Tue, 13 Feb 2024 05:05:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829556; cv=none; d=google.com; s=arc-20160816; b=T4b5urztSy3GOfC4/0h6byIW5YeroHGApyXJOXt1P4qh9VYg8NJCEewClG47WKGg7i KmfRfgVpUU66PeIkQXDLwcN2+j/54Qu+IpwDeMjsg9JsyayNscmx83VS8W87V+FW4DZe RjqU4sMMfQ8d7w7VQw1pE6EQyTuKg38bpaEFPxw7NyqzaU4C4PSND0lSZLveoX6wfEuc 76pza0AGbE/HNN8yT+q4YEJIqH6/Gfto/pFU3EUTz4q+BS21XMFpV5cW74Kuz8o+AMb8 8Lm+l3rt0ADFGuVp7Gup41gybX6g2d+j1ihpdE8dpnsx8FTN6zHg/vJpiZDJOUR4CoBG JgoA== 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=KjkB+UnEukm/G3HfYj7xftramerJL8Ci1VN86IlC3EQ=; fh=HsMxguKqC9L2sTUyTHdJ37HBU1V1ryMBLydgQCYEN4o=; b=g+Fh/m1ccF4vxdLNcPMVm3HXfpmqqbj3kTjviMw6mvNgvLjqtVUzkBrkIfaM5mZT9P 3iOvZTNTbA0OTKhaT6smmwpWEX+pWfwSBU+lYOyyetF7xVE78kEki5H81xwpTIpjvBrT B++6RFQ+Ya9kRUcjUvskEBcGmqUNIOSRMlzecIaIX4sfS0q0380+bUJh4z4PA7oX/8BX hgUKPmdBsShM9Npoy8kef2zDoRMABj3la/jgNyKPT9a4/l8rWQLC8qj8ev/FsIDw+yIj S0euw3i7hhnYh4zlptPpH4QjEQu36sOWl2qD/wwu70BmGjwgwsetRoi9bv49aJWZyBtR 4CAg==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zLix+y+h; 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 X-Forwarded-Encrypted: i=1; AJvYcCWwx/p5Vk7XXno6rzfn2jkbnzYGEc9FutK0ZD5f9qmyt9x3klPjqK7tTaE0UTiU4OCALXWGrJKUxplEMsGUGsTA Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l21-20020ac848d5000000b0042c06c5df98si2487299qtr.255.2024.02.13.05.05.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:05: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=zLix+y+h; 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 1rZsTu-00036h-DV; Tue, 13 Feb 2024 08:05:50 -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 1rZsSe-00020Q-PJ for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:37 -0500 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsSc-00065V-2X for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:32 -0500 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2d0b4ea773eso56678131fa.0 for ; Tue, 13 Feb 2024 05:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829465; x=1708434265; 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=KjkB+UnEukm/G3HfYj7xftramerJL8Ci1VN86IlC3EQ=; b=zLix+y+h6M8Mo5JxlojlTgkM2DJHY2Wp44kxEJBy0913n1yBIHyJBYwC4SAc4f65QV m6LV72+hDbyGXapG4PAzHyV1NA6ifEZEj5NZpvSqEUu/hTXmyvQ1TZpBtoa47M3oSyW1 GVXNR6cNmLmXuxWFvQL8OdVrxAdVGCyhYwb2zaRPyTPRK0kDnQYygjBwq0PcWeZbXdmu HrslsdBx+5svjv10dw8C++H0kgfKlMBR1zHAydOliw7Z7e1A0dP0JS5SEucEsGfwKM94 02WVFYTj7RbgmOpXgNIIJYXsmWnbGl4nURfOz1dmKv23geqyrPB5EiddQmPs3gYFWcI0 lpjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829465; x=1708434265; 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=KjkB+UnEukm/G3HfYj7xftramerJL8Ci1VN86IlC3EQ=; b=MAGHtiiY06O6hdDRaAqLv4dly4TzXq0P523HpCgYCC9+cl3zPLNeR94fWwuvp46Np1 6ZnnS6rfxL/07xb5iJwRjh2xPlay+Mdc80WZTy5uL3Wdd1A0uURZmZkf+SRAqMUTjn0S vUI8qotxmLwJW5hfSa3siqc3Kggb1v6jYmoAdZgaqOg9sECKfe2fQDGKZzUWDuRosLOf cNoDwnjflwXYLrFT1OCnjLPvp5Cm1bNuCUz26rxKo0gGlwRgWvfTrt5rCOQeFqMuI5w3 PIWcaZwFLbYAoELG++aqK9B0eal2nJOrOOE40bBioExswETWUtqWMw8Mo2Rdq1cfldWx gPZQ== X-Gm-Message-State: AOJu0YyLMyX3vOEy9TPAg+EFEdLbTU4xXBsVYPQkMmE7gIU5IYKsw0so WMT67WK5vYKZ0nEfWAVvWN8xtJfp0QX0yMdYfddRTvQW2h2ZfXLV+L/2jniXKa1ScCaCM70JLOd l X-Received: by 2002:a2e:a615:0:b0:2d0:698f:1fb with SMTP id v21-20020a2ea615000000b002d0698f01fbmr5797890ljp.5.1707829465497; Tue, 13 Feb 2024 05:04:25 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVdOCzsYTBBK7kPOb9KwFlrPl9+/2764GRmGdTqaSSS1tmSSaFRTKYDcQ/TzlyIkOItZgmR6vAVlr/SIAXXUHtK6C+mw/6xAT3jrXMK5xvqwnnA2ngWuaYefelaA6dpX4QTRuvhlxfw2OVlvcwzwBNk4NwKX+qifcCgg5iskJRgbgNn54GZjjPe6P/KiuDjhSPIO1Hg/X5lKyAEM1QdFujDcVmxeMVW/hfN4JJvKWXg7N5B09K5855vCsVCEafvJonZh4TY0C8qa7/UKAY8i0KgReY4UHe15nb6SSr85+Tt8eoeJarNtAeUt7YSKwI/X8b1Z6LGJG4= Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id h11-20020a05600c314b00b00411ab6dad65sm2948681wmo.29.2024.02.13.05.04.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:04:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v4 06/12] hw/misc/macio: Realize IDE controller before accessing it Date: Tue, 13 Feb 2024 14:03:35 +0100 Message-ID: <20240213130341.1793-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.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, RCVD_IN_DNSWL_NONE=-0.0001, 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 We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Reviewed-by: BALATON Zoltan --- hw/misc/macio/macio.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index c9f22f8515..3f449f91c0 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -123,14 +123,17 @@ static bool macio_realize_ide(MacIOState *s, MACIOIDEState *ide, { SysBusDevice *sbd = SYS_BUS_DEVICE(ide); - sysbus_connect_irq(sbd, 0, irq0); - sysbus_connect_irq(sbd, 1, irq1); qdev_prop_set_uint32(DEVICE(ide), "channel", dmaid); object_property_set_link(OBJECT(ide), "dbdma", OBJECT(&s->dbdma), &error_abort); macio_ide_register_dma(ide); + if (!qdev_realize(DEVICE(ide), BUS(&s->macio_bus), errp)) { + return false; + } + sysbus_connect_irq(sbd, 0, irq0); + sysbus_connect_irq(sbd, 1, irq1); - return qdev_realize(DEVICE(ide), BUS(&s->macio_bus), errp); + return true; } static void macio_oldworld_realize(PCIDevice *d, Error **errp) From patchwork Tue Feb 13 13:03:36 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: 772311 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp242802wre; Tue, 13 Feb 2024 05:07:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXtgMSqRRby2KCGetSpGA0DVf2n2aV8WTD6Hs79/xAp3e36aQ1E6/NIDSHAV5d/zBaqAYekDi21MhblbhLTzZzs X-Google-Smtp-Source: AGHT+IFw7aAxT4YFMAf/jxbltzy5rI4sl50n7IgmRgekuE2m+5ZB2od9pEaMwP/wnXGaR1CVf8Ek X-Received: by 2002:a05:6871:1cd:b0:219:2d1a:90ab with SMTP id q13-20020a05687101cd00b002192d1a90abmr9445465oad.59.1707829647894; Tue, 13 Feb 2024 05:07:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829647; cv=none; d=google.com; s=arc-20160816; b=heT4Hct9NUehjSooE51HPpNy3ZTYULZz3XJoBT9ou64IikvjrwlY19xMgWQbU+Jcxr lk6Tp/pUt8GBNfcvZHKiV/N+0uLB4CZ5hxv6WGtcCZC6kw1xSnbjTxTGtuMR6u8RjqUn r3ZQX5D1ptMapyFHa9lmM/sbNWnV7MYACLx4Yxlms4uWDi4fgem5sVExppORXPnxbCav CdWdYuRZs/w1xzuizF0ZQqbmbQw63ErTPGkiG6BkhSMPfEiAJ80Bl4tJQhkn1bupf3p8 wP0SJkYk/VFNy8fMDyY9pzhwV0PlD9Dby1aolcTrQ3teYs+3otQb1u8Hnyxn/S/Kaq8o YRWA== 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=XdX06BDUj7IHudTjK3BG6Cg14kAdsMYjZQRXHg7kqgI=; fh=cHFrOiRxhqmXvvXNqY78z5pSCD8F6gMwE3yuE1EJkQ4=; b=jDb5AJEiUM+2ZBXOWlq3V0tcfVNc5bRruInHQpv0LriRZVjIr9nJrYsL3XeiSjykIz 5H9Mzp3GrAi0kkp3jI2+8NvKeND8tQlTM+Zxxn/Q2HIs3Tstyy0QieM/SApIueWOj8ug nQ88bKLFG8w4szZT4ldye5NmZmPji6ZEUahKXq9jl62vg4GYDriZWSp707kR2pGDnc0S G8hVe2CV/RUBNsThFZcy8GSxPpE7fMaoxlTPWfFzvGNT38BX77So+iCwNLtw/0sE7bxd E09g0Q0DG0QyXHvag3JteMSTBynJgIr7Q+qDOpRq0rxh4mFH+Yr7L8AYmDj5N87ubt58 W8pA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fZ2tdunO; 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 X-Forwarded-Encrypted: i=1; AJvYcCWwJSfEnBhDBA3RvT5aIi1hvHTQOK0p2NJZ06sgbao7a9+Io+RobRO3CdbgJua1f6GILhbUDpp0zfIXDAPfZqjd Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 99-20020a9f206c000000b007d305cc1cc3si1249894uam.207.2024.02.13.05.07.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:07:27 -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=fZ2tdunO; 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 1rZsUP-0004Jg-HT; Tue, 13 Feb 2024 08:06: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 1rZsSh-00023h-U4 for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:39 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsSf-00068I-P5 for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:35 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-411d231ea71so752435e9.1 for ; Tue, 13 Feb 2024 05:04:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829472; x=1708434272; 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=XdX06BDUj7IHudTjK3BG6Cg14kAdsMYjZQRXHg7kqgI=; b=fZ2tdunO+hrdAHlDFES1xg7rcLOJX7jG9vCv3EDmmImiz9xK9HQ04muXiks1DD2TRB qlLT40mLaU6sxI740dpnWHwMowRr7EPEIowjljWj/05xQ1Vhg0C/QtuT5AxfZADi0vol 4bI8bx1B/8xDNYklTrpLzgcEms9ViIaSxkvmchhnyBp6Y2iN0RSc385SEi+vSzePljTv r9vEL1NlEjA8VDOS0k/VhB8U55TgOL3wwIsxY+AqMG2mA1JUSw+v4+DHt0TTqNy9TFYg 3yYZjIrz2+MHti1j4hz1jQTV9cZZODr8copSUzomUSdGW3pqnhHT0ogCF+16zAdJIoTZ HBEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829472; x=1708434272; 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=XdX06BDUj7IHudTjK3BG6Cg14kAdsMYjZQRXHg7kqgI=; b=jDRnZuSovZCZEuNheisEykJM+Ob6h8B0RUrNs35phkKkMdt2vFe6sF/2DiYRiwO2nD 9jNzGQGqcpyVwsB3lDcyzlEkV4SNsiz7oH9w4lwZVfdKN9ndK7eEi7DQoUWIaC/ys45q 41/dW3V3AWShVtfaKyi+X5z7OifnlHkTO8Wu3F5yplIxpt8ptEjgJNLdkE8Mj1unYbKJ zHFnBGg8VbCTKMp/6zmjh3yW8xb6TmWc6SZ+Kv/MA5OeX1tTik/m/EoW5owOaXTwxtMV 9wsgkbk3VJQOBMzkVFTxY2s50iLvcnpW5nAMUFzsLiODY2YppboNZTM8wz90CL7TEoFd Nbnw== X-Gm-Message-State: AOJu0YyKuU/Ai3cai0+fDz4/yoGOtwKIuxjBPnzkNDFtVhvxqZInJK9h 53HQZB60w7OTMqjdUxuBwebnurulvxe0NGSSxCzadxg0tzKKiVT8Nmg+iPNgyY8nXykDF/Qzojc + X-Received: by 2002:a05:600c:5248:b0:40e:f2d6:9dc with SMTP id fc8-20020a05600c524800b0040ef2d609dcmr8400422wmb.33.1707829472135; Tue, 13 Feb 2024 05:04:32 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUmsggy1yIJOq36rY3HLkR7YiiALQSWYffVtLb3oeQTgBWNPByqA//REb0fwW0unXcGXBgO1gZ4uRQSpTlBmdmKwgvP7++Ba+zk2ICnbKNtFOvn/afpI5lzkL8/+Fmm/s5uadVYeujphWYJmC5gBHAfzDc/28HnVNtjz3gSk8DFp6X8U1OIH/DAaLTCYJv0imztbNK+9vO2CNW342PmVrlI0w/Pwb86ptWP6fy2s0OAnmIeKAzT6w8IxN/yyKgqhYXVVn1CEedN5thOZh7aBo2SvQtjvNIv4So2uacO5D1SkQ2rEfFBNaNHDeG0o1aQIjAilXaJrvwYeFnUdnRztwmshDZ5osB03ZgqXKpQOrFmv2ZQY6M3iRrCSLbvresstQt17desvwW/i2S+T+yibG7RJ2F5Z9Jcgs5ts1aP1LSgEAyr9Q== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id o16-20020adfead0000000b0033b4ef142edsm9495466wrn.110.2024.02.13.05.04.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:04:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , Yoshinori Sato , Magnus Damm Subject: [PATCH v4 07/12] hw/sh4/r2d: Realize IDE controller before accessing it Date: Tue, 13 Feb 2024 14:03:36 +0100 Message-ID: <20240213130341.1793-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Yoshinori Sato --- hw/sh4/r2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index e9f316a6ce..c73e8f49b8 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -285,9 +285,9 @@ static void r2d_init(MachineState *machine) dinfo = drive_get(IF_IDE, 0, 0); dev = qdev_new("mmio-ide"); busdev = SYS_BUS_DEVICE(dev); - sysbus_connect_irq(busdev, 0, irq[CF_IDE]); qdev_prop_set_uint32(dev, "shift", 1); sysbus_realize_and_unref(busdev, &error_fatal); + sysbus_connect_irq(busdev, 0, irq[CF_IDE]); sysbus_mmio_map(busdev, 0, 0x14001000); sysbus_mmio_map(busdev, 1, 0x1400080c); mmio_ide_init_drives(dev, dinfo, NULL); From patchwork Tue Feb 13 13:03:37 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: 772313 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp243126wre; Tue, 13 Feb 2024 05:08:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWcGmBuwi7Y2ukKY17E6f4R7K8brGGJppS9EA6ShKYfZ8tHQF7KE9grZNQAD7eUDDi3s+SLx1y+jssnOdvlF+NM X-Google-Smtp-Source: AGHT+IHFp0XaszGa2IfflH0SjZp/ceyGZ0xROPwWTRjkqoyNRSwJFP1W7ZyBwapET1KYhYi61JHJ X-Received: by 2002:a05:620a:318a:b0:787:2250:ceae with SMTP id bi10-20020a05620a318a00b007872250ceaemr900089qkb.8.1707829685603; Tue, 13 Feb 2024 05:08:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829685; cv=none; d=google.com; s=arc-20160816; b=EjMBim9Crq/HfG/1AA835M8XL91G4H4+OFYBjoffIaWWOJMKvBj04rpbcHvTk9knFN wJN7oz+xmlclSRn8LIb/qipix2nIR47wOrEa7xMBGzl5vxWNRNFOnqgJf9wBzt6P0W0H I+Om1K/gOGu5YIMLqrB1SVjv6t2QFLkR1m3CV4Qj6BkUJSYj9zdDf7CKOfvEOMqxHWm9 Vuo+l/bQG7L1BOEs1crNXklbdg/D1SpwJQPtoHe6Bk/oUrgKs/3c6XiCLxpHbCy/JNsk OfWeANL7XFEeVwrwOI/fsuXLSlfmhQFqeuXUwsus4YD8cCoWfndwkmrBLP6mZuxOAAGk uc3g== 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=kzdfTq0867epJMYzdvQvnVDtS/miOKN1SYVhmEO67ak=; fh=1ELaaGsmpvzz1TVwGIdTIjKCrucKrOb/G4bPMIZ+GbE=; b=GdKLIxYfBdCsH0zGEZ4eyKj3r+AQM2CGoGCo4BmjIAO9x9FDwtJw2tYNrbhQJLmEOY xUDCWoOvtwLbURBHT6JXcVNRp7b2L8AyU9/MCFzeQb5VcozKBRJXn5B3efpvuF8YjXqx daMvYDv6Z8fPDyG/sskWd4NTG4sGNO3X3VNFjnczq07X0k0waNohIUhDtzIhVxKqKEhZ lNEPAbwJHt9sxGQ/FQmYLbt/qpjnxnxnUgYDT75ede6CLCdgtr8nYcrNpJ8m372ThlaF I/r7tHoFyIT00KrmnJwW4YuR/kuXzOgRjoJm8hJ1wGKj3TdzeHnF34QMBTnES0R3pUO8 iYjA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="w6fP3/sD"; 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 X-Forwarded-Encrypted: i=1; AJvYcCWYspflxKFlFLD5YFejgzNpXwh6Udh9vyZshSmauba3JOXUUKOv5uQQ1mLmRsSHmLwJvKjLL/LUclxun8B0aVB8 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bq8-20020a05620a468800b007871669a7fbsi2689267qkb.780.2024.02.13.05.08.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:08:05 -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="w6fP3/sD"; 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 1rZsV3-00068u-5j; Tue, 13 Feb 2024 08:07:01 -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 1rZsSp-00027l-HI for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:46 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsSm-00069L-IM for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:41 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-411c93e1cd8so2322435e9.0 for ; Tue, 13 Feb 2024 05:04:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829478; x=1708434278; 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=kzdfTq0867epJMYzdvQvnVDtS/miOKN1SYVhmEO67ak=; b=w6fP3/sDQDdPCliuc7rhwWmIKHhP+0ykeRIAsXhoyxUbtoYauaZ2+/UcqieqHg9jVO N8BVcS3DZaSYeE9XNatnFExHyvbzAU+lVVDWovkN4PGBjc+rUJuVg+PPupN1OXp6n0rG Ot5QFGCbLAfnaHImQri+2631MwmtjHMr1YR+0ojODB7lSgic5+OLnlGdhSfCZqWf9vtK BVQXt1qWlpWoVBIxBUXBJkZKtNVTW22/fsZ+U62XQrpr4zXYz+7h2tlBDDIkjTYIbJ8W FmprHBtoKHrgMxVpzCOoMiuYV1QVIgAWqRwjMe9jsOetECyWh2IC29WT2UKu6gkj9gvE qYiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829478; x=1708434278; 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=kzdfTq0867epJMYzdvQvnVDtS/miOKN1SYVhmEO67ak=; b=Nnz4B36tqnL7oOr34/Bb51keBNmLQD8OnYKSEwq9/saA2CnDkiox3EUKUNJDMu9maF FxUHeJw6GVeeQTSOPFU7gjLKovgFWIJ1bapu70+4JgoDihVMfXQ3FakmbLnNfHnioci/ eZlvtoSQAas/23ksffshdy/DwoIG7UeC+p7iQG+V85gOtNDi46m//YPERBJZIXNz0fT3 USC6MsQ8/N9CLgijEiqld2gx1m/yK6moTOWxesGevxAJj6sSRT6gaTqtwpKeqbAxWSFv EqOFXZ24/Tjt3qCFL8qgjqOlsd1+dkg3O/IuOjdHrinJq2OmPHp1DUojszhQP6IP1T9p 1yAQ== X-Gm-Message-State: AOJu0YxgzQxsYJV16j+JQ0IU5y5q0SdtFzoVj6fQZXVhE3+UOwEfiwbP mJup13yOrZpdkul2BK4S2Bcoau4PMVAkpeOlpcvppIy/U8Jl+Xb/0SWKPy9E3wPhWLcGqKP8I6Q 8 X-Received: by 2002:a05:600c:3b29:b0:410:ce61:8609 with SMTP id m41-20020a05600c3b2900b00410ce618609mr2194442wms.11.1707829478644; Tue, 13 Feb 2024 05:04:38 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUGyK71U+xBG8+bXpW2Gz81GejX3O5t5GAFLhPp91QS2RYXupYGRARBfvf4sg3F6D0iprzPfO1IzjPDLr6JC9afdVNS+7XZnGgzrAV78JMP/QmkhkQMJu20cKk6LTtH61n7JbS1TSOWwtdM/rILg7+WdFy2+vakczaDGbOw50soQg5w1D2uQfI/feE4OxAquZm6AZ38/wo/lXpodAYbiTsx0tvwsucmKORFQ53is2aYybkMhaIHraAG8xxqFli+Bo0KLksMrsaUnBW3Od0i+9CMcI38kF5X1rWEH1BZ3aqaMy2UKP2JtraWQv1N8BVUxDG2fKwXsvCuAsiPJ231+VlOMo2SDlGEC8T9zn/0h2FvDueZjXtkgAZIX6d1tNoUvikMOdnptA== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id bo6-20020a056000068600b0033ccfd57d4dsm2324610wrb.52.2024.02.13.05.04.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:04:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , Artyom Tarasenko Subject: [PATCH v4 08/12] hw/sparc/sun4m: Realize DMA controller before accessing it Date: Tue, 13 Feb 2024 14:03:37 +0100 Message-ID: <20240213130341.1793-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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, RCVD_IN_DNSWL_NONE=-0.0001, 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 We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Mark Cave-Ayland --- hw/sparc/sun4m.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index e782c8ec7a..d52e6a7213 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -312,13 +312,11 @@ static void *sparc32_dma_init(hwaddr dma_base, dma = qdev_new(TYPE_SPARC32_DMA); espdma = SPARC32_ESPDMA_DEVICE(object_resolve_path_component( OBJECT(dma), "espdma")); - sysbus_connect_irq(SYS_BUS_DEVICE(espdma), 0, espdma_irq); esp = SYSBUS_ESP(object_resolve_path_component(OBJECT(espdma), "esp")); ledma = SPARC32_LEDMA_DEVICE(object_resolve_path_component( OBJECT(dma), "ledma")); - sysbus_connect_irq(SYS_BUS_DEVICE(ledma), 0, ledma_irq); lance = SYSBUS_PCNET(object_resolve_path_component( OBJECT(ledma), "lance")); @@ -332,6 +330,11 @@ static void *sparc32_dma_init(hwaddr dma_base, } sysbus_realize_and_unref(SYS_BUS_DEVICE(dma), &error_fatal); + + sysbus_connect_irq(SYS_BUS_DEVICE(espdma), 0, espdma_irq); + + sysbus_connect_irq(SYS_BUS_DEVICE(ledma), 0, ledma_irq); + sysbus_mmio_map(SYS_BUS_DEVICE(dma), 0, dma_base); sysbus_mmio_map(SYS_BUS_DEVICE(esp), 0, esp_base); From patchwork Tue Feb 13 13:03:38 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: 772314 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp243136wre; Tue, 13 Feb 2024 05:08:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IHe43yvRYO1OIwt2+OcmfE3FegnhA8E33/aMk098V1lzA1GJlJlDrZKBK9HQoB07HpRjUgk X-Received: by 2002:a05:6214:4a84:b0:68c:4058:7383 with SMTP id pi4-20020a0562144a8400b0068c40587383mr4615325qvb.5.1707829686781; Tue, 13 Feb 2024 05:08:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829686; cv=none; d=google.com; s=arc-20160816; b=ca44JxGtLwZjOO6mhEtQF4SwrWyjTxFvqpsuFsfkM7YTCt1tfYtqHAL0ij4oiUAiaT smJewhCvg/q0Y8wZ/jOBo+taB+g+r5mlly7HrcckyRYaIiL1ep43PqAkg9E30VSm5/Qd DDLAOUg9wf87+xb6cU/G87AtL/pAqo3jiGy389838otXPEjalmxtIqJtbqbv7QQ7KSi8 ioHZyUL/WCt8kSrHHQe2daQMq5kX95aBvRCpTnS7oyrnBlyM4le5RgpExv8JxWb0JiOF fAn4U1gpD4/g/7UrRLpeDdRlhf5oS6i6rpw7YYIvqvTZwKCGhF1A5UvChgVBHxrLbVnF SPjg== 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=9EBc8uaZJKAVMJ0YtC4KyzGDaHMLrSoGEeS2FgFf5YI=; fh=KRd52AZ9yZltWv7KdBTJJ2rIrEHh6GsA5mCtTGMn+rc=; b=rKKV0PExDjGovwVaHElCn43XVVP9dOa9rkRWQLVoXk773PaZI3aHBHsrL1OtqIa0rw y4U4+ON+hLtazlWhGGr3edjXYbHxq4biyQSzvspxXIOLh98A3LyiAgsgxud658UPRrx4 PC394ZfOYjbxv8LDKTneWVZT4OyYI1TFiWqTZbSSxgh+u1p3/lTpz1gE3g+TYzQrL7sx J6X/D1uRGQivHG+S3iYHWN8NXAJwWZfHifc4FVR9LKvGGAGpNUwgpo+qOY15cyNZ0ooE 7UfOoAvHQXotGkQe8yZSv68v2k7HXGmLAEPYEearv8SOQ/1H1wPh+1ddEhWwUXdxIyvM WUcA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fH8206m8; 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 X-Forwarded-Encrypted: i=1; AJvYcCWzPUZEMuMqwvzt/eLjzG7UJtyauR8MDDRYVsv4y0K+TO2KuJ9UxjgrbhV6GjnSXkcYN5V+dVC6gcQEqu7+biho Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t13-20020ad45bcd000000b006816cb52973si2760306qvt.504.2024.02.13.05.08.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:08:06 -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=fH8206m8; 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 1rZsUy-0005NM-GL; Tue, 13 Feb 2024 08:06:56 -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 1rZsSv-0002A9-Vp for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:53 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsSt-0006AI-Af for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:49 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-411d01eb13cso1266395e9.3 for ; Tue, 13 Feb 2024 05:04:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829485; x=1708434285; 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=9EBc8uaZJKAVMJ0YtC4KyzGDaHMLrSoGEeS2FgFf5YI=; b=fH8206m8iLuD4hO9dwpbnjx6tMSfQ1i2HD7xCRbERlqPrEfnLEiRLKyCmDmLVlJ5sO yghOEgpYrW/7jTgWj0tvN1mXnTfrjQYyy/nCF21rGwkg+gN7/Jr50wRx2QbyKAxG6B7B 1qEr4YmP/36CAWCGmNbMtwGwS4RsTN3I2PJzMfP54zVTTRZG2+w6gs+Eir74yLEzkxrW t9T9T5qJ7Y7iRzVdP35bQzKwHvqgOUjWB5WGBmdamnp5QdNg4zTjRsNOtfGNdnjqWXUg wgqGIhpyOp+wgMFnkfXq+MGJmNTSc8Os6RYfCozzRtPXca0+uNlez2QI6opMz+c+Djhr +iaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829485; x=1708434285; 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=9EBc8uaZJKAVMJ0YtC4KyzGDaHMLrSoGEeS2FgFf5YI=; b=s9zxtFWTQLzYeMDC3c/2sj1JzMbHHpmSvpfgSEVdejd2fr1JX5w+kF/D7rYp+JvE5j U+6aHR5z2UdWDkk6vutllBw6LBmd7JpoEH5GeiJSP16dCzQEo/kvdLZZ6UO8gZ9aBqIL NxqTF1VWq7Fh01cLpCov/wmLYHikWX8eldpsr/Dfu49i0OkGFsG2VcwIrg34xNEaL833 WBn1p2i8mOFknZPKgh6XKuDL5qMWDGTPU1rf2JATLB9dNQJU9iqm6RsLubtGaW7Qe65w +kW9ihducYUaDpMueWp8Ix9ElpFUe8Z1CFPepGXW52ulenP7Z+57GE1qFD8hXoGU7lbM 57zg== X-Gm-Message-State: AOJu0YwNLWY+7ttS8G40FBoKwQSzTgwx2d5eFLxQd676uy0nvHh5FjFM 3alWzKMcBxHD+zprCfI3kqDRRd1wOVZFG/Zv3jEKn/AQEpUfD24QTsLG7qGfXcLG9FURRXovFhh z X-Received: by 2002:a05:600c:4f11:b0:40f:ddbb:73ae with SMTP id l17-20020a05600c4f1100b0040fddbb73aemr8528462wmq.27.1707829485359; Tue, 13 Feb 2024 05:04:45 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXB4Lp6f8xGZoVGZ979xI98mQcdBsW0FVpGL9G6CGGimOTiIwitn5/ww/VWJ1cVnS3DOTx/ienY2QTK7OSFPIjrmgb8KxQobJS8ZbVHDkTXH0CUOIBTwMt1OxK9X6iMyqpaRAfnAEQpYPE25lBdZduB33hotDMfGjeVrSsfDrBE/5nfRrqY7umc72rVSGliocZIdlcjcS3dR/B9pw7yZCSnPhBTvKcBN7vRQKbt7va1J5knyc4k5EykAcrkR37vd880b4M/y9VTz4Zzr6cCjKWsaH/XHdi+t21HFIu0ZVcj9F4rrWPGlIOX107TjXL9O7C/jUaT46FcNTgNswa3ByjoB8y/Svtskn6j9OWKHlM9NvkP4OYJz9WET8poz51UuldTJVFaVi0XiPP5LMTA6lnPw2JPPeUwmjIKMG40cTaO1rNDova/5lwBMgfXKR2S2vdmeFJl2A== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id z15-20020adff1cf000000b0033b44a349e1sm9507995wro.38.2024.02.13.05.04.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:04:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , Fabien Chouteau , Frederic Konrad , Artyom Tarasenko Subject: [PATCH v4 09/12] hw/sparc/leon3: Realize GRLIB IRQ controller before accessing it Date: Tue, 13 Feb 2024 14:03:38 +0100 Message-ID: <20240213130341.1793-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Mark Cave-Ayland --- hw/sparc/leon3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 2dfb742566..0df5fc949d 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -263,10 +263,10 @@ static void leon3_generic_hw_init(MachineState *machine) irqmpdev = qdev_new(TYPE_GRLIB_IRQMP); qdev_init_gpio_in_named_with_opaque(DEVICE(cpu), leon3_set_pil_in, env, "pil", 1); - qdev_connect_gpio_out_named(irqmpdev, "grlib-irq", 0, - qdev_get_gpio_in_named(DEVICE(cpu), "pil", 0)); sysbus_realize_and_unref(SYS_BUS_DEVICE(irqmpdev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(irqmpdev), 0, LEON3_IRQMP_OFFSET); + qdev_connect_gpio_out_named(irqmpdev, "grlib-irq", 0, + qdev_get_gpio_in_named(DEVICE(cpu), "pil", 0)); env->irq_manager = irqmpdev; env->qemu_irq_ack = leon3_irq_manager; grlib_apb_pnp_add_entry(apb_pnp, LEON3_IRQMP_OFFSET, 0xFFF, From patchwork Tue Feb 13 13:03:39 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: 772309 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp242022wre; Tue, 13 Feb 2024 05:06:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVP98DkT6eHMZvcKNeeeumOoC3l+izZMX8k1VtbMNU/WrdunrCS9iK33KtT8mtLht6LDHhbn5J3OWRRMd2QlEdf X-Google-Smtp-Source: AGHT+IGxy0fihTuu66/key3RLuDcfO3h3Vx5JTC1QOGYJHcqozaxiSs5h5oQtQJDLz3cqi6tsITU X-Received: by 2002:a05:6808:4443:b0:3c0:3989:1e31 with SMTP id ep3-20020a056808444300b003c039891e31mr7689145oib.24.1707829561581; Tue, 13 Feb 2024 05:06:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829561; cv=none; d=google.com; s=arc-20160816; b=UVmDIIbBdEH83NEE2fFSSt/5vjTEd4xlWOdd27C2SYT2Lyo8+kFSW8aP73RxrxJtNb /3lYtfa0OPDYuCA9vTGq9UJ0AIiS+B14HgQE9aErrJOphdIrDZA8GiNjwocojci9gbSl 3EREcfRd1TEWWt5H+LJC1z4O55NjhqwvE3sfWh4R9XZjr32m1KzOAgyyS8PN70C77a7y JT4TTRS7kYG034lMbw0kHYYaA2trplKSdxDyNi3Qavx64c3cPZwxuhCXGmYmqhQ8UiKd 2iRErY4yEhTXjEZor3zUEW6GBvbdyKXOxWE3Dq1eIDTXJCNhlQsPJ5j2q7LpTSxPFkRE n9Zg== 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=z6tfNfgtwQJ+hKgvVWTuaRcXckGlcPh4xersidzU6i4=; fh=iZkF3mlFo6e20rAqU83WBOOj6aAYz+1VDcfPOB0ckoU=; b=jQp9uM52QZYksZRUY+qq0O2bbFC7YM6UrUMTeiwXQEeau37dlGU8ZT1ML+mFvyfhyN x5lI4qCLA2sQ6uF30bC+hh00HGg2zrwZcXu/OVhq/sU3tCoCfcj3zloplKQTfQjhXQ4c Z9NeEcqClFP2DQtg6awQS3Me7FxAt7dvBrlMT42lAVbBXmfD5J70qbAC6y7+TjO0sgdm w/Ar8EZdLTd5nDXAdsBjBmUoJfHeK+oLkKJZIIgszs3XxwY6+7aZo5WlgjlMPMU7KbBl +xXCQJ7ElxnUDzz4zAU33Ih3XvLhzwVl2DqkVuLM+nJWiED2JW2oYEwWRll92zxr0Lr/ vr7g==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YkSPYmbC; 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 X-Forwarded-Encrypted: i=1; AJvYcCXmKeq3pmwHI3f43dcziChfGZLoQDybJ90UCS6zSRhfe7dME1aD8mrYfdVuKylF7pKlLWtkuyGoyhh4M3yosuyL Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v6-20020a67f1c6000000b0046d1fd68f9bsi896294vsm.414.2024.02.13.05.06.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:06:01 -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=YkSPYmbC; 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 1rZsTo-0002sV-3n; Tue, 13 Feb 2024 08:05:45 -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 1rZsTC-0002OJ-Qi for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:05:15 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsT1-0006Av-UJ for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:57 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-410ee8ed659so12533055e9.2 for ; Tue, 13 Feb 2024 05:04:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829492; x=1708434292; 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=z6tfNfgtwQJ+hKgvVWTuaRcXckGlcPh4xersidzU6i4=; b=YkSPYmbCPqhT1HusDd2pSu8APVMTkTnUMh7kL1qmXsSE7PJ/HRWHFdAThgAc5HVVG8 L4cOdrfZzfu55saBA5U/b057SJZh4UOgDQwRhtVQJfYsU2tKWOxH66AogRjkGJdDO48a ZxEr7MzKWJtRHGaOJNAbZ2JGdl+SDs4Pwyo7Q4xH7QLP9AXFSUWKQW7kBLi1x3np5xtb vw3JHLcTE/QYR5pZkD350ZpGfln4cNL6ltv2LUr7b1bBOo2z5xGI/fw56xcyafmQ53d6 TTlV1t9lKaq1qPrYtLjO4L5h7fyYNQx/gkGV8BscRF1RxhoPyzoerz0QgOZXQPLEI1cP i+HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829492; x=1708434292; 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=z6tfNfgtwQJ+hKgvVWTuaRcXckGlcPh4xersidzU6i4=; b=w4mr0ISSTlpmeBxprOqsbH3JKkL45oVAGRgaWor05FJccqirbMgtYr6mqll4wQvg5q fTF+8j9pYNYrDXg9z3DxnGxHJKr9RsC38tLpH6c7sJLwX/YH7nTsfhkOgP1hhOQgROal F9lIBfumJ5bhiqgXEceXuQiQVEztZ3Rp/6zvG3VoKzdsgoPWASIZgttZeIyA3DTFlUe6 +w9tHEFBuEgOUSnK6gJqGDwQhUlVpllXn8Ucp2lxBetSsFtChWhZIQ8V8cWSWczg5G8d 7+jetNQbO60UrAugsp1q91Eu6f3YyIq9pCogBaWQ3Eg1toHcjJvyoaKfgbpKR3rv/A7B w3AA== X-Gm-Message-State: AOJu0YyG0HRmbRs6vOTXVfk9wG4kvaNjF0OG01NV0E5otxeNgJu2Hbu+ W80KRWslzrgZclM9+t7J/GbU0EhIjBB6UWNwPtude5sp7WbyiASWK7npmkoY4omDfWuna2HNnXI B X-Received: by 2002:a5d:4983:0:b0:33b:4197:75dc with SMTP id r3-20020a5d4983000000b0033b419775dcmr7441418wrq.14.1707829492124; Tue, 13 Feb 2024 05:04:52 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXIy9NiWKWjD7X6rhHNGIGXfQxWWDNj25dx6yV4jHNbJvWHLjJojgRgYlprKIwELly0prPoQL3RkBP+fqsCdfdjK3Q1nDGueh5P/NNRakLV1Qfd4DQG3SzS1DtPbFkMU93l9ylXa2nMc5h7XYQS6mXdp74YCVTafjasKmsvtPeffy6bau70UyDukGX8YIBAivjYU0ZCdd6iW2ZXJom0nWzWu4+V9AfvjmCI47B+FSmYtO5ZxwKc6OOY/LnVCW4rXKrXe2O2l8qkzE9bBTCI38UxOS7hMrWT3gpFhoHs8ORQrfphD5TXHo9AqsfREaXoixGkk3rBf2X/qSShXgrYjVBpzU8aFBzb1CjVQQfnsT2pVPQgnqt+jbUUxHzOY/6FgSda0m4G4KyAIiHcFsGQAy53Jr9CyJFyDVmXU5I= Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id x8-20020a5d6508000000b0033b1b01e4fcsm9553815wru.96.2024.02.13.05.04.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:04:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Fabien Chouteau , Frederic Konrad , Artyom Tarasenko Subject: [PATCH v4 10/12] hw/sparc/leon3: Pass DeviceState opaque argument to leon3_set_pil_in() Date: Tue, 13 Feb 2024 14:03:39 +0100 Message-ID: <20240213130341.1793-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 By passing a DeviceState context to a QDev IRQ handler, we can simplify and use qdev_init_gpio_in_named() instead of qdev_init_gpio_in_named_with_opaque(). Suggested-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- hw/sparc/leon3.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 0df5fc949d..d2be900988 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -175,9 +175,10 @@ static void leon3_irq_ack(CPUSPARCState *env, int intno) */ static void leon3_set_pil_in(void *opaque, int n, int level) { - CPUSPARCState *env = opaque; + DeviceState *cpu = opaque; + CPUState *cs = CPU(cpu); + CPUSPARCState *env = cpu_env(cs); uint32_t pil_in = level; - CPUState *cs; assert(env != NULL); @@ -193,7 +194,6 @@ static void leon3_set_pil_in(void *opaque, int n, int level) env->interrupt_index = TT_EXTINT | i; if (old_interrupt != env->interrupt_index) { - cs = env_cpu(env); trace_leon3_set_irq(i); cpu_interrupt(cs, CPU_INTERRUPT_HARD); } @@ -201,7 +201,6 @@ static void leon3_set_pil_in(void *opaque, int n, int level) } } } else if (!env->pil_in && (env->interrupt_index & ~15) == TT_EXTINT) { - cs = env_cpu(env); trace_leon3_reset_irq(env->interrupt_index & 15); env->interrupt_index = 0; cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); @@ -261,8 +260,7 @@ static void leon3_generic_hw_init(MachineState *machine) /* Allocate IRQ manager */ irqmpdev = qdev_new(TYPE_GRLIB_IRQMP); - qdev_init_gpio_in_named_with_opaque(DEVICE(cpu), leon3_set_pil_in, - env, "pil", 1); + qdev_init_gpio_in_named(DEVICE(cpu), leon3_set_pil_in, "pil", 1); sysbus_realize_and_unref(SYS_BUS_DEVICE(irqmpdev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(irqmpdev), 0, LEON3_IRQMP_OFFSET); qdev_connect_gpio_out_named(irqmpdev, "grlib-irq", 0, From patchwork Tue Feb 13 13:03:40 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: 772315 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp243218wre; Tue, 13 Feb 2024 05:08:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3nAiPQrXNVgCeTfFkUHIS1fUkqUFI1DdK63CRC6j7Qu4ebINs/5H2Yjmy7Q65drPrMNzC X-Received: by 2002:ac8:5948:0:b0:42c:5d73:eebd with SMTP id 8-20020ac85948000000b0042c5d73eebdmr13505432qtz.26.1707829695111; Tue, 13 Feb 2024 05:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829695; cv=none; d=google.com; s=arc-20160816; b=nKgBiHft/mA6d3rdjkJSgPUPYZ/tbuhj351hosW7BTWJqG7QDPEtPlOBkXDaRHvZuS MNlcdS2vIrxKukNzUHiU3YyZfrIXxangTvLFxQOEddkbq4PmPvPDtb0Nn/j0SF3IYr1V FNawa0WAfJYbJTT4jGA3bnONFkTuQi5tq8wzSlVFM4bDi42pkAy4m+dIy2rnx1yFUYY1 sN3r9u3vaZNQ4n0qve88Kw/WU6dPTKEieYSBNMfw1REtXbl+TvW1YJzUXeN/WUYuzcYA 2KbnSo4lD47n+VxZGPP8u1QgapdiKICh0lTNtwJmENgBaV6GetvXp6xJoxLawETd04Z9 dpQQ== 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=X3G+vEW0xvfxGhbxCqdv/Jy2lDj70Tb0WDMAzSbPYcE=; fh=ic8aBDCn53kZHE/bor6ZbTkUSJ6je/AAw9+qEpM3pLI=; b=fkfXtW8u1BtHrIuJ+6FIm1tz/rkmtYyKyJ8HbzUU5kzqos63QRlSAaACjPkLdxENTi /ZOK9GNkvbcT3b/7lr1okR1SMDYFKaukI580j8uUFiHYXdqLsIozj/31EVDk90wsttTG CHmjbj9q3bFPpgTMSob6OX+6V9kIzqzRijP0bouNBqct7VOdW9EyUX8ijTOx0oaKpcD3 UjFamqwVVnMaspLKWcQyhR4nBDrGqMJHKwCGHsKr2Q+aJxiUEnRi0Us40uXRz+HA7owo VnkzGxT76vq60aCwf2YoHf1xKPlPYuuYWRAp2FHV9zaR1dTSSGfJLiWBVTABwKglvm9v JUpw==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gGp9CFuD; 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 X-Forwarded-Encrypted: i=1; AJvYcCUBR6/9wpRzseqwfUsXDBdP1vliUZM4c9EW2QawCsoqeJWRttkhvOKtUXo8OgGe+/e8GnUUMoNnV9ICMEXn0lZl Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l10-20020ac8724a000000b0042c43231de8si2605972qtp.153.2024.02.13.05.08.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:08:15 -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=gGp9CFuD; 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 1rZsUD-0003xI-2S; Tue, 13 Feb 2024 08:06:09 -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 1rZsT9-0002Tp-Nb for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:05:11 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsT7-0006Bg-5j for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:05:02 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-411c7359e35so2982105e9.1 for ; Tue, 13 Feb 2024 05:05:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829499; x=1708434299; 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=X3G+vEW0xvfxGhbxCqdv/Jy2lDj70Tb0WDMAzSbPYcE=; b=gGp9CFuDM48uzgJgV7N4hAP0MXGegQGckU5j4lC/4alqBRcMd047e1SithzWnSByhN ulkM7Z6hlnys0x4ufGSVqluVZp3yJV3zIiGr1FI7jDwgO7XeCvc8XmprBbR1fkhFmguG HGHqcJ4OkDech8qPPc5642++TfNc8AzhuDuMBdx7hCfJqb1IVjXf0uCe0weJcJoGQwy+ LZC22zwDe4QTpj9VC3rQs9HcJyuKv/83vlAuFtdhc5SDas4yy7AXrSsWs+qn9j+poVlV XbZr58JDyh7NuNxNM5ww7Ati6DgWL2HbzgTUE5ORyf18qLVZj2vTxlHAgz9rTNq40Xvu zQxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829499; x=1708434299; 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=X3G+vEW0xvfxGhbxCqdv/Jy2lDj70Tb0WDMAzSbPYcE=; b=Rwi4f2JOfHpb47vSwsnFe2J1dxIVypYjJC6CJi8Kz/wxR7O8KYi7cH/DMhpSCx9a/x pfv73OtmVg/sbuTsAXJ2MBpy6Ek2cAtjVLOuLn1BBSh+HbWw/8olB/1ydfm3YN9UHRa3 KmUepPtIyFgcf9Q6xwLTdEMUFFM4e/h8Ii1AOGafeJWOKXdTE7EHHWSfciK1LyyAA3T5 gl039GqskasGLfreQkcy+YA8tkSit0ZdYuo1kzvXFZzdLZa8JnWh3qnqzT/T8hn9B6cI TSWN6+v4ECbaV1gXMbEzcnSbOldFrWbI4jTY5YH47qkx7KAT/eZ552M3EY/r1UvZZCz6 AnwA== X-Gm-Message-State: AOJu0YwJ+R67ZAfEcemSAosdGt3Q0/+MxoD579SCfRykjF/vcO0u1AaT vUd3U4u/So8DUChcKQGeyzBc2/LBmNldCFRPz3M374dyqDxEs11SzEAtENGydCa5L4b+8VFHbVQ A X-Received: by 2002:adf:f712:0:b0:33b:4656:5e5 with SMTP id r18-20020adff712000000b0033b465605e5mr7446743wrp.27.1707829498845; Tue, 13 Feb 2024 05:04:58 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUipwOP/ic6f1PTuNgzbwZzkboeUhao/GmYCicaTda3rwMCm0h45lDPBGyEtImnsy8MW1jkyMz4jn5ESyas6z+5A6h8+ToNGavXLrGpXkoBd5TV1KoIlGKeSVJ/wPdgPi9n4TcgfoTACI79dS0OSRX+YcdxJCqZ8q2mvArIiaLmpMqECDPv2LmNkwBPCTZ+DkO4y2jX48N24zr5iwc+7FbqYqTmg9eqhOAPV9D1FcAEKO0n2RD9VdqmPehn3WBfM0TmOqW5AbU1aFeSABzt2NR+L2qP6XvI0FxGz6yiO895HoRMhxuInSyPcKeLrNGIgAJJMsWHysHsvorDKLdhYRy8Dc7FOPV6vG7K7nHmwOoVrgZjfp4w6hdFMyi9TL4MBEjThLTX8g1jksuhnp497vtwA/wI9sqkqldBwUYwPWAh05cZ7UGogf8XOTvR3LiexWWZm2og5A== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id o16-20020a5d58d0000000b0033afe816977sm9465067wrf.66.2024.02.13.05.04.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:04:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , Fabien Chouteau , Frederic Konrad , Artyom Tarasenko Subject: [PATCH v4 11/12] hw/sparc/leon3: Initialize GPIO before realizing CPU devices Date: Tue, 13 Feb 2024 14:03:40 +0100 Message-ID: <20240213130341.1793-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Mark Cave-Ayland --- hw/sparc/leon3.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index d2be900988..d0ff4a2892 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -233,7 +233,9 @@ static void leon3_generic_hw_init(MachineState *machine) APBPnp *apb_pnp; /* Init CPU */ - cpu = SPARC_CPU(cpu_create(machine->cpu_type)); + cpu = SPARC_CPU(object_new(machine->cpu_type)); + qdev_init_gpio_in_named(DEVICE(cpu), leon3_set_pil_in, "pil", 1); + qdev_realize(DEVICE(cpu), NULL, &error_fatal); env = &cpu->env; cpu_sparc_set_id(env, 0); @@ -260,7 +262,6 @@ static void leon3_generic_hw_init(MachineState *machine) /* Allocate IRQ manager */ irqmpdev = qdev_new(TYPE_GRLIB_IRQMP); - qdev_init_gpio_in_named(DEVICE(cpu), leon3_set_pil_in, "pil", 1); sysbus_realize_and_unref(SYS_BUS_DEVICE(irqmpdev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(irqmpdev), 0, LEON3_IRQMP_OFFSET); qdev_connect_gpio_out_named(irqmpdev, "grlib-irq", 0, From patchwork Tue Feb 13 13:03:41 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: 772310 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp242666wre; Tue, 13 Feb 2024 05:07:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+zcXHy1o+bpQaOQGw7LZKDAmJYHnR7mK8snIpRongKiy3hBiGifreXeHnwaqNgZdmubrQ X-Received: by 2002:a05:6358:7429:b0:178:7540:999 with SMTP id s41-20020a056358742900b0017875400999mr11479552rwg.3.1707829630879; Tue, 13 Feb 2024 05:07:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829630; cv=none; d=google.com; s=arc-20160816; b=zmBDdc50PBu/thDF0xF/XrxhNGgc1pw3hPKLp/h3krKMtUkrKRw5tnw/xk8rl/AFCO HnwL+MORPYDXV5dR96OoQV+449aIGqR1B3fplKPTVRK4I1qOH+OCU81KzbLFMPCjypQR NGoHhp4iXtmaV7USIMZ8FXxWB9wua1/+U9ucgFYhQuTuqZVRS369I9F8V7KVqse8zNTN wvhA/8tQcU8zp7WynO8LcuMIS6Mu4S7Hy3YHDFTd7JFdU8ImPkUy/QraoooW9rtL2QHH uNwkaKUp1we+mvc1Cy963hgZwsHBckodVMuEP9RdULCSyZ9L0b2F5EzYG/eG7zQyWl/m KfMA== 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=f0fVvYEwFHKEuJye0m7tE2Ksg3XkzZ7A8P3KgL7X69E=; fh=+G4mpM7+va4a7NR5PWXRFtZ5wAYC9NNdygAClmQ1ErM=; b=x6tf/JaU3FnTGVOVvOsRPbhYk/zw58rXKSWQwQiK2MnWsY7Ko6BUxjBGgSHXeUvVQY axabga1AF3hlIprK7MM59/Tu9lz5g+Wg4MuMFNWFvl27I1z0/rXppUKvMB7w5V7sSBDp n2VLoHkEv7yMsRILbYR7pzrEpLwyMxS4bIC2oQka6ULB30PifeGh0I2JCOmivGVBFsuz zO4lHCsT++picv/YfjaN5jcunAkIxi8g1Os/qjKN1u5PUAfCUhlxAPpinP+iKTxp44ab eKBmHaRUrNS5FQVOZgtSNkB/SLW1LwI5zjbl/2iJQzF/gW8Y6fjN8mJuzojacpXgb4z3 zD1g==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eCkjN2gw; 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 X-Forwarded-Encrypted: i=1; AJvYcCXYqz0IVffK7ZJAl6G2xX94/PBEd/WmkSIg82wLwMt1SDJxFTt+u3hrnEPdW17a5/utkiFQWp9O4hS5qIi2TZT9 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y10-20020ac8524a000000b0042c721831f6si2557421qtn.234.2024.02.13.05.07.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:07:10 -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=eCkjN2gw; 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 1rZsV1-0005nb-DR; Tue, 13 Feb 2024 08:06:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZsTP-0002a2-Gi for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:05:23 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsTE-0006Mx-5M for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:05:14 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-410db155e57so14028155e9.1 for ; Tue, 13 Feb 2024 05:05:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829505; x=1708434305; 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=f0fVvYEwFHKEuJye0m7tE2Ksg3XkzZ7A8P3KgL7X69E=; b=eCkjN2gwIKCunjzEI0DOiStsScxGgI5xc5/ShHoqDeAo96/s9sE6mvTrQ6HGf5V/b7 vaYtfUbeCLslHbxtjTx216PclXWSFlD3soT6Fs6EqcvE5acZRMJQ7rq9gi+o58xZ36PU eO/HqRf9sijzKATZz3M+pB7OQEFY1JZZEBEZJNrc5prLjQb+Fo9db7dAIgkLRi2wzIuE dqyKkXiGkV9PT8fQF1tQnoSEzLAlLFB29DqI93nzZGMXSpZiwA6Kea/w9+KF8LOJfDBS ZhONTIt3oUUjehp3EcNhiwIP0vjyB562LEV/84OApKDZa2XPJpfZc2bWlc/fC8ESWjq9 vD0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829505; x=1708434305; 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=f0fVvYEwFHKEuJye0m7tE2Ksg3XkzZ7A8P3KgL7X69E=; b=liDaBGQTQqNAdCBxaT4jba4pZ0lgZ/oVUl918jVxwP9KFz3cwSE9tAiKdAPQ/Ke0jK JqA4O3Fq1lH8sFOG4ypXKC8k8HC/tX1Z8tZftFrvR2q1eO6hjalNdQwUof0TWDLxKq4/ b/dkA4xyo9bDjdnYO8elWn35XJxETIil8qeeSAoJZzqzgQgL2cs1XV7+LK0dKbz2Q5he Jog1n5VDi1jJFQmHO1xvOE9lge6vqzhlv1ALY7ekMQaQcQAEUFIjOBejmnvmW0BlA+4c 3Kqlb7Gb5BzeRaiXsqJrQk1y/+/AvFKcdiWfPuTEAXoMaxvKgUg5O5ywQCebMIoF4U31 J8UQ== X-Gm-Message-State: AOJu0Ywa8Q1YUqTkAWXLnekv1k+KglsVc8pZVqaR9Nig+FOybShsDvaD z9jJGwE3CiE4bJyIe522sdkRaNER9QGxiqIGSiPeaB9h2LikzRDn+ZM7+GnN+c7VLXik2h3pwK8 e X-Received: by 2002:a05:600c:1f18:b0:40f:b691:d3c1 with SMTP id bd24-20020a05600c1f1800b0040fb691d3c1mr7989569wmb.30.1707829505301; Tue, 13 Feb 2024 05:05:05 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWewp6QbmZBRyB9ZP50Ix24ln72h+9o3GfoTchBmrSG9YYrtu8X7YwYKKzK8Nyarl0LNYjb4Mt6sy+1lTJdNsISoG/eymbDRTu/HPyBL5PsaG6LCK48VdK4aN2bVAR8wXF9PHC/oVRKG3N1Uvqcd6J8buvAIjoT9rKFnfQmupegs/xWMdGkA6k+XropZF2qtVIOamCf4s40TwawBRJgXuV1FOu76CkBou0dfeahUsoJiNQ/EemXCx+CAZO+w8Fnl4mb4Eh4izT1u468gDGngtIuJAuoLuS999ShBFUWpRW6rq44d8NeJAlGpoZ+6joJQG/z8S+gdHpeTMlJgOB8/MOlQxgbNMLHLmf6kdTh4k3EEKV9RexrYdxqBEvsBNOTSsoOFTQ2xQ== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id ck18-20020a5d5e92000000b0033b7a2136a4sm7254044wrb.97.2024.02.13.05.05.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:05:05 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , Artyom Tarasenko Subject: [PATCH v4 12/12] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices Date: Tue, 13 Feb 2024 14:03:41 +0100 Message-ID: <20240213130341.1793-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Mark Cave-Ayland Reviewed-by: Damien Hedde --- hw/sparc64/sparc64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index 72f0849f50..3091cde586 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -24,6 +24,7 @@ #include "qemu/osdep.h" +#include "qapi/error.h" #include "cpu.h" #include "hw/boards.h" #include "hw/sparc/sparc64.h" @@ -271,9 +272,10 @@ SPARCCPU *sparc64_cpu_devinit(const char *cpu_type, uint64_t prom_addr) uint32_t stick_frequency = 100 * 1000000; uint32_t hstick_frequency = 100 * 1000000; - cpu = SPARC_CPU(cpu_create(cpu_type)); + cpu = SPARC_CPU(object_new(cpu_type)); qdev_init_gpio_in_named(DEVICE(cpu), sparc64_cpu_set_ivec_irq, "ivec-irq", IVEC_MAX); + qdev_realize(DEVICE(cpu), NULL, &error_fatal); env = &cpu->env; env->tick = cpu_timer_create("tick", cpu, tick_irq,