From patchwork Tue Feb 13 13:03:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 772305 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp241420wre; Tue, 13 Feb 2024 05:05:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUDcEUPwzF2DHgFaeQ7674BCnFCxcbw3JpbMO5lZ/PPMob5nd6DhY7t0mQSL3PtU5fUaIZTentBDXiWzXsVXjbK X-Google-Smtp-Source: AGHT+IF7u/z1UuBu676diPX70dcgtAMaJuHmEsxdVtZW3ouv6xGqvmbaHAG0hDOuCJGjcZtIhxK+ X-Received: by 2002:a05:6870:c18d:b0:214:85d0:b912 with SMTP id h13-20020a056870c18d00b0021485d0b912mr9093414oad.14.1707829500381; Tue, 13 Feb 2024 05:05:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707829500; cv=none; d=google.com; s=arc-20160816; b=zTer1+hSUTuUXjVbwN4Kja/pP1iLM7ofcbzzEhUEqqBGSq8/QsLaPRY1daCVk5gHRI DQjelti68rLBjShlNJaopzAlhwF+6ouK+TyU3lZSjcOxKTn5eCW7AkHsGDlMxkQxJG5+ 3I3cphmj3PfpzXaKwgUDl/AL5iI7CZYAIOQwZ6o5PMOwHVrSJWi42sbUSOrXSfet27OD 2ccit1cSVRWb3Y2ySlkAbpeA5W/nptPg9SV96Q8dJthM7sYESom2iSRYIniawIbpKlsC wc74Hlau42Tx2p0ppykZvD1TflyxK6GVVM74U3OVpb26vKL6LyTAR/dDpbgleMH6K+2x 1xzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tP5MZohIYd0wVaYtS+mlCIb83dpcfafYILJYWOltnx8=; fh=qj0rgE4H/239xp7mHLV1eUcUoGytWeJ2zsyELN4UN/k=; b=QlIvEmGVwd8vas/6WT8ybSvMS+F65Vg/DIwN787X+oxufaB+EVvLl5Rb0EFnv4GCVu yqcVH1xkWLxaUEeXVTp1EpCg4RY4KdsdVZYATRgFV2FdjC5lVhye7l3alL7ndltUsxgM N2py5O1kjv1p+zoCrbQ7+S2eTkBMZqDeUqLS5rO8gHtVdHM0RSMLaG8rEOXtEenK5DJ3 GRULPH+UseBmDNoGGVX+fmc8YFM57aHeR7u8tsnEbpXODnd33mPhaFClo9S8LEuT0ffz pEwCPytZib9EWdfvMFTwuxHriZV+tudniHrDvRkxSV+bQAtVp8VuChCHkE1UYTbPFT70 mpdA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NR67svxf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCWMr0ATSRsX/4wbgDTBIObQ9cstjP/bZ9uJB6zgMs5FuRIzbhHSU56YdpHZ2rIUT1wgNHG48sjGApa+bvVJdr79 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id az18-20020a0561220d1200b004c077185da8si1023258vkb.176.2024.02.13.05.05.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 05:05:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NR67svxf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZsSc-0001sq-Fq; Tue, 13 Feb 2024 08:04:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZsSQ-0001qP-Lm for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:19 -0500 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZsSN-00063x-Np for qemu-devel@nongnu.org; Tue, 13 Feb 2024 08:04:18 -0500 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2d10ae127ffso6304221fa.3 for ; Tue, 13 Feb 2024 05:04:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707829452; x=1708434252; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tP5MZohIYd0wVaYtS+mlCIb83dpcfafYILJYWOltnx8=; b=NR67svxfy4CVQ9Y3Ufhe2Buu/SXfQph6ViYpwJz9gf3V/ro6EAfhuvsjsTrjF12rK7 Yor3ZLaRqDJuCKuazcdPzojN36oyMXQA0VcOFVxxpkApw/ymarkSKzs7iy1OpxhpOwe0 +MgamQ/jI55QVDcCu9jll4t5cehi6XxMGcCe9IIed/XBMaU2HD27VTeB9RIAWL0JJM7Y JiPmdw6DCTh37skgELUK8DTz/MpE/EL6zzHu2i0P4Y+qGRKFT8CTGIC5bOwoa1z5xZOk cYtvntN3xZAqd+dBSyUMpC3guDyzfvsSsc4XddQjRs6qGFx0/zOveyPJx/OcxaH5q7VM VRNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707829452; x=1708434252; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tP5MZohIYd0wVaYtS+mlCIb83dpcfafYILJYWOltnx8=; b=q3h6HKA8dAdakW0aWLr+Nc15ydzejM1/JYDBcYbOoFZm2cyAa9HVuG3RXD8pRcA3jW ESpc7g7j6t1yMvmIXAl+miw3QUMYlgGNjQUeUHkSB+Um2StHOV3ruZHtpWQcQIW1xxrd vnrih++jccbRAL0JZiW+Nb3uQVqU+rmJSulqU6UNdOucJAnkYDdJIGfHYiSsf9W6SnKB GGvdNLzD2JsPnm+gQwJGL/l2LZz4odha39y4oJVR7fHaa2yfdb8WOUGCHLPZLvwaQ/Kg HSXX3H/138QCkzLTQrD6xrLIaSSgY4+xxQCuWAVZH26tP77y1suFThTG1lTKRIC9kJ9m 8IGQ== X-Gm-Message-State: AOJu0YzlfjLgRdZNxqQpmKUEYoAAyhSr2jpYFsWLWwjzG7kI3qSX97Vr e0DnUiIyBV1mOWQIgyvgcEchL7N7O0oR7cjDgXnM+PxXgcleh/7TNmr4svnzPI7PwWbeROHL1Xa g X-Received: by 2002:a2e:b8ca:0:b0:2d0:ce3c:5848 with SMTP id s10-20020a2eb8ca000000b002d0ce3c5848mr7125795ljp.51.1707829452257; Tue, 13 Feb 2024 05:04:12 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUNc/1kZ+RlDRWhqliOhyerbcazasaX8PwLsgb/PcmLCzq5tltp5lVOb+0w+3h9qgI+39eNzsHMTrXljpK4ukoRvR9WyKtuY761oWVAL0MDIjcTRPqWwjFpvLmB8H1gkYc7ZKwd2xmfC4BzeZlhZyXazUXCrQc/3a61GiCMxYEOY16gLQTRQeLYaY8bvLJ+Y1l3qcis11l9D7y6CPc05llooWrVnYVQuCklXYDzgPiPtzaJqZXaKeGOC1KH/YUwVs9gC6F7K8UvqPqShtyaMM2UCOGWb8C6tFBW7Y2ekM1UbS1ycYgo7wjp/sk38rhA8nx18k3Th4LyA/KWdrK5fBSdIq6C4czoTAM2Hj793qc5ErovfhDNPPY0EuHyMl4pj1ZmOiapsTMY Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id jv23-20020a05600c571700b0040fdd7cbc8dsm11631611wmb.47.2024.02.13.05.04.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 05:04:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zhao Liu , Bernhard Beschow , Paolo Bonzini , Mark Cave-Ayland , Richard Henderson , BALATON Zoltan , "Michael S. Tsirkin" , qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Marcel Apfelbaum , Eduardo Habkost Subject: [PATCH v4 04/12] hw/i386/q35: Realize LPC PCI function before accessing it Date: Tue, 13 Feb 2024 14:03:33 +0100 Message-ID: <20240213130341.1793-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213130341.1793-1-philmd@linaro.org> References: <20240213130341.1793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=philmd@linaro.org; helo=mail-lj1-x22c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Damien Hedde Reviewed-by: BALATON Zoltan --- hw/i386/pc_q35.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 7ca3f465e0..b7c69d55d6 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -248,13 +248,13 @@ static void pc_q35_init(MachineState *machine) /* create ISA bus */ lpc = pci_new_multifunction(PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC), TYPE_ICH9_LPC_DEVICE); - qdev_prop_set_bit(DEVICE(lpc), "smm-enabled", - x86_machine_is_smm_enabled(x86ms)); lpc_dev = DEVICE(lpc); + qdev_prop_set_bit(lpc_dev, "smm-enabled", + x86_machine_is_smm_enabled(x86ms)); + pci_realize_and_unref(lpc, host_bus, &error_fatal); for (i = 0; i < IOAPIC_NUM_PINS; i++) { qdev_connect_gpio_out_named(lpc_dev, ICH9_GPIO_GSI, i, x86ms->gsi[i]); } - pci_realize_and_unref(lpc, host_bus, &error_fatal); rtc_state = ISA_DEVICE(object_resolve_path_component(OBJECT(lpc), "rtc"));