[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: Thu, 10 Feb 2022 09:38:53 +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=uEqkvuJ5/4V8NnvZAKxYIs6jlIia3JW/ziM1jfYuOUA=; b=lCPaHpjzIWUk75jGCHgrX1UPegRKr4Y2HIlDRmXC83px35SYjt7LInSWs5XEnXUeLYhmZl5ZcY3lC3HlVdJeFpWxJCyv8jKC0yZBFyJc4r1Y+s9uc7BnXLfIwzgVFAlVz0TRTtKXbwEztA4A0dsf+jKf4GZAo+21KORRbrqSggCXtg/DCU1Obai8tzNx3b6z/8j8GiBo1L4De1V9HPdsCxqHsyP/RkhYZwMmswxyYYO2kJOjXLr9r79ARFGYn9H20LgEH/WG3lwtrvuEpamrrfbjpiiHdLfboUfTF3NW7V8nf3Ui2h8+YCJBIgf550iHKv5Y+sHFRz6bNEhf/JXxVA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dEnuQopIOWEqKnp1FruWnO14TdNe8VjX49wOO4x+6MbDnmHGEGjuFAyPQzfyKaZj2IBAwpv8S59HlyqSNbWtoChYIVCYZdI0mZZsjqfsdRyJOSz/oFRhri6iwPaaL9+5ZqS7hUKvPpl4uw7JkvVa96v/NVCVCfa16kxtrcku2EbuLPZJjNebY9RIDjHum5uKH5Fq5dxutZ7GMKRpmfL9lrLDS+GurcaorNK7ITQnUP071TAFp72cBzd+7VmgSQYl9R2LaWuWs8QHkusG6g6ZvzbLcgPGDHeif2gqACkeF/Hlf3RsiX+vfA0Ag+5lJaCJwRM4VZiMU88w3tBBDBWrpA==
  • 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: Thu, 10 Feb 2022 09:44:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYHRW1S717SraA0Ui+K6wc2/TNAKyJ+LkAgAEKd4CAACCZgIAAbkMAgAAMBYCAAOvKAA==
  • Thread-topic: [RFC v2 3/8] xen/arm: Export host device-tree to hypfs

On Wed, Feb 09, 2022 at 07:34:57PM +0000, Julien Grall wrote:
> Hi,
> 
> On 09/02/2022 18:51, Oleksii Moisieiev wrote:
> > 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.
> 
> I am sorry, but I don't understand why moving the code to common code
> prevents you to use !acpi_disabled. Can you clarify?
> 
Sorry, my bad. I thought that acpi_disabled is defined only for arm. Now
I've rechecked and see I was wrong.

> > 
> > 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.
> 
> I am not sure what's your point... Yes I wrote the same ASSERT() 9 years
> time. But people view evolves over the time.
> 
> There are some code I wished I had written differently (How about you? ;)).
> However, I don't have the time to rewrite everything I ever wrote. That
> said, I can at least make sure they are not spread.
> 

I'm sorry, I didn't mean to be rude. I've just tried to tell where I
took this assertion from.

> > 
> > What do you think if I omit dt_host->sibling check and make it:
> > 
> > if ( !dt_host )
> >      return -ENODEV;
> 
> We used to set dt_host even when booting with ACPI but that shouldn't be the
> case anymore. So I think this check should be fine.
> 

Ok, thank you. I'll do the change.

Best regards,
Oleksii.


 


Rackspace

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