mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
x86/sgx: use VM_ACCESS_FLAGS
Simplify VM_READ|VM_WRITE|VM_EXEC with VM_ACCESS_FLAGS. Link: https://lkml.kernel.org/r/20221019034945.93081-3-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Jarkko Sakkinen <jarkko@kernel.org> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "Christian König" <christian.koenig@amd.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: David Airlie <airlied@gmail.com> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
93d38b72e4
commit
4f20566f5c
@ -268,7 +268,7 @@ static struct sgx_encl_page *sgx_encl_load_page_in_vma(struct sgx_encl *encl,
|
||||
unsigned long addr,
|
||||
unsigned long vm_flags)
|
||||
{
|
||||
unsigned long vm_prot_bits = vm_flags & (VM_READ | VM_WRITE | VM_EXEC);
|
||||
unsigned long vm_prot_bits = vm_flags & VM_ACCESS_FLAGS;
|
||||
struct sgx_encl_page *entry;
|
||||
|
||||
entry = xa_load(&encl->page_array, PFN_DOWN(addr));
|
||||
@ -502,7 +502,7 @@ static void sgx_vma_open(struct vm_area_struct *vma)
|
||||
int sgx_encl_may_map(struct sgx_encl *encl, unsigned long start,
|
||||
unsigned long end, unsigned long vm_flags)
|
||||
{
|
||||
unsigned long vm_prot_bits = vm_flags & (VM_READ | VM_WRITE | VM_EXEC);
|
||||
unsigned long vm_prot_bits = vm_flags & VM_ACCESS_FLAGS;
|
||||
struct sgx_encl_page *page;
|
||||
unsigned long count = 0;
|
||||
int ret = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user