[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v6 1/3] x86/mm: Change default value for suppress #VE in set_mem_access()
On Wed, Sep 12, 2018 at 1:50 AM Adrian Pop <apop@xxxxxxxxxxxxxxx> wrote: > > From: Vlad Ioan Topan <itopan@xxxxxxxxxxxxxxx> > > 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 <itopan@xxxxxxxxxxxxxxx> > Signed-off-by: Adrian Pop <apop@xxxxxxxxxxxxxxx> Acked-by: Tamas K Lengyel <tamas@xxxxxxxxxxxxx> > --- > Changes in v6: > - add a comment in the code to explain the meaning of the -1 magic value > --- > xen/arch/x86/mm/mem_access.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/xen/arch/x86/mm/mem_access.c b/xen/arch/x86/mm/mem_access.c > index a8b3e99ec4..c980f1744d 100644 > --- a/xen/arch/x86/mm/mem_access.c > +++ b/xen/arch/x86/mm/mem_access.c > @@ -285,8 +285,11 @@ 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); > + /* > + * Inherit the old suppress #VE bit value if it is already set, or set it > + * to 1 otherwise > + */ > + 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@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |