From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by mx.groups.io with SMTP id smtpd.web09.10222.1612878502004616892 for ; Tue, 09 Feb 2021 05:48:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=WL+rogVG; spf=pass (domain: gmx.de, ip: 212.227.15.15, mailfrom: xypron.glpk@gmx.de) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1612878470; bh=dG/EXTW8CZVlEkvwLwfRyJq6SKaXgYdAy1qfEHF4VvM=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=WL+rogVG1wOLDGmoop5i5QmTwiOBj7d9Q4PRFcvsI/hu9PJv68FRDmgdhGXgjukZF VUWRCt7kDvNSbBBLtnYaUya21gt8ahaxVz5t7JA0JrFR4dFeokJJMDklNofppTacjy kCvMW1GnQsue9IRfLwP2T+8DqLKDM/yrTcvCGVqQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.70] ([62.143.246.89]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N3KPg-1lqsp22mkE-010KDo; Tue, 09 Feb 2021 14:47:50 +0100 Subject: Re: [edk2-devel] [edk2-test PATCH v1 2/2] SctPkg: Enable RISCV64 support using AARCH64 sources To: Leif Lindholm Cc: Daniel Schaefer , devel@edk2.groups.io, Abner Chang , Gilbert Chen , Eric Jin , G Edhaya Chandran , Barton Gao , Samer El-Haj-Mahmoud References: <20201201161752.23734-1-daniel.schaefer@hpe.com> <20201201161752.23734-3-daniel.schaefer@hpe.com> <20201202120436.GE1664@vanye> <7741f08d-efeb-e959-7118-fb74474e3424@gmx.de> <20210209124219.GG1664@vanye> From: "Heinrich Schuchardt" Message-ID: <5e8de9b9-17cc-65c5-1b47-e3f087f8ce85@gmx.de> Date: Tue, 9 Feb 2021 14:47:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210209124219.GG1664@vanye> X-Provags-ID: V03:K1:+c/0+0nustY4vsxpDV/TVIepbZcctP3VrRbYzcSN9gSdIjrKanc Xa419tyrU/Qi6NHC/NDFBkogeTDqKVrv5m9yXs//PIh6N78CXNkhkoNp3gCWgSgiMF3e4Bs XxQNQbah400WjUtCP6fIJ+MAL8/eHSm6fiLMO1PxbEwEtcCjc+o+Q+OY+f0nYL7rlmJz2qw /06w7iI0VIHfkdN1WHVgw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:gh5rTGsRry0=:XGkCFGF+j+rZ3L00X1GwQM 7IcY9enzXPmf7lH1MZpaLed2yk679rJri0EBj4VKQ0Uo1PujrS0QgoG3wGINGK7usjmpA6MiP w7HrU8CcgRLbpIFZayP2Lj8WBwbd2Mp+nRKFrbUWhviqrAzPeHGo0if8Pnf1ueUsnsmFhHX7o uFs1vVL6VwYhZ1PgTqgFv4Ut54KbbjvF4cD8gC8+vQPOGAH8xvez8j6xPza5SkKHsX7dLK17Z JVh9GqwH8Ic0NUVJUswAerOJvRheNHBqwJ7VYov2+1aV01kNkIk2m3ABmekCCdcg9JAXwqG7c oV8Z9n/qu9xYXpst9WTYt5SrZxxiQob1M0KvOX2zAvtSW2DrW4GgNYgiztdZEXM4baDcPBrAY H0U0xygibjSfYLH0cr3+0Z/gVTmzNX7sXptiNPSXx+GobiUOeAKGJua0SOIYwtOdta71WkCd5 dI5/ZekkfQQJAzjbxCnmNxu6ponoeLYxRnl10QBMbE1xjZlf47yjFFPv7u2pOieWiP4WEdIbm IOOg/J671KTVqNRH97DflVf4r4/DteZan9STNkZrfpeUtTUuBBa6vKmVquncdVTLINfxv0E7P ee80JSaQ601BngtAx1RM2ytfV/ogO6yzCHI8BlGjOo8WOumY/AswpmcbsqwXgYx7vn6RaCtf/ G6P7C73SgiCSrHVDt6NdliZdsb0QBSLLhnIK5id9e6l9R9JoulsHqVIVRfs9pPLVVhJx24HRn XXjfls1EsLm9FmLn0bzrazSzV2nK1Nzy14XMERcTFQ7EepCS3wS5I1WGsjJgN/rNQEUzRTv8W 4oIg8tZvicbezSvvcMwk7mjMenGsNvsrGUuOdEbq+RvpN668G37LbV4jWwSgjAooe4cOdqno4 PwJ02+JKMtm0VMBE0RqQ== Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 09.02.21 13:42, Leif Lindholm wrote: > On Mon, Feb 08, 2021 at 18:04:45 +0100, Heinrich Schuchardt wrote: >>>>> diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S >>>>> b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S >>>>> new file mode 100644 >>>>> index 00000000..8bc2c624 >>>>> --- /dev/null >>>>> +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S >>>>> @@ -0,0 +1,45 @@ >>>>> +## @file >>>>> +# >>>>> +#=C2=A0 Copyright 2010 - 2012 Unified EFI, Inc.
>>>>> +#=C2=A0 Copyright (c) 2012, ARM Ltd. All rights reserved.
>>>>> +#=C2=A0 Copyright (c) 2020, Hewlett Packard Enterprise Development = LP.
>>>>> +# >>>>> +#=C2=A0 This program and the accompanying materials >>>>> +#=C2=A0 are licensed and made available under the terms and conditi= ons of >>>>> the BSD License >>>>> +#=C2=A0 which accompanies this distribution.=C2=A0 The full text of= the >>>>> license may be found at >>>>> +#=C2=A0 http://opensource.org/licenses/bsd-license.php >>>>> +# >>>>> +#=C2=A0 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS = IS" >>>>> BASIS, >>>>> +#=C2=A0 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER E= XPRESS >>>>> OR IMPLIED. >>>>> +# >>>>> +## >>>>> +# >>>>> +# >>>>> +#/*++ >>>>> +# >>>>> +# Module Name: >>>>> +# >>>>> +#=C2=A0 GoVirtual.S >>>>> +# >>>>> +#--*/ >>>>> +#start of the code section >>>>> +.text >>>>> +/* FIXME: Should alignment be different on Aarch64? */ >>>> >>>> 1) FIXME >>>> 2) Aarch64. >>> >>> I have no idea why the alignment would be 3 on other platforms, so I >>> don't know how to fix it. >>> If anyone knows more, please let me know. I'll just change the comment >>> to say Riscv64. >>> >>>>> +.align 3 >> >> Both on Aarch64 and on RISC-V an odd alignment value makes no sense. >> >> .align 8 should do no harm. But is it needed? > > The glory of the GAS .align directive is that its meaning differs > between architectures and executable formats. On ARM/AArch64, as well > as on RISC-V (I think?) the alignment is described as a power of 2. > > So .align 3 on ARM and others are the same as .align 8 on x86 (ELF) > and others. > > (It might not be a bad idea to start replacing .align directives with > .baligh to reduce confusion.) Thanks for pointing out the different meanings of .align. They are documented in binutils-2.36/gas/doc/as.info chapter 7.3. .balign is GNU assembler specific. Do we have to consider other assemblers here? Best regards Heinrich > > I haven't looked into whether 8-byte alignment is actually required by > the code here. > > / > Leif >