From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Tue, 19 Aug 2008 11:28:16 +0000 Subject: Re: [PATCH 2/4] kvmppc: add hypercall infrastructure - guest part Message-Id: <200808191328.16934.arnd@arndb.de> List-Id: References: <1219142204-12044-1-git-send-email-ehrhardt@linux.vnet.ibm.com> <1219142204-12044-3-git-send-email-ehrhardt@linux.vnet.ibm.com> In-Reply-To: <1219142204-12044-3-git-send-email-ehrhardt@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: linuxppc-dev@ozlabs.org Cc: hollisb@us.ibm.com, kvm-ppc@vger.kernel.org On Tuesday 19 August 2008, ehrhardt@linux.vnet.ibm.com wrote: > +static inline long kvm_hypercall1(unsigned int nr, unsigned long p1) > +{ > +=A0=A0=A0=A0=A0=A0=A0register unsigned long hcall asm ("r0") =3D nr; > +=A0=A0=A0=A0=A0=A0=A0register unsigned long arg1 asm ("r3") =3D p1; > +=A0=A0=A0=A0=A0=A0=A0register long ret asm ("r11"); > + > +=A0=A0=A0=A0=A0=A0=A0asm volatile(".long %1" > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0: "= =3Dr"(ret) > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0: "= i"(KVM_HYPERCALL_BIN), "r"(hcall), "r"(arg1) > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0: "= r4", "r5", "r6", "r7", "r8", > +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = =A0"r9", "r10", "r12", "cc"); > +=A0=A0=A0=A0=A0=A0=A0return ret; > +} What is the reasoning for making the calling convention different from all the existing hcall interfaces here? pseries uses r3 for the hcall number, lv1 and beat use r11, so using r0 just for the sake of being different seems counterintuitive. Arnd <>< =FF=F4=E8=BA{.n=C7+=89=B7=9F=AE=89=AD=86+%=8A=CB=FF=B1=E9=DD=B6=17=A5=8Aw= =FF=BA{.n=C7+=89=B7=A4=BEo=E9=A5=CF=E2=9E=D8^n=87r=A1=F6=A6z=CB=1A=81=EBh= =99=A8=E8=AD=DA&=A3=FB=E0z=BF=E4z=B9=DE=97=FA+=80=CA+zf=A3=A2=B7h=9A=88=A7~= =86=AD=86=DBi=FF=FF=EF=81=EA=FF=91=EA=E7z_=E8=AE=0F=E6j:+v=89=A8=FE)=DF=A3= =F8m