[PATCH i-g-t v6 03/17] lib/gpgpu_shader: Extend shader building library

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Sep 9 06:54:06 UTC 2024


On Thu, Sep 05, 2024 at 11:27:58AM +0200, Christoph Manszewski wrote:

<cut>

> +
> +/**
> + * gpgpu_shader__end_system_routine:
> + * @shdr: shader to be modified
> + * @breakpoint_suppress: breakpoint suppress flag
> + *
> + * Return from system routine. To prevent infinite jumping to the system
> + * routine on a breakpoint, @breakpoint_suppress flag has to be set.
> + */
> +void gpgpu_shader__end_system_routine(struct gpgpu_shader *shdr,
> +				      bool breakpoint_suppress)
> +{
> +	/*
> +	 * set breakpoint suppress bit to avoid an endless loop
> +	 * when sip was invoked by a breakpoint
> +	 */
> +	if (breakpoint_suppress)
> +		emit_iga64_code(shdr, breakpoint_suppress, "			\n\
> +(W)	or  (1|M0)               cr0.0<1>:ud   cr0.0<0;1,0>:ud   0x8000:ud	\n\
> +		");
> +
> +	emit_iga64_code(shdr, end_system_routine, "				\n\
> +(W)	and (1|M0)               cr0.1<1>:ud   cr0.1<0;1,0>:ud   ARG(0):ud	\n\
> +	// return to an application						\n\
> +(W)	and (1|M0)               cr0.0<1>:ud   cr0.0<0;1,0>:ud   0x7FFFFFFD:ud	\n\

I'm reading documentation and I've doubts regarding 0x7ffffffd value.
If I understand correctly, the bits 0 and 2 are mbz, so mask here
should likely be 0x7ffffffa.

> +	", 0x7fffff | (1 << 26)); /* clear all exceptions, except read only bit */
> +}
> +

--
Zbigniew



More information about the igt-dev mailing list