On 11/21/18 3:21 PM, Andrew Cooper wrote: > The gfn references need to remain held until after the p2m_set_entry() has > completed. This is only a latent bug for now, because there is no per-gfn > locking and we recursively hold the main p2m locks. > > Rearrange the code to have a single exit path, and defer taking the ap2m lock > until it is necessary to do so. Leave some comments behind to help people > attempting to follow the logic. > > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> > --- > CC: Jan Beulich <jbeul...@suse.com> > CC: Wei Liu <wei.l...@citrix.com> > CC: Roger Pau Monné <roger....@citrix.com> > CC: Razvan Cojocaru <rcojoc...@bitdefender.com> > CC: Tamas K Lengyel <ta...@tklengyel.com> > CC: George Dunlap <george.dun...@eu.citrix.com> > --- > xen/arch/x86/mm/p2m.c | 27 ++++++++++++++++++++------- > 1 file changed, 20 insertions(+), 7 deletions(-) > > diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c > index b5a59d6..ae9cb20 100644 > --- a/xen/arch/x86/mm/p2m.c > +++ b/xen/arch/x86/mm/p2m.c > @@ -2184,24 +2184,29 @@ bool_t p2m_altp2m_lazy_copy(struct vcpu *v, paddr_t > gpa, > unsigned long mask; > mfn_t mfn; > int rv; > + bool ret;
Thanks for the patches! This one looks good, except I think you'll want to also change the return type of p2m_altp2m_lazy_copy() from bool_t to bool. With that: Reviewed-by: Razvan Cojocaru <rcojoc...@bitdefender.com> Thanks, Razvan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel