All of lore.kernel.org
 help / color / mirror / Atom feed
From: kirill@shutemov.name (Kirill A. Shutemov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] ARMv6K and ARMv7 use fault statuses 3 and 6 as Access Flag fault
Date: Mon, 19 Jul 2010 14:20:12 +0300	[thread overview]
Message-ID: <20100719112012.GA12602@shutemov.name> (raw)
In-Reply-To: <4C4424D4.3000002@ru.mvista.com>

On Mon, Jul 19, 2010 at 02:11:32PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> Kirill A. Shutsemov wrote:
> 
> > Statuses 3 (0b00011) and 6 (0x00110) of DFSR are Access Flags faults on
> > ARMv6K and ARMv7. Let's patch fsr_info[] at runtime if we are on ARMv7
> > or later.
> 
> > Unfortunately, we don't have runtime check for 'K' extension, so we
> > can't check for it.
> 
> > Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
> [...]
> > diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
> > index 77cfdbe..d073b64 100644
> > --- a/arch/arm/mm/alignment.c
> > +++ b/arch/arm/mm/alignment.c
> > @@ -926,8 +926,18 @@ static int __init alignment_init(void)
> >  
> >  	hook_fault_code(1, do_alignment, SIGBUS, BUS_ADRALN,
> >  			"alignment exception");
> > -	hook_fault_code(3, do_alignment, SIGBUS, BUS_ADRALN,
> > -			"alignment exception");
> > +
> > +	/*
> > +	 * ARMv6K and ARMv7 use fault status 3 (0b00011) as Access Flag section
> > +	 * fault, not as alignment error.
> > +	 *
> > +	 * TODO: handle ARMv6K properly. Runtime check for 'K' extension is
> > +	 * needed.
> > +	 */
> > +	if (cpu_architecture() <= CPU_ARCH_ARMv6) {
> > +		hook_fault_code(3, do_alignment, SIGBUS, BUS_ADRALN,
> > +				"alignment exception");
> > +	}
> 
>     Curly braces not neeed here. I assume you haven't run your patch thru 
> scripts/checkpatch.pl?

total: 0 errors, 0 warnings, 37 lines checked

I'll remove it if you want. But I think it reasonable to leave braces in
cases like:

if (condition) {
	do_this(a, very_long, list, of, parameters,
		second, part, of, the, list);
}

What do you think?

-- 
 Kirill A. Shutemov

  reply	other threads:[~2010-07-19 11:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-19  8:53 [PATCH 0/5] ARM: fix exceptions handling Kirill A. Shutsemov
2010-07-19  8:53 ` [PATCH 1/5] Use SIGBUS for unalinged access instead of SIGILL Kirill A. Shutsemov
2010-07-19  8:53 ` [PATCH 2/5] Add 'code' parameter for hook_fault_code() Kirill A. Shutsemov
2010-07-27  9:35   ` Russell King - ARM Linux
2010-07-27  9:42     ` Kirill A. Shutemov
2010-07-19  8:53 ` [PATCH 3/5] Check arch version and modify fsr_info[] depends on it at runtime Kirill A. Shutsemov
2010-07-19  8:53 ` [PATCH 4/5] ARMv6K and ARMv7 use fault statuses 3 and 6 as Access Flag fault Kirill A. Shutsemov
2010-07-19 10:11   ` Sergei Shtylyov
2010-07-19 11:20     ` Kirill A. Shutemov [this message]
2010-07-19 13:51       ` Sergei Shtylyov
2010-07-19  8:53 ` [PATCH 5/5] Workaround infinity loop in handling of translation faults Kirill A. Shutsemov

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=20100719112012.GA12602@shutemov.name \
    --to=kirill@shutemov.name \
    --cc=linux-arm-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.