Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1705953ybh; Tue, 14 Jul 2020 05:19:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7qRiUD6ZhaHH7FT5+WqHDTsUSfCWWwd4lxzR5oy6hnq30J0e2ThxQ/v146iOknMz8o6SM X-Received: by 2002:a17:906:c0d9:: with SMTP id bn25mr4131418ejb.176.1594729197667; Tue, 14 Jul 2020 05:19:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594729197; cv=none; d=google.com; s=arc-20160816; b=WiSuJQyr4EZoPe605v52E4NBH+D71eM0yCoZQ59qPhR3Y1aOl/w1ckaXqVOL7fQcHB hMXZSZhVirJ+6rEj70Xk3oA2vClFWE028jECU5EFyoVMatgKyD5XbEqe9CJhEm9Ld2HE 3JYaiWfGV6RenaTWmVVBdCeK+STc9qvgCUwq82sfgfTIEiYxGPy6GqtYTX3PBgKjxVlC hp5XzGxUX5xYqsQRerK4Jnlm0Qdo/5jUN9dc21x3Z6UpQY0zcv1/diM6u0GqSBLPeTWY aJIyR06o39fLlDqD282As8ejUmXXk8N+GwZpBfrTc+0zLfTLLeB2pmDZfujTTGcxtlee lUNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pWUBlSD1WohmRmxvzaqYEgoCRfgwUNsc599ISUZB8AA=; b=dNXqFarcXgqrtKx/O9bbq9A3N4v02J2x0bmMmWt7vYzl++oekpBkiyF2E8E/+9gvnX GqupHnJg/nfOqYNTGkxAZYZX/9i5keKKCzJRNRZVNxKK/8VIKviX2iUFIcOMzj9BUPJk yP3l8DrzWQcZazAyg9yjJzj7uXeUkSfBw7YgHqkkcw29YP5kXAAqKiFvrDkVKNI/T2Du WUzIXjWQVbht4o5ZmdqfKhFF2jCRAGFs3bcTYIZdh2orz5V+NZLXCEX/lUlOsA33emH9 0S9kxbwy8PMbF2lSXCw5+2XXfC77/XIkcp0lAaiL2OjZagu3CWfJDpSHHjFqlpPb0/PM jhKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si11094202ejv.343.2020.07.14.05.19.33; Tue, 14 Jul 2020 05:19:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728881AbgGNMSI (ORCPT + 99 others); Tue, 14 Jul 2020 08:18:08 -0400 Received: from 8bytes.org ([81.169.241.247]:52864 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728066AbgGNMKi (ORCPT ); Tue, 14 Jul 2020 08:10:38 -0400 Received: from cap.home.8bytes.org (p5b006776.dip0.t-ipconnect.de [91.0.103.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by theia.8bytes.org (Postfix) with ESMTPSA id DB40A346; Tue, 14 Jul 2020 14:10:35 +0200 (CEST) From: Joerg Roedel To: x86@kernel.org Cc: Joerg Roedel , Joerg Roedel , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Sean Christopherson , Martin Radev , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH v4 05/75] x86/traps: Move pf error codes to Date: Tue, 14 Jul 2020 14:08:07 +0200 Message-Id: <20200714120917.11253-6-joro@8bytes.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714120917.11253-1-joro@8bytes.org> References: <20200714120917.11253-1-joro@8bytes.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel Move the definition of the x86 page-fault error code bits to the new header file asm/trap_pf.h. This makes it easier to include them into pre-decompression boot code. No functional changes. Signed-off-by: Joerg Roedel --- arch/x86/include/asm/trap_pf.h | 24 ++++++++++++++++++++++++ arch/x86/include/asm/traps.h | 19 +------------------ 2 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 arch/x86/include/asm/trap_pf.h diff --git a/arch/x86/include/asm/trap_pf.h b/arch/x86/include/asm/trap_pf.h new file mode 100644 index 000000000000..305bc1214aef --- /dev/null +++ b/arch/x86/include/asm/trap_pf.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_X86_TRAP_PF_H +#define _ASM_X86_TRAP_PF_H + +/* + * Page fault error code bits: + * + * bit 0 == 0: no page found 1: protection fault + * bit 1 == 0: read access 1: write access + * bit 2 == 0: kernel-mode access 1: user-mode access + * bit 3 == 1: use of reserved bit detected + * bit 4 == 1: fault was an instruction fetch + * bit 5 == 1: protection keys block access + */ +enum x86_pf_error_code { + X86_PF_PROT = 1 << 0, + X86_PF_WRITE = 1 << 1, + X86_PF_USER = 1 << 2, + X86_PF_RSVD = 1 << 3, + X86_PF_INSTR = 1 << 4, + X86_PF_PK = 1 << 5, +}; + +#endif /* _ASM_X86_TRAP_PF_H */ diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h index 714b1a30e7b0..6a308355ea29 100644 --- a/arch/x86/include/asm/traps.h +++ b/arch/x86/include/asm/traps.h @@ -8,6 +8,7 @@ #include #include #include /* TRAP_TRACE, ... */ +#include #ifdef CONFIG_X86_64 asmlinkage __visible notrace struct pt_regs *sync_regs(struct pt_regs *eregs); @@ -41,22 +42,4 @@ void __noreturn handle_stack_overflow(const char *message, unsigned long fault_address); #endif -/* - * Page fault error code bits: - * - * bit 0 == 0: no page found 1: protection fault - * bit 1 == 0: read access 1: write access - * bit 2 == 0: kernel-mode access 1: user-mode access - * bit 3 == 1: use of reserved bit detected - * bit 4 == 1: fault was an instruction fetch - * bit 5 == 1: protection keys block access - */ -enum x86_pf_error_code { - X86_PF_PROT = 1 << 0, - X86_PF_WRITE = 1 << 1, - X86_PF_USER = 1 << 2, - X86_PF_RSVD = 1 << 3, - X86_PF_INSTR = 1 << 4, - X86_PF_PK = 1 << 5, -}; #endif /* _ASM_X86_TRAPS_H */ -- 2.27.0