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

Re: [PATCH v5 6/9] xen/arm: introduce CDF_staticmem


  • To: Penny Zheng <Penny.Zheng@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 2 Jun 2022 12:34:07 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; 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=QKDqeGUoz4In79F0vmCHiH1bU9+pEkaoRqSbHsioEvk=; b=LTU8jc4Xl65+JDxAqL50GWJva1+FaBZ5VBgLaZpdKvxmo0Cws66Kwl/MBfWD+J118oRYTntFhNHWvHHbakgfVAjYtRUKdAmff087+s4xvPxjvq+smVguU1VQ9+0OrC6w6ph0z52Quf/k9VmSI8sO5+BiQwVfhyzSTjIy2eY2kJuGseN5gaO0OdrPF7Dx2jQnRdpZR5AFAuYiWlgOZSlgbuc7DO6Lqw/13iK00xPhUH79f1X1CMz5n0xbQBuhcBoznQGNHgpr07LVoCyoH7I4gZosBbvtm41Qq3sM/eqZFryA3UwjHPDBy4P3pOkMciSR/h7HRnGxhvMF9T6yF5KrpA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Joa54ufh8X9EQ+AiQIl8TAP9aqOW8rW+8J29XqkZmZTskCdR9JgzTqE+9tmGxOVAAeoHDl+tQCqduURZRVX0PP7womtthDSmDt0TfH35J6mgpDrFgRKa7LtIx+bdqdaWX0GcSSUk2YRNHC4OLWV8YCdLbvCxiSzib/kmZhj/QhG3MbGWme1dGbnhwpXCcmNOGGhFeR7ZL+efNT7Amumoa6ff8sTLu/OjZjFvGQtqRoJHSOoKVJMyE52NhjIfOIv9i0pEKCxQ+haHOQ/SXjCV1STaLDb0yWxOUVbRGzNzrPgkGgWGQAHVXCACF/geq+5ts/eDV7gTgvYU67j1zrWe3w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 02 Jun 2022 10:34:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.06.2022 12:07, Penny Zheng wrote:
>> From: Jan Beulich <jbeulich@xxxxxxxx>
>> Sent: Tuesday, May 31, 2022 4:41 PM
>>
>> On 31.05.2022 05:12, Penny Zheng wrote:
>>> --- a/xen/arch/arm/include/asm/domain.h
>>> +++ b/xen/arch/arm/include/asm/domain.h
>>> @@ -31,6 +31,10 @@ enum domain_type {
>>>
>>>  #define is_domain_direct_mapped(d) ((d)->cdf & CDF_directmap)
>>>
>>> +#ifdef CONFIG_STATIC_MEMORY
>>> +#define is_domain_using_staticmem(d) ((d)->cdf & CDF_staticmem)
>>> +#endif
>>
>> Why is this in the Arm header, rather than ...
>>
>>> --- a/xen/include/xen/domain.h
>>> +++ b/xen/include/xen/domain.h
>>> @@ -34,6 +34,12 @@ void arch_get_domain_info(const struct domain *d,
>>> #ifdef CONFIG_ARM
>>>  /* Should domain memory be directly mapped? */
>>>  #define CDF_directmap            (1U << 1)
>>> +/* Is domain memory on static allocation? */
>>> +#define CDF_staticmem            (1U << 2)
>>> +#endif
>>> +
>>> +#ifndef is_domain_using_staticmem
>>> +#define is_domain_using_staticmem(d) ((void)(d), false)
>>>  #endif
>>
>> ... here (with what you have here now simply becoming the #else part)?
>> Once living here, I expect it also can be an inline function rather than a 
>> macro,
>> with the #ifdef merely inside its body.
>>
> 
> In order to avoid bring the chicken and egg problem in 
> xen/include/xen/domain.h,
> I may need to move the static inline function to xen/include/xen/sched.h(which
> has already included domain.h header).

Hmm, yes, if made an inline function it would need to move to sched.h.
But as a macro it could live here (without one half needing to live
in the Arm header).

Jan




 


Rackspace

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