Skip to contentSkip to conversation

x86/mm/paging: Prevent the guest from faulting on the same gfn when dying

PATCH Applied Andres Lagar-Cavilla 2 participants 2 messages Mar 12, 2012 – Mar 15, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mm/paging: Prevent the guest from faulting on the same gfn when dying

 xen/arch/x86/mm/p2m.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Please ignore previous post from a minute ago. Use this instead.

A crashing guest due to paging may hit an "endless" loop faulting repeatedly on the current paged-out gfn, until the toolstack comes around to killing the domain.

Unfortunately domain_crash at this point may not pause the vcpu due to the shutting_down flag, so we pause it explicitly when detecting the condition.

xen/arch/x86/mm/p2m.c +3 -0
diff -r dfbcb092aa66 -r 88584a17d2da xen/arch/x86/mm/p2m.c
@@ -988,6 +988,9 @@ void p2m_mem_paging_populate(struct doma
     {
         gdprintk(XENLOG_ERR, "Domain %hu paging gfn %lx yet no ring "
                              "in place\n", d->domain_id, gfn);
+        /* Prevent the vcpu from faulting repeatedly on the same gfn */
+        if ( v->domain == d )
+            vcpu_pause_nosync(v);
         domain_crash(d);
         return;
     }
Applied
#1 lore raw
Quoted 6 lines · Andres Lagar-Cavilla

A crashing guest due to paging may hit an "endless" loop faulting repeatedly on the current paged-out gfn, until the toolstack comes around to killing the domain.

Unfortunately domain_crash at this point may not pause the vcpu due to the shutting_down flag, so we pause it explicitly when detecting the condition.

Applied, thanks.

Tim.