mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Fleming <matt.fleming@intel.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: "H. Peter Anvin" <hpa@kernel.org>,
	mingo@redhat.com, mjg@redhat.com, linux-kernel@vger.kernel.org,
	keithp@keithp.com, rui.zhang@intel.com,
	huang.ying.caritas@gmail.com, stable@vger.kernel.org,
	tglx@linutronix.de, linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/urgent] x86, efi: Delete efi_ioremap() and fix CONFIG_X86_32 oops
Date: Thu, 15 Mar 2012 12:40:51 +0000	[thread overview]
Message-ID: <1331815251.15493.108.camel@mfleming-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <CAE9FiQXA4+Ubh-6QZv5bouZchR6XZjBSGwR1ox-vug01xiGveA@mail.gmail.com>

On Mon, 2012-03-12 at 22:39 -0700, Yinghai Lu wrote:
> On Mon, Mar 12, 2012 at 5:38 AM, Matt Fleming <matt.fleming@intel.com> wrote:
> 
> > Have you tested my patch? Have you hit this bug or is it just from code
> > inspection. I'm starting to feel a bit silly now because I can't see the
> > problem you're describing.
> 
> from code inspection.
> 
> your new init_memory_mapping() will only map mem under max_low_pfn ?

No, that's not true for x86_64, look,

        for (i = 0; i < e820.nr_map; i++) {
                entry = &e820.map[i];
                start = entry->addr;
                end = start + entry->size;

                /* We've already mapped below 1MB */
                if (end < (1 << 20))
                        continue;

                if (start < (1 << 20))
                        start = 1 << 20;
#ifdef CONFIG_X86_32
                /*
                 * The map is sorted, so bail once we hit a region
                 * that's above max_low_pfn.
                 */
                if (start >= max_low_pfn << PAGE_SHIFT)
                        break;

                if (end > max_low_pfn << PAGE_SHIFT)
                        end = max_low_pfn << PAGE_SHIFT;
#endif
                switch (entry->type) {
                case E820_RAM:
                case E820_RESERVED_EFI:
                case E820_ACPI:
                case E820_NVS:
                        last_pfn_mapped = __init_memory_mapping(start, end);
                        break;
                default:
                        continue;
                }

                if (end <= max_low_pfn << PAGE_SHIFT)
                        max_low_pfn_mapped = last_pfn_mapped;
        }

The max_low_pfn checks are only for CONFIG_X86_32 so that the behaviour
is the same as before this patch, i.e. we don't try to map above
max_low_pfn.

> and before that calling for x86_64, max_low_pfn is not updated to max_pfn yet.
> 
> +       max_pfn_mapped = init_memory_mapping();
> 
>  #ifdef CONFIG_X86_64
>        if (max_pfn > max_low_pfn) {
> -               max_pfn_mapped = init_memory_mapping(1UL<<32,
> -                                                    max_pfn<<PAGE_SHIFT);
>                /* can we preseve max_low_pfn ?*/
>                max_low_pfn = max_pfn;
>        }
> 
> Please do find one system with more than 4G to test the code.

I'm ordering some parts so that I can test this out.



  reply	other threads:[~2012-03-15 12:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20 13:30 [PATCH] " Matt Fleming
2012-02-23  1:16 ` [tip:x86/urgent] " tip-bot for Matt Fleming
2012-02-23  2:20   ` Yinghai Lu
2012-02-23  3:32     ` H. Peter Anvin
2012-02-23 10:36       ` Yinghai Lu
2012-02-24  4:47         ` H. Peter Anvin
2012-02-28  2:27           ` H. Peter Anvin
2012-03-07 10:30             ` Matt Fleming
2012-03-07 18:05               ` Yinghai Lu
2012-03-08 11:28                 ` Matt Fleming
2012-03-08 18:59                   ` Yinghai Lu
2012-03-12 12:38                     ` Matt Fleming
2012-03-13  5:39                       ` Yinghai Lu
2012-03-15 12:40                         ` Matt Fleming [this message]
2012-03-15 17:54                           ` Yinghai Lu
2012-03-16 18:36                             ` Matt Fleming
2012-03-16 19:01                               ` Yinghai Lu
2012-03-07 18:14               ` Yinghai Lu
2012-03-07 18:18                 ` Matthew Garrett
2012-03-08 12:09                 ` Matt Fleming
2012-03-04  0:12   ` Keith Packard
2012-03-04  0:27     ` H. Peter Anvin
2012-03-04  1:33       ` Keith Packard
2012-03-05 10:45         ` Ingo Molnar
2012-03-07 18:31           ` Yinghai Lu
2012-03-05 11:48         ` Matt Fleming
2012-02-28  2:33 ` [PATCH] " H. Peter Anvin
2012-02-28 17:35   ` Matt Fleming

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=1331815251.15493.108.camel@mfleming-mobl1.ger.corp.intel.com \
    --to=matt.fleming@intel.com \
    --cc=hpa@kernel.org \
    --cc=huang.ying.caritas@gmail.com \
    --cc=keithp@keithp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mjg@redhat.com \
    --cc=rui.zhang@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=yinghai@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

all inboxes | Powered by JetHome®