qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Alexander Graf <agraf@suse.de>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/3] ppc: Generalize the kvmppc_get_clockfreq() function
Date: Tue, 11 Oct 2011 15:29:25 +1100	[thread overview]
Message-ID: <20111011042925.GB4849@truffala.fritz.box> (raw)
In-Reply-To: <081CD065-4C93-4747-8399-E102C89CA417@suse.de>

On Fri, Sep 30, 2011 at 08:06:59PM +0200, Alexander Graf wrote:
> 
> Am 30.09.2011 um 09:50 schrieb David Gibson <david@gibson.dropbear.id.au>:
> 
> > Currently the kvmppc_get_clockfreq() function reads the host's clock
> > frequency from /proc/device-tree, which is useful to past to the guest
> > in KVM setups.  However, there are some other host properties
> > advertised in the device tree which can also be relevant to the
> > guests.
> > 
> > This patch, therefore, replaces kvmppc_get_clockfreq() which can
> > retrieve any named, single integer property from the host device
> > tree's CPU node.
> > 
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > ---
> > hw/ppc440_bamboo.c     |    2 +-
> > hw/ppce500_mpc8544ds.c |    2 +-
> > hw/spapr.c             |   13 ++++++++++++-
> > target-ppc/kvm.c       |   30 +++++++++++++++++++-----------
> > target-ppc/kvm_ppc.h   |    4 ++--
> > 5 files changed, 35 insertions(+), 16 deletions(-)
> > 
> > diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c
> > index 1523764..df85da0 100644
> > --- a/hw/ppc440_bamboo.c
> > +++ b/hw/ppc440_bamboo.c
> > @@ -83,7 +83,7 @@ static int bamboo_load_device_tree(target_phys_addr_t addr,
> >      * the correct frequencies. */
> >     if (kvm_enabled()) {
> >         tb_freq = kvmppc_get_tbfreq();
> > -        clock_freq = kvmppc_get_clockfreq();
> > +        clock_freq = kvmppc_read_int_cpu_dt("clock-frequency");
> 
> Hrm. I was actually trying to abstract host dt handling away
> here. The idea was to use the helper inside of kvm.c, but still
> expose specific functions for specific properties.

Ok, fair enough.

> >     }
> > 
> >     qemu_devtree_setprop_cell(fdt, "/cpus/cpu@0", "clock-frequency",
> > diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c
> > index f00367e..eb37c3d 100644
> > --- a/hw/ppce500_mpc8544ds.c
> > +++ b/hw/ppce500_mpc8544ds.c
> > @@ -112,7 +112,7 @@ static int mpc8544_load_device_tree(CPUState *env,
> > 
> >     if (kvm_enabled()) {
> >         /* Read out host's frequencies */
> > -        clock_freq = kvmppc_get_clockfreq();
> > +        clock_freq = kvmppc_read_int_cpu_dt("clock-frequency");
> >         tb_freq = kvmppc_get_tbfreq();
> > 
> >         /* indicate KVM hypercall interface */
> > diff --git a/hw/spapr.c b/hw/spapr.c
> > index 9a3a1ea..ea5690e 100644
> > --- a/hw/spapr.c
> > +++ b/hw/spapr.c
> > @@ -185,7 +185,8 @@ static void *spapr_create_fdt_skel(const char *cpu_model,
> >         uint32_t segs[] = {cpu_to_be32(28), cpu_to_be32(40),
> >                            0xffffffff, 0xffffffff};
> >         uint32_t tbfreq = kvm_enabled() ? kvmppc_get_tbfreq() : TIMEBASE_FREQ;
> > -        uint32_t cpufreq = kvm_enabled() ? kvmppc_get_clockfreq() : 1000000000;
> > +        uint32_t cpufreq = kvm_enabled() ?
> > +            kvmppc_read_int_cpu_dt("clock-frequency") : 1000000000;
> > 
> >         if ((index % smt) != 0) {
> >             continue;
> > @@ -233,6 +234,16 @@ static void *spapr_create_fdt_skel(const char *cpu_model,
> >                                segs, sizeof(segs))));
> >         }
> > 
> > +        /* Advertise VMX/VSX (vector extensions) if available */
> > +        if (vmx) {
> > +            _FDT((fdt_property_cell(fdt, "ibm,vmx", vmx)));
> > +        }
> > +
> > +        /* Advertise DFP (Decimal Floating Point) if available */
> > +        if (dfp) {
> > +            _FDT((fdt_property_cell(fdt, "ibm,dfp", dfp)));
> > +        }
> > +
> 
> Please make sure that your patch set is bisectable :)

Oops, bad split - that hunk was supposed to be in the other patch of
the series.  I'll resend with both the above fixed momentarily.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  reply	other threads:[~2011-10-11  4:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-30  7:50 [Qemu-devel] [0/3] pseries: RFC: Advertise host CPU capabilties to guest David Gibson
2011-09-30  7:50 ` [Qemu-devel] [PATCH 1/3] ppc: Generalize the kvmppc_get_clockfreq() function David Gibson
2011-09-30 18:06   ` Alexander Graf
2011-10-11  4:29     ` David Gibson [this message]
2011-09-30  7:50 ` [Qemu-devel] [PATCH 2/3] pseries: Add device tree properties for VMX/VSX and DFP under kvm David Gibson
2011-09-30  7:50 ` [Qemu-devel] [PATCH 3/3] pseries: Correctly create ibm, segment-page-sizes property David Gibson
2011-10-07  7:20   ` Alexander Graf
2011-09-30  8:20 ` [Qemu-devel] [0/3] pseries: RFC: Advertise host CPU capabilties to guest Alexander Graf
2011-09-30  9:00   ` David Gibson

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=20111011042925.GB4849@truffala.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).