From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [PATCH 11/19] KVM: PPC: Book3S HV: add support for the XIVE native exploitation mode hcalls Date: Wed, 23 Jan 2019 17:44:15 +1100 Message-ID: References: <20190107184331.8429-1-clg@kaod.org> <20190107184331.8429-12-clg@kaod.org> <20190122052346.GF15124@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 , =?ISO-8859-1?Q?C=E9dric?= Le Goater Return-path: In-Reply-To: <20190122052346.GF15124@blackberry> 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 Tue, 2019-01-22 at 16:23 +1100, Paul Mackerras wrote: > > Which ones of these could be implemented in QEMU? Are there any that > can't possibly be implemented in QEMU because they need to do things > that require calling internal interfaces that userspace doesn't have > access to? Implementing them in qemu doesn't make a lot of sense. Qemu doesn't have access to most of the XIVE HW state. There's a XIVE model for full emulation but when using the real thing, almost none of it is visible. A lot of those hcalls effectively turn into OPAL calls. > How often do we expect each of these hypercalls to be called? It depends, I can't tell for AIX. For Linux, not often with one exception: H_INT_ESB which will be used whenever you EOI an emulated LSI. .../... > Why do we need to provide real-mode versions of these hypercall > handlers? I thought these hypercalls would only get called > infrequently, and in any case certainly much less frequently than once > per interrupt delivered. If they are infrequent, then let's leave out > the real-mode version and just handle them in book3s_hv.c. Agreed with the exception maybe of H_INT_ESB > > @@ -5153,6 +5169,19 @@ static unsigned int default_hcall_list[] = { > > H_IPOLL, > > H_XIRR, > > H_XIRR_X, > > +#endif > > +#ifdef CONFIG_KVM_XIVE > > + H_INT_GET_SOURCE_INFO, > > + H_INT_SET_SOURCE_CONFIG, > > + H_INT_GET_SOURCE_CONFIG, > > + H_INT_GET_QUEUE_INFO, > > + H_INT_SET_QUEUE_CONFIG, > > + H_INT_GET_QUEUE_CONFIG, > > + H_INT_SET_OS_REPORTING_LINE, > > + H_INT_GET_OS_REPORTING_LINE, > > + H_INT_ESB, > > + H_INT_SYNC, > > + H_INT_RESET, > > #endif > > The policy is not to add new hcalls to default_hcall_list[]. Is there > a strong reason for adding them here? > > Paul. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Date: Wed, 23 Jan 2019 06:44:15 +0000 Subject: Re: [PATCH 11/19] KVM: PPC: Book3S HV: add support for the XIVE native exploitation mode hcalls Message-Id: List-Id: References: <20190107184331.8429-1-clg@kaod.org> <20190107184331.8429-12-clg@kaod.org> <20190122052346.GF15124@blackberry> In-Reply-To: <20190122052346.GF15124@blackberry> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Paul Mackerras , =?ISO-8859-1?Q?C=E9dric?= Le Goater Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, David Gibson On Tue, 2019-01-22 at 16:23 +1100, Paul Mackerras wrote: > > Which ones of these could be implemented in QEMU? Are there any that > can't possibly be implemented in QEMU because they need to do things > that require calling internal interfaces that userspace doesn't have > access to? Implementing them in qemu doesn't make a lot of sense. Qemu doesn't have access to most of the XIVE HW state. There's a XIVE model for full emulation but when using the real thing, almost none of it is visible. A lot of those hcalls effectively turn into OPAL calls. > How often do we expect each of these hypercalls to be called? It depends, I can't tell for AIX. For Linux, not often with one exception: H_INT_ESB which will be used whenever you EOI an emulated LSI. .../... > Why do we need to provide real-mode versions of these hypercall > handlers? I thought these hypercalls would only get called > infrequently, and in any case certainly much less frequently than once > per interrupt delivered. If they are infrequent, then let's leave out > the real-mode version and just handle them in book3s_hv.c. Agreed with the exception maybe of H_INT_ESB > > @@ -5153,6 +5169,19 @@ static unsigned int default_hcall_list[] = { > > H_IPOLL, > > H_XIRR, > > H_XIRR_X, > > +#endif > > +#ifdef CONFIG_KVM_XIVE > > + H_INT_GET_SOURCE_INFO, > > + H_INT_SET_SOURCE_CONFIG, > > + H_INT_GET_SOURCE_CONFIG, > > + H_INT_GET_QUEUE_INFO, > > + H_INT_SET_QUEUE_CONFIG, > > + H_INT_GET_QUEUE_CONFIG, > > + H_INT_SET_OS_REPORTING_LINE, > > + H_INT_GET_OS_REPORTING_LINE, > > + H_INT_ESB, > > + H_INT_SYNC, > > + H_INT_RESET, > > #endif > > The policy is not to add new hcalls to default_hcall_list[]. Is there > a strong reason for adding them here? > > Paul.