Re: [PATCH 2/6] i915/gvt/kvm: a NULL ->mm does not mean a thread is a kthread

2020-04-04 Thread Sergei Shtylyov
Hello! On 04.04.2020 12:40, Christoph Hellwig wrote: Use the proper API instead. Fixes: f440c8a572d7 ("drm/i915/gvt/kvmgt: read/write GPA via KVM API") Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/

[PATCH 1/6] amdgpu: a NULL ->mm does not mean a thread is a kthread

2020-04-04 Thread Christoph Hellwig
Use the proper API instead. Fixes: 70539bd795002 ("drm/amd: Update MEC HQD loading code for KFD") Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/driv

[PATCH 2/6] i915/gvt/kvm: a NULL ->mm does not mean a thread is a kthread

2020-04-04 Thread Christoph Hellwig
Use the proper API instead. Fixes: f440c8a572d7 ("drm/i915/gvt/kvmgt: read/write GPA via KVM API") Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt

[PATCH 5/6] kernel: better document the use_mm/unuse_mm API contract

2020-04-04 Thread Christoph Hellwig
Switch the function documentation to kerneldoc comments, and add WARN_ON_ONCE asserts that the calling thread is a kernel thread and does not have ->mm set (or has ->mm set in the case of unuse_mm). Also give the functions a kthread_ prefix to better document the use case. Signed-off-by: Christop

[PATCH 4/6] kernel: move use_mm/unuse_mm to kthread.c

2020-04-04 Thread Christoph Hellwig
These helpers are only for use with kernel threads, and I will tie them more into the kthread infrastructure going forward. Also move the prototypes to kthread.h - mmu_context.h was a little weird to start with as it otherwise contains very low-level MM bits. Signed-off-by: Christoph Hellwig ---

[PATCH 3/6] i915/gvt: remove unused xen bits

2020-04-04 Thread Christoph Hellwig
No Xen support anywhere here. Remove a dead declaration and an unused include. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.c | 1 - drivers/gpu/drm/i915/gvt/hypercall.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu

improve use_mm / unuse_mm

2020-04-04 Thread Christoph Hellwig
Hi all, this series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API. ___ Virtualization mailing list Virtualization@lists.linux-foundation.or

[PATCH 6/6] kernel: set USER_DS in kthread_use_mm

2020-04-04 Thread Christoph Hellwig
Some architectures like arm64 and s390 require USER_DS to be set for kernel threads to access user address space, which is the whole purpose of kthread_use_mm, but other like x86 don't. That has lead to a huge mess where some callers are fixed up once they are tested on said architectures, while o