lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7vb3ql7z5dac3kwo7nhibh5al7wemt45ibzuyk4bpyzpltzjml@go7rtyq4m6hq>
Date: Mon, 8 Jan 2024 15:24:06 -0600
From: Lucas De Marchi <lucas.demarchi@...el.com>
To: Michal Wajdeczko <michal.wajdeczko@...el.com>
CC: Dan Carpenter <dan.carpenter@...aro.org>,
	<kernel-janitors@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<dri-devel@...ts.freedesktop.org>, Maxime Ripard <mripard@...nel.org>,
	"Thomas Zimmermann" <tzimmermann@...e.de>, Rodrigo Vivi
	<rodrigo.vivi@...el.com>, <intel-xe@...ts.freedesktop.org>
Subject: Re: [PATCH] drm/xe: clean up type of GUC_HXG_MSG_0_ORIGIN

On Mon, Jan 08, 2024 at 09:46:47PM +0100, Michal Wajdeczko wrote:
>
>
>On 08.01.2024 15:07, Lucas De Marchi wrote:
>> On Mon, Jan 08, 2024 at 12:05:57PM +0300, Dan Carpenter wrote:
>>> The GUC_HXG_MSG_0_ORIGIN definition should be unsigned.  Currently it is
>>> defined as INT_MIN.  This doesn't cause a problem currently but it's
>>> still worth cleaning up.
>>>
>>> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
>>
>> it seems there are a few more places to change to follow what was done
>> in commit 962bd34bb457 ("drm/i915/uc: Fix undefined behavior due to
>> shift overflowing the constant").
>>
>> +Michal
>>
>> Could we eventually share these abi includes with i915 so we don't
>> keep fixing the same thing in 2 places?
>
>it should be possible and I guess we should plan for that while
>discussing all this new xe driver...
>
>anyway, what about creating new intel/ folder under drm/ ?

include/drm/intel/?

>
> - drm/intel/include/abi
>        guc_actions_abi.h
>        guc_klvs_abi.h
>        ...
>
>the only question would be what prefix should be used for macros:
>just GUC_ or INTEL_GUC_ or XE_GUC_ ?

if using a intel/ dir, probably better with INTEL_ prefix

>
>then we can also think of creating library with common helpers for GuC
>(for encoding/decoding HXG messages, preparing ADS, reading logs, etc)

with the other differences we have, I don't see much benefit,
particularly as it won't change for i915 wrt supported platforms.

>
>btw, we can also consider sharing register definitions:
>
> - drm/intel/include/regs
>        xe_engine_regs.h
>        xe_gt_regs.h
>        xe_regs_defs.h

same as above, I don't think it's worth it as xe will keep adding to it
and it doesn't care for all the previous platforms. For those files we
may eventually autogen them like done by mesa.

Lucas De Marchi

>
>Michal
>
>>
>> Lucas De Marchi
>>
>>> ---
>>> drivers/gpu/drm/xe/abi/guc_messages_abi.h | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/xe/abi/guc_messages_abi.h
>>> b/drivers/gpu/drm/xe/abi/guc_messages_abi.h
>>> index 3d199016cf88..c04606872e48 100644
>>> --- a/drivers/gpu/drm/xe/abi/guc_messages_abi.h
>>> +++ b/drivers/gpu/drm/xe/abi/guc_messages_abi.h
>>> @@ -40,7 +40,7 @@
>>>  */
>>>
>>> #define GUC_HXG_MSG_MIN_LEN            1u
>>> -#define GUC_HXG_MSG_0_ORIGIN            (0x1 << 31)
>>> +#define GUC_HXG_MSG_0_ORIGIN            (0x1U << 31)
>>> #define   GUC_HXG_ORIGIN_HOST            0u
>>> #define   GUC_HXG_ORIGIN_GUC            1u
>>> #define GUC_HXG_MSG_0_TYPE            (0x7 << 28)
>>> -- 
>>> 2.42.0
>>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