From nobody Mon Nov 25 07:25:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1717413464; cv=none; d=zohomail.com; s=zohoarc; b=Zf227Wl6oZvzf9kmXTgXRLopGthde6yrdDjdoK272mBe5QUSLWfelT4dPsSkt/at3YyjksF9sMMonIacNtx0encsYQHAPApjqoLytjfjV5XoMxjIkgJq5PqtskKO6tdnWrdlDczufT4RLGdy4f7rd2aZ3e8whL52bK4YvG3Z+DY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717413464; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=F2fI6nwAJXeFe1hxyMYDF/QLET3EtTO13tMnuGkb/Vs=; b=OmBrB6krLjgoSYSrl677+LgEbUcJpB0WtCp1LvDMIO8jJjNiu1PfIxgt0kzdWPcy25gSmrCyUNQ8lCY4Dv6TKbQLDtBKMXrakV4mV/tSJ8Nt+cArNXr6EOzH5v4LS1nzG19O1MNzoLiqk9TPbdHlHP0uCiiyxKBpqo4GoVURr9M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1717413464059366.37310844633794; Mon, 3 Jun 2024 04:17:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE5gi-0003MC-II; Mon, 03 Jun 2024 07:17:18 -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 1sE5gW-0003E1-LW; Mon, 03 Jun 2024 07:17:04 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sE5gR-00069c-0o; Mon, 03 Jun 2024 07:17:04 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-7026ad046a2so622274b3a.2; Mon, 03 Jun 2024 04:16:58 -0700 (PDT) Received: from toolbox.alistair23.me (2403-580b-97e8-0-82ce-f179-8a79-69f4.ip6.aussiebb.net. [2403:580b:97e8:0:82ce:f179:8a79:69f4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6323e18c7sm62375435ad.177.2024.06.03.04.16.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 04:16:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717413417; x=1718018217; 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=F2fI6nwAJXeFe1hxyMYDF/QLET3EtTO13tMnuGkb/Vs=; b=cSza6VZdQ+EaOp1JNPegF+7yiEy5JImzjs7Nf903l/4G5Awpvc31NHIB8Hft2oxf7h Dzh/Ex7boiBYSgbhsB/YfY3eyPbhDJZP0M/H8Fcqx2bvq3EXMxaYlnGpuu2fnSmntrfR 2LDcfqmmVezZVQLjG35qq0OKZrlUhBCLK9NVS+6kyGLd5+pV+fEL+b4RiCJytzjza6ho SU7Xjbg5R9sJg7OxAa7fQyNYVgOsrgdRb3zXJ55KmJsk6isE6bIFxWfOUn+gILG7q/3x +yM5C1rWaVyxm8q/4OtNME2r+4u0dAsKlMRzgtvPYxo/eYdEakeCIZPC9H3iHgREo295 qYyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717413417; x=1718018217; 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=F2fI6nwAJXeFe1hxyMYDF/QLET3EtTO13tMnuGkb/Vs=; b=CiOIzQRg8tkM0nNg5mTRHfJQ1rYoM+DAAQ8hUzok23CtcN54zRKh5w9yfSP4LJOYlB aHeN+8aBV7RUW1bW5krYxWIfzvR19JoSy5LnWU8Kow3BwybZBN+2X3qJFjGCP+HxORfr HoJqtapEedu8/CZ+eFXcMlYaJYEFMV6ByYkl+1QC8JRUrT5x9hciJbLJM7iqOfQNrlVx JckZJ7d2iaDdExD1NaqO0KunCaB7ehvKfRKW4mSX09IHWHN7794viU0rrpL29ymN2UIz Rdrfv7iUFDooRQy738GxkEwV3JJQxcmwLJWkbAPFdH/mL2eQ/+e7fUYwD9tE96upwIxr o2mg== X-Forwarded-Encrypted: i=1; AJvYcCWR6wBWzxKjIJxsksUZoWXkINtmcRJzNhVGyoKpZuIku6NhhOThPubcMM5SpXkjVn22ihge3V5coC1+NjaHzCVwbtZ7vgSk X-Gm-Message-State: AOJu0YxtQeOv8+WCYKxaNkcev8ruxQV3Otdg/n0Tk99SFqa+A4g8sd7h pVc2N36XNcXMYYu2dCDQh5WslrjJboF0zrqzQCsFJKffJerja/oeZXByWg== X-Google-Smtp-Source: AGHT+IFtlEScgxX0IALRTDBUEWCwikW6IgOTZQvS5/qI9OZXkvAJeqljLyUTVKu6WP3RJnjXn5H/LQ== X-Received: by 2002:a05:6a20:158a:b0:1af:cc75:3f79 with SMTP id adf61e73a8af0-1b26f30e460mr9127997637.55.1717413416774; Mon, 03 Jun 2024 04:16:56 -0700 (PDT) From: Alistair Francis X-Google-Original-From: Alistair Francis To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, "yang.zhang" , Daniel Henrique Barboza , qemu-stable , Alistair Francis Subject: [PULL v2 01/27] hw/intc/riscv_aplic: APLICs should add child earlier than realize Date: Mon, 3 Jun 2024 21:16:17 +1000 Message-ID: <20240603111643.258712-2-alistair.francis@wdc.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240603111643.258712-1-alistair.francis@wdc.com> References: <20240603111643.258712-1-alistair.francis@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=alistair23@gmail.com; helo=mail-pf1-x42c.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1717413465876100007 Content-Type: text/plain; charset="utf-8" From: "yang.zhang" Since only root APLICs can have hw IRQ lines, aplic->parent should be initialized first. Fixes: e8f79343cf ("hw/intc: Add RISC-V AIA APLIC device emulation") Reviewed-by: Daniel Henrique Barboza Signed-off-by: yang.zhang Cc: qemu-stable Message-ID: <20240409014445.278-1-gaoshanliukou@163.com> Signed-off-by: Alistair Francis --- hw/intc/riscv_aplic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/intc/riscv_aplic.c b/hw/intc/riscv_aplic.c index fc5df0d598..32edd6d07b 100644 --- a/hw/intc/riscv_aplic.c +++ b/hw/intc/riscv_aplic.c @@ -1000,16 +1000,16 @@ DeviceState *riscv_aplic_create(hwaddr addr, hwaddr= size, qdev_prop_set_bit(dev, "msimode", msimode); qdev_prop_set_bit(dev, "mmode", mmode); =20 + if (parent) { + riscv_aplic_add_child(parent, dev); + } + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 if (!is_kvm_aia(msimode)) { sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, addr); } =20 - if (parent) { - riscv_aplic_add_child(parent, dev); - } - if (!msimode) { for (i =3D 0; i < num_harts; i++) { CPUState *cpu =3D cpu_by_arch_id(hartid_base + i); --=20 2.45.1