On 06/08/2016 10:54, Sergej Proskurin wrote:
Hi Julien,
Hello Sergej,
On 08/04/2016 01:46 PM, Julien Grall wrote:
Hello Sergej,
On 01/08/16 18:10, Sergej Proskurin wrote:
Signed-off-by: Sergej Proskurin <prosku...@sec.in.tum.de>
---
Cc: Stefano Stabellini <sstabell...@kernel.org>
Cc: Julien Grall <julien.gr...@arm.com>
---
v2: Substituted the call to tlb_flush for p2m_flush_table.
Added comments.
Cosmetic fixes.
---
xen/arch/arm/altp2m.c | 50
++++++++++++++++++++++++++++++++++++++++++++
xen/arch/arm/hvm.c | 2 +-
xen/include/asm-arm/altp2m.h | 4 ++++
3 files changed, 55 insertions(+), 1 deletion(-)
diff --git a/xen/arch/arm/altp2m.c b/xen/arch/arm/altp2m.c
index c22d2e4..80ed553 100644
--- a/xen/arch/arm/altp2m.c
+++ b/xen/arch/arm/altp2m.c
[...]
+
+ p2m_flush_table(p2m);
+
+ /*
+ * Reset VTTBR.
+ *
+ * Note that VMID is not freed so that it can be reused
later.
+ */
+ p2m->vttbr.vttbr = INVALID_VTTBR;
+ d->arch.altp2m_vttbr[idx] = INVALID_VTTBR;
+
+ read_unlock(&p2m->lock);
Why did you decide to reset the p2m rather than free it? The code
would be simpler with the latter.
* First, to be as similar to the x86 implementation as possible.
* Second, simply to reuse already allocated p2m's without additional
overhead.
I don't really buy those arguments. The x86 implementation may not fit
the ARM model. Initializing a p2m on ARM is very quick: allocating the
p2m and the root pages (up to 2 page).
So the overhead is really minimal. Therefore, I don't see any reason to
introduce complex bookkeeping when NULL can be used for the same purpose.
Regards,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel