All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] x86: Misc fixlets
@ 2013-03-04 20:16 Borislav Petkov
  2013-03-04 20:16 ` [PATCH 1/5] x86, smpboot: Remove unused variable Borislav Petkov
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Borislav Petkov @ 2013-03-04 20:16 UTC (permalink / raw)
  To: X86 ML; +Cc: LKML, Borislav Petkov

From: Borislav Petkov <bp@suse.de>

Hi guys,

below a couple of minor fixlets and cleanups which have accumulated in
the last months.

Thanks.

Borislav Petkov (5):
  x86, smpboot: Remove unused variable
  x86: Drop KERNEL_IMAGE_START
  x86-64, docs, mm: Add vsyscall range to virtual address space layout
  x86, msr: Unify variable names
  x86, quirks: Shut-up a long-standing gcc warning

 Documentation/x86/x86_64/mm.txt      |  4 +++-
 arch/x86/include/asm/msr.h           | 14 +++++++-------
 arch/x86/include/asm/page_64_types.h |  1 -
 arch/x86/kernel/head64.c             |  6 +++---
 arch/x86/kernel/quirks.c             | 18 +++++++++++-------
 arch/x86/kernel/smpboot.c            |  3 +--
 6 files changed, 25 insertions(+), 21 deletions(-)

-- 
1.8.1.3.535.ga923c31


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/5] x86, smpboot: Remove unused variable
  2013-03-04 20:16 [PATCH 0/5] x86: Misc fixlets Borislav Petkov
@ 2013-03-04 20:16 ` Borislav Petkov
  2013-03-06  0:24   ` [tip:x86/urgent] " tip-bot for Borislav Petkov
  2013-03-04 20:16 ` [PATCH 2/5] x86: Drop KERNEL_IMAGE_START Borislav Petkov
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Borislav Petkov @ 2013-03-04 20:16 UTC (permalink / raw)
  To: X86 ML; +Cc: LKML, Borislav Petkov

From: Borislav Petkov <bp@suse.de>

The cpuinfo_x86 ptr is unused now. Drop it. Got obsolete by 69fb3676df33
("x86 idle: remove mwait_idle() and "idle=mwait" cmdline param")
removing its only user.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Len Brown <len.brown@intel.com>
---
 arch/x86/kernel/smpboot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index a6ceaedc396a..9f190a2a00e9 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1365,9 +1365,8 @@ static inline void mwait_play_dead(void)
 	unsigned int eax, ebx, ecx, edx;
 	unsigned int highest_cstate = 0;
 	unsigned int highest_subcstate = 0;
-	int i;
 	void *mwait_ptr;
-	struct cpuinfo_x86 *c = __this_cpu_ptr(&cpu_info);
+	int i;
 
 	if (!this_cpu_has(X86_FEATURE_MWAIT))
 		return;
