From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: "Dinh Nguyen" <dinguyen@kernel.org>,
"Jarkko Sakkinen" <jarkko@kernel.org>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
linux-sgx@vger.kernel.org, amd-gfx@lists.freedesktop.org,
linux-mm@kvack.org, "Kefeng Wang" <wangkefeng.wang@huawei.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>
Subject: [PATCH 5/5] amdgpu: use VM_ACCESS_FLAGS
Date: Wed, 19 Oct 2022 11:49:45 +0800 [thread overview]
Message-ID: <20221019034945.93081-6-wangkefeng.wang@huawei.com> (raw)
In-Reply-To: <20221019034945.93081-1-wangkefeng.wang@huawei.com>
Simplify VM_READ|VM_WRITE|VM_EXEC with VM_ACCESS_FLAGS.
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 8ef31d687ef3..4728be161828 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -255,7 +255,7 @@ static int amdgpu_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_str
* becoming writable and makes is_cow_mapping(vm_flags) false.
*/
if (is_cow_mapping(vma->vm_flags) &&
- !(vma->vm_flags & (VM_READ | VM_WRITE | VM_EXEC)))
+ !(vma->vm_flags & VM_ACCESS_FLAGS))
vma->vm_flags &= ~VM_MAYWRITE;
return drm_gem_ttm_mmap(obj, vma);
--
2.35.3
prev parent reply other threads:[~2022-10-19 3:30 UTC|newest]
Thread overview: 8+ 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 ` [PATCH 1/5] nios2: remove unused INIT_MMAP Kefeng Wang
2022-10-19 3:49 ` [PATCH 2/5] x86/sgx: use VM_ACCESS_FLAGS Kefeng Wang
2022-10-23 20:07 ` 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 ` [PATCH 4/5] mm: debug_vm_pgtable: " Kefeng Wang
2022-10-19 3:49 ` Kefeng Wang [this message]
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=20221019034945.93081-6-wangkefeng.wang@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dave.hansen@linux.intel.com \
--cc=dinguyen@kernel.org \
--cc=jarkko@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-sgx@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox