From nobody Sun Feb 8 10:50:35 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D956DC7EE29 for ; Fri, 9 Jun 2023 18:37:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231657AbjFIShe (ORCPT ); Fri, 9 Jun 2023 14:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231779AbjFIShZ (ORCPT ); Fri, 9 Jun 2023 14:37:25 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E2793ABF for ; Fri, 9 Jun 2023 11:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686335832; x=1717871832; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jwp2HjzYTo7V1oc3MvCqOYLHYFthgPfSLKoKbfmVBTI=; b=NjzZInySB9HgOhCIiP8pcWuNdaboqXoixvdOPMDviVqYfaBOjMZ6pup4 U6C9sfDfqQtyHUP7Iq5n5DkuD0BX+dkoVa40YSMOuv9bd6iJzXsK5Ar6g gQmp4GNNLegUJLnWNdS1ZsWmEOKa2njb7kbUA3jOvJojwMV9AdzfBfngA DTgVwK2p7zG7vBThoCT5y70maXfCs9p57IRCwU3gZiK39kqqbU5gld2V3 b36ByPgcZRJ+B+9RChiXorlYGxsGFymEap3cBzbo5E9q6Ivky32/GFaKZ jR3HaNmm6jgmE+9nRDqw6mYS8XEGBwm3okA+8t9jRPupP0VZNAgF5wiaZ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10736"; a="338022169" X-IronPort-AV: E=Sophos;i="6.00,230,1681196400"; d="scan'208";a="338022169" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2023 11:37:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10736"; a="710444055" X-IronPort-AV: E=Sophos;i="6.00,230,1681196400"; d="scan'208";a="710444055" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 09 Jun 2023 11:37:09 -0700 From: Alexander Shishkin To: linux-kernel@vger.kernel.org, x86@kernel.org, Andy Lutomirski , Dave Hansen , Ravi Shankar , Tony Luck , Sohil Mehta Cc: Dave Hansen , Alexander Shishkin Subject: [PATCH v3 07/12] x86/traps: Consolidate user fixups in exc_general_protection() Date: Fri, 9 Jun 2023 21:36:27 +0300 Message-Id: <20230609183632.48706-8-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230609183632.48706-1-alexander.shishkin@linux.intel.com> References: <20230609183632.48706-1-alexander.shishkin@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sohil Mehta Move the UMIP exception fixup along with the other user mode fixups. No functional change intended. Suggested-by: Dave Hansen Signed-off-by: Sohil Mehta Signed-off-by: Alexander Shishkin --- arch/x86/kernel/traps.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 58b1f208eff5..f3e619ce9fbd 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -736,11 +736,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); @@ -755,6 +750,9 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection) if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0)) goto exit; =20 + if (cpu_feature_enabled(X86_FEATURE_UMIP) && fixup_umip_exception(regs)) + goto exit; + gp_user_force_sig_segv(regs, X86_TRAP_GP, error_code, desc); goto exit; } --=20 2.39.2