[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xenbus: check xen_domain in xenbus_probe_initcall


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>
  • Date: Sat, 22 Jul 2023 13:00:01 +0000
  • Accept-language: en-US, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yyQncW3QjF1r9yAUxjyLtg5BVB8a24sKRAj9UFU6RFM=; b=CROasv3W34d9XufyPM4hz0cfG2ZaT3PtBgmK/+/LQv7bn3WLtWSo2kYFw45cEjnHfp9YTTSupl0iyrXinaV9cvBgnY4ABFxqHmQ8aJ+uMHX4ixQET4G4l0dcdvOrE5jLkzQlU9c54iYU2B8t5pSisTwOEEkB0lEmggNVOi6QRh6UM6mXDF57LGlWnU+RoPTGRSAnQWsTCKvoOag7PKB2BnlYxm4fXVBC1swle24FIWe5LR0jXQLMbn/X5k+/YFYiE3LGDcd6egMompDIExo4CsvIgFDo4WXCvvWk8w58Np9UrKgiITgtEzI38Io+v0MKzmNoom4PsHkPU+opiTAuGA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lvEQKk5mLVB9YTb2GqU9cgs8Yc2DKK41dnvbSGgBEVwKBETOpbIL5P+wxLPI+u8RAnHmje+sRSoXJ057qLcaj6BTTEffPzwfXA3AkJQgoFZGSS7EDFcGuJsKcyj6oWpL48d4y8zWfg3yublKTfmLRQQ0XhPi0IQMQiSBYe1fhgn67gMKxg6vaeH7DL6+xzuyAnK+Otp7ydmD3NpmLhzXw7HZGMtMFOabHV2dI1LrYSOMbG4q9NLHQkAF4qmbxLRDv/1FnBetO9YDzPTmG070WNZAUp/6aTvZxJ/YxJk9izS1ilbLeFuYPuz1Nc1Zpbk/itLMewh+ykkIzWkkcBBemw==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "pmladek@xxxxxxxx" <pmladek@xxxxxxxx>, "jgross@xxxxxxxx" <jgross@xxxxxxxx>
  • Delivery-date: Sat, 22 Jul 2023 13:00:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZvCju+wR/K2O8tkyLPTyf5+laP6/FwIeA
  • Thread-topic: [PATCH] xenbus: check xen_domain in xenbus_probe_initcall


On 22.07.23 02:13, Stefano Stabellini wrote:

Hello Stefano


> 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]  <TASK>
> [  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 <stefano.stabellini@xxxxxxx>
> Tested-by: Petr Mladek <pmladek@xxxxxxxx>


Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>

I guess this wants to gain the Fixes tag:

Fixes: 5b3353949e89 ("xen: add support for initializing xenstore later 
as HVM domain")



> 
> diff --git a/drivers/xen/xenbus/xenbus_probe.c 
> b/drivers/xen/xenbus/xenbus_probe.c
> index 58b732dcbfb8..e9bd3ed70108 100644
> --- 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)
>   
>   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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.