Oookay, I'm about to extend/tweak this patch series again. But I plan to do that in a new thread, since this one has turned into a complete mess (my bad, my bad, I know).
Please disregard this thread and all the patches I've posted in it. Thanks for your patience, Stefano