[PATCH] drm/ttm: provide default page protection for UML

Anton Ivanov anton.ivanov at cambridgegreys.com
Wed Sep 1 22:48:43 PDT 2021


On 02/09/2021 03:01, Randy Dunlap wrote:
> boot_cpu_data [struct cpuinfo_um (on UML)] does not have a struct
> member named 'x86', so provide a default page protection mode
> for CONFIG_UML.
> 
> Mends this build error:
> ../drivers/gpu/drm/ttm/ttm_module.c: In function ‘ttm_prot_from_caching’:
> ../drivers/gpu/drm/ttm/ttm_module.c:59:24: error: ‘struct cpuinfo_um’ has no member named ‘x86’
>    else if (boot_cpu_data.x86 > 3)
>                          ^
> 
> Fixes: 3bf3710e3718 ("drm/ttm: Add a generic TTM memcpy move for page-based iomem")
> Signed-off-by: Randy Dunlap <rdunlap at infradead.org>
> Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>
> Cc: Christian König <christian.koenig at amd.com>
> Cc: Huang Rui <ray.huang at amd.com>
> Cc: dri-devel at lists.freedesktop.org
> Cc: Jeff Dike <jdike at addtoit.com>
> Cc: Richard Weinberger <richard at nod.at>
> Cc: Anton Ivanov <anton.ivanov at cambridgegreys.com>
> Cc: linux-um at lists.infradead.org
> Cc: David Airlie <airlied at linux.ie>
> Cc: Daniel Vetter <daniel at ffwll.ch>
> ---
>   drivers/gpu/drm/ttm/ttm_module.c |    4 ++++
>   1 file changed, 4 insertions(+)
> 
> --- linux-next-20210901.orig/drivers/gpu/drm/ttm/ttm_module.c
> +++ linux-next-20210901/drivers/gpu/drm/ttm/ttm_module.c
> @@ -53,6 +53,9 @@ pgprot_t ttm_prot_from_caching(enum ttm_
>   	if (caching == ttm_cached)
>   		return tmp;
>   
> +#ifdef CONFIG_UML
> +	tmp = pgprot_noncached(tmp);
> +#else
>   #if defined(__i386__) || defined(__x86_64__)
>   	if (caching == ttm_write_combined)
>   		tmp = pgprot_writecombine(tmp);
> @@ -69,6 +72,7 @@ pgprot_t ttm_prot_from_caching(enum ttm_
>   #if defined(__sparc__)
>   	tmp = pgprot_noncached(tmp);
>   #endif
> +#endif
>   	return tmp;
>   }
>   

Patch looks OK.

I have a question though - why all of DRM is not !UML in config. Not 
like we can use them.

> 
> _______________________________________________
> linux-um mailing list
> linux-um at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-um
> 


-- 
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/



More information about the linux-um mailing list