public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: sshtylyov@mvista•com (Sergei Shtylyov)
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 17:51:48 +0400	[thread overview]
Message-ID: <4C445874.40500@mvista.com> (raw)
In-Reply-To: <20100719112012.GA12602@shutemov.name>

Kirill A. Shutemov 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

    Strange, it used to warn about superfluous braces...

> 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?

    I wouldn't use braces in this case. But it's up to you after all, if 
checkpatch.pl is indifferent about them...

WBR, Sergei

  reply	other threads:[~2010-07-19 13:51 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
2010-07-19 13:51       ` Sergei Shtylyov [this message]
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=4C445874.40500@mvista.com \
    --to=sshtylyov@mvista$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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