On Mon, Sep 3, 2018 at 9:48 AM Adrian Pop <a...@bitdefender.com> wrote: > > From: Vlad Ioan Topan <ito...@bitdefender.com> > > The default value for the "suppress #VE" bit set by set_mem_access() > currently depends on whether the call is made from the same domain (the > bit is set when called from another domain and cleared if called from > the same domain). This patch changes that behavior to inherit the old > suppress #VE bit value if it is already set and to set it to 1 > otherwise, which is safer and more reliable. > > Signed-off-by: Vlad Ioan Topan <ito...@bitdefender.com> > Signed-off-by: Adrian Pop <a...@bitdefender.com> > --- > xen/arch/x86/mm/mem_access.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c > index 84d260ebd8..e1522a0b75 100644 > --- a/xen/arch/x86/mm/mem_access.c > +++ b/xen/arch/x86/mm/mem_access.c > @@ -284,8 +284,7 @@ int p2m_set_altp2m_mem_access(struct domain *d, struct > p2m_domain *hp2m, > } > } > > - return ap2m->set_entry(ap2m, gfn, mfn, PAGE_ORDER_4K, t, a, > - current->domain != d);
Could you add a comment here saying "inherit the old suppress #VE bit value if it is already set and to set it to 1 otherwise" to explain the meaning of the magic -1 value? Thanks, Tamas > + return ap2m->set_entry(ap2m, gfn, mfn, PAGE_ORDER_4K, t, a, -1); > } > > static int set_mem_access(struct domain *d, struct p2m_domain *p2m, > -- > 2.18.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel