From patchwork Thu Feb 8 18:12: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: 770854 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp464305wre; Thu, 8 Feb 2024 10:13:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoJMjmKo4k2wIhbflcjgtw+UfMuPM2IB0KrQl8ySRo9gu7RmuevZiNW3mzFK0o1G86DIhb X-Received: by 2002:a25:ef0c:0:b0:dc7:4431:589d with SMTP id g12-20020a25ef0c000000b00dc74431589dmr216457ybd.6.1707416010678; Thu, 08 Feb 2024 10:13:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416010; cv=none; d=google.com; s=arc-20160816; b=iAuVpVSJ0Z7wh2dY+G/A1j0qKbmOlHWKqO8Hn0zYWGEZs+4XxK/phM+yiY8skitylN tHGw7Z8z6rxrXhSgO8GCdSKy99r+VYzfDBNZNsA86tAV0ydz4e0fzZA02Q5mRMFTcqKT BuzJoIxrfLD+yOBQqLMAAuR6kgXxYz9jxx2AtmZLPrf77MNbDHBsQoBoaFjkyFgIY+aJ wrV6ZgAQPorf1eAXdMfuHg37vcvc1h3SlAJkX0QnIBhcBrTiKcD+R1ygCJ8KQBVGCLuV h/fBJzsTXOccXiWSUdBQ1whnj3ILqT/4RTzvIU8VlbHO8u/JnF3DxS5gU2/nxChvDBJ+ V6LA== 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=w2MStSDCsStbLku+FFcB1QAt3hfE/6paGjBeMPhTa10=; fh=MZt9IuLd1LZvOqI11mDdvtw3STOlq6UGergS47mftEY=; b=eR/I7PXvHoJxY/Qq4uZ2bEnIXvQ3nMCVTP65ivNhkHksAwpVDPGmteA07CYe1AiMFn M2o6FszEUCgiqPxI9c3CtLLcN/0hLsO+WK/P6f61eFpyZxEc878zTYH2i0t1G8H1A/fv aPNGIwrM+4doreI7zDErwYTddBxD+wxz6DtoyE5sPG8ruYfSO3S0g3x+iEIiMja0SJX0 mln7MTflzLog9uArK4VN1JAuk9uITReC7UpnD7gSkHoCZSE9Os+wJiiSprlLeOiJaHw+ T82itMawrVitXVrtakfhwQpVMiTqEQdHQ3piYW63jIBf1C8jLU+tN1aBZFzdmkMb18Px tjNA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gSyxdpNC; 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; AJvYcCWh5irEifadZPt3M0cB9tr4opO99mUbgG1tA5Gf3IbuB1QLf0oO3r6YoAp4Hk9h5wzt/yIF5LheXyk2LdyE4kRr Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ia19-20020a0561024b1300b0046d6813d0f4si77774vsb.657.2024.02.08.10.13.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:13:30 -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=gSyxdpNC; 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 1rY8tT-0004BT-Bw; Thu, 08 Feb 2024 13:13:03 -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 1rY8tQ-00048N-4S for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:00 -0500 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8tN-0006kC-SB for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:12:59 -0500 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a389ea940f1so6536866b.3 for ; Thu, 08 Feb 2024 10:12:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707415975; x=1708020775; 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=w2MStSDCsStbLku+FFcB1QAt3hfE/6paGjBeMPhTa10=; b=gSyxdpNCl6XxdHLBYe6vCnGNmaBeQvS82kA8/OZskTbdeDm66Ogr7a4L8pjfjHq2oA nZlQoVkxQdlzsXiI+II0oMkVX5AZnQ2+0+NK+jYFyvH6r21XTQq6EABJwmy+W+kTYSvx oarYVpsX2lkN4e54oo1VEsUAD4kXO7wpVI8ege56EZdP3o7u+1qR/HX64VDkHfH1XUSb Fa/WMHW7xSIXyC8fJN4tJaFChJ+z9VHoLZItQbe8afOMcNnv70I8k6sJd1AKl7bs48id IsXH7yZ9geTW3yTToavejmm4oz42AQGKSBM+AFZz8SRKd9+MvtBENQXzpHuTMcXber5O otyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707415975; x=1708020775; 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=w2MStSDCsStbLku+FFcB1QAt3hfE/6paGjBeMPhTa10=; b=IXZx7+4728IQB3iE8iS2woUy0eG5OTuLj/13q19P8cqLSLviAdXK9eHjs+lmVQ7LFz dHfqdgEICT+8kyC1nXOZLAY9Q0Y98K03aDqOVxWl1Xe5xN7kqtnOTm7XhQ5exAoT7nDM 18Qk+vIa4PwxfUPODZHzE4MEJOASMRnTa7jJ/8ArsHnF/NGGHO7iSgdJ7iD8hnRdc5xc jjrF1pCf81lOHfO/l/tHxoA93HZA8SA0hDAbnrlee9YhMWTNUJTWiXaJ1MtoDLV4Rrzp J4ZqpBZdS2bxP5iGNPF52VJ31OiP+467Gt/y5UZZByN89Jby304qDxNl3mQvSuUMKpDS Phuw== X-Gm-Message-State: AOJu0Ywz3//og4+llBF9s2xM9vaU4Xl6FdElhx1TJkf7AhAbIFMi8k7p 2r1XlILIclzacxVth/LBWTprPvzof3EKrYG4DVE68v0XuYeNups6Cdpb4nbEgrGbtUG15a7YVNE 4Tsc= X-Received: by 2002:a17:906:b2d3:b0:a36:2df:5ded with SMTP id cf19-20020a170906b2d300b00a3602df5dedmr77560ejb.72.1707415974678; Thu, 08 Feb 2024 10:12:54 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWvDhQpyJ+AI4o6GqNvSoUYNSlJubsBOjQg+Xc46YBKGB6fb5A4QPhJA8Qpq4ro7FWE+jJBo/TTBzS9jO0TY2uJVyx1y5bsi2oFIDF2dthoOQz7rFEY431l2Xx0kxYYWG/fMsd5kF+H0LpsPsd3FCMNkxgWpZUJqc0XChqwItk3ZKEJ4SJYuYMymuSs6V23wgts+eXBsxrhZXqysDE1NT1zUc9Foat5uXaQ1Ib0Xc2YGo+eeCEWiEeoIpYs8ETmK5fyvtV85ae6LE7IwbSBTH6vRE4NlFuP0IoJt7lgKZhBgs56J2HgI6XaHLiC6hh7bHiH4JjqyQ== Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id y11-20020a17090629cb00b00a3af8158bd7sm297255eje.67.2024.02.08.10.12.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:12:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v3 01/11] hw/ide/ich9: Use AHCIPCIState typedef Date: Thu, 8 Feb 2024 19:12:34 +0100 Message-ID: <20240208181245.96617-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 Thu Feb 8 18:12: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: 770855 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp464355wre; Thu, 8 Feb 2024 10:13:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV80vBE9CYf4EWGzf04dv3En45A+kR4dFfm56HlXiLhqUJfJdJSYyYh+KR9Nx2tX7EZYPoqaOFOZc/BVrXonkJd X-Google-Smtp-Source: AGHT+IHi3n+3Xq+UsWqfFPyd38hNktexX+xF558j1oC45PaRXzhGGm5avqMD5ao1JLEURIgIQkS3 X-Received: by 2002:ac8:594b:0:b0:42c:2a20:97e1 with SMTP id 11-20020ac8594b000000b0042c2a2097e1mr11710732qtz.13.1707416018089; Thu, 08 Feb 2024 10:13:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416018; cv=none; d=google.com; s=arc-20160816; b=zmiyBTdIbb6K5tb+qFo4DYBAAm66dixCOaryN2t2YdqDgNJiyUFfLYng1apr7dieIk XcfSY5wm2uyn1GeSobL9eMxAEYpaDXypkeduDUL++IhO+Zek1v/bd/VOtbQ3YSWJdnVD yuqVMeCPgkZOfEMa+lBmsgSuKKOqUXeAjj4M5H83akT5GO6q72hHqbGuchk3YgTyQ/lC 7yoDlDTFB4lznnq9ONALyg8fFiMff0DW3II4KulF7DPIBVr4Hvhtt9M0hztRmIRR72wM OQ1yTx5pWyDCO59GwU9kEPoJSjWcXdvVplj81CA+HfHGSu+T12rbDWlVKmn7R1KCtd/7 U/1A== 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=qwWWw6/AhfeHezI8OBy+gdgG3eOQyHTGWWLFzL2P+Mo=; fh=lkxxkG51wSLh2XzaDiLpKEOC8PP5gPkbyW8i9Y5hhHo=; b=z5QKk2iLq3wJvl+SYG5rEZe6FJTsbz6AyXHioblpbL7bwHKAHzDlQu2zu2DVU74Bt5 hgTX/D1gv842B1zloUrcRBQws2wToqadAmlblf6cEDf+qerfHMP+kTSryls18U+ylEAj 1YlILYNO/CYgXEx6t5KWbqW/ticqIbRSQ8M5zqShuw7PIsjhL49wHmkUSnRfe/CgoXWA DmhF43pPvauCl6hMSFxXeWTpC3D2xhNhr/mly8m4ubCngLBViBqhPTPkLwlGfEigUS99 D+48hkp2WUufD+oNGW4O6D7t/pVlynuF2cmnkx05HOahDxf+nlQXiwRBDU5q+4DqNwKO lSSw==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iMKrJTI5; 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; AJvYcCVs2/lbISfqkrHnzK4HFldgERj1kVt2bS+ge1Olg41IRPo2CD6J10COYggAi7Yfp6tAyXOA4+gwwO9vI+k2qqnP Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o16-20020a05622a045000b0042c5023f9ebsi519076qtx.45.2024.02.08.10.13.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:13:38 -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=iMKrJTI5; 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 1rY8tl-0004k4-4o; Thu, 08 Feb 2024 13:13:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rY8tb-0004IS-A5 for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:14 -0500 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8tS-0006kx-FZ for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:09 -0500 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-55a90a0a1a1so298488a12.0 for ; Thu, 08 Feb 2024 10:13:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707415981; x=1708020781; 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=qwWWw6/AhfeHezI8OBy+gdgG3eOQyHTGWWLFzL2P+Mo=; b=iMKrJTI5G89jKVELuig+jjr6KJxQTLPRDGbFEpqYrcJokMuCrcrYKnB4vV4+futlSd AfztfM4YrKz/jPU1mBoznwI90vR9f4l9ixkwyMuDuoHJIgbLgsLOSpdX/kwocQjb5XW6 Rbleb1BqVH9ndk1HgdNlkaAGr3+IVdzSigZfaKvYEoNH0RAMRDXN7O0gmJxbAufx8Dat 4zldWNgrrDH4YJNY1QuaJ0ODqHPfSwtcqsPWVBB+UZ9inBh0jIec9cvQ7qbqDUuUHFvp vHprdjTXdlcrCj3cKQcYeqhJSdpNdEPMODYFCng1ou/o/kedIGn9EnuQNhLW/slF6IC5 9+6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707415981; x=1708020781; 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=qwWWw6/AhfeHezI8OBy+gdgG3eOQyHTGWWLFzL2P+Mo=; b=vTPLiD9emvkV5CVg2xpzEtujFtUEW7ffNVHUwgd0i0cz7uAlDXakEygzwDsLJliN1F pr2Qi5cacuVdT5YCD9ihOkSDjsZSmlguauLjg1647txXyVjWjYJhJmByjDrE8/76LRri aIDQwvFxOcAMjCKxMCm/xw/eV3fb0QMocrwkPbxwiLdY3IoiEnNQcKQWMpalh1tI32tD Q9WEG6+ramaf1LzZFhyivfUQ7z6e5HjpDX9aXwS4UW54dW6APnUdd/Ko/0pJ/ZXzkRqd rpCrhrtjAaZokNZl9+1AOXuAgGGjRcXLhl97miAqRIjWbzupN2IaC1TehhxfME8YniID OJ8A== X-Gm-Message-State: AOJu0YxxA1NGyiCJQNHvG9Ffs5gOt8zzRlE4HHkN4foh8dKeUc1GqNuy Ogug4bzWVXKHdbVvjSJ072oBWxqD5VIR0uMloPJZ9ZIql3UKWuuiFc3F5jcWia9EQx6mErlqEbB HjuA= X-Received: by 2002:a05:6402:1a48:b0:55f:e493:33b4 with SMTP id bf8-20020a0564021a4800b0055fe49333b4mr28068edb.15.1707415980948; Thu, 08 Feb 2024 10:13:00 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUxITh5WgxpxEnE0pCbPY+mJp69t0QXA6TXFqR3rOI55w+MctTFXycjLSOQV0oK20G6Q8pwA6IyIzSF0PWJhHplV7PODdE7gA//sj4lq3tN7D0I64VCJZZFbCWac5qdp1foL42qazV6gwWXDoczLime+0ZH57fSVsTlYJssXJXSfZn7fleQ7MnqTc0PUYpIjtTh/kMPOUP9O4Fl1HmRccBGyGcPmHUIiwGh1ytQuNtJRghivWX5u6f2UFuvkXFuVp7xj+ZcWE06qln9AkN6fV5+Hrsqczc8xcrqcDGyNr2lb/wjdeCp6eUQTghyLrHxBbe68Q7+xH7uXqyd3it8CvUpHrdk2itJvytCTUYjJXLEPEk= Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id g12-20020a056402320c00b0056038077ffasm1078573eda.38.2024.02.08.10.12.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Yoshinori Sato Subject: [PATCH v3 02/11] hw/rx/rx62n: Reduce inclusion of 'qemu/units.h' Date: Thu, 8 Feb 2024 19:12:35 +0100 Message-ID: <20240208181245.96617-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=philmd@linaro.org; helo=mail-ed1-x529.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=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 "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 Thu Feb 8 18:12: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: 770856 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp464553wre; Thu, 8 Feb 2024 10:14:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2IhyoadLzObyMWEOesNpGTnb94tmOBHsB60oBtdGDcqMZJuaZtXEB7yDxyvomS4Fb9sqY X-Received: by 2002:a05:620a:4784:b0:781:c01:385f with SMTP id dt4-20020a05620a478400b007810c01385fmr276732qkb.53.1707416040343; Thu, 08 Feb 2024 10:14:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416040; cv=none; d=google.com; s=arc-20160816; b=tfQ7qZzta6+FCi/OQkamtR6S7tGCrF5djouORttCXgrV4rsOimM5/S1mj2BDz8LUFA +YTzS49mgiB6B6yThJ6QynoHpyly2YHqzIlfnV8MRHa6/mY/OcUTHQw4O9J36COfe0ZA HILkknXxBl16r+8dB5WUha1XawfXxHHd07YGK9219z60NnxVeLqLAMdcK0To2MkONdtM 1xPEuCDehw5e7HBe68aIGSxMGbJTTbaUw6DWfXmosjvskmdZ41vjQu8Z3nDqKFv91g/o Ir8dEHACNy70tsoCImm7k19Fru5UZ7NrngneRRhU2yUpYMhIGFNlJvIkhPUwDD6Br7rY Z89w== 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=L0ogzzUtX0pA4ogtPPYPzAFnKo2sHz3gs+YB0BMu1oo=; fh=H1JZ+9WlsYRdBmgCwRbs5sU7Bj+23p9GKsDG/93yt3Q=; b=kybaeIcs605p2Ju486ZhoJS8zSzOorW4oXzJY2Y782gv5Jeg2n9BH70PtYeuHrxISP FpYy3vSga9zJPhfMX3siVUB4882CoWkWcFmYBa1RzumBUHBCowEFQwvOWkzihkXB10t+ OieAU+E9la9iOrwkVlodQ4vSXH+lmBuGdsRNFvBUqeFrb05Mi0qCdCyG72hmDgtMsg2u ByVhA6IXvbK3L2q0deE+D7Gi5iKdMjdyccJa/TqI9D04Q6CTCf/vOpNrQwUiEnRIfkj4 wT/Ih4A+vBJq2RoCc5A0e9AY546QWCeMknL6TsnmqzEVb/rkRTJLh+fXk3fKZKySAWzW C1uA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MNaP1E22; 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; AJvYcCV8My/Id8jobIpeij/YhGE4lmF9G5xm82zPjHn2HtiHcCCbNGbospMstqI7+hVmOdeICek6xH4yB+61a7el37eb Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x14-20020ae9f80e000000b0078349f5b7c7si111741qkh.559.2024.02.08.10.14.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:14: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=MNaP1E22; 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 1rY8tj-0004dB-TL; Thu, 08 Feb 2024 13:13:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rY8tb-0004IW-Gs for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:14 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8tY-0006lP-Qr for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:11 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a30f7c9574eso9509166b.0 for ; Thu, 08 Feb 2024 10:13:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707415987; x=1708020787; 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=L0ogzzUtX0pA4ogtPPYPzAFnKo2sHz3gs+YB0BMu1oo=; b=MNaP1E22rrBn2bXQkGF3n0cl51UKSFaGT9lmlFuI0mjYDoY7/Eb2l2QTCWkY6YFe8a Ts/MAVviCTFhBwvhWE4YuAABTpYHpOBuW//GikOQBp+52itomLOnMQrKy/6JJth4VIxc +YFLk+ntc7fakgIEh2/Mzd73ObaMN4yjXx5SDgsRZfFkD/VBVdOw7gm4+kOL5EHgUWtD W6oA9SkHvMb1iadMTrrZz4ImXab/uthPNAJJX5lUflp/+KQn+by35Meu4BOzhL2jybU1 sZd4TPC5RrtJPKlJTVvYwAus3Avc2MWRmWHKW6Owf3U96lrUYvt2DAN03WYSmOewRH8k k0JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707415987; x=1708020787; 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=L0ogzzUtX0pA4ogtPPYPzAFnKo2sHz3gs+YB0BMu1oo=; b=RkVJL6CgP9vbYOnfvM0PnDDaYtRr33g7HvkvteZoYNr9l4Sf2tPqngp8aPd7jhZBek JNVzmbfilul7nEHpeEFaEvtmaiDL3Ypa6cz7IDCzyS/xV/sH6FKPmoLjHgXKtNP13qDO JtzoLiXd/DkoH88FL3NbPR40oTjt9E8SJKCGiHhT//mpsbD9MDOEPaN8sDE7Z5en84fJ CkAKWsMYPS8DYC1FeqI0lfeZ+3KcHqCZwWq/7xAaPdPpR0+Ej37h9xnEwsNI4+HMJbrL ZA8iArbiqPWy/POyUCfZ8lmbcYT8gE6CKhyyMyPCVbB45luBEf448co/oKVfUsLhaOXm 3+wA== X-Gm-Message-State: AOJu0YxcOVj2gpOR+k1TrxI4z4tMK+9DJE/04+uiKC8jLtVmJX15qfoU piZVyCzS+/ITjImvlx8p5cNRPw/fScLwUvBXPTJfAi9j/Mdhy2U18E9hrd7A/iFi2Rdp88VyGPx jFEo= X-Received: by 2002:a17:906:5794:b0:a38:8d35:c8b4 with SMTP id k20-20020a170906579400b00a388d35c8b4mr75914ejq.46.1707415987030; Thu, 08 Feb 2024 10:13:07 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWjPzvlEHE4oYPpySgAkE7/zjy3goOzi3NwSHkTTSWlgD0P6yoQ7k0sJB/Q+d4MdKul1AdEsOjJ0yOyR5lATAxU26+mLETi+tasJrtjM4E0kNlJUWJallVGABAm/WxVLT0rdhX8OxFjS976Yrati9OfnDRZ8n3oA8FM4o17D40f5o8yahIwdA7uc9KjVQCyKqv5CBpzdpIZAXfveZ9LXPnJoyjMR1iKzNKzYh9orktB+3cJEMhQAnmhP28LE4N/2xVV48MCHrB6hhWyNgPQLP4cqAFjwJWXkj+AJ8D6NNxO8xQbLB7rkutceBzmeQwAKRTRywrejh6Tt7O4XguPzLl99oH/sCNH1dCB/jweM3JeDjA= Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id s18-20020a17090699d200b00a3ba3d8af9bsm296233ejn.136.2024.02.08.10.13.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Yoshinori Sato Subject: [PATCH v3 03/11] hw/rx/rx62n: Only call qdev_get_gpio_in() when necessary Date: Thu, 8 Feb 2024 19:12:36 +0100 Message-ID: <20240208181245.96617-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 Thu Feb 8 18:12: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: 770860 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp464686wre; Thu, 8 Feb 2024 10:14:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IG7tjm9rWE+nt3CjD4kFvCkIgl6IEr54rODjorBGDVL4Ug9SpB+/aR353N6rSV75m+9JVTG X-Received: by 2002:ac8:7445:0:b0:42b:ef45:dae2 with SMTP id h5-20020ac87445000000b0042bef45dae2mr8864932qtr.57.1707416057303; Thu, 08 Feb 2024 10:14:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416057; cv=none; d=google.com; s=arc-20160816; b=U5iEX6X1cvB+3yakI5ZR+vZ7l3yyICQUxgO2siMyWHG5t9gcxnpVBLt1Gir/BfbGpx 6BZp0i7b476nby5Dlh3Oj2kvMU1iObV+mnfRygDMZvq4pIVhQfnpZBvE7FCeeZ3ychRx z0lifcZZpewP+TT2yVZXY62LwVOlYgM+Ga/1yKDMcWQgQ7ZA4+YLTJ2oMzsXXJdn0xJA mpaJ8Gl0+cwedco3bbBJgMfsUJAa8oG46F0wP6EBXgLhAs5NWF7xT7qUQhXCEvQZuFQ3 XuAU7EvmSIVwFwn0uKwcgud8Bfdb6QA6PgfpH0WKI8ptuVCVX32WqrAh3ZX0objm6CcU pFdQ== 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=/LcvVs02z5wCqQ7/8i6+yu1iXa6S9Xb47UoWtCZNINM=; fh=6fuirHJ4j9ESNJqihDodf4pmh72nbntMLt6Tdr4cqTQ=; b=U3iI+NLukBP5nH9SVJzyFZ3Nyya7ePGD/uOFwoEX5DlBKw0AJDFCqB+IStzAMHve6n 2Iz0/sjnM7GrjU3RhKfIIa10m+xAUQid6VRXM92tgtHlQXaDB9Hx/3DoOypHlA0VLMkA OzRm7WzZKeGrCQg6WD37D9CLO5Ybk/6MceWhR5vBJZHwmSPpVOhs+0P7+oeXQIOtmh/v jatoOKx1d2X0pS3w2r9PzyDZFe23QHEm3Acfebu8FL4LhTXMqkZDexBYQjKe1435MWmk kUEgXfBLU3YDgZokynOstGOrkx1vVp2CDa3C736DErlmdFA9yCrKGWZUh/3iDMqyTJ/0 WyrQ==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kLChST3M; 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; AJvYcCUX37DxT4RO50YtuIZV63twMqZqyWvBxWIjuLVtTKe0fF5YofvEpSCcoaQpZWnm1+F+44irnD2vWGaIvlJW7Trk Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g11-20020ac85d4b000000b0042c1accc565si594465qtx.51.2024.02.08.10.14.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:14: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=kLChST3M; 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 1rY8tk-0004gS-CH; Thu, 08 Feb 2024 13:13:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rY8tg-0004P7-KJ for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:16 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8te-0006mP-FV for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:16 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a3bbad234feso12490666b.0 for ; Thu, 08 Feb 2024 10:13:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707415993; x=1708020793; 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=/LcvVs02z5wCqQ7/8i6+yu1iXa6S9Xb47UoWtCZNINM=; b=kLChST3MpqAINYSWIKQ7SvZsfDAj4eCpLU11rm+axmFfvUj7LaHPCR4t/qmeAjWGrq mBOB9jsrAcSGK6OsZXaiqPewx0VjnuxewG/OI9vyn2MCwA3s8PeiKNdouphtuxd28kON 1sD5+5YepU0/e2ovZbQcB5zRayxRxEBcGTgXsPCRls/3TOwYZSRDBV2/mNRIXSx8rhjz qh9HHkv/acwSNwjQm2nx4HOIWAGwb9MAFu5f7yIpIcba6EpTvPwLqXvzGI06KWFqLTc8 x+g+Y7oIt9A+Im4769VpNx5dJ8hkJD5pixXB+bsTcNkENJiCmWkTSLCWZ+e6pt3bSj4X 7XAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707415993; x=1708020793; 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=/LcvVs02z5wCqQ7/8i6+yu1iXa6S9Xb47UoWtCZNINM=; b=mlUTLnp4YWSBBeEkTpcGOs78dLfCh2JRrmqKRpVJ1nEu4tgllHmnldT4fSXmFhZW2G j+QQRK8KPbu20s/tXnV56mvSOssZBS/E2jBltCuwS4e8bKjjWXNSI+BUyC2+bqE3z+Xe MzVsBCL5BJ3PGj9KPo0YIezIG6spRYGaMgdJoumAUyylX5/654RZC3418KQ8mqJAroyx 3S1s8cpDw5guvsZBv3EOBZlZG4rHmkXMWzRxiEtQL3tyZjnSXcp5EdK88v6x7rB0Ntrd zMa+FMqKyG6um2NhEt8IzK5ip87iFJfN1PyDppNmLhaEIyJP0y/SPqy/2gtxAV9Sr0iS oVWg== X-Gm-Message-State: AOJu0YzwXkLOpU7ZBLOTvHsw0Ce5eVlgQQzLOC+RIAWMttlN+BOrBq+c kNZSxSTAnmbz61m39XG0iWL6z7SwGWiidEp3E71dU0Hgu6RITiAXocEXzZtoAK7TRRZ6PTFVnZl /Sco= X-Received: by 2002:a17:906:35db:b0:a37:5bf7:f64a with SMTP id p27-20020a17090635db00b00a375bf7f64amr86361ejb.41.1707415993010; Thu, 08 Feb 2024 10:13:13 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUZfWjveanJQ5aK1sWpJZqar0gAVGSp61K9g/bixFm0BOrX7dgH5vTaB5OvNGW+/SnuYXSKAt6OUtxnBup2L2Rjq3Z0Akmmd526UHBN1ZC4i46OOstrEDooU4Cm+WmoI5FHAk8cMrg/qWOcctApmm28cbxVfMUPxqYFIiUvaa5v7Lzw1ZyeeoE0Zpbi5OV8bqeoJFuKmqlkC3f22Q9I3McCVYr04T0PwmSfcP9YQOyCGRV9VskMzRoT6is3d9fi5ktgcv7p4J1gpUEv2IuJzk3+/djLw1+/SglqTQ06alvFjIAG7zQ8aIReGY9o31bIvyrKYUHCcVtu4/Sr7o/XV6zFN5GhlPaHtStglkU/0ei44duEijInvEoeHqkJbwDHeSaC Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id cu12-20020a170906ba8c00b00a397c2ab4a5sm297011ejd.120.2024.02.08.10.13.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:12 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH v3 04/11] hw/i386/pc_q35: Realize LPC PCI function before accessing it Date: Thu, 8 Feb 2024 19:12:37 +0100 Message-ID: <20240208181245.96617-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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é --- hw/i386/pc_q35.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 7ca3f465e0..f67e5a55df 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -250,11 +250,11 @@ static void pc_q35_init(MachineState *machine) TYPE_ICH9_LPC_DEVICE); qdev_prop_set_bit(DEVICE(lpc), "smm-enabled", x86_machine_is_smm_enabled(x86ms)); + pci_realize_and_unref(lpc, host_bus, &error_fatal); lpc_dev = DEVICE(lpc); 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 Thu Feb 8 18:12: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: 770858 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp464647wre; Thu, 8 Feb 2024 10:14:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW4KknVZg74pgPywggQdpgbi6dnK7lnDaPiG1u3yxeFTgUm8r6Ngyf3XYjNXqe1Pmw0WhD39yJEdkNIFnC5D0qF X-Google-Smtp-Source: AGHT+IESxSLFzN1UbujliD+Jn4dBJz5tW6hVXGzjpIAk3weBu1zWMoUn2+e2TWnA3GQUhQRoD3T3 X-Received: by 2002:a05:6214:29ca:b0:686:a29b:906a with SMTP id gh10-20020a05621429ca00b00686a29b906amr88604qvb.11.1707416052485; Thu, 08 Feb 2024 10:14:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416052; cv=none; d=google.com; s=arc-20160816; b=oDrS1tlXw+EqHBN9S/f2Us6Wg0GovdPvJGbI6WGIzCvRP/s1ZTf9IgNL1VwrjzMSKz WapUjl4xRZ/WT4uAeRi7j36ggTdHIRR3XjNfQzD7fxw1WCgKf+TgmyhgNm3y+0qnijO+ RStzDbsKM2kyuQnMW72gQlFcyf8ipB3tpqV6MGQ3tPhT8106NQRt+jVEOOB6eWFIulmb KcIq+7B4LISO4ATMiTsQgwv+xk9PbKBp3kaEse3osJhf4wH519m7VbEeI+AFTlVLjUvE iPTtx5mmwYcZ53TKabJ9iWOfRMmOozCNn6fz+Ze2cFSb0BxyaZGjzzUhU0OYkfwFKeec +Ksg== 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=oP+Zl7qTTxZCu2Jq0yM9dMIapLtMm8swkthsq2XPVBs=; fh=NE26PbRSMnt8lS/DEtZmQTOIMttjlDRW0pvm+//BuX8=; b=qdBveRF7BfFHthKdaWbcGiYV9xv2A363gZU7+UHe95IdjwDm06Obhrf+/uOSGlgXvz +AYvFy49E1pfZTEl/bXwIIXE7Z3jsN8u7fDLnsNo93WZX6TkoW+wq9s65WkXn9zryR2f fW5N01fsOxAadjWnfKYSz9YZaertFcUO8rmS13yw6vPmShZsXLryLzxHsx/UJOD393xq Vg4WofX7S79o5GQC2bUbD8FBRq40wifVAC5K6/V9RgqIZPk1M1Vjxu2hiEa32UttXrh2 PPpGMCTOXHC0yJkKTf3SU+BhM43kjxh//BApxrwszzt5vcvkEDV0z+/ancy2p8vn/fWY IEFw==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q8cpAV8v; 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; AJvYcCVQ2enisbYPrTS3ATg6SxhIj5X3Nyt9Ufvr+SBz5L1lHmiuwDvALQwtGhIUXxnoPyCt2KzFRDuJ0dN1bfUFdzi0 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f13-20020a056214076d00b0068cccc21b30si48518qvz.492.2024.02.08.10.14.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:14:12 -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=q8cpAV8v; 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 1rY8tq-0004vE-CE; Thu, 08 Feb 2024 13:13:26 -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 1rY8to-0004nb-3t for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:24 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8tk-0006n9-PF for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:23 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5601eb97b29so315540a12.0 for ; Thu, 08 Feb 2024 10:13:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707415999; x=1708020799; 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=oP+Zl7qTTxZCu2Jq0yM9dMIapLtMm8swkthsq2XPVBs=; b=q8cpAV8vsMGa4v7NOjgzmsS+/pS+sXYH2xx9nErwIH3c2pYXpuiQgEPanqVCTbz+iL Fvu3bWo/P2etA6N/MhVCD91jdiq6LZNulQ14mzG9gPIcYyQtewhoshULxNO/WO9rMo+n 25B9ZruI1kUzM7tLw3khLQxttvBtr5jrNRPUK/9fTAmmtSNskDjg217kMsCn3+9XcnMp OaAk0t/HkxOZKnS8ecXk4C1ku63we8etVVesa16AlY9IZt4kRU/5w4C5QZo8wGOi4b6F lN5c9bI5dJOBOQMFNQqvJQrWvAKx83o+BNAnIYcPPuE4m12yoljNEnz1C3XL3KSpZhhE U8Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707415999; x=1708020799; 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=oP+Zl7qTTxZCu2Jq0yM9dMIapLtMm8swkthsq2XPVBs=; b=u7FN9t3j/i6HSkj81nEgvieV1j9KDyHp6snJKJW4NEBS1c/kT4RzGe1voyIIFFXuxF 5p4lbZnL3GFmHQ90uRe9MiKV5nvj5AbxPnl7V3PTCepCa3EuUcd8iCtTFnga91V+5EP+ 0hAdEferxn4K9u/szRm6wmUndk8bNoyLLwJmhkQpw95EsXuORxxUDvBN7gSD/LINPN3t ISw5vrtCSWS85PoQcC6Hr3oZGbk/7Upb3Hl/LG/l5QQ0RtOJ2TnOjXgE0tthHHPSv4Ne 1u9sjhkJs3sTWycWKUfLTIoZPdfzpsfLOwROGvGNN5Kh096WxjW3JX7n7RJPZ9laeFAA wEMA== X-Gm-Message-State: AOJu0YztpIu8coCZdoYgqKunX6RWws2cU32nAl4rQXt1dETvLSH7CDgo g0AXRwTSAicAWwM/f1sDMvuxSGGXgEu9RIjd5Xa0QNTG7atjZfRZ7tCnJ38aRwHnAeO7R+H0OP0 vGEs= X-Received: by 2002:a05:6402:8d8:b0:560:ef1d:a9e6 with SMTP id d24-20020a05640208d800b00560ef1da9e6mr318752edz.15.1707415999180; Thu, 08 Feb 2024 10:13:19 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXQV6J/JY3fLcszotp40NVy3j7JppsbUHNDxnA1/uudNIpeBG3fM9u4JPS3GVW4p+PbeBc9Z2h66ceTx+abSJJmYx/h9HxdSDwfYTy4POyjIXsTHNkoXzPNidaLvQrc3KVrX19xYfBDE9Z0+D+4OfLVCUuYV6p63+P2xc4ukkXJu91u9wvtBlWxcmxE7sXO4zhcRIJigOfLVFl/Kd6vH6sno7A623F7B9IT1ybBcjZxNaNkv02FNNC0O/t9vWz9eRiAXnhvBF6w51SEs9N4Y4+RcLonARwLAPHCcPJk2ytVy8ZUj0oe5iyBxjcQQL5G5ZrlwzPhCp/fxcK2nttamhJhhkSQVxSX2ShGrAI= Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id x3-20020a056402414300b0056058f2603asm1071801eda.3.2024.02.08.10.13.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:18 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Herv=C3=A9_Poussineau?= Subject: [PATCH v3 05/11] hw/ppc/prep: Realize ISA bridge before accessing it Date: Thu, 8 Feb 2024 19:12:38 +0100 Message-ID: <20240208181245.96617-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=philmd@linaro.org; helo=mail-ed1-x533.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 Thu Feb 8 18:12: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: 770857 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp464598wre; Thu, 8 Feb 2024 10:14:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/zkH1CLd1YshfH7uQCMYxmeuq7GlU+09CJt2g0qOaIbFl4aDpA2n+vlaGP7iILgBWABXO X-Received: by 2002:ac8:7e8e:0:b0:42c:a2b:eb55 with SMTP id w14-20020ac87e8e000000b0042c0a2beb55mr13063825qtj.14.1707416045733; Thu, 08 Feb 2024 10:14:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416045; cv=none; d=google.com; s=arc-20160816; b=nuhox4zotcU8CGa5TJgM+XRwUYoFNy84JPFWRPEWN6WHVDJ/UAvlRr99I793P1jorZ logDkw4oaCp96eNWZnIjhvosW8O8RSiUp+q7fcJcJlFTfPgEkHkz9WDJmjGrtQ9UDnua Xiem/b5HCS/yt5doOyeRF38PgL2WENGLavYnB93Zi7HQzMy0LuEV2NRi5z4MNbQeVb81 T5ZilWWabvLVojHEfqHIUzexbGU1up0DoNzZcCV2h03iIytiW4Zpt4gT+velhUUVDCmI iDegVX0jOvTrPI+sYNlmN1vNx5F7w1TwYU/sfIyfaIQG1jIZ4W/g4iC24kXE5cv0ssu5 rk3Q== 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=ARLLZN1q9jOO5ilFbs0xhNVpC6mVoYo93eKHvwmo3rg=; fh=zMmNFMXDqdsrkJQd4bRvY8FZv9EfgIzwQM032q2fm2c=; b=xqeNtB5L3eDKkEpS/CfiAEcNYYXahUSL17BEXluYkMzq3SMx1xt+jnoOqexFolmTSN 4zdNwct8FW0mr8697rDzlmVF8zO/XNTU3xOxsXUjnSxE01MDFD8RrphRS+pclVlTOjPD Fb1VO0GDITUF5pg7ztM2suFEWNdfEkgSM2kS9VvBqatZbcFR35+jQiKxDcFojM9zs492 hPrD4oiZAW3ihBYBVAYbkImZqCK/Fb2TTuCuOrFIh9/8BmFi0a2yf2AQVtFw6rzR6mgK C4wsIqXY400L/YkQozOXVh1bnSl1v/D7t74sAgNmj/l20XGrfykbQpZ3RVZovCkgXXKN QcIw==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BzItl0TN; 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; AJvYcCVBM/VRooObo8xnklXqpozNzU6ZSeyi/5mIHIv5HLSNtqHu/VPItjVVNew1DlCU5eL8bngczSRwbCMsTW/gbWWj Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z3-20020a05622a028300b0042a9aa32409si559340qtw.130.2024.02.08.10.14.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:14: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=BzItl0TN; 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 1rY8tv-00055i-Ud; Thu, 08 Feb 2024 13:13:31 -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 1rY8tt-0004x6-0x for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:29 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8tr-0006o6-5L for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:28 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a293f2280c7so10569366b.1 for ; Thu, 08 Feb 2024 10:13:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707416005; x=1708020805; 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=ARLLZN1q9jOO5ilFbs0xhNVpC6mVoYo93eKHvwmo3rg=; b=BzItl0TNbV4E0X7V0XOnMZ7urtn+gtlgFpoTFPRJ1NJ5VU6tLcQqtPDV4sUfSaOo23 k6ddd4bp+gRU1jj4Z8F9I9R235GQ/gm95sHD5KUaB7GCbJibLqH3BGemRQ1rruRt050I 3SkpMn1B2XIA/e+DzRgJ/RiNLbRJ9+7qpk2eCnNRzvYJszndfRtipvFVWVxBQMYMC8Wp 1XEpHmp7Iw7PCtnkivcDk94cO/uG99PoE3zMyd7EKwbb4TDqUS3h7ZVV3lHyQcRGnLWs jewIrUuNzNTDrUMKME4/LGuvg9iUOp0E3qlERButSOtdWdqyF5INfu5KEuYr6Bwr3S8S MRMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707416005; x=1708020805; 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=ARLLZN1q9jOO5ilFbs0xhNVpC6mVoYo93eKHvwmo3rg=; b=iJFa83rZZ4zuKkpN80rgeGIWtTSgdJC/+QBoM7tnM2jx9oIOV3gvq81g/3W3fJkKth RcGGl2hVDVdWkUCKNCG8QzdNiYUYRGoR1sS+7F6X4he6L45LYVLsvpG5UzEtgNYmKnY4 Jw4/4zolkXnI1bvs81uDHaA4yUyjYVbnePhPa90t9Z1EpWzOpaty0s9yWjCq9CrKH/ms KT6JORh5kcynlXwWcaMAGWcUYVlYeWA8zu2RVNiuVgcVWtRHR2+wXWJbY6AsinVhQsBv buwz0MqoGGUX0lJgf8MfbEIALd0pKNuqRy6xfzlICphCayKPxvPK4tN6SHv0dMwK93dO R59A== X-Gm-Message-State: AOJu0YzCMxtQwNUiqRd4iYz7nFSrDrAygfQj0sXt/c6RXSPM26ae8aya hsIR27POv1/j8+QOhtRhyEP+EIBjl06hzXmmt4EvjrxICkQghw7no8i0AH54FF4Hju21o8iCZZ1 kKTo= X-Received: by 2002:a17:906:6d55:b0:a38:4cd:7e13 with SMTP id a21-20020a1709066d5500b00a3804cd7e13mr76621ejt.35.1707416005261; Thu, 08 Feb 2024 10:13:25 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVKe3bkGBFJH1vsY8ebsqIn9hao/dFktYpQkK5HaFuys/YJBAzFebHkOxcimAX7Go3ZEvuRwo1u+NVl8xiGCMRpmSTYos5UyKpbUY237ApkQjomiiyhLZT1g9WAR0YpJWsQ8CIAYWYK1eBJvxE5+VrRY6E3zorRYGmg6MQpuVwKVpOfQJlmDrkZL8eW1aFHU+0zYxpo8nYEMEzlyeUcXzv+Nj1M1YgJYyDFemp9WeaPn18/yTyxs3+t3NdlFDYKbr9YugckyonlUDvRz60Nc3LM+Hr/ESOJ1SNUeRxGUcwgmwNLEKTJmCPv0AqB0aw96EJdzCUm4A== Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id vb5-20020a170907d04500b00a38103ab710sm298607ejc.125.2024.02.08.10.13.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:24 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing it Date: Thu, 8 Feb 2024 19:12:39 +0100 Message-ID: <20240208181245.96617-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=philmd@linaro.org; helo=mail-ej1-x62f.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: Mark Cave-Ayland --- hw/misc/macio/macio.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index c9f22f8515..db662a2065 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -122,15 +122,17 @@ static bool macio_realize_ide(MacIOState *s, MACIOIDEState *ide, Error **errp) { SysBusDevice *sbd = SYS_BUS_DEVICE(ide); + bool success; - 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); + success = qdev_realize(DEVICE(ide), BUS(&s->macio_bus), errp); + sysbus_connect_irq(sbd, 0, irq0); + sysbus_connect_irq(sbd, 1, irq1); - return qdev_realize(DEVICE(ide), BUS(&s->macio_bus), errp); + return success; } static void macio_oldworld_realize(PCIDevice *d, Error **errp) From patchwork Thu Feb 8 18:12: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: 770859 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp464671wre; Thu, 8 Feb 2024 10:14:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXBd8+TcwlSHC6u2tKB+tkXQgeXq6whuVoYZxIBoPPoAfLKJ9NPLo1AlNRv7+kiRSVSKR7vu5gm7WGd+OgM5W6q X-Google-Smtp-Source: AGHT+IF12GDcVKkDK8TsnDP/imr89JJxSW8RgCpRjm55kcTZO8j66mSl9oxXgqqg57/ic1vweDY3 X-Received: by 2002:a05:6808:210c:b0:3be:9630:2bac with SMTP id r12-20020a056808210c00b003be96302bacmr163131oiw.28.1707416054773; Thu, 08 Feb 2024 10:14:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416054; cv=none; d=google.com; s=arc-20160816; b=ov60VnZzMMaZjxMgqHWq+qzvdnQF+Ckx93bZoCvh6wi9pALnD7HexHoB+S4qAvc1ek f4zQUi/qxSOCCHTLU/8CawQJFKf5c4n48Tq+mKaJEtHq8/1Os4Nh4x0MDynQ4gZeMaSX 7g8kBPpC+onmNZGgOz1jvWD1AWCYBzvaJOA+DFWAzlxF9e7X8KCqJg8qeppLyzxIqwAO 51pVIf0nk7tBtWpbMVfav94H2aIn8ejrjLEUSGjtDylYj5Z2dASNKP4KOQC+ksef6o0S 1wsEqi1y0zwLYl6wkVZxcx8x02V/+SnxExgK6eTafZbT+JRz+qXzLSBFyAxqxPQlWDSo XpWw== 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=49ud5Yjb30rn8SP9Mr5OVYTkrS5yFB+17IJ/cfY04ss=; fh=XG5r3+cCYGu5sjwdrBQVRO7XETtYpPgGlqeLRXrBXAc=; b=HgD4aJIIkNHD5wQZfJWj9eos1a11qM+GzQlO1+w7DagMFlUQSmTo+ugwBjjeB9iRSn xvUnRjKWCcSf7z6q7tJV4r6jJtBc2havio4QUBE732Cm9w7pBFZ5S55spKuya7StYUG9 HKQXATsF/s8JJxYM2rtpERV5hKYq7ksdjuriSeAxYMvrx23h+nuKwtIrZtdxvew5HRoX 0pXAn+pUUDgdqm76NbdRJhg1XH9dgrroOF8zaMWccMxQ4pF83cuI3UBkNhBgJ2WPPJH2 pL7nb0T9zSzzMejE6eZWJfebRxu19HXjtEsALJwTuSiExemlFydfh/v04trIa6+X00eo fQ7Q==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LIMfBEEI; 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; AJvYcCUwcdODVbDk8UImLJ9WciGWdS+U5OhJcrezG5ZJ6HOTgJxAw79IYl4VNzjf4ojsNaLcuWVV2V9wC5mcnSXHOx4e Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v23-20020a05620a0a9700b007855eda5446si110702qkg.392.2024.02.08.10.14.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:14:14 -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=LIMfBEEI; 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 1rY8uK-0005ZZ-UH; Thu, 08 Feb 2024 13:13: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 1rY8u1-0005Me-71 for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:38 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8tx-0006os-Qx for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:35 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a39e31e1aa9so12210066b.0 for ; Thu, 08 Feb 2024 10:13:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707416011; x=1708020811; 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=49ud5Yjb30rn8SP9Mr5OVYTkrS5yFB+17IJ/cfY04ss=; b=LIMfBEEIRCYqMVNfECDt9W/Oy3qom2pvaKtrUCP2zzx/dfbyupZbdvTiFl5XZODU// /lqR4op+YrNaoB5XhpFaskWz8qTo+Ff5rOyq78BSIhrCmLU07+uGvJOKVTzAHeVFg8Ly RY8RK2HJFa5XE+F12yZ1yJis3fai+trNMAIot4gQDR/eNIXDpUk72kfHIXRHgWGIJVWI gq8Y7I804gASPjdwVKgn/PDVbCjcvW2KuZhXS3gNfliPtj8DDVsUwrf8/IgHV2sSfa8Z Nt24uHzHJV5SNHnvwl/LT4O6oWLC3h5kklXRjN3l3+QHP3M2dOvbYKS3eFPqn/Dn1PfB MrRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707416011; x=1708020811; 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=49ud5Yjb30rn8SP9Mr5OVYTkrS5yFB+17IJ/cfY04ss=; b=adr/9dPLNU0dX5W3r9sHpFR04fghqKAjeThLd5HVTW7La+iEEvp4S0Kfvne73LQuA/ MzOsMXcWsJBqNwCCBI3Uwn1YXNt23sKNjLkWAQzBZBXnBAKzseFgFlyMLWemCF5o6MhP MxRy3jXwC0hivMug6o3yReFFqn8KUXis0h8Q0yZ+e2NtuZBmQncsTh96oq/OMF/z5oCl DjuWoD2+Sj+uH2Nj+wmIU/DJQkJTiVP/aMUe23ZFx6DBsuULmw/V4oj1+jdeEwSREf4r 6Uxc40paqJU7U0M7hTKBBKSfGX2M8Vr0DGVEPOsExsejE8Q8Z645zIHPUhFTFbQgVtSD 4HdQ== X-Gm-Message-State: AOJu0YwGRDSxMVUNnr7jp80vKKtrkkKsrl8PWfjMgtn5ng1T8xzzjlbf zeJZ5iDReEz/JdMk/2ZA8dvFPttOJ6cqbp1p4SyC3VskugtTWcPJ1hNDH6bcyJEwSkSzhNlERM/ YOhY= X-Received: by 2002:a17:906:1cc3:b0:a38:6b3e:8bd with SMTP id i3-20020a1709061cc300b00a386b3e08bdmr93193ejh.37.1707416011498; Thu, 08 Feb 2024 10:13:31 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWu2EbPuE4dOdkSp7nul+FpNq+9PE8jv5D0KfYqhDgArRE57ave53OHf/heI6zT4eJVrEkTNtyt8x4aN5C8rpwpzxSAv30Klpc+CgZqcaiftxlryebGJ8pjHyG8tT6XHnkoJecs+aHlKKLCxaK116PUB3ASLy7jpH9MVM3oSvV5BEy7HyJu8p6NmBwvotGQxRETSqJzIGXSGfKdfM155VlEXgpmzOkeHd4yt1ptNA7svbf5rnhIc0mNhetgZIFJFJTAxcTlXvxH/7ioqra/jiOUh0uxs0d3v9rEOGgpDLS1gfqpHD1/Mj1Wuey+PrIaLqJZTnSLSrHzX1++NMw91yJOnHQGB+aB7TriTyefKhM4eaMBoKvo4jANJQv/RTvFp+2tS++EzcPAmg== Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id e3-20020a17090681c300b00a3826937a33sm292715ejx.211.2024.02.08.10.13.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Yoshinori Sato , Magnus Damm Subject: [PATCH v3 07/11] hw/sh4/r2d: Realize IDE controller before accessing it Date: Thu, 8 Feb 2024 19:12:40 +0100 Message-ID: <20240208181245.96617-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 Thu Feb 8 18:12: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: 770863 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp464753wre; Thu, 8 Feb 2024 10:14:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IH7QjZGvwaVKZ66uvZY2nnnzypgful37Y2E4EgDybjrHSzSprf8sXpYLFb8cDxp6id5G38M X-Received: by 2002:a05:620a:171f:b0:785:4443:50d with SMTP id az31-20020a05620a171f00b007854443050dmr652637qkb.24.1707416064845; Thu, 08 Feb 2024 10:14:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416064; cv=none; d=google.com; s=arc-20160816; b=t51BmN84GXly908FE3bSAxcEjtBrYB21wnZwwWa3Wx+BRhfef2nLkM9I+SHDqxG+1m 0pSzhk+FuuzKzBT4myt3+W6hcAnoIOfqKQTOhI269h5kFSIg//LLUWCUJNvzV6VO/bYB 1QJUCrdjWIO4YRcCpoIvg9G6fzYFIk2qoBKAAi/BSNxuZjtmKVIFgtEEoM6KtguzHYml POSUqaWDsjVhy80FN3QJ88g5pjcGZW77MT+oFHWgeAGmGo8PKs95rTktCAcGjq6yGnwj DsL9fDiUjD0MrqlL3XMaRXV0PcT+y29RK0ciQH0pas4YOwptmQW49736ztoC72oUke5Y 0xMg== 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=Bt8SkwfuTwRhmfpWk+aV3Q70u7eITNuY2Qk9HyWSpOY=; fh=YvsOEy3oRxWIC+ittmf8wPz/8tOUL1ZmWub48J+ifTI=; b=FVCS98ELSSEGzZ7jwDud8pdOgrNTVKRDdABvgxA8BeHDyWK3H4ItWJGM13nScePUP4 ygwdFp01aB36IP8xeuTpL8s42Z0daa4DYp1UeWi+fYo/8A3AiDNWAydrMl30KzFfUepw 8/rPvgKNYyquxFY7QrOvaezf4mBH+2P/Vp0JzaVxOYA1mrtcV6Wf0Ys6YDaxUWN0iWXS HVMx2VJfq+FZAkKcrbiy4g4ux41ttUki+HNAAbMg5mOYvnR1hPR69da7RW9IBM40ICyn psl51IOtvPcKgMSGSKSZXD5gvfGh7h933/w/Kuih3V9P7m38ULyxTZxecg3BLeZWDN9k yVew==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="GkEu/7x+"; 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; AJvYcCUKIxtDKRaW2a2Yve8XAkZ4hDnbznpSLt3gKb89+YFCYF+7gFUk+S+eXFm54PrpBVOd16fuiWU29vLQZosVQYNH Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r8-20020a05620a298800b007858da6db88si133333qkp.741.2024.02.08.10.14.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:14:24 -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="GkEu/7x+"; 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 1rY8uL-0005fh-BK; Thu, 08 Feb 2024 13:13:57 -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 1rY8u6-0005Tx-4E for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:46 -0500 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8u3-0006qv-DL for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:41 -0500 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-55f50cf2021so264889a12.1 for ; Thu, 08 Feb 2024 10:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707416017; x=1708020817; 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=Bt8SkwfuTwRhmfpWk+aV3Q70u7eITNuY2Qk9HyWSpOY=; b=GkEu/7x+LhvgzxvFrsBqg7xz3XLOIbH/ygPjY28GJMXoLCQh6bO52acPOf9bL0yyKj vJZauE2fIz6VOSkuwgU65o6cn61M2FZ3yZu/OPfKoRd8Onh4W3rVR0D1Fxo+wIQ72Lsl iPNtLBgZkGJrJjElyLNAzXAtJTwXvJCBqkZntuVrlThXccdh5ETmm0mvvP3BANvcj+jL kqbKpE7ri3CVm/pvZCj2Hl5OKA9Bvg1WcMS6aN5M1UXDE/5vZrkaHF8lmNrdCAiY9xBy gp7yN8dsYZheUaZvw1QOFSFW3xSef9M4B6zxGN/1z+nyOn948Lz82q5X8UyHCSPu2riG muTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707416017; x=1708020817; 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=Bt8SkwfuTwRhmfpWk+aV3Q70u7eITNuY2Qk9HyWSpOY=; b=qWm7hbts1FCW7pEWzTyemdtbfikb+hWCdGlcf7HpCr1vl/MaVnGADBAhhOKE4MCNos 5sRsZ142XjwOZaOcQJjK8ZEQypoK0W5Yt62Ta1eSfG1f0X8UeA8qXyD6PNdMGHBqcM8H xM96EdRP/yGjLedY5/uCFLVppAk/cH+U9teJrF0p9zsL4JkchKmWT556YYZgyplYdIUq FA5FoJPjY2GUVVXXq2n52azG6iSCzBhtHRMeUBdEfstmft/dpQn+b1il6fsxT5S4SEqh LWbgeaG8R3jJyrCoUsEopWqqT/UdyEzapDsWFpEoMenj+6inwywcYrxreDxEAe8yXQmu WqIQ== X-Gm-Message-State: AOJu0Yz/qXQLzLReTvMUOXAKdutknuT+cloQxMFhz7sarIKVFJ38a+0I pOwqpJEbYyjOv8tWRpmVwT2CxU3IveW359o3KsRzPZklDNIc1BRWkVcJb/GqUfl1nipeyekFcJT G2SU= X-Received: by 2002:aa7:d8d9:0:b0:55f:6b8:b2fb with SMTP id k25-20020aa7d8d9000000b0055f06b8b2fbmr37282eds.1.1707416017744; Thu, 08 Feb 2024 10:13:37 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUpB0LftIgS+0pSlh5T06px9JNZoGmicjknWgOUCNyXDg3pA9Cl5j1vOEGW0J0cCxOWON2wrXxumcpuuJlDciXXTO17pbGNqwun1BY+A3KhPilgtsdTOSmnpJ/2NwvB90kZ4LnWogY0Mfz1PlLcXc2gz8YN/4pLIZnvq2AD6XXnb7eEoj4Y+FoB+AncOnWHNRhGIEUz1vTejgWw0K89MX9Oz2E/VZkafWyt4e9CNNUzqDt1JO1QEbafSZHyjM2mQiafWzcFIQs5iwa8EPCW8CCZ7MSCciBnca1vQhiGPUwXHJRTVMMS8AHYmizeUJE8rK7SjdhoFqL3EYk1L8C4ykwr9/+0cWrzYuWA9A== Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id g19-20020a056402091300b00560dbcd61a8sm1059949edz.94.2024.02.08.10.13.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Artyom Tarasenko Subject: [PATCH v3 08/11] hw/sparc/sun4m: Realize DMA controller before accessing it Date: Thu, 8 Feb 2024 19:12:41 +0100 Message-ID: <20240208181245.96617-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=philmd@linaro.org; helo=mail-ed1-x536.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/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 Thu Feb 8 18:12:42 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: 770864 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp465091wre; Thu, 8 Feb 2024 10:15:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU+MYn4g4p+ZMsqL700VM6kpjmQMpI8Lh1TzmI/onEeYJ773ZSP8YEkqZIav3L6bUirLQ/4BrnSd9UhN+IzCtrE X-Google-Smtp-Source: AGHT+IGmeKSHhg66kv7Wm9hMDqTJ9zb57XOXKv6++puyvc7ogHWldhfqyt79YLh7NxPALeqpApC7 X-Received: by 2002:a05:6830:6d88:b0:6e0:b741:452d with SMTP id ea8-20020a0568306d8800b006e0b741452dmr348353otb.29.1707416101727; Thu, 08 Feb 2024 10:15:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416101; cv=none; d=google.com; s=arc-20160816; b=NF2I/6S3Fv2NWFJJOKGqujgtj/CTGa+a6ggbJEBlcAiIq/AY33D9FQr/YAJI0ylrQA 1Osz7OIFVBFCQTfR5iyZeMl9CLAIMhI0U0CJKQk/sF60IIyXtSCQjdOCJgYXrdgq3gir o8pEKrL9LXHarLjwnDS0o9gqjhYko5nF0mhWf/lgUMQyupsTfGQ907mIFAOok9InyCUb +RUphdiNIx5qVXSDOGsKbVlijwgcslhQVuQo/vN60847epUaP/ZhnoZIvYKTho1eDSVX TrLutFmlhuGg+RoPjlZ9j5FedIVDPqJZCZxBzgWbKIXkJ5eC6gwJk9TIDKCxgSoXxFVg B/3w== 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=h2BaaqYtSB0f7aHxoF7miID3EmqxQDE1kM5wTAvRNjM=; fh=ceygyocNZIoq+LcjbZ3zxWJys1HoulPpqTElfyycH0I=; b=o4ZyUE8jNdlu1lb0snF1ZuwWON1esTDyPKgMcPTcSArgV2clbiW30idC8YQrOJKNEd bz6EGpJSaK8CoMMcfT2xM9YqmzAIKtcNG0awNVNtlCybbl7Nj8qic/WGShE6ww7F60Zd WLzoWM8kW1QWxZX8EX5PS4Cddyl7dd2MaCTvq/zWV6PuhAf8Fg/XpfX++EUKa10BE+K1 g0rP9xDklsJ9s1VkFb3ilzvV/dyE4nKaU3phHv4nqCEbaXqAy/bIhlEDx+0+0sXScVZz NosfWKVoZk0s7Ew/e2ysxqjrWgd4adQmqQ/gt3Z2f+fjic/07Iio2E9vz2B8WOiNM0AI vVaA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GeQjWD0h; 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; AJvYcCVmuAne1va7JPUF+v8ZHiIUVPXYHhLvoj+jZDLGujm7UjFskCBmkmE4JEogeJUBECU+43CJU1auEWFdujzWB8Mq Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a3-20020ad45c43000000b0068c938c5548si80100qva.39.2024.02.08.10.15.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:15: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=GeQjWD0h; 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 1rY8uM-0005xe-DZ; Thu, 08 Feb 2024 13:13:58 -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 1rY8uB-0005VB-JM for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:49 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8uA-0006rK-3V for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:47 -0500 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5602500d1a6so233246a12.3 for ; Thu, 08 Feb 2024 10:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707416024; x=1708020824; 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=h2BaaqYtSB0f7aHxoF7miID3EmqxQDE1kM5wTAvRNjM=; b=GeQjWD0hwrVNlRHZmxEPTP6tyQcIhdu7ThSmsg3JuAQyfhnZ/iBw0jXKD5WFZfuLhN vea0W1fmtIOccNqdYvLjUIloC320gDzXEMHwHYMVlZLhOTBBbuJAmEiOYjEEqFE0StM6 AhKztkdodNRCBgmHt/SSPbbm3XPYAiPOisXftLvJ1VPBRrClj5WVXik5w1uwObDrcjFX mWF6AviTpDKxZcEhBGhmRuLiX9igkG/9Hqy90nbcQ5cU8e4FEca4GwbrqrcWrUTTw8WL QL1AUT/vI7ZYBq7SXIayileKeOx2hTo5TN9OTv9GT7hmCxlO2+vycmPjtH+JWBh99xBL gMIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707416024; x=1708020824; 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=h2BaaqYtSB0f7aHxoF7miID3EmqxQDE1kM5wTAvRNjM=; b=dGh2iMObraasJTsHgSJ/joTvQiodALVnNZCdpuuIUUQ1ZzYO8JGImbZ1k69ssFJlD0 TTKH9/ckLJV5GMxMYx9HlYWGPGnxcDs8kRUdk79csv/FDtjaxeydAO+jFtP/I460iiZO qBYiZZ89qVv+l/gl+asJX2tzjtvy/wg9ERzARcBRDtgzA58ac1BHxjnu8gyAfH5zbmwF Djxp9GfRzVWFZ133NRQhuHEqbBULNWWmYg4Riah6L+o4fR2Ymsb9ooiEwKrbng7hYqm0 8QPRYrNqoiz7DAGluSrk8CuSrrImuUuGGO3NK64yV6L3l3NGI88w4Vj1mIJ+kqW/Dcaa b9BA== X-Gm-Message-State: AOJu0YwDthDnunGz6cTDN5SHFPD0Oa1rTO6vPTNp+b3ZCxWMaQqbDnIH n7MTPwJDaxyrFmGWNN8m+7XKHztQXz86eALTygKyH7IzwtXNSvUE6SRtKlyM/Fr91xR1IY4OlgW 7Sqg= X-Received: by 2002:aa7:cfd1:0:b0:561:1602:949d with SMTP id r17-20020aa7cfd1000000b005611602949dmr30642edy.24.1707416024131; Thu, 08 Feb 2024 10:13:44 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWicqgbrRVVwmt+MjebO7v6rOOJM9EID8Ep0AD2RCmrZjRuPz/y71P7YBizYQkNbJCycYmDF50cJxHGydKsrrdguYSifoUEX87Hm6345qbhm4JJFsFTd//9NccnRs9w7q5aPE6NjpDk/3kXPcVY7oOiFZ8JFtF/peJGt/xfc4KL79ws8OuNzkKYkiCrb6+dvnefJeEOu1yXCiPRn0YW2xB9I6Ln7ng6rqVI9EkR8RYm9ViEkseqdEPTQmzJX/mytTS9Av2VqT9JbDIREFmbdrUDMF9yeq7QERypi46BCw5cIHMTPO2UGE/NqjCBHlLY52unYWlY8HXzXSw5mJNcXMH9IA7GLjSAdcB1e4aGms7zXd1FCx28TZHQgrbPmmma7zf8oONO/rNaEuIIBz5xN52d8WBkLp0JDts/Mw== Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id cs16-20020a0564020c5000b005611d0f7339sm409781edb.41.2024.02.08.10.13.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Fabien Chouteau , Frederic Konrad , Artyom Tarasenko Subject: [PATCH v3 09/11] hw/sparc/leon3: Realize GRLIB IRQ controller before accessing it Date: Thu, 8 Feb 2024 19:12:42 +0100 Message-ID: <20240208181245.96617-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=philmd@linaro.org; helo=mail-ed1-x52d.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/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 Thu Feb 8 18:12:43 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: 770862 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp464735wre; Thu, 8 Feb 2024 10:14:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkyIryzH0ZqNHtkvjBbYEdSeBfPpIzS2UOUu++JOGt2XB5raZHBk42XtvI8t2LSVnD993R X-Received: by 2002:a05:6808:11c1:b0:3bd:9a04:80a4 with SMTP id p1-20020a05680811c100b003bd9a0480a4mr110768oiv.48.1707416062091; Thu, 08 Feb 2024 10:14:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416062; cv=none; d=google.com; s=arc-20160816; b=AD7tv23WIsSr8bthsCFxP9rweh5HSL5d1kvlSlLCht5OINuwDTHvXkCt/h3iVHkZSr uIYktHt5ckKwKPTCvt0q7UBtQvK+g7MFWkRoNAciFC+CwkqL3CqP6/urmqKxKl8hUpCt sFfYMxt9/YTJBaRu7yVy9v+AJ8JYiIlEUZy+aICHqU189wltQUY0KOMoGo50/MaQy7GK D6//sP/hdDDQy6W8XcYDx57BcLh5cQJvqczEgEyN+GMnj8hI8BMZ+w0t6mOIpk7PUkGg D60J861qfDniNYht89w0m9vLRBF9+UASXfqWobFFY2F5opy+Xd/zO6pyArzOvdlGoQNX 0hXA== 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=rJDi0dase1u+UxugeaCpuJyBUHrq46IwKZeWRl/RxT8=; fh=TgyL+IkBT8nqUMdxbmzuBDrO6CpLGfV/5+V5K7HEtCk=; b=d/96o1WNCvLpKojZaWgqD9CBS6KGLOd0wgYEOyOVXuW6D81nQNJ0TpCgjvjfEao/Gn Jz1ooj0OeEDwdtY5GQMTHX39KeXwRhuUXslDYMI2J2Ef29X1RYNbR6/XeEaYh8/ttiyW U6Cj/Gd6dz5XjbbDFWK3E4hQT3KDEjSdw4lu+BYMminBdiyqppNLq3ZiiFjfHBdh1SgP LZx4KIj/PMXN6qoBCeHPpC3ttlz33TPDDxKSV+HKLWnL2/dma1Dv9WPzwdJYp9Ye7Qh6 QgzIK29BvfRwnmYNC2rOBaj4d62BKrblHHHWtQeH8kH9BPLvdNE2galot+Vdy2vvtVtG Ps1g==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b5iOrIJB; 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; AJvYcCXqmPZbd+ZgCG8IDQLdW/AgoWt4d0+3AIvUYLSqZAV6BUZwvQd267kZdy+QgAMvuEmOnu7dA2YTmqZT6jf4tw2R Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d17-20020a05622a05d100b0042c3e82fa13si529314qtb.779.2024.02.08.10.14.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:14:22 -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=b5iOrIJB; 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 1rY8uO-00063b-1U; Thu, 08 Feb 2024 13:14:00 -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 1rY8uK-0005lS-Iz for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:56 -0500 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8uG-0006sB-Pn for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:13:56 -0500 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-5116b540163so125114e87.1 for ; Thu, 08 Feb 2024 10:13:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707416030; x=1708020830; 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=rJDi0dase1u+UxugeaCpuJyBUHrq46IwKZeWRl/RxT8=; b=b5iOrIJBrx0d3LphHmsNbMqIXL5Cu9pjxlAbg5Wxy6/lgaZdy6qWxE9FBEPLijregP O1BdnAm9TY0GtdMo9tIxSvt+4LOrNoMxx7Fr+M1CcPfxu5wz9YnhHcImhFaArerJBI1Y 6cUIUagq3uTHcrxVZWjiPcu7C1KvsNMYBM63QfFyIRhUV8EBIgKFr1u5OrFn9+1Typr9 JD2zCejnffkIiR2t2WpqbuHMEthgRWgRXsh0dEvqDmyWr9gh+m8U5yN/Z8SVbFQpT/j6 KpggL8rNrbgQmZ0N9TX0hQ7TOHMyxkn/Dhi7koALbJpfJAW+iD1z8lRwxrH1+JzccYaI wqEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707416030; x=1708020830; 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=rJDi0dase1u+UxugeaCpuJyBUHrq46IwKZeWRl/RxT8=; b=JgLqn/6GXL0T20DZ6l9k22qTstWBglGMYKj5SZ5KBeN1T9lAWlwZvkUFv3YKKdCPeo ulhjlv4Rnc868fiBDUqag62S5oid7xk/qIw+RlNfabrcq45+ZtEm5JBsIYRgaBbnopqp 8Sl7GiIWIT6SvV/ZZhlSNRg7IbpUSu8wb5pivEYA2Aol9PnOrvOjtS31M6N8JwhmI5pm /V0kTFT73wGf3dwkMjNbwORl+E8YtTpxzGLWWPsu8B6CZDbTR4/YyXVi5Xu2qF8X3+lv 99x8HpJ0hcyuDrQ2gtAV9APcRmDvf1T9MWW4zMZoQWTJLg25c93bxLITXdupZfkHhaBJ zevQ== X-Gm-Message-State: AOJu0Yx7gAD+2lv9wrsfPUYsmYyHmW1DvffDm2zCz/cldMlqHNYDLgvq EL5Bt0DxLPFsdwQgkW8UP2QJgwzaOgx3RqhVciE3Q1z3P82rxsJBdIoFcWsnEWS1Conj1WVbkrM fwzc= X-Received: by 2002:ac2:5f4c:0:b0:511:5361:20df with SMTP id 12-20020ac25f4c000000b00511536120dfmr22799lfz.13.1707416030376; Thu, 08 Feb 2024 10:13:50 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUaNaNjjnd3A3FmgNXUAOALmF0y5Wed6rvoAqmHZVw8V9mWBT5tTxeXyhPJtOFh3R0TWOFH2eqahfLI4U/tO0mo0kIc03uGZfeiQxbNWycH9X4O7jfRFhEukTu0zDFXZf672jNufRhplQSJivw5uhRE0cbuvV/6b0KqT2dOWxfAOwCfd8ygOGcRB/opX0GJWhMLGzTlggDFvw5azjf1RcrBVnPjXUiqsJhypTnwNRybfUXzkW+uQZGHietvkvRuI+JzQOTeVd77gQqczAxr/IgeENoojH3NM3Amt1e/Xyrr3CfZKCxnzUNLD5mwPyBmJBdUr4txR9KwNsNA+JOt/nSxEJ9WzLtUFG0BZhbd5pPp1vxyooL14v0q8VVxXzjvLP0487/YKjHlyF3cP4P1YyTg1oZIz02IyPa7/w== Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id o16-20020a17090611d000b00a384365e3b9sm294221eja.195.2024.02.08.10.13.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:49 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Fabien Chouteau , Frederic Konrad , Artyom Tarasenko Subject: [PATCH v3 10/11] hw/sparc/leon3: Initialize GPIO before realizing CPU devices Date: Thu, 8 Feb 2024 19:12:43 +0100 Message-ID: <20240208181245.96617-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=philmd@linaro.org; helo=mail-lf1-x130.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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 0df5fc949d..0e1d749306 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -234,8 +234,11 @@ 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)); env = &cpu->env; + qdev_init_gpio_in_named_with_opaque(DEVICE(cpu), leon3_set_pil_in, + env, "pil", 1); + qdev_realize(DEVICE(cpu), NULL, &error_fatal); cpu_sparc_set_id(env, 0); @@ -261,8 +264,6 @@ 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); 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 Thu Feb 8 18:12:44 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: 770861 Delivered-To: patch@linaro.org Received: by 2002:adf:9dca:0:b0:33b:4db1:f5b3 with SMTP id q10csp464725wre; Thu, 8 Feb 2024 10:14:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwmNZMOrjzfkqBZJBozli32krlrp7m9QdUV9ixyVYxfjfRSat0lbKR6BNvUz8G4y+3BaOL X-Received: by 2002:ac8:5f12:0:b0:42c:4257:5906 with SMTP id x18-20020ac85f12000000b0042c42575906mr5399108qta.26.1707416060844; Thu, 08 Feb 2024 10:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707416060; cv=none; d=google.com; s=arc-20160816; b=xAp/dpXSstiOLJ0b/hqwgaDiYrmcfvvJgHrKwXc7ymiEzmJh/uGjYOQCFjU0aVVxVV cnZhA3FzD3qzagWeGRaRH/FsYg+MqBRwfR3QDhXaNg4c5c51ZZX4azTbbgnuMMM4PEXv naVJ6FUS6AW46K1zHtMEAFJwwD30/uTJm4heuvIdEiowoZ97/UFvkeD2OmUv4fq4DCMu iEYRUWmdL8BVPVIQFaRcNmbGyOAIanuViacCUDFre3LWRDYOFYW1C/YXx5hLIV4w6y4w 3glddht8UneEWYe1Dq7p8PZLhbofDEhNt6zaquzss/yXvA4vRhmDGHDUhBUPq9B8Sc6L IZvQ== 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=e0Ufl9fqBfA4JrpwEmiN6ER59zmqlqLsBKlzkxxHoFQ=; fh=M8L61ifGcqxmigHCxZG3RzHf81TsBQ0nVmg68TnLUyc=; b=P7ExWRT8KFwtZCHdAGaSE206SLCe5LgAu5WEIRLOlXgPp2pEmxZvHkwNogOhlxOKAT 8xyHWF9BHo4QBnJz8W8T5W0hsWGe6QbMDlmQKClKoD86tPg0BtHd4/fy83Xdy2otT5dq rW70nUQxo6VKKA5HhxvQJvBlYC0rILC0XnZQ1HizBMRoaW0dSRFiXNejrgUjvq0UZKzF cK+QNDpTXi2XnssYaNNEZ0cx/mt4guz3OUt/tyfmbZN5wPBEEnadOVj0yGA4A2xjppqe 2sM1rmTarNfsJj6jXMcEWw5mY1HOuBvYFM/sebq4iu0W7k7NmqxQBOZvNb++jqZ+uX06 gjHA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DRtKoL7E; 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; AJvYcCUEAUZwpIibXtYr8Q6xWA0cN8Y7qP4d3KfVAf8m3FI6yqv3ppDGbaFfSy1JGIqZ4XJLNHYeFrooKal3SLcnn3zl Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o10-20020ac85a4a000000b0042aa70b5cb1si548697qta.47.2024.02.08.10.14.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2024 10:14:20 -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=DRtKoL7E; 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 1rY8uP-0006Hp-UW; Thu, 08 Feb 2024 13:14: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 1rY8uO-00065A-9E for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:14:00 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY8uL-0006t9-Ub for qemu-devel@nongnu.org; Thu, 08 Feb 2024 13:14:00 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a2f22bfb4e6so12022666b.0 for ; Thu, 08 Feb 2024 10:13:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707416036; x=1708020836; 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=e0Ufl9fqBfA4JrpwEmiN6ER59zmqlqLsBKlzkxxHoFQ=; b=DRtKoL7EEoO49IUAU6sA7DmmTc7syfWoRA+317qbBESw2ezVfDpoOZ0a7Ko5MO0jjz pONop6zedD8lgkZTPNAMyiWUmRmUytkgUkgtrQmzMDz8wPgIV9oLYktajXKk1VBtviio lgjgvvokfd+Jw+Wq9C964pNgKTtNSUpLmI0U6g48QSkaKMM//4ElGQTCC37jE5jNNko/ KTiTR4R6GvnJ6upD9+P86+qk5VqkLqgf0JeoSKqMZSGpJs6FaiuRkwT6yAXiF6R9y/gz lgnNomn+hsdWVyI2zbj1gzuzzXjYg4ML8zgPUfBZZMBDgvF+PG/cEEimqXoKeBa5OWzj LWVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707416036; x=1708020836; 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=e0Ufl9fqBfA4JrpwEmiN6ER59zmqlqLsBKlzkxxHoFQ=; b=Y8smPFC5ZH4RrPxEn6kJaUSpehTxPxZb8LJ+WkVoMMUXxE5uv3Okt6WA81lJY43sEs zEy+zzwQxNxPKDS95kHdYK5MDrjw3c7J7pdjP3maicut68bzpHdxE5I4QlFGNlOGqAH4 /pXSlrCitXYB3wn3ziFCFaJJa5xuEybuC/5Tk4eYFvAx2A3kCNONW2AfMlr104PVRQxd dgpnzsAfcQUjupoXnJYFN5X3VwzHoKkQxF1n96ZiIrTFJzXP+bBrTrRBiyZO5dPdZzMS QnI29AJifzz6qVAxDfY5bBPhE1milYeJNLhJderlYHkmVSlZSitq+LDRbqFlg+dNK/x8 aNwQ== X-Gm-Message-State: AOJu0Yzy35VDQESI0rdt+b80WBmxvQXVulL/NY1Yc9bbgo14JRaQlpHS VqEehv9musxmBVUAJm6AvqrbVEznILhMdeM0gbucFOXJnr5cIVaXm7yD9td4K/pFXs9LB/F1Ksw SEFE= X-Received: by 2002:a17:906:4808:b0:a37:aa3b:f56 with SMTP id w8-20020a170906480800b00a37aa3b0f56mr82482ejq.49.1707416036295; Thu, 08 Feb 2024 10:13:56 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXC+04nAVm0zyDOUEvv5ti6R/jvcT9j+VXkU7fy1k21yTDd5UCfYql7jILgh0hcpandaqeRv0O0R/1WVHUnsvAqmFlwvbcEE1uhoAjRyaeRgRiqFTzJ1WqJ3TUhyVcNCgyuSC9SkTIJDR/wJBAwRviEbeGHsI1rvoyl7bm0EVu+dlCKrjGrxS7s4+Gx8ZmemLTCVrJyGdDxPTrPwBQ+Fl+J9MAXoImiERssDSpUcRVvIIzWGG+euB+MBHPl4k5L8prV1rRAlLdi/9P1tSeN0YEv0JVWRINaoHWd5DQXOqdYTquUmlgnmCqNK/bweD+0KQkywwGLI15QFNq1IaYghDe+srVdmKydBEYP+w== Received: from m1x-phil.lan ([176.187.218.105]) by smtp.gmail.com with ESMTPSA id lf4-20020a170907174400b00a3bbf725080sm303160ejc.55.2024.02.08.10.13.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 08 Feb 2024 10:13:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Zhao Liu , Paolo Bonzini , qemu-block@nongnu.org, John Snow , qemu-ppc@nongnu.org, Eduardo Habkost , Richard Henderson , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Artyom Tarasenko Subject: [PATCH v3 11/11] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices Date: Thu, 8 Feb 2024 19:12:44 +0100 Message-ID: <20240208181245.96617-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240208181245.96617-1-philmd@linaro.org> References: <20240208181245.96617-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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/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,