All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, marcelo@conectiva.com.br,
	alan@lxorguk.ukuu.org.uk, andrea@suse.de
Subject: Re: [PATCH] page_to_phys() fix for >4GB pages (i386)
Date: Mon, 18 Mar 2002 09:18:45 +0100	[thread overview]
Message-ID: <20020318081845.GF22756@suse.de> (raw)
In-Reply-To: <200203152257.g2FMv9h10896@eng2.beaverton.ibm.com>

On Fri, Mar 15 2002, Badari Pulavarty wrote:
> Hi,
> 
> I found that page_to_phys() is broken for pages > 4GB on x86.
> It is truncating the physical addresses to 32bit, loosing higher
> bits. (pci_map_sg() uses this).
> 
> Here is the patch to fix it. Marcelo, could you consider this
> patch ? I have not looked at 2.5 yet, it may be needed there also.
> 
> Thanks,
> Badari
> 
> 
> --- linux/include/asm-i386/io.h Fri Mar 15 11:19:28 2002
> +++ linux.new/include/asm-i386/io.h     Fri Mar 15 11:20:38 2002
> @@ -76,7 +76,11 @@
>  /*
>   * Change "struct page" to physical address.
>   */
> +#ifdef CONFIG_HIGHMEM64G
> +#define page_to_phys(page)     ((u64)(page - mem_map) << PAGE_SHIFT)
> +#else
>  #define page_to_phys(page)     ((page - mem_map) << PAGE_SHIFT)
> +#endif
> 
>  extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);

Ugh, this would indeed explain an unfixed problem with compaq arrays
corrupting data with > 4gb of ram. Thanks, good spotting!

-- 
Jens Axboe


      reply	other threads:[~2002-03-18  8:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-15 22:57 [PATCH] page_to_phys() fix for >4GB pages (i386) Badari Pulavarty
2002-03-18  8:18 ` Jens Axboe [this message]

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=20020318081845.GF22756@suse.de \
    --to=axboe@suse.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=pbadari@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.