* [PATCH 0/3] x86/sgx: Misc code cleanups @ 2019-08-23 21:52 Sean Christopherson 2019-08-23 21:52 ` [PATCH 1/3] x86/sgx: Tweak Kconfig help section according to checkpatch Sean Christopherson ` (3 more replies) 0 siblings, 4 replies; 5+ messages in thread From: Sean Christopherson @ 2019-08-23 21:52 UTC (permalink / raw) To: Jarkko Sakkinen; +Cc: linux-sgx Fix a few minor issues flagged by checkpatch. No functional change intended. Sean Christopherson (3): x86/sgx: Tweak Kconfig help section according to checkpatch x86/sgx: Add missing SPDX license to encls.c x86/sgx: Fix whitespace damage in sgx_encl_page_alloc() arch/x86/Kconfig | 2 +- arch/x86/kernel/cpu/sgx/encls.c | 3 +++ arch/x86/kernel/cpu/sgx/ioctl.c | 23 +++++++++++------------ 3 files changed, 15 insertions(+), 13 deletions(-) -- 2.22.0 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] x86/sgx: Tweak Kconfig help section according to checkpatch 2019-08-23 21:52 [PATCH 0/3] x86/sgx: Misc code cleanups Sean Christopherson @ 2019-08-23 21:52 ` Sean Christopherson 2019-08-23 21:52 ` [PATCH 2/3] x86/sgx: Add missing SPDX license to encls.c Sean Christopherson ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: Sean Christopherson @ 2019-08-23 21:52 UTC (permalink / raw) To: Jarkko Sakkinen; +Cc: linux-sgx Replace ---help--- with help as suggested by checkpatch. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> --- arch/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index eac03f448b59..2a8988aaa074 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1939,7 +1939,7 @@ config INTEL_SGX depends on X86_64 && CPU_SUP_INTEL select SRCU select MMU_NOTIFIER - ---help--- + help Intel(R) SGX is a set of CPU instructions that can be used by applications to set aside private regions of code and data, referred to as enclaves. An enclave's private memory can only be accessed by -- 2.22.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] x86/sgx: Add missing SPDX license to encls.c 2019-08-23 21:52 [PATCH 0/3] x86/sgx: Misc code cleanups Sean Christopherson 2019-08-23 21:52 ` [PATCH 1/3] x86/sgx: Tweak Kconfig help section according to checkpatch Sean Christopherson @ 2019-08-23 21:52 ` Sean Christopherson 2019-08-23 21:52 ` [PATCH 3/3] x86/sgx: Fix whitespace damage in sgx_encl_page_alloc() Sean Christopherson 2019-08-26 5:38 ` [PATCH 0/3] x86/sgx: Misc code cleanups Jarkko Sakkinen 3 siblings, 0 replies; 5+ messages in thread From: Sean Christopherson @ 2019-08-23 21:52 UTC (permalink / raw) To: Jarkko Sakkinen; +Cc: linux-sgx Tag encls.c has being GPL2.0 or BSD-3 to match the other SGX source files. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> --- arch/x86/kernel/cpu/sgx/encls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/cpu/sgx/encls.c b/arch/x86/kernel/cpu/sgx/encls.c index 5045f1365e07..1b492c15a2b8 100644 --- a/arch/x86/kernel/cpu/sgx/encls.c +++ b/arch/x86/kernel/cpu/sgx/encls.c @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) +// Copyright(c) 2016-19 Intel Corporation. + #include <asm/cpufeature.h> #include <asm/traps.h> #include "encls.h" -- 2.22.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] x86/sgx: Fix whitespace damage in sgx_encl_page_alloc() 2019-08-23 21:52 [PATCH 0/3] x86/sgx: Misc code cleanups Sean Christopherson 2019-08-23 21:52 ` [PATCH 1/3] x86/sgx: Tweak Kconfig help section according to checkpatch Sean Christopherson 2019-08-23 21:52 ` [PATCH 2/3] x86/sgx: Add missing SPDX license to encls.c Sean Christopherson @ 2019-08-23 21:52 ` Sean Christopherson 2019-08-26 5:38 ` [PATCH 0/3] x86/sgx: Misc code cleanups Jarkko Sakkinen 3 siblings, 0 replies; 5+ messages in thread From: Sean Christopherson @ 2019-08-23 21:52 UTC (permalink / raw) To: Jarkko Sakkinen; +Cc: linux-sgx Fix a variety of recently introduced whitespace damage. No functional change intended. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> --- arch/x86/kernel/cpu/sgx/ioctl.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c index ead9fb2d9b69..3ce7849f067b 100644 --- a/arch/x86/kernel/cpu/sgx/ioctl.c +++ b/arch/x86/kernel/cpu/sgx/ioctl.c @@ -133,7 +133,7 @@ static struct sgx_encl_page *sgx_encl_page_alloc(struct sgx_encl *encl, u64 secinfo_flags) { struct sgx_encl_page *encl_page; - unsigned long prot; + unsigned long prot; encl_page = kzalloc(sizeof(*encl_page), GFP_KERNEL); if (!encl_page) @@ -145,18 +145,17 @@ static struct sgx_encl_page *sgx_encl_page_alloc(struct sgx_encl *encl, if (secinfo_flags & SGX_SECINFO_TCS) encl_page->desc |= SGX_ENCL_PAGE_TCS; + prot = _calc_vm_trans(secinfo_flags, SGX_SECINFO_R, PROT_READ) | + _calc_vm_trans(secinfo_flags, SGX_SECINFO_W, PROT_WRITE) | + _calc_vm_trans(secinfo_flags, SGX_SECINFO_X, PROT_EXEC); - prot = _calc_vm_trans(secinfo_flags, SGX_SECINFO_R, PROT_READ) | - _calc_vm_trans(secinfo_flags, SGX_SECINFO_W, PROT_WRITE) | - _calc_vm_trans(secinfo_flags, SGX_SECINFO_X, PROT_EXEC); - - /* - * TCS pages must always RW set for CPU access while the SECINFO - * permissions are *always* zero - the CPU ignores the user provided - * values and silently overwrites them with zero permissions. - */ - if ((secinfo_flags & SGX_SECINFO_PAGE_TYPE_MASK) == SGX_SECINFO_TCS) - prot |= PROT_READ | PROT_WRITE; + /* + * TCS pages must always RW set for CPU access while the SECINFO + * permissions are *always* zero - the CPU ignores the user provided + * values and silently overwrites them with zero permissions. + */ + if ((secinfo_flags & SGX_SECINFO_PAGE_TYPE_MASK) == SGX_SECINFO_TCS) + prot |= PROT_READ | PROT_WRITE; /* Calculate maximum of the VM flags for the page. */ encl_page->vm_max_prot_bits = calc_vm_prot_bits(prot, 0); -- 2.22.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] x86/sgx: Misc code cleanups 2019-08-23 21:52 [PATCH 0/3] x86/sgx: Misc code cleanups Sean Christopherson ` (2 preceding siblings ...) 2019-08-23 21:52 ` [PATCH 3/3] x86/sgx: Fix whitespace damage in sgx_encl_page_alloc() Sean Christopherson @ 2019-08-26 5:38 ` Jarkko Sakkinen 3 siblings, 0 replies; 5+ messages in thread From: Jarkko Sakkinen @ 2019-08-26 5:38 UTC (permalink / raw) To: Sean Christopherson; +Cc: linux-sgx On Fri, Aug 23, 2019 at 02:52:33PM -0700, Sean Christopherson wrote: > Fix a few minor issues flagged by checkpatch. No functional change > intended. > > Sean Christopherson (3): > x86/sgx: Tweak Kconfig help section according to checkpatch > x86/sgx: Add missing SPDX license to encls.c > x86/sgx: Fix whitespace damage in sgx_encl_page_alloc() > > arch/x86/Kconfig | 2 +- > arch/x86/kernel/cpu/sgx/encls.c | 3 +++ > arch/x86/kernel/cpu/sgx/ioctl.c | 23 +++++++++++------------ > 3 files changed, 15 insertions(+), 13 deletions(-) > > -- > 2.22.0 > I merged this and my kdoc update. Thank you. /Jarkko ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-08-26 5:38 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-08-23 21:52 [PATCH 0/3] x86/sgx: Misc code cleanups Sean Christopherson 2019-08-23 21:52 ` [PATCH 1/3] x86/sgx: Tweak Kconfig help section according to checkpatch Sean Christopherson 2019-08-23 21:52 ` [PATCH 2/3] x86/sgx: Add missing SPDX license to encls.c Sean Christopherson 2019-08-23 21:52 ` [PATCH 3/3] x86/sgx: Fix whitespace damage in sgx_encl_page_alloc() Sean Christopherson 2019-08-26 5:38 ` [PATCH 0/3] x86/sgx: Misc code cleanups Jarkko Sakkinen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).