Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2461128imd; Fri, 2 Nov 2018 11:48:33 -0700 (PDT) X-Google-Smtp-Source: AJdET5cPTyLHDopfobItRqMncGDvahuZf4cn9y6mGdtLnZT/leUcuMqCjjteFmEt5NoCPeUgjkVp X-Received: by 2002:a62:2e04:: with SMTP id u4-v6mr13052450pfu.229.1541184513039; Fri, 02 Nov 2018 11:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184513; cv=none; d=google.com; s=arc-20160816; b=DT3vNAUN0L4kkJp+o4YsuIgPgsex1nkF44ZNKRZPJHAdA8TzlW/Cm79LgjBNwCFEhZ yms/Bgx9/u7O3NeQldogPqeGqpwkdx/C+3yOgxK+NUBo4W1s8T40UZN89IeM8d3h6hMg BCG+Sf8JCcwMV4xTI+pgEdlBOXvY5NTEP0RrGoMKcyBnnVU58cpzs6bwHcoTBN4EjNpV RvaguhsnE9giQKI5KrDjT+36Bxcb7l6GpWn9ZPlwR9y+kd1oWVE3nIb9P4Fr3TtrMjRp R27DHoiNebuVn4MR5uSl0gTmsEGcl7squvduF64w3E99LrjBtG6xc2w2b9GYw5uJA0Sd UaQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=D9PS4Bt3TpHcTjCsUmE9EKx0yV7QjJbZUVNyymhjB6w=; b=vPLdcCBTc4tPa6ytHo83RW4vGaWFS/lB1F4W7N7nTFOPpN1z9kjfPL81wF+QaRVWE9 EpvSxCHY3w4gqCE5h7FXJ3RsiTgqbbd1xz4u6SAIteML7n23jSzQQ88pV5YPRC91BNqz 1WsOX1s3EE9yLP6jFUt8y594VY6qNuveiwwkbAhCw2RH0Kwerj1PVvTYQ6hGJDu+6xj2 41KGBWAjrmMgdmKw4HNljUqPQ14PRaLPg8Ko7I8vXqSyFd5grbu4953ovOuCktOfc6n4 +h6UW8JkSg5SlmrfRsjKwSPvxO6SNIqTVnPiEBy5Jb/FvFZJ842RgKqROcVPwT6gGFEB 3iaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dtLpOsjc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11-v6si28904370pgm.102.2018.11.02.11.48.18; Fri, 02 Nov 2018 11:48:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dtLpOsjc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730315AbeKCDyR (ORCPT + 99 others); Fri, 2 Nov 2018 23:54:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:50172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729136AbeKCDyR (ORCPT ); Fri, 2 Nov 2018 23:54:17 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3CA1420847; Fri, 2 Nov 2018 18:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184363; bh=1qADsAp/w3konQaCVsj/kZdiS0tewDiQsek94bVz/WI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dtLpOsjcizgRwGXuz+FCvfVQqtWANde47lvgH7t+FLMZj0mSEqyXe9MpNCZ/j0gRT WDeEuk6qut1vAiK0IdtVU0PUriMZ4Qu2M3v0MhQsUDp7+jCe9YAMNAjm0/lvgud1FP ejM2wNHsFbtQFdqh14lWG6nlxcJBpHU/O7CQ3bAU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "David S. Miller" Subject: [PATCH 4.18 145/150] sparc64: Set %l4 properly on trap return after handling signals. Date: Fri, 2 Nov 2018 19:35:07 +0100 Message-Id: <20181102182912.529395378@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: "David S. Miller" [ Upstream commit d1f1f98c6d1708a90436e1a3b2aff5e93946731b ] If we did some signal processing, we have to reload the pt_regs tstate register because it's value may have changed. In doing so we also have to extract the %pil value contained in there anre load that into %l4. This value is at bit 20 and thus needs to be shifted down before we later write it into the %pil register. Most of the time this is harmless as we are returning to userspace and the %pil is zero for that case. Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- arch/sparc/kernel/rtrap_64.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/arch/sparc/kernel/rtrap_64.S +++ b/arch/sparc/kernel/rtrap_64.S @@ -85,8 +85,9 @@ __handle_signal: ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1 sethi %hi(0xf << 20), %l4 and %l1, %l4, %l4 + andn %l1, %l4, %l1 ba,pt %xcc, __handle_preemption_continue - andn %l1, %l4, %l1 + srl %l4, 20, %l4 /* When returning from a NMI (%pil==15) interrupt we want to * avoid running softirqs, doing IRQ tracing, preempting, etc.