Message ID | 20231230161954.569267-9-michael.roth@amd.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6E3CC46CD2 for <linux-mm@archiver.kernel.org>; Sat, 30 Dec 2023 16:21:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D49D6B014C; Sat, 30 Dec 2023 11:21:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5835F6B014D; Sat, 30 Dec 2023 11:21:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44BEC6B014E; Sat, 30 Dec 2023 11:21:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 32D5A6B014C for <linux-mm@kvack.org>; Sat, 30 Dec 2023 11:21:34 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id F1D04120440 for <linux-mm@kvack.org>; Sat, 30 Dec 2023 16:21:33 +0000 (UTC) X-FDA: 81624000066.22.1B9C9AD Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2085.outbound.protection.outlook.com [40.107.223.85]) by imf23.hostedemail.com (Postfix) with ESMTP id 05A65140026 for <linux-mm@kvack.org>; Sat, 30 Dec 2023 16:21:30 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=uPLjsqsq; dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf23.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.223.85 as permitted sender) smtp.mailfrom=Michael.Roth@amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1703953291; h=from:from:sender: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:dkim-signature; bh=Vg8hNqxzPvTdDJnhMLzezvdd7rMr6n6xVpdNNd8ZLxA=; b=QJw1SvWR5L4g+OmrYO2GgYPd8bZIdsmv3Qzt5PhDkLvXHPxP3BLoApCx4tpog3VHmOrctC VqARv+xlcOMCqD8x63PA35KsYR1fKolqcermVWedJUU6hnz5DLxs3r7Vd5jxSWxM2WCj2q 9F/6MkSNvOFF3MXx8LLBMIYDLyCxJyc= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=uPLjsqsq; dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf23.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.223.85 as permitted sender) smtp.mailfrom=Michael.Roth@amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1703953291; a=rsa-sha256; cv=pass; b=CtIlDr6TXYY/RatdQRGpBRPxv6ZbWWIqSCFyOCuWhUmLMs/Z83X7uCl3s4RWu7nX/A0FDy OxFhE9AXaVNENycWs64KpwqjRBSUFCbKKmzQd+LJXjbMGJHz0B0B5CzZLrPqIjdWUxtxT2 X4hV1QJLOB3OT6oeMs+qp9LAFzrBlZI= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZrUmHpRluYsyM8UdOuTB+xbz4FfuBM78uSx+ozYgXzBzDNgrsOTmRUraTjVQ0x1heONdlHQUGM9VWcRKMkIRxJ9DCwJwIIib829c2zhtJJjbWeO5eP1Cm46b2vtnatd4IecamjYfX49W1b1QlyUT0fGDF+vXLG6XlyCB6AayFvCYHr71lfqcFZIN9f0nKeWamDKjuc4IyoK8xRVaffGzF0lWyi3Aykj5YOOe/dpAtUAFM+fWRv8pp4d2EoEOnyt1lCkAkUjWY+/rVKe3Bu8qFAj3YMbzikaEp1K9qKOXhWZvmSzrl0GUlE+tRmrhi+OrCCOmNyMFsBFW1t7axffJxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Vg8hNqxzPvTdDJnhMLzezvdd7rMr6n6xVpdNNd8ZLxA=; b=X//58TzVKxgoGOoGoV5eb25mM4SYRwZwnzapknXosmz4MjYMCxmMD31l8rO5J7mqLbTv5sWZRmf8/6rnGwdLbR1NtSBdltwrpkukF99LhpJ6w0a+quOq5d8X5tuRDJxfl89L8vQ+1FEG7SaSH42KsLq6fvys2S/yYo0yqMTK56FlhxMKZPOxK+re1KCLzLvhtuRFNuHJrt1IztNE49cm7VZ83X7zLllNpvWmqiDuQy9R3bT+WiIKYVo1PZeSG9u/kq1l/Wb+UlevGmp3uNaHOCLtBvdQ0YcNKkA//VN4QiNUjTbF17eTtQ4Ngyi4PVGkAKae/YnE41i75JTd7ZgL2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vg8hNqxzPvTdDJnhMLzezvdd7rMr6n6xVpdNNd8ZLxA=; b=uPLjsqsqFnorc3dVuzj0Q8nrVZ3S5rIumCLQJ7g7Je7P7E7Y4sPhb07Wxtk8F3ttlraFRlggztaPZ4JU8TgHPvX8IYKywmf8tLcX8xYCt9UIdXVyqaPPTWF+18PTMe6tX1El6dZYi9HcqosWuqXZ5+PcLEtEHa3RzWQMl09ScGE= Received: from CH0PR03CA0325.namprd03.prod.outlook.com (2603:10b6:610:118::31) by DM6PR12MB4484.namprd12.prod.outlook.com (2603:10b6:5:28f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.23; Sat, 30 Dec 2023 16:21:25 +0000 Received: from DS3PEPF000099E1.namprd04.prod.outlook.com (2603:10b6:610:118:cafe::6b) by CH0PR03CA0325.outlook.office365.com (2603:10b6:610:118::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.20 via Frontend Transport; Sat, 30 Dec 2023 16:21:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS3PEPF000099E1.mail.protection.outlook.com (10.167.17.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7159.9 via Frontend Transport; Sat, 30 Dec 2023 16:21:25 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Sat, 30 Dec 2023 10:21:25 -0600 From: Michael Roth <michael.roth@amd.com> To: <x86@kernel.org> CC: <kvm@vger.kernel.org>, <linux-coco@lists.linux.dev>, <linux-mm@kvack.org>, <linux-crypto@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <tglx@linutronix.de>, <mingo@redhat.com>, <jroedel@suse.de>, <thomas.lendacky@amd.com>, <hpa@zytor.com>, <ardb@kernel.org>, <pbonzini@redhat.com>, <seanjc@google.com>, <vkuznets@redhat.com>, <jmattson@google.com>, <luto@kernel.org>, <dave.hansen@linux.intel.com>, <slp@redhat.com>, <pgonda@google.com>, <peterz@infradead.org>, <srinivas.pandruvada@linux.intel.com>, <rientjes@google.com>, <tobin@ibm.com>, <bp@alien8.de>, <vbabka@suse.cz>, <kirill@shutemov.name>, <ak@linux.intel.com>, <tony.luck@intel.com>, <sathyanarayanan.kuppuswamy@linux.intel.com>, <alpergun@google.com>, <jarkko@kernel.org>, <ashish.kalra@amd.com>, <nikunj.dadhania@amd.com>, <pankaj.gupta@amd.com>, <liam.merwick@oracle.com>, <zhi.a.wang@intel.com>, Brijesh Singh <brijesh.singh@amd.com>, Dave Hansen <dave.hansen@intel.com> Subject: [PATCH v1 08/26] x86/traps: Define RMP violation #PF error code Date: Sat, 30 Dec 2023 10:19:36 -0600 Message-ID: <20231230161954.569267-9-michael.roth@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231230161954.569267-1-michael.roth@amd.com> References: <20231230161954.569267-1-michael.roth@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099E1:EE_|DM6PR12MB4484:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d8f7c36-8b31-4dba-fc97-08dc09535ebe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jyw3aszWCCxgHt5su6iUL7Rt8LbwZWJjiktcne7frUgxtn8qbw+ibcSLgbaMwI3M7PeDLJqSBveuRD27cAyTKe8C3GBViBht7qnfEGcxAVAs5NtnpqSgwVWZSPd42ErmMsP5VIrd0gdZHhk5AkReSaH5Hy/oos23lvJEobQ7VpRvt96smSIubUpxPdp/zQcKz4Ffc7ZbdU+Yivd2DQir4U3khpBjBJNFyiL6FK9q2J/ra0ZSKj4cgijuMnS8DkPw+XrKHKmgnaiMMA7qm28ebxsJ1XiKeuekO8QlaR1dWFKlh6E66Ox3WPZ8LMrQyE+zY5sYIbHHieQml82cFYawaCj1Lf1KSUv25oV7RTgpW1N1TbDdsLCcCVCsdebXWTP4MwJYAFPdcHurWYQ+neeAb3Xn5A30v7od0qWz0LBp8FCQABvw8sg2zW9KEq8/OZDoEa1+odZTCbRORDHaoyDgas9lJB0XJXga1bZgJPrs97TXkGnO/xXamoet7EM7kAcuKOlEgtG3CwhaqkXssXf36qQd8ujtBKI0sJ6CraZKmnF271JA4uLXvm02e6qXP86M2Wn6gv7K4SC615uFN6h3LCdo+mT2ac40i/5unU6UcK7sERqCHsW5+4OCxBTSCavNiuwDbkrV/Z3hwt0t+26Wu8+S3vXmyq02ThqL6MiRNsJsDAUxOfJUoHlIo2UmX3xDwwX704axdywRGbCW0PQpW5lMcCJJbWVmBH/lysGzOOWyIk6bCOeuw5ZNOaBkytuAom9826fZQbakdA377f/KZw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(396003)(136003)(376002)(346002)(39860400002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(82310400011)(36840700001)(46966006)(40470700004)(40480700001)(40460700003)(6666004)(36860700001)(478600001)(86362001)(81166007)(36756003)(82740400003)(356005)(7406005)(7416002)(41300700001)(2906002)(83380400001)(2616005)(1076003)(426003)(336012)(26005)(16526019)(47076005)(44832011)(316002)(54906003)(6916009)(5660300002)(70586007)(70206006)(8936002)(8676002)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2023 16:21:25.5653 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d8f7c36-8b31-4dba-fc97-08dc09535ebe X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099E1.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4484 X-Rspamd-Queue-Id: 05A65140026 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: kd5aqnd6rddcopq5wxrdf894gipumb54 X-HE-Tag: 1703953290-984482 X-HE-Meta: U2FsdGVkX1/rRcsCc327OfszgkJ5tjzvoGolsN38A8j3/VK48AyLmdjsT7Y6U2w+jyT1CIUwB580fzC1sNE3+rLioziphLsdc4t7+oPIpDokP28JsoOwXQa0CnqoPmFktULmcJkqLnYecWyJpP/OkxmRG4a0nLBMUtFVnF2KpZEPf/D3e38/1ScLShtlWfgRUKznXohg4HL3W4zwYqMQtUaYr42ETOKuziI9Idst/2/5K02yB2iEhTUoF0F56fbYRm4uw7bJzF3fMfX6jRa3nGAwNQgK6CL/g7PyBxDSqX3/7uYnv2gSi1zq6B9s0sbMTGlrHecf/vsK2EAy+W/1TnvGA2raVhilSfUBnVHb70X+MVmJ3VzX6KNWBk9UijrKy/deTt1emDWu8bSHKCHpVJN6BuKO3mzl80v8oq04s862POSppTCkIGKgPg5taj1HA/PBn6ALGB1aMZhm8RYAYvME37x4XR+vF3QuozZfzRY3wZFkJtnd1JRFD+Uu5qVPuXuDc1YoGgyQFUB/YptR/pcmF65luxgUIFvU7hZ90PDSrKAFDm9H/vF0VpF/vQDpgzPtIKv9Nqwot88FW/lOjRZa1V11Jn/FxA1IDwIJHBokr1w6WZNgiSpJ1sqtijuUHeJuCyb+Z5Z7CBSs8QIX3r7fvBpPzAOTE68bVSa/Skqpd5WRam8boWCiNSVMdxCMUdt0l22CJyY1LtnQOosyK30GUd3KRfg8ERSHcTjFXxzxHQj63Rr7opUEZT4E5Znai3iTqtlFD4dIL1n0YD1iSq8IznJ8hsWx9xCLxARnzt/tfGY/i9WdPFs8oxbIDmYlkVsSfW6AkdWphJ79DqgsD3iyhF6GS1il1Fe6VbBwpoECYwkppl/QCW7Ic2OuedZknZZ2veLK7/VlMvNh/dOXxLIz0lVkNl6QHEgomGHAeMrnJfkcOJrp43vhu4mmOc9+HKiWzBg0+RZjNWyvM2o VARmybd4 8PdfuicjiVsdtjEhGn42QKKOtQAkcmZVdKUbB69UAi34QimL8PV6fkckguSbFSk6xbqbPFC+Drvf2zTC0g+r4/AKp0ZepHiykUjxIejkhEM89y+wlFwVAZrrP42eekQeBvvhYi12rivZdjevn7ef7tJgZ8+e8nEiQ6l7bphjXpWaXs7diWD3FgLcodFaIj2+YQWVg95QhIpYwpzdNNxEEiNkZJh2Pd3GLM0vMYVGHtSne742SFf5dRnhH1m1mMM5r43+tfgPwkLo1c/cP/Yv0lhf/kmrhgN2ufQl7GPq/GA9sVHBXpjsSE8sQiEyozuvgVY2khiDqo1XJfTenXtniRSuZYiwkV50ZGtxo1JWjuWj/HuI= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Add AMD Secure Nested Paging (SEV-SNP) Initialization Support
|
expand
|
diff --git a/arch/x86/include/asm/trap_pf.h b/arch/x86/include/asm/trap_pf.h index afa524325e55..7fc4db774dd6 100644 --- a/arch/x86/include/asm/trap_pf.h +++ b/arch/x86/include/asm/trap_pf.h @@ -2,6 +2,8 @@ #ifndef _ASM_X86_TRAP_PF_H #define _ASM_X86_TRAP_PF_H +#include <linux/bits.h> /* BIT() macro */ + /* * Page fault error code bits: * @@ -13,16 +15,18 @@ * bit 5 == 1: protection keys block access * bit 6 == 1: shadow stack access fault * bit 15 == 1: SGX MMU page-fault + * bit 31 == 1: fault was due to RMP violation */ 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, - X86_PF_SHSTK = 1 << 6, - X86_PF_SGX = 1 << 15, + X86_PF_PROT = BIT(0), + X86_PF_WRITE = BIT(1), + X86_PF_USER = BIT(2), + X86_PF_RSVD = BIT(3), + X86_PF_INSTR = BIT(4), + X86_PF_PK = BIT(5), + X86_PF_SHSTK = BIT(6), + X86_PF_SGX = BIT(15), + X86_PF_RMP = BIT(31), }; #endif /* _ASM_X86_TRAP_PF_H */ diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index ab778eac1952..7858b9515d4a 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -547,6 +547,7 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, unsigned long ad !(error_code & X86_PF_PROT) ? "not-present page" : (error_code & X86_PF_RSVD) ? "reserved bit violation" : (error_code & X86_PF_PK) ? "protection keys violation" : + (error_code & X86_PF_RMP) ? "RMP violation" : "permissions violation"); if (!(error_code & X86_PF_USER) && user_mode(regs)) {