From: David Gibson Date: Wed, 26 Sep 2018 03:30:40 +0000 Subject: Re: [RFC PATCH 12/32] powerpc: Provide dummy versions of plpar_hcall functions when !CONFIG_PPC_PSER Message-Id: <20180926033040.GN30868@umbus.fritz.box> MIME-Version: 1 Content-Type: multipart/mixed; boundary="0lUWL3nN4GV0+Ptw" List-Id: References: <1537524123-9578-13-git-send-email-paulus@ozlabs.org> In-Reply-To: <1537524123-9578-13-git-send-email-paulus@ozlabs.org> To: kvm-ppc@vger.kernel.org --0lUWL3nN4GV0+Ptw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 21, 2018 at 08:01:43PM +1000, Paul Mackerras wrote: > This will reduce the number of instances where we require ifdefs in > code which needs to call a hypercall on a pseries platform or do > something different on a powernv platform. >=20 > Signed-off-by: Paul Mackerras Wouldn't it make more sense for these to BUG_ON() or at least WARN_ON() before returning H_FUNCTION, since calling a hypercall on a non pseries platform is definitely a kernel bug? > --- > arch/powerpc/include/asm/hvcall.h | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) >=20 > diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm= /hvcall.h > index a0b17f9..cc9fe87 100644 > --- a/arch/powerpc/include/asm/hvcall.h > +++ b/arch/powerpc/include/asm/hvcall.h > @@ -362,6 +362,7 @@ > #ifndef __ASSEMBLY__ > #include > =20 > +#ifdef CONFIG_PPC_PSERIES > /** > * plpar_hcall_norets: - Make a pseries hypervisor call with no return a= rguments > * @opcode: The hypervisor call to make. > @@ -411,6 +412,27 @@ long plpar_hcall_raw(unsigned long opcode, unsigned = long *retbuf, ...); > long plpar_hcall9(unsigned long opcode, unsigned long *retbuf, ...); > long plpar_hcall9_raw(unsigned long opcode, unsigned long *retbuf, ...); > =20 > +#else /* CONFIG_PPC_PSERIES */ > +static inline long plpar_hcall_norets(unsigned long opcode, ...) > +{ return H_FUNCTION; } > + > +#define PLPAR_HCALL_BUFSIZE 4 > +static inline long plpar_hcall(unsigned long opcode, unsigned long *retb= uf, ...) > +{ return H_FUNCTION; } > + > +static inline long plpar_hcall_raw(unsigned long opcode, > + unsigned long *retbuf, ...) > +{ return H_FUNCTION; } > + > +#define PLPAR_HCALL9_BUFSIZE 9 > +static inline long plpar_hcall9(unsigned long opcode, > + unsigned long *retbuf, ...) > +{ return H_FUNCTION; } > +static inline long plpar_hcall9_raw(unsigned long opcode, > + unsigned long *retbuf, ...) > +{ return H_FUNCTION; } > +#endif /* CONFIG_PPC_PSERIES */ > + > struct hvcall_mpp_data { > unsigned long entitled_mem; > unsigned long mapped_mem; --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --0lUWL3nN4GV0+Ptw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAluq/WAACgkQbDjKyiDZ s5L9FRAAngdLxfGPxefmo4HHrMemBkxcA5FBlvPnnGC9Ad9OUiV2jCNbR/kaGfSU uZ1Unj7r4CSgeEPpLabyKvftQX/zOObDVwL2481brexZELrPYN5t1OCPSPei8ubT rVrG0KT6cWyGsMLngCvV/cI/KA0UG5pENY5oQUuuhd4MgsrduVcYp2zQ5d/q0wre yfZmCziPGOTYNYZUddbWzJ8uO8OExb10w17lafO0DLSnUpz6LIH0rxmel5Iwpd6f TZUJ8kLsbAkZ8H0wazI1EEIAItilxAIjw/wxWeVY86Ag9eRiY6WrA6yFxRyWDSk3 o4ggivDw18fZH9uDdmi4h4cLnbkajyBiNpShROoCt7GbqkkqigPEIQkY+IQj33qf o5gv+OnFgo0oIQNiD6XdPhLW85MEQpWpRjR7CSQ7NOBmQSOzKwM9Z7uRxbPpTsjP bwuPl+fHLoSL+SaxI6en9VfmA/mfXNv+mW+FOu/ZbBwfqmIS+10JYkFxJcS/fzOw 1/qfz3GNAnyvLpXiD+ehk/f95HuHR8ixdqz6zgpUZbTMofjYWzett0QpLq0wTzAJ feKxOfFwSnAIuEP5ljwVUtTZQZQm3GfPEdH8lEOiTdRklGSPU1NEa9/i+mET+UAB SAZX3EhuHjowfHV2DEPwDOnGUGoisV4EKf2rChjPlc67bxum8so= =lSca -----END PGP SIGNATURE----- --0lUWL3nN4GV0+Ptw--