Re: [3.11-rc1] CONFIG_DEBUG_MUTEXES=y using gcc 3.x makes unbootablekernel.

From: Maarten Lankhorst
Date: Mon Sep 09 2013 - 08:07:47 EST


Op 09-09-13 13:56, Tetsuo Handa schreef:
> Maarten Lankhorst wrote:
>> Almost correct. I meant passing it as parameter to __mutex_lock_common. Your version will still cause an extra pointless null check in the ww_mutex_lock case.
> Ah, I see.
> ----------
> >From 95f189eb37c25ddf8e48d5dfc2f9f1185c52b6a8 Mon Sep 17 00:00:00 2001
> From: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
> Date: Mon, 9 Sep 2013 20:48:13 +0900
> Subject: [PATCH] mutex: Avoid gcc version dependent __builtin_constant_p() usage.
>
> Commit 040a0a37 "mutex: Add support for wound/wait style locks" used
> "!__builtin_constant_p(p == NULL)" but gcc 3.x cannot handle such expression
> correctly, leading to boot failure when built with CONFIG_DEBUG_MUTEXES=y.
>
> Fix it by explicitly passing a bool which tells whether p != NULL or not.
>
Yeah looks ok, did you run the selftests from CONFIG_DEBUG_LOCKING_API_SELFTESTS,
with/without CONFIG_PROVE_LOCKING and once more with DEBUG_MUTEXES also unset?

~Maarten
--
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/