All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksii Moisieiev <Oleksii_Moisieiev@epam.com>
To: Julien Grall <julien@xen.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [RFC v2 3/8] xen/arm: Export host device-tree to hypfs
Date: Thu, 10 Feb 2022 09:38:53 +0000	[thread overview]
Message-ID: <20220210093852.GA1700852@EPUAKYIW015D> (raw)
In-Reply-To: <6fcf1e16-0c9d-c871-76b7-59d9311e9db4@xen.org>

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.

  reply	other threads:[~2022-02-10  9:44 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 18:00 [RFC v2 0/8] Introduce SCI-mediator feature Oleksii Moisieiev
2022-02-08 18:00 ` [RFC v2 1/8] xen/hypfs: support fo nested dynamic hypfs nodes Oleksii Moisieiev
2022-02-10  7:34   ` Juergen Gross
2022-02-11  8:16     ` Oleksii Moisieiev
2022-02-11 13:28       ` Juergen Gross
2022-02-11 13:32         ` Oleksii Moisieiev
2022-02-08 18:00 ` [RFC v2 2/8] libs: libxenhypfs - handle blob properties Oleksii Moisieiev
2022-02-09 13:47   ` Oleksandr Andrushchenko
2022-02-09 14:01     ` Jan Beulich
2022-02-09 14:04       ` Oleksandr Andrushchenko
2022-02-09 14:04   ` Juergen Gross
2022-02-08 18:00 ` [RFC v2 3/8] xen/arm: Export host device-tree to hypfs Oleksii Moisieiev
2022-02-08 18:26   ` Julien Grall
2022-02-09 10:20     ` Oleksii Moisieiev
2022-02-09 12:17       ` Julien Grall
2022-02-09 14:17         ` Oleksii Moisieiev
2022-02-09 18:51         ` Oleksii Moisieiev
2022-02-09 19:34           ` Julien Grall
2022-02-10  9:38             ` Oleksii Moisieiev [this message]
2022-02-09 14:03     ` Juergen Gross
2022-02-08 18:00 ` [RFC v2 4/8] xen/arm: add generic SCI mediator framework Oleksii Moisieiev
2022-02-08 18:00 ` [RFC v2 5/8] xen/arm: introduce SCMI-SMC mediator driver Oleksii Moisieiev
2022-02-09 15:02   ` Oleksandr Andrushchenko
2022-02-09 15:23     ` Julien Grall
2022-02-11  8:46   ` Bertrand Marquis
2022-02-11 10:44     ` Oleksii Moisieiev
2022-02-11 11:18       ` Bertrand Marquis
2022-02-11 11:55         ` Oleksii Moisieiev
2022-02-11 23:35           ` Stefano Stabellini
2022-02-12 12:43         ` Julien Grall
2022-02-14 11:13           ` Oleksii Moisieiev
2022-02-14 11:27             ` Bertrand Marquis
2022-02-14 11:51               ` Oleksii Moisieiev
2022-02-14 22:05                 ` Stefano Stabellini
2022-02-16 17:41                   ` Oleksii Moisieiev
2022-02-08 18:00 ` [RFC v2 6/8] tools/arm: Introduce force_assign_without_iommu option to xl.cfg Oleksii Moisieiev
2022-02-17 14:52   ` Anthony PERARD
2022-02-18  8:19     ` Oleksii Moisieiev
2022-02-17 15:20   ` Julien Grall
2022-02-18  9:16     ` Oleksii Moisieiev
2022-02-18 10:17       ` Julien Grall
2022-02-21 18:39         ` Oleksii Moisieiev
2022-06-03 13:43   ` Jan Beulich
2022-02-08 18:00 ` [RFC v2 7/8] tools/arm: add "arm_sci" " Oleksii Moisieiev
2022-02-08 18:00 ` [RFC v2 8/8] xen/arm: add SCI mediator support for DomUs Oleksii Moisieiev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220210093852.GA1700852@EPUAKYIW015D \
    --to=oleksii_moisieiev@epam.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.