qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Alexander Graf <agraf@suse.de>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH] target-ppc: Add compatibility between P7/P7+ and P8E/P8
Date: Sat, 28 Jun 2014 21:39:32 +1000	[thread overview]
Message-ID: <53AEA974.8040900@ozlabs.ru> (raw)
In-Reply-To: <53AE0CEB.2000300@ozlabs.ru>

On 06/28/2014 10:31 AM, Alexey Kardashevskiy wrote:
> On 06/28/2014 10:00 AM, Alexey Kardashevskiy wrote:
>> On 06/28/2014 02:14 AM, Alexander Graf wrote:
>>>
>>> On 27.06.14 17:54, Alexey Kardashevskiy wrote:
>>>> At the moment POWER7+ and POWER7 CPUs are different incompatible
>>>> families in QOM. The same is valid for POWER8E and POWER8 CPUs.
>>>> However, these couples are architecturally equal and there is no
>>>> good reason, for example, not to let run -cpu POWER7 on the real
>>>> POWER7+ CPU machine.
>>>>
>>>> This introduces one more level in hierarchy of POWERPC CPU classes.
>>>> New macro POWERPC_FAMILY_2 takes a family class and the parent family
>>>> class and, for example, for POWER7+ the hierarchy looks like:
>>>> TYPE_CPU
>>>> TYPE_POWERPC_CPU
>>>> POWER7-powerpc64-cpu
>>>> POWER7+-powerpc64-cpu
>>>>
>>>> This registers new dynamic POWERPC CPU classes for all classes between
>>>> the lowest one which matches the real PVR and TYPE_POWERPC_CPU.
>>>> So for POWER7, it is still going to be just a single dynamic "POWER7"
>>>> class but for POWER7+ inherited from POWER7 there are going to be
>>>> 2 dynamic classes  - "POWER7+" and "POWER7" so management software
>>>> can use both to ensure successful migration.
>>>>
>>>> Since POWER7+ inherits from POWER7 and POWER8E from POWER8, this
>>>> removes recurring pieces of code. CPUs with shorter names were chosen
>>>> as parents.
>>>>
>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>> ---
>>>>
>>>> This is rather RFC patch and there is no hurry in reviewing this,
>>>> and this is not 2.1 material and everyhting, just tried to solve
>>>> a QOM puzzle here :)
>>>
>>> I'm not sure - I'd rather make sure we have this sorted out for 2.1 so we
>>> can keep the -cpu list stable.
>>>
>>> Could we make the PVR matching a function callback rather than value+mask?
>>> Then we could have p7 and p8 just match on 2 different PVR ranges.
>>
>> POWER8:
>>>>> bin(0x4d)
>> '0b1001101'
>>>>> bin(0x4b)
>> '0b1001011'
>>>>> bin(0x4c)
>> '0b1001100'
>>
>> 4D == POWER8, 4B == POWER8E, 4C - does not exist and when it will, I do not
>> know what it is going to be.
>>
>> POWER7:
>>>>> bin(0x3f)
>> '0b111111'
>>>>> bin(0x4a)
>> '0b1001010'
>>>>>
>>
>>
>> What should mask look like for P7 and P8?
> 
> Re-read your email :) Callback you say... And we will loose POWER7+ and
> POWER8E. May it is all right as we drop bottom 16bits already...


Ufff. Ok, I tried adding a callback:
int (*pvr_match)(uint32_t pvr);

Ok. Then POWER7 has fw_name = "PowerPC,POWER7" and POWER7+ has fw_name =
"PowerPC,POWER7+". Hosts use the same names, with and without "+", QEMU
uses them to make up CPU nodes in /proc/device-tree/cpus/. If it is going
to be one CPU class, won't we need yet another callback for these fw_name's?

And this fw_path is just a field (or a typename is used if fw_path==NULL)
and since it is a DeviceState's property and used directly, I cannot
intercept this so I need to hack the original class somehow.

Make it
int (*pvr_match_and_init_fw_path_if_matched)(uint32_t pvr);
?


-- 
Alexey

      reply	other threads:[~2014-06-28 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 15:54 [Qemu-devel] [RFC PATCH] target-ppc: Add compatibility between P7/P7+ and P8E/P8 Alexey Kardashevskiy
2014-06-27 16:14 ` Alexander Graf
2014-06-28  0:00   ` Alexey Kardashevskiy
2014-06-28  0:31     ` Alexey Kardashevskiy
2014-06-28 11:39       ` Alexey Kardashevskiy [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=53AEA974.8040900@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=agraf@suse.de \
    --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).