* [tip:x86/build] x86, vdso: Error out if the vdso contains external references
[not found] <tip-*@vger.kernel.org>
@ 2010-06-18 22:16 ` tip-bot for H. Peter Anvin
2010-06-19 7:27 ` Andi Kleen
2010-07-28 3:42 ` Stephen Rothwell
2010-07-08 7:18 ` [tip:x86/cpu] x86, cpu: Support the features flags in new CPUID leaf 7 tip-bot for H. Peter Anvin
2010-07-28 7:18 ` [tip:x86/asm] x86, asm: Clean up and simplify set_64bit() tip-bot for H. Peter Anvin
2 siblings, 2 replies; 9+ messages in thread
From: tip-bot for H. Peter Anvin @ 2010-06-18 22:16 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, andi, tglx, hpa
Commit-ID: 05d0b0889ca9d033a960542af7f8a13b3ad4f630
Gitweb: http://git.kernel.org/tip/05d0b0889ca9d033a960542af7f8a13b3ad4f630
Author: H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Fri, 18 Jun 2010 14:36:26 -0700
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Fri, 18 Jun 2010 14:46:21 -0700
x86, vdso: Error out if the vdso contains external references
The vdso is a piece of userspace code which is supposed to be fully
self-contained. Any external (undefined) reference is an error, and
should be caught at compile time. This was giving us trouble when
compiling with -Os on gcc 4.5.0, for example (failed inline).
The need to do a buildtime check was pointed out by Andi Kleen.
Reported-by: Andi Kleen <andi@firstfloor.org>
LKML-Reference: <tip-*@vger.kernel.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
arch/x86/vdso/Makefile | 3 ++-
arch/x86/vdso/checkundef.sh | 10 ++++++++++
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 6b4ffed..4a2afa1 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -120,7 +120,8 @@ $(obj)/vdso32-syms.lds: $(vdso32.so-y:%=$(obj)/vdso32-%-syms.lds) FORCE
quiet_cmd_vdso = VDSO $@
cmd_vdso = $(CC) -nostdlib -o $@ \
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
- -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^)
+ -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
+ sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
GCOV_PROFILE := n
diff --git a/arch/x86/vdso/checkundef.sh b/arch/x86/vdso/checkundef.sh
new file mode 100755
index 0000000..490be1c
--- /dev/null
+++ b/arch/x86/vdso/checkundef.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+nm="$1"
+file="$2"
+"$nm" "$file" | grep '^ *U' > /dev/null 2>&1
+if [ $? -eq 1 ]; then
+ exit 0
+else
+ echo "$file: undefined symbols found" >&2
+ exit 1
+fi
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [tip:x86/build] x86, vdso: Error out if the vdso contains external references
2010-06-18 22:16 ` [tip:x86/build] x86, vdso: Error out if the vdso contains external references tip-bot for H. Peter Anvin
@ 2010-06-19 7:27 ` Andi Kleen
2010-06-19 15:44 ` H. Peter Anvin
2010-07-28 3:42 ` Stephen Rothwell
1 sibling, 1 reply; 9+ messages in thread
From: Andi Kleen @ 2010-06-19 7:27 UTC (permalink / raw)
To: mingo, hpa, linux-kernel, andi, tglx, hpa; +Cc: linux-tip-commits
> diff --git a/arch/x86/vdso/checkundef.sh b/arch/x86/vdso/checkundef.sh
> new file mode 100755
> index 0000000..490be1c
> --- /dev/null
> +++ b/arch/x86/vdso/checkundef.sh
> @@ -0,0 +1,10 @@
> +#!/bin/sh
> +nm="$1"
> +file="$2"
> +"$nm" "$file" | grep '^ *U' > /dev/null 2>&1
Does that really handle the failed inline, static function case?
In this case you get a function which is not 'U', but it's
just in the wrong section. I think that would need to be checked too.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [tip:x86/build] x86, vdso: Error out if the vdso contains external references
2010-06-19 7:27 ` Andi Kleen
@ 2010-06-19 15:44 ` H. Peter Anvin
0 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2010-06-19 15:44 UTC (permalink / raw)
To: Andi Kleen; +Cc: mingo, linux-kernel, tglx, hpa, linux-tip-commits
On 06/19/2010 12:27 AM, Andi Kleen wrote:
>> diff --git a/arch/x86/vdso/checkundef.sh b/arch/x86/vdso/checkundef.sh
>> new file mode 100755
>> index 0000000..490be1c
>> --- /dev/null
>> +++ b/arch/x86/vdso/checkundef.sh
>> @@ -0,0 +1,10 @@
>> +#!/bin/sh
>> +nm="$1"
>> +file="$2"
>> +"$nm" "$file" | grep '^ *U' > /dev/null 2>&1
>
> Does that really handle the failed inline, static function case?
>
> In this case you get a function which is not 'U', but it's
> just in the wrong section. I think that would need to be checked too.
>
Makes sense.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [tip:x86/cpu] x86, cpu: Support the features flags in new CPUID leaf 7
[not found] <tip-*@vger.kernel.org>
2010-06-18 22:16 ` [tip:x86/build] x86, vdso: Error out if the vdso contains external references tip-bot for H. Peter Anvin
@ 2010-07-08 7:18 ` tip-bot for H. Peter Anvin
2010-07-28 7:18 ` [tip:x86/asm] x86, asm: Clean up and simplify set_64bit() tip-bot for H. Peter Anvin
2 siblings, 0 replies; 9+ messages in thread
From: tip-bot for H. Peter Anvin @ 2010-07-08 7:18 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx
Commit-ID: bdc802dcca1709b01988d57e91f9f35ce1609fcc
Gitweb: http://git.kernel.org/tip/bdc802dcca1709b01988d57e91f9f35ce1609fcc
Author: H. Peter Anvin <hpa@zytor.com>
AuthorDate: Wed, 7 Jul 2010 17:29:18 -0700
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Wed, 7 Jul 2010 17:29:18 -0700
x86, cpu: Support the features flags in new CPUID leaf 7
Intel has defined CPUID leaf 7 as the next set of feature flags (see
the AVX specification, version 007). Add support for this new feature
flags word.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <tip-*@vger.kernel.org>
---
arch/x86/include/asm/cpufeature.h | 13 +++++++++----
arch/x86/include/asm/required-features.h | 2 ++
arch/x86/kernel/cpu/common.c | 10 ++++++++++
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index aeb6f3f..3ec9275 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -6,7 +6,7 @@
#include <asm/required-features.h>
-#define NCAPINTS 9 /* N 32-bit words worth of info */
+#define NCAPINTS 10 /* N 32-bit words worth of info */
/*
* Note: If the comment begins with a quoted string, that string is used
@@ -159,14 +159,14 @@
/*
* Auxiliary flags: Linux defined - For features scattered in various
- * CPUID levels like 0x6, 0xA etc
+ * CPUID levels like 0x6, 0xA etc, word 7
*/
#define X86_FEATURE_IDA (7*32+ 0) /* Intel Dynamic Acceleration */
#define X86_FEATURE_ARAT (7*32+ 1) /* Always Running APIC Timer */
#define X86_FEATURE_CPB (7*32+ 2) /* AMD Core Performance Boost */
#define X86_FEATURE_EPB (7*32+ 3) /* IA32_ENERGY_PERF_BIAS support */
-/* Virtualization flags: Linux defined */
+/* Virtualization flags: Linux defined, word 8 */
#define X86_FEATURE_TPR_SHADOW (8*32+ 0) /* Intel TPR Shadow */
#define X86_FEATURE_VNMI (8*32+ 1) /* Intel Virtual NMI */
#define X86_FEATURE_FLEXPRIORITY (8*32+ 2) /* Intel FlexPriority */
@@ -177,6 +177,9 @@
#define X86_FEATURE_SVML (8*32+7) /* "svm_lock" AMD SVM locking MSR */
#define X86_FEATURE_NRIPS (8*32+8) /* "nrip_save" AMD SVM next_rip save */
+/* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */
+#define X86_FEATURE_FSGSBASE (9*32+0) /* {RD/WR}{FS/GS}BASE instructions*/
+
#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
#include <asm/asm.h>
@@ -197,7 +200,9 @@ extern const char * const x86_power_flags[32];
(((bit)>>5)==4 && (1UL<<((bit)&31) & REQUIRED_MASK4)) || \
(((bit)>>5)==5 && (1UL<<((bit)&31) & REQUIRED_MASK5)) || \
(((bit)>>5)==6 && (1UL<<((bit)&31) & REQUIRED_MASK6)) || \
- (((bit)>>5)==7 && (1UL<<((bit)&31) & REQUIRED_MASK7)) ) \
+ (((bit)>>5)==7 && (1UL<<((bit)&31) & REQUIRED_MASK7)) || \
+ (((bit)>>5)==8 && (1UL<<((bit)&31) & REQUIRED_MASK8)) || \
+ (((bit)>>5)==9 && (1UL<<((bit)&31) & REQUIRED_MASK9)) ) \
? 1 : \
test_cpu_cap(c, bit))
diff --git a/arch/x86/include/asm/required-features.h b/arch/x86/include/asm/required-features.h
index 64cf2d2..6c7fc25 100644
--- a/arch/x86/include/asm/required-features.h
+++ b/arch/x86/include/asm/required-features.h
@@ -84,5 +84,7 @@
#define REQUIRED_MASK5 0
#define REQUIRED_MASK6 0
#define REQUIRED_MASK7 0
+#define REQUIRED_MASK8 0
+#define REQUIRED_MASK9 0
#endif /* _ASM_X86_REQUIRED_FEATURES_H */
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 68e4a6f..c735830 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -551,6 +551,16 @@ static void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c)
c->x86_capability[4] = excap;
}
+ /* Additional Intel-defined flags: level 0x00000007 */
+ if (c->cpuid_level >= 0x00000007) {
+ u32 eax, ebx, ecx, edx;
+
+ cpuid_count(0x00000007, 0, &eax, &ebx, &ecx, &edx);
+
+ if (eax > 0)
+ c->x86_capability[9] = ebx;
+ }
+
/* AMD-defined flags: level 0x80000001 */
xlvl = cpuid_eax(0x80000000);
c->extended_cpuid_level = xlvl;
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [tip:x86/build] x86, vdso: Error out if the vdso contains external references
2010-06-18 22:16 ` [tip:x86/build] x86, vdso: Error out if the vdso contains external references tip-bot for H. Peter Anvin
2010-06-19 7:27 ` Andi Kleen
@ 2010-07-28 3:42 ` Stephen Rothwell
2010-07-28 5:25 ` H. Peter Anvin
2010-07-28 7:19 ` [tip:x86/build] x86, vdso: Don't quote $nm in the script for checking vdso references tip-bot for H. Peter Anvin
1 sibling, 2 replies; 9+ messages in thread
From: Stephen Rothwell @ 2010-07-28 3:42 UTC (permalink / raw)
To: hpa; +Cc: mingo, hpa, linux-kernel, andi, tglx, linux-kernel, hpa
[-- Attachment #1: Type: text/plain, Size: 608 bytes --]
Hi,
On Fri, 18 Jun 2010 22:16:05 GMT "tip-bot for H. Peter Anvin" <hpa@linux.intel.com> wrote:
>
> diff --git a/arch/x86/vdso/checkundef.sh b/arch/x86/vdso/checkundef.sh
> new file mode 100755
> index 0000000..490be1c
> --- /dev/null
> +++ b/arch/x86/vdso/checkundef.sh
> @@ -0,0 +1,10 @@
> +#!/bin/sh
> +nm="$1"
> +file="$2"
> +"$nm" "$file" | grep '^ *U' > /dev/null 2>&1
Quoting $nm here doesn't work if you are building with ccache like this:
make CROSS_COMPILE="ccache ...."
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [tip:x86/build] x86, vdso: Error out if the vdso contains external references
2010-07-28 3:42 ` Stephen Rothwell
@ 2010-07-28 5:25 ` H. Peter Anvin
2010-07-28 7:19 ` [tip:x86/build] x86, vdso: Don't quote $nm in the script for checking vdso references tip-bot for H. Peter Anvin
1 sibling, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2010-07-28 5:25 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: mingo, hpa, linux-kernel, andi, tglx
Stephen Rothwell wrote:
> Hi,
>
> On Fri, 18 Jun 2010 22:16:05 GMT "tip-bot for H. Peter Anvin" <hpa@linux.intel.com> wrote:
>> diff --git a/arch/x86/vdso/checkundef.sh b/arch/x86/vdso/checkundef.sh
>> new file mode 100755
>> index 0000000..490be1c
>> --- /dev/null
>> +++ b/arch/x86/vdso/checkundef.sh
>> @@ -0,0 +1,10 @@
>> +#!/bin/sh
>> +nm="$1"
>> +file="$2"
>> +"$nm" "$file" | grep '^ *U' > /dev/null 2>&1
>
> Quoting $nm here doesn't work if you are building with ccache like this:
>
> make CROSS_COMPILE="ccache ...."
Hmmm... in some ways I'm not sure if that's a feature or a bug, but I
guess it's the only way currently provided. Sigh.
-hpa
^ permalink raw reply [flat|nested] 9+ messages in thread
* [tip:x86/asm] x86, asm: Clean up and simplify set_64bit()
[not found] <tip-*@vger.kernel.org>
2010-06-18 22:16 ` [tip:x86/build] x86, vdso: Error out if the vdso contains external references tip-bot for H. Peter Anvin
2010-07-08 7:18 ` [tip:x86/cpu] x86, cpu: Support the features flags in new CPUID leaf 7 tip-bot for H. Peter Anvin
@ 2010-07-28 7:18 ` tip-bot for H. Peter Anvin
2010-08-03 14:09 ` [tip:x86/asm] um, x86: Cast to (u64 *) inside set_64bit() tip-bot for H. Peter Anvin
2 siblings, 1 reply; 9+ messages in thread
From: tip-bot for H. Peter Anvin @ 2010-07-28 7:18 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx
Commit-ID: 69309a05907546fb686b251d4ab041c26afe1e1d
Gitweb: http://git.kernel.org/tip/69309a05907546fb686b251d4ab041c26afe1e1d
Author: H. Peter Anvin <hpa@zytor.com>
AuthorDate: Tue, 27 Jul 2010 23:29:52 -0700
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Tue, 27 Jul 2010 23:29:52 -0700
x86, asm: Clean up and simplify set_64bit()
Clean up and simplify set_64bit(). This code is quite old (1.3.11)
and contains a fair bit of auxilliary machinery that current versions
of gcc handle just fine automatically. Worse, the auxilliary
machinery can actually cause an unnecessary spill to memory.
Furthermore, the loading of the old value inside the loop in the
32-bit case is unnecessary: if the value doesn't match, the CMPXCHG8B
instruction will already have loaded the "new previous" value for us.
Clean up the comment, too, and remove page references to obsolete
versions of the Intel SDM.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <tip-*@vger.kernel.org>
---
arch/x86/include/asm/cmpxchg_32.h | 67 +++++++++++--------------------------
arch/x86/include/asm/cmpxchg_64.h | 4 +--
2 files changed, 21 insertions(+), 50 deletions(-)
diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
index c1cf59d..20955ea 100644
--- a/arch/x86/include/asm/cmpxchg_32.h
+++ b/arch/x86/include/asm/cmpxchg_32.h
@@ -53,60 +53,33 @@ struct __xchg_dummy {
__xchg((v), (ptr), sizeof(*ptr))
/*
- * The semantics of XCHGCMP8B are a bit strange, this is why
- * there is a loop and the loading of %%eax and %%edx has to
- * be inside. This inlines well in most cases, the cached
- * cost is around ~38 cycles. (in the future we might want
- * to do an SIMD/3DNOW!/MMX/FPU 64-bit store here, but that
- * might have an implicit FPU-save as a cost, so it's not
- * clear which path to go.)
+ * CMPXCHG8B only writes to the target if we had the previous
+ * value in registers, otherwise it acts as a read and gives us the
+ * "new previous" value. That is why there is a loop. Preloading
+ * EDX:EAX is a performance optimization: in the common case it means
+ * we need only one locked operation.
*
- * cmpxchg8b must be used with the lock prefix here to allow
- * the instruction to be executed atomically, see page 3-102
- * of the instruction set reference 24319102.pdf. We need
- * the reader side to see the coherent 64bit value.
+ * A SIMD/3DNOW!/MMX/FPU 64-bit store here would require at the very
+ * least an FPU save and/or %cr0.ts manipulation.
+ *
+ * cmpxchg8b must be used with the lock prefix here to allow the
+ * instruction to be executed atomically. We need to have the reader
+ * side to see the coherent 64bit value.
*/
-static inline void __set_64bit(unsigned long long *ptr,
- unsigned int low, unsigned int high)
+static inline void set_64bit(volatile u64 *ptr, u64 value)
{
+ u32 low = value;
+ u32 high = value >> 32;
+ u64 prev = *ptr;
+
asm volatile("\n1:\t"
- "movl (%1), %%eax\n\t"
- "movl 4(%1), %%edx\n\t"
- LOCK_PREFIX "cmpxchg8b (%1)\n\t"
+ LOCK_PREFIX "cmpxchg8b %0\n\t"
"jnz 1b"
- : "=m" (*ptr)
- : "D" (ptr),
- "b" (low),
- "c" (high)
- : "ax", "dx", "memory");
-}
-
-static inline void __set_64bit_constant(unsigned long long *ptr,
- unsigned long long value)
-{
- __set_64bit(ptr, (unsigned int)value, (unsigned int)(value >> 32));
-}
-
-#define ll_low(x) *(((unsigned int *)&(x)) + 0)
-#define ll_high(x) *(((unsigned int *)&(x)) + 1)
-
-static inline void __set_64bit_var(unsigned long long *ptr,
- unsigned long long value)
-{
- __set_64bit(ptr, ll_low(value), ll_high(value));
+ : "=m" (*ptr), "+A" (prev)
+ : "b" (low), "c" (high)
+ : "memory");
}
-#define set_64bit(ptr, value) \
- (__builtin_constant_p((value)) \
- ? __set_64bit_constant((ptr), (value)) \
- : __set_64bit_var((ptr), (value)))
-
-#define _set_64bit(ptr, value) \
- (__builtin_constant_p(value) \
- ? __set_64bit(ptr, (unsigned int)(value), \
- (unsigned int)((value) >> 32)) \
- : __set_64bit(ptr, ll_low((value)), ll_high((value))))
-
extern void __cmpxchg_wrong_size(void);
/*
diff --git a/arch/x86/include/asm/cmpxchg_64.h b/arch/x86/include/asm/cmpxchg_64.h
index b92f147..9596e7c 100644
--- a/arch/x86/include/asm/cmpxchg_64.h
+++ b/arch/x86/include/asm/cmpxchg_64.h
@@ -5,13 +5,11 @@
#define __xg(x) ((volatile long *)(x))
-static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
+static inline void set_64bit(volatile u64 *ptr, u64 val)
{
*ptr = val;
}
-#define _set_64bit set_64bit
-
extern void __xchg_wrong_size(void);
extern void __cmpxchg_wrong_size(void);
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [tip:x86/build] x86, vdso: Don't quote $nm in the script for checking vdso references
2010-07-28 3:42 ` Stephen Rothwell
2010-07-28 5:25 ` H. Peter Anvin
@ 2010-07-28 7:19 ` tip-bot for H. Peter Anvin
1 sibling, 0 replies; 9+ messages in thread
From: tip-bot for H. Peter Anvin @ 2010-07-28 7:19 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, sfr, tglx
Commit-ID: 18642a57df02a044b91219d3176128996ddc81a5
Gitweb: http://git.kernel.org/tip/18642a57df02a044b91219d3176128996ddc81a5
Author: H. Peter Anvin <hpa@zytor.com>
AuthorDate: Tue, 27 Jul 2010 23:52:29 -0700
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Tue, 27 Jul 2010 23:52:29 -0700
x86, vdso: Don't quote $nm in the script for checking vdso references
Don't quote $nm in the script for checking the vdso for external
references. Doing so breaks multiword constructs, like using
CROSS_COMPILE='ccache '.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <20100728134252.2e4c27cf.sfr@canb.auug.org.au>
---
arch/x86/vdso/checkundef.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/vdso/checkundef.sh b/arch/x86/vdso/checkundef.sh
index 490be1c..7ee90a9 100755
--- a/arch/x86/vdso/checkundef.sh
+++ b/arch/x86/vdso/checkundef.sh
@@ -1,7 +1,7 @@
#!/bin/sh
nm="$1"
file="$2"
-"$nm" "$file" | grep '^ *U' > /dev/null 2>&1
+$nm "$file" | grep '^ *U' > /dev/null 2>&1
if [ $? -eq 1 ]; then
exit 0
else
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [tip:x86/asm] um, x86: Cast to (u64 *) inside set_64bit()
2010-07-28 7:18 ` [tip:x86/asm] x86, asm: Clean up and simplify set_64bit() tip-bot for H. Peter Anvin
@ 2010-08-03 14:09 ` tip-bot for H. Peter Anvin
0 siblings, 0 replies; 9+ messages in thread
From: tip-bot for H. Peter Anvin @ 2010-08-03 14:09 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, jdike, hpa, mingo, tglx
Commit-ID: bf676945cb5bfe455321f57968967c18976f4995
Gitweb: http://git.kernel.org/tip/bf676945cb5bfe455321f57968967c18976f4995
Author: H. Peter Anvin <hpa@zytor.com>
AuthorDate: Tue, 3 Aug 2010 07:00:16 -0700
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Tue, 3 Aug 2010 07:00:16 -0700
um, x86: Cast to (u64 *) inside set_64bit()
After tightening up the types passed to set_64bit(), the cast to
(phys_t *) triggers a warning apparently because phys_t is defined as
"unsigned long" when building on 64 bits; however, u64 is defined as
"unsigned long long". This is, however, a explicit cast inside a
size-specific call, so just make the cast explicitly (u64 *).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jeff Dike <jdike@addtoit.com>
LKML-Reference: <tip-69309a05907546fb686b251d4ab041c26afe1e1d@git.kernel.org>
---
arch/um/include/asm/pgtable-3level.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/um/include/asm/pgtable-3level.h b/arch/um/include/asm/pgtable-3level.h
index 084de4a..0032f92 100644
--- a/arch/um/include/asm/pgtable-3level.h
+++ b/arch/um/include/asm/pgtable-3level.h
@@ -60,7 +60,7 @@
set_pud(pud, __pud(_PAGE_TABLE + __pa(pmd)))
#ifdef CONFIG_64BIT
-#define set_pud(pudptr, pudval) set_64bit((phys_t *) (pudptr), pud_val(pudval))
+#define set_pud(pudptr, pudval) set_64bit((u64 *) (pudptr), pud_val(pudval))
#else
#define set_pud(pudptr, pudval) (*(pudptr) = (pudval))
#endif
@@ -73,7 +73,7 @@ static inline int pgd_newpage(pgd_t pgd)
static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; }
#ifdef CONFIG_64BIT
-#define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval))
+#define set_pmd(pmdptr, pmdval) set_64bit((u64 *) (pmdptr), pmd_val(pmdval))
#else
#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval))
#endif
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-08-03 14:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <tip-*@vger.kernel.org>
2010-06-18 22:16 ` [tip:x86/build] x86, vdso: Error out if the vdso contains external references tip-bot for H. Peter Anvin
2010-06-19 7:27 ` Andi Kleen
2010-06-19 15:44 ` H. Peter Anvin
2010-07-28 3:42 ` Stephen Rothwell
2010-07-28 5:25 ` H. Peter Anvin
2010-07-28 7:19 ` [tip:x86/build] x86, vdso: Don't quote $nm in the script for checking vdso references tip-bot for H. Peter Anvin
2010-07-08 7:18 ` [tip:x86/cpu] x86, cpu: Support the features flags in new CPUID leaf 7 tip-bot for H. Peter Anvin
2010-07-28 7:18 ` [tip:x86/asm] x86, asm: Clean up and simplify set_64bit() tip-bot for H. Peter Anvin
2010-08-03 14:09 ` [tip:x86/asm] um, x86: Cast to (u64 *) inside set_64bit() tip-bot for H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox