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

Re: [PATCH v8 7/9] xen/arm: create shared memory nodes in guest device tree


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Fri, 9 Sep 2022 12:35:54 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=DB4irmaGsLrNw968AkoqxufXa1FXjHqMsMSgbafPtVk=; b=U6yF+2nN1ivRe8wFyXWzjWmkXcLcJF0d5IbUbI3gZdt2cYCiexiRB3IYnBTbLbG5WcPm6yH1BSBI4RiHUam7mQBgCSkCtVWlRrLZXL1mnqbEIX2Fq2EbShN0UhnI4e7WQ386Gb0nOPINS3ZKQnSy9fw1RfC+0a/JDg8QYGXnPnC7WHupA3IXB9WxWzRhXiSik8nMKo6g/zLk/Fu7u6owKVCb+DmD8yDGVuNXXhYEU3uIvit5AFxqysl1OfKdDbiO7HxYdOw7m7mUQ9pXxA+7Fa6jIZZkSeQzb7ZwljUElAOeefSnLLl1ntGHwR0iwAL6R4HeAUd/aN+bnSbJT3M6GA==
  • 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=DB4irmaGsLrNw968AkoqxufXa1FXjHqMsMSgbafPtVk=; b=Uo+PXX+PeZZNABMkQFtlhYJXerYcPJN3WNRHlEyg7/9INRmg8L0p4X//ELdFHgDqdpQxBWlyMpiaBBLNZ9XhM2tX+QWKv+kwmUIyM9BF6q0D2anORbTjBlCbeqBsKXKRDJrpKIxQ+9UKz3hUMu+qT6SXkWcSErmnyhuRnW/5oDfnyrI2/jdTYNXBHPcyWL/KN09kws2tIFr+EdsYYxTs9CdVjW86vP3zFVFZb4E9IpuYJaEOvexgFEvU1G5m/1l8Wkb6YZzbJTrVw5hHnRcFdwBoAHK7cppifoOzpwZQ2E/X0laPvuyj9hWCHFjEVmabAhD/R2kjeSujtbmiEA4Mrg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=jyvFhDnXKvNwkiSVW0TFm4cdvdIgRxXCj+8mXg1QbRiXHlkpR1ov89ceOf389FYT4g4XGwfJSb3YgFgsz99VGdBYBxnHXw1y9q7ITT5uxnerkJDjXjVTRlt51rpEDoymqGU5vLZ6nN987uNtCSQEjlAZvgqsS1tezlvecO360tnO0Y2nVsOq3aaSUuAHdT2Ar5lC1RGKvIWTONd96EYnbvc3mFMCGYNe+nf9idwMcPHoQxtbBLXIMxYqCb6tufysGsNbWNpguavUM64f6SYptD7Wp7gJm2cBn1q4lNyL6sHpbBx/oecswACWiYENRNqBbphS/ctwFJuVq+N4yjbi+g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=klfzJL9WcoNSKIz+fLb+buPmGK9LJn5NiftrJdVDt6JSbyvn8Tr5COfOXjkHF34YYtcyblrC7ybvYmoKCkS0gHk8kBnGueN423lZG+xvGpoKo0pi3t2McFHfZE+EtJke/C8y4qw/2LX8zyYVbcf6E0TkiLCnUbINK0vAp45YbohepNKvWzJLkjLCMJUgjJntK7hY3CV/PLRyuqESovFnmwpb7qEEzF4eZPCtTjRfiAFulHM/rZqe4IuGZKylI8tUfR1SR/k9T27Zia2RTSIT7b1+mrFEAiReUxlBC+myYOic1pN5UKDpatLDFtxc3eaDEj3yG5OE+7blZA7QznqkbQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Fri, 09 Sep 2022 12:36:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYxC5uizhN+hjMF0m2RbBlUt+pVq3W1+wAgAAxHYA=
  • Thread-topic: [PATCH v8 7/9] xen/arm: create shared memory nodes in guest device tree


> On 9 Sep 2022, at 10:40, Bertrand Marquis <Bertrand.Marquis@xxxxxxx> wrote:
> 
> Hi Julien,
> 
>> On 9 Sep 2022, at 10:27, Julien Grall <julien@xxxxxxx> 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@xxxxxxx>
>> 
>> 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?

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


 


Rackspace

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