-- 
1.8.1.3.535.ga923c31


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/5] x86: Drop KERNEL_IMAGE_START
  2013-03-04 20:16 [PATCH 0/5] x86: Misc fixlets Borislav Petkov
  2013-03-04 20:16 ` [PATCH 1/5] x86, smpboot: Remove unused variable Borislav Petkov
@ 2013-03-04 20:16 ` Borislav Petkov
  2013-04-03  0:18   ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
  2013-03-04 20:16 ` [PATCH 3/5] x86-64, docs, mm: Add vsyscall range to virtual address space layout Borislav Petkov
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Borislav Petkov @ 2013-03-04 20:16 UTC (permalink / raw)
  To: X86 ML; +Cc: LKML, Borislav Petkov

We have KERNEL_IMAGE_START and __START_KERNEL_map which both contain the
start of the kernel text mapping's virtual address. Remove the prior one
which has been replicated a lot less times around the tree.

No functionality change.

Signed-off-by: Borislav Petkov <bp@alien8.de>
---
 arch/x86/include/asm/page_64_types.h | 1 -
 arch/x86/kernel/head64.c             | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h
index 8b491e66eaa8..6c896fbe21db 100644
--- a/arch/x86/include/asm/page_64_types.h
+++ b/arch/x86/include/asm/page_64_types.h
@@ -48,6 +48,5 @@
  * arch/x86/kernel/head_64.S), and it is mapped here:
  */
 #define KERNEL_IMAGE_SIZE	(512 * 1024 * 1024)
-#define KERNEL_IMAGE_START	_AC(0xffffffff80000000, UL)
 
 #endif /* _ASM_X86_PAGE_64_DEFS_H */
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index c5e403f6d869..101ac1a9263e 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -144,10 +144,10 @@ void __init x86_64_start_kernel(char * real_mode_data)
 	 * Build-time sanity checks on the kernel image and module
 	 * area mappings. (these are purely build-time and produce no code)
 	 */
-	BUILD_BUG_ON(MODULES_VADDR < KERNEL_IMAGE_START);
-	BUILD_BUG_ON(MODULES_VADDR-KERNEL_IMAGE_START < KERNEL_IMAGE_SIZE);
+	BUILD_BUG_ON(MODULES_VADDR < __START_KERNEL_map);
+	BUILD_BUG_ON(MODULES_VADDR - __START_KERNEL_map < KERNEL_IMAGE_SIZE);
 	BUILD_BUG_ON(MODULES_LEN + KERNEL_IMAGE_SIZE > 2*PUD_SIZE);
-	BUILD_BUG_ON((KERNEL_IMAGE_START & ~PMD_MASK) != 0);
+	BUILD_BUG_ON((__START_KERNEL_map & ~PMD_MASK) != 0);
 	BUILD_BUG_ON((MODULES_VADDR & ~PMD_MASK) != 0);
 	BUILD_BUG_ON(!(MODULES_VADDR > __START_KERNEL));
 	BUILD_BUG_ON(!(((MODULES_END - 1) & PGDIR_MASK) ==
-- 
1.8.1.3.535.ga923c31


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/5] x86-64, docs, mm: Add vsyscall range to virtual address space layout
  2013-03-04 20:16 [PATCH 0/5] x86: Misc fixlets Borislav Petkov
  2013-03-04 20:16 ` [PATCH 1/5] x86, smpboot: Remove unused variable Borislav Petkov
  2013-03-04 20:16 ` [PATCH 2/5] x86: Drop KERNEL_IMAGE_START Borislav Petkov
@ 2013-03-04 20:16 ` Borislav Petkov
  2013-03-04 21:45   ` Andy Lutomirski
  2013-04-03  0:19   ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
  2013-03-04 20:16 ` [PATCH 4/5] x86, msr: Unify variable names Borislav Petkov
  2013-03-04 20:16 ` [PATCH 5/5] x86, quirks: Shut-up a long-standing gcc warning Borislav Petkov
  4 siblings, 2 replies; 13+ messages in thread
From: Borislav Petkov @ 2013-03-04 20:16 UTC (permalink / raw)
  To: X86 ML; +Cc: LKML, Borislav Petkov

Add the end of the virtual address space to its layout documentation.

Signed-off-by: Borislav Petkov <bp@alien8.de>
---
 Documentation/x86/x86_64/mm.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/x86/x86_64/mm.txt b/Documentation/x86/x86_64/mm.txt
index d6498e3cd713..881582f75c9c 100644
--- a/Documentation/x86/x86_64/mm.txt
+++ b/Documentation/x86/x86_64/mm.txt
@@ -13,7 +13,9 @@ ffffe90000000000 - ffffe9ffffffffff (=40 bits) hole
 ffffea0000000000 - ffffeaffffffffff (=40 bits) virtual memory map (1TB)
 ... unused hole ...
 ffffffff80000000 - ffffffffa0000000 (=512 MB)  kernel text mapping, from phys 0
-ffffffffa0000000 - fffffffffff00000 (=1536 MB) module mapping space
+ffffffffa0000000 - ffffffffff5fffff (=1525 MB) module mapping space
+ffffffffff600000 - ffffffffffdfffff (=8 MB) vsyscalls
+ffffffffffe00000 - ffffffffffffffff (=2 MB) unused hole
 
 The direct mapping covers all memory in the system up to the highest
 memory address (this means in some cases it can also include PCI memory
-- 
1.8.1.3.535.ga923c31


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/5] x86, msr: Unify variable names
  2013-03-04 20:16 [PATCH 0/5] x86: Misc fixlets Borislav Petkov
                   ` (2 preceding siblings ...)
  2013-03-04 20:16 ` [PATCH 3/5] x86-64, docs, mm: Add vsyscall range to virtual address space layout Borislav Petkov
@ 2013-03-04 20:16 ` Borislav Petkov
  2013-04-03  0:20   ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
  2013-03-04 20:16 ` [PATCH 5/5] x86, quirks: Shut-up a long-standing gcc warning Borislav Petkov
  4 siblings, 1 reply; 13+ messages in thread
From: Borislav Petkov @ 2013-03-04 20:16 UTC (permalink / raw)
  To: X86 ML; +Cc: LKML, Borislav Petkov

From: Borislav Petkov <bp@suse.de>

Make sure all MSR-accessing primitives which split MSR values in
two 32-bit parts have their variables called 'low' and 'high' for
consistence with the rest of the code and for ease of staring.

Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/include/asm/msr.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 9264802e2824..cb7502852acb 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -137,11 +137,11 @@ static inline unsigned long long native_read_pmc(int counter)
  * pointer indirection), this allows gcc to optimize better
  */
 
-#define rdmsr(msr, val1, val2)					\
+#define rdmsr(msr, low, high)					\
 do {								\
 	u64 __val = native_read_msr((msr));			\
-	(void)((val1) = (u32)__val);				\
-	(void)((val2) = (u32)(__val >> 32));			\
+	(void)((low) = (u32)__val);				\
+	(void)((high) = (u32)(__val >> 32));			\
 } while (0)
 
 static inline void wrmsr(unsigned msr, unsigned low, unsigned high)
@@ -162,12 +162,12 @@ static inline int wrmsr_safe(unsigned msr, unsigned low, unsigned high)
 }
 
 /* rdmsr with exception handling */
-#define rdmsr_safe(msr, p1, p2)					\
+#define rdmsr_safe(msr, low, high)				\
 ({								\
 	int __err;						\
 	u64 __val = native_read_msr_safe((msr), &__err);	\
-	(*p1) = (u32)__val;					\
-	(*p2) = (u32)(__val >> 32);				\
+	(*low) = (u32)__val;					\
+	(*high) = (u32)(__val >> 32);				\
 	__err;							\
 })
 
@@ -208,7 +208,7 @@ do {                                                            \
 #define wrmsrl_safe(msr, val) wrmsr_safe((msr), (u32)(val),		\
 					     (u32)((val) >> 32))
 
-#define write_tsc(val1, val2) wrmsr(MSR_IA32_TSC, (val1), (val2))
+#define write_tsc(low, high) wrmsr(MSR_IA32_TSC, (low), (high))
 
 #define write_rdtscp_aux(val) wrmsr(MSR_TSC_AUX, (val), 0)
 
-- 
1.8.1.3.535.ga923c31


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/5] x86, quirks: Shut-up a long-standing gcc warning
  2013-03-04 20:16 [PATCH 0/5] x86: Misc fixlets Borislav Petkov
                   ` (3 preceding siblings ...)
  2013-03-04 20:16 ` [PATCH 4/5] x86, msr: Unify variable names Borislav Petkov
@ 2013-03-04 20:16 ` Borislav Petkov
  2013-04-03  0:21   ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
  4 siblings, 1 reply; 13+ messages in thread
