[PATCH] drm/amdgpu: select ARCH_HAS_HMM and ZONE_DEVICE option

Kuehling, Felix Felix.Kuehling at amd.com
Thu Feb 21 00:17:33 UTC 2019


On 2019-02-20 6:34 p.m., Jerome Glisse wrote:
> On Wed, Feb 20, 2019 at 10:39:49PM +0000, Kuehling, Felix wrote:
>> On 2019-02-20 5:12 p.m., Jerome Glisse wrote:
>>> On Wed, Feb 20, 2019 at 07:18:17PM +0000, Kuehling, Felix wrote:
>>>> [+Jerome]
>>>>
>>>> Why to we need ZONE_DEVICE. I didn't think this was needed for mirroring
>>>> CPU page tables to device page tables.
>>>>
>>>> ARCH_HAS_HMM depends on (X86_64 || PPC64). Do we have some alternative
>>>> for ARM support?
>>>>
>>>> Also, the name ARCH_HAS_HMM looks like it's meant to be selected by the
>>>> CPU architecture rather than any driver. Jerome, do you have any advice?
>>> This patch is wrong you need to depend on ARCH_HAS_HMM and
>> Who selects ARCH_HAS_HMM? Currently I don't see this selected anywhere.
>> So any config option that depends on it will be invisible in menuconfig.
>> Do we need ARCH_HAS_HMM somewhere in the arch/x86/Kconfig and
>> arch/powerpc/Kconfig?
>>
>> Also, ARCH_HAS_HMM does not currently support ARM. Does that mean we
>> can't have ARM support in AMDGPU if we start using HMM?
> ARCH_HAS_HMM is defined by architecture that support HMM. So par x86
> and PPC. It should not be hard to add it to ARM (i can not remember if
> ARM has DAX yet or not, if ARM does not have DAX then you need to add
> that first).

Not having ARM support is a bummer. I just enabled KFD on ARM a few 
weeks ago. Now depending on HMM makes KFD unusable on ARM. [+Mark FYI] I 
hope this is only a temporary setback.


>> Finally, ARCH_HAS_HMM has a bunch of dependencies. If they are not met,
>> I guess it can't be enabled. Should those be "select"s instead?
> No they should not be selected, people configuring their system need
> to have the freedom of doing so. All those option are selected in all
> the big distribution.
As far as I can tell, the arch/x86/Kconfig doesn't select ARCH_HAS_HMM. 
Its default is "y", so it should be enabled on anything that meets the 
dependencies. But ZONE_DEVICE was not enabled by default. I think that's 
what broke our kernel configs.

We'll fix our own kernel configs to enable ZONE_DEVICE and ARCH_HAS_HMM 
to get our internal builds to work again.

I suspect other users with their own kernel configs will stumble over 
this and wonder why KFD and userptr support are disabled in their builds.

Regards,
   Felix


>
>> config ARCH_HAS_HMM
>>           bool
>>           default y
>>           depends on (X86_64 || PPC64)
>>           depends on ZONE_DEVICE
>>           depends on MMU && 64BIT
>>           depends on MEMORY_HOTPLUG
>>           depends on MEMORY_HOTREMOVE
>>           depends on SPARSEMEM_VMEMMAP
>>
> Cheers,
> Jérôme


More information about the amd-gfx mailing list