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: <ff3a9c58-5c7a-4c48-8a9e-cc828a43baed@app.fastmail.com>
Date: Wed, 12 Mar 2025 16:34:06 +0100
From: "Sven Peter" <sven@...npeter.dev>
To: "Aditya Garg" <gargaditya08@...e.com>,
 "Thomas Zimmermann" <tzimmermann@...e.de>
Cc: "Aun-Ali Zaidi" <admin@...eit.net>, "Maxime Ripard" <mripard@...nel.org>,
 "airlied@...hat.com" <airlied@...hat.com>, "Simona Vetter" <simona@...ll.ch>,
 "Andy Shevchenko" <andriy.shevchenko@...ux.intel.com>,
 "Petr Mladek" <pmladek@...e.com>, "Steven Rostedt" <rostedt@...dmis.org>,
 "Rasmus Villemoes" <linux@...musvillemoes.dk>,
 "Sergey Senozhatsky" <senozhatsky@...omium.org>,
 "Jonathan Corbet" <corbet@....net>,
 "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
 "apw@...onical.com" <apw@...onical.com>, "joe@...ches.com" <joe@...ches.com>,
 "dwaipayanray1@...il.com" <dwaipayanray1@...il.com>,
 "lukas.bulwahn@...il.com" <lukas.bulwahn@...il.com>,
 "Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
 "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
 "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
 "Hector Martin" <marcan@...can.st>,
 "asahi@...ts.linux.dev" <asahi@...ts.linux.dev>
Subject: Re: [PATCH 1/2] lib/vsprintf: Add support for generic FourCCs by extending
 %p4cc

Hi,


On Wed, Mar 12, 2025, at 13:03, Aditya Garg wrote:
>> On 12 Mar 2025, at 5:29 PM, Thomas Zimmermann <tzimmermann@...e.de> wrote:
>> 
>> Hi
>> 
>>> Am 12.03.25 um 12:49 schrieb Aditya Garg:
>>> 
>>>>> On 12 Mar 2025, at 5:16 PM, Thomas Zimmermann <tzimmermann@...e.de> wrote:
>>>> 
>>>> Hi
>>>> 
>>>>> Am 12.03.25 um 10:05 schrieb Aditya Garg:
>>>>> From: Hector Martin <marcan@...can.st>
>>>>> 
>>>>> %p4cc is designed for DRM/V4L2 FourCCs with their specific quirks, but
>>>>> it's useful to be able to print generic 4-character codes formatted as
>>>>> an integer. Extend it to add format specifiers for printing generic
>>>>> 32-bit FourCCs with various endian semantics:
>>>>> 
>>>>> %p4ch    Host byte order
>>>>> %p4cn    Network byte order
>>>>> %p4cl    Little-endian
>>>>> %p4cb    Big-endian
>>>> That looks like someone trying to be too clever for their own good. Just my 2 cts.
>>> I don't understand what you are trying to say. Anyways, I thought it's obvious, but Petr's Ack is still left and thus cannot be merged into DRM for now unless he says so in this thread.
>> 
>> I'm trying to say that the author of this patch found the %p4cc functionality and over-generalized the feature. Source code should express the idea of what it's doing in clear terms. %p4ch somehow doesn't do that for me. Printing 4 bytes in various orders without context seems arbitrary and confusing.
>> 
>> (I don't really have a say here. I'm just asking to reconsider this change.)
>
> Ah I see. I'll checkout the macros you sent. The Asahi Linux SMC 
> drivers would need these as well, so I'll probably first wait for the 
> vsprintf maintainers and also Asahi Linux maintainers for their views.

I don't have a strong opinion either way: for SMC I just need to print
FourCC keys for debugging / information in a few places.

I'm preparing the SMC driver for upstreaming again (after a two year delay :-()
and was just going to use macros to print the SMC FourCC keys similar to
DRM_MODE_FMT/DRM_MODE_ARG for now to keep the series smaller and revisit
the topic later.

Right now I have these in my local tree (only compile tested so far):

#define SMC_KEY_FMT "%c%c%c%c (0x%08x)"
#define SMC_KEY_ARG(k) (k)>>24, (k)>>16, (k)>>8, (k), (k)

which are then used like this:

	dev_info(dev,
		"Initialized (%d keys " SMC_KEY_FMT " .. " SMC_KEY_FMT ")\n",
		 smc->key_count, SMC_KEY_ARG(smc->first_key),
		 SMC_KEY_ARG(smc->last_key));

Best,

Sven

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