From: Borislav Petkov @ 2013-03-04 20:16 UTC (permalink / raw)
  To: X86 ML; +Cc: LKML, Borislav Petkov

From: Borislav Petkov <bp@suse.de>

So gcc nags about those since forever in randconfig builds.

arch/x86/kernel/quirks.c: In function ‘ati_ixp4x0_rev’:
arch/x86/kernel/quirks.c:361:4: warning: ‘b’ is used uninitialized in this function [-Wuninitialized]
arch/x86/kernel/quirks.c: In function ‘ati_force_enable_hpet’:
arch/x86/kernel/quirks.c:367:4: warning: ‘d’ may be used uninitialized in this function [-Wuninitialized]
arch/x86/kernel/quirks.c:357:6: note: ‘d’ was declared here
arch/x86/kernel/quirks.c:407:21: warning: ‘val’ may be used uninitialized in this function [-Wuninitialized]

This function quirk is called on a SB400 chipset only anyway so the
distant possibility of a PCI access failing becomes almost impossible
there. Even if it did fail, then something else more serious is the
problem.

So zero-out the variables so that gcc shuts up but do a coarse check
on the PCI accesses at the end and signal whether any of them had an
error. They shouldn't but in case they do, we'll at least know and we
can address it.

Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/kernel/quirks.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index 26ee48a33dc4..04ee1e2e4c02 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -354,18 +354,22 @@ static void ati_force_hpet_resume(void)
 
 static u32 ati_ixp4x0_rev(struct pci_dev *dev)
 {
-	u32 d;
-	u8  b;
+	int err = 0;
+	u32 d = 0;
+	u8  b = 0;
 
-	pci_read_config_byte(dev, 0xac, &b);
+	err = pci_read_config_byte(dev, 0xac, &b);
 	b &= ~(1<<5);
-	pci_write_config_byte(dev, 0xac, b);
-	pci_read_config_dword(dev, 0x70, &d);
+	err |= pci_write_config_byte(dev, 0xac, b);
+	err |= pci_read_config_dword(dev, 0x70, &d);
 	d |= 1<<8;
-	pci_write_config_dword(dev, 0x70, d);
-	pci_read_config_dword(dev, 0x8, &d);
+	err |= pci_write_config_dword(dev, 0x70, d);
+	err |= pci_read_config_dword(dev, 0x8, &d);
 	d &= 0xff;
 	dev_printk(KERN_DEBUG, &dev->dev, "SB4X0 revision 0x%x\n", d);
+
+	WARN_ON_ONCE(err);
+
 	return d;
 }
 
