linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: 'Nishanth Aravamudan' <nacc@us.ibm.com>,
	agl@us.ibm.com, david@gibson.dropbear.id.au, ak@suse.de
Cc: linux-mm@kvack.org, discuss@x86-64.org
Subject: RE: BUG in x86_64 hugepage support
Date: Tue, 14 Mar 2006 20:03:20 -0800	[thread overview]
Message-ID: <200603150403.k2F43Kg10964@unix-os.sc.intel.com> (raw)
In-Reply-To: <20060315012000.GC5526@us.ibm.com>

Nishanth Aravamudan wrote on Tuesday, March 14, 2006 5:20 PM
> While doing some testing of libhugetlbfs, I ran into the following BUGs
> on my x86_64 box when checking mprotect with hugepages (running make
> func in libhugetlbfs is all it took here) (distro is Ubuntu Dapper, runs
> 32-bit userspace).
> 
> So, the first &= results in the lower 11 bits of pte_val(pte) being all
> 0s. By my analysis, this is the problem, pte_modify() on x86_64 is
> clearing the bits we check to see if a pte is a hugetlb one. To see if
> this might be an accurate analysis, I modified _PAGE_CHG_MASK as
> follows:
> 
> 	-#define _PAGE_CHG_MASK	(PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
> 	+#define _PAGE_CHG_MASK	(PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_PSE | _PAGE_PRESENT)
> 
> That is, forcing the bits we care about to get set in pte_modify(). This
> removed the BUG()s I was seeing in our testing.


I think your analysis looked correct.  Though I don't think you want to
add _PAGE_PRESENT to _PAGE_CHG_MASK.  The reason being newprot suppose
to have correct present bit (based on what the new protection is) and
it will be or'ed to form new pte.

I think _PAGE_PSE bit should be in _PAGE_CHG_MASK.

- Ken

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-03-15  4:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-15  1:20 Nishanth Aravamudan
2006-03-15  4:03 ` Chen, Kenneth W [this message]
2006-03-15  4:35   ` Nishanth Aravamudan
2006-03-15  7:08     ` Chen, Kenneth W
2006-03-15  7:30       ` Nishanth Aravamudan
2006-03-15  8:50         ` [discuss] " Jan Beulich
2006-03-15 10:03           ` Chen, Kenneth W
2006-03-15 15:14             ` Nishanth Aravamudan
2006-03-15 15:56             ` Nishanth Aravamudan
2006-03-15 15:13           ` Nishanth Aravamudan

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=200603150403.k2F43Kg10964@unix-os.sc.intel.com \
    --to=kenneth.w.chen@intel.com \
    --cc=agl@us.ibm.com \
    --cc=ak@suse.de \
    --cc=david@gibson.dropbear.id.au \
    --cc=discuss@x86-64.org \
    --cc=linux-mm@kvack.org \
    --cc=nacc@us.ibm.com \
    /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