Bug 201434 - [PATCH] Bad management of PSR_A bit
Summary: [PATCH] Bad management of PSR_A bit
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: arm Any
: --- Affects Some People
Assignee: freebsd-arm (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-07-09 07:30 UTC by Grégory Soutadé
Modified: 2015-11-28 14:29 UTC (History)
1 user (show)

See Also:


Attachments
Clear PSR_A bit at startup (initarm) (728 bytes, patch)
2015-07-09 07:30 UTC, Grégory Soutadé
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Grégory Soutadé 2015-07-09 07:30:36 UTC
Created attachment 158557 [details]
Clear PSR_A bit at startup (initarm)

Sometimes at reboot, the PSR_A bit (CPSR register) is set. This bit mask further hardware bad accesses until it's cleared (going into userspace for me) leaving "Asynchronous External Abort" very late.

In the ARM_NEW_PMAP code, we call enable_interrupts() in initarm() to force clearing this bit. Nevertheless, enable_interrupts() does a mask with ARM_CPSR_I32 and ARM_CPSR_F32 bits making the call useless.

The attached patch correct it in ARM_NEW_PMAP and non ARM_NEW_PMAP code.
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-11-10 13:47:35 UTC
A commit references this bug:

Author: mmel
Date: Tue Nov 10 13:47:28 UTC 2015
New revision: 290661
URL: https://svnweb.freebsd.org/changeset/base/290661

Log:
  ARM: Refactor interrupt_enable/disable/restore.
  Allow manipulation with PSR_A bit on ARMv6+.
  Remove declaration of unused functions.

  This effectively enables asynchronous aborts on early bootstrap stage,
  which previously was not enabled due to an error in enable_interrupts().

  PR:		201434
  Reported by:	Gregory Soutade <soutade at gmail.com>
  Approved by:	kib (mentor)

Changes:
  head/sys/arm/include/cpufunc.h
Comment 2 Michael Moll freebsd_committer freebsd_triage 2015-11-28 14:29:55 UTC
closing with mmel@'s blessings.