All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>,
	qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.11 6/6] ppc: drop caching ObjectClass from PowerPCCPUAlias
Date: Tue, 29 Aug 2017 17:30:46 +1000	[thread overview]
Message-ID: <20170829073046.GM2578@umbus.fritz.box> (raw)
In-Reply-To: <20170825094948.5a7315fd@nial.brq.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2834 bytes --]

On Fri, Aug 25, 2017 at 09:49:48AM +0200, Igor Mammedov wrote:
> On Fri, 25 Aug 2017 14:22:03 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > On Thu, Aug 24, 2017 at 10:21:51AM +0200, Igor Mammedov wrote:
> > > Caching there practically doesn't give any benefits
> > > and that at slow path druring querying supported CPU list.
> > > But it introduces non conventional path of where from
> > > comes used CPU type name (kvm_ppc_register_host_cpu_type).
> > > 
> > > Taking in account that kvm_ppc_register_host_cpu_type()
> > > fixes up models the aliases point to, it's sufficient to
> > > make ppc_cpu_class_by_name() translate cpu alias to
> > > correct cpu type name.
> > > So drop PowerPCCPUAlias::oc field + ppc_cpu_class_by_alias()
> > > and let ppc_cpu_class_by_name() do conversion to cpu type name,
> > > which simplifies code a little bit saving ~20LOC and trouble
> > > wondering why ppc_cpu_class_by_alias() is necessary.
> > > 
> > > Signed-off-by: Igor Mammedov <imammedo@redhat.com>  
> > 
> > Unfortunately, this will break things.  This isn't purely a cache, in
> > the case handled by kvm_ppc_register_host_cpu_type(), 'oc' is *not*
> > redundant with the name.  The name is based on the specific CPU
> > description, but the oc points to the information for the "host" cpu.
> > 
> > There may well be a better way to do this, but this isn't it.
> > 
> > The problem we're trying to solve here is that KVM HV basically only
> > works with -cpu host.  But for the benefit of libvirt (and others), we
> > want, say, -cpu POWER8 to also work if the host *is* a POWER8.  But we
> > *don't* want to require that the host be exactly the same model of
> > POWER8 as "POWER8" would be aliased to with TCG.
> 
> here is snippet from kvm_ppc_register_host_cpu_type()
> 
> 1:
>             ppc_cpu_aliases[i].model = g_strdup(object_class_get_name(oc));      
>             suffix = strstr(ppc_cpu_aliases[i].model, "-"TYPE_POWERPC_CPU);      
>             if (suffix) {                                                        
>                 *suffix = 0;                                                     
>             }
> 2:                                                        
>             ppc_cpu_aliases[i].oc = oc;
> 
> where model is fixed up (1) to the name that corresponds to
> exactly the same 'oc' that is cached into (2)
> 
> any follow up attempt to translate fixed up alias will end up resolving
> it into model => the same 'oc' that would be cached in ppc_cpu_aliases[i].oc
> 
> isn't it?


You're right, I misread the code, sorry.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2017-08-29 11:02 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24  8:21 [Qemu-devel] [PATCH for-2.11 0/6] ppc: cpu_model handling cleanups Igor Mammedov
2017-08-24  8:21 ` [Qemu-devel] [PATCH for-2.11 1/6] ppc: use macros to make cpu type name from string literal Igor Mammedov
2017-08-25  1:30   ` David Gibson
2017-08-25  7:28     ` Igor Mammedov
2017-08-25 13:24       ` David Gibson
2017-08-24  8:21 ` [Qemu-devel] [PATCH for-2.11 2/6] ppc: make cpu_model translation to type consistent Igor Mammedov
2017-08-25  1:38   ` David Gibson
2017-08-25  7:27     ` Igor Mammedov
2017-08-25  9:45       ` David Gibson
2017-08-25 11:40         ` Igor Mammedov
2017-08-25 13:28           ` David Gibson
2017-08-25 14:34             ` Igor Mammedov
2017-08-29  7:26               ` David Gibson
2017-08-24  8:21 ` [Qemu-devel] [PATCH for-2.11 3/6] ppc: make cpu alias point only to real cpu models Igor Mammedov
2017-08-25  1:40   ` David Gibson
2017-08-24  8:21 ` [Qemu-devel] [PATCH for-2.11 4/6] ppc: replace inter-function cyclic dependency/recurssion with 2 simple lookups Igor Mammedov
2017-08-25  4:12   ` David Gibson
2017-08-25  7:34     ` Igor Mammedov
2017-08-30  3:05       ` David Gibson
2017-08-30  6:16         ` Igor Mammedov
2017-08-24  8:21 ` [Qemu-devel] [PATCH for-2.11 5/6] ppc: simplify cpu model lookup by PVR Igor Mammedov
2017-08-25  4:16   ` David Gibson
2017-08-25  7:40     ` Igor Mammedov
2017-08-25  9:32       ` David Gibson
2017-08-25 11:41         ` Igor Mammedov
2017-08-30 10:50         ` Igor Mammedov
2017-08-31  5:54           ` David Gibson
2017-08-24  8:21 ` [Qemu-devel] [PATCH for-2.11 6/6] ppc: drop caching ObjectClass from PowerPCCPUAlias Igor Mammedov
2017-08-25  4:22   ` David Gibson
2017-08-25  7:49     ` Igor Mammedov
2017-08-29  7:30       ` David Gibson [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=20170829073046.GM2578@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=imammedo@redhat.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.