Message ID | 20230530114247.21821-8-alexander.shishkin@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2121090vqr; Tue, 30 May 2023 04:56:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4DeksOCSLV1mtUWKujINHz3Trx2kCx25PXkVbf5Ziq97B9Tp9jX1vUhNiTFg1JTpr2Pjw8 X-Received: by 2002:a17:90a:cb93:b0:256:6c75:b512 with SMTP id a19-20020a17090acb9300b002566c75b512mr2385442pju.46.1685447769453; Tue, 30 May 2023 04:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685447769; cv=none; d=google.com; s=arc-20160816; b=ojVsK50r9aIn6OPA7OgRIMPCTYWG59XcSi3Io/R4blPkQjy8yfV0UG4Yh7zx6CMvrn 3mmmGHJs/R9BbHZZA7aUcXlsifpkyQzt1KpkjKsWoZ+HZyMiJwW9RiOXmXy2Tg9l3yke NhT4EAeVCiU9jaTm5NPwDLYnYZ+I4F/zYGN7gp8visNS9BVPuHI3Fu8lOrmLw37bp8jI 6QJ2b9uu+d4hkKfIin7P3NOVoU6Bs+zukDZIcMRluEGZCahzGX3yQsTX5qAA4KGiqUT0 ua4tA6fpPLBlgaRt1mFx//rkmWts1Fp8NjQC5J3THVnsnV60zU4M0ROp/8kMGBJC8ItT h31w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5plwln1KbAf6sEvC6GqHgXj+rJYTUYeIPdVdArO4468=; b=CZO8ysOv9cR1TCVjHFmD+fw/OERz2mmEJfHza2tY2XLz7v62T7nhtOjEubBKY+AD8i S9RR5+YGjoADeYjIDnKasduaSHb9tMLIHTMijt/7YkTEhN8lMlUjY2VFpAtb2rSwUYXi fh1v424hmyG1NH1nJJw4XecInpvqcqrK2eZHmSsKxY5v1Ku4vXWcvGaJAZ6503BnTrif zTwAiYtDA3qYQNDwIViaza0JtUwqBnzyVhSyC1zaevycMsNOTKCxSMJFPLqU7jhk5ffZ 0ES7y2kLxtSWlaC+0q6I1jndNAL8KjBwqaIvjuqr8xo4c3q3BZASb1KU8fvrJShFAuSg 76UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DVeDvuJZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ml7-20020a17090b360700b0024e036ec731si593490pjb.36.2023.05.30.04.55.56; Tue, 30 May 2023 04:56:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DVeDvuJZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232129AbjE3LoV (ORCPT <rfc822;andrewvogler123@gmail.com> + 99 others); Tue, 30 May 2023 07:44:21 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <alexander.shishkin@linux.intel.com> To: linux-kernel@vger.kernel.org, x86@kernel.org, Andy Lutomirski <luto@kernel.org>, Dave Hansen <dave.hansen@linux.intel.com>, Ravi Shankar <ravi.v.shankar@intel.com>, Tony Luck <tony.luck@intel.com>, Sohil Mehta <sohil.mehta@intel.com>, Paul Lai <paul.c.lai@intel.com> Cc: Dave Hansen <dave.hansen@intel.com> 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: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767320080101314465?= X-GMAIL-MSGID: =?utf-8?q?1767320080101314465?= |
Series |
Enable Linear Address Space Separation support
|
|
Commit Message
Alexander Shishkin
May 30, 2023, 11:42 a.m. UTC
From: Sohil Mehta <sohil.mehta@intel.com> Move the UMIP exception fixup along with the other user mode fixups. No functional change intended. Suggested-by: Dave Hansen <dave.hansen@intel.com> Signed-off-by: Sohil Mehta <sohil.mehta@intel.com> --- 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) cond_local_irq_enable(regs); - 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; + 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; }