xen/arm: fix nr_pdxs calculation
authorStefano Stabellini <sstabellini@kernel.org>
Mon, 3 Jun 2019 22:02:43 +0000 (15:02 -0700)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 29 Oct 2019 18:39:20 +0000 (11:39 -0700)
commitd6d52bc5ab9e3b31ad54f6f215d55d338d35dec5
tree0258def57a8c650237ed050097d4c2e649b7ce6b
parent317de0a12f36a4a6424c9fb302c6d81cefd6a840
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
(cherry picked from commit f51027be0688540aaab61513b06a8693a37e4c00)
xen/arch/arm/mm.c