From: Tamas K Lengyel Date: Wed, 29 Jan 2020 14:06:50 +0000 (+0100) Subject: x86/mem_access: use __get_gfn_type_access in set_mem_access X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~784 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9b71d6a759a6835c7723afa3d79e1e7f10da4396;p=xen.git x86/mem_access: use __get_gfn_type_access in set_mem_access Use __get_gfn_type_access instead of p2m->get_entry to trigger page-forking when the mem_access permission is being set on a page that has not yet been copied over from the parent. Signed-off-by: Tamas K Lengyel Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c index d16540a9aa..ede774fb50 100644 --- a/xen/arch/x86/mm/mem_access.c +++ b/xen/arch/x86/mm/mem_access.c @@ -303,11 +303,10 @@ static int set_mem_access(struct domain *d, struct p2m_domain *p2m, ASSERT(!ap2m); #endif { - mfn_t mfn; p2m_access_t _a; p2m_type_t t; - - mfn = p2m->get_entry(p2m, gfn, &t, &_a, 0, NULL, NULL); + mfn_t mfn = __get_gfn_type_access(p2m, gfn_x(gfn), &t, &_a, + P2M_ALLOC, NULL, false); rc = p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, t, a, -1); }