From nobody Sun Feb 8 19:40:04 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 DF0FCC7EE39 for ; Tue, 30 May 2023 11:44:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229722AbjE3LoW (ORCPT ); Tue, 30 May 2023 07:44:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232063AbjE3Lnr (ORCPT ); Tue, 30 May 2023 07:43:47 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24F06115 for ; Tue, 30 May 2023 04:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685447019; x=1716983019; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+DWQTSeLMQPtYgTuldlbeqGxSIW76k7nOP+l3EGtfX0=; b=DVeDvuJZheCLG7C/f2NGrij/YGcyR/zF7zYzjyd+7M59zbj92t0DYM63 AWigIdKrS7/3mA3ZKkVNA0K2gikfQ8pCrvAJHq3NeC9pnVW1FQ7voqNTV oSHuLy6e0pnRR+n002brnJA1hPizN29SV72/EPev69PSjYAOgYpF6YPK4 MS01+xDobkDyLbHZbEdtLzvV44Lrdvswn9xLd+B3Bdbn3mUo0QHzBVQ0S XT0ATCjoBijNmYgiv+g+QFc6Iu6vIISrxm+Zi8bPjvRwsEhzFeRpDyWYI V1s2QXfpC3Lo3obbYIDWmDdzRsYXNdtaC80v7lx0MpFF948/BK+XdJkVe w==; X-IronPort-AV: E=McAfee;i="6600,9927,10725"; a="383145377" X-IronPort-AV: E=Sophos;i="6.00,204,1681196400"; d="scan'208";a="383145377" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2023 04:43:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10725"; a="700588731" X-IronPort-AV: E=Sophos;i="6.00,204,1681196400"; d="scan'208";a="700588731" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 30 May 2023 04:43:12 -0700 From: Alexander Shishkin To: linux-kernel@vger.kernel.org, x86@kernel.org, Andy Lutomirski , Dave Hansen , Ravi Shankar , Tony Luck , Sohil Mehta , Paul Lai Cc: Dave Hansen Subject: [PATCH v2 07/12] x86/traps: Consolidate user fixups in exc_general_protection() Date: Tue, 30 May 2023 14:42:42 +0300 Message-Id: <20230530114247.21821-8-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230530114247.21821-1-alexander.shishkin@linux.intel.com> References: <20230530114247.21821-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 --- 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