* Re: [OT] ppc64 serialization problem
From: Ivan Warren @ 2006-03-29 18:42 UTC (permalink / raw)
To: Olaf Hering; +Cc: Greg Smith, linuxppc-dev, Paul Mackerras
In-Reply-To: <20060329183259.GA18514@suse.de>
[-- Attachment #1: Type: text/plain, Size: 938 bytes --]
Olaf Hering wrote:
> On Wed, Mar 29, Greg Smith wrote:
>
>
>> So it is clear between .A and .B -> value of b was read then written. If
>> anything happens between .A and .B to ->b, then it is lost.
>>
>
> Even gcc4.1 does it that way with -O0
Yeah.. Noticed that..gcc 3.3.3 and gcc 4.0.3 also do this
Even declaring the field volatile has no effect..
Question :
Is this *NORMAL* behavior ? I discussed this with some C folks and they
seem to think (at least some of them) that it's broken per standards..
(volatile fields should be only read/written IFF read/written explicitly
- pretty much what section 6.3.7 of the C std says).
Anyway I can produce perfectly valid sample code (to my understanding
anyway) that produces incorrect result.. YUCK !
This is also possibly a problem with the powerpc64 back end of gcc..
Anyway.. It's OT.. Sorry to have bothered you guys ! (And thanks Greg
for pointing me here).
--Ivan
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3216 bytes --]
^ permalink raw reply
* Re: [OT] ppc64 serialization problem
From: Olaf Hering @ 2006-03-29 18:32 UTC (permalink / raw)
To: Greg Smith; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <1143656433.3075.108.camel@localhost.localdomain>
On Wed, Mar 29, Greg Smith wrote:
> So it is clear between .A and .B -> value of b was read then written. If
> anything happens between .A and .B to ->b, then it is lost.
Even gcc4.1 does it that way with -O0.
^ permalink raw reply
* Re: [OT] ppc64 serialization problem
From: Greg Smith @ 2006-03-29 18:20 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17450.2061.510951.479016@cargo.ozlabs.ibm.com>
On Wed, 2006-03-29 at 15:07 +1100, Paul Mackerras wrote:
> Greg Smith writes:
>
> > On rare occasions, values A and B will differ! In the examples that I
> > have seen, there is contention with `lock'. This phenomenon does not
> > occur on ppc32 or a number of other architectures that we support.
>
> I would be interested to see the assembler code being generated for
> your code snippets.
>
> Paul.
This is looking like a compiler optimization issue. We have two fields
_u32 x,y;
Field y is what we are trying to serialize with the lock. However,
while we are doing that it appears another thread is updating x. When x
is updated and with optimization, the code is doing an 8 byte load of x
and y then doing an 8 byte store, wiping out what was stored in y.
Which explains why changing the type to _u64 seemed to fix the problem.
Below are some of the notes the other developer sent me.
Thanks,
Greg Smith
There are OTHER field neighbouring the ints_state field.. (and this is
probably some of the flags)..
gcc, when optimizing, gcc load and stores 64 bit values, *INCLUDING* the
ints_state field effectivelly breaking serialization.
Here is a sample program :
struct _test1
{
unsigned long long z;
unsigned char c;
unsigned int a:1;
const volatile unsigned int b;
};
int main()
{
}
unsigned int toto(struct _test1 *data)
{
data->a=1;
return data->b;
}
And here is the relevant asm snippet :
.A
ld 11,8(9) - get 64 bits ->a
lis 0,0x80 *
sldi 0,0,32 *
or 0,11,0 *
.B
std 0,8(9) * Store 64 bits -> a
ld 9,112(31) *
lwz 0,12(9) * get 32 bit b
So it is clear between .A and .B -> value of b was read then written. If
anything happens between .A and .B to ->b, then it is lost.
^ permalink raw reply
* Re: [PATCH] powerpc: Extends HCALL interface for InfiniBand usage
From: Heiko J Schick @ 2006-03-29 16:49 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev, paulus
In-Reply-To: <2691DBEE-C7E2-46A3-8455-6F98806C3102@kernel.crashing.org>
Hello Segher,
On 29.03.2006, at 17:09, Segher Boessenkool wrote:
> 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
^ permalink raw reply
* Re: [PATCH] powerpc: Extends HCALL interface for InfiniBand usage
From: Heiko J Schick @ 2006-03-29 16:55 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: linuxppc-dev, paulus
In-Reply-To: <2691DBEE-C7E2-46A3-8455-6F98806C3102@kernel.crashing.org>
Hello,
On 29.03.2006, at 17:09, Segher Boessenkool wrote:
> 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
^ permalink raw reply
* Re: "lseek/write char driver" versus "usermode iomem access"
From: David Hawkins @ 2006-03-29 16:46 UTC (permalink / raw)
To: Josef Angermeier; +Cc: linuxppc-embedded
In-Reply-To: <442A43C6.5050605@cs.fau.de>
> besides adapting linux to my custom board, i now have to write a driver
> for a special device. This device mainly consists of an up to 512 bytes
> big IO memory. Because performance matters alot, i wonder if i shall
> write a simple char driver offering a write/lseek-interface to access
> this memory or if i shall do something new to me, mapping the IO-memory
> to the userspace, so that the user-program can directly access the
> device memory. Can anyone tell me how performance probably differs
> between those two design.
>
> Thanks, you probably save me alot of time to tryout!
Hi Josef,
Here's a couple of comments that may help:
lseek()/read()/write():
- read and write need to use copy_to_user and copy_from_user
commands to copy bytes from the registers into the user-space
buffer.
mmap()
- maps pages directly, so avoids the overhead of the copy_xx_user
calls.
So, if you have a set of control *registers* that you want to
manipulate, then mmap would be recommended.
However, this 512-bytes of memory is just that, *memory*, and the
requirement is to move it off the device as fast as possible,
then you probably want to create a device that has a linked
list of 512-byte buffers internally, and use a DMA channel
to move data from the device into the buffer. Then the
'read' function of the driver would consume the contents of
the buffer.
So, as always, things are application dependent. If you
could describe things in more detail, I can help make
more suggestions and supply you with code.
Regards,
Dave
^ permalink raw reply
* Re: Kernel for MPC Lite 5200 will not compile
From: Matthias Fechner @ 2006-03-29 15:39 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <20060328223105.2E44D3535F7@atlas.denx.de>
Hello Wolfgang,
* Wolfgang Denk <wd@denx.de> [29-03-06 00:31]:
> Which kernel tree are you using? There is no support for MPC5200 in
> the DENX Linux tree. Well, some code is there, as there is in the
> public 2.6 kernel tree, but it's known to be broken and not supported
> by us.
i tried the following trees:
linux-2.6.15 (from kernel.org)
linux-2.6-denx (from cg-clone http://www.denx.de/git/<project_name>)
linux-2.6-denx-git (see above)
linuxppc_2_4_mpc5200 (see above)
on the 2.4 kernel i got a different errormessage, but now with the
kernel linux-2.6-mpc52xx.git from Sylvain everthing seems to work fine,
I need to test it at first. :) But I think this will take now some
time from now.
> > For this I used the git repository.
>
> Which one?
see above
> > I copied the file arch/ppc/configs/lite5200_defconfig to .config, and
> > tried the following one:
> > make ARCH=ppc CROSS_COMPILE=ppc_6xx- uImage
>
> That's not the official way to build images.
oh, sry I played with crosscompiling the firt time, it would be a
pleasure for me if you could correct me.
Best regards,
Matthias
^ permalink raw reply
* Re: Kernel for MPC Lite 5200 will not compile
From: Matthias Fechner @ 2006-03-29 15:32 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <4429A0E5.8010308@246tNt.com>
Hello Sylvain,
* Sylvain Munaut <tnt@246tNt.com> [28-03-06 22:47]:
> You might want to try the "quick start" section of
> http://www.246tnt.com/mpc52xx/
thx a lot, I'm sure this will help.
Best regards,
Matthias
^ permalink raw reply
* Re: Kernel for MPC Lite 5200 will not compile
From: Matthias Fechner @ 2006-03-29 15:31 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <4b73d43f0603280815n3fc7bb5dq38b72f87f18b905f@mail.gmail.com>
Hello John,
* John Rigby <jcrigby@gmail.com> [28-03-06 09:15]:
> kernel: http://gitbits.246tnt.com/gitbits/linux-2.6-mpc52xx.git
thx a lot, the compile was successfully now.
Now i can start to play with the environment. :)
Best regards,
Matthias
^ permalink raw reply
* Re: [PATCH] powerpc: Extends HCALL interface for InfiniBand usage
From: Segher Boessenkool @ 2006-03-29 15:09 UTC (permalink / raw)
To: Heiko J Schick; +Cc: linuxppc-dev, paulus
In-Reply-To: <442AA34B.7050801@de.ibm.com>
> 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?
Looks good /an sich/, but...
> #define H_Success 0
> #define H_Busy 1 /* Hardware busy -- retry later */
> #define H_Closed 2 /* Resource closed */
> +#define H_NOT_AVAILABLE 3
> #define H_Constrained 4 /* Resource request constrained to
> max allowed */
> +#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).
> 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
^ permalink raw reply
* [PATCH] powerpc: Extends HCALL interface for InfiniBand usage
From: Heiko J Schick @ 2006-03-29 15:10 UTC (permalink / raw)
To: Anton Blanchard, paulus; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 23190 bytes --]
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
Signed-off-by: Heiko J Schick <schickhj@de.ibm.com>
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(-)
diff -Nurpw linux-2.6.16-git14/arch/powerpc/platforms/pseries/hvCall.S linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/hvCall.S
--- linux-2.6.16-git14/arch/powerpc/platforms/pseries/hvCall.S 2006-03-28 14:18:52.389031144 +0200
+++ linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/hvCall.S 2006-03-28 14:20:47.800056224 +0200
@@ -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 */
diff -Nurpw linux-2.6.16-git14/arch/powerpc/platforms/pseries/lpar.c linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/lpar.c
--- linux-2.6.16-git14/arch/powerpc/platforms/pseries/lpar.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/lpar.c 2006-03-28 14:20:47.801056072 +0200
@@ -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);
diff -Nurpw linux-2.6.16-git14/include/asm-powerpc/hvcall.h linux-2.6.16-git14-ib/include/asm-powerpc/hvcall.h
--- linux-2.6.16-git14/include/asm-powerpc/hvcall.h 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-git14-ib/include/asm-powerpc/hvcall.h 2006-03-28 14:20:47.799056376 +0200
@@ -7,8 +7,12 @@
#define H_Success 0
#define H_Busy 1 /* Hardware busy -- retry later */
#define H_Closed 2 /* Resource closed */
+#define H_NOT_AVAILABLE 3
#define H_Constrained 4 /* Resource request constrained to max allowed */
+#define H_PARTIAL 5
#define H_InProgress 14 /* Kind of like busy */
+#define H_PARTIAL_STORE 16
+#define H_PAGE_REGISTERED 15
#define H_Continue 18 /* Returned from H_Join on success */
#define H_LongBusyStartRange 9900 /* Start of long busy range */
#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */
@@ -34,6 +38,36 @@
#define H_DestParm -14
#define H_RemoteParm -15
#define H_Resource -16
+#define H_ADAPTER_PARM -17
+#define H_RH_PARM -18
+#define H_RCQ_PARM -19
+#define H_SCQ_PARM -20
+#define H_EQ_PARM -21
+#define H_RT_PARM -22
+#define H_ST_PARM -23
+#define H_SIGT_PARM -24
+#define H_TOKEN_PARM -25
+#define H_MLENGTH_PARM -27
+#define H_MEM_PARM -28
+#define H_MEM_ACCESS_PARM -29
+#define H_ATTR_PARM -30
+#define H_PORT_PARM -31
+#define H_MCG_PARM -32
+#define H_VL_PARM -33
+#define H_TSIZE_PARM -34
+#define H_TRACE_PARM -35
+
+#define H_MASK_PARM -37
+#define H_MCG_FULL -38
+#define H_ALIAS_EXIST -39
+#define H_P_COUNTER -40
+#define H_TABLE_FULL -41
+#define H_ALT_TABLE -42
+#define H_MR_CONDITION -43
+#define H_NOT_ENOUGH_RESOURCES -44
+#define H_R_STATE -45
+#define H_RESCINDEND -46
+
/* Long Busy is a condition that can be returned by the firmware
* when a call cannot be completed now, but the identical call
@@ -65,6 +99,9 @@
#define H_DABRX_KERNEL (1UL<<(63-62))
#define H_DABRX_USER (1UL<<(63-63))
+/* Each control block has to be on a 4K bondary */
+#define H_CB_ALIGNMENT 4096
+
/* pSeries hypervisor opcodes */
#define H_REMOVE 0x04
#define H_ENTER 0x08
@@ -116,6 +153,33 @@
#define H_VTERM_PARTNER_INFO 0x150
#define H_REGISTER_VTERM 0x154
#define H_FREE_VTERM 0x158
+#define H_RESET_EVENTS 0x15C
+#define H_ALLOC_RESOURCE 0x160
+#define H_FREE_RESOURCE 0x164
+#define H_MODIFY_QP 0x168
+#define H_QUERY_QP 0x16C
+#define H_REREGISTER_PMR 0x170
+#define H_REGISTER_SMR 0x174
+#define H_QUERY_MR 0x178
+#define H_QUERY_MW 0x17C
+#define H_QUERY_HCA 0x180
+#define H_QUERY_PORT 0x184
+#define H_MODIFY_PORT 0x188
+#define H_DEFINE_AQP1 0x18C
+#define H_GET_TRACE_BUFFER 0x190
+#define H_DEFINE_AQP0 0x194
+#define H_RESIZE_MR 0x198
+#define H_ATTACH_MCQP 0x19C
+#define H_DETACH_MCQP 0x1A0
+#define H_CREATE_RPT 0x1A4
+#define H_REMOVE_RPT 0x1A8
+#define H_REGISTER_RPAGES 0x1AC
+#define H_DISABLE_AND_GETC 0x1B0
+#define H_ERROR_DATA 0x1B4
+#define H_GET_HCA_INFO 0x1B8
+#define H_GET_PERF_COUNT 0x1BC
+#define H_MANAGE_TRACE 0x1C0
+#define H_QUERY_INT_STATE 0x1E4
#define H_POLL_PENDING 0x1D8
#define H_JOIN 0x298
#define H_ENABLE_CRQ 0x2B0
@@ -175,6 +239,42 @@ long plpar_hcall_4out(unsigned long opco
unsigned long *out3,
unsigned long *out4);
+long plpar_hcall_7arg_7ret(unsigned long opcode,
+ unsigned long arg1,
+ unsigned long arg2,
+ unsigned long arg3,
+ unsigned long arg4,
+ unsigned long arg5,
+ unsigned long arg6,
+ unsigned long arg7,
+ unsigned long *out1,
+ unsigned long *out2,
+ unsigned long *out3,
+ unsigned long *out4,
+ unsigned long *out5,
+ unsigned long *out6,
+ unsigned long *out7);
+
+long plpar_hcall_9arg_9ret(unsigned long opcode,
+ unsigned long arg1,
+ unsigned long arg2,
+ unsigned long arg3,
+ unsigned long arg4,
+ unsigned long arg5,
+ unsigned long arg6,
+ unsigned long arg7,
+ unsigned long arg8,
+ unsigned long arg9,
+ unsigned long *out1,
+ unsigned long *out2,
+ unsigned long *out3,
+ unsigned long *out4,
+ unsigned long *out5,
+ unsigned long *out6,
+ unsigned long *out7,
+ unsigned long *out8,
+ unsigned long *out9);
+
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_HVCALL_H */
diff -Nurpw linux-2.6.16-git14/arch/powerpc/platforms/pseries/hvCall.S linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/hvCall.S
--- linux-2.6.16-git14/arch/powerpc/platforms/pseries/hvCall.S 2006-03-28 14:18:52.389031144 +0200
+++ linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/hvCall.S 2006-03-28 14:20:47.800056224 +0200
@@ -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 */
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
@@ -0,0 +1,129 @@
+/*
+ * This file contains the generic code to perform a call to the
+ * pSeries LPAR hypervisor.
+ * NOTE: this file will go away when we move to inline this work.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+#include <asm/hvcall.h>
+#include <asm/processor.h>
+#include <asm/ppc_asm.h>
+
+#define STK_PARM(i) (48 + ((i)-3)*8)
+
+ .text
+
+/* long plpar_hcall(unsigned long opcode, R3
+ unsigned long arg1, R4
+ unsigned long arg2, R5
+ unsigned long arg3, R6
+ unsigned long arg4, R7
+ unsigned long *out1, R8
+ unsigned long *out2, R9
+ unsigned long *out3); R10
+ */
+_GLOBAL(plpar_hcall)
+ HMT_MEDIUM
+
+ mfcr r0
+
+ std r8,STK_PARM(r8)(r1) /* Save out ptrs */
+ std r9,STK_PARM(r9)(r1)
+ std r10,STK_PARM(r10)(r1)
+
+ stw r0,8(r1)
+
+ HVSC /* invoke the hypervisor */
+
+ lwz r0,8(r1)
+
+ ld r8,STK_PARM(r8)(r1) /* Fetch r4-r6 ret args */
+ ld r9,STK_PARM(r9)(r1)
+ ld r10,STK_PARM(r10)(r1)
+ std r4,0(r8)
+ std r5,0(r9)
+ std r6,0(r10)
+
+ mtcrf 0xff,r0
+ blr /* return r3 = status */
+
+
+/* Simple interface with no output values (other than status) */
+_GLOBAL(plpar_hcall_norets)
+ HMT_MEDIUM
+
+ mfcr r0
+ stw r0,8(r1)
+
+ HVSC /* invoke the hypervisor */
+
+ lwz r0,8(r1)
+ mtcrf 0xff,r0
+ blr /* return r3 = status */
+
+
+/* long plpar_hcall_8arg_2ret(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 *out1); 120(R1)
+ */
+_GLOBAL(plpar_hcall_8arg_2ret)
+ HMT_MEDIUM
+
+ mfcr r0
+ ld r11,STK_PARM(r11)(r1) /* put arg8 in R11 */
+ stw r0,8(r1)
+
+ HVSC /* invoke the hypervisor */
+
+ lwz r0,8(r1)
+ ld r10,STK_PARM(r12)(r1) /* Fetch r4 ret arg */
+ std r4,0(r10)
+ mtcrf 0xff,r0
+ blr /* return r3 = status */
+
+
+/* long plpar_hcall_4out(unsigned long opcode, R3
+ unsigned long arg1, R4
+ unsigned long arg2, R5
+ unsigned long arg3, R6
+ unsigned long arg4, R7
+ unsigned long *out1, R8
+ unsigned long *out2, R9
+ unsigned long *out3, R10
+ unsigned long *out4); 112(R1)
+ */
+_GLOBAL(plpar_hcall_4out)
+ HMT_MEDIUM
+
+ mfcr r0
+ stw r0,8(r1)
+
+ std r8,STK_PARM(r8)(r1) /* Save out ptrs */
+ std r9,STK_PARM(r9)(r1)
+ std r10,STK_PARM(r10)(r1)
+
+ HVSC /* invoke the hypervisor */
+
+ lwz r0,8(r1)
+
+ ld r8,STK_PARM(r8)(r1) /* Fetch r4-r7 ret args */
+ ld r9,STK_PARM(r9)(r1)
+ ld r10,STK_PARM(r10)(r1)
+ ld r11,STK_PARM(r11)(r1)
+ std r4,0(r8)
+ std r5,0(r9)
+ std r6,0(r10)
+ std r7,0(r11)
+
+ mtcrf 0xff,r0
+ blr /* return r3 = status */
diff -Nurpw linux-2.6.16-git14/arch/powerpc/platforms/pseries/lpar.c linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/lpar.c
--- linux-2.6.16-git14/arch/powerpc/platforms/pseries/lpar.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/lpar.c 2006-03-28 14:20:47.801056072 +0200
@@ -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);
diff -Nurpw linux-2.6.16-git14/include/asm-powerpc/hvcall.h linux-2.6.16-git14-ib/include/asm-powerpc/hvcall.h
--- linux-2.6.16-git14/include/asm-powerpc/hvcall.h 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-git14-ib/include/asm-powerpc/hvcall.h 2006-03-28 14:20:47.799056376 +0200
@@ -7,8 +7,12 @@
#define H_Success 0
#define H_Busy 1 /* Hardware busy -- retry later */
#define H_Closed 2 /* Resource closed */
+#define H_NOT_AVAILABLE 3
#define H_Constrained 4 /* Resource request constrained to max allowed */
+#define H_PARTIAL 5
#define H_InProgress 14 /* Kind of like busy */
+#define H_PARTIAL_STORE 16
+#define H_PAGE_REGISTERED 15
#define H_Continue 18 /* Returned from H_Join on success */
#define H_LongBusyStartRange 9900 /* Start of long busy range */
#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */
@@ -34,6 +38,36 @@
#define H_DestParm -14
#define H_RemoteParm -15
#define H_Resource -16
+#define H_ADAPTER_PARM -17
+#define H_RH_PARM -18
+#define H_RCQ_PARM -19
+#define H_SCQ_PARM -20
+#define H_EQ_PARM -21
+#define H_RT_PARM -22
+#define H_ST_PARM -23
+#define H_SIGT_PARM -24
+#define H_TOKEN_PARM -25
+#define H_MLENGTH_PARM -27
+#define H_MEM_PARM -28
+#define H_MEM_ACCESS_PARM -29
+#define H_ATTR_PARM -30
+#define H_PORT_PARM -31
+#define H_MCG_PARM -32
+#define H_VL_PARM -33
+#define H_TSIZE_PARM -34
+#define H_TRACE_PARM -35
+
+#define H_MASK_PARM -37
+#define H_MCG_FULL -38
+#define H_ALIAS_EXIST -39
+#define H_P_COUNTER -40
+#define H_TABLE_FULL -41
+#define H_ALT_TABLE -42
+#define H_MR_CONDITION -43
+#define H_NOT_ENOUGH_RESOURCES -44
+#define H_R_STATE -45
+#define H_RESCINDEND -46
+
/* Long Busy is a condition that can be returned by the firmware
* when a call cannot be completed now, but the identical call
@@ -65,6 +99,9 @@
#define H_DABRX_KERNEL (1UL<<(63-62))
#define H_DABRX_USER (1UL<<(63-63))
+/* Each control block has to be on a 4K bondary */
+#define H_CB_ALIGNMENT 4096
+
/* pSeries hypervisor opcodes */
#define H_REMOVE 0x04
#define H_ENTER 0x08
@@ -116,6 +153,33 @@
#define H_VTERM_PARTNER_INFO 0x150
#define H_REGISTER_VTERM 0x154
#define H_FREE_VTERM 0x158
+#define H_RESET_EVENTS 0x15C
+#define H_ALLOC_RESOURCE 0x160
+#define H_FREE_RESOURCE 0x164
+#define H_MODIFY_QP 0x168
+#define H_QUERY_QP 0x16C
+#define H_REREGISTER_PMR 0x170
+#define H_REGISTER_SMR 0x174
+#define H_QUERY_MR 0x178
+#define H_QUERY_MW 0x17C
+#define H_QUERY_HCA 0x180
+#define H_QUERY_PORT 0x184
+#define H_MODIFY_PORT 0x188
+#define H_DEFINE_AQP1 0x18C
+#define H_GET_TRACE_BUFFER 0x190
+#define H_DEFINE_AQP0 0x194
+#define H_RESIZE_MR 0x198
+#define H_ATTACH_MCQP 0x19C
+#define H_DETACH_MCQP 0x1A0
+#define H_CREATE_RPT 0x1A4
+#define H_REMOVE_RPT 0x1A8
+#define H_REGISTER_RPAGES 0x1AC
+#define H_DISABLE_AND_GETC 0x1B0
+#define H_ERROR_DATA 0x1B4
+#define H_GET_HCA_INFO 0x1B8
+#define H_GET_PERF_COUNT 0x1BC
+#define H_MANAGE_TRACE 0x1C0
+#define H_QUERY_INT_STATE 0x1E4
#define H_POLL_PENDING 0x1D8
#define H_JOIN 0x298
#define H_ENABLE_CRQ 0x2B0
@@ -175,6 +239,42 @@ long plpar_hcall_4out(unsigned long opco
unsigned long *out3,
unsigned long *out4);
+long plpar_hcall_7arg_7ret(unsigned long opcode,
+ unsigned long arg1,
+ unsigned long arg2,
+ unsigned long arg3,
+ unsigned long arg4,
+ unsigned long arg5,
+ unsigned long arg6,
+ unsigned long arg7,
+ unsigned long *out1,
+ unsigned long *out2,
+ unsigned long *out3,
+ unsigned long *out4,
+ unsigned long *out5,
+ unsigned long *out6,
+ unsigned long *out7);
+
+long plpar_hcall_9arg_9ret(unsigned long opcode,
+ unsigned long arg1,
+ unsigned long arg2,
+ unsigned long arg3,
+ unsigned long arg4,
+ unsigned long arg5,
+ unsigned long arg6,
+ unsigned long arg7,
+ unsigned long arg8,
+ unsigned long arg9,
+ unsigned long *out1,
+ unsigned long *out2,
+ unsigned long *out3,
+ unsigned long *out4,
+ unsigned long *out5,
+ unsigned long *out6,
+ unsigned long *out7,
+ unsigned long *out8,
+ unsigned long *out9);
+
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_HVCALL_H */
[-- Attachment #2: ib_hcalls-2616-git14.patch --]
[-- Type: text/x-patch, Size: 8857 bytes --]
diff -Nurpw linux-2.6.16-git14/arch/powerpc/platforms/pseries/hvCall.S linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/hvCall.S
--- linux-2.6.16-git14/arch/powerpc/platforms/pseries/hvCall.S 2006-03-28 14:18:52.389031144 +0200
+++ linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/hvCall.S 2006-03-28 14:20:47.800056224 +0200
@@ -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 */
diff -Nurpw linux-2.6.16-git14/arch/powerpc/platforms/pseries/lpar.c linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/lpar.c
--- linux-2.6.16-git14/arch/powerpc/platforms/pseries/lpar.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-git14-ib/arch/powerpc/platforms/pseries/lpar.c 2006-03-28 14:20:47.801056072 +0200
@@ -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);
diff -Nurpw linux-2.6.16-git14/include/asm-powerpc/hvcall.h linux-2.6.16-git14-ib/include/asm-powerpc/hvcall.h
--- linux-2.6.16-git14/include/asm-powerpc/hvcall.h 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-git14-ib/include/asm-powerpc/hvcall.h 2006-03-28 14:20:47.799056376 +0200
@@ -7,8 +7,12 @@
#define H_Success 0
#define H_Busy 1 /* Hardware busy -- retry later */
#define H_Closed 2 /* Resource closed */
+#define H_NOT_AVAILABLE 3
#define H_Constrained 4 /* Resource request constrained to max allowed */
+#define H_PARTIAL 5
#define H_InProgress 14 /* Kind of like busy */
+#define H_PARTIAL_STORE 16
+#define H_PAGE_REGISTERED 15
#define H_Continue 18 /* Returned from H_Join on success */
#define H_LongBusyStartRange 9900 /* Start of long busy range */
#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */
@@ -34,6 +38,36 @@
#define H_DestParm -14
#define H_RemoteParm -15
#define H_Resource -16
+#define H_ADAPTER_PARM -17
+#define H_RH_PARM -18
+#define H_RCQ_PARM -19
+#define H_SCQ_PARM -20
+#define H_EQ_PARM -21
+#define H_RT_PARM -22
+#define H_ST_PARM -23
+#define H_SIGT_PARM -24
+#define H_TOKEN_PARM -25
+#define H_MLENGTH_PARM -27
+#define H_MEM_PARM -28
+#define H_MEM_ACCESS_PARM -29
+#define H_ATTR_PARM -30
+#define H_PORT_PARM -31
+#define H_MCG_PARM -32
+#define H_VL_PARM -33
+#define H_TSIZE_PARM -34
+#define H_TRACE_PARM -35
+
+#define H_MASK_PARM -37
+#define H_MCG_FULL -38
+#define H_ALIAS_EXIST -39
+#define H_P_COUNTER -40
+#define H_TABLE_FULL -41
+#define H_ALT_TABLE -42
+#define H_MR_CONDITION -43
+#define H_NOT_ENOUGH_RESOURCES -44
+#define H_R_STATE -45
+#define H_RESCINDEND -46
+
/* Long Busy is a condition that can be returned by the firmware
* when a call cannot be completed now, but the identical call
@@ -65,6 +99,9 @@
#define H_DABRX_KERNEL (1UL<<(63-62))
#define H_DABRX_USER (1UL<<(63-63))
+/* Each control block has to be on a 4K bondary */
+#define H_CB_ALIGNMENT 4096
+
/* pSeries hypervisor opcodes */
#define H_REMOVE 0x04
#define H_ENTER 0x08
@@ -116,6 +153,33 @@
#define H_VTERM_PARTNER_INFO 0x150
#define H_REGISTER_VTERM 0x154
#define H_FREE_VTERM 0x158
+#define H_RESET_EVENTS 0x15C
+#define H_ALLOC_RESOURCE 0x160
+#define H_FREE_RESOURCE 0x164
+#define H_MODIFY_QP 0x168
+#define H_QUERY_QP 0x16C
+#define H_REREGISTER_PMR 0x170
+#define H_REGISTER_SMR 0x174
+#define H_QUERY_MR 0x178
+#define H_QUERY_MW 0x17C
+#define H_QUERY_HCA 0x180
+#define H_QUERY_PORT 0x184
+#define H_MODIFY_PORT 0x188
+#define H_DEFINE_AQP1 0x18C
+#define H_GET_TRACE_BUFFER 0x190
+#define H_DEFINE_AQP0 0x194
+#define H_RESIZE_MR 0x198
+#define H_ATTACH_MCQP 0x19C
+#define H_DETACH_MCQP 0x1A0
+#define H_CREATE_RPT 0x1A4
+#define H_REMOVE_RPT 0x1A8
+#define H_REGISTER_RPAGES 0x1AC
+#define H_DISABLE_AND_GETC 0x1B0
+#define H_ERROR_DATA 0x1B4
+#define H_GET_HCA_INFO 0x1B8
+#define H_GET_PERF_COUNT 0x1BC
+#define H_MANAGE_TRACE 0x1C0
+#define H_QUERY_INT_STATE 0x1E4
#define H_POLL_PENDING 0x1D8
#define H_JOIN 0x298
#define H_ENABLE_CRQ 0x2B0
@@ -175,6 +239,42 @@ long plpar_hcall_4out(unsigned long opco
unsigned long *out3,
unsigned long *out4);
+long plpar_hcall_7arg_7ret(unsigned long opcode,
+ unsigned long arg1,
+ unsigned long arg2,
+ unsigned long arg3,
+ unsigned long arg4,
+ unsigned long arg5,
+ unsigned long arg6,
+ unsigned long arg7,
+ unsigned long *out1,
+ unsigned long *out2,
+ unsigned long *out3,
+ unsigned long *out4,
+ unsigned long *out5,
+ unsigned long *out6,
+ unsigned long *out7);
+
+long plpar_hcall_9arg_9ret(unsigned long opcode,
+ unsigned long arg1,
+ unsigned long arg2,
+ unsigned long arg3,
+ unsigned long arg4,
+ unsigned long arg5,
+ unsigned long arg6,
+ unsigned long arg7,
+ unsigned long arg8,
+ unsigned long arg9,
+ unsigned long *out1,
+ unsigned long *out2,
+ unsigned long *out3,
+ unsigned long *out4,
+ unsigned long *out5,
+ unsigned long *out6,
+ unsigned long *out7,
+ unsigned long *out8,
+ unsigned long *out9);
+
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_HVCALL_H */
^ permalink raw reply
* Re: snd-aoa: new apple sound driver
From: Johannes Berg @ 2006-03-29 13:11 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, debian-powerpc, Alastair Poole
In-Reply-To: <1143589234.2284.63.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 5568 bytes --]
On Wed, 2006-03-29 at 10:40 +1100, Benjamin Herrenschmidt wrote:
> The GPIO stuff is a bit can-of-worms-ish ... we need at least 2
> different implementations for machines using "old style" direct GPIO
> access and machines using platform functions. So we may need a gpio
> "driver" with 2 instances there.
Yeah, was thinking like that too.
> I think we need to hook that with the input/output net... basically we
> just say things like mute/unmute(id) and the gpio "layer" sort of
> matches the input/output "id" with whatever gpios it has at hand. That's
> also why I think your input/output IDs should have separate entries for
> combo connectors vs. analog line out (at least you used not to, I
> haven't looked at the latest code).
Note sure what you mean here...
> Then, the core would get events from interrupts (or clock switches from
> the codecs) via a yet-to-be-defined call and would react by calling the
> various mute/unmutes accordingly for available inputs and outputs on the
> bus where the event occured.
Ah but you see, the codec actually "mutes" the digital output when it
isn't usable, and the codec also mutes the analog output when we
transfer compressed data. We don't amp-mute in that case, but just from
the codec, so no analog audio is even leaving the codec.
> For things like headphone/speaker automute, I think we need a kind of
> tristate.. either that, or we need a bit mask of mute conditions. When
> any of them is set, it's muted. That way, the "user" mute control sticks
> regardless of the automute action or temporary mute to analog outputs
> because, for example, the digital input lost its clock and we are
> switching (we need to mute to avoid "clics").
Yeah. I have to think a bit about an in-snd-aoa api for all this.
> Hrm... So my feature calls are doing too much at once... (they both do
> the clocks and the cell enable). I don't do clock refcounting like Apple
> does tho, thus the main clock sources are always enabled. So I think all
> you have to do is toggle the I2Sn_CLK_ENABLE bits ...
Hmm. How do I get at those bits? Clock refcounting would be nice too,
along with proper power save management...
> Can you verify if all machines that have digital inputs (thus all
> machines for which you may need to do that kind of clock switching) also
> have working platform functions for doing so ? If they do, then it's
> really just a matter of calling those. If not, then we can either
> ioremap the FCR's in the driver and play with them (evil solution +
> possibly locking problems) or add a feature call.
The former isn't feasible since I need to do clock switching even on
analog-only machines to support more sample rates than the 44.1 KHz that
the firmware sets for the boing sound :)
> In the later case, you add a feature call in pmac_feature.h and the
> appropriate entry in the table in feature.c and then you can toggle bits
> as you wish with appropriate locking (look at eixsting code in there). I
> can give you more details on irc if you need.
Ok. I definitely need more details I think.
> But it would be nice if it could all be done with platform functions
> instead.
Hardly possible though, see above.
> > Modalias situtation. I played some tricks: i2sbus depends on soundbus
> Yeah :) There might be some issue with the macio automatching from
> userland, not sure yet, could just be missing bits in hotplug scripts.
macio automatching is working, i2sbus loads, but the latter modules
don't. I guess there's a userland issue in that it doesn't pick up new
devices that are added to /sys while it is loading another module.
> > Recording. There's code to record sound, but it doesn't do anything on
> > my machine. I have no idea why.
>
> What machine ? The quad ? maybe you need some gpio manipulation or maybe
> you just didn't get something right in onyx ... I'll try later.
Yeah the quad. I was thinking that no matter what, I should at least be
recording silence, but my userland app (arecord) doesn't get *any* data
at all. It's like the dbdma controller isn't doing anything.
> - macio_device gets the suspend resume event. That is, the i2s busses
> basically. That code should forward to all attaches sub-busses which
> then dispatch to codecs.
right.
> - ordering of things should be: mute all, stop alsa, stop codecs
> (enable whatever internal power management mode they may have), stop
> clocks, disable i2s cells.
yeah. It's slightly more complicated unless we assume that the control
interface (i2c) is always available, because we'd also get power
management through the i2c device stuff.
> I'll play with adapting the whole stuff to older machines, I have plenty
> of those :) We also need to implement a davbus module, so make sure you
> don't have too much i2s-related assumptions in your core.. No timeframe
> for that though, I'm fairly busy with other things at the moment
I don't think there are any i2s assumptions. Well, except that on any
given soundbus_dev, you have at most one input and one output stream...
> It's also a complicated thing because of the need to deal with old
> machines and the need to coordinate properly & serialize... things like
> interrupts or events from the codec should, if possible, use alsa hidden
> controls or whatever other ways to properly serialize, if possible, be
> run at task level (from a work queue) and things like that (due to the
> need for delays etc...
Good points.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
^ permalink raw reply
* Re: snd-aoa: new apple sound driver
From: Johannes Berg @ 2006-03-29 13:00 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, debian-powerpc, Alastair Poole
In-Reply-To: <1143604878.3585.5.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 860 bytes --]
On Wed, 2006-03-29 at 15:01 +1100, Benjamin Herrenschmidt wrote:
> BTW.. with the current stuff, if I install the modules and then do
>
> modprobe i2sbus
>
> I get a registration error in dmesg.
Hmm. What's the error? Can't reproduce this at all. Also, what machine?
It works fine on my powermac, even when i2sbus is auto-loaded due to
binding to the macio i2s device alias.
> If I then try to rmmod it, the
> machine blows up. Haven't had time to track that down at this point.
That sucks.
> Appart from that, it works and I can play morse with myh SPID output :)
Heh yeah, we did that too :)
> Oh, and jackd seems to be unhappy even if I tell it to ignore the
> capture channels, it's probably a problem with setting the sample
> formats, I haven't looked in detail (yet).
Hmm. I'll try to see what jackd does.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
^ permalink raw reply
* [PATCH] PowerMac11,2 i2c-bus@0 duplicate dev-tree workaround
From: Johannes Berg @ 2006-03-29 11:30 UTC (permalink / raw)
To: linuxppc-dev
On a PowerMac11,2, there are two i2c-bus@0 nodes of which only the first
is correct. This patch makes the device tree unflattening code ignore
the second one on those machines.
Signed-Off-By: Johannes Berg <johannes@sipsolutions.net>
---
I'm not sure this is the right way to do it. Maybe we should have some
'dev-tree quirks fixer' that makes a third pass through the device tree
after the allnodes chain has been set up, and fixes it up. On the other
hand, as long as there aren't too many workarounds, this works fine.
The patch looks longer than it is because some code changed indentation
level.
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -624,6 +624,11 @@ static void *__init unflatten_dt_alloc(u
return res;
}
+/* PowerMac11,2 has a bug in the device tree where
+ * an i2c-bus@0 shows up twice. We ignore the second
+ * one since it is the bogus one */
+static __initdata int powermac_i2c_bus_0_workaround = 0;
+
static unsigned long __init unflatten_dt_node(unsigned long mem,
unsigned long *p,
struct device_node *dad,
@@ -695,17 +700,31 @@ static unsigned long __init unflatten_dt
memcpy(p, pathp, l);
} else
memcpy(np->full_name, pathp, l);
+ DBG("node %s found\n", np->full_name);
prev_pp = &np->properties;
- **allnextpp = np;
- *allnextpp = &np->allnext;
- if (dad != NULL) {
- np->parent = dad;
- /* we temporarily use the next field as `last_child'*/
- if (dad->next == 0)
- dad->child = np;
- else
- dad->next->sibling = np;
- dad->next = np;
+ /* so if the workaround is in effect, and we have the right
+ * node found, we increase the workaround count (we use the
+ * same variable) and then set allnextpp to NULL on the second
+ * one around so the node isn't added to the allnodes list */
+ if (powermac_i2c_bus_0_workaround &&
+ strcmp(np->full_name,
+ "/ht@0,f2000000/pci@8/mac-io@7/i2c@18000/i2c-bus@0") == 0) {
+ powermac_i2c_bus_0_workaround++;
+ if (powermac_i2c_bus_0_workaround == 3)
+ allnextpp = NULL;
+ }
+ if (allnextpp) {
+ **allnextpp = np;
+ *allnextpp = &np->allnext;
+ if (dad != NULL) {
+ np->parent = dad;
+ /* we temporarily use the next field as `last_child'*/
+ if (dad->next == 0)
+ dad->child = np;
+ else
+ dad->next->sibling = np;
+ dad->next = np;
+ }
}
kref_init(&np->kref);
}
@@ -745,6 +764,14 @@ static unsigned long __init unflatten_dt
}
if (strcmp(pname, "ibm,phandle") == 0)
np->linux_phandle = *((u32 *)*p);
+ /* we check the root node's compatible property
+ * to see if we need to start the powermac i2c
+ * workaround */
+ if ((pathp[0] == '\0') &&
+ (strcmp(pname, "compatible") == 0) &&
+ (strncmp((char*)*p, "PowerMac11,2", sz) == 0)) {
+ powermac_i2c_bus_0_workaround = 1;
+ }
pp->name = pname;
pp->length = sz;
pp->value = (void *)*p;
^ permalink raw reply
* Re: linux-2.6-rt patch on ppc85xx and OOM messages
From: emre kara @ 2006-03-29 10:14 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <77C1FC46-AF49-4807-9AC4-C3DC448F79BF@kernel.crashing.org>
The OOM messages disappeared but the ethernet
throughput decreased significantly (90MBit for
1518Byte packet, and throughput without the patch is
about 900Bits) and the system can't manage load
balancing between to interfaces,the system acts like
the priorty of tsec0 is higher then tsec1 because of
this, the heavy load on tsec0 blocks packet receiving
on tsec1.
--- Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Mar 29, 2006, at 12:45 AM, emre kara wrote:
>
> > Dear All,
> > Is Ingo Molnar's realtime-preempt patch compatible
> > with ppc, or is there any work on a porting effort
> of
> > this patch ? I have made some tests on a 85xx
> machine
> > with this patch, under heavy load on ethernet
> > interfaces, thw system prints OOM messages on
> console
> > and hangs..
> > Thanks.
>
> Can you try setting the gfar interrupts to
> SA_INTERRUPT and see what
> happens.
>
> - k
>
> > --------------------------console output-----
> > softirq-net-rx/: page allocation failure. order:0,
> > mode:0x20
> > Call Trace:
> > [C04E3DB0] [C000A60C] show_stack+0x50/0x188
> > (unreliable)
> > [C04E3DE0] [C004C3EC] __alloc_pages+0x1c8/0x2a4
> > [C04E3E30] [C0063C90]
> cache_alloc_refill+0x35c/0x57c
> > [C04E3E80] [C0063FA4] __kmalloc+0xf4/0xfc
> > [C04E3EB0] [C012D460] __alloc_skb+0x58/0x118
> > [C04E3ED0] [C011AF20] gfar_new_skb+0x40/0xd4
> > [C04E3EF0] [C011D320]
> gfar_clean_rx_ring+0x25c/0x634
> > [C04E3F30] [C011D72C] gfar_poll+0x34/0x140
> > [C04E3F50] [C013364C] net_rx_action+0x94/0x188
> > [C04E3F80] [C0026730] ksoftirqd+0x104/0x1b4
> > [C04E3FC0] [C003779C] kthread+0xf8/0x100
> > [C04E3FF0] [C0004DB8] kernel_thread+0x44/0x60
> > Mem-info:
> > DMA per-cpu:
> > cpu 0 hot: high 90, batch 15 used:0
> > cpu 0 cold: high 30, batch 7 used:0
> > DMA32 per-cpu: empty
> > Normal per-cpu: empty
> > HighMem per-cpu: empty
> > Free pages: 768kB (0kB HighMem)
> > Active:1650 inactive:2036 dirty:0 writeback:0
> > unstable:0 free:192
> > slab:60106 mapped:764 pagetables:29
> > DMA free:768kB min:2048kB low:2560kB high:3072kB
> > active:6600kB
> > inactive:8144kB present:262144kB pages_scanned:0
> > all_unreclaimab
> > le? no
> > lowmem_reserve[]: 0 0 0 0
> > DMA32 free:0kB min:0kB low:0kB high:0kB active:0kB
> > inactive:0kB
> > present:0kB pages_scanned:0 all_unreclaimable? no
> > lowmem_reserve[]: 0 0 0 0
> > Normal free:0kB min:0kB low:0kB high:0kB
> active:0kB
> > inactive:0kB
> > present:0kB pages_scanned:0 all_unreclaimable? no
> > lowmem_reserve[]: 0 0 0 0
> > HighMem free:0kB min:128kB low:128kB high:128kB
> > active:0kB
> > inactive:0kB present:0kB pages_scanned:0
> > all_unreclaimable? no
> > lowmem_reserve[]: 0 0 0 0
> > DMA: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB
> 1*256kB
> > 1*512kB 0*1024kB
> > 0*2048kB 0*4096kB = 768kB
> > DMA32: empty
> > Normal: empty
> > HighMem: empty
> > Swap cache: add 0, delete 0, find 0/0, race 0+0
> > Free swap = 0kB
> > Total swap = 0kB
> > Free swap: 0kB
> > 65536 pages of RAM
> > 0 pages of HIGHMEM
> > 662 free pages
> > 1180 reserved pages
> > 1249 pages shared
> > 0 pages swap cached
> > printk: 2159030 messages suppressed.
> >
> >
> >
> >
> >
>
___________________________________________________________
> > Yahoo! Photos NEW, now offering a quality print
> service from just
> > 8p a photo http://uk.photos.yahoo.com
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
>
___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
^ permalink raw reply
* "lseek/write char driver" versus "usermode iomem access"
From: Josef Angermeier @ 2006-03-29 8:22 UTC (permalink / raw)
To: linuxppc-embedded
Hello,
besides adapting linux to my custom board, i now have to write a driver
for a special device. This device mainly consists of an up to 512 bytes
big IO memory. Because performance matters alot, i wonder if i shall
write a simple char driver offering a write/lseek-interface to access
this memory or if i shall do something new to me, mapping the IO-memory
to the userspace, so that the user-program can directly access the
device memory. Can anyone tell me how performance probably differs
between those two design.
Thanks, you probably save me alot of time to tryout!
Josef
^ permalink raw reply
* Re: linux-2.6-rt patch on ppc and OOM messages
From: Kumar Gala @ 2006-03-29 7:39 UTC (permalink / raw)
To: emre kara; +Cc: linuxppc-dev
In-Reply-To: <20060329064551.29548.qmail@web25913.mail.ukl.yahoo.com>
On Mar 29, 2006, at 12:45 AM, emre kara wrote:
> Dear All,
> Is Ingo Molnar's realtime-preempt patch compatible
> with ppc, or is there any work on a porting effort of
> this patch ? I have made some tests on a 85xx machine
> with this patch, under heavy load on ethernet
> interfaces, thw system prints OOM messages on console
> and hangs..
> Thanks.
Can you try setting the gfar interrupts to SA_INTERRUPT and see what =20
happens.
- k
> --------------------------console output-----
> softirq-net-rx/: page allocation failure. order:0,
> mode:0x20
> Call Trace:
> [C04E3DB0] [C000A60C] show_stack+0x50/0x188
> (unreliable)
> [C04E3DE0] [C004C3EC] __alloc_pages+0x1c8/0x2a4
> [C04E3E30] [C0063C90] cache_alloc_refill+0x35c/0x57c
> [C04E3E80] [C0063FA4] __kmalloc+0xf4/0xfc
> [C04E3EB0] [C012D460] __alloc_skb+0x58/0x118
> [C04E3ED0] [C011AF20] gfar_new_skb+0x40/0xd4
> [C04E3EF0] [C011D320] gfar_clean_rx_ring+0x25c/0x634
> [C04E3F30] [C011D72C] gfar_poll+0x34/0x140
> [C04E3F50] [C013364C] net_rx_action+0x94/0x188
> [C04E3F80] [C0026730] ksoftirqd+0x104/0x1b4
> [C04E3FC0] [C003779C] kthread+0xf8/0x100
> [C04E3FF0] [C0004DB8] kernel_thread+0x44/0x60
> Mem-info:
> DMA per-cpu:
> cpu 0 hot: high 90, batch 15 used:0
> cpu 0 cold: high 30, batch 7 used:0
> DMA32 per-cpu: empty
> Normal per-cpu: empty
> HighMem per-cpu: empty
> Free pages: 768kB (0kB HighMem)
> Active:1650 inactive:2036 dirty:0 writeback:0
> unstable:0 free:192
> slab:60106 mapped:764 pagetables:29
> DMA free:768kB min:2048kB low:2560kB high:3072kB
> active:6600kB
> inactive:8144kB present:262144kB pages_scanned:0
> all_unreclaimab
> le? no
> lowmem_reserve[]: 0 0 0 0
> DMA32 free:0kB min:0kB low:0kB high:0kB active:0kB
> inactive:0kB
> present:0kB pages_scanned:0 all_unreclaimable? no
> lowmem_reserve[]: 0 0 0 0
> Normal free:0kB min:0kB low:0kB high:0kB active:0kB
> inactive:0kB
> present:0kB pages_scanned:0 all_unreclaimable? no
> lowmem_reserve[]: 0 0 0 0
> HighMem free:0kB min:128kB low:128kB high:128kB
> active:0kB
> inactive:0kB present:0kB pages_scanned:0
> all_unreclaimable? no
> lowmem_reserve[]: 0 0 0 0
> DMA: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 1*256kB
> 1*512kB 0*1024kB
> 0*2048kB 0*4096kB =3D 768kB
> DMA32: empty
> Normal: empty
> HighMem: empty
> Swap cache: add 0, delete 0, find 0/0, race 0+0
> Free swap =3D 0kB
> Total swap =3D 0kB
> Free swap: 0kB
> 65536 pages of RAM
> 0 pages of HIGHMEM
> 662 free pages
> 1180 reserved pages
> 1249 pages shared
> 0 pages swap cached
> printk: 2159030 messages suppressed.
>
>
>
> =09
> ___________________________________________________________
> Yahoo! Photos =96 NEW, now offering a quality print service from just =20=
> 8p a photo http://uk.photos.yahoo.com
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* linux-2.6-rt patch on ppc and OOM messages
From: emre kara @ 2006-03-29 6:45 UTC (permalink / raw)
To: linuxppc-dev
Dear All,
Is Ingo Molnar's realtime-preempt patch compatible
with ppc, or is there any work on a porting effort of
this patch ? I have made some tests on a 85xx machine
with this patch, under heavy load on ethernet
interfaces, thw system prints OOM messages on console
and hangs..
Thanks.
--------------------------console output-----
softirq-net-rx/: page allocation failure. order:0,
mode:0x20
Call Trace:
[C04E3DB0] [C000A60C] show_stack+0x50/0x188
(unreliable)
[C04E3DE0] [C004C3EC] __alloc_pages+0x1c8/0x2a4
[C04E3E30] [C0063C90] cache_alloc_refill+0x35c/0x57c
[C04E3E80] [C0063FA4] __kmalloc+0xf4/0xfc
[C04E3EB0] [C012D460] __alloc_skb+0x58/0x118
[C04E3ED0] [C011AF20] gfar_new_skb+0x40/0xd4
[C04E3EF0] [C011D320] gfar_clean_rx_ring+0x25c/0x634
[C04E3F30] [C011D72C] gfar_poll+0x34/0x140
[C04E3F50] [C013364C] net_rx_action+0x94/0x188
[C04E3F80] [C0026730] ksoftirqd+0x104/0x1b4
[C04E3FC0] [C003779C] kthread+0xf8/0x100
[C04E3FF0] [C0004DB8] kernel_thread+0x44/0x60
Mem-info:
DMA per-cpu:
cpu 0 hot: high 90, batch 15 used:0
cpu 0 cold: high 30, batch 7 used:0
DMA32 per-cpu: empty
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages: 768kB (0kB HighMem)
Active:1650 inactive:2036 dirty:0 writeback:0
unstable:0 free:192
slab:60106 mapped:764 pagetables:29
DMA free:768kB min:2048kB low:2560kB high:3072kB
active:6600kB
inactive:8144kB present:262144kB pages_scanned:0
all_unreclaimab
le? no
lowmem_reserve[]: 0 0 0 0
DMA32 free:0kB min:0kB low:0kB high:0kB active:0kB
inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB
inactive:0kB
present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
HighMem free:0kB min:128kB low:128kB high:128kB
active:0kB
inactive:0kB present:0kB pages_scanned:0
all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
DMA: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 1*256kB
1*512kB 0*1024kB
0*2048kB 0*4096kB = 768kB
DMA32: empty
Normal: empty
HighMem: empty
Swap cache: add 0, delete 0, find 0/0, race 0+0
Free swap = 0kB
Total swap = 0kB
Free swap: 0kB
65536 pages of RAM
0 pages of HIGHMEM
662 free pages
1180 reserved pages
1249 pages shared
0 pages swap cached
printk: 2159030 messages suppressed.
___________________________________________________________
Yahoo! Photos NEW, now offering a quality print service from just 8p a photo http://uk.photos.yahoo.com
^ permalink raw reply
* Re: [OT] ppc64 serialization problem
From: Benjamin Herrenschmidt @ 2006-03-29 4:21 UTC (permalink / raw)
To: Greg Smith; +Cc: linuxppc-dev
In-Reply-To: <1143605294.3075.87.camel@localhost.localdomain>
On Tue, 2006-03-28 at 23:08 -0500, Greg Smith wrote:
> Very fair questions!!
>
> Actually the code was
>
> pthread_mutex_lock(&lock);
> u32 |= bitB;
> TRACE("A", u32, ...);
> TRACE("B", u32, ...);
> pthread_mutex_unlock(&lock);
>
> where TRACE is a function call (entering a trace entry to an in-storage
> wrap-around table). So for the "A" call, u32 could have come directly
> from a register and for "B" from the storage location. I'll have the
> user (actually a fellow developer) send me the assembly listing to make
> sure.
Could you try to make a small program that reproduces the problem
instead ?
> He has tested SLES9 (kernel 2.6.5, glibc 2.3.3, gcc 3.3.3) and Debian
> (kernel 2.6.16, glibc 2.3.6, gcc 4.0.3).
>
> The TRACE occurs while the lock is held.
>
> Now the interesting part.
>
> I suggested he try u64 instead of u32. That works!!
>
> He is suspecting a recent firmware upgrade may have something to do with
> the problem.
I doubt it, but I need more informations.
> Thank you,
> Greg Smith
>
> On Wed, 2006-03-29 at 14:11 +1100, Benjamin Herrenschmidt wrote:
> > On Tue, 2006-03-28 at 20:58 -0500, Greg Smith wrote:
> > > We have a multi-threaded app running on a p520 in 64 bit mode.
> > >
> > > Thread A does
> > >
> > > pthread_mutex_lock(&lock);
> > > u32 &= ~bitA;
> > > pthread_mutex_unlock(&lock);
> > >
> > > and Thread B does
> > >
> > > pthread_mutex_lock(&lock);
> > > u32 |= bitB;
> > > A = u32;
> > > B = u32;
> > > pthread_mutex_unlock(&lock);
> > >
> > > On rare occasions, values A and B will differ! In the examples that I
> > > have seen, there is contention with `lock'. This phenomenon does not
> > > occur on ppc32 or a number of other architectures that we support.
> >
> > How did you actually "look" at A and B ? is that also protected by the
> > lock ?
> >
> > > I confess I do not know the linux version nor the glibc version nor what
> > > pthreads implementation is being used. I'll find that out shortly.
> >
> > That's fairly important to know those yes.
> >
> > > What I am curious about is where the problem might lie
> > > (kernel/lib/pthreads/app) so I can ask the right people.
> > >
> > > Thank you for your patience,
> > > Greg Smith
>
^ permalink raw reply
* please pull powerpc.git
From: Paul Mackerras @ 2006-03-29 4:15 UTC (permalink / raw)
To: torvalds; +Cc: linuxppc-dev
Linus,
Please do a pull from
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git
to get another batch of powerpc updates.
Thanks,
Paul.
Andrew Morton:
powerpc: hot_add_scn_to_nid() build fix
git-powerpc: WARN was a dumb idea
Anton Blanchard:
powerpc: Allow non zero boot cpuids
powerpc: Consistent printing of node id
powerpc: Compile warning in hvcs driver
powerpc: Remove some ifdefs in oprofile_impl.h
powerpc: export validate_sp for oprofile calltrace
powerpc: Fix some initcall return values
powerpc: Add oprofile calltrace support to all powerpc cpus
powerpc: Remove oprofile spinlock backtrace code
Arnd Bergmann:
powerpc: fix cell iommu setup
powerpc: update cell defconfig
powerpc: work around a cell interrupt HW bug
powerpc: declare arch syscalls in <asm/syscalls.h>
spufs: allow SPU code to do syscalls
spufs: implement mfc access for PPE-side DMA
powerpc: fix spider-pic affinity setting
powerpc: use guarded ioremap for cell on-chip mappings
spufs: Fix endless protection fault on LS writes by SPE.
powerpc: add hvc backend for rtas
spufs: fix __init/__exit annotations
Benjamin Herrenschmidt:
powerpc: Kill _machine and hard-coded platform numbers
Brian Rogan:
powerpc: Add oprofile calltrace support
Dirk Herrendoerfer:
spufs: initialize context correctly
Eugene Surovegin:
lock PTE before updating it in 440/BookE page fault handler
Jens Osterkamp:
powerpc: cell interrupt controller updates
John Rose:
powerpc: dynamic probe - use ppc_md.pci_probe_mode()
KAMEZAWA Hiroyuki:
for_each_possible_cpu: powerpc
for_each_possible_cpu: ppc
Kumar Gala:
ppc: fix strncasecmp prototype
powerpc: use memparse() for mem= command line parsing
powerpc: move math-emu over to arch/powerpc
powerpc: Make uImage default build output for MPC8540 ADS
powerpc: remove OCP references
Laurent MEYER:
powerpc: fix incorrect SA_ONSTACK behaviour for 64-bit processes
Linas Vepstas:
powerpc/pseries: Cleanup device name printing.
Mark Nutter:
spufs: enable SPE problem state MMIO access.
Michael Ellerman:
powerpc: Make BUG_ON & WARN_ON play nice with compile-time optimisations
powerpc: Change firmware_has_feature() to a macro
powerpc: Rename and export ppc64_firmware_features
powerpc: Cope with duplicate node & property names in /proc/device-tree
Michael Neuling:
powerpc: legacy_serial loop cleanup
powerpc: HVC init race
Mike Kravetz:
powerpc: Workaround for pSeries RTAS bug
Olaf Hering:
correct the comment about stackpointer alignment in __boot_from_prom
powerpc: return to OF via trap, not exit
Paul Mackerras:
powerpc: Unify the 32 and 64 bit idle loops
powerpc: Simplify pSeries idle loop
powerpc: Move l2cr.S over to arch/powerpc
powerpc: Move cpu_setup_6xx.S and temp.c over to arch/powerpc
powerpc: Move swsusp.S over to arch/powerpc
powerpc: Move module.c over to arch/powerpc
powerpc: Move perfmon_fsl_booke.c over to arch/powerpc
powerpc: Don't compile in arch/ppc/kernel for 32-bit ARCH=powerpc
ppc: Remove duplicate exports of __down, __up etc.
powerpc: Fix event-scan code for 32-bit CHRP
powerpc: Fix goof in 6xx and POWER4 idle power-save functions
ppc: Remove CHRP, POWER3 and POWER4 support from arch/ppc
ppc: Fix compile error in arch/ppc/lib/strcase.c
Ryan S. Arnold:
powerpc: hvc_console updates
Stephen Rothwell:
powerpc: work around sparse warnings in cputable.h
powerpc: fix various sparse warnings
powerpc: make ISA floppies work again
powerpc: a couple of trivial compile warning fixes
Sylvain Munaut:
ppc32: Adds support for the PCI hostbridge in MPC5200B
ppc32: Adds support for the LITE5200B dev board
ppc32: Reorganize and complete MPC52xx initial cpu setup
Documentation/powerpc/booting-without-of.txt | 5
arch/powerpc/Kconfig | 4
arch/powerpc/Kconfig.debug | 5
arch/powerpc/Makefile | 7
arch/powerpc/configs/cell_defconfig | 133 +-
arch/powerpc/configs/mpc8540_ads_defconfig | 43 -
arch/powerpc/kernel/Makefile | 11
arch/powerpc/kernel/asm-offsets.c | 2
arch/powerpc/kernel/cpu_setup_6xx.S | 0
arch/powerpc/kernel/entry_32.S | 8
arch/powerpc/kernel/entry_64.S | 6
arch/powerpc/kernel/firmware.c | 4
arch/powerpc/kernel/head_64.S | 32
arch/powerpc/kernel/idle.c | 122 ++
arch/powerpc/kernel/idle_64.c | 121 --
arch/powerpc/kernel/idle_6xx.S | 18
arch/powerpc/kernel/idle_power4.S | 38 -
arch/powerpc/kernel/irq.c | 2
arch/powerpc/kernel/l2cr_6xx.S | 0
arch/powerpc/kernel/legacy_serial.c | 42 -
arch/powerpc/kernel/lparcfg.c | 4
arch/powerpc/kernel/module_32.c | 0
arch/powerpc/kernel/nvram_64.c | 7
arch/powerpc/kernel/paca.c | 21
arch/powerpc/kernel/pci_32.c | 4
arch/powerpc/kernel/pci_64.c | 1
arch/powerpc/kernel/perfmon_fsl_booke.c | 0
arch/powerpc/kernel/proc_ppc64.c | 3
arch/powerpc/kernel/process.c | 11
arch/powerpc/kernel/prom.c | 154 +-
arch/powerpc/kernel/prom_init.c | 68 +
arch/powerpc/kernel/rtas-proc.c | 2
arch/powerpc/kernel/rtas.c | 8
arch/powerpc/kernel/setup-common.c | 70 +
arch/powerpc/kernel/setup_32.c | 75 -
arch/powerpc/kernel/setup_64.c | 78 -
arch/powerpc/kernel/signal_32.c | 1
arch/powerpc/kernel/signal_64.c | 3
arch/powerpc/kernel/smp.c | 2
arch/powerpc/kernel/swsusp_32.S | 0
arch/powerpc/kernel/syscalls.c | 1
arch/powerpc/kernel/sysfs.c | 12
arch/powerpc/kernel/tau_6xx.c | 0
arch/powerpc/kernel/time.c | 4
arch/powerpc/kernel/traps.c | 35 -
arch/powerpc/kernel/vdso.c | 9
arch/powerpc/kernel/vmlinux.lds.S | 379 +++--
arch/powerpc/lib/sstep.c | 2
arch/powerpc/math-emu/Makefile | 0
arch/powerpc/math-emu/double.h | 0
arch/powerpc/math-emu/fabs.c | 0
arch/powerpc/math-emu/fadd.c | 0
arch/powerpc/math-emu/fadds.c | 0
arch/powerpc/math-emu/fcmpo.c | 0
arch/powerpc/math-emu/fcmpu.c | 0
arch/powerpc/math-emu/fctiw.c | 0
arch/powerpc/math-emu/fctiwz.c | 0
arch/powerpc/math-emu/fdiv.c | 0
arch/powerpc/math-emu/fdivs.c | 0
arch/powerpc/math-emu/fmadd.c | 0
arch/powerpc/math-emu/fmadds.c | 0
arch/powerpc/math-emu/fmr.c | 0
arch/powerpc/math-emu/fmsub.c | 0
arch/powerpc/math-emu/fmsubs.c | 0
arch/powerpc/math-emu/fmul.c | 0
arch/powerpc/math-emu/fmuls.c | 0
arch/powerpc/math-emu/fnabs.c | 0
arch/powerpc/math-emu/fneg.c | 0
arch/powerpc/math-emu/fnmadd.c | 0
arch/powerpc/math-emu/fnmadds.c | 0
arch/powerpc/math-emu/fnmsub.c | 0
arch/powerpc/math-emu/fnmsubs.c | 0
arch/powerpc/math-emu/fres.c | 0
arch/powerpc/math-emu/frsp.c | 0
arch/powerpc/math-emu/frsqrte.c | 0
arch/powerpc/math-emu/fsel.c | 0
arch/powerpc/math-emu/fsqrt.c | 0
arch/powerpc/math-emu/fsqrts.c | 0
arch/powerpc/math-emu/fsub.c | 0
arch/powerpc/math-emu/fsubs.c | 0
arch/powerpc/math-emu/lfd.c | 0
arch/powerpc/math-emu/lfs.c | 0
arch/powerpc/math-emu/math.c | 0
arch/powerpc/math-emu/mcrfs.c | 0
arch/powerpc/math-emu/mffs.c | 0
arch/powerpc/math-emu/mtfsb0.c | 0
arch/powerpc/math-emu/mtfsb1.c | 0
arch/powerpc/math-emu/mtfsf.c | 0
arch/powerpc/math-emu/mtfsfi.c | 0
arch/powerpc/math-emu/op-1.h | 0
arch/powerpc/math-emu/op-2.h | 0
arch/powerpc/math-emu/op-4.h | 0
arch/powerpc/math-emu/op-common.h | 0
arch/powerpc/math-emu/sfp-machine.h | 0
arch/powerpc/math-emu/single.h | 0
arch/powerpc/math-emu/soft-fp.h | 0
arch/powerpc/math-emu/stfd.c | 0
arch/powerpc/math-emu/stfiwx.c | 0
arch/powerpc/math-emu/stfs.c | 0
arch/powerpc/math-emu/types.c | 0
arch/powerpc/math-emu/udivmodti4.c | 0
arch/powerpc/mm/fault.c | 30
arch/powerpc/mm/hash_utils_64.c | 7
arch/powerpc/mm/mem.c | 2
arch/powerpc/mm/numa.c | 2
arch/powerpc/mm/pgtable_32.c | 6
arch/powerpc/mm/stab.c | 2
arch/powerpc/oprofile/Makefile | 2
arch/powerpc/oprofile/backtrace.c | 126 ++
arch/powerpc/oprofile/common.c | 9
arch/powerpc/oprofile/op_model_7450.c | 4
arch/powerpc/oprofile/op_model_fsl_booke.c | 4
arch/powerpc/oprofile/op_model_power4.c | 45 -
arch/powerpc/oprofile/op_model_rs64.c | 5
arch/powerpc/platforms/85xx/Kconfig | 1
arch/powerpc/platforms/cell/Kconfig | 5
arch/powerpc/platforms/cell/Makefile | 10
arch/powerpc/platforms/cell/interrupt.c | 135 ++
arch/powerpc/platforms/cell/interrupt.h | 2
arch/powerpc/platforms/cell/iommu.c | 16
arch/powerpc/platforms/cell/pervasive.c | 4
arch/powerpc/platforms/cell/setup.c | 11
arch/powerpc/platforms/cell/spider-pic.c | 108 +-
arch/powerpc/platforms/cell/spu_base.c | 17
arch/powerpc/platforms/cell/spu_callbacks.c | 345 +++++
arch/powerpc/platforms/cell/spufs/backing_ops.c | 47 +
arch/powerpc/platforms/cell/spufs/context.c | 24
arch/powerpc/platforms/cell/spufs/file.c | 523 +++++++-
arch/powerpc/platforms/cell/spufs/hw_ops.c | 57 +
arch/powerpc/platforms/cell/spufs/inode.c | 6
arch/powerpc/platforms/cell/spufs/run.c | 91 +
arch/powerpc/platforms/cell/spufs/sched.c | 2
arch/powerpc/platforms/cell/spufs/spufs.h | 28
arch/powerpc/platforms/cell/spufs/switch.c | 3
arch/powerpc/platforms/chrp/chrp.h | 2
arch/powerpc/platforms/chrp/setup.c | 77 +
arch/powerpc/platforms/iseries/setup.c | 13
arch/powerpc/platforms/maple/setup.c | 10
arch/powerpc/platforms/powermac/bootx_init.c | 6
arch/powerpc/platforms/powermac/feature.c | 2
arch/powerpc/platforms/powermac/low_i2c.c | 3
arch/powerpc/platforms/powermac/nvram.c | 14
arch/powerpc/platforms/powermac/pci.c | 5
arch/powerpc/platforms/powermac/pfunc_base.c | 2
arch/powerpc/platforms/powermac/setup.c | 74 +
arch/powerpc/platforms/powermac/time.c | 4
arch/powerpc/platforms/powermac/udbg_scc.c | 2
arch/powerpc/platforms/pseries/eeh.c | 2
arch/powerpc/platforms/pseries/eeh_driver.c | 16
arch/powerpc/platforms/pseries/firmware.c | 2
arch/powerpc/platforms/pseries/hvconsole.c | 5
arch/powerpc/platforms/pseries/pci.c | 2
arch/powerpc/platforms/pseries/pci_dlpar.c | 11
arch/powerpc/platforms/pseries/ras.c | 2
arch/powerpc/platforms/pseries/reconfig.c | 5
arch/powerpc/platforms/pseries/rtasd.c | 3
arch/powerpc/platforms/pseries/setup.c | 223 +--
arch/powerpc/platforms/pseries/xics.c | 4
arch/ppc/Kconfig | 93 -
arch/ppc/Kconfig.debug | 7
arch/ppc/Makefile | 6
arch/ppc/boot/Makefile | 7
arch/ppc/boot/openfirmware/Makefile | 109 --
arch/ppc/boot/openfirmware/chrpmain.c | 101 -
arch/ppc/boot/openfirmware/common.c | 146 --
arch/ppc/boot/openfirmware/dummy.c | 4
arch/ppc/boot/openfirmware/misc.S | 67 -
arch/ppc/boot/openfirmware/start.c | 172 --
arch/ppc/boot/simple/mpc10x_memory.c | 4
arch/ppc/boot/simple/relocate.S | 2
arch/ppc/boot/utils/addnote.c | 175 ---
arch/ppc/boot/utils/hack-coff.c | 84 -
arch/ppc/boot/utils/mknote.c | 44 -
arch/ppc/configs/ibmchrp_defconfig | 875 -------------
arch/ppc/configs/pmac_defconfig | 1591 -----------------------
arch/ppc/configs/power3_defconfig | 1035 ---------------
arch/ppc/configs/prep_defconfig | 0
arch/ppc/kernel/Makefile | 28
arch/ppc/kernel/entry.S | 60 -
arch/ppc/kernel/head.S | 183 ---
arch/ppc/kernel/idle.c | 112 --
arch/ppc/kernel/idle_6xx.S | 233 ---
arch/ppc/kernel/idle_power4.S | 91 -
arch/ppc/kernel/pci.c | 396 ------
arch/ppc/kernel/ppc_htab.c | 8
arch/ppc/kernel/ppc_ksyms.c | 26
arch/ppc/kernel/setup.c | 256 ----
arch/ppc/kernel/smp.c | 2
arch/ppc/lib/strcase.c | 3
arch/ppc/mm/fault.c | 30
arch/ppc/mm/hashtable.S | 34
arch/ppc/mm/init.c | 13
arch/ppc/mm/mmu_context.c | 2
arch/ppc/mm/pgtable.c | 8
arch/ppc/mm/ppc_mmu.c | 28
arch/ppc/platforms/Makefile | 12
arch/ppc/platforms/chrp_nvram.c | 83 -
arch/ppc/platforms/chrp_pci.c | 309 ----
arch/ppc/platforms/chrp_pegasos_eth.c | 211 ---
arch/ppc/platforms/chrp_setup.c | 669 ----------
arch/ppc/platforms/chrp_smp.c | 99 -
arch/ppc/platforms/chrp_time.c | 235 ---
arch/ppc/platforms/lite5200.c | 71 +
arch/ppc/platforms/prep_setup.c | 12
arch/ppc/syslib/Makefile | 2
arch/ppc/syslib/mpc52xx_pci.c | 3
arch/ppc/syslib/mpc52xx_setup.c | 48 +
arch/ppc/syslib/open_pic.c | 2
arch/ppc/syslib/prom.c | 1429 ---------------------
arch/ppc/syslib/prom_init.c | 1011 ---------------
arch/ppc/xmon/start.c | 2
drivers/char/Kconfig | 17
drivers/char/Makefile | 4
drivers/char/generic_nvram.c | 5
drivers/char/hvc_console.c | 101 +
drivers/char/hvc_console.h | 63 +
drivers/char/hvc_rtas.c | 138 ++
drivers/char/hvc_vio.c | 11
drivers/char/hvcs.c | 1
drivers/ide/pci/via82cxxx.c | 2
drivers/ide/ppc/pmac.c | 2
drivers/ieee1394/ohci1394.c | 4
drivers/macintosh/adb.c | 3
drivers/macintosh/adbhid.c | 4
drivers/macintosh/mediabay.c | 4
drivers/media/video/planb.c | 2
drivers/net/tulip/de4x5.c | 2
drivers/scsi/mesh.c | 2
drivers/usb/core/hcd-pci.c | 4
drivers/video/aty/aty128fb.c | 7
drivers/video/aty/atyfb_base.c | 7
drivers/video/aty/radeon_pm.c | 4
drivers/video/cirrusfb.c | 4
drivers/video/matrox/matroxfb_base.c | 3
drivers/video/nvidia/nvidia.c | 5
drivers/video/radeonfb.c | 2
drivers/video/riva/fbdev.c | 9
fs/partitions/mac.c | 3
fs/proc/proc_devtree.c | 103 +
include/asm-powerpc/bug.h | 36 -
include/asm-powerpc/cputable.h | 299 ++--
include/asm-powerpc/firmware.h | 10
include/asm-powerpc/floppy.h | 5
include/asm-powerpc/hvcall.h | 1
include/asm-powerpc/hvconsole.h | 26
include/asm-powerpc/machdep.h | 43 -
include/asm-powerpc/oprofile_impl.h | 17
include/asm-powerpc/paca.h | 2
include/asm-powerpc/percpu.h | 2
include/asm-powerpc/pmac_feature.h | 2
include/asm-powerpc/processor.h | 43 -
include/asm-powerpc/prom.h | 14
include/asm-powerpc/reg.h | 4
include/asm-powerpc/smp.h | 2
include/asm-powerpc/spu.h | 11
include/asm-powerpc/syscalls.h | 58 +
include/asm-powerpc/unistd.h | 35 -
include/asm-powerpc/vdso_datapage.h | 3
include/asm-ppc/machdep.h | 17
include/asm-ppc/mpc52xx.h | 4
include/asm-ppc/pgtable.h | 3
include/asm-ppc/prom.h | 156 --
include/asm-ppc/serial.h | 7
include/linux/pci_ids.h | 1
sound/oss/dmasound/dmasound_awacs.c | 2
sound/ppc/pmac.c | 2
266 files changed, 3450 insertions(+), 11829 deletions(-)
rename arch/{ppc/kernel/cpu_setup_6xx.S => powerpc/kernel/cpu_setup_6xx.S} (100%)
create mode 100644 arch/powerpc/kernel/idle.c
delete mode 100644 arch/powerpc/kernel/idle_64.c
rename arch/{ppc/kernel/l2cr.S => powerpc/kernel/l2cr_6xx.S} (100%)
rename arch/{ppc/kernel/module.c => powerpc/kernel/module_32.c} (100%)
rename arch/{ppc/kernel/perfmon_fsl_booke.c => powerpc/kernel/perfmon_fsl_booke.c} (100%)
rename arch/{ppc/kernel/swsusp.S => powerpc/kernel/swsusp_32.S} (100%)
rename arch/{ppc/kernel/temp.c => powerpc/kernel/tau_6xx.c} (100%)
rename arch/{ppc/math-emu/Makefile => powerpc/math-emu/Makefile} (100%)
rename arch/{ppc/math-emu/double.h => powerpc/math-emu/double.h} (100%)
rename arch/{ppc/math-emu/fabs.c => powerpc/math-emu/fabs.c} (100%)
rename arch/{ppc/math-emu/fadd.c => powerpc/math-emu/fadd.c} (100%)
rename arch/{ppc/math-emu/fadds.c => powerpc/math-emu/fadds.c} (100%)
rename arch/{ppc/math-emu/fcmpo.c => powerpc/math-emu/fcmpo.c} (100%)
rename arch/{ppc/math-emu/fcmpu.c => powerpc/math-emu/fcmpu.c} (100%)
rename arch/{ppc/math-emu/fctiw.c => powerpc/math-emu/fctiw.c} (100%)
rename arch/{ppc/math-emu/fctiwz.c => powerpc/math-emu/fctiwz.c} (100%)
rename arch/{ppc/math-emu/fdiv.c => powerpc/math-emu/fdiv.c} (100%)
rename arch/{ppc/math-emu/fdivs.c => powerpc/math-emu/fdivs.c} (100%)
rename arch/{ppc/math-emu/fmadd.c => powerpc/math-emu/fmadd.c} (100%)
rename arch/{ppc/math-emu/fmadds.c => powerpc/math-emu/fmadds.c} (100%)
rename arch/{ppc/math-emu/fmr.c => powerpc/math-emu/fmr.c} (100%)
rename arch/{ppc/math-emu/fmsub.c => powerpc/math-emu/fmsub.c} (100%)
rename arch/{ppc/math-emu/fmsubs.c => powerpc/math-emu/fmsubs.c} (100%)
rename arch/{ppc/math-emu/fmul.c => powerpc/math-emu/fmul.c} (100%)
rename arch/{ppc/math-emu/fmuls.c => powerpc/math-emu/fmuls.c} (100%)
rename arch/{ppc/math-emu/fnabs.c => powerpc/math-emu/fnabs.c} (100%)
rename arch/{ppc/math-emu/fneg.c => powerpc/math-emu/fneg.c} (100%)
rename arch/{ppc/math-emu/fnmadd.c => powerpc/math-emu/fnmadd.c} (100%)
rename arch/{ppc/math-emu/fnmadds.c => powerpc/math-emu/fnmadds.c} (100%)
rename arch/{ppc/math-emu/fnmsub.c => powerpc/math-emu/fnmsub.c} (100%)
rename arch/{ppc/math-emu/fnmsubs.c => powerpc/math-emu/fnmsubs.c} (100%)
rename arch/{ppc/math-emu/fres.c => powerpc/math-emu/fres.c} (100%)
rename arch/{ppc/math-emu/frsp.c => powerpc/math-emu/frsp.c} (100%)
rename arch/{ppc/math-emu/frsqrte.c => powerpc/math-emu/frsqrte.c} (100%)
rename arch/{ppc/math-emu/fsel.c => powerpc/math-emu/fsel.c} (100%)
rename arch/{ppc/math-emu/fsqrt.c => powerpc/math-emu/fsqrt.c} (100%)
rename arch/{ppc/math-emu/fsqrts.c => powerpc/math-emu/fsqrts.c} (100%)
rename arch/{ppc/math-emu/fsub.c => powerpc/math-emu/fsub.c} (100%)
rename arch/{ppc/math-emu/fsubs.c => powerpc/math-emu/fsubs.c} (100%)
rename arch/{ppc/math-emu/lfd.c => powerpc/math-emu/lfd.c} (100%)
rename arch/{ppc/math-emu/lfs.c => powerpc/math-emu/lfs.c} (100%)
rename arch/{ppc/math-emu/math.c => powerpc/math-emu/math.c} (100%)
rename arch/{ppc/math-emu/mcrfs.c => powerpc/math-emu/mcrfs.c} (100%)
rename arch/{ppc/math-emu/mffs.c => powerpc/math-emu/mffs.c} (100%)
rename arch/{ppc/math-emu/mtfsb0.c => powerpc/math-emu/mtfsb0.c} (100%)
rename arch/{ppc/math-emu/mtfsb1.c => powerpc/math-emu/mtfsb1.c} (100%)
rename arch/{ppc/math-emu/mtfsf.c => powerpc/math-emu/mtfsf.c} (100%)
rename arch/{ppc/math-emu/mtfsfi.c => powerpc/math-emu/mtfsfi.c} (100%)
rename arch/{ppc/math-emu/op-1.h => powerpc/math-emu/op-1.h} (100%)
rename arch/{ppc/math-emu/op-2.h => powerpc/math-emu/op-2.h} (100%)
rename arch/{ppc/math-emu/op-4.h => powerpc/math-emu/op-4.h} (100%)
rename arch/{ppc/math-emu/op-common.h => powerpc/math-emu/op-common.h} (100%)
rename arch/{ppc/math-emu/sfp-machine.h => powerpc/math-emu/sfp-machine.h} (100%)
rename arch/{ppc/math-emu/single.h => powerpc/math-emu/single.h} (100%)
rename arch/{ppc/math-emu/soft-fp.h => powerpc/math-emu/soft-fp.h} (100%)
rename arch/{ppc/math-emu/stfd.c => powerpc/math-emu/stfd.c} (100%)
rename arch/{ppc/math-emu/stfiwx.c => powerpc/math-emu/stfiwx.c} (100%)
rename arch/{ppc/math-emu/stfs.c => powerpc/math-emu/stfs.c} (100%)
rename arch/{ppc/math-emu/types.c => powerpc/math-emu/types.c} (100%)
rename arch/{ppc/math-emu/udivmodti4.c => powerpc/math-emu/udivmodti4.c} (100%)
create mode 100644 arch/powerpc/oprofile/backtrace.c
create mode 100644 arch/powerpc/platforms/cell/spu_callbacks.c
delete mode 100644 arch/ppc/boot/openfirmware/Makefile
delete mode 100644 arch/ppc/boot/openfirmware/chrpmain.c
delete mode 100644 arch/ppc/boot/openfirmware/common.c
delete mode 100644 arch/ppc/boot/openfirmware/dummy.c
delete mode 100644 arch/ppc/boot/openfirmware/misc.S
delete mode 100644 arch/ppc/boot/openfirmware/start.c
delete mode 100644 arch/ppc/boot/utils/addnote.c
delete mode 100644 arch/ppc/boot/utils/hack-coff.c
delete mode 100644 arch/ppc/boot/utils/mknote.c
delete mode 100644 arch/ppc/configs/ibmchrp_defconfig
delete mode 100644 arch/ppc/configs/pmac_defconfig
delete mode 100644 arch/ppc/configs/power3_defconfig
rename arch/ppc/configs/{common_defconfig => prep_defconfig} (100%)
delete mode 100644 arch/ppc/kernel/idle.c
delete mode 100644 arch/ppc/kernel/idle_6xx.S
delete mode 100644 arch/ppc/kernel/idle_power4.S
delete mode 100644 arch/ppc/platforms/chrp_nvram.c
delete mode 100644 arch/ppc/platforms/chrp_pci.c
delete mode 100644 arch/ppc/platforms/chrp_pegasos_eth.c
delete mode 100644 arch/ppc/platforms/chrp_setup.c
delete mode 100644 arch/ppc/platforms/chrp_smp.c
delete mode 100644 arch/ppc/platforms/chrp_time.c
delete mode 100644 arch/ppc/syslib/prom.c
delete mode 100644 arch/ppc/syslib/prom_init.c
create mode 100644 drivers/char/hvc_console.h
create mode 100644 drivers/char/hvc_rtas.c
create mode 100644 include/asm-powerpc/syscalls.h
^ permalink raw reply
* Re: [OT] ppc64 serialization problem
From: Greg Smith @ 2006-03-29 4:08 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1143601903.3585.2.camel@localhost.localdomain>
Very fair questions!!
Actually the code was
pthread_mutex_lock(&lock);
u32 |= bitB;
TRACE("A", u32, ...);
TRACE("B", u32, ...);
pthread_mutex_unlock(&lock);
where TRACE is a function call (entering a trace entry to an in-storage
wrap-around table). So for the "A" call, u32 could have come directly
from a register and for "B" from the storage location. I'll have the
user (actually a fellow developer) send me the assembly listing to make
sure.
He has tested SLES9 (kernel 2.6.5, glibc 2.3.3, gcc 3.3.3) and Debian
(kernel 2.6.16, glibc 2.3.6, gcc 4.0.3).
The TRACE occurs while the lock is held.
Now the interesting part.
I suggested he try u64 instead of u32. That works!!
He is suspecting a recent firmware upgrade may have something to do with
the problem.
Thank you,
Greg Smith
On Wed, 2006-03-29 at 14:11 +1100, Benjamin Herrenschmidt wrote:
> On Tue, 2006-03-28 at 20:58 -0500, Greg Smith wrote:
> > We have a multi-threaded app running on a p520 in 64 bit mode.
> >
> > Thread A does
> >
> > pthread_mutex_lock(&lock);
> > u32 &= ~bitA;
> > pthread_mutex_unlock(&lock);
> >
> > and Thread B does
> >
> > pthread_mutex_lock(&lock);
> > u32 |= bitB;
> > A = u32;
> > B = u32;
> > pthread_mutex_unlock(&lock);
> >
> > On rare occasions, values A and B will differ! In the examples that I
> > have seen, there is contention with `lock'. This phenomenon does not
> > occur on ppc32 or a number of other architectures that we support.
>
> How did you actually "look" at A and B ? is that also protected by the
> lock ?
>
> > I confess I do not know the linux version nor the glibc version nor what
> > pthreads implementation is being used. I'll find that out shortly.
>
> That's fairly important to know those yes.
>
> > What I am curious about is where the problem might lie
> > (kernel/lib/pthreads/app) so I can ask the right people.
> >
> > Thank you for your patience,
> > Greg Smith
^ permalink raw reply
* Re: [OT] ppc64 serialization problem
From: Paul Mackerras @ 2006-03-29 4:07 UTC (permalink / raw)
To: Greg Smith; +Cc: linuxppc-dev
In-Reply-To: <1143597506.3075.53.camel@localhost.localdomain>
Greg Smith writes:
> On rare occasions, values A and B will differ! In the examples that I
> have seen, there is contention with `lock'. This phenomenon does not
> occur on ppc32 or a number of other architectures that we support.
I would be interested to see the assembler code being generated for
your code snippets.
Paul.
^ permalink raw reply
* Re: snd-aoa: new apple sound driver
From: Benjamin Herrenschmidt @ 2006-03-29 4:01 UTC (permalink / raw)
To: Johannes Berg; +Cc: linuxppc-dev, debian-powerpc, Alastair Poole
In-Reply-To: <1143547826.13615.24.camel@localhost>
BTW.. with the current stuff, if I install the modules and then do
modprobe i2sbus
I get a registration error in dmesg. If I then try to rmmod it, the
machine blows up. Haven't had time to track that down at this point.
Appart from that, it works and I can play morse with myh SPID output :)
Oh, and jackd seems to be unhappy even if I tell it to ignore the
capture channels, it's probably a problem with setting the sample
formats, I haven't looked in detail (yet).
Ben.
^ permalink raw reply
* Re: [OT] ppc64 serialization problem
From: Benjamin Herrenschmidt @ 2006-03-29 3:11 UTC (permalink / raw)
To: Greg Smith; +Cc: linuxppc-dev
In-Reply-To: <1143597506.3075.53.camel@localhost.localdomain>
On Tue, 2006-03-28 at 20:58 -0500, Greg Smith wrote:
> We have a multi-threaded app running on a p520 in 64 bit mode.
>
> Thread A does
>
> pthread_mutex_lock(&lock);
> u32 &= ~bitA;
> pthread_mutex_unlock(&lock);
>
> and Thread B does
>
> pthread_mutex_lock(&lock);
> u32 |= bitB;
> A = u32;
> B = u32;
> pthread_mutex_unlock(&lock);
>
> On rare occasions, values A and B will differ! In the examples that I
> have seen, there is contention with `lock'. This phenomenon does not
> occur on ppc32 or a number of other architectures that we support.
How did you actually "look" at A and B ? is that also protected by the
lock ?
> I confess I do not know the linux version nor the glibc version nor what
> pthreads implementation is being used. I'll find that out shortly.
That's fairly important to know those yes.
> What I am curious about is where the problem might lie
> (kernel/lib/pthreads/app) so I can ask the right people.
>
> Thank you for your patience,
> Greg Smith
>
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH] DTC - validation by device_type
From: Paul Nasrat @ 2006-03-29 2:33 UTC (permalink / raw)
To: Hollis Blanchard; +Cc: linuxppc-dev, Jon Loeliger
In-Reply-To: <66cc5bfb5a367a814fbace8105572658@penguinppc.org>
On Tue, 2006-03-28 at 20:03 -0600, Hollis Blanchard wrote:
> On Mar 28, 2006, at 4:49 PM, Paul Nasrat wrote:
> >
> > It'd be nice to be able to validate by device_type, to ensure that we
> > don't reinvent the wheel (address vs. local-mac-address) and to give
> > embedded designers an added level of sanity checking.
> >
> > Here is a proposed implementation with an implemented check for
> > "network".
> >
> Unless this is some weird style thing, that close brace seems
> misindented.
No you're not missing anything, both artefacts of how I got there. Take
2.
As above
Signed-off-by: Paul Nasrat <pnasrat@redhat.com>
diff --git a/livetree.c b/livetree.c
index ef54174..bf8bb56 100644
--- a/livetree.c
+++ b/livetree.c
@@ -441,6 +441,51 @@ static int check_structure(struct node *
(propname), (node)->fullpath); \
} while (0)
+static int check_network(struct node *net)
+{
+
+ int ok = 1;
+ struct property *prop;
+
+ CHECK_HAVE(net, "reg");
+ CHECK_HAVE(net, "local-mac-address");
+ CHECK_HAVE(net, "mac-address");
+ CHECK_HAVE(net, "address-bits");
+
+ return ok;
+}
+
+static struct {
+ char *devtype;
+ int (*check_fn)(struct node *node);
+} devtype_checker_table[] = {
+ {"network", check_network},
+};
+
+static int check_devtypes(struct node *root)
+{
+
+ struct node *child;
+ struct property *prop;
+ int ok = 1;
+ int i;
+
+ for_each_child(root, child) {
+ /* check this node */
+ if ((prop = get_property((child), ("device_type"))))
+ for (i = 0; i < ARRAY_SIZE(devtype_checker_table); i++) {
+ if (streq(prop->val.val, devtype_checker_table[i].devtype))
+ if (! devtype_checker_table[i].check_fn(child)) {
+ ok = 0;
+ break;
+ }
+ }
+ ok = check_devtypes(child);
+ }
+
+ return ok;
+}
+
static int check_root(struct node *root)
{
struct property *prop;
@@ -716,6 +761,7 @@ int check_device_tree(struct node *dt)
ok = ok && check_cpus(dt);
ok = ok && check_memory(dt);
ok = ok && check_chosen(dt);
+ ok = ok && check_devtypes(dt);
if (! ok)
return 0;
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox