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

[Xen-devel] Re: [PATCH 6/7] xen: Enable PV clocksource for HVM

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 6/7] xen: Enable PV clocksource for HVM
From: Sheng Yang <sheng@xxxxxxxxxxxxxxx>
Date: Mon, 8 Mar 2010 15:05:21 +0800
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, Ian Pratt <Ian.Pratt@xxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxx>
Delivery-date: Sun, 07 Mar 2010 23:04:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1267781507.11737.36769.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>
Organization: Intel Opensource Technology Center
References: <1267695416-14988-1-git-send-email-sheng@xxxxxxxxxxxxxxx> <201003051054.50535.sheng@xxxxxxxxxxxxxxx> <1267781507.11737.36769.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.12.2 (Linux/2.6.31-19-generic; KDE/4.3.2; x86_64; ; )
On Friday 05 March 2010 17:31:47 Ian Campbell wrote:
> On Fri, 2010-03-05 at 02:54 +0000, Sheng Yang wrote:
> > On Friday 05 March 2010 01:40:51 Jeremy Fitzhardinge wrote:
> > > On 03/04/2010 01:36 AM, Sheng Yang wrote:
> > > > And enable it by default in PV extended HVM guest.
> > > >
> > > > Signed-off-by: Sheng Yang<sheng@xxxxxxxxxxxxxxx>
> > > > ---
> > > >   arch/x86/xen/hvmpv.c |   20 ++++++++++++++++++++
> > > >   arch/x86/xen/time.c  |    4 +++-
> > > >   2 files changed, 23 insertions(+), 1 deletions(-)
> > > >
> > > > diff --git a/arch/x86/xen/hvmpv.c b/arch/x86/xen/hvmpv.c
> > > > index 7a741ed..284e021 100644
> > > > --- a/arch/x86/xen/hvmpv.c
> > > > +++ b/arch/x86/xen/hvmpv.c
> > > > @@ -43,6 +43,7 @@ static void __init xen_hvm_pv_banner(void)
> > > >                 pv_info.name);
> > > >         printk(KERN_INFO "Xen version: %d.%d%s\n",
> > > >                 version>>  16, version&  0xffff, extra.extraversion);
> > > > +       printk(KERN_INFO "PV feature: PV clocksource enabled\n");
> > > >   }
> > > >
> > > >   static int __init xen_para_available(void)
> > > > @@ -117,6 +118,22 @@ static void __init init_shared_info(void)
> > > >         per_cpu(xen_vcpu, 0) =&HYPERVISOR_shared_info->vcpu_info[0];
> > > >   }
> > > >
> > > > +extern struct clocksource xen_clocksource;
> > >
> > > No externs in .c files.  But aside from that, I'd prefer you export a
> > > function from xen/time.c to do the clocksource registration and call it
> > > from both places (even if its a one-liner).
> >
> > OK
> >
> > > > +
> > > > +static void __init init_pv_clocksource(void)
> > > > +{
> > > > +       if (enable_hvm_pv(HVM_PV_CLOCK))
> > > > +               BUG();
> > >
> > > BUG is a bit severe.  Will it really never, ever fail?  And if it does,
> > > the consequence is hardly serious; we just fall back to emulated
> > > devices.
> >
> > It shouldn't fail. If we got a hypervisor without these extension, this
> > one won't be called. Because the feature should be detected by CPUID, and
> > the hypervisor would mask the unsupported features. So the guest won't
> > see that bit if it's not supported, and this one wouldn't be involved.
> 
> It is still possible that a hypervisor might want to turn on the general
> extensions but not the PV clock extensions, and we can't predict what
> reasons we might have for doing that in the future. A BUG() is an
> awfully big hammer for a failure like this and destroys any hope of
> making changes in a forward/backward compatible manner in the future.
> Surely it is possible to simply continue with non-PV clock?

Evtchn can't work with it. 

If the potentially disable pv clock is your concern, I think the better way is 
to make PV clock as a separate feature, and let PV evtchn depends on it. I've 
updated the patches to reflect this change.

-- 
regards
Yang, Sheng

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