From: Mark Rutland <mark.rutland@arm.com>
To: Andre Przywara <andre.przywara@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, Jaxson Han <jaxson.han@arm.com>
Subject: Re: [boot-wrapper PATCH v2 8/9] configure: Autodetect GICv3
Date: Fri, 7 Jan 2022 14:19:05 +0000 [thread overview]
Message-ID: <YdhL2drubqQpq5fl@FVFF77S0Q05N> (raw)
In-Reply-To: <20211222181607.1203191-9-andre.przywara@arm.com>
On Wed, Dec 22, 2021 at 06:16:06PM +0000, Andre Przywara wrote:
> Currently the user has to specify the GIC architecture version (v2 or
> v3) on the ./configure command line, even though this is actually
> redundant information, since the DTB can carry only one GIC type.
>
> Unconditionally query for the two GIC compatible strings in the provided
> DTB, then choose the GIC type automatically depending on which string is
> found.
>
> This saves the user from specifying the GIC type on the configure
> command line, and avoids errors when the wrong type was accidentally
> named.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
> Makefile.am | 23 +++++++++--------------
> configure.ac | 8 --------
> 2 files changed, 9 insertions(+), 22 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index d9ad6d1..3d8128f 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -63,19 +63,14 @@ PSCI_NODE :=
> CPU_NODES :=
> endif
>
> -if GICV3
> -GIC_DIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 0 'arm,gic-v3')
> -GIC_RDIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 1 'arm,gic-v3')
> -DEFINES += -DGIC_DIST_BASE=$(GIC_DIST_BASE)
> -DEFINES += -DGIC_RDIST_BASE=$(GIC_RDIST_BASE)
> -COMMON_OBJ += gic-v3.o
> -else
> -GIC_DIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 0 'arm,cortex-a15-gic')
> -GIC_CPU_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 1 'arm,cortex-a15-gic')
> -DEFINES += -DGIC_CPU_BASE=$(GIC_CPU_BASE)
> -DEFINES += -DGIC_DIST_BASE=$(GIC_DIST_BASE)
> -COMMON_OBJ += gic.o
> -endif
> +GICV3_DIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 0 'arm,gic-v3' 2> /dev/null)
> +GIC_RDIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 1 'arm,gic-v3' 2> /dev/null)
> +GICV2_DIST_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 0 'arm,cortex-a15-gic' 2> /dev/null)
> +GIC_CPU_BASE := $(shell perl -I $(SCRIPT_DIR) $(SCRIPT_DIR)/findbase.pl $(KERNEL_DTB) 1 'arm,cortex-a15-gic' 2> /dev/null)
> +DEFINES += $(if $(GICV3_DIST_BASE), -DGIC_DIST_BASE=$(GICV3_DIST_BASE), -DGIC_DIST_BASE=$(GICV2_DIST_BASE))
> +DEFINES += $(if $(GIC_RDIST_BASE), -DGIC_RDIST_BASE=$(GIC_RDIST_BASE), )
> +DEFINES += $(if $(GIC_CPU_BASE), -DGIC_CPU_BASE=$(GIC_CPU_BASE), )
> +GIC_OBJ := $(if $(GICV3_DIST_BASE), gic-v3.o, gic.o)
Hmm... can we organise this such that if we don't find either GICv2 or GICv3 we
produce a build-time error? Currently this'll silently go with GICv2.
Other than that nit, this is a nice quality-of-life improvement!
Thanks,
Mark.
>
> if KERNEL_32
> MBOX_OFFSET := 0x7ff8
> @@ -134,7 +129,7 @@ CFLAGS += -fno-pic -fno-pie
> CFLAGS += -Os
> LDFLAGS += --gc-sections
>
> -OBJ := $(addprefix $(ARCH_SRC),$(ARCH_OBJ)) $(addprefix $(COMMON_SRC),$(COMMON_OBJ))
> +OBJ := $(addprefix $(ARCH_SRC),$(ARCH_OBJ)) $(addprefix $(COMMON_SRC),$(COMMON_OBJ)) $(addprefix $(COMMON_SRC),$(GIC_OBJ))
>
> # Don't lookup all prerequisites in $(top_srcdir), only the source files. When
> # building outside the source tree $(ARCH_SRC) needs to be created.
> diff --git a/configure.ac b/configure.ac
> index 9e3b722..ed3e094 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -111,13 +111,6 @@ AC_ARG_WITH([xen-cmdline],
> [X_CMDLINE=$withval])
> AC_SUBST([XEN_CMDLINE], [$X_CMDLINE])
>
> -# Allow a user to pass --enable-gicv3
> -AC_ARG_ENABLE([gicv3],
> - AS_HELP_STRING([--enable-gicv3], [enable GICv3 instead of GICv2]),
> - [USE_GICV3=$enableval])
> -AM_CONDITIONAL([GICV3], [test "x$USE_GICV3" = "xyes"])
> -AS_IF([test "x$USE_GICV3" = "xyes"], [], [USE_GICV3=no])
> -
> # Ensure that we have all the needed programs
> AC_PROG_CC
> AC_PROG_CPP
> @@ -144,7 +137,6 @@ echo " Device tree blob: ${KERN_DTB}"
> echo " Linux kernel command line: ${CMDLINE}"
> echo " Embedded initrd: ${FILESYSTEM:-NONE}"
> echo " Use PSCI? ${USE_PSCI}"
> -echo " Use GICv3? ${USE_GICV3}"
> echo " Boot-wrapper execution state: AArch${BOOTWRAPPER_ES}"
> echo " Kernel execution state: AArch${KERNEL_ES}"
> echo " Xen image ${XEN_IMAGE:-NONE}"
> --
> 2.25.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-01-07 14:20 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-22 18:15 [boot-wrapper PATCH v2 0/9] Various (build system) fixes Andre Przywara
2021-12-22 18:15 ` [boot-wrapper PATCH v2 1/9] Makefile: Avoid .got section creation Andre Przywara
2022-01-07 13:49 ` Mark Rutland
2021-12-22 18:16 ` [boot-wrapper PATCH v2 2/9] Add standard headers Andre Przywara
2022-01-07 13:49 ` Mark Rutland
2022-01-07 14:31 ` Andre Przywara
2022-01-11 11:34 ` Mark Rutland
2021-12-22 18:16 ` [boot-wrapper PATCH v2 3/9] Makefile: Tell compiler to generate bare-metal code Andre Przywara
2022-01-07 13:53 ` Mark Rutland
2022-01-07 14:38 ` Andre Przywara
2022-01-11 11:30 ` Mark Rutland
2022-01-18 12:52 ` Andre Przywara
2022-01-18 14:10 ` Ard Biesheuvel
2021-12-22 18:16 ` [boot-wrapper PATCH v2 4/9] configure: Make PSCI the default boot method Andre Przywara
2022-01-07 14:12 ` Mark Rutland
2021-12-22 18:16 ` [boot-wrapper PATCH v2 5/9] configure: Fix default DTB Andre Przywara
2022-01-07 14:13 ` Mark Rutland
2021-12-22 18:16 ` [boot-wrapper PATCH v2 6/9] configure: Use earlycon instead of earlyprintk Andre Przywara
2022-01-07 14:01 ` Mark Rutland
2022-01-07 14:14 ` Mark Rutland
2022-01-07 14:47 ` Andre Przywara
2021-12-22 18:16 ` [boot-wrapper PATCH v2 7/9] pointer auth: Document CPU feature bit mask Andre Przywara
2022-01-07 14:15 ` Mark Rutland
2021-12-22 18:16 ` [boot-wrapper PATCH v2 8/9] configure: Autodetect GICv3 Andre Przywara
2022-01-07 14:19 ` Mark Rutland [this message]
2021-12-22 18:16 ` [boot-wrapper PATCH v2 9/9] avoid dtc warnings on re-compiling DTB Andre Przywara
2022-01-07 13:59 ` Mark Rutland
2022-01-13 18:42 ` Vladimir Murzin
2022-01-13 19:50 ` Andre Przywara
2022-01-14 8:35 ` Vladimir Murzin
2022-01-14 10:44 ` Mark Rutland
2022-01-14 12:09 ` Andre Przywara
2022-01-19 12:02 ` Mark Rutland
2022-01-07 14:25 ` [boot-wrapper PATCH v2 0/9] Various (build system) fixes Mark Rutland
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=YdhL2drubqQpq5fl@FVFF77S0Q05N \
--to=mark.rutland@arm.com \
--cc=andre.przywara@arm.com \
--cc=jaxson.han@arm.com \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox