public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: arm64: only use general regs
Date: Thu, 7 Dec 2017 14:56:35 +0100	[thread overview]
Message-ID: <bc3971f1-59d5-e27d-aaeb-ab3cb5d2969d@suse.de> (raw)
In-Reply-To: <20171207072512.tcjb3yhjfoswvp7p@linux-u7w5.ap.freescale.net>

On 12/07/2017 08:25 AM, Peng Fan wrote:
> Hi Alexander,
> On Fri, Dec 01, 2017 at 10:46:29PM +0100, Alexander Graf wrote:
>>
>> On 28.11.17 03:09, Peng Fan wrote:
>>> When compiling with android toolchain, there is an instruction
>>> "str     q0, [x8],#16", but x8 is not 16bytes aligned,
>>> this instruction will trigger sync abort.
>>>
>>> So, following Linux kernel, only use general regs for arm64.
>>> If not, compiler may use simd registers Q[x]. We need to avoid
>>> using simd registers in U-Boot, because load/store Q[x] has
>>> restriction that 128bits aligned when str/ldr.
>>>
>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> The compiler should only output 16-byte-alignemnt-requiring instructions
>> when it can safely assume that the variable in question is 16 byte aligned.
>>
>> Where did x8 come from? That was probably just an unsafe cast?
> I am not able to resetup my compiler enviorment, it's long time
> since we found this issue.
>
> Just objdump and seems it is memset/memcpy,
>
> 00000000007ee708 <memset>:
>    7ee708:       92400804        and     x4, x0, #0x7
>    7ee70c:       aa0003e3        mov     x3, x0
>
> .......
>
>    7ee764:       aa0003e8        mov     x8, x0
>    7ee768:       d2800007        mov     x7, #0x0                        // #0
>    7ee76c:       3c810500        str     q0, [x8], #16

I would assume this 16-byte aligned store only happens when the pointer 
is also 16-byte aligned.

Really, I am fairly sure if you ran into issues, we're looking at a 
compiler bug or an unsafe cast. We shouldn't disable vector register 
usage in U-Boot altogether because of either.


Alex

  reply	other threads:[~2017-12-07 13:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28  2:09 [U-Boot] [PATCH] arm: arm64: only use general regs Peng Fan
2017-11-28  5:00 ` Simon Glass
2017-12-01 21:46 ` Alexander Graf
2017-12-07  7:25   ` Peng Fan
2017-12-07 13:56     ` Alexander Graf [this message]
2017-12-03  4:02 ` [U-Boot] " Tom Rini
2017-12-03 10:37   ` Peng Fan

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=bc3971f1-59d5-e27d-aaeb-ab3cb5d2969d@suse.de \
    --to=agraf@suse.de \
    --cc=u-boot@lists.denx.de \
    /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