Return-Path: Received: from mail-la0-f46.google.com ([209.85.215.46]:36710 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751273AbbGELJr (ORCPT ); Sun, 5 Jul 2015 07:09:47 -0400 Received: by lagc2 with SMTP id c2so125550095lag.3 for ; Sun, 05 Jul 2015 04:09:46 -0700 (PDT) From: Max Filippov To: linux-xtensa@linux-xtensa.org Cc: Chris Zankel , Marc Gauthier , Waldemar Brodkorb , Max Filippov , stable@vger.kernel.org Subject: [PATCH] xtensa: fix threadptr reload on return to userspace Date: Sat, 4 Jul 2015 15:53:09 +0300 Message-Id: <1436014389-31621-1-git-send-email-jcmvbkbc@gmail.com> Sender: stable-owner@vger.kernel.org List-ID: Userspace return code may skip restoring THREADPTR register if there are no registers that need to be zeroed. This leads to spurious failures in libc NPTL tests. Always restore THREADPTR on return to userspace. Cc: stable@vger.kernel.org Signed-off-by: Max Filippov --- arch/xtensa/kernel/entry.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index ab6a857..8985339 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S @@ -578,12 +578,13 @@ user_exception_exit: * (if we have restored WSBITS-1 frames). */ +2: #if XCHAL_HAVE_THREADPTR l32i a3, a1, PT_THREADPTR wur a3, threadptr #endif -2: j common_exception_exit + j common_exception_exit /* This is the kernel exception exit. * We avoided to do a MOVSP when we entered the exception, but we -- 1.8.1.4