linux/arch/x86/xen
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
..
Kconfig fix XEN_SAVE_RESTORE Kconfig dependencies 2011-04-11 22:54:48 +02:00
Makefile xen/tracing: it looks like we wanted CONFIG_FTRACE 2011-08-04 15:31:27 -04:00
debugfs.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
debugfs.h xen: add debugfs support 2008-08-21 13:52:58 +02:00
enlighten.c xen/x86: replace order-based range checking of M2P table by linear one 2011-08-17 10:26:48 -04:00
grant-table.c xen: make grant table arch portable 2008-04-24 23:57:32 +02:00
irq.c arch/x86/xen/irq: Cleanup code/data sections definitions 2011-05-12 17:19:33 -04:00
mmu.c xen/x86: replace order-based range checking of M2P table by linear one 2011-08-17 10:26:48 -04:00
mmu.h xen: make a pile of mmu pvop functions static 2011-05-20 14:25:24 -07:00
multicalls.c xen/multicall: move *idx fields to start of mc_buffer 2011-07-18 15:43:46 -07:00
multicalls.h xen/trace: add multicall tracing 2011-07-18 15:43:26 -07:00
p2m.c Merge branches 'stable/irq', 'stable/p2m.bugfixes', 'stable/e820.bugfixes' and 'stable/mmu.bugfixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2011-05-19 16:14:58 -07:00
pci-swiotlb-xen.c treewide: fix a few typos in comments 2011-05-10 10:16:21 +02:00
platform-pci-unplug.c xen:pvhvm: Modpost section mismatch fix 2011-07-11 13:37:04 -04:00
setup.c xen: Fix misleading WARN message at xen_release_chunk 2011-08-04 15:31:29 -04:00
smp.c xen: support CONFIG_MAXSMP 2011-06-15 14:18:49 -04:00
spinlock.c xen: Use this_cpu_ops 2010-12-17 15:07:19 +01:00
suspend.c xen: suspend: add "arch" to pre/post suspend hooks 2011-02-25 16:43:12 +00:00
time.c Merge branch 'timers-clocksource-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-05-19 17:44:13 -07:00
trace.c xen/trace: Fix compile error when CONFIG_XEN_PRIVILEGED_GUEST is not set 2011-08-05 09:43:02 -04:00
vdso.h
vga.c xen: allow enable use of VGA console on dom0 2011-06-06 11:46:00 -04:00
xen-asm.S x86: style cleanups for xen assemblies 2009-02-05 20:25:41 +01:00
xen-asm.h xen: make direct versions of irq_enable/disable/save/restore to common code 2009-02-04 16:59:04 -08:00
xen-asm_32.S percpu: remove per_cpu__ prefix. 2009-10-29 22:34:15 +09:00
xen-asm_64.S xen: use iret for return from 64b kernel to 32b usermode 2009-12-03 11:14:54 -08:00
xen-head.S x86, asm: Cleanup unnecssary macros in asm-offsets.c 2011-02-25 16:37:32 -08:00
xen-ops.h Merge branch 'stable/vga.support' into stable/drivers 2011-06-21 09:25:41 -04:00