From: Michael Ellerman Date: Mon, 15 Jul 2019 04:46:06 +0000 Subject: Re: [PATCH v4 3/8] KVM: PPC: Ultravisor: Add generic ultravisor call handler Message-Id: <875zo3aos1.fsf@concordia.ellerman.id.au> List-Id: References: <20190628200825.31049-1-cclaudio@linux.ibm.com> <20190628200825.31049-4-cclaudio@linux.ibm.com> <87lfx4g253.fsf@concordia.ellerman.id.au> <45cb74bc-442c-e1c5-6636-93e9ab7f323a@linux.ibm.com> In-Reply-To: <45cb74bc-442c-e1c5-6636-93e9ab7f323a@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Claudio Carvalho , linuxppc-dev@ozlabs.org Cc: Madhavan Srinivasan , Michael Anderson , Ram Pai , kvm-ppc@vger.kernel.org, Bharata B Rao , Ryan Grimm , Sukadev Bhattiprolu , Thiago Bauermann , Anshuman Khandual Claudio Carvalho writes: > On 7/11/19 9:57 AM, Michael Ellerman wrote: >> Claudio Carvalho writes: >>> From: Ram Pai >>> >>> Add the ucall() function, which can be used to make ultravisor calls >>> with varied number of in and out arguments. Ultravisor calls can be made >>> from the host or guests. >>> >>> This copies the implementation of plpar_hcall(). >> .. with quite a few changes? >> >> This is one of the things I'd like to see in a Documentation file, so >> that people can review the implementation vs the specification. > > I will document this (and other things) in a file under Documentation/powerpc. Thanks. >>> +/* API functions */ >>> +#define UCALL_BUFSIZE 4 >> Please don't copy this design from the hcall code, it has led to bugs in >> the past. >> >> See my (still unmerged) attempt to fix this for the hcall case: >> https://patchwork.ozlabs.org/patch/683577/ >> >> Basically instead of asking callers nicely to define a certain sized >> buffer, and them forgetting, define a proper type that has the right size. > > I will keep that in mind. For now I think we don't need that since the v5 > will have ucall_norets() instead. OK. >>> diff --git a/arch/powerpc/kernel/ultravisor.c b/arch/powerpc/kernel/ultravisor.c >>> index dc6021f63c97..02ddf79a9522 100644 >>> --- a/arch/powerpc/kernel/ultravisor.c >>> +++ b/arch/powerpc/kernel/ultravisor.c >>> @@ -8,10 +8,14 @@ >>> #include >>> #include >>> #include >>> +#include >>> >>> #include >>> #include >>> >>> +/* in ucall.S */ >>> +EXPORT_SYMBOL_GPL(ucall); >> This should be in ucall.S > > Here I'm following the same way that hypercall wrapper symbols are exported. Yeah we used to not be able to export from .S but that was fixed a few years ago. > Last time I tried to export that in ucall.S the linker complained that the > ucall > symbol will not be versioned. Something like this: > https://patchwork.kernel.org/patch/9452759/ I think you just need to include in the .S ? cheers