From nobody Tue Nov 18 06:04:49 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1607921990; cv=none; d=zohomail.com; s=zohoarc; b=GDw0R8H22aO8mgmmxflG2KTh50bOGKc9MVdzdeN9/LaBgEZDIa/Ws3qpke3fYeTg102o6b+2aXN9/GeYEnZ15NmIj5H2HGxfrDHnlGjpNGM7nVG/sSpDl1/WO0UNbDRa6Jgv7zSGJjYlp/AxJgX4N3t6immjYhMU/+dSuFqJLo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607921990; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LrsjIKEMo18Bl4TniGRzfHvIwWJAPROsjQHf7lHb4Hc=; b=niCHRmNuSZ1HUJfJRY72nCUCI4+DVj2thl9U408djZrtCLNgiA+nBDNHMcfEJJCfiSHVwjy4jmhDeM1VTaTDQJzUmZ98bsfA521K0JLar7a1qxepI9C5O6DlnJYGPsobAu06C1ZWByRthG8EUOpjREZsPWr+NBEs4x77M56yPzo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607921990309891.1331437789947; Sun, 13 Dec 2020 20:59:50 -0800 (PST) Received: from localhost ([::1]:41014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kofxc-0006za-LE for importer@patchew.org; Sun, 13 Dec 2020 23:59:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kofwL-00058R-6r; Sun, 13 Dec 2020 23:58:30 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:36091) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kofwI-0004pG-OU; Sun, 13 Dec 2020 23:58:28 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4CvTfp6ZqJz9sSC; Mon, 14 Dec 2020 15:58:10 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1607921890; bh=gfeNh3a0FmYAZk7sxGaHo1IQu2z3E9m3i+0g+ViVWlk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iHfn8/EXTPygIWvg6AjAvZcvghS57BCu9H0MQNFKivpMXDiZPZ5bmWovCndtwPqCQ c6VAdhQ5QLy9+2Hrn7SyjhRSL9KOfg6qjZD7t9bqmkDrsGLH6QqA4MmEufxaZbK2Pb b/bnA1lYN5f+3/fcYrfSXdePAU5eEjvpFTofLOSw= From: David Gibson To: peter.maydell@linaro.org Subject: [PULL 01/30] spapr/xive: Turn some sanity checks into assertions Date: Mon, 14 Dec 2020 15:57:38 +1100 Message-Id: <20201214045807.41003-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201214045807.41003-1-david@gibson.dropbear.id.au> References: <20201214045807.41003-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2401:3900:2:1::2; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org 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, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, groug@kaod.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Greg Kurz The sPAPR XIVE device is created by the machine in spapr_irq_init(). The latter overrides any value provided by the user with -global for the "nr-irqs" and "nr-ends" properties with strictly positive values. It seems reasonable to assume these properties should never be 0, which wouldn't make much sense by the way. Signed-off-by: Greg Kurz Message-Id: <20201120174646.619395-2-groug@kaod.org> Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: David Gibson --- hw/intc/spapr_xive.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index 1fa09f287a..60e0d5769d 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -296,22 +296,16 @@ static void spapr_xive_realize(DeviceState *dev, Erro= r **errp) XiveENDSource *end_xsrc =3D &xive->end_source; Error *local_err =3D NULL; =20 + /* Set by spapr_irq_init() */ + g_assert(xive->nr_irqs); + g_assert(xive->nr_ends); + sxc->parent_realize(dev, &local_err); if (local_err) { error_propagate(errp, local_err); return; } =20 - if (!xive->nr_irqs) { - error_setg(errp, "Number of interrupt needs to be greater 0"); - return; - } - - if (!xive->nr_ends) { - error_setg(errp, "Number of interrupt needs to be greater 0"); - return; - } - /* * Initialize the internal sources, for IPIs and virtual devices. */ --=20 2.29.2