WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH pvops] Fix a bug that shutdown watcher is disable

To: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH pvops] Fix a bug that shutdown watcher is disabled on pvops
From: Frank Pan <frankpzh@xxxxxxxxx>
Date: Fri, 4 Mar 2011 17:29:12 +0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, Jeremy Fitzhardinge <Jeremy.Fitzhardinge@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Fri, 04 Mar 2011 01:30:12 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=74vzqejya/jyfYnGsHy74Xfotnw8DtGRYuuizH2FVcI=; b=pRDJ6SrUnmkMYHbN6SPeVL1SIu4H6fw/ljXc+A2297DTEJi3MAlFwm0ex4kfEor2cl DVba21VKSwqffLzlAmuIIclYfXUmzFFN7NzxH0dZgC6/rlzKRoz+3x4zYFLBDB+TLmOO SoKXX7BNBdN2y6+Fdw7OCUFK6QADZxnVr9q0s=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=Iaius/9t0JgL2oJ65Rk+PvRwSipty6jsMI3uTM4LnhldBGEhk/0JSb8+Ln1hS3qWjC AV28iBW1CMsOQUzVgD6BS1lkmiYx6K1D5duXNI3GQa+Hi/HKkcK43Jva6zDm1g3+/105 Eu2AWPrn1sb92XkKqf14FDMScCa36rRHbKVrg=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1299228090.6552.63.camel@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <AANLkTikUyYpVKG_LZHFLL-ziCfU-Oc3qM9uFCd7QH13Z@xxxxxxxxxxxxxx> <20110303182909.GA10812@xxxxxxxxxxxx> <AANLkTi=xQ6xQJmbUphGjcGEMwKmS6kuorL3oDPpSVPm7@xxxxxxxxxxxxxx> <1299228090.6552.63.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> Is the issue you are seeing perhaps due to this patch being missing from
> that tree?
>
> commit a947f0f8f7012a5e8689a9cff7209ec6964ec154
> Author: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Date:   Mon Oct 4 16:10:06 2010 +0100
>
>    xen: do not set xenstored_ready before xenbus_probe on hvm

> Stefano's "2.6.38-rc6-pvhvm" branch also contains this which looks
> related:
>
> commit 702d4eb9b3de4398ab99cf0a4e799e552c7ab756
> Author: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Date:   Thu Dec 2 17:54:50 2010 +0000
>
>    xen: no need to delay xen_setup_shutdown_event for hvm guests anymore

FP: Yes, both commits seem like a solution of the issue I met.

> If possible we should prefer to backport patches from newer kernels
> rather than diverge in the 2.6.32 branch.

FP: The former commit seems ok. The latter one is more like a cleanup.
Here is a patch can be applied on xen/next-2.6.32:

---
 linux-2.6-xen/drivers/xen/xenbus/xenbus_probe.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/linux-2.6-xen/drivers/xen/xenbus/xenbus_probe.c
b/linux-2.6-xen/drivers/xen/xenbus/xenbus_probe.c
index 3a83ba2..f368db9 100644
--- a/linux-2.6-xen/drivers/xen/xenbus/xenbus_probe.c
+++ b/linux-2.6-xen/drivers/xen/xenbus/xenbus_probe.c
@@ -646,7 +646,10 @@ int register_xenstore_notifier(struct notifier_block *nb)
 {
        int ret = 0;

-       blocking_notifier_chain_register(&xenstore_chain, nb);
+       if (xenstored_ready > 0)
+               ret = nb->notifier_call(nb, 0, NULL);
+       else
+               blocking_notifier_chain_register(&xenstore_chain, nb);

        return ret;
 }
@@ -660,7 +663,7 @@ EXPORT_SYMBOL_GPL(unregister_xenstore_notifier);

 void xenbus_probe(struct work_struct *unused)
 {
-       BUG_ON((xenstored_ready <= 0));
+       xenstored_ready = 1;

        /* Notify others that xenstore is up */
        blocking_notifier_call_chain(&xenstore_chain, 0, NULL);
@@ -722,7 +725,6 @@ static int __init xenbus_init(void)

                xen_store_interface = mfn_to_virt(xen_store_mfn);
        } else {
-               xenstored_ready = 1;
                if (xen_hvm_domain()) {
                        uint64_t v = 0;
                        err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v);
@@ -738,6 +740,7 @@ static int __init xenbus_init(void)
                        xen_store_evtchn = xen_start_info->store_evtchn;
                        xen_store_mfn = xen_start_info->store_mfn;
                        xen_store_interface = mfn_to_virt(xen_store_mfn);
+                       xenstored_ready = 1;
                }
        }

-- 
1.7.0.4


-- 
潘震皓, Frank Pan

Computer Science and Technology
Tsinghua University

Attachment: 0001-xen-do-not-set-xenstored_ready-before-xenbus_probe-o.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel