All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 04/10] ppc/pnv: add a PIR handler to PnvChip
Date: Wed, 21 Sep 2016 09:05:19 +0200	[thread overview]
Message-ID: <022a7d23-5967-c4e5-53de-52170a5e5ad2@kaod.org> (raw)
In-Reply-To: <20160921012903.GO20488@umbus>

On 09/21/2016 03:29 AM, David Gibson wrote:
> On Thu, Sep 15, 2016 at 02:45:54PM +0200, Cédric Le Goater wrote:
>> P9 and P8 have some differences in the CPU PIR encoding.
> 
> The thread id isn't in the PIR at all?

The thread id from what I have seen is basically a +1. So this is why in
PnvCore there is : 

    for (i = 0; i < cc->nr_threads; i++) {
	...
    	cs->cpu_index = pc->pir + i;
    }

and 

    env->spr[SPR_PIR] = cs->cpu_index;

But, yes I should not use cpu_index that way. working on it.

Thanks,
C.


> 
>>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> ---
>>  hw/ppc/pnv.c         | 14 ++++++++++++++
>>  include/hw/ppc/pnv.h |  1 +
>>  2 files changed, 15 insertions(+)
>>
>> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
>> index ec7dd6ac5ea1..f4c125503249 100644
>> --- a/hw/ppc/pnv.c
>> +++ b/hw/ppc/pnv.c
>> @@ -238,6 +238,16 @@ static void ppc_powernv_init(MachineState *machine)
>>      g_free(chip_typename);
>>  }
>>  
>> +static uint32_t pnv_chip_core_pir_p8(PnvChip *chip, uint32_t core_id)
>> +{
>> +    return (chip->chip_id << 7) | (core_id << 3);
>> +}
>> +
>> +static uint32_t pnv_chip_core_pir_p9(PnvChip *chip, uint32_t core_id)
>> +{
>> +    return (chip->chip_id << 8) | (core_id << 2);
>> +}
>> +
>>  /* Allowed core identifiers on a POWER8 Processor Chip :
>>   *
>>   * <EX0 reserved>
>> @@ -273,6 +283,7 @@ static void pnv_chip_power8e_class_init(ObjectClass *klass, void *data)
>>      k->chip_type = PNV_CHIP_POWER8E;
>>      k->chip_cfam_id = 0x221ef04980000000ull;  /* P8 Murano DD2.1 */
>>      k->cores_mask = POWER8E_CORE_MASK;
>> +    k->core_pir = pnv_chip_core_pir_p8;
>>      dc->desc = "PowerNV Chip POWER8E";
>>  }
>>  
>> @@ -292,6 +303,7 @@ static void pnv_chip_power8_class_init(ObjectClass *klass, void *data)
>>      k->chip_type = PNV_CHIP_POWER8;
>>      k->chip_cfam_id = 0x220ea04980000000ull; /* P8 Venice DD2.0 */
>>      k->cores_mask = POWER8_CORE_MASK;
>> +    k->core_pir = pnv_chip_core_pir_p8;
>>      dc->desc = "PowerNV Chip POWER8";
>>  }
>>  
>> @@ -311,6 +323,7 @@ static void pnv_chip_power8nvl_class_init(ObjectClass *klass, void *data)
>>      k->chip_type = PNV_CHIP_POWER8NVL;
>>      k->chip_cfam_id = 0x120d304980000000ull;  /* P8 Naples DD1.0 */
>>      k->cores_mask = POWER8_CORE_MASK;
>> +    k->core_pir = pnv_chip_core_pir_p8;
>>      dc->desc = "PowerNV Chip POWER8NVL";
>>  }
>>  
>> @@ -330,6 +343,7 @@ static void pnv_chip_power9_class_init(ObjectClass *klass, void *data)
>>      k->chip_type = PNV_CHIP_POWER9;
>>      k->chip_cfam_id = 0x100d104980000000ull; /* P9 Nimbus DD1.0 */
>>      k->cores_mask = POWER9_CORE_MASK;
>> +    k->core_pir = pnv_chip_core_pir_p9;
>>      dc->desc = "PowerNV Chip POWER9";
>>  }
>>  
>> diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h
>> index cfc32586320f..2bd2294ac2a3 100644
>> --- a/include/hw/ppc/pnv.h
>> +++ b/include/hw/ppc/pnv.h
>> @@ -58,6 +58,7 @@ typedef struct PnvChipClass {
>>      uint64_t     cores_mask;
>>  
>>      void (*realize)(PnvChip *dev, Error **errp);
>> +    uint32_t (*core_pir)(PnvChip *chip, uint32_t core_id);
>>  } PnvChipClass;
>>  
>>  #define TYPE_PNV_CHIP_POWER8E TYPE_PNV_CHIP "-POWER8E"
> 

  parent reply	other threads:[~2016-09-21  7:05 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 12:45 [Qemu-devel] [PATCH v3 00/10] ppc/pnv: loading skiboot and booting the kernel Cédric Le Goater
2016-09-15 12:45 ` [Qemu-devel] [PATCH v3 01/10] ppc/pnv: add skeleton PowerNV platform Cédric Le Goater
2016-09-20  7:53   ` David Gibson
2016-09-21  7:32     ` Cédric Le Goater
2016-09-15 12:45 ` [Qemu-devel] [PATCH v3 02/10] ppc/pnv: add a PnvChip object Cédric Le Goater
2016-09-20 13:50   ` David Gibson
2016-09-21  7:44     ` Cédric Le Goater
2016-09-15 12:45 ` [Qemu-devel] [PATCH v3 03/10] ppc/pnv: add a core mask to PnvChip Cédric Le Goater
2016-09-20 13:57   ` David Gibson
2016-09-21  7:57     ` Cédric Le Goater
2016-09-15 12:45 ` [Qemu-devel] [PATCH v3 04/10] ppc/pnv: add a PIR handler " Cédric Le Goater
2016-09-21  1:29   ` David Gibson
2016-09-21  1:52     ` Benjamin Herrenschmidt
2016-09-21  7:05     ` Cédric Le Goater [this message]
2016-09-15 12:45 ` [Qemu-devel] [PATCH v3 05/10] ppc/pnv: add a PnvCore object Cédric Le Goater
2016-09-21  1:51   ` David Gibson
2016-09-21  2:05     ` Benjamin Herrenschmidt
2016-09-21  2:15       ` David Gibson
2016-09-21  7:15       ` Cédric Le Goater
2016-09-21  7:09     ` Cédric Le Goater
2016-09-21 14:24     ` Cédric Le Goater
2016-09-15 12:45 ` [Qemu-devel] [PATCH v3 06/10] monitor: fix crash for platforms without a CPU 0 Cédric Le Goater
2016-09-21  5:30   ` David Gibson
2016-09-21  8:06     ` Cédric Le Goater
2016-09-15 12:45 ` [Qemu-devel] [PATCH v3 07/10] ppc/pnv: add XSCOM infrastructure Cédric Le Goater
2016-09-15 22:11   ` Benjamin Herrenschmidt
2016-09-21  5:56     ` David Gibson
2016-09-21  7:44       ` Benjamin Herrenschmidt
2016-09-21  6:08   ` David Gibson
2016-09-22  8:25     ` Cédric Le Goater
2016-09-23  2:46       ` David Gibson
2016-09-26 16:11         ` Cédric Le Goater
2016-09-27  2:35           ` David Gibson
2016-09-27  5:54             ` Cédric Le Goater
2016-09-27  6:10               ` Benjamin Herrenschmidt
2016-09-27  7:16                 ` Cédric Le Goater
2016-09-28  1:40               ` David Gibson
2016-09-27  9:10     ` Cédric Le Goater
2016-09-27  9:30       ` Cédric Le Goater
2016-09-27 10:18         ` Benjamin Herrenschmidt
2016-09-27 10:17       ` Benjamin Herrenschmidt
2016-09-15 12:45 ` [Qemu-devel] [PATCH v3 08/10] ppc/pnv: add a XScomDevice to PnvCore Cédric Le Goater
2016-09-21  6:12   ` David Gibson
2016-09-22  8:33     ` Cédric Le Goater
2016-09-23  2:50       ` David Gibson
2016-09-15 12:45 ` [Qemu-devel] [PATCH v3 09/10] ppc/pnv: add a LPC controller Cédric Le Goater
2016-09-15 22:13   ` Benjamin Herrenschmidt
2016-09-16 17:35     ` Cédric Le Goater
2016-09-21  6:23   ` David Gibson
2016-09-15 12:46 ` [Qemu-devel] [PATCH v3 10/10] ppc/pnv: add a ISA bus Cédric Le Goater
2016-09-21  6:30   ` David Gibson
2016-09-22  8:44     ` Cédric Le Goater
2016-09-23  2:54       ` 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=022a7d23-5967-c4e5-53de-52170a5e5ad2@kaod.org \
    --to=clg@kaod.org \
    --cc=benh@kernel.crashing.org \
    --cc=david@gibson.dropbear.id.au \
    --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.