Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp718422img; Wed, 20 Mar 2019 09:23:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9Tv2du99jQZ7JwPTGP4uo6HKYSupdmCJzYbqlte2YDWlwqt6QlahwXcSFTga0tbpS9mtq X-Received: by 2002:aa7:9397:: with SMTP id t23mr2302344pfe.238.1553099038625; Wed, 20 Mar 2019 09:23:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553099038; cv=none; d=google.com; s=arc-20160816; b=04UTX7IHTKLq6qdQ8vnNFzoCJzlVrB6k16LUw4+1347izQEyOah+JOgUKGPHa3Gqr2 3J0VgkflHhZ0S7PzgqmsQBSxjaziBoMHFaI4Evc04enmqXQPfAu9VcF5Vl0EXOl+uphM mN4k9+AIH2YFNwtbt0Hcfrtqh4ICcR2CzMOvPlzJr2c9zJaL4bhyCg9McKuWE2D9uD0x 8W6JCe100xWGMG8oESCFIDHE9OaRiwAZjRE+IPp0q0ZNXL2VCoBWY7+kNtz9iaqfJgqf xHLNAQ0ZTfl/bp3T9Q2si6kjXWZlBXTCNr+oS7HYGIcBETWimOj2FYfCSMVegi7HcL4f aChA== 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=hhHWXk5tFuLTqEa6mBYeaa5y7AYAU91w2hFpy0BNIhw=; b=aEphFyW4VwvPTqB4o+KGTUyyJCoB2M4NnJtgryM8o+K/Y3n/DEOg6GuU4BDoOoBEDE NNwbfkqRWG1Cpuh9ir2g910tbWLReXhj59SgoliR/Ieihjb2Yj2aznDs/U+O//PoMWDK 29Abb1MhZuofXsk2ouiTOcv2W9G6ePvFdyVsJeVsF7P+GPQJ+2hWa7uzU2uD4dic6zsk TZLIs2t/ZzB+6SBS01SslbkJkOrFp1ctjGLcckZLCoSlZl3tcJ4YkEq6F10dNLmleCSa QiNgmZza5VkKSvOfOB7MNCZa4X0/Oos9aXVDdwAkCitLN4uOxSuqnwnDb95laYKjQMMk snEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k18si1999228pfi.224.2019.03.20.09.23.42; Wed, 20 Mar 2019 09:23:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727626AbfCTQWg (ORCPT + 99 others); Wed, 20 Mar 2019 12:22:36 -0400 Received: from mga18.intel.com ([134.134.136.126]:41905 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbfCTQWf (ORCPT ); Wed, 20 Mar 2019 12:22:35 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2019 09:22:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,249,1549958400"; d="scan'208";a="135714755" Received: from sorenthe-mobl1.ger.corp.intel.com (HELO localhost) ([10.249.254.203]) by orsmga003.jf.intel.com with ESMTP; 20 Mar 2019 09:22:25 -0700 From: Jarkko Sakkinen To: linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org Cc: akpm@linux-foundation.org, dave.hansen@intel.com, sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.com, haitao.huang@intel.com, andriy.shevchenko@linux.intel.com, tglx@linutronix.de, kai.svahn@intel.com, bp@alien8.de, josh@joshtriplett.org, luto@kernel.org, kai.huang@intel.com, rientjes@google.com, Dave Hansen , Jarkko Sakkinen Subject: [PATCH v19,RESEND 06/27] x86/mm: x86/sgx: Add new 'PF_SGX' page fault error code bit Date: Wed, 20 Mar 2019 18:20:58 +0200 Message-Id: <20190320162119.4469-7-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190320162119.4469-1-jarkko.sakkinen@linux.intel.com> References: <20190320162119.4469-1-jarkko.sakkinen@linux.intel.com> 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: Sean Christopherson The SGX bit is set in the #PF error code if and only if the fault is detected by the Enclave Page Cache Map (EPCM), a hardware-managed table that enforces the paging permissions defined by the enclave, e.g. to prevent the kernel from changing the permissions of an enclave's page(s). Despite triggering a #PF, a #PF with PF_SGX has nothing to do with paging. Cc: Dave Hansen Signed-off-by: Sean Christopherson Signed-off-by: Jarkko Sakkinen --- arch/x86/include/asm/traps.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h index 7d6f3f3fad78..c3e02912e9c7 100644 --- a/arch/x86/include/asm/traps.h +++ b/arch/x86/include/asm/traps.h @@ -171,5 +171,6 @@ enum x86_pf_error_code { X86_PF_RSVD = 1 << 3, X86_PF_INSTR = 1 << 4, X86_PF_PK = 1 << 5, + X86_PF_SGX = 1 << 15, }; #endif /* _ASM_X86_TRAPS_H */ -- 2.19.1