Message ID | 20230914044805.301390-24-xin3.li@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp698776vqi; Thu, 14 Sep 2023 16:56:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHEodbcfhUnAppwRKMoFOwiBdB+NNWpBhgLjYgcY4xnlJoT+RHb0SPRnsvWBtIpRI4DXM9 X-Received: by 2002:a17:902:e886:b0:1bf:349f:b85c with SMTP id w6-20020a170902e88600b001bf349fb85cmr144749plg.1.1694735804841; Thu, 14 Sep 2023 16:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694735804; cv=none; d=google.com; s=arc-20160816; b=GdlYcQnoPuLTCdaYqNirK+59wnE1z/JshOemU2ZVlVbJ8ucjV4L9C2Lkrx2N1WVs9i Wp8rsZRFwsuOZhzkREsm47NnmhgPLEPNnB+J31uuJh22HRlsoCS+jwjfP0xH5mC1YHGM fHB5ZIgZn+p/Yeg9Tx7HdQuAtK2aU1VFx5r4mIyYApBo6dfYSET3h3muVVLMruwlW7K/ FIsNYB96WQ6sL9g/2Ywn8zdAtLLdGxLnzNWbvAlYxdHhV2F+zbwGIr6noPTtu2ITgJsC lbra2BVvHu/TPuB19TCrltxiQD9zzut63kVrcYfqv0EF5boAw3VlUEMVqoy72r3fpbRj E4jw== 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=cLu+Nie38tLk5TZpiMn0bhtKs2zR9NOclJkrcTwTo9I=; fh=jqCbnajAXgJ+s7A1aA7DOHJD13/+EpD442pw8d+Ofss=; b=jvTgbX4e8OEj2hltHay9yb51gxVl6YhM+ax6EicuPglXK877i2jNGbufYv0tDq+CUr 85iipP78/UkJBd8dTPYcvBKuXX5raHWa3gMzxRdM0xG4dVcYT16Uy4tHsneCJzr4eZPy MiN0vyy9l252Zjmmq+BLDG11na48BWl8dXX+TbyHhl2yBAVULxXmE9qh78TWluZCNQhZ EO0RkhPXJwc8smzZ8P9WXRM0CHboLoBSnsCVu52Wh+cgV2I5K4Dq1ky4qPQkh9c9ZlTX 8iUPaMJqxo56wFLLMUL12FeP8HbRnqi6au3ybhTqgDSFQaBobjkU1Bi6H/kitznYRRe8 LtXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K69NdO6K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id y10-20020a170902b48a00b001c3a05b0b58si2311600plr.500.2023.09.14.16.56.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 16:56:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K69NdO6K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B1B6485C5765; Wed, 13 Sep 2023 22:20:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235706AbjINFUW (ORCPT <rfc822;chrisfriedt@gmail.com> + 35 others); Thu, 14 Sep 2023 01:20:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235154AbjINFTa (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 14 Sep 2023 01:19:30 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F2661FDE; Wed, 13 Sep 2023 22:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694668762; x=1726204762; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vZ6vels66+tC8YRpSCj8dEsAAUPLXovJkO1WpIp9s0Y=; b=K69NdO6K32mKD65wvuc7+o8TLuc8W//zfepoDPWD37CLmifV9V7SkCqh W56/I8Li0lj6K9ty0OXjvqwKEc4yI6erTwc3ld/MuEOlFA7VFww3MTJZW w8C/bqW8jkhS9yxzaxxsi3jpDDV+/98+Qk8ZEk4skUK/1IsRyNHek0b2E /NP4L05K1bnTVwcKZ73LzrIGaobRxr7B/tyFzpYvSck/ypUsti4ABe6XB XvaJd6V3qmMn4gM4Kt9zHiUwJ/L+iFWOFCl611f3s6st3tbfoJ7Fg5/Is sf0BOARuZqIX5/op/dQjSsDFvCai0D1J3DYd248CNWbdmZtSIBjhF4IKD w==; X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="382661368" X-IronPort-AV: E=Sophos;i="6.02,145,1688454000"; d="scan'208";a="382661368" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 22:17:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="779488808" X-IronPort-AV: E=Sophos;i="6.02,145,1688454000"; d="scan'208";a="779488808" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga001.jf.intel.com with ESMTP; 13 Sep 2023 22:17:40 -0700 From: Xin Li <xin3.li@intel.com> To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, luto@kernel.org, pbonzini@redhat.com, seanjc@google.com, peterz@infradead.org, jgross@suse.com, ravi.v.shankar@intel.com, mhiramat@kernel.org, andrew.cooper3@citrix.com, jiangshanlai@gmail.com Subject: [PATCH v10 23/38] x86/fred: Make exc_page_fault() work for FRED Date: Wed, 13 Sep 2023 21:47:50 -0700 Message-Id: <20230914044805.301390-24-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230914044805.301390-1-xin3.li@intel.com> References: <20230914044805.301390-1-xin3.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 13 Sep 2023 22:20:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777059291365242533 X-GMAIL-MSGID: 1777059291365242533 |
Series |
x86: enable FRED for x86-64
|
|
Commit Message
Li, Xin3
Sept. 14, 2023, 4:47 a.m. UTC
From: "H. Peter Anvin (Intel)" <hpa@zytor.com> On a FRED system, the faulting address (CR2) is passed on the stack, to avoid the problem of transient state. Thus we get the page fault address from the stack instead of CR2. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> Tested-by: Shan Kang <shan.kang@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Xin Li <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 ab778eac1952..7675bc067153 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> @@ -1516,8 +1517,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);