Re: shmem_fill_super(): WARNING: kmemcheck: Caught 32-bit readfrom uninitialized memory

From: Pekka Enberg
Date: Mon Sep 21 2009 - 07:07:27 EST


Hi Hugh,

On Mon, 2009-09-21 at 11:49 +0100, Hugh Dickins wrote:
> I got a bit anxious when I saw that the mode arg to shmem_get_inode()
> is declared as an int: was afraid that compiler was then passing a bad
> upper half down, which in fact would cause no trouble, but how could it
> be sure of that? However, it looks okay: after doing the 32-bit load,
> it goes on to do a movzwl %ax,%eax - seems an odd way to proceed to me,
> but I bet it knows a lot more about efficiency of memory loads than I do.

Yeah, that's a common cause of kmemcheck false positives. I guess GCC
wants to avoid a partial register stall in the memory load and expects
CPU register renaming to work for "movzwl %ax, %eax" or something.

Pekka

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/