All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: "Andreas Färber" <afaerber@suse.de>
Cc: sPAPR <qemu-ppc@nongnu.org>,
	qemu-devel@nongnu.org, Prerna Saxena <prerna@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 4/4] spapr: Suppress underscores in device tree CPU node
Date: Thu, 29 Aug 2013 14:39:32 +1000	[thread overview]
Message-ID: <521ED084.5050903@ozlabs.ru> (raw)
In-Reply-To: <1376606111-3518-5-git-send-email-afaerber@suse.de>

On 08/16/2013 08:35 AM, Andreas Färber wrote:
> PAPR requires that PowerPC,<name> shall not contain underscores, so skip
> any underscores in the type name.

Again, as this is for sPAPR only and spapr-supported CPUs have fw_name, why
to bother with "_" at all? Where can it possibly come from?

Sorry if I am asking something really stupid, it is just that the solution
for the pretty trivial problem looks bigger that I'd expect :)


> Reported-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  hw/ppc/spapr.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 0e9be32..137e060 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -264,7 +264,7 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,
>      char qemu_hypertas_prop[] = "hcall-memop1";
>      uint32_t refpoints[] = {cpu_to_be32(0x4), cpu_to_be32(0x4)};
>      uint32_t interrupt_server_ranges_prop[] = {0, cpu_to_be32(smp_cpus)};
> -    int i, smt = kvmppc_smt_threads();
> +    int i, j, smt = kvmppc_smt_threads();
>      unsigned char vec5[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x80};
>  
>      fdt = g_malloc0(FDT_MAX_SIZE);
> @@ -350,6 +350,17 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,
>              }
>              nodename = g_strndup(typename,
>                                   strlen(typename) - strlen("-" TYPE_POWERPC_CPU));
> +            for (i = j = 0; j < strlen(nodename); i++, j++) {
> +                if (nodename[j] == '_') {
> +                    j++;
> +                }
> +                if (j > i) {
> +                    nodename[i] = nodename[j];
> +                }
> +            }
> +            if (j > i) {
> +                nodename[i] = '\0';
> +            }
>              dc->fw_name = g_strdup_printf("PowerPC,%s", nodename);
>              g_free(nodename);
>          }
> 


-- 
Alexey

  reply	other threads:[~2013-08-29  4:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15 22:35 [Qemu-devel] [PATCH v2 0/4] target-ppc: Tidy sPAPR device tree CPU nodes Andreas Färber
2013-08-15 22:35 ` [Qemu-devel] [PATCH v2 1/4] target-ppc: Fill in OpenFirmware names for some PowerPCCPU families Andreas Färber
2013-09-10  4:15   ` Alexey Kardashevskiy
2013-09-16 14:16     ` Alexey Kardashevskiy
2013-09-25  9:01       ` Alexey Kardashevskiy
2013-09-30 17:55         ` Alexander Graf
2013-10-07 13:59           ` Alexey Kardashevskiy
2013-08-15 22:35 ` [Qemu-devel] [PATCH v2 2/4] spapr: Use DeviceClass::fw_name for device tree CPU node Andreas Färber
2013-08-29  4:29   ` Alexey Kardashevskiy
2013-08-29  5:30     ` Andreas Färber
2013-08-30  6:05       ` Alexey Kardashevskiy
2013-08-30 13:54         ` Alexander Graf
2013-08-30 14:00           ` Andreas Färber
2013-08-30 14:15             ` Alexander Graf
2013-08-30 13:21   ` Alexander Graf
2013-08-30 13:26     ` Andreas Färber
2013-08-30 13:52       ` Alexander Graf
2013-08-30 13:53       ` Alexey Kardashevskiy
2013-08-30 13:58         ` Andreas Färber
2013-08-30 14:03           ` Alexander Graf
2013-08-15 22:35 ` [Qemu-devel] [PATCH v2 3/4] spapr: Improve device tree CPU node for -cpu host with unknown OF name Andreas Färber
2013-08-15 22:40   ` Andreas Färber
2013-08-29  4:33   ` [Qemu-devel] [Qemu-ppc] " Alexey Kardashevskiy
2013-08-29  5:30     ` Andreas Färber
2013-08-15 22:35 ` [Qemu-devel] [PATCH v2 4/4] spapr: Suppress underscores in device tree CPU node Andreas Färber
2013-08-29  4:39   ` Alexey Kardashevskiy [this message]
2013-08-29  5:33     ` [Qemu-devel] [Qemu-ppc] " Andreas Färber

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=521ED084.5050903@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=afaerber@suse.de \
    --cc=prerna@linux.vnet.ibm.com \
    --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 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.