public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: christophpfister@bluemail.ch
Cc: linux-kernel@vger.kernel.org
Subject: Re: failure in /mm/memory.c
Date: Sat, 16 Oct 2004 05:09:11 -0700	[thread overview]
Message-ID: <20041016120911.GW5607@holomorphy.com> (raw)
In-Reply-To: <412EB75E00164E05@mssazhh-int.msg.bluewin.ch>

On Sat, Oct 16, 2004 at 12:32:35PM +0100, christophpfister@bluemail.ch wrote:
> i found a failure in function remap_pte_range in memory.c
> static inline void remap_pte_range(...)
> {
> unsigned long end;
> unsigned long pfn;
> address &= ~PMD_MASK;
> end = address + size;
> if (end > PMD_SIZE)
>     end = PMD_SIZE;
> pfn = phys_addr >> PAGE_SHIFT;
> do {
>     BUG_ON(!pte_none(*pte));
>     if (!pfn_valid(pfn) || PageReserved(pfn_to_page(pfn))) *****
>       set_pte(pte, pfn_pte(pfn, prot));
>     address += PAGE_SIZE;
>     pfn++;
>     pte++;
>     } while (address && (address < end));
> }

Well, there are issues...

On Sat, Oct 16, 2004 at 12:32:35PM +0100, christophpfister@bluemail.ch wrote:
> by ****
> the condition is wrong, because it just maps the page, if it's invalid or
> reserved
> correct: if (!(pfn_valid(pfn) || PageReserved(pfn_to_page(pfn))))
> (it doesn't seems to be used, otherwise there must be bugs)

This isn't one of them. De Morgan teach us that what you wrote is just
	!pfn_valid(pfn) && !PageReserved(pfn_to_page(pfn))
which would evaluate pfn_to_page() on an invalid pfn, and so nonsensical.


-- wli

  reply	other threads:[~2004-10-16 12:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-16 11:32 failure in /mm/memory.c christophpfister
2004-10-16 12:09 ` William Lee Irwin III [this message]
2004-10-17  2:33   ` Alan Cox
2004-10-17  3:40     ` William Lee Irwin III

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=20041016120911.GW5607@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=christophpfister@bluemail.ch \
    --cc=linux-kernel@vger.kernel.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