linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: Add support for hardware updates of the access and dirty pte bits
Date: Thu, 10 Sep 2015 11:41:06 +0100	[thread overview]
Message-ID: <20150910104106.GC22439@arm.com> (raw)
In-Reply-To: <20150910100753.GE12294@localhost>

On Thu, Sep 10, 2015 at 11:07:54AM +0100, Catalin Marinas wrote:
> On Wed, Sep 09, 2015 at 06:21:11PM +0100, Julien Grall wrote:
> > I've tried to boot the latest linus/master (a794b4f) which include this
> > patch as DOM0 on xgene. This is failing late in the boot with
> > a BUG (see trace below).
> > 
> > The bisector pointed me to this patch. When I disable
> > CONFIG_ARM64_HW_AFDBM, I'm able to boot the kernel and use it
> > without any issue.
> > 
> > Although, I'm not sure to understand how this patch could
> > possibly break the filesystem subsystem.
> 
> I don't understand either. It seems that the kernel raises a BUG on
> !PagePrivate but this patch never touches the page structure, only ptes.

Right, but this could be a symptom of some earlier memory corruption thanks
to junk ptes.

> > > +#ifdef CONFIG_ARM64_HW_AFDBM
> > > +	/*
> > > +	 * Hardware update of the Access and Dirty bits.
> > > +	 */
> > > +	mrs	x9, ID_AA64MMFR1_EL1
> > > +	and	x9, x9, #0xf
> > > +	cbz	x9, 2f
> > > +	cmp	x9, #2
> > > +	b.lt	1f
> > > +	orr	x10, x10, #TCR_HD		// hardware Dirty flag update
> > > +1:	orr	x10, x10, #TCR_HA		// hardware Access flag update
> > > +2:
> > > +#endif	/* CONFIG_ARM64_HW_AFDBM */
> > >  	msr	tcr_el1, x10
> > >  	ret					// return to head.S
> > >  ENDPROC(__cpu_setup)
> 
> Just in case some ID registers are wrong, can you do an "#if 0" above
> instead of CONFIG_ARM64_HW_AFDBM?

The other thing to try would be getting rid of the
__HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG and related definitions in case the
issue is somehow related to the use of exclusives for the page table
updates.

Still, it's strange that nobody else has seen any problems with this
(and we've so far failed to reproduce it locally on any of our boards,
even mustang).

Will

  reply	other threads:[~2015-09-10 10:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10 16:24 [PATCH] arm64: Add support for hardware updates of the access and dirty pte bits Catalin Marinas
2015-09-09 17:21 ` Julien Grall
2015-09-09 18:22   ` Mark Rutland
2015-09-09 18:27     ` Julien Grall
2015-09-10 10:07   ` Catalin Marinas
2015-09-10 10:41     ` Will Deacon [this message]
2015-09-10 14:45     ` Julien Grall
2015-09-10 14:54       ` Marc Zyngier
2015-09-10 15:10         ` Julien Grall
2015-09-10 15:21           ` Marc Zyngier
2015-09-10 15:38       ` Will Deacon
2015-09-11 15:43         ` Julien Grall
2015-09-10 13:01   ` Marc Zyngier
2015-09-10 14:29     ` Julien Grall
2015-09-10 14:49       ` Marc Zyngier
2015-09-10 14:58         ` Julien Grall

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=20150910104106.GC22439@arm.com \
    --to=will.deacon@arm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).