linux/arch
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
..
alpha atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
arm Merge branch 'at91/cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc 2011-07-29 23:32:53 -07:00
avr32 atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
blackfin atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
cris atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
frv atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
h8300 atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
ia64 atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
m32r atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
m68k atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
microblaze Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze 2011-07-27 09:24:20 -07:00
mips atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
mn10300 atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
openrisc OpenRISC: Miscellaneous 2011-07-22 18:46:41 +02:00
parisc atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
powerpc Merge branch 'next/cross-platform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/linux-arm-soc 2011-07-26 17:12:10 -07:00
s390 atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
score modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
sh atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
sparc sparc: Detect and handle UltraSPARC-T3 cpu types. 2011-07-27 22:10:10 -07:00
tile atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
um ptrace: unify show_regs() prototype 2011-07-26 16:49:43 -07:00
unicore32 modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
x86 xen/x86: replace order-based range checking of M2P table by linear one 2011-08-17 10:26:48 -04:00
xtensa atomic: cleanup asm-generic atomic*.h inclusion 2011-07-26 16:49:47 -07:00
.gitignore
Kconfig mm, powerpc: move the RCU page-table freeing into generic code 2011-05-25 08:39:16 -07:00