xen/arm: fix nr_pdxs calculation
authorStefano Stabellini <sstabellini@kernel.org>
Mon, 3 Jun 2019 22:02:43 +0000 (15:02 -0700)
committerJulien Grall <julien.grall@arm.com>
Thu, 6 Jun 2019 15:07:03 +0000 (16:07 +0100)
commitf51027be0688540aaab61513b06a8693a37e4c00
treeb2bd685961438c49685b1daccf3aeb2fae9f647d
parenteb0520cb9165ab91d87efcb8a1a5a11c0f6ec979
xen/arm: fix nr_pdxs calculation

pfn_to_pdx expects an address, not a size, as a parameter. Specifically,
it expects the end address, then the masks calculations compensate for
any holes between start and end. Thus, we should pass the end address to
pfn_to_pdx.

The initial pdx is stored in frametable_base_pdx, so we can subtract the
result of pfn_to_pdx(start_address) from nr_pdxs; we know that we don't
need to cover any memory in the range 0-start in the frametable.

Remove the variable `nr_pages' because it is unused.

Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
CC: JBeulich@suse.com
xen/arch/arm/mm.c