-- 
1.8.1.3.535.ga923c31


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/5] x86-64, docs, mm: Add vsyscall range to virtual address space layout
  2013-03-04 20:16 ` [PATCH 3/5] x86-64, docs, mm: Add vsyscall range to virtual address space layout Borislav Petkov
@ 2013-03-04 21:45   ` Andy Lutomirski
  2013-03-04 21:56     ` Borislav Petkov
  2013-04-03  0:19   ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
  1 sibling, 1 reply; 13+ messages in thread
From: Andy Lutomirski @ 2013-03-04 21:45 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: X86 ML, LKML

On 03/04/2013 12:16 PM, Borislav Petkov wrote:
> Add the end of the virtual address space to its layout documentation.
> 
> Signed-off-by: Borislav Petkov <bp@alien8.de>
> ---
>  Documentation/x86/x86_64/mm.txt | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/x86/x86_64/mm.txt b/Documentation/x86/x86_64/mm.txt
> index d6498e3cd713..881582f75c9c 100644
> --- a/Documentation/x86/x86_64/mm.txt
> +++ b/Documentation/x86/x86_64/mm.txt
> @@ -13,7 +13,9 @@ ffffe90000000000 - ffffe9ffffffffff (=40 bits) hole
>  ffffea0000000000 - ffffeaffffffffff (=40 bits) virtual memory map (1TB)
>  ... unused hole ...
>  ffffffff80000000 - ffffffffa0000000 (=512 MB)  kernel text mapping, from phys 0
> -ffffffffa0000000 - fffffffffff00000 (=1536 MB) module mapping space
> +ffffffffa0000000 - ffffffffff5fffff (=1525 MB) module mapping space
> +ffffffffff600000 - ffffffffffdfffff (=8 MB) vsyscalls
> +ffffffffffe00000 - ffffffffffffffff (=2 MB) unused hole
>  
>  The direct mapping covers all memory in the system up to the highest
>  memory address (this means in some cases it can also include PCI memory
> 

vsyscalls are only 4k.  Am I missing something obvious her?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/5] x86-64, docs, mm: Add vsyscall range to virtual address space layout
  2013-03-04 21:45   ` Andy Lutomirski
