Linux SNPS ARC Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: eugeniy.paltsev@synopsys.com (Eugeniy Paltsev)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH 1/2] ARCv2: Enable unaligned access in early ASM code
Date: Tue, 29 Jan 2019 17:25:57 +0000	[thread overview]
Message-ID: <1548782756.29008.20.camel@synopsys.com> (raw)
In-Reply-To: <3c341dd9-f360-640e-a3c9-3291300d02ae@synopsys.com>

On Tue, 2019-01-29@09:21 -0800, Vineet Gupta wrote:
> On 1/16/19 3:29 AM, Eugeniy Paltsev wrote:
> > Even though we do enable AD bit in arc_init_IRQ() we need to do
> > it in early ASM code otherwise we may face unaligned data until
> > we reach arc_init_IRQ() because GCC starting from v8.1.0 actively
> > generates unaligned data as it assumes that:
> >  * ARCv2 always has support of unaliged data
> >  * This support is turned on in runtime
> > 
> > Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev at synopsys.com>
> > ---
> >  arch/arc/kernel/head.S | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
> > index 8b90d25a15cc..d5b7a572365a 100644
> > --- a/arch/arc/kernel/head.S
> > +++ b/arch/arc/kernel/head.S
> > @@ -17,6 +17,9 @@
> >  #include <asm/entry.h>
> >  #include <asm/arcregs.h>
> >  #include <asm/cache.h>
> > +#ifdef CONFIG_ISA_ARCV2
> > +#include <asm/irqflags-arcv2.h>
> > +#endif
> 
> I presume there is no specific reason to include this conditionally.
> irqflags.h already includes the right version.

Agree.
I've just forgotten about common irqflags.h

Will fix in V2.

> >  
> >  .macro CPU_EARLY_SETUP
> >  
> > @@ -47,6 +50,13 @@
> >  	sr	r5, [ARC_REG_DC_CTRL]
> >  
> >  1:
> > +
> > +#ifdef CONFIG_ISA_ARCV2
> > +	; Enable handling of unaligned access in the CPU as by default
> > +	; this HW feature is disabled while GCC starting from 8.1.0
> > +	; unconditionally uses it for ARC HS cores.
> > +	flag    1 << STATUS_AD_BIT
> > +#endif
> >  .endm
> >  
> >  	.section .init.text, "ax", at progbits
> > 
> 
> 
-- 
 Eugeniy Paltsev

  reply	other threads:[~2019-01-29 17:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 11:29 [PATCH 1/2] ARCv2: Enable unaligned access in early ASM code Eugeniy Paltsev
2019-01-16 11:29 ` [PATCH 2/2] ARCv2: enable HAVE_EFFICIENT_UNALIGNED_ACCESS Eugeniy Paltsev
     [not found] ` <4881796E12491D4BB15146FE0209CE64681CEB03@DE02WEMBXB.internal.synopsys.com>
2019-01-29 17:15   ` [PATCH 1/2] ARCv2: Enable unaligned access in early ASM code Vineet Gupta
2019-01-29 17:21 ` Vineet Gupta
2019-01-29 17:25   ` Eugeniy Paltsev [this message]
2019-01-29 17:28     ` Vineet Gupta
2019-01-29 17:32       ` Eugeniy Paltsev

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=1548782756.29008.20.camel@synopsys.com \
    --to=eugeniy.paltsev@synopsys.com \
    --cc=linux-snps-arc@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