xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mm/paging: Prevent the guest from faulting on the same gfn when dying
@ 2012-03-12 15:39 Andres Lagar-Cavilla
  0 siblings, 0 replies; 3+ messages in thread
From: Andres Lagar-Cavilla @ 2012-03-12 15:39 UTC (permalink / raw)
  To: xen-devel; +Cc: andres, tim, olaf, adin

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


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.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>

diff -r dfbcb092aa66 -r 0fe4b3326167 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -988,6 +988,8 @@ 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 */
+        vcpu_pause_nosync(v);
         domain_crash(d);
         return;
     }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] x86/mm/paging: Prevent the guest from faulting on the same gfn when dying
@ 2012-03-12 15:42 Andres Lagar-Cavilla
  2012-03-15 11:32 ` Tim Deegan
  0 siblings, 1 reply; 3+ messages in thread
From: Andres Lagar-Cavilla @ 2012-03-12 15:42 UTC (permalink / raw)
  To: xen-devel; +Cc: andres, tim, olaf, adin

 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.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>

diff -r dfbcb092aa66 -r 88584a17d2da xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c
+++ b/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;
     }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/mm/paging: Prevent the guest from faulting on the same gfn when dying
  2012-03-12 15:42 [PATCH] x86/mm/paging: Prevent the guest from faulting on the same gfn when dying Andres Lagar-Cavilla
@ 2012-03-15 11:32 ` Tim Deegan
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Deegan @ 2012-03-15 11:32 UTC (permalink / raw)
  To: Andres Lagar-Cavilla; +Cc: andres, adin, olaf, xen-devel

At 11:42 -0400 on 12 Mar (1331552563), Andres Lagar-Cavilla wrote:
> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-15 11:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-12 15:42 [PATCH] x86/mm/paging: Prevent the guest from faulting on the same gfn when dying Andres Lagar-Cavilla
2012-03-15 11:32 ` Tim Deegan
  -- strict thread matches above, loose matches on Subject: below --
2012-03-12 15:39 Andres Lagar-Cavilla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).