From nobody Mon Apr 6 09:13:13 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3D59407105; Thu, 19 Mar 2026 21:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773957566; cv=none; b=aI/cKIAwuh6h2CUwfsCtWeehFve/PDrA/oC7XCz6zB/h77Zv2ap4hYgCGAtYfui5K+tHqhXj4E8RaSJiPFVUi9Jf+laTyZ8vpWTdE7pCJkRXrrOzoOfynbcMaQzkpA613s0/fDtFSnajTa8ib09hpOmFb224sN6BfrFB4mNhBfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773957566; c=relaxed/simple; bh=2LtGVtAVHQzJganQzmBJ19TOtI9T+s0T6SBHNubXcgI=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=a+JVTO1zKp1aGw1O4iXGdglq/un2dK4uF30FJUPfKNvb9CzmZB9Gdp78Io11kPNSYvc9LcAN2N9o4lXG3GrhkeUC81KuxsQQmtZvL/yGl8RSEe9opm6a6Qds8JGXwDpgYavZPagqvwvRdls4STiOXBI2P5Dqe4w4JQgEZan9+JI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rWh4VXU2; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zF9Jp/os; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rWh4VXU2"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zF9Jp/os" Date: Thu, 19 Mar 2026 21:59:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773957564; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wtrSnerMLc8To6dfWjfI7Nm9QzstdHnsBevYAW9tcTE=; b=rWh4VXU2r+Iaul1xoXPnCdaUGE2O4aBk7G3SlQwXNK/eCPRmfYjp5yauPBEcssZj1YbEUb 3wgtQ/bogN+sZl8T1UkSjEEmN9MSEgioNWe2ODzvaCaAfXe3HXS3zLPOEfy9tW7YclCAAn MyFSJK8NppfueY1aoOBmqA9Z9rjTHGj5ZxZ8CPgG7Qv7ATt7x6rSASCzX9R8FQqROBAwhN w/LA1GLa3jRnwJhF8QzLyooqbz5tS0fIC0AJ5WpNyzHybciF5lTyPJ2Y7YgWDDKWemclTZ VFNDn7+hWE+Gp68pH2rdozq4r2NSPBsrKJ3lCDOW8sj73cPmS5zHhrN1p40CbA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773957564; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wtrSnerMLc8To6dfWjfI7Nm9QzstdHnsBevYAW9tcTE=; b=zF9Jp/os7VPNAsP8SqljivbqRF5QRp/sDD9lXOryWopiHeGh5NkqnMev93dXwG087T3EsE 0MlajAlsRW0N4oBQ== From: "tip-bot2 for Sohil Mehta" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/traps: Consolidate user fixups in the #GP handler Cc: Dave Hansen , Sohil Mehta , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260305214026.3887452-3-sohil.mehta@intel.com> References: <20260305214026.3887452-3-sohil.mehta@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177395756307.1647592.9759553576757477766.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 97b8c8927ee107c5a1bfe990106209beb054d3bf Gitweb: https://git.kernel.org/tip/97b8c8927ee107c5a1bfe990106209beb= 054d3bf Author: Sohil Mehta AuthorDate: Thu, 05 Mar 2026 13:40:23 -08:00 Committer: Dave Hansen CommitterDate: Thu, 05 Mar 2026 13:49:26 -08:00 x86/traps: Consolidate user fixups in the #GP handler Move the UMIP exception fixup under the common "if (user_mode(regs))" condition where the rest of user mode fixups reside. Also, move the UMIP feature check into its fixup function to keep the calling code consistent and clean. No functional change intended. Suggested-by: Dave Hansen Signed-off-by: Sohil Mehta Signed-off-by: Dave Hansen Acked-by: Dave Hansen Link: https://patch.msgid.link/20260305214026.3887452-3-sohil.mehta@intel.c= om --- arch/x86/kernel/traps.c | 8 +++----- arch/x86/kernel/umip.c | 3 +++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 4dbff8e..614a281 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -921,11 +921,6 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection) =20 cond_local_irq_enable(regs); =20 - if (static_cpu_has(X86_FEATURE_UMIP)) { - if (user_mode(regs) && fixup_umip_exception(regs)) - goto exit; - } - if (v8086_mode(regs)) { local_irq_enable(); handle_vm86_fault((struct kernel_vm86_regs *) regs, error_code); @@ -940,6 +935,9 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection) if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0)) goto exit; =20 + if (fixup_umip_exception(regs)) + goto exit; + gp_user_force_sig_segv(regs, X86_TRAP_GP, error_code, desc); goto exit; } diff --git a/arch/x86/kernel/umip.c b/arch/x86/kernel/umip.c index d432f38..3ce99cb 100644 --- a/arch/x86/kernel/umip.c +++ b/arch/x86/kernel/umip.c @@ -354,6 +354,9 @@ bool fixup_umip_exception(struct pt_regs *regs) void __user *uaddr; struct insn insn; =20 + if (!cpu_feature_enabled(X86_FEATURE_UMIP)) + return false; + if (!regs) return false; =20