@ 2013-03-04 21:56     ` Borislav Petkov
  0 siblings, 0 replies; 13+ messages in thread
From: Borislav Petkov @ 2013-03-04 21:56 UTC (permalink / raw)
  To: Andy Lutomirski; +Cc: X86 ML, LKML

On Mon, Mar 04, 2013 at 01:45:20PM -0800, Andy Lutomirski wrote:
> vsyscalls are only 4k.  Am I missing something obvious her?

Right, but we're reserving 5 level2 pages for this, i.e. 5*512*4K = 10M.
I.e., each level2 page contains 512 ptes, each pointing to a 4K page.

arch/x86/kernel/head_64.S:

...
NEXT_PAGE(level2_fixmap_pgt)
	.fill	506,8,0
	.quad	level1_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE
	/* 8MB reserved for vsyscalls + a 2MB hole = 4 + 1 entries */
	.fill	5,8,0

NEXT_PAGE(level1_fixmap_pgt)
	.fill	512,8,0

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [tip:x86/urgent] x86, smpboot: Remove unused variable
  2013-03-04 20:16 ` [PATCH 1/5] x86, smpboot: Remove unused variable Borislav Petkov
@ 2013-03-06  0:24   ` tip-bot for Borislav Petkov
  0 siblings, 0 replies; 13+ messages in thread
From: tip-bot for Borislav Petkov @ 2013-03-06  0:24 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx, hpa, bp, len.brown

Commit-ID:  576cfb404c9cab728e9462ea713f3422679d5cf7
Gitweb:     http://git.kernel.org/tip/576cfb404c9cab728e9462ea713f3422679d5cf7
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Mon, 4 Mar 2013 21:16:16 +0100
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 5 Mar 2013 15:26:45 -0800

x86, smpboot: Remove unused variable

The cpuinfo_x86 ptr is unused now. Drop it. Got obsolete by 69fb3676df33
("x86 idle: remove mwait_idle() and "idle=mwait" cmdline param")
removing its only user.

[ hpa: fixes gcc warning ]

Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/1362428180-8865-2-git-send-email-bp@alien8.de
Cc: Len Brown <len.brown@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/kernel/smpboot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index a6ceaed..9f190a2 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1365,9 +1365,8 @@ static inline void mwait_play_dead(void)
 	unsigned int eax, ebx, ecx, edx;
 	unsigned int highest_cstate = 0;
 	unsigned int highest_subcstate = 0;
-	int i;
 	void *mwait_ptr;
-	struct cpuinfo_x86 *c = __this_cpu_ptr(&cpu_info);
+	int i;
 
 	if (!this_cpu_has(X86_FEATURE_MWAIT))
 		return;

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [tip:x86/cleanups] x86: Drop KERNEL_IMAGE_START
  2013-03-04 20:16 ` [PATCH 2/5] x86: Drop KERNEL_IMAGE_START Borislav Petkov
