From nobody Thu May 16 08:23:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1689981222; cv=none; d=zohomail.com; s=zohoarc; b=Rqxm/GPdxttql86fFSu4OqOHHTuUlRfrlw6I3dkCRGqyuaTb6+KyAF7xoL7pq8ZInBUJdVAkSAvcWqmaiU0so9A61zgiwYP0abG3Br7Zx3rwjIVX5AsS1mgu/K5YUuvvWrVh8Fw07ZVqzJswW7q8Aqk6gDzU1QRk9sww+tthJso= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689981222; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ASmmiOMWM1QJbTGc6xlw6wfBn6mQTfyV2z5D3IV+sq4=; b=fF3GWdqNpvI6l27aiw5ztsaIOXTxWy30oVMaW1953usufpkpWWafCiwc519Y6Krihp2Bqov42yS3wHFatS+9NCUbjSnCABYXsV+5Ym2HKooDW7i9JEGpvJVFvWs8RLaKd4mdUwnTBU+JHmEQeWX6BlRaS+pExmCD58jlxq6Url8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1689981222499290.89984467940565; Fri, 21 Jul 2023 16:13:42 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.567741.887195 (Exim 4.92) (envelope-from ) id 1qMzJ9-0007ZG-DK; Fri, 21 Jul 2023 23:13:11 +0000 Received: by outflank-mailman (output) from mailman id 567741.887195; Fri, 21 Jul 2023 23:13:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qMzJ9-0007Z9-Al; Fri, 21 Jul 2023 23:13:11 +0000 Received: by outflank-mailman (input) for mailman id 567741; Fri, 21 Jul 2023 23:13:09 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qMzJ7-0007Z3-M2 for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 23:13:09 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 26728197-281c-11ee-b23a-6b7b168915f2; Sat, 22 Jul 2023 01:13:07 +0200 (CEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 56B5561DA6; Fri, 21 Jul 2023 23:13:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12038C433C7; Fri, 21 Jul 2023 23:13:04 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 26728197-281c-11ee-b23a-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689981185; bh=CQjnTZRieSPJBy5tqH0/lc09aY1+gJmSqr/VPaOnrlY=; h=Date:From:To:cc:Subject:From; b=oXrwpICt7Kx2mTe9TBiZFnq8H7+GEP3RV0g/Cspqa4gIXWY5xsrmYYDlxwHnmijZm zAbNY16m0wDnOS8TzE4KV4wrEbPCo/8XauKQ6agweVaTXPhFOQubISG7+5GHur6+cg LuPCLClT9+SLC0Lau2aB7+ORomYm0AyvluGo/lxLaZDYGdCOE4vdhYqT6uEzfq+1Go VFCG3WKYCrQkOh06KmhDrTJVVh25rPvmucJ3Ab/hy+lkk3yDjDsUtx+tNbHBuqPv+o WJW2sVQp+EXN81FbPhw8nULubiob2RvJxhoLLtUH0pmDv29BNccTcVehMARfpKjoGV auX/pxaR9wveg== Date: Fri, 21 Jul 2023 16:13:03 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: jgross@suse.com cc: sstabellini@kernel.org, oleksandr_tyshchenko@epam.com, xen-devel@lists.xenproject.org, pmladek@suse.com Subject: [PATCH] xenbus: check xen_domain in xenbus_probe_initcall Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1689981224360100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The same way we already do in xenbus_init. Fixes the following warning: [ 352.175563] Trying to free already-free IRQ 0 [ 352.177355] WARNING: CPU: 1 PID: 88 at kernel/irq/manage.c:1893 free_irq= +0xbf/0x350 [...] [ 352.213951] Call Trace: [ 352.214390] [ 352.214717] ? __warn+0x81/0x170 [ 352.215436] ? free_irq+0xbf/0x350 [ 352.215906] ? report_bug+0x10b/0x200 [ 352.216408] ? prb_read_valid+0x17/0x20 [ 352.216926] ? handle_bug+0x44/0x80 [ 352.217409] ? exc_invalid_op+0x13/0x60 [ 352.217932] ? asm_exc_invalid_op+0x16/0x20 [ 352.218497] ? free_irq+0xbf/0x350 [ 352.218979] ? __pfx_xenbus_probe_thread+0x10/0x10 [ 352.219600] xenbus_probe+0x7a/0x80 [ 352.221030] xenbus_probe_thread+0x76/0xc0 Signed-off-by: Stefano Stabellini Tested-by: Petr Mladek diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_= probe.c index 58b732dcbfb8..e9bd3ed70108 100644 Reviewed-by: Oleksandr Tyshchenko --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c @@ -811,6 +812,9 @@ static int xenbus_probe_thread(void *unused) =20 static int __init xenbus_probe_initcall(void) { + if (!xen_domain()) + return -ENODEV; + /* * Probe XenBus here in the XS_PV case, and also XS_HVM unless we * need to wait for the platform PCI device to come up or