All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Andi Kleen <ak@suse.de>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	Zach Amsden <zach@vmware.com>,
	Glauber de Oliveira Costa <glommer@gmail.com>,
	Jeremy Fitzhardinge <Jeremy.Fitzhardinge@citrix.com>
Subject: [PATCH RFC 2/7] x86: clean up mm/init_32.c
Date: Wed, 07 Nov 2007 17:50:10 -0800	[thread overview]
Message-ID: <20071108015310.059598778@goop.org> (raw)
In-Reply-To: 20071108015008.660012621@goop.org

[-- Attachment #1: x86-cleanup-mm-init_32.patch --]
[-- Type: text/plain, Size: 2055 bytes --]

Some code reformatting in init_32.c.  No functional change.

Signed-off-by: Jeremy Fitzhardinge <Jeremy.Fitzhardinge@citrix.com>

---
 arch/x86/mm/init_32.c |   31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

===================================================================
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -165,16 +165,25 @@ static void __init kernel_physical_mappi
 		pmd = one_md_table_init(pgd);
 		if (pfn >= max_low_pfn)
 			continue;
-		for (pmd_idx = 0; pmd_idx < PTRS_PER_PMD && pfn < max_low_pfn; pmd++, pmd_idx++) {
+		for (pmd_idx = 0;
+		     pmd_idx < PTRS_PER_PMD && pfn < max_low_pfn;
+		     pmd++, pmd_idx++) {
 			unsigned int address = pfn * PAGE_SIZE + PAGE_OFFSET;
 
-			/* Map with big pages if possible, otherwise create normal page tables. */
+			/* Map with big pages if possible, otherwise
+			   create normal page tables. */
 			if (cpu_has_pse) {
-				unsigned int address2 = (pfn + PTRS_PER_PTE - 1) * PAGE_SIZE + PAGE_OFFSET + PAGE_SIZE-1;
-				if (is_kernel_text(address) || is_kernel_text(address2))
-					set_pmd(pmd, pfn_pmd(pfn, PAGE_KERNEL_LARGE_EXEC));
-				else
-					set_pmd(pmd, pfn_pmd(pfn, PAGE_KERNEL_LARGE));
+				unsigned int address2;
+				pgprot_t prot = PAGE_KERNEL_LARGE;
+
+				address2 = (pfn + PTRS_PER_PTE - 1) * PAGE_SIZE +
+					PAGE_OFFSET + PAGE_SIZE-1;
+
+				if (is_kernel_text(address) ||
+				    is_kernel_text(address2))
+					prot = PAGE_KERNEL_LARGE_EXEC;
+
+				set_pmd(pmd, pfn_pmd(pfn, prot));
 
 				pfn += PTRS_PER_PTE;
 			} else {
@@ -183,10 +192,12 @@ static void __init kernel_physical_mappi
 				for (pte_ofs = 0;
 				     pte_ofs < PTRS_PER_PTE && pfn < max_low_pfn;
 				     pte++, pfn++, pte_ofs++, address += PAGE_SIZE) {
+					pgprot_t prot = PAGE_KERNEL;
+
 					if (is_kernel_text(address))
-						set_pte(pte, pfn_pte(pfn, PAGE_KERNEL_EXEC));
-					else
-						set_pte(pte, pfn_pte(pfn, PAGE_KERNEL));
+						prot = PAGE_KERNEL_EXEC;
+
+					set_pte(pte, pfn_pte(pfn, prot));
 				}
 			}
 		}

-- 


  parent reply	other threads:[~2007-11-08  2:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08  1:50 [PATCH RFC 0/7] Unify asm-x86/pgtable.h and page.h Jeremy Fitzhardinge
2007-11-08  1:50 ` [PATCH RFC 1/7] x86: kill mk_pte_huge Jeremy Fitzhardinge
2007-11-08  1:50 ` Jeremy Fitzhardinge [this message]
2007-11-08 16:20   ` [PATCH RFC 2/7] x86: clean up mm/init_32.c Glauber de Oliveira Costa
2007-11-08 16:39     ` Jeremy Fitzhardinge
2007-11-08  1:50 ` [PATCH RFC 3/7] x86: clean up asm-x86/page*.h Jeremy Fitzhardinge
2007-11-08 16:42   ` Glauber de Oliveira Costa
2007-11-08 20:59     ` Jeremy Fitzhardinge
2007-11-08 22:38       ` Glauber de Oliveira Costa
2007-11-08 23:03         ` Jeremy Fitzhardinge
2007-11-08  1:50 ` [PATCH RFC 4/7] x86: unify pgtable*.h Jeremy Fitzhardinge
2007-11-08  1:50 ` [PATCH RFC 5/7] x86: simplify pagetable-related operationsin paravirt.h Jeremy Fitzhardinge
2007-11-08  1:50 ` [PATCH RFC 6/7] x86/xen: simplify Xen mmu operations Jeremy Fitzhardinge
2007-11-08  1:50 ` [PATCH RFC 7/7] x86: fix up formatting in pgtable*.h Jeremy Fitzhardinge

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=20071108015310.059598778@goop.org \
    --to=jeremy@goop.org \
    --cc=Jeremy.Fitzhardinge@citrix.com \
    --cc=ak@suse.de \
    --cc=glommer@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=zach@vmware.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.