* several Qs about domain live migration
@ 2008-11-17 6:50 Tian, Kevin
2008-11-17 7:45 ` Keir Fraser
0 siblings, 1 reply; 11+ messages in thread
From: Tian, Kevin @ 2008-11-17 6:50 UTC (permalink / raw)
To: Xen Developers
Is analysis_phase just for debug purpose, since 'runs' is just zero
when invoked?
Where is the possible place to mark pfn_type to as some special
type for hvm domain, like invalid pfn?
if ( hvm )
pfn_type[batch] = n;
else
pfn_type[batch] = pfn_to_mfn(n);
I didn't find code to check mmio holes. Then how does restore
side differentiate normal ram from those holes, for a hvm with
>4G memory?
Thanks,
Kevin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: several Qs about domain live migration
2008-11-17 6:50 several Qs about domain live migration Tian, Kevin
@ 2008-11-17 7:45 ` Keir Fraser
2008-11-17 7:49 ` Tian, Kevin
0 siblings, 1 reply; 11+ messages in thread
From: Keir Fraser @ 2008-11-17 7:45 UTC (permalink / raw)
To: Tian, Kevin, Xen Developers
On 17/11/08 06:50, "Tian, Kevin" <kevin.tian@intel.com> wrote:
> I didn't find code to check mmio holes. Then how does restore
> side differentiate normal ram from those holes, for a hvm with
>> 4G memory?
I don't think the save side transmits entries for non-existent pages.
-- Keir
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: several Qs about domain live migration
2008-11-17 7:45 ` Keir Fraser
@ 2008-11-17 7:49 ` Tian, Kevin
2008-11-17 8:40 ` Keir Fraser
0 siblings, 1 reply; 11+ messages in thread
From: Tian, Kevin @ 2008-11-17 7:49 UTC (permalink / raw)
To: 'Keir Fraser', Xen Developers
>From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
>Sent: Monday, November 17, 2008 3:45 PM
>
>On 17/11/08 06:50, "Tian, Kevin" <kevin.tian@intel.com> wrote:
>
>> I didn't find code to check mmio holes. Then how does restore
>> side differentiate normal ram from those holes, for a hvm with
>>> 4G memory?
>
>I don't think the save side transmits entries for non-existent pages.
>
Yes, that's also my original assumption. But after reading code,
I didn't find lines to seperate those non-existence pages. I saw
one of your change (18533) to skip page patches which contain
no valid pages:
+ if ( hvm )
+ {
+ /* Look for and skip completely empty batches. */
+ for ( j = 0; j < batch; j++ )
+ if ( (pfn_type[j] & XEN_DOMCTL_PFINFO_LTAB_MASK) !=
+ XEN_DOMCTL_PFINFO_XTAB )
+ break;
+ if ( j == batch )
+ {
+ munmap(region_base, batch*PAGE_SIZE);
+ continue; /* bail on this batch: no valid pages */
+ }
+ }
+ else
But I don't know where XEN_DOMCTL_PFINFO_XTAB may be
set for hvm domain. Could you help spot it to me?
Thanks,
Kevin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: several Qs about domain live migration
2008-11-17 7:49 ` Tian, Kevin
@ 2008-11-17 8:40 ` Keir Fraser
2008-11-17 8:46 ` Tian, Kevin
2008-11-18 1:17 ` Zhai, Edwin
0 siblings, 2 replies; 11+ messages in thread
From: Keir Fraser @ 2008-11-17 8:40 UTC (permalink / raw)
To: Tian, Kevin, Xen Developers
On 17/11/08 07:49, "Tian, Kevin" <kevin.tian@intel.com> wrote:
> But I don't know where XEN_DOMCTL_PFINFO_XTAB may be
> set for hvm domain. Could you help spot it to me?
xc_map_foreign_batch()
-- Keir
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: several Qs about domain live migration
2008-11-17 8:40 ` Keir Fraser
@ 2008-11-17 8:46 ` Tian, Kevin
2008-11-18 1:17 ` Zhai, Edwin
1 sibling, 0 replies; 11+ messages in thread
From: Tian, Kevin @ 2008-11-17 8:46 UTC (permalink / raw)
To: 'Keir Fraser', Xen Developers
>From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
>Sent: Monday, November 17, 2008 4:40 PM
>On 17/11/08 07:49, "Tian, Kevin" <kevin.tian@intel.com> wrote:
>
>> But I don't know where XEN_DOMCTL_PFINFO_XTAB may be
>> set for hvm domain. Could you help spot it to me?
>
>xc_map_foreign_batch()
>
> -- Keir
Got it. Thank you.
Kevin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: several Qs about domain live migration
2008-11-17 8:40 ` Keir Fraser
2008-11-17 8:46 ` Tian, Kevin
@ 2008-11-18 1:17 ` Zhai, Edwin
2008-11-18 8:13 ` Keir Fraser
1 sibling, 1 reply; 11+ messages in thread
From: Zhai, Edwin @ 2008-11-18 1:17 UTC (permalink / raw)
To: Keir Fraser; +Cc: Tian, Kevin, Xen Developers, Zhai, Edwin
Keir,
We are trying to fix a HVM live migration bug, and found "Use main memory for
video memory" in r18383 cause guest hang after restore.
Following changes make all valid pages migrated, including vlapic page
(0xFEE00), and share page(0xFFFFF), so an extra memory population for these 2
pages would override previous mapping then cause guest hang (if using vlapic
acceleration).
What do you think of possible fixing? Skipping these specific pages in
xc_domain_save except video memory, or change the HVM domain creation.
Thanks,
=====================================================================
diff -r 2397555ebcc2 -r dade7f0bdc8d tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c Wed Aug 27 13:31:01 2008 +0100
+++ b/tools/libxc/xc_domain_save.c Wed Aug 27 14:53:39 2008 +0100
@@ -1109,12 +1109,6 @@ int xc_domain_save(int xc_handle, int io
if ( !((test_bit(n, to_send) && !test_bit(n, to_skip)) ||
(test_bit(n, to_send) && last_iter) ||
(test_bit(n, to_fix) && last_iter)) )
- continue;
-
- /* Skip PFNs that aren't really there */
- if ( hvm && ((n >= 0xa0 && n < 0xc0) /* VGA hole */
- || (n >= (HVM_BELOW_4G_MMIO_START >> PAGE_SHIFT)
- && n < (1ULL<<32) >> PAGE_SHIFT)) /* MMIO */ )
continue;
/*
On Mon, Nov 17, 2008 at 04:40:19PM +0800, Keir Fraser wrote:
>
>
>
> On 17/11/08 07:49, "Tian, Kevin" <kevin.tian@intel.com> wrote:
>
> > But I don't know where XEN_DOMCTL_PFINFO_XTAB may be
> > set for hvm domain. Could you help spot it to me?
>
> xc_map_foreign_batch()
>
> -- Keir
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
--
best rgds,
edwin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: several Qs about domain live migration
2008-11-18 1:17 ` Zhai, Edwin
@ 2008-11-18 8:13 ` Keir Fraser
2008-11-18 8:22 ` Zhai, Edwin
0 siblings, 1 reply; 11+ messages in thread
From: Keir Fraser @ 2008-11-18 8:13 UTC (permalink / raw)
To: Zhai, Edwin; +Cc: Tian, Kevin, Xen Developers
On 18/11/08 01:17, "Zhai, Edwin" <edwin.zhai@intel.com> wrote:
> We are trying to fix a HVM live migration bug, and found "Use main memory for
> video memory" in r18383 cause guest hang after restore.
>
> Following changes make all valid pages migrated, including vlapic page
> (0xFEE00), and share page(0xFFFFF), so an extra memory population for these 2
> pages would override previous mapping then cause guest hang (if using vlapic
> acceleration).
>
> What do you think of possible fixing? Skipping these specific pages in
> xc_domain_save except video memory, or change the HVM domain creation.
Try changing gmfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e)) in mod_l1_entry()
to:
mfn = gfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e), &p2mt);
if ( !p2m_is_ram(p2mt) || (mfn == INVALID_MFN) )
....
This will prevent foreign mappings of 'mmio' pages. Pretty sensible and will
fix this problem.
-- Keir
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: several Qs about domain live migration
2008-11-18 8:13 ` Keir Fraser
@ 2008-11-18 8:22 ` Zhai, Edwin
2008-11-18 9:12 ` Keir Fraser
0 siblings, 1 reply; 11+ messages in thread
From: Zhai, Edwin @ 2008-11-18 8:22 UTC (permalink / raw)
To: Keir Fraser; +Cc: Tian, Kevin, Xen Developers
Keir Fraser wrote:
> On 18/11/08 01:17, "Zhai, Edwin" <edwin.zhai@intel.com> wrote:
>
>
>> We are trying to fix a HVM live migration bug, and found "Use main memory for
>> video memory" in r18383 cause guest hang after restore.
>>
>> Following changes make all valid pages migrated, including vlapic page
>> (0xFEE00), and share page(0xFFFFF), so an extra memory population for these 2
>> pages would override previous mapping then cause guest hang (if using vlapic
>> acceleration).
>>
>> What do you think of possible fixing? Skipping these specific pages in
>> xc_domain_save except video memory, or change the HVM domain creation.
>>
>
> Try changing gmfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e)) in mod_l1_entry()
> to:
> mfn = gfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e), &p2mt);
> if ( !p2m_is_ram(p2mt) || (mfn == INVALID_MFN) )
> ....
>
> This will prevent foreign mappings of 'mmio' pages. Pretty sensible and will
> fix this problem.
>
It's great!
Does p2m_is_ram return 1 for video memory?
I'll make a small patch and test it.
Thanks,
> -- Keir
>
>
>
--
best rgds,
edwin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: several Qs about domain live migration
2008-11-18 8:22 ` Zhai, Edwin
@ 2008-11-18 9:12 ` Keir Fraser
2008-11-18 9:35 ` Zhai, Edwin
0 siblings, 1 reply; 11+ messages in thread
From: Keir Fraser @ 2008-11-18 9:12 UTC (permalink / raw)
To: Zhai, Edwin; +Cc: Tian, Kevin, Xen Developers
On 18/11/08 08:22, "Zhai, Edwin" <edwin.zhai@intel.com> wrote:
>> Try changing gmfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e)) in mod_l1_entry()
>> to:
>> mfn = gfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e), &p2mt);
>> if ( !p2m_is_ram(p2mt) || (mfn == INVALID_MFN) )
>> ....
>>
>> This will prevent foreign mappings of 'mmio' pages. Pretty sensible and will
>> fix this problem.
>>
>
> It's great!
> Does p2m_is_ram return 1 for video memory?
Yes, since it is just ordinary guest memory. That was the point of Samuel's
patch.
-- Keir
> I'll make a small patch and test it.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: several Qs about domain live migration
2008-11-18 9:12 ` Keir Fraser
@ 2008-11-18 9:35 ` Zhai, Edwin
2008-11-18 9:47 ` Keir Fraser
0 siblings, 1 reply; 11+ messages in thread
From: Zhai, Edwin @ 2008-11-18 9:35 UTC (permalink / raw)
To: Keir Fraser; +Cc: Tian, Kevin, Xen Developers, Zhai, Edwin
Keir,
As my test, video mem and vlapic page are okay, but share page is
still treated as ram.
After going through the source code, I think this should be "no harm".
Although xc_domain_restore populate a new share page first, PV driver
in HVM guest will remap share page when resume, thus destroying
previous mapping and releasing previous page.
So we want to use this simple patch, or mark the share page "not ram"?
Keir Fraser wrote:
> On 18/11/08 08:22, "Zhai, Edwin" <edwin.zhai@intel.com> wrote:
>
> >> Try changing gmfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e)) in
mod_l1_entry()
> >> to:
> >> mfn = gfn_to_mfn(FOREIGNDOM, l1e_get_pfn(nl1e), &p2mt);
> >> if ( !p2m_is_ram(p2mt) || (mfn == INVALID_MFN) )
> >> ....
> >>
> >> This will prevent foreign mappings of 'mmio' pages. Pretty sensible
and will
> >> fix this problem.
> >>
> > It's great!
> > Does p2m_is_ram return 1 for video memory?
>
> Yes, since it is just ordinary guest memory. That was the point of
Samuel's
> patch.
>
> -- Keir
>
> > I'll make a small patch and test it.
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
--
best rgds,
edwin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: several Qs about domain live migration
2008-11-18 9:35 ` Zhai, Edwin
@ 2008-11-18 9:47 ` Keir Fraser
0 siblings, 0 replies; 11+ messages in thread
From: Keir Fraser @ 2008-11-18 9:47 UTC (permalink / raw)
To: Zhai, Edwin; +Cc: Tian, Kevin, Xen Developers
On 18/11/08 09:35, "Zhai, Edwin" <edwin.zhai@intel.com> wrote:
> Keir,
> As my test, video mem and vlapic page are okay, but share page is
> still treated as ram.
>
> After going through the source code, I think this should be "no harm".
> Although xc_domain_restore populate a new share page first, PV driver
> in HVM guest will remap share page when resume, thus destroying
> previous mapping and releasing previous page.
>
> So we want to use this simple patch, or mark the share page "not ram"?
It's fine. The shared page mapping is not set up until after normal guest
memory is restored. So it's safe.
-- Keir
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-11-18 9:47 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-17 6:50 several Qs about domain live migration Tian, Kevin
2008-11-17 7:45 ` Keir Fraser
2008-11-17 7:49 ` Tian, Kevin
2008-11-17 8:40 ` Keir Fraser
2008-11-17 8:46 ` Tian, Kevin
2008-11-18 1:17 ` Zhai, Edwin
2008-11-18 8:13 ` Keir Fraser
2008-11-18 8:22 ` Zhai, Edwin
2008-11-18 9:12 ` Keir Fraser
2008-11-18 9:35 ` Zhai, Edwin
2008-11-18 9:47 ` Keir Fraser
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.