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

Re: [XEN PATCH v3] xen: rework `checkpolicy` detection when using "randconfig"


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 16 Sep 2021 17:34:00 +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; bh=QAU95lKgjP591NS7TknXuAXLyWzCj94rCuuPDnhasOM=; b=VjpfrvsZd9eyyfhHbf4UHgg1d1IPIqIwQET14uG/As0RgmY7NZqaKktZBFCPg+WcMOxGzlGcCk3LAIwUWNiQnn+tSl4dywstX8VkwmkJ3eI0kxUK3BWDHxpzvXv+0Y5OMln+zM8FH53ChHdq6Abp7ASW0jGDJeH9Y2uusRDgDAISgiIYPZibFO+u0E8EWFEa7mA3sgiG21oP+64HWOQCO3iTmwgjG+dPGVAa99aKvyLFIeAQuV5JVn2bk80k+c5oD1uFf2O34ECOyhzh7yBO7VmPkCjKqpNhblabRgX5FXtNh/pjHab1Zi+otFtNX8WvjaCg2EA3ZNzPwdysqxxSwQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KTe26F61co4YGXM2ZSzPvOPbW9gT5UPj1rAU7PcO9PxHLnCRVQ1aZkQGqjWHvRIhzzcqH2UPDgS4abQc5Dnp/yJwhCmIQChRJBAIu5cwdF7Ehv0GSA/HJo+i/aEyjI9oaYpaP4V893ZeBluwdjvIg/mgI7tubouvHczWhcR2GsqEoXzP3S6ErqIYezEEPzp6IlQqTJNJHnJ3aj4eRFYoSD1vfUIGCEIVpXLgbnZmd0db4ulq5r0WT6cWGreKOY9xb+Kz8Mle7BdWDiw1W5N9wOnKBLJfYi0wkrebqJU/kaXuAIS8M2bG1fv5I5HinP7fYvQ7/4XYeYvUBmU3veI62g==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 16 Sep 2021 15:34:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.09.2021 13:17, Anthony PERARD wrote:
> --- a/Config.mk
> +++ b/Config.mk
> @@ -137,12 +137,6 @@ export XEN_HAS_BUILD_ID=y
>  build_id_linker := --build-id=sha1
>  endif
>  
> -ifndef XEN_HAS_CHECKPOLICY
> -    CHECKPOLICY ?= checkpolicy
> -    XEN_HAS_CHECKPOLICY := $(shell $(CHECKPOLICY) -h 2>&1 | grep -q xen && 
> echo y || echo n)
> -    export XEN_HAS_CHECKPOLICY
> -endif

Is there a particular reason to go from XEN_HAS_CHECKPOLICY to ...

> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -17,6 +17,8 @@ export XEN_BUILD_HOST       ?= $(shell hostname)
>  PYTHON_INTERPRETER   := $(word 1,$(shell which python3 python python2 
> 2>/dev/null) python)
>  export PYTHON                ?= $(PYTHON_INTERPRETER)
>  
> +export CHECKPOLICY   ?= checkpolicy
> +
>  export BASEDIR := $(CURDIR)
>  export XEN_ROOT := $(BASEDIR)/..
>  
> @@ -178,6 +180,8 @@ CFLAGS += $(CLANG_FLAGS)
>  export CLANG_FLAGS
>  endif
>  
> +export HAS_CHECKPOLICY := $(call success,$(CHECKPOLICY) -h 2>&1 | grep -q 
> xen)

... HAS_CHECKPOLICY? As soon as things get put in the environment,
I'm always suspecting possible name collisions ...

> @@ -189,14 +193,24 @@ ifeq ($(config-build),y)
>  # *config targets only - make sure prerequisites are updated, and descend
>  # in tools/kconfig to make the *config target
>  
> +# Create a file for KCONFIG_ALLCONFIG which depends on the environment.
> +# This will be use by kconfig targets 
> allyesconfig/allmodconfig/allnoconfig/randconfig
> +filechk_kconfig_allconfig = \
> +    $(if $(findstring n,$(HAS_CHECKPOLICY)),echo 
> 'CONFIG_XSM_FLASK_POLICY=n';) \
> +    $(if $(KCONFIG_ALLCONFIG), cat $(KCONFIG_ALLCONFIG), :)

Nit: It would be nice if you were consistent with the blanks after
commas in $(if ...). Personally I'm also considering $(if ...)s the
more difficult to follow the longer they are. Hence for the 2nd one
I wonder whether

    $(if $(KCONFIG_ALLCONFIG),cat,:) $(KCONFIG_ALLCONFIG)

wouldn't be easier to read.

> +
> +

Nit: Please avoid double blank lines.

> +.allconfig.tmp: FORCE
> +     set -e; { $(call filechk_kconfig_allconfig); } > $@

Is there a particular reason for the .tmp suffix?

Jan




 


Rackspace

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