[Nouveau] nouveau: DRM: GPU lockup - switching to software fbcon

2019-06-13 Thread Sergey Senozhatsky
5.2.0-rc4-next-20190613 dmesg nouveau :01:00.0: DRM: GPU lockup - switching to software fbcon nouveau :01:00.0: fifo: SCHED_ERROR 0a [CTXSW_TIMEOUT] nouveau :01:00.0: fifo: runlist 0: scheduled for recovery nouveau :01:00.0: fifo: channel 5: killed nouveau :01:00.0: fifo

Re: [Nouveau] [PATCH 22/22] mm: don't select MIGRATE_VMA_HELPER from HMM_MIRROR

2019-06-13 Thread John Hubbard
On 6/13/19 2:43 AM, Christoph Hellwig wrote: > The migrate_vma helper is only used by noveau to migrate device private > pages around. Other HMM_MIRROR users like amdgpu or infiniband don't > need it. > > Signed-off-by: Christoph Hellwig > --- > drivers/gpu/drm/nouveau/Kconfig | 1 + >

Re: [Nouveau] [PATCH 05/22] mm: export alloc_pages_vma

2019-06-13 Thread John Hubbard
On 6/13/19 2:43 AM, Christoph Hellwig wrote: > noveau is currently using this through an odd hmm wrapper, and I plan "nouveau" > to switch it to the real thing later in this series. > > Signed-off-by: Christoph Hellwig > --- Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA >

Re: [Nouveau] [PATCH 04/22] mm: don't clear ->mapping in hmm_devmem_free

2019-06-13 Thread John Hubbard
On 6/13/19 2:43 AM, Christoph Hellwig wrote: > ->mapping isn't even used by HMM users, and the field at the same offset > in the zone_device part of the union is declared as pad. (Which btw is > rather confusing, as DAX uses ->pgmap and ->mapping from two different > sides of the union, but DAX

