public inbox for linux-arm-kernel@lists.infradead.org 
 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 16:38:12 +0100	[thread overview]
Message-ID: <20150910153812.GG22439@arm.com> (raw)
In-Reply-To: <55F19785.4090106@citrix.com>

On Thu, Sep 10, 2015 at 03:45:25PM +0100, Julien Grall wrote:
> >> Do you have any insight for debugging this problem?
> > [...]
> >>> diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
> >>> index 39139a3aa16d..a8be513dff6f 100644
> >>> --- a/arch/arm64/mm/proc.S
> >>> +++ b/arch/arm64/mm/proc.S
> >>> @@ -196,6 +196,19 @@ ENTRY(__cpu_setup)
> >>>  	 */
> >>>  	mrs	x9, ID_AA64MMFR0_EL1
> >>>  	bfi	x10, x9, #32, #3
> >>> +#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?
> 
> It doesn't change anything for me. I've also tried the solution
> suggested by Will (see changes below) and I still hit the BUG_ON in the
> fs driver.
> 
> The only way to get a usable userspace is disabling CONFIG_ARM64_HW_AFDBM.

Weird. That doesn't leave a lot of code. Two other things you could try
are:

  (1) Put PTE_WRITE back to bit 57
  (2) Remove the pte_hw_dirty check/set in pte_modify

I thought maybe we could be corrupting a swap entry or something, but I
really can't see how that could happen.

Will

  parent reply	other threads:[~2015-09-10 15:38 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
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 [this message]
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=20150910153812.GG22439@arm.com \
    --to=will.deacon@arm$(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