ia64/xen-unstable

changeset 18328:b1e5a0def648

x86, shadow: Fix OOS on domain crash.

I couldn't reproduce the Nevada crash on my testbox, but this should
fix the first Xen crash that was seen in the Nevada HVM (bugzilla
#1322).

What I think most probably happened there is that the set_l2e call in
shadow_get_and_create_l1e() has tried to resync a page, but somehow we
weren't unable to remove the shadow (the real bug we should actually
look after). sh_resync() then removes the page from the OOS hash and
later in the page fault path we find the gw.l1mfn to be still OOS, so
we try to update the snapshot and the bug happens.

This should fix this and other unlikely (like sh_unsync() failing to
remove for hash collision the current gw.l1mfn) cases.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Aug 14 10:14:32 2008 +0100 (2008-08-14)
parents 3ad6ad720f90
children ca7dd77d5365
files xen/arch/x86/mm/shadow/multi.c
line diff
     1.1 --- a/xen/arch/x86/mm/shadow/multi.c	Thu Aug 14 11:00:35 2008 +0900
     1.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Thu Aug 14 10:14:32 2008 +0100
     1.3 @@ -3290,6 +3290,16 @@ static int sh_page_fault(struct vcpu *v,
     1.4      if ( sh_mfn_is_a_page_table(gmfn)
     1.5           && ft == ft_demand_write )
     1.6          sh_unsync(v, gmfn);
     1.7 +
     1.8 +    if ( unlikely(d->is_shutting_down) )
     1.9 +    {
    1.10 +        /* We might end up with a crashed domain here if
    1.11 +         * sh_remove_shadows() in a previous sh_resync() call has
    1.12 +         * failed. We cannot safely continue since some page is still
    1.13 +         * OOS but not in the hash table anymore. */
    1.14 +        shadow_unlock(d);
    1.15 +        return 0;
    1.16 +    }
    1.17  #endif /* OOS */
    1.18  
    1.19      /* Calculate the shadow entry and write it */