Re: [PATCH v2 3/8] x86-64: Allow alternative patching in the vDSO

From: Andrew Lutomirski
Date: Mon Jul 11 2011 - 10:21:31 EST


On Mon, Jul 11, 2011 at 4:41 AM, Rakib Mullick <rakib.mullick@xxxxxxxxx> wrote:
> On Sun, Jul 10, 2011 at 9:22 AM, Andy Lutomirski <luto@xxxxxxx> wrote:

>> +static void patch_vdso(void *vdso, size_t len)
>
> I think, patch_vdso should mark with __init. Since it's been only
> called from an __init function. We might hit a section mismatch, even
> if we don't hit section mismatch, the will function get removed after
> system boot - saves some .text size.

Sure. It won't make any difference, because my compiler at least is
smart enough to inline the whole function into init_vdso_vars, but
it's the right thing to do anyway.

>> +       return;  /* nothing to patch */
>
> If there's nothing to patch, I think (perhaps) - it would be nice to
> let user know through printk.

Will do. I verified it myself by dumping the vdso image from memory
and confirming that it got patched correctly, but if the code ever
bitrots it'll be nice to have the warning.

--Andy
--
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/