@ 2013-04-03  0:18   ` tip-bot for Borislav Petkov
  0 siblings, 0 replies; 13+ messages in thread
From: tip-bot for Borislav Petkov @ 2013-04-03  0:18 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx, hpa, bp

Commit-ID:  8e3c2a8cf647e2f3a1e9d38009b0d1c02145822f
Gitweb:     http://git.kernel.org/tip/8e3c2a8cf647e2f3a1e9d38009b0d1c02145822f
Author:     Borislav Petkov <bp@alien8.de>
AuthorDate: Mon, 4 Mar 2013 21:16:17 +0100
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 2 Apr 2013 16:03:29 -0700

x86: Drop KERNEL_IMAGE_START

We have KERNEL_IMAGE_START and __START_KERNEL_map which both contain the
start of the kernel text mapping's virtual address. Remove the prior one
which has been replicated a lot less times around the tree.

No functionality change.

Signed-off-by: Borislav Petkov <bp@alien8.de>
Link: http://lkml.kernel.org/r/1362428180-8865-3-git-send-email-bp@alien8.de
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/include/asm/page_64_types.h | 1 -
 arch/x86/kernel/head64.c             | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h
index 8b491e6..6c896fb 100644
--- a/arch/x86/include/asm/page_64_types.h
+++ b/arch/x86/include/asm/page_64_types.h
@@ -48,6 +48,5 @@
  * arch/x86/kernel/head_64.S), and it is mapped here:
  */
 #define KERNEL_IMAGE_SIZE	(512 * 1024 * 1024)
-#define KERNEL_IMAGE_START	_AC(0xffffffff80000000, UL)
 
 #endif /* _ASM_X86_PAGE_64_DEFS_H */
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index c5e403f..101ac1a9 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -144,10 +144,10 @@ void __init x86_64_start_kernel(char * real_mode_data)
 	 * Build-time sanity checks on the kernel image and module
 	 * area mappings. (these are purely build-time and produce no code)
 	 */
-	BUILD_BUG_ON(MODULES_VADDR < KERNEL_IMAGE_START);
-	BUILD_BUG_ON(MODULES_VADDR-KERNEL_IMAGE_START < KERNEL_IMAGE_SIZE);
+	BUILD_BUG_ON(MODULES_VADDR < __START_KERNEL_map);
+	BUILD_BUG_ON(MODULES_VADDR - __START_KERNEL_map < KERNEL_IMAGE_SIZE);
 	BUILD_BUG_ON(MODULES_LEN + KERNEL_IMAGE_SIZE > 2*PUD_SIZE);
-	BUILD_BUG_ON((KERNEL_IMAGE_START & ~PMD_MASK) != 0);
+	BUILD_BUG_ON((__START_KERNEL_map & ~PMD_MASK) != 0);
 	BUILD_BUG_ON((MODULES_VADDR & ~PMD_MASK) != 0);
 	BUILD_BUG_ON(!(MODULES_VADDR > __START_KERNEL));
 	BUILD_BUG_ON(!(((MODULES_END - 1) & PGDIR_MASK) ==

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [tip:x86/cleanups] x86-64, docs, mm: Add vsyscall range to virtual address space layout
  2013-03-04 20:16 ` [PATCH 3/5] x86-64, docs, mm: Add vsyscall range to virtual address space layout Borislav Petkov
  2013-03-04 21:45   ` Andy Lutomirski
@ 2013-04-03  0:19   ` tip-bot for Borislav Petkov
  1 sibling, 0 replies; 13+ messages in thread
From: tip-bot for Borislav Petkov @ 2013-04-03  0:19 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx, hpa, bp

Commit-ID:  aca91bfc67fe356544eb1cfc483c09b27ce49fa9
Gitweb:     http://git.kernel.org/tip/aca91bfc67fe356544eb1cfc483c09b27ce49fa9
Author:     Borislav Petkov <bp@alien8.de>
AuthorDate: Mon, 4 Mar 2013 21:16:18 +0100
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 2 Apr 2013 16:03:31 -0700

x86-64, docs, mm: Add vsyscall range to virtual address space layout

Add the end of the virtual address space to its layout documentation.

Signed-off-by: Borislav Petkov <bp@alien8.de>
Link: http://lkml.kernel.org/r/1362428180-8865-4-git-send-email-bp@alien8.de
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 Documentation/x86/x86_64/mm.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/x86/x86_64/mm.txt b/Documentation/x86/x86_64/mm.txt
index d6498e3..881582f 100644
--- a/Documentation/x86/x86_64/mm.txt
+++ b/Documentation/x86/x86_64/mm.txt
@@ -13,7 +13,9 @@ ffffe90000000000 - ffffe9ffffffffff (=40 bits) hole
 ffffea0000000000 - ffffeaffffffffff (=40 bits) virtual memory map (1TB)
 ... unused hole ...
 ffffffff80000000 - ffffffffa0000000 (=512 MB)  kernel text mapping, from phys 0