Re: [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread John Hubbard
On 6/13/19 5:43 PM, Ira Weiny wrote: > On Thu, Jun 13, 2019 at 07:58:29PM +, Jason Gunthorpe wrote: >> On Thu, Jun 13, 2019 at 12:53:02PM -0700, Ralph Campbell wrote: >>> ... >> Hum, so the only thing this config does is short circuit here: >> >> static inline bool is_device_public_page(const

Re: [Nouveau] [PATCH 03/22] mm: remove hmm_devmem_add_resource

2019-06-13 Thread John Hubbard
On 6/13/19 2:43 AM, Christoph Hellwig wrote: > This function has never been used since it was first added to the kernel > more than a year and a half ago, and if we ever grow a consumer of the > MEMORY_DEVICE_PUBLIC infrastructure it can easily use devm_memremap_pages > directly now that we've

Re: [Nouveau] [PATCH] drm/nouveau/dmem: missing mutex_lock in error path

2019-06-13 Thread John Hubbard
On 6/13/19 5:11 PM, Ralph Campbell wrote: > In nouveau_dmem_pages_alloc(), the drm->dmem->mutex is unlocked before > calling nouveau_dmem_chunk_alloc(). > Reacquire the lock before continuing to the next page. > > Signed-off-by: Ralph Campbell > --- > > I found this while testing Jason

Re: [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 07:58:29PM +, Jason Gunthorpe wrote: > On Thu, Jun 13, 2019 at 12:53:02PM -0700, Ralph Campbell wrote: > > > > On 6/13/19 12:44 PM, Jason Gunthorpe wrote: > > > On Thu, Jun 13, 2019 at 11:43:21AM +0200, Christoph Hellwig wrote: > > > > The code hasn't been used since

Re: dev_pagemap related cleanups

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 08:40:46PM +, Jason Gunthorpe wrote: > On Thu, Jun 13, 2019 at 11:27:39AM -0700, Dan Williams wrote: > > On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: > > > > > > Hi Dan, Jérôme and Jason, > > > > > > below is a series that cleans up the dev_pagemap

Re: [Nouveau] [PATCH] drm/nouveau/dmem: missing mutex_lock in error path

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 05:11:21PM -0700, Ralph Campbell wrote: > In nouveau_dmem_pages_alloc(), the drm->dmem->mutex is unlocked before > calling nouveau_dmem_chunk_alloc(). > Reacquire the lock before continuing to the next page. > > Signed-off-by: Ralph Campbell > --- > > I found this while

Re: [PATCH 13/22] device-dax: use the dev_pagemap internal refcount

2019-06-13 Thread Ira Weiny
On Thu, Jun 13, 2019 at 11:43:16AM +0200, Christoph Hellwig wrote: > The functionality is identical to the one currently open coded in > device-dax. > > Signed-off-by: Christoph Hellwig > --- > drivers/dax/dax-private.h | 4 --- > drivers/dax/device.c | 52

[PATCH] drm/nouveau/dmem: missing mutex_lock in error path

2019-06-13 Thread Ralph Campbell
In nouveau_dmem_pages_alloc(), the drm->dmem->mutex is unlocked before calling nouveau_dmem_chunk_alloc(). Reacquire the lock before continuing to the next page. Signed-off-by: Ralph Campbell --- I found this while testing Jason Gunthorpe's hmm tree but this is independant of those changes. I

Re: [PATCH 10/22] memremap: add a migrate callback to struct dev_pagemap_ops

2019-06-13 Thread Ralph Campbell
On 6/13/19 2:43 AM, Christoph Hellwig wrote: This replaces the hacky ->fault callback, which is currently directly called from common code through a hmm specific data structure as an exercise in layering violations. Signed-off-by: Christoph Hellwig --- include/linux/hmm.h | 6 --

Re: [Nouveau] dev_pagemap related cleanups

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:21:01PM +0200, Christoph Hellwig wrote: > On Thu, Jun 13, 2019 at 08:40:46PM +, Jason Gunthorpe wrote: > > > Perhaps we should pull those out and resend them through hmm.git? > > > > It could be done - but how bad is the conflict resolution? > > Trivial. All but

Re: [Nouveau] [PATCH 02/22] mm: remove the struct hmm_device infrastructure

2019-06-13 Thread John Hubbard
On 6/13/19 2:43 AM, Christoph Hellwig wrote: > This code is a trivial wrapper around device model helpers, which > should have been integrated into the driver device model usage from > the start. Assuming it actually had users, which it never had since > the code was added more than 1 1/2 years

Re: dev_pagemap related cleanups

2019-06-13 Thread Christoph Hellwig
On Thu, Jun 13, 2019 at 08:40:46PM +, Jason Gunthorpe wrote: > > Perhaps we should pull those out and resend them through hmm.git? > > It could be done - but how bad is the conflict resolution? Trivial. All but one patch just apply using git-am, and the other one just has a few lines of

Re: [Nouveau] dev_pagemap related cleanups

2019-06-13 Thread Andrew Morton
On Thu, 13 Jun 2019 14:24:20 -0600 Logan Gunthorpe wrote: > > > On 2019-06-13 2:21 p.m., Dan Williams wrote: > > On Thu, Jun 13, 2019 at 1:18 PM Logan Gunthorpe wrote: > >> > >> > >> > >> On 2019-06-13 12:27 p.m., Dan Williams wrote: > >>> On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig

Re: [Nouveau] dev_pagemap related cleanups

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:27:39AM -0700, Dan Williams wrote: > On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: > > > > Hi Dan, Jérôme and Jason, > > > > below is a series that cleans up the dev_pagemap interface so that > > it is more easily usable, which removes the need to wrap it in

Re: dev_pagemap related cleanups

2019-06-13 Thread Logan Gunthorpe
On 2019-06-13 2:21 p.m., Dan Williams wrote: > On Thu, Jun 13, 2019 at 1:18 PM Logan Gunthorpe wrote: >> >> >> >> On 2019-06-13 12:27 p.m., Dan Williams wrote: >>> On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: Hi Dan, Jérôme and Jason, below is a series that

Re: dev_pagemap related cleanups

2019-06-13 Thread Dan Williams
On Thu, Jun 13, 2019 at 1:18 PM Logan Gunthorpe wrote: > > > > On 2019-06-13 12:27 p.m., Dan Williams wrote: > > On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: > >> > >> Hi Dan, Jérôme and Jason, > >> > >> below is a series that cleans up the dev_pagemap interface so that > >> it is

Re: dev_pagemap related cleanups

2019-06-13 Thread Logan Gunthorpe
On 2019-06-13 12:27 p.m., Dan Williams wrote: > On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: >> >> Hi Dan, Jérôme and Jason, >> >> below is a series that cleans up the dev_pagemap interface so that >> it is more easily usable, which removes the need to wrap it in hmm >> and thus

Re: [Nouveau] [PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill

2019-06-13 Thread Dan Williams
On Thu, Jun 13, 2019 at 1:12 PM Logan Gunthorpe wrote: > > > > On 2019-06-13 3:43 a.m., Christoph Hellwig wrote: > > Passing the actual typed structure leads to more understandable code > > vs the actual references. > > Ha, ok, I originally suggested this to Dan when he introduced the >

Re: [PATCH 07/22] memremap: move dev_pagemap callbacks into a separate structure

2019-06-13 Thread Logan Gunthorpe
On 2019-06-13 3:43 a.m., Christoph Hellwig wrote: > The dev_pagemap is a growing too many callbacks. Move them into a > separate ops structure so that they are not duplicated for multiple > instances, and an attacker can't easily overwrite them. > > Signed-off-by: Christoph Hellwig > --- >

Re: [PATCH 09/22] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-13 Thread Dan Williams
On Thu, Jun 13, 2019 at 12:35 PM Jason Gunthorpe wrote: > > On Thu, Jun 13, 2019 at 11:43:12AM +0200, Christoph Hellwig wrote: > > Just check if there is a ->page_free operation set and take care of the > > static key enable, as well as the put using device managed resources. > > diff --git

Re: [PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill

2019-06-13 Thread Logan Gunthorpe
On 2019-06-13 3:43 a.m., Christoph Hellwig wrote: > Passing the actual typed structure leads to more understandable code > vs the actual references. Ha, ok, I originally suggested this to Dan when he introduced the callback[1]. Reviewed-by: Logan Gunthorpe Logan [1]

Re: [Nouveau] [PATCH 22/22] mm: don't select MIGRATE_VMA_HELPER from HMM_MIRROR

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:25AM +0200, Christoph Hellwig wrote: > The migrate_vma helper is only used by noveau to migrate device private > pages around. Other HMM_MIRROR users like amdgpu or infiniband don't > need it. > > Signed-off-by: Christoph Hellwig > --- >

Re: [Nouveau] [PATCH] PCI: Expose hidden NVIDIA HDA controllers

2019-06-13 Thread Bjorn Helgaas
[+cc Rafael, Martin, zigarrre] On Thu, Jun 13, 2019 at 02:35:14PM +0800, Daniel Drake wrote: > From: Lukas Wunner > > The integrated HDA controller on Nvidia GPUs can be hidden with a bit in > the GPU's config space. Information about this scheme was provided by > NVIDIA on their forums. > >

Re: [Nouveau] [PATCH 21/22] mm: remove the HMM config option

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:24AM +0200, Christoph Hellwig wrote: > All the mm/hmm.c code is better keyed off HMM_MIRROR. Also let nouveau > depend on it instead of the mix of a dummy dependency symbol plus the > actually selected one. Drop various odd dependencies, as the code is > pretty

Re: [Nouveau] [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 12:53:02PM -0700, Ralph Campbell wrote: > > On 6/13/19 12:44 PM, Jason Gunthorpe wrote: > > On Thu, Jun 13, 2019 at 11:43:21AM +0200, Christoph Hellwig wrote: > > > The code hasn't been used since it was added to the tree, and doesn't > > > appear to actually be usable.

Re: [Nouveau] [PATCH 20/22] mm: sort out the DEVICE_PRIVATE Kconfig mess

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:23AM +0200, Christoph Hellwig wrote: > The ZONE_DEVICE support doesn't depend on anything HMM related, just on > various bits of arch support as indicated by the architecture. Also > don't select the option from nouveau as it isn't present in many setups, > and

Re: [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread Ralph Campbell
On 6/13/19 12:44 PM, Jason Gunthorpe wrote: On Thu, Jun 13, 2019 at 11:43:21AM +0200, Christoph Hellwig wrote: The code hasn't been used since it was added to the tree, and doesn't appear to actually be usable. Mark it as BROKEN until either a user comes along or we finally give up on it.

Re: [Nouveau] [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:21AM +0200, Christoph Hellwig wrote: > The code hasn't been used since it was added to the tree, and doesn't > appear to actually be usable. Mark it as BROKEN until either a user > comes along or we finally give up on it. > > Signed-off-by: Christoph Hellwig >

Re: [Nouveau] [PATCH] PCI: Expose hidden NVIDIA HDA controllers

2019-06-13 Thread Ilia Mirkin
On Thu, Jun 13, 2019 at 9:15 AM Ilia Mirkin wrote: > > On Thu, Jun 13, 2019 at 2:35 AM Daniel Drake wrote: > > > > From: Lukas Wunner > > > > The integrated HDA controller on Nvidia GPUs can be hidden with a bit in > > the GPU's config space. Information about this scheme was provided by > >

Re: [Nouveau] [PATCH 17/22] mm: remove hmm_devmem_add

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:20AM +0200, Christoph Hellwig wrote: > There isn't really much value add in the hmm_devmem_add wrapper. Just > factor out a little helper to find the resource, and otherwise let the > driver implement the dev_pagemap_ops directly. Was this commit message written

Re: [Nouveau] [PATCH 14/22] nouveau: use alloc_page_vma directly

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:17AM +0200, Christoph Hellwig wrote: > hmm_vma_alloc_locked_page is scheduled to go away, use the proper > mm function directly. > > Signed-off-by: Christoph Hellwig > --- > drivers/gpu/drm/nouveau/nouveau_dmem.c | 3 ++- > 1 file changed, 2 insertions(+), 1

Re: [PATCH 11/22] memremap: remove the data field in struct dev_pagemap

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:14AM +0200, Christoph Hellwig wrote: > struct dev_pagemap is always embedded into a containing structure, so > there is no need to an additional private data field. > > Signed-off-by: Christoph Hellwig > --- > drivers/nvdimm/pmem.c| 2 +- >

Re: [Nouveau] [PATCH 09/22] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:12AM +0200, Christoph Hellwig wrote: > Just check if there is a ->page_free operation set and take care of the > static key enable, as well as the put using device managed resources. > diff --git a/mm/hmm.c b/mm/hmm.c > index c76a1b5defda..6dc769feb2e1 100644 > +++

Re: [Nouveau] [PATCH] PCI: Expose hidden NVIDIA HDA controllers

2019-06-13 Thread Lukas Wunner
On Thu, Jun 13, 2019 at 09:15:31AM -0400, Ilia Mirkin wrote: > On Thu, Jun 13, 2019 at 2:35 AM Daniel Drake wrote: > > Link: https://devtalk.nvidia.com/default/topic/1024022 > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75985 > > Cc: Aaron Plattner > > Cc: Peter Wu > > Cc: Ilia

Re: [PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:11AM +0200, Christoph Hellwig wrote: > Passing the actual typed structure leads to more understandable code > vs the actual references. > > Signed-off-by: Christoph Hellwig > drivers/dax/device.c | 7 +++ > drivers/nvdimm/pmem.c | 6

Re: [PATCH 07/22] memremap: move dev_pagemap callbacks into a separate structure

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:10AM +0200, Christoph Hellwig wrote: > The dev_pagemap is a growing too many callbacks. Move them into a > separate ops structure so that they are not duplicated for multiple > instances, and an attacker can't easily overwrite them. Reviewed-by: Jason Gunthorpe

Re: [Nouveau] [PATCH 06/22] mm: factor out a devm_request_free_mem_region helper

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:09AM +0200, Christoph Hellwig wrote: > Keep the physical address allocation that hmm_add_device does with the > rest of the resource code, and allow future reuse of it without the hmm > wrapper. > > Signed-off-by: Christoph Hellwig > include/linux/ioport.h | 2 ++

Re: [PATCH 04/22] mm: don't clear ->mapping in hmm_devmem_free

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:07AM +0200, Christoph Hellwig wrote: > ->mapping isn't even used by HMM users, and the field at the same offset > in the zone_device part of the union is declared as pad. (Which btw is > rather confusing, as DAX uses ->pgmap and ->mapping from two different > sides

Re: [Nouveau] [PATCH 03/22] mm: remove hmm_devmem_add_resource

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:06AM +0200, Christoph Hellwig wrote: > This function has never been used since it was first added to the kernel > more than a year and a half ago, and if we ever grow a consumer of the > MEMORY_DEVICE_PUBLIC infrastructure it can easily use devm_memremap_pages >

Re: [Nouveau] [PATCH 02/22] mm: remove the struct hmm_device infrastructure

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:05AM +0200, Christoph Hellwig wrote: > This code is a trivial wrapper around device model helpers, which > should have been integrated into the driver device model usage from > the start. Assuming it actually had users, which it never had since > the code was added

Re: [PATCH 01/22] mm: remove the unused ARCH_HAS_HMM_DEVICE Kconfig option

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:04AM +0200, Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > --- > mm/Kconfig | 10 -- > 1 file changed, 10 deletions(-) So long as we are willing to run a hmm.git we can merge only complete features going forward. Thus we don't need the crazy

Re: [Nouveau] dev_pagemap related cleanups

2019-06-13 Thread Dan Williams
On Thu, Jun 13, 2019 at 2:43 AM Christoph Hellwig wrote: > > Hi Dan, Jérôme and Jason, > > below is a series that cleans up the dev_pagemap interface so that > it is more easily usable, which removes the need to wrap it in hmm > and thus allowing to kill a lot of code > > Diffstat: > > 22 files

[Nouveau] NOUVEAU_LEGACY_CTX_SUPPORT Fan Speed

2019-06-13 Thread Mar Mel
As of kernel 5.1.9, on resume from suspend, my NV50 fan runs at full speed. Not sure if it has to do with this new config option (NOUVEAU_LEGACY_CTX_SUPPORT)? This issue is not present using kernel 5.0.21. Years ago I filed a similar issue: 60704 – [nouveau, git regression] - I2C PWM fan

Re: [Nouveau] dev_pagemap related cleanups

2019-06-13 Thread Jason Gunthorpe
On Thu, Jun 13, 2019 at 11:43:03AM +0200, Christoph Hellwig wrote: > Hi Dan, Jérôme and Jason, > > below is a series that cleans up the dev_pagemap interface so that > it is more easily usable, which removes the need to wrap it in hmm > and thus allowing to kill a lot of code Do you want some of

Re: [Nouveau] Question on interoperability with Nouveau

2019-06-13 Thread Ilia Mirkin
This is done with a sequence of blits, from level 0 -> level 1, then level 1 -> level 2, etc. st/mesa has a helper which will call the gallium driver's blit method with the appropriate parameters. Internally, assuming there's nothing too funky going on, we'll use the 2d blit logic (class 0x902d).

[Nouveau] Question on interoperability with Nouveau

2019-06-13 Thread Fernando Sahmkow
Hi guys again. A homebrew developer (homebrew is custom software made for the switch using openGL under nouveau) reported to me that 'glGenerateMipmap' wasn't working on yuzu (Nintendo Switch emulator). I looked into it and I noticed all the triangle data used by nouveau to render the mipmaps was

Re: [Nouveau] [PATCH] PCI: Expose hidden NVIDIA HDA controllers

2019-06-13 Thread Ilia Mirkin
On Thu, Jun 13, 2019 at 2:35 AM Daniel Drake wrote: > > From: Lukas Wunner > > The integrated HDA controller on Nvidia GPUs can be hidden with a bit in > the GPU's config space. Information about this scheme was provided by > NVIDIA on their forums. > > Many laptops now ship with this device

[Nouveau] [PATCH] nouveau: no need to check return value of debugfs_create functions

2019-06-13 Thread Greg Kroah-Hartman
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-de...@lists.freedesktop.org Cc:

[Nouveau] [PATCH 10/22] memremap: add a migrate callback to struct dev_pagemap_ops

2019-06-13 Thread Christoph Hellwig
This replaces the hacky ->fault callback, which is currently directly called from common code through a hmm specific data structure as an exercise in layering violations. Signed-off-by: Christoph Hellwig --- include/linux/hmm.h | 6 -- include/linux/memremap.h | 6 ++

[Nouveau] [PATCH 19/22] mm: simplify ZONE_DEVICE page private data

2019-06-13 Thread Christoph Hellwig
Remove the clumsy hmm_devmem_page_{get,set}_drvdata helpers, and instead just access the page directly. Also make the page data a void pointer, and thus much easier to use. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 18 +++-- include/linux/hmm.h

[Nouveau] [PATCH 09/22] memremap: lift the devmap_enable manipulation into devm_memremap_pages

2019-06-13 Thread Christoph Hellwig
Just check if there is a ->page_free operation set and take care of the static key enable, as well as the put using device managed resources. Signed-off-by: Christoph Hellwig --- drivers/nvdimm/pmem.c | 23 +++-- include/linux/mm.h| 10 kernel/memremap.c | 59

[Nouveau] [PATCH 18/22] mm: mark DEVICE_PUBLIC as broken

2019-06-13 Thread Christoph Hellwig
The code hasn't been used since it was added to the tree, and doesn't appear to actually be usable. Mark it as BROKEN until either a user comes along or we finally give up on it. Signed-off-by: Christoph Hellwig --- mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/Kconfig

[Nouveau] [PATCH 17/22] mm: remove hmm_devmem_add

2019-06-13 Thread Christoph Hellwig
There isn't really much value add in the hmm_devmem_add wrapper. Just factor out a little helper to find the resource, and otherwise let the driver implement the dev_pagemap_ops directly. Signed-off-by: Christoph Hellwig --- Documentation/vm/hmm.rst | 26 include/linux/hmm.h |

[Nouveau] [PATCH 22/22] mm: don't select MIGRATE_VMA_HELPER from HMM_MIRROR

2019-06-13 Thread Christoph Hellwig
The migrate_vma helper is only used by noveau to migrate device private pages around. Other HMM_MIRROR users like amdgpu or infiniband don't need it. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/Kconfig | 1 + mm/Kconfig | 1 - 2 files changed, 1

[Nouveau] [PATCH 21/22] mm: remove the HMM config option

2019-06-13 Thread Christoph Hellwig
All the mm/hmm.c code is better keyed off HMM_MIRROR. Also let nouveau depend on it instead of the mix of a dummy dependency symbol plus the actually selected one. Drop various odd dependencies, as the code is pretty portable. Signed-off-by: Christoph Hellwig ---

[Nouveau] [PATCH 11/22] memremap: remove the data field in struct dev_pagemap

2019-06-13 Thread Christoph Hellwig
struct dev_pagemap is always embedded into a containing structure, so there is no need to an additional private data field. Signed-off-by: Christoph Hellwig --- drivers/nvdimm/pmem.c| 2 +- include/linux/memremap.h | 3 +-- kernel/memremap.c| 2 +- mm/hmm.c | 9

[Nouveau] [PATCH 20/22] mm: sort out the DEVICE_PRIVATE Kconfig mess

2019-06-13 Thread Christoph Hellwig
The ZONE_DEVICE support doesn't depend on anything HMM related, just on various bits of arch support as indicated by the architecture. Also don't select the option from nouveau as it isn't present in many setups, and depend on it instead. Signed-off-by: Christoph Hellwig ---

[Nouveau] [PATCH 15/22] nouveau: use devm_memremap_pages directly

2019-06-13 Thread Christoph Hellwig
Just use devm_memremap_pages instead of hmm_devmem_add pages to allow killing that wrapper which doesn't provide a whole lot of benefits. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 80 -- 1 file changed, 38 insertions(+), 42

[Nouveau] [PATCH 13/22] device-dax: use the dev_pagemap internal refcount

2019-06-13 Thread Christoph Hellwig
The functionality is identical to the one currently open coded in device-dax. Signed-off-by: Christoph Hellwig --- drivers/dax/dax-private.h | 4 --- drivers/dax/device.c | 52 +-- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git

[Nouveau] [PATCH 16/22] mm: remove hmm_vma_alloc_locked_page

2019-06-13 Thread Christoph Hellwig
The only user of it has just been removed, and there wasn't really any need to wrap a basic memory allocator to start with. Signed-off-by: Christoph Hellwig --- include/linux/hmm.h | 3 --- mm/hmm.c| 14 -- 2 files changed, 17 deletions(-) diff --git

[Nouveau] [PATCH 14/22] nouveau: use alloc_page_vma directly

2019-06-13 Thread Christoph Hellwig
hmm_vma_alloc_locked_page is scheduled to go away, use the proper mm function directly. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c

[Nouveau] [PATCH 07/22] memremap: move dev_pagemap callbacks into a separate structure

2019-06-13 Thread Christoph Hellwig
The dev_pagemap is a growing too many callbacks. Move them into a separate ops structure so that they are not duplicated for multiple instances, and an attacker can't easily overwrite them. Signed-off-by: Christoph Hellwig --- drivers/dax/device.c | 6 +-

[Nouveau] [PATCH 12/22] memremap: provide an optional internal refcount in struct dev_pagemap

2019-06-13 Thread Christoph Hellwig
Provide an internal refcounting logic if no ->ref field is provided in the pagemap passed into devm_memremap_pages so that callers don't have to reinvent it poorly. Signed-off-by: Christoph Hellwig --- include/linux/memremap.h | 4 +++ kernel/memremap.c | 60

[Nouveau] [PATCH 03/22] mm: remove hmm_devmem_add_resource

2019-06-13 Thread Christoph Hellwig
This function has never been used since it was first added to the kernel more than a year and a half ago, and if we ever grow a consumer of the MEMORY_DEVICE_PUBLIC infrastructure it can easily use devm_memremap_pages directly now that we've simplified the API for it. Signed-off-by: Christoph

[Nouveau] [PATCH 04/22] mm: don't clear ->mapping in hmm_devmem_free

2019-06-13 Thread Christoph Hellwig
->mapping isn't even used by HMM users, and the field at the same offset in the zone_device part of the union is declared as pad. (Which btw is rather confusing, as DAX uses ->pgmap and ->mapping from two different sides of the union, but DAX doesn't use hmm_devmem_free). Signed-off-by:

[Nouveau] [PATCH 05/22] mm: export alloc_pages_vma

2019-06-13 Thread Christoph Hellwig
noveau is currently using this through an odd hmm wrapper, and I plan to switch it to the real thing later in this series. Signed-off-by: Christoph Hellwig --- mm/mempolicy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 01600d80ae01..f9023b5fba37

[Nouveau] [PATCH 06/22] mm: factor out a devm_request_free_mem_region helper

2019-06-13 Thread Christoph Hellwig
Keep the physical address allocation that hmm_add_device does with the rest of the resource code, and allow future reuse of it without the hmm wrapper. Signed-off-by: Christoph Hellwig --- include/linux/ioport.h | 2 ++ kernel/resource.c | 39 +++

[Nouveau] [PATCH 08/22] memremap: pass a struct dev_pagemap to ->kill

2019-06-13 Thread Christoph Hellwig
Passing the actual typed structure leads to more understandable code vs the actual references. Signed-off-by: Christoph Hellwig --- drivers/dax/device.c | 7 +++ drivers/nvdimm/pmem.c | 6 +++--- drivers/pci/p2pdma.c | 6 +++--- include/linux/memremap.h

[Nouveau] [PATCH 02/22] mm: remove the struct hmm_device infrastructure

2019-06-13 Thread Christoph Hellwig
This code is a trivial wrapper around device model helpers, which should have been integrated into the driver device model usage from the start. Assuming it actually had users, which it never had since the code was added more than 1 1/2 years ago. Signed-off-by: Christoph Hellwig ---

[Nouveau] [PATCH 01/22] mm: remove the unused ARCH_HAS_HMM_DEVICE Kconfig option

2019-06-13 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- mm/Kconfig | 10 -- 1 file changed, 10 deletions(-) diff --git a/mm/Kconfig b/mm/Kconfig index f0c76ba47695..0d2ba7e1f43e 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -675,16 +675,6 @@ config ARCH_HAS_HMM_MIRROR depends on (X86_64 || PPC64)

[Nouveau] dev_pagemap related cleanups

2019-06-13 Thread Christoph Hellwig
Hi Dan, Jérôme and Jason, below is a series that cleans up the dev_pagemap interface so that it is more easily usable, which removes the need to wrap it in hmm and thus allowing to kill a lot of code Diffstat: 22 files changed, 245 insertions(+), 802 deletions(-) Git tree:

[Nouveau] [PATCH] PCI: Expose hidden NVIDIA HDA controllers

2019-06-13 Thread Daniel Drake
From: Lukas Wunner The integrated HDA controller on Nvidia GPUs can be hidden with a bit in the GPU's config space. Information about this scheme was provided by NVIDIA on their forums. Many laptops now ship with this device hidden, meaning that Linux users of affected platforms (where the HDMI