From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A777C433F5 for ; Fri, 7 Jan 2022 14:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pYNMDdrq80dlp4q3MLv4qNy7kzZZYsHK8o8gQZA++BM=; b=5CHCCYjPyIfXuZ xqnkO9t6ahW9V8J2cItu6EXsmqOA082a0oWYWEsEb01GWxyVhfE1gtVm6wy28TLRlcr2Q1FBmzRqk gnGHW0IAJcCbpKhm3lRH/fBKUFIGgZiLHhFi9MJnTfnprFqYgeXQK0kqkDTRRTXtHImEpxRHktBRD XFtYsO9cu1s7sQ/sp4VV2w9AfKxV40eZhx2+AdTKrs8Z61A9r1V2FnYoshMregSiWc+3pY4aBwwZh M4JT3TQE62g4mx+AOZsFE/PzXJK+YfJrA4N96cZMKqhEClZXTSF7lSqbnTHIFCyx4vjy6dF7pTrxf jkPDcYyjhmB8rPYUemlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5q5K-0049eI-7W; Fri, 07 Jan 2022 14:19:14 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5q5G-0049dH-Rm for linux-arm-kernel@lists.infradead.org; Fri, 07 Jan 2022 14:19:12 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EFF9A13A1; Fri, 7 Jan 2022 06:19:09 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.7.134]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 10AB73F774; Fri, 7 Jan 2022 06:19:08 -0800 (PST) Date: Fri, 7 Jan 2022 14:19:05 +0000 From: Mark Rutland To: Andre Przywara Cc: linux-arm-kernel@lists.infradead.org, Jaxson Han Subject: Re: [boot-wrapper PATCH v2 8/9] configure: Autodetect GICv3 Message-ID: References: <20211222181607.1203191-1-andre.przywara@arm.com> <20211222181607.1203191-9-andre.przywara@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211222181607.1203191-9-andre.przywara@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220107_061911_014564_865BF387 X-CRM114-Status: GOOD ( 20.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > --- > 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