From: Jarkko Sakkinen <jarkko@kernel.org>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: linux-mm@kvack.org, Dave Hansen <dave.hansen@linux.intel.com>,
linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org,
Dinh Nguyen <dinguyen@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-sgx@vger.kernel.org
Subject: Re: [PATCH 2/5] x86/sgx: use VM_ACCESS_FLAGS
Date: Sun, 23 Oct 2022 23:07:43 +0300 [thread overview]
Message-ID: <Y1WfD1x+XDi3xvpL@kernel.org> (raw)
In-Reply-To: <20221019034945.93081-3-wangkefeng.wang@huawei.com>
On Wed, Oct 19, 2022 at 11:49:42AM +0800, Kefeng Wang wrote:
> Simplify VM_READ|VM_WRITE|VM_EXEC with VM_ACCESS_FLAGS.
>
> Cc: Jarkko Sakkinen <jarkko@kernel.org>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> arch/x86/kernel/cpu/sgx/encl.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c
> index 1ec20807de1e..6225c525372d 100644
> --- a/arch/x86/kernel/cpu/sgx/encl.c
> +++ b/arch/x86/kernel/cpu/sgx/encl.c
> @@ -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;
> --
> 2.35.3
>
Why?
BR, Jarkko
WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Dinh Nguyen <dinguyen@kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
linux-sgx@vger.kernel.org, amd-gfx@lists.freedesktop.org,
linux-mm@kvack.org
Subject: Re: [PATCH 2/5] x86/sgx: use VM_ACCESS_FLAGS
Date: Sun, 23 Oct 2022 23:07:43 +0300 [thread overview]
Message-ID: <Y1WfD1x+XDi3xvpL@kernel.org> (raw)
In-Reply-To: <20221019034945.93081-3-wangkefeng.wang@huawei.com>
On Wed, Oct 19, 2022 at 11:49:42AM +0800, Kefeng Wang wrote:
> Simplify VM_READ|VM_WRITE|VM_EXEC with VM_ACCESS_FLAGS.
>
> Cc: Jarkko Sakkinen <jarkko@kernel.org>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> arch/x86/kernel/cpu/sgx/encl.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c
> index 1ec20807de1e..6225c525372d 100644
> --- a/arch/x86/kernel/cpu/sgx/encl.c
> +++ b/arch/x86/kernel/cpu/sgx/encl.c
> @@ -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;
> --
> 2.35.3
>
Why?
BR, Jarkko
next prev parent reply other threads:[~2022-10-23 20:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-19 3:49 [PATCH 0/5] mm: cleanup with VM_ACCESS_FLAGS Kefeng Wang
2022-10-19 3:49 ` Kefeng Wang
2022-10-19 3:49 ` [PATCH 1/5] nios2: remove unused INIT_MMAP Kefeng Wang
2022-10-19 3:49 ` Kefeng Wang
2022-10-19 3:49 ` [PATCH 2/5] x86/sgx: use VM_ACCESS_FLAGS Kefeng Wang
2022-10-19 3:49 ` Kefeng Wang
2022-10-23 20:07 ` Jarkko Sakkinen [this message]
2022-10-23 20:07 ` Jarkko Sakkinen
2022-10-23 20:09 ` Jarkko Sakkinen
2022-10-23 20:09 ` Jarkko Sakkinen
2022-10-19 3:49 ` [PATCH 3/5] mm: mprotect: " Kefeng Wang
2022-10-19 3:49 ` Kefeng Wang
2022-10-19 3:49 ` [PATCH 4/5] mm: debug_vm_pgtable: " Kefeng Wang
2022-10-19 3:49 ` Kefeng Wang
2022-10-19 3:49 ` [PATCH 5/5] amdgpu: " Kefeng Wang
2022-10-19 3:49 ` Kefeng Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y1WfD1x+XDi3xvpL@kernel.org \
--to=jarkko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dave.hansen@linux.intel.com \
--cc=dinguyen@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-sgx@vger.kernel.org \
--cc=wangkefeng.wang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.