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

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


  • To: Penny Zheng <Penny.Zheng@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 7 Jun 2022 09:54:51 +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=MTc/EEkBFCDuOeKCw4rqXpZJkxzvOOQxY29jKUWEpAE=; b=SBRziRh0Gy/HnHEnnqeZ4RfcRDBsdU3y14+EfwsWcM7RmyyPvlwgnbdI8lRL/OBtXThebgmssCg13srm2s1ERTeC5LIJx1HlCGpFlcKiISLb/erYOd3EOxLGxJQWa6GEtFZcY32erf/5ckWsH5m8VKEYD8+r6GSY/pccyyzQDdcgl2za9iaqqXJDkjjYVg8pdviPW8Q/abxsQXsovTYswGuzQYz4+9VdJ3ukJPSOHuNVrRo7zqud7neN9g7O3cVIrmr74ufItTMteiK53MwQgWwjVuovaKAPDepy3LsFSCREj0Bd2M6gXyp1Rh6HS2fBUvZ2veRuYKztrDxkKIlrEg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QtvWjyC1060ev5OhtCp/yhDqysGkrPC3yDe1KLoxfqJwp6au8mNZMBkQsXgsuqej943Kn4FDLH9xZIak6PdM7XpSQ/EQ99bMbBjKh4AKvHaBb74kvWxrc0DBJ/cCVMoZKI+hT/8OR5caIkbkxdoDHkSZVSeYs8p8hOcvgn37ILcYqQdY/0ciuNnKXEjs36nqyqM1OlsPdRgPuxpLW8/rwU6/iaN1raz0Sq+A2KFkCjkKfY7N7+66o6dLhSNSUKG/Ug6zOqCcs1WqN9E+j6DAovSDDubZL+N3E3BUcFmAiyPfqqXcVFR8Xz70oKuwi9kcUb4UKE0OY9+Vib/JiLribg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: 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
  • Delivery-date: Tue, 07 Jun 2022 07:55:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.06.2022 09:30, Penny Zheng wrote:
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -3287,9 +3287,12 @@ void __init create_domUs(void)
>          if ( !dt_device_is_compatible(node, "xen,domain") )
>              continue;
>  
> +        if ( dt_find_property(node, "xen,static-mem", NULL) )
> +            flags |= CDF_staticmem;
> +
>          if ( dt_property_read_bool(node, "direct-map") )
>          {
> -            if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) || 
> !dt_find_property(node, "xen,static-mem", NULL) )
> +            if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) || !(flags & 
> CDF_staticmem) )
>                  panic("direct-map is not valid for domain %s without static 
> allocation.\n",
>                        dt_node_name(node));

I think there's either a change needed elsewhere (which you may have in a
later patch, but which would look to belong here) or you may want to deal
right here with CDF_staticmem being invalid without STATIC_MEMORY:

        if ( IS_ENABLED(CONFIG_STATIC_MEMORY) &&
             dt_find_property(node, "xen,static-mem", NULL) )
            flags |= CDF_staticmem;

        if ( dt_property_read_bool(node, "direct-map") )
        {
            if ( !(flags & CDF_staticmem) )
                panic("direct-map is not valid for domain %s without static 
allocation.\n",
                      dt_node_name(node));

Another option would seem to be

/* Is domain memory on static allocation? */
#ifdef CONFIG_STATIC_MEMORY
# define CDF_staticmem            (1U << 2)
#else
# define CDF_staticmem            0
#endif

in xen/domain.h (at which point no IS_ENABLED() would be needed
anymore afaict).

Jan




 


Rackspace

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