Message ID | 170673568749.398.7045347279493145706.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-47131-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp31494dyc; Wed, 31 Jan 2024 13:20:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IGt+Fw397WDhGcJuggUeKHG7ys9SS2dIEN0ZichAkElSrPgE8eqk32Rf5XHvde5o703I+FM X-Received: by 2002:a05:6a00:17a9:b0:6dd:86b2:a4a5 with SMTP id s41-20020a056a0017a900b006dd86b2a4a5mr3428102pfg.5.1706736057297; Wed, 31 Jan 2024 13:20:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706736057; cv=pass; d=google.com; s=arc-20160816; b=N6Er/qSFn9L4g4hMGdsizMtdsycyJ7H+17aab8g1Lyxri4NVKHHY5uhsxnI0+iXZMF NPeBMbOEUG+a5aw3HmD1DtX7x90EFQGGVY1OhkhoITxew/MJPNQw/UpWVsvZLnprjqfb 96eS/2rIHGo9uqkKe1yFlGzRRD0CCS8JiE26Lwk20mSgNQNOP6aOnMb699+tQF+LoqSZ dXqq//zZlR+sZZm1zNUNokdGm5kvYDOuzmE2avCphsrgDjcMUZ3SHSBX64g2lcsRizVl i/F12p4ZCYoxqemCqfXD8aL1BEms6+CRCbZGT7J9605EGV5/bhEGJV8opOT9yFBA7363 iw0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=qB1GFWsHKuSTUsV5DHwObFwR+52c5Y/OuUx5Al7VURY=; fh=IQG+RkJ60jXYQwt30jqzwpPr+xdWBUDTa8iyB2Vze1Q=; b=Oli/bulM+bgFoLyh876s8DSNmHxGu7b8UQpguyXpffrDNfjb6YH9BRRCWWNgzAYXNW facOiDpLMPcxF8e4pRMuxv/hv1Guuw5hKjZCuavDTIgC6fSju9t73Ui88U2dCgQU/5b6 HVH2gccmlvLe+hKaCqVYHomwv9O1l4Jia8RJBc8+FXKm42w7hJJNnd6oLkBDc0XhZR1w OMBa/N9WGuUAetYr4JxeNR9uNh1ErDgvkFdY5sCENqqO/YkOFJwe+xgKI34uPAHiYWwu NB5gTbbd6ad4dVcC9qzyg5rTXa/Gpy7uhv32HUYOPf3Hfw4nUq9JtdpEr7yVIBR09XXr IE5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=tirqsuFv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-47131-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47131-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=1; AJvYcCXswbQkBLQ1iYwQv5ZHbLJwHW6SV9SaYWPe/qW6jqNdpe5jKNELKtmPXRzQW/9DPLUIKz9KCb4YwwPQd5JvOlGr9A7ouA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u3-20020aa78483000000b006dda2014f31si10316833pfn.172.2024.01.31.13.20.57 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 13:20:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47131-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=tirqsuFv; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-47131-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47131-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E7B942905CB for <ouuuleilei@gmail.com>; Wed, 31 Jan 2024 21:19:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFB983F8FB; Wed, 31 Jan 2024 21:14:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tirqsuFv"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="6HF5g5B1" 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 0769D39ACB; Wed, 31 Jan 2024 21:14:49 +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=1706735692; cv=none; b=QrZN5caVWsw1uDfAnoeHPgO9Ag3mVREfJITLbeqTfMzW7y3VhGJy0GNMwuLUcx44Z5g2BhkuhAZB8Wdt9yQ762WHP3sMOHkODpbx739zwo6077eOeue2U1qd3WT0emMpXf4VGblH6UI6wpXrmPGg0ox+BQNN8Wp6zEAXSMxbH/s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706735692; c=relaxed/simple; bh=FNNQ4v5en5QQA9wJHLquxcQTcybBQRxDpzmgCR8zsds=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=bn+h2sEa/PaOnmnDICnEHChYBho7p/3/tdAiaULZs9P05YPDvNeqitMDLvZEJBg8JqVdxYpt49sCCLUvgYHFevgNo8k+DMCmDSr1sg4LBVeVywun5JgdlI4rCHMzJQ1DT/CHGMntE4/NRouEeeddQ8TKlRnJUlyr1Evvod6wkUE= 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=tirqsuFv; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=6HF5g5B1; 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 Date: Wed, 31 Jan 2024 21:14:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706735688; 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=qB1GFWsHKuSTUsV5DHwObFwR+52c5Y/OuUx5Al7VURY=; b=tirqsuFvwer57NHQkI6+6NWo/P17qIfrLInUfAPfHISFzmQUc3oo6HkZ9mtYDuFjDRPExh FFm7a1ViA4sz4QD0P+YLk61PfVK1js5gxQjc2H+qC9dvw+vlVwNymtkz5312IXpxT6gOg4 nu6MrIAtouyp/PkVQdLFYNHqSWwMwxhm3a0x4+EoRPujleAqt/IVeajWLc+nDmWawNfMZV f9kZYlX/k1K62QHo5Wk3bKYZ3RpkI2kz2haSkqWGuxKbNDCScycmpwBfFKDwvvcZRiwTHD ugpJ+vWXiFGbt1WtKPZ87Vni5ZwoQY0g6EZqw4v1ga290dWuOcxKz49OIueC2Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706735688; 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=qB1GFWsHKuSTUsV5DHwObFwR+52c5Y/OuUx5Al7VURY=; b=6HF5g5B1GXM2UMgKhjDKBXqrPiaOQynPDDFoiyr56joStvQZ9oSxvOIi03eTAZAuqgDb5w Q1/PDUZ0rAHO7LAA== From: "tip-bot2 for H. Peter Anvin (Intel)" <tip-bot2@linutronix.de> Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/fred] x86/fred: Make exc_page_fault() work for FRED Cc: "H. Peter Anvin (Intel)" <hpa@zytor.com>, Xin Li <xin3.li@intel.com>, Thomas Gleixner <tglx@linutronix.de>, "Borislav Petkov (AMD)" <bp@alien8.de>, Shan Kang <shan.kang@intel.com>, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231205105030.8698-22-xin3.li@intel.com> References: <20231205105030.8698-22-xin3.li@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Message-ID: <170673568749.398.7045347279493145706.tip-bot2@tip-bot2> Robot-ID: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784440858398159884 X-GMAIL-MSGID: 1789642467866117631 |
Series |
[tip:,x86/fred] x86/fred: Make exc_page_fault() work for FRED
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Jan. 31, 2024, 9:14 p.m. UTC
The following commit has been merged into the x86/fred branch of tip: Commit-ID: 58c80cc55e079933205597ecf846583c5e6e4946 Gitweb: https://git.kernel.org/tip/58c80cc55e079933205597ecf846583c5e6e4946 Author: H. Peter Anvin (Intel) <hpa@zytor.com> AuthorDate: Tue, 05 Dec 2023 02:50:10 -08:00 Committer: Borislav Petkov (AMD) <bp@alien8.de> CommitterDate: Wed, 31 Jan 2024 22:02:05 +01:00 x86/fred: Make exc_page_fault() work for FRED On a FRED system, the faulting address (CR2) is passed on the stack, to avoid the problem of transient state. Thus the page fault address is read from the FRED stack frame instead of CR2 when FRED is enabled. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> Signed-off-by: Xin Li <xin3.li@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Tested-by: Shan Kang <shan.kang@intel.com> Link: https://lore.kernel.org/r/20231205105030.8698-22-xin3.li@intel.com --- arch/x86/mm/fault.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 679b09c..fa2d699 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -34,6 +34,7 @@ #include <asm/kvm_para.h> /* kvm_handle_async_pf */ #include <asm/vdso.h> /* fixup_vdso_exception() */ #include <asm/irq_stack.h> +#include <asm/fred.h> #define CREATE_TRACE_POINTS #include <asm/trace/exceptions.h> @@ -1518,8 +1519,10 @@ handle_page_fault(struct pt_regs *regs, unsigned long error_code, DEFINE_IDTENTRY_RAW_ERRORCODE(exc_page_fault) { - unsigned long address = read_cr2(); irqentry_state_t state; + unsigned long address; + + address = cpu_feature_enabled(X86_FEATURE_FRED) ? fred_event_data(regs) : read_cr2(); prefetchw(¤t->mm->mmap_lock);