powerpc: Extends HCALL interface for InfiniBand usage
PATCH 1/1 powerpc: Extends HCALL interface for InfiniBand usage
Hello,
below (and attached) you will find my ib_hcall patch, which extends the HCALL interface for InfiniBand usage. I've made the patch agains the lates Linux kernel snapshot (linux-2.6.16-git14) from kernel.org. We moved this into the common powerpc code based on comments we got after posting the first eHCA InfiniBand device driver patch.
Any comments or proposals for my patch?
Regards,
Heiko
arch/powerpc/platforms/pseries/hvCall.S | 101 ++++++++++++++++++++- arch/powerpc/platforms/pseries/lpar.c | 3 include/asm-powerpc/hvcall.h | 100 ++++++++++++++++++++ 4 files changed, 202 insertions(+), 2 deletions(-)
arch/powerpc/platforms/pseries/hvCall.S 2006-03-28 14:20:47.800056224 +0200 renamed from arch/powerpc/platforms/pseries/hvCall.S 2006-03-28 14:18:52.389031144 +0200 +100 -1
@@ -91,7 +91,6 @@ _GLOBAL(plpar_hcall_8arg_2ret) mtcrf 0xff,r0 blr /* return r3 = status */ - /* long plpar_hcall_4out(unsigned long opcode, R3 unsigned long arg1, R4 unsigned long arg2, R5
@@ -127,3 +126,103 @@ _GLOBAL(plpar_hcall_4out) mtcrf 0xff,r0 blr /* return r3 = status */ + +/* plpar_hcall_7arg_7ret(unsigned long opcode, R3 + unsigned long arg1, R4 + unsigned long arg2, R5 + unsigned long arg3, R6 + unsigned long arg4, R7 + unsigned long arg5, R8 + unsigned long arg6, R9 + unsigned long arg7, R10 + unsigned long *out1, 112(R1) + unsigned long *out2, 110(R1) + unsigned long *out3, 108(R1) + unsigned long *out4, 106(R1) + unsigned long *out5, 104(R1) + unsigned long *out6, 102(R1) + unsigned long *out7); 100(R1) +*/ +_GLOBAL(plpar_hcall_7arg_7ret) + HMT_MEDIUM + + mfcr r0 + stw r0,8(r1) + + HVSC /* invoke the hypervisor */ + + lwz r0,8(r1) + + ld r11,STK_PARM(r11)(r1) /* Fetch r4 ret arg */ + std r4,0(r11) + ld r11,STK_PARM(r12)(r1) /* Fetch r5 ret arg */ + std r5,0(r11) + ld r11,STK_PARM(r13)(r1) /* Fetch r6 ret arg */ + std r6,0(r11) + ld r11,STK_PARM(r14)(r1) /* Fetch r7 ret arg */ + std r7,0(r11) + ld r11,STK_PARM(r15)(r1) /* Fetch r8 ret arg */ + std r8,0(r11) + ld r11,STK_PARM(r16)(r1) /* Fetch r9 ret arg */ + std r9,0(r11) + ld r11,STK_PARM(r17)(r1) /* Fetch r10 ret arg */ + std r10,0(r11) + + mtcrf 0xff,r0 + + blr /* return r3 = status */ + +/* plpar_hcall_9arg_9ret(unsigned long opcode, R3 + unsigned long arg1, R4 + unsigned long arg2, R5 + unsigned long arg3, R6 + unsigned long arg4, R7 + unsigned long arg5, R8 + unsigned long arg6, R9 + unsigned long arg7, R10 + unsigned long arg8, 112(R1) + unsigned long arg9, 110(R1) + unsigned long *out1, 108(R1) + unsigned long *out2, 106(R1) + unsigned long *out3, 104(R1) + unsigned long *out4, 102(R1) + unsigned long *out5, 100(R1) + unsigned long *out6, 98(R1) + unsigned long *out7); 96(R1) + unsigned long *out8, 94(R1) + unsigned long *out9, 92(R1) +*/ +_GLOBAL(plpar_hcall_9arg_9ret) + HMT_MEDIUM + + mfcr r0 + stw r0,8(r1) + + ld r11,STK_PARM(r11)(r1) /* put arg8 in R11 */ + ld r12,STK_PARM(r12)(r1) /* put arg9 in R12 */ + + HVSC /* invoke the hypervisor */ + + ld r0,STK_PARM(r13)(r1) /* Fetch r4 ret arg */ + stdx r4,r0,r0 + ld r0,STK_PARM(r14)(r1) /* Fetch r5 ret arg */ + stdx r5,r0,r0 + ld r0,STK_PARM(r15)(r1) /* Fetch r6 ret arg */ + stdx r6,r0,r0 + ld r0,STK_PARM(r16)(r1) /* Fetch r7 ret arg */ + stdx r7,r0,r0 + ld r0,STK_PARM(r17)(r1) /* Fetch r8 ret arg */ + stdx r8,r0,r0 + ld r0,STK_PARM(r18)(r1) /* Fetch r9 ret arg */ + stdx r9,r0,r0 + ld r0,STK_PARM(r19)(r1) /* Fetch r10 ret arg */ + stdx r10,r0,r0 + ld r0,STK_PARM(r20)(r1) /* Fetch r11 ret arg */ + stdx r11,r0,r0 + ld r0,STK_PARM(r21)(r1) /* Fetch r12 ret arg */ + stdx r12,r0,r0 + + lwz r0,8(r1) + mtcrf 0xff,r0 + + blr /* return r3 = status */
arch/powerpc/platforms/pseries/lpar.c 2006-03-28 14:20:47.801056072 +0200 renamed from arch/powerpc/platforms/pseries/lpar.c 2006-03-20 06:53:29.000000000 +0100 +2 -1
@@ -54,7 +54,8 @@ EXPORT_SYMBOL(plpar_hcall); EXPORT_SYMBOL(plpar_hcall_4out); EXPORT_SYMBOL(plpar_hcall_norets); EXPORT_SYMBOL(plpar_hcall_8arg_2ret); - +EXPORT_SYMBOL(plpar_hcall_7arg_7ret); +EXPORT_SYMBOL(plpar_hcall_9arg_9ret); extern void pSeries_find_serial_port(void);
include/asm-powerpc/hvcall.h 2006-03-28 14:20:47.799056376 +0200 renamed from include/asm-powerpc/hvcall.h 2006-03-20 06:53:29.000000000 +0100 +100 -0
132 lines not on this page · raw message
arch/powerpc/platforms/pseries/hvCall.S +100 -1
110 lines not on this page · raw message
arch/powerpc/platforms/pseries/hvCall.S.orig +129 -0
129 lines not on this page · raw message
arch/powerpc/platforms/pseries/lpar.c +2 -1
@@ -54,7 +54,8 @@ EXPORT_SYMBOL(plpar_hcall);EXPORT_SYMBOL (plpar_hcall_4out);EXPORT_SYMBOL (plpar_hcall_norets);EXPORT_SYMBOL (plpar_hcall_8arg_2ret); - +EXPORT_SYMBOL (plpar_hcall_7arg_7ret); +EXPORT_SYMBOL (plpar_hcall_9arg_9ret);extern void pSeries_find_serial_port (void );
include/asm-powerpc/hvcall.h +100 -0
132 lines not on this page · raw message
arch/powerpc/platforms/pseries/hvCall.S +100 -1
110 lines not on this page · raw message
arch/powerpc/platforms/pseries/lpar.c +2 -1
@@ -54,7 +54,8 @@ EXPORT_SYMBOL(plpar_hcall);EXPORT_SYMBOL (plpar_hcall_4out);EXPORT_SYMBOL (plpar_hcall_norets);EXPORT_SYMBOL (plpar_hcall_8arg_2ret); - +EXPORT_SYMBOL (plpar_hcall_7arg_7ret); +EXPORT_SYMBOL (plpar_hcall_9arg_9ret);extern void pSeries_find_serial_port (void );
include/asm-powerpc/hvcall.h +100 -0
132 lines not on this page · raw message
Quoted 8 lines
below (and attached) you will find my
ib_hcallpatch, which extends the HCALL interface for InfiniBand usage. I've made the patch agains the lates Linux kernel snapshot (linux-2.6.16-git14) from kernel.org. We moved this into the common powerpc code based on comments we got after posting the first eHCA InfiniBand device driver patch.Any comments or proposals for my patch?
Looks good /an sich/, but...
include/asm-powerpc/hvcall.h 2006-03-28 14:20:47.799056376 +0200 line 15
Quoted 10 lines
#define
H_Success0
#defineH_Busy1 /* Hardware busy -- retry later */
#defineH_Closed2 /* Resource closed */
+#defineH_NOT_AVAILABLE3
#defineH_Constrained4 /* Resource request constrained to
max allowed */include/asm-powerpc/hvcall.h 2006-03-28 14:20:47.799056376 +0200 renamed from include/asm-powerpc/hvcall.h 2006-03-20 06:53:29.000000000 +0100 +3
-0+#define H_PARTIAL 5 #define H_InProgress 14 /* Kind of like busy */ +#define H_PARTIAL_STORE 16 +#define H_PAGE_REGISTERED 15
All the other defines use StudlyCaps, yours use SHOUTING_CAPS, you might want to choose just one style (though I prefer the shouting one).
Quoted 5 lines
diff -Nurpw linux-2.6.16-git14/arch/powerpc/platforms/pseries/hvCall.S.orig linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/hvCall.S.orig --- linux-2.6.16-git14/arch/powerpc/platforms/pseries/hvCall.S.orig
1970-01-01 01:00:00.000000000 +0100+++ linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/
hvCall.S.orig 2006-03-28 14:19:51.140018464 +0200
Erm... you messed up here :-)
In fact, the patch is broken in more places, please make sure just to diff the files you wanted to diff, and it looks like you posted two patches in one?
Segher
Hello,
Quoted 2 lines · Segher Boessenkool
All the other defines use StudlyCaps, yours use
SHOUTING_CAPS, you might want to choose just one style (though I prefer the shouting one).
if StudlyCaps are better (and more readable) than SHOUTING CAPS I can change it. Not a big deal.
Regards,
Heiko
Quoted 3 lines
if StudlyCaps are better (and more readable) than SHOUTING CAPS I can change it. Not a big deal.
They are not... but consistency is better :)
Ben.
Ok, I will change it to StudlyCaps. ;)
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 3 lines
if StudlyCaps are better (and more readable) than SHOUTING CAPS I can change it. Not a big deal.
They are not... but consistency is better :)
Ben.
Quoted 6 lines
Ok, I will change it to StudlyCaps. ;)
Quoted 4 lines
Quoted 2 lines
if StudlyCaps are better (and more readable) than SHOUTING CAPS I can change it. Not a big deal.
They are not... but consistency is better :)
Don't top-post, please.
How about we change the existing Studly's? It's only 132 lines... Opinions?
I guess I'll have to volunteer for that job now. Oops.
Segher
Quoted 2 lines · Segher Boessenkool
How about we change the existing Studly's? It's only 132 lines... Opinions?
Yes, that's the best idea.
Quoted 1 line
I guess I'll have to volunteer for that job now. Oops.
Thanks, Segher! :)
Paul.
Hello Segher,
Quoted 2 lines · Segher Boessenkool
and it looks like you posted two
patches
I've posted the patch as attachment and and directly in the e-mail. I think my mail application messed it up. Sorry. I will post the next patches without attachment. Thanks for your comment.
Regards,
Heiko