From patchwork Thu Oct 19 21:17:48 2023 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: 735624 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1731430wro; Thu, 19 Oct 2023 14:24:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFk9oKVG4yAiv22f3MFuGfPZj7OwZ4FVu4sCCQU5c8QaNt0LrOYPXAIIu26VHSXOSVrvieK X-Received: by 2002:ac8:58c9:0:b0:41c:c428:2be3 with SMTP id u9-20020ac858c9000000b0041cc4282be3mr3703811qta.46.1697750670125; Thu, 19 Oct 2023 14:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697750670; cv=none; d=google.com; s=arc-20160816; b=kG4Nl6GTJCpid736xZRV0mG6BiZzdKcqTwppLzKBcaqcHBPifHq9EVap6ij+nIADk5 b7gzBH31e3dKv4M8dpfYbp1uQqIJEkXs/UV6yxd1WhPk5lalp7pgVR8a+9q+kST+fBqW +ly/5oYJKs8pLq/V81wHXXnuH4FpOdv+wZU333/Lwcn2VE3qe0oFHSIf7t/uYWa011WC xYAVC3shOBWK0T1LddoBUnQ1DwWvEnh5EgS5mwaVxYwJxm5P/Oc6aeFBGahLIj8cXBrh xCka9u7d5FYk1VlOn2lIhhY4RpD0aOFoneALzYvv7LkLVxePqYHne75hnjVLTXvSwz89 SOdA== 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=kG3m+UrB+1tXa81IHczK7QBkGPM1a1yV1vD8kixZHhU=; fh=AVBhj4Fy+QyIIwcX4VOy9V2m7/XoySUoeqZjVcC7SWY=; b=VJA6Rc/aI3afE1CNKFUMSGSdMmNLO63b7gt7791RFXc1ZbqUjs2lTo+5pXUUhCFgG6 M1r5X2+qVSUiaE422Z4QBau9KLHpQmyVp7z6zBTd/EulyiYlQ4+hMIDMfXoFaxzxDovK dIVvmTwLR+xNNhyxmUjNg8imZmJp5XuHIyJFkdvVgGzz2hYcNRZpjEazHWuO75bbr9Rj seM/DJZTCcMtx8l1dSOCzz0adqve1jipWr3kc2QsuKRpSTSukgIBk2FhkZaRhZG3Mr2x Vf3IYVYqfcPJYlo/hHEJ9/Ahh2ObHMif6X3eR0uzmXZBfvd4J63NPx8SbfNJ5iCKArau t19g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zxWNbtDB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p19-20020a05622a00d300b00417b189f692si252735qtw.503.2023.10.19.14.24.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 14:24:30 -0700 (PDT) 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=zxWNbtDB; 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 1qtaRq-0000vP-Sx; Thu, 19 Oct 2023 17:20:54 -0400 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 1qtaRp-0000uL-8X for qemu-devel@nongnu.org; Thu, 19 Oct 2023 17:20:53 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtaRm-0005do-TQ for qemu-devel@nongnu.org; Thu, 19 Oct 2023 17:20:53 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4083cd39188so939375e9.2 for ; Thu, 19 Oct 2023 14:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697750449; x=1698355249; 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=kG3m+UrB+1tXa81IHczK7QBkGPM1a1yV1vD8kixZHhU=; b=zxWNbtDBgcvI2l+R/7m3HyIXyXO79WWJGiO70Tyg+MJ+nj4ReWReEiuTC1eqjddfMj HsUdd//q6a7Wmo5tQ3GALNuYLw6lIJ0nhGcQAuvcsFVFz4oXBmDLkylxG+KrQcXNByI/ iUPFyXjV3JlcqYqIsHA8/1Up6YX0p4dtQqxgnIQ3/XHlt0/NdoV1Vrdu+oFSPFQrZpXg rK7st6hyZZciHqj02XZ10a+1OIuBIXcZNNl1cZTLY27kZJBG/QKiXjsXkCTCG399dUtD sO8sgTGnH+N+W5B6brwukB+0RlOk0A3WgYpeYx+vxz2tmc9+3PX+cv6ZUSts9wead9l8 HE6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697750449; x=1698355249; 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=kG3m+UrB+1tXa81IHczK7QBkGPM1a1yV1vD8kixZHhU=; b=QznS8Y9Ta1bJDUTHQ74l8TGPauekRjpF1mm5xpz3j6OQcMWUrG7eLiHt1UR2wpG3B4 RkqhFGfCahxr8TvEworBpO5V9A6bairbk3Y66BW5a9VKYSO4iMlm+5xfg/cfwxyYU8bs 2xHGo8LytrXXRM/PZiSKyCUQSwoxoM5GCBvXoh7yfkDYJAz6gWPfxKGIctJ1dD6NocZA dWQExMhEpymeNDodSSw1vRfb1A0PpsB2xTkHHANBV7Z68cXHa37XP3YgjGAHkUQjUIdO vJrgLsnNnnlLe0W4PC+S+/YhSKtmmvndTOt8DdS8gJLKEkfRiUM2kQM4rUrTt3LWmnpk bb6Q== X-Gm-Message-State: AOJu0YyOBcNLCAM2pjYHhSxcD5w5Wj3RRjDM/b+hpNMXxTKBAZAMmcoM m4dTrRfBYJpoojYcG+1F92n296XH9FsWnUxAvM3PPA== X-Received: by 2002:a05:600c:1d25:b0:408:3eaa:aea6 with SMTP id l37-20020a05600c1d2500b004083eaaaea6mr69227wms.7.1697750449130; Thu, 19 Oct 2023 14:20:49 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id t6-20020a05600c450600b0040535648639sm515316wmo.36.2023.10.19.14.20.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 14:20:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Thomas Huth , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora Subject: [PULL 23/46] hw/ppc/spapr_vio: Realize SPAPR_VIO_BRIDGE device before accessing it Date: Thu, 19 Oct 2023 23:17:48 +0200 Message-ID: <20231019211814.30576-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019211814.30576-1-philmd@linaro.org> References: <20231019211814.30576-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 qbus_new() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Reviewed-by: Thomas Huth Message-Id: <20231019131647.19690-2-philmd@linaro.org> --- hw/ppc/spapr_vio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c index 9d4fec2c04..f8ef2b6fa8 100644 --- a/hw/ppc/spapr_vio.c +++ b/hw/ppc/spapr_vio.c @@ -574,13 +574,14 @@ SpaprVioBus *spapr_vio_bus_init(void) /* Create bridge device */ dev = qdev_new(TYPE_SPAPR_VIO_BRIDGE); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); /* Create bus on bridge device */ qbus = qbus_new(TYPE_SPAPR_VIO_BUS, dev, "spapr-vio"); bus = SPAPR_VIO_BUS(qbus); bus->next_reg = SPAPR_VIO_REG_BASE; + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + /* hcall-vio */ spapr_register_hypercall(H_VIO_SIGNAL, h_vio_signal);