From: Greg Kurz <groug@kaod.org>
To: Thomas Huth <thuth@redhat.com>
Cc: "David Gibson" <david@gibson.dropbear.id.au>,
"Laurent Vivier" <lvivier@redhat.com>,
joserz@linux.vnet.ibm.com, qemu-devel@nongnu.org,
qemu-ppc@nongnu.org, "Suraj Singh" <sursingh@redhat.com>,
"Cédric Le Goater" <clg@kaod.org>,
"Sam Bobroff" <sbobroff@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 2/2] target/ppc: move POWER9 DD1 workaround to init_proc_POWER9()
Date: Wed, 5 Jul 2017 10:47:51 +0200 [thread overview]
Message-ID: <20170705104751.041323f5@bahia.lan> (raw)
In-Reply-To: <41cfc821-c7f8-0c3d-3bc8-d2877ac5db04@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2788 bytes --]
On Wed, 5 Jul 2017 09:56:15 +0200
Thomas Huth <thuth@redhat.com> wrote:
> On 05.07.2017 08:36, David Gibson wrote:
> > On Tue, Jul 04, 2017 at 03:02:39PM +0200, Greg Kurz wrote:
> >> On Tue, 4 Jul 2017 21:41:51 +1000
> >> David Gibson <david@gibson.dropbear.id.au> wrote:
> >>
> >>> On Tue, Jul 04, 2017 at 01:15:00PM +0200, Greg Kurz wrote:
> >>>> On Tue, 4 Jul 2017 13:01:26 +0200
> >>>> Laurent Vivier <lvivier@redhat.com> wrote:
> >>>>
> >>>>> Commit 5f3066d ("target/ppc: Allow workarounds for POWER9 DD1")
> >>>>> disables compatibility mode for POWER9 DD1 to allow to
> >>>>> boot on POWER9 DD1 host with KVM.
> >>>>>
> >>>>> As the workaround has been added in kvmppc_host_cpu_class_init(),
> >>>>> it applies only on CPU created with "-cpu host".
> >>>>> As we want to be able to use also "-cpu POWER9" on a POWER9 DD1
> >>>>> host, this patch moves the workaround from kvmppc_host_cpu_class_init()
> >>>>> to init_proc_POWER9().
> >>>>>
> >>>>
> >>>> As with ppc_cpu_initfn() in your previous version, init_proc_POWER9() is
> >>>> called for every CPU instance.. ie, all CPU will adjust the @pcr_supported
> >>>> class attribute...
> >>>
> >>> Ah.. yeah.. I didn't notice that before. That's definitely not right.
> >>>
> >>>> What about moving the workaround to ppc_POWER9_cpu_family_class_init()
> >>>> instead ? This would just require to expose mfpvr() in some header.
> >>>
> >>> Yeah, as someone else pointed out using the host PVR is also
> >>> definitely not right (unless you're in a function specifically
> >>> connected to the host cpu class).
> >>>
> >>
> >> I agree but the root issue is that we accept to pass -cpu POWER9 instead of
> >> -cpu host with -enable-kvm. And the host cpu class isn't involved in this
> >> case.
> >
> > Well.. it sort of is. I believe the way we make this work (since
> > Thomas' cleanup) is that when KVM is active, we alter the alias for
> > the host cpu's family to point to the host cpu class, instead of
> > whatever specific version it usually points to.
>
Yeah, I saw that and I guess there's a problem: we alter the alias to
point to the class with the same PVR as the host CPU, not to the
host CPU class itself. The CPUs don't belong to TYPE_HOST_POWERPC_CPU
and aren't configured according to kvmppc_host_cpu_class_init().
> Right, it's the code at the and of the kvm_ppc_register_host_cpu_type()
> function. Maybe that function could also be a good spot to move the DD1
> workaround into (just a quick idea, I haven't checked whether it's
> feasible)?
>
I have a patch to change the alias to point to TYPE_HOST_POWERPC_CPU. This
allows to use "-cpu POWER9" with KVM on a DD1 host.
Cheers,
--
Greg
> Thomas
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
prev parent reply other threads:[~2017-07-05 8:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 11:01 [Qemu-devel] [PATCH v4 0/2] target/ppc/cpu-models: set POWER9_v1.0 as POWER9 DD1 Laurent Vivier
2017-07-04 11:01 ` [Qemu-devel] [PATCH v4 1/2] " Laurent Vivier
2017-07-04 11:01 ` [Qemu-devel] [PATCH v4 2/2] target/ppc: move POWER9 DD1 workaround to init_proc_POWER9() Laurent Vivier
2017-07-04 11:12 ` Thomas Huth
2017-07-04 11:15 ` Greg Kurz
2017-07-04 11:21 ` Laurent Vivier
2017-07-04 11:28 ` Laurent Vivier
2017-07-04 11:41 ` David Gibson
2017-07-04 13:02 ` Greg Kurz
2017-07-04 13:08 ` Thomas Huth
2017-07-05 6:36 ` David Gibson
2017-07-05 7:56 ` Thomas Huth
2017-07-05 8:47 ` Greg Kurz [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=20170705104751.041323f5@bahia.lan \
--to=groug@kaod.org \
--cc=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=joserz@linux.vnet.ibm.com \
--cc=lvivier@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=sbobroff@redhat.com \
--cc=sursingh@redhat.com \
--cc=thuth@redhat.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 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.