-ffffffffa0000000 - fffffffffff00000 (=1536 MB) module mapping space
+ffffffffa0000000 - ffffffffff5fffff (=1525 MB) module mapping space
+ffffffffff600000 - ffffffffffdfffff (=8 MB) vsyscalls
+ffffffffffe00000 - ffffffffffffffff (=2 MB) unused hole
 
 The direct mapping covers all memory in the system up to the highest
 memory address (this means in some cases it can also include PCI memory

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [tip:x86/cleanups] x86, msr: Unify variable names
  2013-03-04 20:16 ` [PATCH 4/5] x86, msr: Unify variable names Borislav Petkov
@ 2013-04-03  0:20   ` tip-bot for Borislav Petkov
  0 siblings, 0 replies; 13+ messages in thread
From: tip-bot for Borislav Petkov @ 2013-04-03  0:20 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx, hpa, bp

Commit-ID:  1423bed239415edd1562c25be8a7408858fdbb19
Gitweb:     http://git.kernel.org/tip/1423bed239415edd1562c25be8a7408858fdbb19
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Mon, 4 Mar 2013 21:16:19 +0100
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 2 Apr 2013 16:03:32 -0700

x86, msr: Unify variable names

Make sure all MSR-accessing primitives which split MSR values in
two 32-bit parts have their variables called 'low' and 'high' for
consistence with the rest of the code and for ease of staring.

Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/1362428180-8865-5-git-send-email-bp@alien8.de
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/include/asm/msr.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 9264802..cb75028 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -137,11 +137,11 @@ static inline unsigned long long native_read_pmc(int counter)
  * pointer indirection), this allows gcc to optimize better
  */
 
-#define rdmsr(msr, val1, val2)					\
+#define rdmsr(msr, low, high)					\
 do {								\
 	u64 __val = native_read_msr((msr));			\
-	(void)((val1) = (u32)__val);				\
-	(void)((val2) = (u32)(__val >> 32));			\
+	(void)((low) = (u32)__val);				\
+	(void)((high) = (u32)(__val >> 32));			\
 } while (0)
 
 static inline void wrmsr(unsigned msr, unsigned low, unsigned high)
@@ -162,12 +162,12 @@ static inline int wrmsr_safe(unsigned msr, unsigned low, unsigned high)
 }
 
 /* rdmsr with exception handling */
-#define rdmsr_safe(msr, p1, p2)					\
+#define rdmsr_safe(msr, low, high)				\
 ({								\
 	int __err;						\
 	u64 __val = native_read_msr_safe((msr), &__err);	\
-	(*p1) = (u32)__val;					\
-	(*p2) = (u32)(__val >> 32);				\
+	(*low) = (u32)__val;					\
+	(*high) = (u32)(__val >> 32);				\
 	__err;							\
 })
 
@@ -208,7 +208,7 @@ do {                                                            \
 #define wrmsrl_safe(msr, val) wrmsr_safe((msr), (u32)(val),		\
 					     (u32)((val) >> 32))
 
-#define write_tsc(val1, val2) wrmsr(MSR_IA32_TSC, (val1), (val2))
+#define write_tsc(low, high) wrmsr(MSR_IA32_TSC, (low), (high))
 
 #define write_rdtscp_aux(val) wrmsr(MSR_TSC_AUX, (val), 0)
 

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [tip:x86/cleanups] x86, quirks: Shut-up a long-standing gcc warning
  2013-03-04 20:16 ` [PATCH 5/5] x86, quirks: Shut-up a long-standing gcc warning Borislav Petkov
@ 2013-04-03  0:21   ` tip-bot for Borislav Petkov
  0 siblings, 0 replies; 13+ messages in thread
From: tip-bot for Borislav Petkov @ 2013-04-03  0:21 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx, hpa, bp

