From: Julien Grall Date: Thu, 15 Dec 2022 11:44:54 +0000 (+0000) Subject: xen/arm: mm: Allow xen_pt_update() to work with the current root table X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0e506697d016ceab58b06a5c6e1932b9b382e29e;p=people%2Fdwmw2%2Fxen.git xen/arm: mm: Allow xen_pt_update() to work with the current root table 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 Acked-by: Stefano Stabellini --- diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 1fd207b27c..16ec1d0fe9 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -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