RE: [PATCH 2.6.13-rc1 07/10] IOCHK interface for I/O error handling/detecting

From: Luck, Tony <tony.luck_at_intel.com>
Date: 2005-07-09 06:17:08
>I don't think this is really safe.  There is nothing to stop the
>compiler from loading the value directly into the out register, which
>would again defer consumption of the value (especially if the caller
>of ia64_mca_barrier() got inlined itself.

I'd thought that the value needs to go to both the "out" register, and
to "r8" to be returned from the function ... but you are right, this
can be by-passed if the function that calls ia64_mca_barrier is itself
inlined.

>In my opinion, it would be safest to write this in assembly, so we're
>_guaranteed_ it will do what we want, no matter how smart the
>compilers get.  Something along the lines of:
>
>ia64_mca_barrier:
>   mov r8 = r32
>   br.ret.sptk.many rp
>
>should do (and I agree that this function needs a comment).

So are you envisioning using it like this?

	val = ia64_mca_barrier(*(type *)ioaddr);

-Tony


-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Fri Jul 8 16:29:35 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:40 EST