All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sheng Yang <sheng@linux.intel.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	Keir Fraser <Keir.Fraser@eu.citrix.com>,
	Ingo Molnar <mingo@elte.hu>, Ian Pratt <Ian.Pratt@eu.citrix.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"xen-devel" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 6/7] xen: Enable PV clocksource for HVM
Date: Mon, 8 Mar 2010 15:05:21 +0800	[thread overview]
Message-ID: <201003081505.21833.sheng@linux.intel.com> (raw)
In-Reply-To: <1267781507.11737.36769.camel@zakaz.uk.xensource.com>

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@linux.intel.com>
> > > > ---
> > > >   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

  reply	other threads:[~2010-03-08  7:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04  9:36 [PATCH 0/7][v5] PV extension of HVM (Hybrid) for Xen Sheng Yang
2010-03-04  9:36 ` [PATCH 1/7] xen: add support for hvm_op Sheng Yang
2010-03-04  9:36 ` [PATCH 2/7] xen: Import cpuid.h from Xen Sheng Yang
2010-03-04  9:36 ` [PATCH 3/7] xen: Make pv drivers only work with xen_pv_domain() Sheng Yang
2010-03-04  9:36 ` [PATCH 4/7] xen/hvm: Xen PV extension of HVM initialization Sheng Yang
2010-03-04 18:24   ` Jeremy Fitzhardinge
2010-03-04  9:36 ` [PATCH 5/7] x86/xen: The entrance for PV extension of HVM Sheng Yang
2010-03-04  9:36 ` [PATCH 6/7] xen: Enable PV clocksource for HVM Sheng Yang
2010-03-04 17:40   ` Jeremy Fitzhardinge
2010-03-04 20:25     ` Ian Campbell
2010-03-05  2:54     ` Sheng Yang
2010-03-05  9:31       ` Ian Campbell
2010-03-08  7:05         ` Sheng Yang [this message]
2010-03-04  9:36 ` [PATCH 7/7] xen: Make event channel work with PV extension of HVM Sheng Yang
2010-03-04 18:24   ` Jeremy Fitzhardinge
2010-03-04 19:22     ` [Xen-devel] " Stefano Stabellini
2010-03-05  2:45     ` Sheng Yang
  -- strict thread matches above, loose matches on Subject: below --
2010-03-05  6:07 [PATCH 0/7][v6] PV extension of HVM (Hybrid) for Xen Sheng Yang
2010-03-05  6:07 ` [PATCH 6/7] xen: Enable PV clocksource for HVM Sheng Yang
2010-03-08  7:18 [PATCH 0/7][v7] PV extension of HVM (Hybrid) for Xen Sheng Yang
2010-03-08  7:18 ` [PATCH 6/7] xen: Enable PV clocksource for HVM Sheng Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201003081505.21833.sheng@linux.intel.com \
    --to=sheng@linux.intel.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Pratt@eu.citrix.com \
    --cc=Keir.Fraser@eu.citrix.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.