From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Subject: Re: [PATCH v2 03/16] KVM: PPC: Book3S HV: XIVE: introduce a new capability KVM_CAP_PPC_IRQ_XIVE Date: Mon, 25 Feb 2019 15:59:31 +1100 Message-ID: <20190225045931.GB20501@blackberry> References: <20190222112840.25000-1-clg@kaod.org> <20190222112840.25000-4-clg@kaod.org> <20190225003527.GG7668@umbus.fritz.box> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, =?iso-8859-1?Q?C=E9dric?= Le Goater , linuxppc-dev@lists.ozlabs.org To: David Gibson Return-path: Content-Disposition: inline In-Reply-To: <20190225003527.GG7668@umbus.fritz.box> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" List-Id: kvm.vger.kernel.org On Mon, Feb 25, 2019 at 11:35:27AM +1100, David Gibson wrote: > On Fri, Feb 22, 2019 at 12:28:27PM +0100, Cédric Le Goater wrote: > > + xc->xive = xive; > > + xc->vcpu = vcpu; > > + xc->server_num = cpu; > > + xc->vp_id = xive->vp_base + cpu; > > Hrm. This ties the internal VP id to the userspace chosen server > number, which isn't ideal. It puts a constraint on those server > numbers that you wouldn't otherwise have. We should probably do the same as the xics-on-xive code, which is to put the server number through kvmppc_pack_vcpu_id(), which is a folding function that maps the QEMU vcpu id (which is the server number) down to the range 0..KVM_MAX_VCPUS-1, and works for the allocation patterns used in the various vSMT modes. Paul. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Date: Mon, 25 Feb 2019 04:59:31 +0000 Subject: Re: [PATCH v2 03/16] KVM: PPC: Book3S HV: XIVE: introduce a new capability KVM_CAP_PPC_IRQ_XIVE Message-Id: <20190225045931.GB20501@blackberry> List-Id: References: <20190222112840.25000-1-clg@kaod.org> <20190222112840.25000-4-clg@kaod.org> <20190225003527.GG7668@umbus.fritz.box> In-Reply-To: <20190225003527.GG7668@umbus.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: David Gibson Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, =?iso-8859-1?Q?C=E9dric?= Le Goater , linuxppc-dev@lists.ozlabs.org On Mon, Feb 25, 2019 at 11:35:27AM +1100, David Gibson wrote: > On Fri, Feb 22, 2019 at 12:28:27PM +0100, C=E9dric Le Goater wrote: > > + xc->xive =3D xive; > > + xc->vcpu =3D vcpu; > > + xc->server_num =3D cpu; > > + xc->vp_id =3D xive->vp_base + cpu; >=20 > Hrm. This ties the internal VP id to the userspace chosen server > number, which isn't ideal. It puts a constraint on those server > numbers that you wouldn't otherwise have. We should probably do the same as the xics-on-xive code, which is to put the server number through kvmppc_pack_vcpu_id(), which is a folding function that maps the QEMU vcpu id (which is the server number) down to the range 0..KVM_MAX_VCPUS-1, and works for the allocation patterns used in the various vSMT modes. Paul.