From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Subject: Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support Date: Tue, 29 Jan 2019 14:46:59 +0100 Message-ID: <0b053855-1f96-2614-b958-eb6720aab69b@kaod.org> References: <20190107184331.8429-1-clg@kaod.org> <20190107191006.10648-1-clg@kaod.org> <20190107191006.10648-2-clg@kaod.org> <20190122052657.GG15124@blackberry> <20190123103009.GB29826@blackberry> <20190128044354.GB3237@blackberry> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, David Gibson To: Paul Mackerras , Benjamin Herrenschmidt Return-path: In-Reply-To: <20190128044354.GB3237@blackberry> Content-Language: en-US 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 1/28/19 5:43 AM, Paul Mackerras wrote: > On Thu, Jan 24, 2019 at 08:25:15AM +1100, Benjamin Herrenschmidt wrote: >> On Wed, 2019-01-23 at 21:30 +1100, Paul Mackerras wrote: >>>> Afaik bcs we change the mapping to point to the real HW irq ESB page >>>> instead of the "IPI" that was there at VM init time. >>> >>> So that makes it sound like there is a whole lot going on that hasn't >>> even been hinted at in the patch descriptions... It sounds like we >>> need a good description of how all this works and fits together >>> somewhere under Documentation/. >>> >>> In any case we need much more informative patch descriptions. I >>> realize that it's all currently in Cedric's head, but I bet that in >>> two or three years' time when we come to try to debug something, it >>> won't be in anyone's head... >> >> The main problem is understanding XIVE itself. It's not realistic to >> ask Cedric to write a proper documentation for XIVE as part of the >> patch series, but sadly IBM doesn't have a good one to provide either. > > There are: (a) the XIVE hardware, (b) the definition of the XIVE > hypercalls that guests use, and (c) the design decisions around how to > implement that hypercall interface. We need to get (b) published > somehow, but it is mostly (c) that I would expect the patch > descriptions to explain. > > It sounds like there will be a mapping to userspace where the pages > can sometimes point to an IPI page and sometimes point to a real HW > irq ESB page. Just to be clear. In both cases, these pages are real HW ESB pages. They are just attached to a different controller : the XIVE IC for the IPIs and the PHB4 for the others. > That is, the same guest "hardware" irq number sometimes > refers to a software-generated interrupt (what you called an "IPI" > above) and sometimes to a hardware-generated interrupt. That fact,> the reason why it is so and the consequences all need to be explained > somewhere. They are really not obvious and I don't believe they are > part of either the XIVE hardware spec or the XIVE hypercall spec. I tried to put the reasons behind the current approach in another thread, not saying this is the correct one. Thanks, C. From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Date: Tue, 29 Jan 2019 13:46:59 +0000 Subject: Re: [PATCH 18/19] KVM: PPC: Book3S HV: add passthrough support Message-Id: <0b053855-1f96-2614-b958-eb6720aab69b@kaod.org> List-Id: References: <20190107184331.8429-1-clg@kaod.org> <20190107191006.10648-1-clg@kaod.org> <20190107191006.10648-2-clg@kaod.org> <20190122052657.GG15124@blackberry> <20190123103009.GB29826@blackberry> <20190128044354.GB3237@blackberry> In-Reply-To: <20190128044354.GB3237@blackberry> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paul Mackerras , Benjamin Herrenschmidt Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, David Gibson On 1/28/19 5:43 AM, Paul Mackerras wrote: > On Thu, Jan 24, 2019 at 08:25:15AM +1100, Benjamin Herrenschmidt wrote: >> On Wed, 2019-01-23 at 21:30 +1100, Paul Mackerras wrote: >>>> Afaik bcs we change the mapping to point to the real HW irq ESB page >>>> instead of the "IPI" that was there at VM init time. >>> >>> So that makes it sound like there is a whole lot going on that hasn't >>> even been hinted at in the patch descriptions... It sounds like we >>> need a good description of how all this works and fits together >>> somewhere under Documentation/. >>> >>> In any case we need much more informative patch descriptions. I >>> realize that it's all currently in Cedric's head, but I bet that in >>> two or three years' time when we come to try to debug something, it >>> won't be in anyone's head... >> >> The main problem is understanding XIVE itself. It's not realistic to >> ask Cedric to write a proper documentation for XIVE as part of the >> patch series, but sadly IBM doesn't have a good one to provide either. > > There are: (a) the XIVE hardware, (b) the definition of the XIVE > hypercalls that guests use, and (c) the design decisions around how to > implement that hypercall interface. We need to get (b) published > somehow, but it is mostly (c) that I would expect the patch > descriptions to explain. > > It sounds like there will be a mapping to userspace where the pages > can sometimes point to an IPI page and sometimes point to a real HW > irq ESB page. Just to be clear. In both cases, these pages are real HW ESB pages. They are just attached to a different controller : the XIVE IC for the IPIs and the PHB4 for the others. > That is, the same guest "hardware" irq number sometimes > refers to a software-generated interrupt (what you called an "IPI" > above) and sometimes to a hardware-generated interrupt. That fact,> the reason why it is so and the consequences all need to be explained > somewhere. They are really not obvious and I don't believe they are > part of either the XIVE hardware spec or the XIVE hypercall spec. I tried to put the reasons behind the current approach in another thread, not saying this is the correct one. Thanks, C.