From: Alexander Kuleshov <kuleshovmail@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Alexander Kuleshov <kuleshovmail@gmail.com>
Subject: [PATCH v1][CLEANUP] x86: use already defined macros instead of hard-coded values
Date: Thu, 5 Mar 2015 19:30:51 +0600 [thread overview]
Message-ID: <1425562251-10218-1-git-send-email-kuleshovmail@gmail.com> (raw)
This patch provides following minor fixes:
* Remove non-used L3_PAGE_OFFSET
* Use already defined L3_START_KERNEL and other macros instead of hard-coded
values
* Fix paths in a comments
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
arch/x86/kernel/head_64.S | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 6fd514d9..dbc4ef3 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -1,6 +1,4 @@
/*
- * linux/arch/x86_64/kernel/head.S -- start in 32bit and switch to 64bit
- *
* Copyright (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSE
* Copyright (C) 2000 Pavel Machek <pavel@suse.cz>
* Copyright (C) 2000 Karsten Keil <kkeil@suse.de>
@@ -20,6 +18,7 @@
#include <asm/processor-flags.h>
#include <asm/percpu.h>
#include <asm/nops.h>
+#include <asm/cpufeature.h>
#ifdef CONFIG_PARAVIRT
#include <asm/asm-offsets.h>
@@ -38,7 +37,6 @@
#define pud_index(x) (((x) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
L4_PAGE_OFFSET = pgd_index(__PAGE_OFFSET)
-L3_PAGE_OFFSET = pud_index(__PAGE_OFFSET)
L4_START_KERNEL = pgd_index(__START_KERNEL_map)
L3_START_KERNEL = pud_index(__START_KERNEL_map)
@@ -56,7 +54,7 @@ startup_64:
* %rsi holds a physical pointer to real_mode_data.
*
* We come here either directly from a 64bit bootloader, or from
- * arch/x86_64/boot/compressed/head.S.
+ * arch/x86/boot/compressed/head_64.S.
*
* We only come here initially at boot nothing else comes here.
*
@@ -90,8 +88,8 @@ startup_64:
*/
addq %rbp, early_level4_pgt + (L4_START_KERNEL*8)(%rip)
- addq %rbp, level3_kernel_pgt + (510*8)(%rip)
- addq %rbp, level3_kernel_pgt + (511*8)(%rip)
+ addq %rbp, level3_kernel_pgt + (L3_START_KERNEL*8)(%rip)
+ addq %rbp, level3_kernel_pgt + (L3_START_KERNEL*8 + 1)(%rip)
addq %rbp, level2_fixmap_pgt + (506*8)(%rip)
@@ -199,7 +197,7 @@ ENTRY(secondary_startup_64)
movl $MSR_EFER, %ecx
rdmsr
btsl $_EFER_SCE, %eax /* Enable System Call */
- btl $20,%edi /* No Execute supported? */
+ btl $X86_FEATURE_NX, %edi /* No Execute supported? */
jnc 1f
btsl $_EFER_NX, %eax
btsq $_PAGE_BIT_NX,early_pmd_flags(%rip)
@@ -441,7 +439,7 @@ GLOBAL(name)
__INITDATA
NEXT_PAGE(early_level4_pgt)
- .fill 511,8,0
+ .fill L4_START_KERNEL,8,0
.quad level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE
NEXT_PAGE(early_dynamic_pgts)
--
2.3.1.167.g7f4ba4b
next reply other threads:[~2015-03-05 13:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-05 13:30 Alexander Kuleshov [this message]
2015-03-05 17:22 ` Borislav Petkov
2015-03-05 17:52 ` Steven Rostedt
2015-03-05 18:01 ` Steven Rostedt
2015-03-05 18:12 ` Alexander Kuleshov
2015-03-05 18:17 ` Borislav Petkov
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=1425562251-10218-1-git-send-email-kuleshovmail@gmail.com \
--to=kuleshovmail@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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®