linux/arch/x86/include/asm/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
..
events.h xen: use our own eventchannel->irq path 2009-02-09 12:17:30 +01:00
grant_table.h x86: drop double underscores from header guards 2008-10-23 00:01:39 -07:00
hypercall.h xen/trace: add multicall tracing 2011-07-18 15:43:26 -07:00
hypervisor.h xen: HVM X2APIC support 2011-01-07 10:03:50 -05:00
interface_32.h xen: implement XENMEM_machphys_mapping 2010-11-12 15:00:06 -08:00
interface_64.h xen: implement XENMEM_machphys_mapping 2010-11-12 15:00:06 -08:00
interface.h x86: Fix common misspellings 2011-03-18 10:39:30 +01:00
page.h xen/x86: replace order-based range checking of M2P table by linear one 2011-08-17 10:26:48 -04:00
pci.h xen/pci: Squash pci_xen_initial_domain and xen_setup_pirqs together. 2011-07-11 13:19:30 -04:00
swiotlb-xen.h pci-swiotlb-xen: Add glue code to setup dma_ops utilizing xen_swiotlb_* 2010-07-27 11:51:02 -04:00
trace_types.h xen/trace: add multicall tracing 2011-07-18 15:43:26 -07:00