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

Re: [RFC v2 3/8] xen/arm: Export host device-tree to hypfs


  • To: Julien Grall <julien@xxxxxxx>
  • From: Oleksii Moisieiev <Oleksii_Moisieiev@xxxxxxxx>
  • Date: Wed, 9 Feb 2022 18:51:57 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=5Fz0jYHNqsq+CFUOHWsmDaJYjSHjqInO4tNdjh3ABGA=; b=YjxhNhdSY/P3hLwSEGKhHKFIl9FGvBapxRgMkk44RQeMpI9QhA4BiKitc0SGmTtInggaXyL4g20QZHP8tE+pj7r6fBiRb/sqGCIckrB/uYi4vksJ0b0tO40NpRrjUyILsgqowGenk6BLsZIMVR9hpg445QRicdKygGAhohCQuOE2C/yLVMcg9t7Mis35MAFIH7RP8lsm29ybq80S+Qf3RrTBB4bk0JwPLp72AQR9ZkCUKEOvkoXRl8/v+QVo7m4xQjV4RJtquCMge6TXmaXH7P10a8oJuU5XUb5NbdAab/pBzW/JbtXnGGWX8DjOYHQIXH9euV0wG0yK04oN4rJyUg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bxbKk3E6/9yB4MDJXhkm+UwXSy3vneND51tz02liEvV9CUyPuGGexkTlKsD9To1tUUoT0JYt3ltd36EPfSFq/MWxiTSCy88fcKN/NXPwuXgu7by/+F2BF9txucNZadbiigSbJTKdThhjfaV19BjWF3xfXilwIEAgIEogmuVvSYT9SautxHPbpilima+XvWBR47cRnJwxULrUICoN8Wl9d8igW2JDJ4yPRkY2C1GhNhkgijcCfoROlP2FqomxxZSMjj8h1OTwbH3d2WyJGRxKxaJ2+Q07OhHtxwjQzI2ceH33cDfazQI0PZpR7XQoFpzIPHvPoDn6T5v+7z4EisR4Kg==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Wed, 09 Feb 2022 18:53:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYHRW1S717SraA0Ui+K6wc2/TNAKyJ+LkAgAEKd4CAACCZgIAAbkMA
  • Thread-topic: [RFC v2 3/8] xen/arm: Export host device-tree to hypfs

On Wed, Feb 09, 2022 at 12:17:17PM +0000, Julien Grall wrote:
> > > > +static HYPFS_DIR_INIT_FUNC(host_dt_dir, HOST_DT_DIR, 
> > > > &host_dt_dir_funcs);
> > > > +
> > > > +static int __init host_dtb_export_init(void)
> > > > +{
> > > > +    ASSERT(dt_host && (dt_host->sibling == NULL));
> > > 
> > > dt_host can be NULL when booting on ACPI platform. So I think this wants 
> > > to
> > > be turned to a normal check and return directly.
> > > 
> > 
> > I will replace if with
> > if ( !acpi_disabled )
> >      return -ENODEV;
> > 
> > > Also could you explain why you need to check dt_host->sibling?
> > > 
> > 
> > This is my way to check if dt_host points to the top of the device-tree.
> > In any case I will replace it with !acpi_disabled as I mentioned
> > earlier.
> 
> dt_host will always points to the root of the host device-tree. I don't
> think it is the job of hypfs to enforce it unless you expect the code to be
> buggy if this happens. But then I would argue the code should be hardened.
> 

Hi Julien,

Unfortunatelly I can't use acpi_disabled in host_dtb_export_init because
I've already moved host_dtb_export.c to the common folder.

As for the host->sibling - I took the whole assert:
ASSERT(dt_host && (dt_host->sibling == NULL));
from the prepare_dtb_hwdom function. And this assertion was added by the
commit b8f1c5e7039efbe1103ed3fe4caedf8c34affe13 authored by you.

What do you think if I omit dt_host->sibling check and make it:

if ( !dt_host )
    return -ENODEV;

Best regards,
Olkesii.


 


Rackspace

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