qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Sam Bobroff <sam.bobroff@au1.ibm.com>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 4/4] spapr: Add RTAS sysparm SPLPAR Characteristics
Date: Tue, 24 Jun 2014 14:03:57 +0200	[thread overview]
Message-ID: <53A9692D.50903@suse.de> (raw)
In-Reply-To: <53A8C4DE.6090408@au1.ibm.com>


On 24.06.14 02:22, Sam Bobroff wrote:
> Add support for the SPLPAR Characteristics parameter to the emulated
> RTAS call ibm,get-system-parameter.
>
> The support provides just enough information to allow "cat
> /proc/powerpc/lparcfg" to succeed without generating a kernel error
> message.
>
> Without this patch the above command will produce the following kernel
> message: arch/powerpc/platforms/pseries/lparcfg.c \
> parse_system_parameter_string Error calling get-system-parameter \
> (0xfffffffd)
>
> Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> ---
>   hw/ppc/spapr_rtas.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
>
> diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> index 8d94845..4270e7a 100644
> --- a/hw/ppc/spapr_rtas.c
> +++ b/hw/ppc/spapr_rtas.c
> @@ -224,6 +224,7 @@ static void rtas_stop_self(PowerPCCPU *cpu, sPAPREnvironment *spapr,
>       env->msr = 0;
>   }
>   
> +#define SPLPAR_CHARACTERISTICS      20
>   #define DIAGNOSTICS_RUN_MODE        42
>   #define UUID                        48
>   
> @@ -238,8 +239,20 @@ static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu,
>       target_ulong length = rtas_ld(args, 2);
>       target_ulong ret = RTAS_OUT_SUCCESS;
>       uint8_t zero = 0;
> +    uint8_t param_buf[64];
> +    int param_len;
>   
>       switch (parameter) {
> +    case SPLPAR_CHARACTERISTICS:
> +        param_len = snprintf((char *)param_buf, sizeof param_buf,
> +                             "MaxEntCap=%d,MaxPlatProcs=%d",
> +                             max_cpus, smp_cpus);

We have a nice g_strdup_printf() helper function that allocates memory 
for us automatically based on the printf size. Just use that one here ;).


Alex

      reply	other threads:[~2014-06-24 12:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1403569210.git.sam.bobroff@au1.ibm.com>
2014-06-24  0:22 ` [Qemu-devel] [PATCH 1/4] spapr: Add rtas_st_buffer utility function Sam Bobroff
2014-06-24 11:51   ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2014-06-24  0:22 ` [Qemu-devel] [PATCH 2/4] spapr: Add RTAS sysparm UUID Sam Bobroff
2014-06-24  0:22 ` [Qemu-devel] [PATCH 3/4] spapr: Fix RTAS sysparm DIAGNOSTICS_RUN_MODE Sam Bobroff
2014-06-24 11:58   ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2014-06-24 12:02     ` Alexander Graf
2014-06-24  0:22 ` [Qemu-devel] [PATCH 4/4] spapr: Add RTAS sysparm SPLPAR Characteristics Sam Bobroff
2014-06-24 12:03   ` Alexander Graf [this message]

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=53A9692D.50903@suse.de \
    --to=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sam.bobroff@au1.ibm.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 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).