public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Hugh Dickins <hugh@veritas.com>, Theodore Tso <tytso@mit.edu>,
	Gabriel C <nix.or.die@googlemail.com>,
	Keith Packard <keithp@keithp.com>,
	"Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
	Eric Anholt <eric@anholt.net>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	"Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	bugme-daemon@bugzilla.kernel.org, airlied@linux.ie, "Barnes,
	Jesse" <jesse.barnes@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [Bug 10732] REGRESSION: 2.6.26-rc2-git4: X server failed start onX61s laptop
Date: Tue, 20 May 2008 08:31:31 +0100	[thread overview]
Message-ID: <48327E53.7010101@goop.org> (raw)
In-Reply-To: <alpine.LFD.1.10.0805191528550.32253@woody.linux-foundation.org>

Linus Torvalds wrote:
> On Mon, 19 May 2008, Hugh Dickins wrote:
>   
>> This comes from an assumption in 1c12c4cf9411eb130b245fa8d0fbbaf989477c7b
>> mprotect: prevent alteration of the PAT bits, that PTE_MASK is what it's
>> supposed to be: whereas it's been wrong forever with PAE, staying 32-bit
>> where 64-bit is needed.
>>     
>
> Can we *please* just fix PTE_MASK?
>
> And can we agree to never EVER use that PAGE_MASK thing (which was only 
> ever meant to work on *addresses*) for any pte operations (including the 
> definition of PTE_MASK)? Because PAGE_MASK is very much the word-size, and 
> in 32-bit PAE, the page table entry is bigger.
>
> IOE, PTE_MASK should be a "pteval_t". And it should have absolutely 
> *nothing* to do with PAGE_MASK. EVER.
>
> IOW, maybe something like this?
>   

That's pretty close to the core of my patches (just reposted), which 
have been cooking in x86.git for a week or so.

One thing I'd take from your patch is something like your 
__PHYSICAL_LOW_BITS definition, since its a bit clearer than what I 
did.  (I haven't updated my patch before posting just because I wanted 
to post exactly as tested.)

> And no, I haven't tested this at all. But it should make PTE_MASK have
>  (a) the right type ("pteval_t", not "long" - the latter is pure and utter 
>      crap)
>  (b) the right value (proper mask, not a sign-extended long - again, the 
>      latter is pure and utter crap)
>
> but for all I know there might be some broken code that depends on the 
> current incorrect and totally broken #defines, so this needs testing and 
> thinking about.
>
> It also causes these warnings on 32-bit PAE:
>
> 	  AS      arch/x86/kernel/head_32.o
> 	arch/x86/kernel/head_32.S: Assembler messages:
> 	arch/x86/kernel/head_32.S:225: Warning: left operand is a bignum; integer 0 assumed
> 	arch/x86/kernel/head_32.S:609: Warning: left operand is a bignum; integer 0 assumed
>
> and I do not see why (the end result seems to be identical).
>
> Ingo, comments?
>
> Oh, and those #define's should be moved from <asm/page.h> to 
> <asm/pgtable.h>, I think. They have nothing to do with pages (despite the 
> name of "physical_page_mask", and really are meaningful only in the 
> context of some kind of page table entry.
>
> 		Linus
>
> ---
>  include/asm-x86/page.h |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h
> index b381f4a..34b4845 100644
> --- a/include/asm-x86/page.h
> +++ b/include/asm-x86/page.h
> @@ -10,8 +10,8 @@
>  
>  #ifdef __KERNEL__
>  
> -#define PHYSICAL_PAGE_MASK	(PAGE_MASK & __PHYSICAL_MASK)
> -#define PTE_MASK		(_AT(long, PHYSICAL_PAGE_MASK))
> +#define PHYSICAL_PAGE_MASK	(__PHYSICAL_MASK & ~__PHYSICAL_LOW_BITS)
> +#define PTE_MASK		(_AT(pteval_t, PHYSICAL_PAGE_MASK))
>  
>  #define PMD_PAGE_SIZE		(_AC(1, UL) << PMD_SHIFT)
>  #define PMD_PAGE_MASK		(~(PMD_PAGE_SIZE-1))
> @@ -24,6 +24,7 @@
>  /* to align the pointer to the (next) page boundary */
>  #define PAGE_ALIGN(addr)	(((addr)+PAGE_SIZE-1)&PAGE_MASK)
>  
> +#define __PHYSICAL_LOW_BITS	_AT(phys_addr_t, (PAGE_SIZE-1))
>  #define __PHYSICAL_MASK		_AT(phys_addr_t, (_AC(1,ULL) << __PHYSICAL_MASK_SHIFT) - 1)
>  #define __VIRTUAL_MASK		((_AC(1,UL) << __VIRTUAL_MASK_SHIFT) - 1)
>  
>   

    J

  parent reply	other threads:[~2008-05-20  6:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-17  7:32 REGRESSION: 2.6.26-rc2-git4: X server failed start on X61s laptop Theodore Ts'o
2008-05-17  9:49 ` Sitsofe Wheeler
2008-05-17 13:21 ` Pallipadi, Venkatesh
2008-05-17 15:41   ` [Bug 10732] " Theodore Tso
2008-05-17 16:02     ` [Bug 10732] REGRESSION: 2.6.26-rc2-git4: X server failed start onX61s laptop Pallipadi, Venkatesh
2008-05-17 16:53       ` Theodore Tso
2008-05-17 18:11       ` Keith Packard
2008-05-17 18:32         ` Gabriel C
2008-05-17 18:46           ` Theodore Tso
2008-05-19 21:25             ` Hugh Dickins
2008-05-19 23:04               ` Jeremy Fitzhardinge
2008-05-19 23:10               ` Linus Torvalds
2008-05-20  2:33                 ` Linus Torvalds
2008-05-20  4:14                 ` Hugh Dickins
2008-05-20  7:32                   ` Jeremy Fitzhardinge
2008-05-20  7:31                 ` Jeremy Fitzhardinge [this message]
2008-06-02 21:21                 ` Fix for asm warning in head_32.S Joe Korty
2008-05-17 16:36     ` [Bug 10732] REGRESSION: 2.6.26-rc2-git4: X server failed start on X61s laptop Arjan van de Ven

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=48327E53.7010101@goop.org \
    --to=jeremy@goop.org \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=eric@anholt.net \
    --cc=hugh@veritas.com \
    --cc=jesse.barnes@intel.com \
    --cc=keithp@keithp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nix.or.die@googlemail.com \
    --cc=rjw@sisk.pl \
    --cc=suresh.b.siddha@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=venkatesh.pallipadi@intel.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