Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752877AbbGJCSb (ORCPT ); Thu, 9 Jul 2015 22:18:31 -0400 Received: from mail.kernel.org ([198.145.29.136]:54485 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752600AbbGJCRq (ORCPT ); Thu, 9 Jul 2015 22:17:46 -0400 From: Andy Lutomirski To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Weisbecker?= , Rik van Riel , Oleg Nesterov , Denys Vlasenko , Borislav Petkov , Kees Cook , Brian Gerst , Linus Torvalds , Andy Lutomirski , Al Viro Subject: [RFC/PATCH v2 v2 4/6] x86/entry/32: Remove unnecessary asm check for returns to kernel mode Date: Thu, 9 Jul 2015 19:17:32 -0700 Message-Id: X-Mailer: git-send-email 2.4.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1254 Lines: 36 Unless I missed something, 44fbbb3dc687c ("x86: get rid of calling do_notify_resume() when returning to kernel mode") was unnecessarily paranoid. It split the exit path into resume_userspace and resume_kernel, after which it was no longer possible to get to work_notifysig when returning to kernel mode. The check for kernel mode in work_notifysig is superfluous. Remove it. Cc: Al Viro Signed-off-by: Andy Lutomirski --- arch/x86/entry/entry_32.S | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S index a36d5df6a749..66ff9c4055d7 100644 --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -491,10 +491,6 @@ work_notifysig: # deal with pending signals and #endif TRACE_IRQS_ON ENABLE_INTERRUPTS(CLBR_NONE) - movb PT_CS(%esp), %bl - andb $SEGMENT_RPL_MASK, %bl - cmpb $USER_RPL, %bl - jb resume_kernel xorl %edx, %edx call do_notify_resume jmp resume_userspace -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/