From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "mingo@elte.hu" <mingo@elte.hu>, "hpa@zytor.com" <hpa@zytor.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"arjan@linux.intel.com" <arjan@linux.intel.com>,
"Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [patch 3/7] x86, cpa: make the kernel physical mapping initialization a two pass sequence
Date: Tue, 07 Oct 2008 08:28:08 -0700 [thread overview]
Message-ID: <48EB8008.1020700@goop.org> (raw)
In-Reply-To: <20081007015833.GO15609@linux-os.sc.intel.com>
Suresh Siddha wrote:
> Jeremy, hi. This dependency is not documented or explicitly called anywhere
> in the mm/init_64.c code. I would have expected to see a big comment near this
> kind of code :(
>
Indeed yes. I've explained it in various places, including commit
comments, but there should be a comment right there in the code.
> It is not just the NX bit that we change. For DEBUG_PAGEALLOC, we want
> use 4k pages instead of large page mappings during the identity mapping
> (as this will clean some of the cpa pool code avoiding the cpa and hence
> the page allocations for splitting the big pages from interrupt context's).
> In this case will will split the static large page mappings.
>
Well, that's OK. We just need to preserve the original page permissions
when fragmenting the large mappings. (This isn't a case that affects
Xen, because it will already be 4k mappings.)
>> 3. The actual implementation is pretty ugly; adding a global variable
>> and hopping about with goto does not improve this code.
>>
>
> This is very early init code and I can't be fancy like calling cpa()
> which need mm to be up and running.
Well, is there any urgency to set NX that early? It might catch some
early bugs, but there's no urgent need.
> And also, cpa's on individual chunks
> for entire identity mapping will make the boot slow.
>
Really? Why? How slow?
>> it cause real failures? Could we revert this patch and address the
>> problem some other way? Which app note is this, BTW? The one I have on
>> hand, "TLBs, Paging-Structure Caches, and Their Invalidation", Apr 2007,
>> does not seem to mention this restriction.
>>
>
> http://developer.intel.com/design/processor/applnots/317080.pdf
> Section 6 page 26
>
Ah, OK. I have the first version of this document which does not
mention this. It would be good to explicitly cite this document by name
in the comments.
>> Xen with this code in place (touching this code is always non-trivial).
>> I haven't looked into it in depth yet, but there's a few stand out "bad
>> for Xen" pieces of code here. (And I haven't tested 32-bit yet.)
>>
>> Quick rules for keeping Xen happy here:
>>
>> 1. Xen provides its own initial pagetable; the head_64.S one is
>> unused when booting under Xen.
>> 2. Xen requires that any pagetable page must always be mapped RO, so
>> we're careful to not replace an existing mapping with a new one,
>> in case the existing mapping is a pagetable one.
>> 3. Xen never uses large pages, and the hypervisor will fail any
>> attempt to do so.
>>
>
> Thanks for this info. Will get back to you tomorrow.
>
Great. Also, do you think you'll have a chance to look at unifying the
32 and 64 bit code (where 32 uses the 64-bit version)?
Thanks,
J
next prev parent reply other threads:[~2008-10-07 15:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-23 21:00 [patch 0/7] x86, cpa: cpa related changes to be inline with TLB Application note - v2 Suresh Siddha
2008-09-23 21:00 ` [patch 1/7] x86, cpa: rename PTE attribute macros for kernel direct mapping in early boot Suresh Siddha
2008-09-23 21:00 ` [patch 2/7] x86, cpa: remove USER permission from the very early identity mapping attribute Suresh Siddha
2008-09-23 21:00 ` [patch 3/7] x86, cpa: make the kernel physical mapping initialization a two pass sequence Suresh Siddha
2008-10-06 20:48 ` Jeremy Fitzhardinge
2008-10-06 23:09 ` Jeremy Fitzhardinge
2008-10-07 1:58 ` Suresh Siddha
2008-10-07 15:28 ` Jeremy Fitzhardinge [this message]
2008-10-07 20:58 ` Suresh Siddha
2008-10-07 21:33 ` Jeremy Fitzhardinge
2008-10-08 19:46 ` Jeremy Fitzhardinge
2008-10-08 21:08 ` Ingo Molnar
2008-09-23 21:00 ` [patch 4/7] x86, cpa: dont use large pages for kernel identity mapping with DEBUG_PAGEALLOC Suresh Siddha
2008-09-23 21:00 ` [patch 5/7] x86, cpa: no need to check alias for __set_pages_p/__set_pages_np Suresh Siddha
2008-09-23 21:00 ` [patch 6/7] x86, cpa: remove cpa pool code Suresh Siddha
2008-09-23 21:00 ` [patch 7/7] x86, cpa: srlz cpa(), global flush tlb after splitting big page and before doing cpa Suresh Siddha
2008-09-24 8:15 ` [patch 0/7] x86, cpa: cpa related changes to be inline with TLB Application note - v2 Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2008-09-11 20:30 [patch 0/7] x86, cpa: cpa related changes to be inline with TLB Application note Suresh Siddha
2008-09-11 20:30 ` [patch 3/7] x86, cpa: make the kernel physical mapping initialization a two pass sequence Suresh Siddha
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=48EB8008.1020700@goop.org \
--to=jeremy@goop.org \
--cc=arjan@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--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 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.