]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xen/arm: mm: Allow xen_pt_update() to work with the current root table
authorJulien Grall <jgrall@amazon.com>
Thu, 15 Dec 2022 11:44:54 +0000 (11:44 +0000)
committerJulien Grall <jgrall@amazon.com>
Thu, 15 Dec 2022 11:46:37 +0000 (11:46 +0000)
At the moment, xen_pt_update() will only work on the runtime page tables.
In follow-up patches, we will also want to use the helper to update
the boot page tables.

All the existing callers of xen_pt_update() expects to modify the
current page-tables. Therefore, we can read the root physical address
directly from TTBR0_EL2.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/mm.c

index 1fd207b27c1d9ad29d3657db4565c66403d861ff..16ec1d0fe9e5a8577c4eb6c79bb03cc0c575f232 100644 (file)
@@ -1099,7 +1099,7 @@ static int xen_pt_update(unsigned long virt,
      *
      * XXX: Add a check.
      */
-    const mfn_t root = virt_to_mfn(THIS_CPU_PGTABLE);
+    const mfn_t root = maddr_to_mfn(READ_SYSREG64(TTBR0_EL2));
 
     /*
      * The hardware was configured to forbid mapping both writeable and