From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shards.monkeyblade.net ([184.105.139.130]:45966 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754777AbdEKCmK (ORCPT ); Wed, 10 May 2017 22:42:10 -0400 Received: from localhost (cpe-66-108-81-97.nyc.res.rr.com [66.108.81.97]) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 0B34F122F642E for ; Wed, 10 May 2017 19:00:39 -0700 (PDT) Date: Wed, 10 May 2017 22:42:08 -0400 (EDT) Message-Id: <20170510.224208.284759659875657965.davem@davemloft.net> To: stable@vger.kernel.org Subject: [PATCH] Sparc From: David Miller Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Wed_May_10_22_42_08_2017_830)--" Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: ----Next_Part(Wed_May_10_22_42_08_2017_830)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Please add the following Sparc bug fix to v4.10 and v4.11 -stable. Thank you. ----Next_Part(Wed_May_10_22_42_08_2017_830)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0023-sparc64-fix-fault-handling-in-NGbzero.S-and-GENbzero.patch" >>From 3c7f62212018b904ae17f5636ead18a4dca3a88f Mon Sep 17 00:00:00 2001 From: Dave Aldridge Date: Tue, 9 May 2017 02:57:35 -0600 Subject: [PATCH] sparc64: fix fault handling in NGbzero.S and GENbzero.S [ Upstream commit 3c7f62212018b904ae17f5636ead18a4dca3a88f ] When any of the functions contained in NGbzero.S and GENbzero.S vector through *bzero_from_clear_user, we may end up taking a fault when executing one of the store alternate address space instructions. If this happens, the exception handler does not restore the %asi register. This commit fixes the issue by introducing a new exception handler that ensures the %asi register is restored when a fault is handled. Orabug: 25577560 Signed-off-by: Dave Aldridge Reviewed-by: Rob Gardner Reviewed-by: Babu Moger Signed-off-by: David S. Miller --- arch/sparc/kernel/head_64.S | 6 ++++++ arch/sparc/lib/GENbzero.S | 2 +- arch/sparc/lib/NGbzero.S | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S index 4410119..41a4073 100644 --- a/arch/sparc/kernel/head_64.S +++ b/arch/sparc/kernel/head_64.S @@ -939,3 +939,9 @@ ENTRY(__retl_o1) retl mov %o1, %o0 ENDPROC(__retl_o1) + +ENTRY(__retl_o1_asi) + wr %o5, 0x0, %asi + retl + mov %o1, %o0 +ENDPROC(__retl_o1_asi) diff --git a/arch/sparc/lib/GENbzero.S b/arch/sparc/lib/GENbzero.S index 8e7a843..2fbf629 100644 --- a/arch/sparc/lib/GENbzero.S +++ b/arch/sparc/lib/GENbzero.S @@ -8,7 +8,7 @@ 98: x,y; \ .section __ex_table,"a";\ .align 4; \ - .word 98b, __retl_o1; \ + .word 98b, __retl_o1_asi;\ .text; \ .align 4; diff --git a/arch/sparc/lib/NGbzero.S b/arch/sparc/lib/NGbzero.S index beab29b..33053bd 100644 --- a/arch/sparc/lib/NGbzero.S +++ b/arch/sparc/lib/NGbzero.S @@ -8,7 +8,7 @@ 98: x,y; \ .section __ex_table,"a";\ .align 4; \ - .word 98b, __retl_o1; \ + .word 98b, __retl_o1_asi;\ .text; \ .align 4; -- 2.7.4 ----Next_Part(Wed_May_10_22_42_08_2017_830)----