From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anNOf-0004mw-UJ for qemu-devel@nongnu.org; Tue, 05 Apr 2016 05:35:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anNOb-0006Cz-Ty for qemu-devel@nongnu.org; Tue, 05 Apr 2016 05:35:41 -0400 In-Reply-To: <20160404211112.66b0756f@kryten> From: Michael Ellerman Message-Id: <3qfNxw4KcCz9sD5@ozlabs.org> Date: Tue, 5 Apr 2016 19:35:32 +1000 (AEST) Subject: Re: [Qemu-devel] powerpc: Clear user CPU feature bits if TM is disabled at runtime List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Mackerras via Linuxppc-dev , Alexey Kardashevskiy , Paul Mackerras , Benjamin Herrenschmidt , Michael Neuling , David Gibson , Alexander Graf Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Mon, 2016-04-04 at 11:11:12 UTC, Paul Mackerras via Linuxppc-dev wrote: > In check_cpu_pa_features() we check a number of bits in the Shouldn't we be clearing the user feature there too? The ibm_pa_features array and the logic in scan_features() knows to flip the cpu_user_features bits, it was just never updated to handle cpu_user_features2. So it seems to me that's where the bug is. > ibm,pa-features array and set and clear CPU features based on what > we find. One of these bits is CPU_FTR_TM, the transactional memory > feature bit. > > If this does disable TM at runtime, then we need to tell userspace > about it by clearing the user CPU feature bits. > > Without this patch userspace processes will think they can execute > TM instructions and get killed when they try. > > Signed-off-by: Anton Blanchard > Cc: stable@vger.kernel.org > Reviewed-by: David Gibson > --- > > Michael I've added stable here because I'm seeing this on a number > of distros and would like to get it backported, but I'll leave it up > to you if it should go there. Yeah it should definitely go to stable. Can we pinpoint which commit introduced the bug, I guess whenever the TM support was merged. cheers