Commit-ID:  73f460408ca9b6e917f32c89c9a85c586f17f732
Gitweb:     http://git.kernel.org/tip/73f460408ca9b6e917f32c89c9a85c586f17f732
Author:     Borislav Petkov <bp@suse.de>
AuthorDate: Mon, 4 Mar 2013 21:16:20 +0100
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 2 Apr 2013 16:03:34 -0700

x86, quirks: Shut-up a long-standing gcc warning

So gcc nags about those since forever in randconfig builds.

arch/x86/kernel/quirks.c: In function ‘ati_ixp4x0_rev’:
arch/x86/kernel/quirks.c:361:4: warning: ‘b’ is used uninitialized in this function [-Wuninitialized]
arch/x86/kernel/quirks.c: In function ‘ati_force_enable_hpet’:
arch/x86/kernel/quirks.c:367:4: warning: ‘d’ may be used uninitialized in this function [-Wuninitialized]
arch/x86/kernel/quirks.c:357:6: note: ‘d’ was declared here
arch/x86/kernel/quirks.c:407:21: warning: ‘val’ may be used uninitialized in this function [-Wuninitialized]

This function quirk is called on a SB400 chipset only anyway so the
distant possibility of a PCI access failing becomes almost impossible
there. Even if it did fail, then something else more serious is the
problem.

So zero-out the variables so that gcc shuts up but do a coarse check
on the PCI accesses at the end and signal whether any of them had an
error. They shouldn't but in case they do, we'll at least know and we
can address it.

Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/1362428180-8865-6-git-send-email-bp@alien8.de
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/kernel/quirks.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index 26ee48a..04ee1e2 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -354,18 +354,22 @@ static void ati_force_hpet_resume(void)
 
 static u32 ati_ixp4x0_rev(struct pci_dev *dev)
 {
-	u32 d;
-	u8  b;
+	int err = 0;
+	u32 d = 0;
+	u8  b = 0;
 
-	pci_read_config_byte(dev, 0xac, &b);
+	err = pci_read_config_byte(dev, 0xac, &b);
 	b &= ~(1<<5);
-	pci_write_config_byte(dev, 0xac, b);
-	pci_read_config_dword(dev, 0x70, &d);
+	err |= pci_write_config_byte(dev, 0xac, b);
+	err |= pci_read_config_dword(dev, 0x70, &d);
 	d |= 1<<8;
-	pci_write_config_dword(dev, 0x70, d);
-	pci_read_config_dword(dev, 0x8, &d);
+	err |= pci_write_config_dword(dev, 0x70, d);
+	err |= pci_read_config_dword(dev, 0x8, &d);
 	d &= 0xff;
 	dev_printk(KERN_DEBUG, &dev->dev, "SB4X0 revision 0x%x\n", d);
+
+	WARN_ON_ONCE(err);
+
 	return d;
 }
 

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-04-03  0:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-04 20:16 [PATCH 0/5] x86: Misc fixlets Borislav Petkov
2013-03-04 20:16 ` [PATCH 1/5] x86, smpboot: Remove unused variable Borislav Petkov
2013-03-06  0:24   ` [tip:x86/urgent] " tip-bot for Borislav Petkov
2013-03-04 20:16 ` [PATCH 2/5] x86: Drop KERNEL_IMAGE_START Borislav Petkov
2013-04-03  0:18   ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
2013-03-04 20:16 ` [PATCH 3/5] x86-64, docs, mm: Add vsyscall range to virtual address space layout Borislav Petkov
2013-03-04 21:45   ` Andy Lutomirski
2013-03-04 21:56     ` Borislav Petkov
2013-04-03  0:19   ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
2013-03-04 20:16 ` [PATCH 4/5] x86, msr: Unify variable names Borislav Petkov
2013-04-03  0:20   ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
2013-03-04 20:16 ` [PATCH 5/5] x86, quirks: Shut-up a long-standing gcc warning Borislav Petkov
2013-04-03  0:21   ` [tip:x86/cleanups] " tip-bot for Borislav Petkov

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.