xen: correctly restore pfn_to_mfn_list_list after resume
commitb6172e046931fd39a53b3607af40155eadbbecc2
authorIan Campbell <ian.campbell@citrix.com>
Sat, 21 Nov 2009 11:32:49 +0000 (21 11:32 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 22:04:47 +0000 (18 14:04 -0800)
tree0c6e50d784daed21c01a0e70a5a7b6386d828e7f
parentb6c73e8a66cd9f54bfc0d2267afd10eaf44157e1
xen: correctly restore pfn_to_mfn_list_list after resume

commit fa24ba62ea2869308ffc9f0b286ac9650b4ca6cb upstream.

pvops kernels >= 2.6.30 can currently only be saved and restored once. The
second attempt to save results in:

    ERROR Internal error: Frame# in pfn-to-mfn frame list is not in pseudophys
    ERROR Internal error: entry 0: p2m_frame_list[0] is 0xf2c2c2c2, max 0x120000
    ERROR Internal error: Failed to map/save the p2m frame list

I finally narrowed it down to:

    commit cdaead6b4e657f960d6d6f9f380e7dfeedc6a09b
        Author: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
        Date:   Fri Feb 27 15:34:59 2009 -0800

            xen: split construction of p2m mfn tables from registration

            Build the p2m_mfn_list_list early with the rest of the p2m table, but
            register it later when the real shared_info structure is in place.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
The unforeseen side-effect of this change was to cause the mfn list list to not
be rebuilt on resume. Prior to this change it would have been rebuilt via
xen_post_suspend() -> xen_setup_shared_info() -> xen_setup_mfn_list_list().

Fix by explicitly calling xen_build_mfn_list_list() from xen_post_suspend().

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/xen/mmu.c
arch/x86/xen/suspend.c
arch/x86/xen/xen-ops.h