Daniel Kiper
2010-Feb-20 21:48 UTC
[Xen-devel] Some fixes for xen-3.4-testing/xen-unstable
Hi, I am sending small fixes for hypervisor and fs-backed. For details look below. # HG changeset patch # User dkiper@net-space.pl # Date 1266696392 -3600 # Node ID cf24f666046204df7dd3d614dfca66004a40cb6e # Parent 06911a6d4d3dc3f3b42ec57dcebb715ca15bbb6c Fix for fs-backend crash when xend was not started after system boot. Signed-off-by: Daniel Kiper <dkiper@net-space.pl> diff -r 06911a6d4d3d -r cf24f6660462 tools/fs-back/fs-backend.c --- a/tools/fs-back/fs-backend.c Wed Feb 17 12:16:23 2010 +0000 +++ b/tools/fs-back/fs-backend.c Sat Feb 20 21:06:32 2010 +0100 @@ -299,7 +299,8 @@ static void await_connections(void) LIST_INIT (&mount_requests_head); assert(xsh != NULL); - fd = xenbus_get_watch_fd(); + if ((fd = xenbus_get_watch_fd()) == -1) + err(1, "xenbus_get_watch_fd: could not setup watch"); /* Infinite watch loop */ do { FD_ZERO(&fds); diff -r 06911a6d4d3d -r cf24f6660462 tools/fs-back/fs-xenbus.c --- a/tools/fs-back/fs-xenbus.c Wed Feb 17 12:16:23 2010 +0000 +++ b/tools/fs-back/fs-xenbus.c Sat Feb 20 21:06:32 2010 +0100 @@ -105,11 +105,18 @@ int xenbus_get_watch_fd(void) int xenbus_get_watch_fd(void) { int res; +#if DEBUG + int errno_orig; +#endif assert(xsh != NULL); res = xs_watch(xsh, WATCH_NODE, "conn-watch"); if (!res) { +#if DEBUG + errno_orig = errno; FS_DEBUG("ERROR: xs_watch %s failed ret=%d errno=%d\n", WATCH_NODE, res, errno); + errno = errno_orig; +#endif return -1; } return xs_fileno(xsh); # HG changeset patch # User dkiper@net-space.pl # Date 1266696656 -3600 # Node ID eed20588492fb6c512cdd03f05a34035da0e2be0 # Parent 06911a6d4d3dc3f3b42ec57dcebb715ca15bbb6c Disable memory mapping warnings when stub domain is used. Signed-off-by: Daniel Kiper <dkiper@net-space.pl> diff -r 06911a6d4d3d -r eed20588492f xen/arch/x86/mm/shadow/common.c --- a/xen/arch/x86/mm/shadow/common.c Wed Feb 17 12:16:23 2010 +0000 +++ b/xen/arch/x86/mm/shadow/common.c Sat Feb 20 21:10:56 2010 +0100 @@ -2584,9 +2584,10 @@ int sh_remove_all_mappings(struct vcpu * { /* Don''t complain if we''re in HVM and there are some extra mappings: * The qemu helper process has an untyped mapping of this dom''s RAM - * and the HVM restore program takes another. */ + * and the HVM restore program takes another. Additionally, if stub domain + * is active then it also has an untyped mapping of original dom''s RAM. */ if ( !(shadow_mode_external(v->domain) - && (page->count_info & PGC_count_mask) <= 3 + && (page->count_info & PGC_count_mask) <= 4 && (page->u.inuse.type_info & PGT_count_mask) == 0) ) { SHADOW_ERROR("can''t find all mappings of mfn %lx: " # HG changeset patch # User dkiper@net-space.pl # Date 1266697931 -3600 # Node ID 4e0254d2adefc07b8ad97cd64a5be700a763ad0b # Parent b4041e7bbe1b62fab4e3416bbab085b07af57809 Fix for fs-backend crash when xend was not started after system boot. Signed-off-by: Daniel Kiper <dkiper@net-space.pl> diff -r b4041e7bbe1b -r 4e0254d2adef tools/fs-back/fs-backend.c --- a/tools/fs-back/fs-backend.c Wed Feb 17 12:11:13 2010 +0000 +++ b/tools/fs-back/fs-backend.c Sat Feb 20 21:32:11 2010 +0100 @@ -300,7 +300,8 @@ static void await_connections(void) LIST_INIT (&mount_requests_head); assert(xsh != NULL); - fd = xenbus_get_watch_fd(); + if ((fd = xenbus_get_watch_fd()) == -1) + err(1, "xenbus_get_watch_fd: could not setup watch"); /* Infinite watch loop */ do { FD_ZERO(&fds); diff -r b4041e7bbe1b -r 4e0254d2adef tools/fs-back/fs-xenbus.c --- a/tools/fs-back/fs-xenbus.c Wed Feb 17 12:11:13 2010 +0000 +++ b/tools/fs-back/fs-xenbus.c Sat Feb 20 21:32:11 2010 +0100 @@ -105,11 +105,18 @@ int xenbus_get_watch_fd(void) int xenbus_get_watch_fd(void) { int res; +#if DEBUG + int errno_orig; +#endif assert(xsh != NULL); res = xs_watch(xsh, WATCH_NODE, "conn-watch"); if (!res) { +#if DEBUG + errno_orig = errno; FS_DEBUG("ERROR: xs_watch %s failed ret=%d errno=%d\n", WATCH_NODE, res, errno); + errno = errno_orig; +#endif return -1; } return xs_fileno(xsh); # HG changeset patch # User dkiper@net-space.pl # Date 1266698140 -3600 # Node ID 0278998ea935b2bf4f503684ec5a352cf44660c8 # Parent b4041e7bbe1b62fab4e3416bbab085b07af57809 Disable memory mapping warnings when stub domain is used. Signed-off-by: Daniel Kiper <dkiper@net-space.pl> diff -r b4041e7bbe1b -r 0278998ea935 xen/arch/x86/mm/shadow/common.c --- a/xen/arch/x86/mm/shadow/common.c Wed Feb 17 12:11:13 2010 +0000 +++ b/xen/arch/x86/mm/shadow/common.c Sat Feb 20 21:35:40 2010 +0100 @@ -2607,9 +2607,10 @@ int sh_remove_all_mappings(struct vcpu * { /* Don''t complain if we''re in HVM and there are some extra mappings: * The qemu helper process has an untyped mapping of this dom''s RAM - * and the HVM restore program takes another. */ + * and the HVM restore program takes another. Additionally, if stub domain + * is active then it also has an untyped mapping of original dom''s RAM. */ if ( !(shadow_mode_external(v->domain) - && (page->count_info & PGC_count_mask) <= 3 + && (page->count_info & PGC_count_mask) <= 4 && (page->u.inuse.type_info & PGT_count_mask) == 0) ) { SHADOW_ERROR("can''t find all mappings of mfn %lx: " Is it possible to differentiate HVM with and without stub domain ??? Daniel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kouya Shimura
2010-Feb-23 04:27 UTC
Re: [Xen-devel] Some fixes for xen-3.4-testing/xen-unstable
Hi, I already fixed it in c/s 20720. It is not applied to xen-3.4 yet. (And the comment of c/s 20720 is reverted by Tim in c/s 20751.) Does the warning still be seen in xen-unstable? Thanks, Kouya Daniel Kiper writes:> # HG changeset patch > # User dkiper@net-space.pl > # Date 1266696656 -3600 > # Node ID eed20588492fb6c512cdd03f05a34035da0e2be0 > # Parent 06911a6d4d3dc3f3b42ec57dcebb715ca15bbb6c > Disable memory mapping warnings when stub domain is used. > > Signed-off-by: Daniel Kiper <dkiper@net-space.pl> > > diff -r 06911a6d4d3d -r eed20588492f xen/arch/x86/mm/shadow/common.c > --- a/xen/arch/x86/mm/shadow/common.c Wed Feb 17 12:16:23 2010 +0000 > +++ b/xen/arch/x86/mm/shadow/common.c Sat Feb 20 21:10:56 2010 +0100 > @@ -2584,9 +2584,10 @@ int sh_remove_all_mappings(struct vcpu * > { > /* Don''t complain if we''re in HVM and there are some extra mappings: > * The qemu helper process has an untyped mapping of this dom''s RAM > - * and the HVM restore program takes another. */ > + * and the HVM restore program takes another. Additionally, if stub domain > + * is active then it also has an untyped mapping of original dom''s RAM. */ > if ( !(shadow_mode_external(v->domain) > - && (page->count_info & PGC_count_mask) <= 3 > + && (page->count_info & PGC_count_mask) <= 4 > && (page->u.inuse.type_info & PGT_count_mask) == 0) ) > { > SHADOW_ERROR("can''t find all mappings of mfn %lx: "_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel Kiper
2010-Feb-23 14:49 UTC
Re: [Xen-devel] Some fixes for xen-3.4-testing/xen-unstable
Hi, On Tue, Feb 23, 2010 at 01:27:40PM +0900, Kouya Shimura wrote:> Hi, > > I already fixed it in c/s 20720. It is not applied to xen-3.4 yet. > (And the comment of c/s 20720 is reverted by Tim in c/s 20751.) > Does the warning still be seen in xen-unstable?Currently I could not check that in xen-unstable. I think that your idea is better. I am going to check it in xen-3.4-testing. I will prepare apriopriate patches for xen-3.4-testing/xen-unstable soon. Daniel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel Kiper
2010-Mar-01 11:53 UTC
Re: [Xen-devel] Some fixes for xen-3.4-testing/xen-unstable
Hi, On Tue, Feb 23, 2010 at 03:49:33PM +0100, Daniel Kiper wrote:> Hi, > > On Tue, Feb 23, 2010 at 01:27:40PM +0900, Kouya Shimura wrote: > > Hi, > > > > I already fixed it in c/s 20720. It is not applied to xen-3.4 yet. > > (And the comment of c/s 20720 is reverted by Tim in c/s 20751.) > > Does the warning still be seen in xen-unstable? > > Currently I could not check that in xen-unstable. I think that > your idea is better. I am going to check it in xen-3.4-testing. > I will prepare apriopriate patches for xen-3.4-testing/xen-unstable soon.Below are new versions of patches. Thank you for your help. # HG changeset patch # User dkiper@net-space.pl # Date 1267443789 -3600 # Node ID 822734301da78e53e3f205da23202506afb4c387 # Parent fa6ee088d915e53c075fb5c6e225f5200e1a0a99 New release of C/S 19894 "Disable memory mapping warnings when stub domain is used." This is backport from xen-unstable. Signed-off-by: Daniel Kiper <dkiper@net-space.pl> diff -r fa6ee088d915 -r 822734301da7 xen/arch/x86/mm.c --- a/xen/arch/x86/mm.c Fri Feb 26 17:10:48 2010 +0000 +++ b/xen/arch/x86/mm.c Mon Mar 01 12:43:09 2010 +0100 @@ -3932,6 +3932,9 @@ long arch_memory_op(int op, XEN_GUEST_HA domain_lock(d); + if ( page ) + put_page(page); + /* Remove previously mapped page if it was present. */ prev_mfn = gmfn_to_mfn(d, xatp.gpfn); if ( mfn_valid(prev_mfn) ) @@ -3953,9 +3956,6 @@ long arch_memory_op(int op, XEN_GUEST_HA rc = guest_physmap_add_page(d, xatp.gpfn, mfn, 0); domain_unlock(d); - - if ( page ) - put_page(page); rcu_unlock_domain(d); diff -r fa6ee088d915 -r 822734301da7 xen/arch/x86/mm/shadow/common.c --- a/xen/arch/x86/mm/shadow/common.c Fri Feb 26 17:10:48 2010 +0000 +++ b/xen/arch/x86/mm/shadow/common.c Mon Mar 01 12:43:09 2010 +0100 @@ -2584,11 +2584,9 @@ int sh_remove_all_mappings(struct vcpu * { /* Don''t complain if we''re in HVM and there are some extra mappings: * The qemu helper process has an untyped mapping of this dom''s RAM - * and the HVM restore program takes another. Additionally, if stub - * domain is active then it also has an untyped mapping of original - * domain''s RAM. */ + * and the HVM restore program takes another. */ if ( !(shadow_mode_external(v->domain) - && (page->count_info & PGC_count_mask) <= 4 + && (page->count_info & PGC_count_mask) <= 3 && (page->u.inuse.type_info & PGT_count_mask) == 0) ) { SHADOW_ERROR("can''t find all mappings of mfn %lx: " # HG changeset patch # User dkiper@net-space.pl # Date 1267443140 -3600 # Node ID 32d996d0c3f1acc6da8b0e9d742ca9e9a3bc2915 # Parent c4301c2c727dc996ada3656c9105caeab92d9bdb Revert C/S 20966 "Disable memory mapping warnings when stub domain is used." It was ealier resolved by C/S 20720 and C/S 20751. This fix was backported to xen-3.4-testing. Signed-off-by: Daniel Kiper <dkiper@net-space.pl> diff -r c4301c2c727d -r 32d996d0c3f1 xen/arch/x86/mm/shadow/common.c --- a/xen/arch/x86/mm/shadow/common.c Fri Feb 26 17:09:50 2010 +0000 +++ b/xen/arch/x86/mm/shadow/common.c Mon Mar 01 12:32:20 2010 +0100 @@ -2607,11 +2607,9 @@ int sh_remove_all_mappings(struct vcpu * { /* Don''t complain if we''re in HVM and there are some extra mappings: * The qemu helper process has an untyped mapping of this dom''s RAM - * and the HVM restore program takes another. Additionally, if stub - * domain is active then it also has an untyped mapping of original - * domain''s RAM. */ + * and the HVM restore program takes another. */ if ( !(shadow_mode_external(v->domain) - && (page->count_info & PGC_count_mask) <= 4 + && (page->count_info & PGC_count_mask) <= 3 && (page->u.inuse.type_info & PGT_count_mask) == 0) ) { SHADOW_ERROR("can''t find all mappings of mfn %lx: " Daniel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel