qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alexander Graf <agraf@suse.de>
Cc: "Anthony Liguori" <aliguori@us.ibm.com>,
	"Alexey Kardashevskiy" <aik@ozlabs.ru>,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	"Paul Mackerras" <paulus@samba.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH v3 1/8] target-ppc: Add helper for KVM_PPC_RTAS_DEFINE_TOKEN
Date: Tue, 27 Aug 2013 10:43:21 +1000	[thread overview]
Message-ID: <1377564201.3819.87.camel@pasglop> (raw)
In-Reply-To: <5B9725EC-8FC8-469C-8758-08EED7D4206D@suse.de>

On Mon, 2013-08-26 at 15:11 +0200, Alexander Graf wrote:
> On 19.08.2013, at 07:55, Alexey Kardashevskiy wrote:
> 
> > From: David Gibson <david@gibson.dropbear.id.au>
> > 
> > Recent PowerKVM allows the kernel to intercept some RTAS calls from
> the
> > guest directly.  This is used to implement the more efficient
> in-kernel
> > XICS for example.  qemu is still responsible for assigning the RTAS
> token
> > numbers however, and needs to tell the kernel which RTAS function
> name is
> > assigned to a given token value.  This patch adds a convenience
> wrapper for
> > the KVM_PPC_RTAS_DEFINE_TOKEN ioctl() which is used for this
> purpose.
> > 
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > ---
> > target-ppc/kvm.c     | 14 ++++++++++++++
> > target-ppc/kvm_ppc.h |  7 +++++++
> > 2 files changed, 21 insertions(+)
> > 
> > diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
> > index eea8c09..ab46aaa 100644
> > --- a/target-ppc/kvm.c
> > +++ b/target-ppc/kvm.c
> > @@ -1792,6 +1792,20 @@ static int
> kvm_ppc_register_host_cpu_type(void)
> >     return 0;
> > }
> > 
> > +int kvmppc_define_rtas_token(uint32_t token, const char *function)
> 
> The naming here is slightly confusing. What the ioctl does is define
> an rtas token that gets handled in-kernel. The name of the function
> should reflect this. How about something like
> kvmppc_define_rtas_in_kernel()?

Am I dreaming ? Those patches were written about a year ago and you guys
are still nitpicking on names ? They should have been merged a LONG time
ago ...

I'm seriously wondering how people get anything done with qemu KVM when
it takes about a year of bike shed painting to get the most basic
functionality merged.

Alex, you know, a maintainer's job is not to bounce a patch over and
over again until it looks EXACTLY what you would have written in the
first place. If that was the case you may as well write it yourself.

In this specific case, it's even more annoying because that comment
could have been done ages ago, and because the name you propose is even
more horrible than what was there... If you are really keen about that
pick up at least something that doesn't suck such as

	kvmppc_define_rtas_kernel_token()

What you propose is even more confusing as to what the function is for.

At the end of the day, I despair though. Really.

Ben.

