linux/arch/x86
Jan Beulich ccbcdf7cf1 xen/x86: replace order-based range checking of M2P table by linear one
The order-based approach is not only less efficient (requiring a shift
and a compare, typical generated code looking like this

	mov	eax, [machine_to_phys_order]
	mov	ecx, eax
	shr	ebx, cl
	test	ebx, ebx
	jnz	...

whereas a direct check requires just a compare, like in

	cmp	ebx, [machine_to_phys_nr]
	jae	...

), but also slightly dangerous in the 32-on-64 case - the element
address calculation can wrap if the next power of two boundary is
sufficiently far away from the actual upper limit of the table, and
hence can result in user space addresses being accessed (with it being
unknown what may actually be mapped there).

Additionally, the elimination of the mistaken use of fls() here (should
have been __fls()) fixes a latent issue on x86-64 that would trigger
if the code was run on a system with memory extending beyond the 44-bit
boundary.

CC: stable@kernel.org
Signed-off-by: Jan Beulich <jbeulich@novell.com>
[v1: Based on Jeremy's feedback]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-08-17 10:26:48 -04:00
..
boot x86, build: Do not set the root_dev field in bzImage 2011-05-25 12:46:05 -07:00
configs cgroup: remove the ns_cgroup 2011-05-26 17:12:34 -07:00
crypto crypto: ghash-intel - Fix set but not used in ghash_async_setkey() 2011-06-30 07:43:42 +08:00
ia32 atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
include/asm xen/x86: replace order-based range checking of M2P table by linear one 2011-08-17 10:26:48 -04:00
kernel atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
kvm atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
lguest lguest: Fix translation count about wikipedia's cpuid page 2011-07-22 14:39:50 +09:30
lib atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
math-emu
mm atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
net net: filter: Just In Time compiler for x86-64 2011-04-27 23:05:08 -07:00
oprofile x86, perf: Make copy_from_user_nmi() a library function 2011-07-21 20:41:57 +02:00
pci Merge branch 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-07-22 17:04:55 -07:00
platform Merge branch 'x86-olpc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-07-26 11:11:54 -07:00
power
tools
vdso x86-64, vdso: Do not allocate memory for the vDSO 2011-07-21 13:41:53 -07:00
video
xen xen/x86: replace order-based range checking of M2P table by linear one 2011-08-17 10:26:48 -04:00
.gitignore
Kbuild net: filter: Just In Time compiler for x86-64 2011-04-27 23:05:08 -07:00
Kconfig Merge branch 'x86-olpc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-07-26 11:11:54 -07:00
Kconfig.cpu x86: Add support for cmpxchg_double 2011-06-25 12:17:32 -07:00
Kconfig.debug lib: consolidate DEBUG_STACK_USAGE option 2011-05-25 08:39:54 -07:00
Makefile
Makefile_32.cpu x86, cpu: Move AMD Elan Kconfig under "Processor family" 2011-04-08 13:01:25 -07:00