public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Jacob Shin <jacob.shin@amd.com>
Cc: X86-ML <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	Yinghai Lu <yinghai@kernel.org>,
	Andreas Herrmann <andreas.herrmann3@amd.com>,
	Tejun Heo <tj@kernel.org>,
	Borislav Petkov <borislav.petkov@amd.com>,
	Dave Young <dyoung@redhat.com>, Chao Wang <chaowang@redhat.com>,
	Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH 3/4] x86: Only direct map addresses that are marked as E820_RAM
Date: Thu, 23 Aug 2012 16:53:59 -0700	[thread overview]
Message-ID: <5036C297.80402@zytor.com> (raw)
In-Reply-To: <20120823223514.GA6502@jshin-Toonie>

On 08/23/2012 03:35 PM, Jacob Shin wrote:
> 
> I looked into this a bit more, and I think what's happening is that this
> user defined memory map leaves out the region where the kernel is loaded on
> to during the boot process. The kernel and the direct mapped page tables up
> to initial max_pfn_mapped reside somwhere under 512M (KERNEL_IMAGE_SIZE),
> I guess it depends on how big your uncompressed kernel is.
> 
> And at the first attempt to set_fixmap_nocache(FIX_APIC_BASE, address) in
> arch/x86/apic/apic.c: register_lapic_address runs into badness because the
> memory region where the initial page tables live is no longer mapped
> because of the above user supplied memory map.
> 
> So I guess there is a disconnect between really early code that seems to
> rely on the boot loader as to where in physical memory it resides and its
> initial page tables live, and the later memory initialization code where
> it looks at the E820 (and here user can interject their own memory map
> using the command line arguments)
> 
> Not really sure how to handle this case .. any advice?
> 

We have two options: one scream really loud and die, assuming the
bootloader actually loaded us on top of non-memory and we're going to
die anyway; or scream really loud but try to continue (i.e. override the
memory type).  I would suggest doing the latter in the near term, and
shift to the former a bit further down the line.

	-hpa

  parent reply	other threads:[~2012-08-23 23:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-14 22:39 [PATCH V3 0/4] x86: Create direct mappings for E820_RAM only Jacob Shin
2012-08-14 22:39 ` [PATCH 1/4] x86: Move enabling of PSE and PGE out of init_memory_mapping Jacob Shin
2012-08-14 22:39 ` [PATCH 2/4] x86: find_early_table_space based on memory ranges that are being mapped Jacob Shin
2012-08-14 22:39 ` [PATCH 3/4] x86: Only direct map addresses that are marked as E820_RAM Jacob Shin
2012-08-22 23:30   ` H. Peter Anvin
2012-08-23 14:50     ` Jacob Shin
2012-08-23 15:39       ` H. Peter Anvin
2012-08-23 20:12         ` Konrad Rzeszutek Wilk
2012-08-23 21:23           ` H. Peter Anvin
2012-08-23 22:35         ` Jacob Shin
2012-08-23 23:46           ` Yinghai Lu
2012-08-23 23:53           ` H. Peter Anvin [this message]
2012-08-14 22:39 ` [PATCH 4/4] x86: Fixup code testing if a pfn is direct mapped Jacob Shin

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=5036C297.80402@zytor.com \
    --to=hpa@zytor.com \
    --cc=andreas.herrmann3@amd.com \
    --cc=borislav.petkov@amd.com \
    --cc=chaowang@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=jacob.shin@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=vgoyal@redhat.com \
    --cc=x86@kernel.org \
    --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