> 
> Alex
> 
> > +{
> > +    struct kvm_rtas_token_args args = {
> > +        .token = token,
> > +    };
> > +
> > +    if (!kvm_check_extension(kvm_state, KVM_CAP_PPC_RTAS)) {
> > +        return -ENOENT;
> > +    }
> > +
> > +    strncpy(args.name, function, sizeof(args.name));
> > +
> > +    return kvm_vm_ioctl(kvm_state, KVM_PPC_RTAS_DEFINE_TOKEN,
> &args);
> > +}
> > 
> > int kvmppc_get_htab_fd(bool write)
> > {
> > diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h
> > index 4ae7bf2..12564ef 100644
> > --- a/target-ppc/kvm_ppc.h
> > +++ b/target-ppc/kvm_ppc.h
> > @@ -38,6 +38,7 @@ uint64_t kvmppc_rma_size(uint64_t current_size,
> unsigned int hash_shift);
> > #endif /* !CONFIG_USER_ONLY */
> > int kvmppc_fixup_cpu(PowerPCCPU *cpu);
> > bool kvmppc_has_cap_epr(void);
> > +int kvmppc_define_rtas_token(uint32_t token, const char *function);
> > int kvmppc_get_htab_fd(bool write);
> > int kvmppc_save_htab(QEMUFile *f, int fd, size_t bufsize, int64_t
> max_ns);
> > int kvmppc_load_htab_chunk(QEMUFile *f, int fd, uint32_t index,
> > @@ -164,6 +165,12 @@ static inline bool kvmppc_has_cap_epr(void)
> >     return false;
> > }
> > 
> > +static inline int kvmppc_define_rtas_token(uint32_t token,
> > +                                           const char *function)
> > +{
> > +    return -1;
> > +}
> > +
> > static inline int kvmppc_get_htab_fd(bool write)
> > {
> >     return -1;
> > -- 
> > 1.8.3.2
> > 

  reply	other threads:[~2013-08-27  0:43 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19  5:55 [Qemu-devel] [PATCH v3 0/8] xics: reworks and in-kernel support Alexey Kardashevskiy
2013-08-19  5:55 ` [Qemu-devel] [PATCH v3 1/8] target-ppc: Add helper for KVM_PPC_RTAS_DEFINE_TOKEN Alexey Kardashevskiy
2013-08-26 13:11   ` Alexander Graf
2013-08-27  0:43     ` Benjamin Herrenschmidt [this message]
2013-08-27  1:48       ` Andreas Färber
2013-08-27  4:10         ` Benjamin Herrenschmidt
2013-08-27  8:36           ` Alexander Graf
2013-08-29  8:18             ` Alexey Kardashevskiy
2013-08-30 14:34               ` Alexander Graf
2013-08-30 22:19                 ` Benjamin Herrenschmidt
2013-08-30 23:04                   ` Alexander Graf
2013-08-30 20:05       ` Laszlo Ersek
2013-08-19  5:55 ` [Qemu-devel] [PATCH v3 2/8] xics: add pre_save/post_load/cpu_setup dispatchers Alexey Kardashevskiy
2013-08-19 13:54   ` Andreas Färber
2013-08-23  3:39     ` Alexey Kardashevskiy
2013-08-23 11:38       ` Andreas Färber
2013-08-29  8:25         ` Alexey Kardashevskiy
2013-08-29  8:32           ` Andreas Färber
2013-08-26 13:22   ` Alexander Graf
2013-08-19  5:55 ` [Qemu-devel] [PATCH v3 3/8] xics: move registration of global state to realize() Alexey Kardashevskiy
2013-08-26 13:27   ` Alexander Graf
2013-08-19  5:55 ` [Qemu-devel] [PATCH v3 4/8] xics: minor changes and cleanups Alexey Kardashevskiy
2013-08-26 13:36   ` Alexander Graf
2013-08-26 14:20     ` Andreas Färber
2013-08-26 14:31       ` Alexander Graf
2013-08-19  5:55 ` [Qemu-devel] [PATCH v3 5/8] xics: split to xics and xics-common Alexey Kardashevskiy
2013-08-26 13:40   ` Alexander Graf
2013-08-19  5:55 ` [Qemu-devel] [PATCH v3 6/8] xics-kvm: Support for in-kernel XICS interrupt controller Alexey Kardashevskiy
2013-08-27  9:28   ` Alexander Graf
2013-08-29  8:37   ` Andreas Färber
2013-08-29  8:53     ` Alexey Kardashevskiy
2013-08-30  0:10   ` Anthony Liguori
2013-08-23 11:56 ` [Qemu-devel] [PATCH v3 0/8] xics: reworks and in-kernel support Andreas Färber
2013-08-23 12:05   ` Alexey Kardashevskiy
2013-08-23 12:02 ` [Qemu-devel] [PATCH v3] xics: Add H_IPOLL implementation Alexey Kardashevskiy
2013-08-27  9:34   ` Alexander Graf
2013-08-23 12:03 ` [Qemu-devel] [PATCH v3] xics: Implement H_XIRR_X Alexey Kardashevskiy
2013-08-27  9:35   ` Alexander Graf

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=1377564201.3819.87.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=aliguori@us.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=paulus@samba.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).