From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 683C2383E802 for ; Wed, 30 Sep 2020 10:25:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 683C2383E802 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 EDBDBD6E; Wed, 30 Sep 2020 03:25:19 -0700 (PDT) Received: from [192.168.1.19] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7884D3F70D; Wed, 30 Sep 2020 03:25:19 -0700 (PDT) Subject: Re: [PATCH] libgloss/aarch64: Add support for Armv8-R AArch64 To: Alex Coplan Cc: newlib@sourceware.org References: <20200918144327.7qgh64f57myg6njs@arm.com> <0bdab8d7-67ee-0d61-3e80-1b8365c41204@arm.com> <20200929162718.x2s3w2pfnelxkzkr@arm.com> From: "Richard Earnshaw (lists)" Message-ID: <3afe2476-6360-fb1a-60bb-e345a731b686@arm.com> Date: Wed, 30 Sep 2020 11:25:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200929162718.x2s3w2pfnelxkzkr@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3035.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_NUMSUBJECT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 10:25:21 -0000 On 29/09/2020 17:27, Alex Coplan via Newlib wrote: > Hi Richard, > > On 29/09/2020 15:06, Richard Earnshaw (lists) wrote: >> On 18/09/2020 15:43, Alex Coplan wrote: >>> Hello, >>> >>> This patch adds support for Armv8-R AArch64. We update the AArch64 CPU >>> boot code to work on Armv8-R if __ARM_ARCH_PROFILE is set to 'R'. >>> Armv8-R AArch64 has no EL3, so we don't set vbar_el3, and adjust the >>> code to set up the MPU for Armv8-R. >>> >>> We also add a specs file for use with Armv8-R AArch64 models. >>> >>> Testing: >>> * Ran AArch64 GCC testsuite using --with-arch=armv8-r together with the >>> new specs file and boot code in an Armv8-R AArch64 model. >>> * Ran newlib testsuite, no regressions. >>> >>> OK for master? >>> >>> Thanks, >>> Alex >>> >>> --- >>> >>> 2020-09-18 Alex Coplan >>> >>> libgloss/ChangeLog: >>> >>> * aarch64/Makefile.in: Install new specs file. >>> * aarch64/cpu-init/Makefile.in: Also build boot code for Armv8-R. >>> * aarch64/cpu-init/rdimon-aem-el3.S: Add support for Armv8-R. >>> * aarch64/elf-aem-v8-r.specs: New. >>> >> >> The main problem I see with this is that it assumes that the compiler >> being used is *not* configured for a default CPU architecture of >> ARMv8-r. If it is, then the normal rdimon-aem-el3.o file will in fact >> become the same as the v8-r version, which is not really what we want. > > Good catch. Thanks for the review. > >> >> Perhaps, rather than hacking around the __ARM_ARCH_PROFILE setting you >> should just set things up to build the file twice, but with a different >> conventional pre-define set each time. >> >> R. > > Sounds sensible. Is the revised patch (attached) OK? > > Thanks, > Alex > Pushed. I've used the following as the commit message (note that newlib doesn't use ChangeLog files anymore). libgloss: aarch64: Add support for Armv8-R AArch64 This patch adds support for Armv8-R AArch64. Armv8-R AArch64 has no EL3, so we don't set vbar_el3, and adjust the code to set up the MPU for Armv8-R. So build a different flavour of the startup code to support that. We also add a specs file that uses this alternative startup code which can be used with Armv8-R AArch64 models. R.