All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Orzel <michal.orzel@amd.com>
To: Luca Fancellu <Luca.Fancellu@arm.com>, Julien Grall <julien@xen.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Penny Zheng <Penny.Zheng@arm.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Wei Chen <Wei.Chen@arm.com>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>
Subject: Re: [PATCH v8 7/9] xen/arm: create shared memory nodes in guest device tree
Date: Fri, 9 Sep 2022 15:35:40 +0200	[thread overview]
Message-ID: <e75b8019-4513-126d-3e6e-f71f44a5f17c@amd.com> (raw)
In-Reply-To: <FBA398EE-B1AD-4394-A357-6DFF77E374D9@arm.com>

Hi Luca,

On 09/09/2022 14:35, Luca Fancellu wrote:
> 
>> On 9 Sep 2022, at 10:40, Bertrand Marquis <Bertrand.Marquis@arm.com> wrote:
>>
>> Hi Julien,
>>
>>> On 9 Sep 2022, at 10:27, Julien Grall <julien@xen.org> wrote:
>>>
>>> Hi,
>>>
>>> On 09/09/2022 08:45, Bertrand Marquis wrote:
>>>>>
>>>>> It should be:
>>>>>
>>>>> /*
>>>>> * TODO:
>>>>> *
>>>>>
>>>>> I think this is good to go. The two minor style issues could be fixed on
>>>>> commit. I haven't committed to give Julien & Bertrand another chance to
>>>>> have a look.
>>>> I think that it is ok to fix those on commit and I am ok with the rest so:
>>>> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
>>>
>>> This series doesn't build without !CONFIG_STATIC_SHM:
>>>
>>> UPD     include/xen/compile.h
>>> Xen 4.17-unstable
>>> make[1]: Nothing to be done for `include'.
>>> make[1]: `arch/arm/include/asm/asm-offsets.h' is up to date.
>>> CC      common/version.o
>>> LD      common/built_in.o
>>> CC      arch/arm/domain_build.o
>>> arch/arm/domain_build.c: In function ‘make_shm_memory_node’:
>>> arch/arm/domain_build.c:1445:1: error: no return statement in function returning non-void [-Werror=return-type]
>>> }
>>> ^
>>> cc1: all warnings being treated as errors
>>> make[2]: *** [arch/arm/domain_build.o] Error 1
>>> make[1]: *** [arch/arm] Error 2
>>> make: *** [xen] Error 2
>>>
>>> This is because...
>>>
>>>>>> +         * - xen,offset: (borrower VMs only)
>>>>>> +         *   64 bit integer offset within the owner virtual machine's shared
>>>>>> +         *   memory region used for the mapping in the borrower VM
>>>>>> +         */
>>>>>> +        res = fdt_property_u64(fdt, "xen,offset", 0);
>>>>>> +        if ( res )
>>>>>> +            return res;
>>>>>> +
>>>>>> +        res = fdt_end_node(fdt);
>>>>>> +        if ( res )
>>>>>> +            return res;
>>>>>> +    }
>>>>>> +
>>>>>> +    return res;
>>>>>> +}
>>>>>> +#else
>>>>>> +static int __init make_shm_memory_node(const struct domain *d,
>>>>>> +                                       void *fdt,
>>>>>> +                                       int addrcells, int sizecells,
>>>>>> +                                       const struct meminfo *mem)
>>>>>> +{
>>>>>> +    ASSERT_UNREACHABLE();
>>>
>>> ... there is a missing 'return -ENOTSUPP' here. While this is simple enough to fix, this indicates to me that this version was not tested with !CONFIG_STATIC_SHM.
>>>
>>> As this is the default option, I will not commit until I get confirmation that some smoke was done.
>>
>> This is a case our internal CI should have gone through.
>> Let me check and come back to you.
>>
> 
> Hi Julien,
> 
> Thanks for catching it, in this case I can confirm that the problem was that we are building with CONFIG_DEBUG enabled, I don’t know why GCC doesn’t complain when
> you have __builtin_unreachable() in that function without any return value, it doesn’t even throw a warning. Could it be considered a bug in GCC?

This is not a bug. The documentation states what is the purpose of it even in case of functions returning type.
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

To sump up __builtin_unreachable generates code itself to return.

> 
> Building Xen without CONFIG_DEBUG instead shows up the error you found.
> 
> In this case this change will fix the problem, do you agree on it?
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 8c77c764bcf2..c5d66f18bd49 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1439,6 +1439,8 @@ static int __init make_shm_memory_node(const struct domain *d,
>                                         const struct meminfo *mem)
>  {
>      ASSERT_UNREACHABLE();
> +
> +    return -EOPNOTSUPP;
>  }
>  #endif
> 
> Is it something that can be addressed on commit?
> 
> Cheers,
> Luca
> 
> 
>> Regards
>> Bertrand
>>
>>>
>>> Cheers,
>>>
>>> --
>>> Julien Grall
> 

~Michal


  reply	other threads:[~2022-09-09 13:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 13:55 [PATCH v8 0/9] static shared memory on dom0less system Penny Zheng
2022-09-08 13:55 ` [PATCH v8 1/9] xen/arm: introduce static shared memory Penny Zheng
2022-09-08 13:55 ` [PATCH v8 2/9] xen/arm: assign static shared memory to the default owner dom_io Penny Zheng
2022-09-08 13:55 ` [PATCH v8 3/9] xen/arm: allocate static shared memory to a specific owner domain Penny Zheng
2022-09-08 13:55 ` [PATCH v8 4/9] xen/arm: introduce put_page_nr and get_page_nr Penny Zheng
2022-09-08 13:55 ` [PATCH v8 5/9] xen/arm: Add additional reference to owner domain when the owner is allocated Penny Zheng
2022-09-08 13:55 ` [PATCH v8 6/9] xen/arm: set up shared memory foreign mapping for borrower domain Penny Zheng
2022-09-08 13:55 ` [PATCH v8 7/9] xen/arm: create shared memory nodes in guest device tree Penny Zheng
2022-09-08 21:05   ` Stefano Stabellini
2022-09-09  7:45     ` Bertrand Marquis
2022-09-09  9:27       ` Julien Grall
2022-09-09  9:40         ` Bertrand Marquis
2022-09-09 12:35           ` Luca Fancellu
2022-09-09 13:35             ` Michal Orzel [this message]
2022-09-09 20:47             ` Stefano Stabellini
2022-09-08 13:55 ` [PATCH v8 8/9] xen/arm: enable statically shared memory on Dom0 Penny Zheng
2022-09-08 13:55 ` [PATCH v8 9/9] xen: Add static memory sharing in SUPPORT.md Penny Zheng

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=e75b8019-4513-126d-3e6e-f71f44a5f17c@amd.com \
    --to=michal.orzel@amd.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Luca.Fancellu@arm.com \
    --cc=Penny.Zheng@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=Wei.Chen@arm.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.