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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d85926bf-ad6b-4898-9c12-693ee185f3d6@redhat.com>
Date: Thu, 22 May 2025 17:26:33 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: netdev@...r.kernel.org, Willem de Bruijn
 <willemdebruijn.kernel@...il.com>, Jason Wang <jasowang@...hat.com>,
 Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
 Eugenio Pérez <eperezma@...hat.com>
Subject: Re: [PATCH net-next 1/8] virtio: introduce virtio_features_t

On 5/22/25 9:29 AM, Paolo Abeni wrote:
> On 5/21/25 6:02 PM, Michael S. Tsirkin wrote:
>> On Wed, May 21, 2025 at 12:32:35PM +0200, Paolo Abeni wrote:
>>> +++ b/include/linux/virtio_features.h
>>> @@ -0,0 +1,23 @@
>>> +/* SPDX-License-Identifier: GPL-2.0 */
>>> +#ifndef _LINUX_VIRTIO_FEATURES_H
>>> +#define _LINUX_VIRTIO_FEATURES_H
>>> +
>>> +#include <linux/bits.h>
>>> +
>>> +#if IS_ENABLED(CONFIG_ARCH_SUPPORTS_INT128)
>>> +#define VIRTIO_HAS_EXTENDED_FEATURES
>>> +#define VIRTIO_FEATURES_MAX	128
>>> +#define VIRTIO_FEATURES_WORDS	4
>>> +#define VIRTIO_BIT(b)		_BIT128(b)
>>> +
>>> +typedef __uint128_t		virtio_features_t;
>>
>> Since we are doing it anyway, what about __bitwise ?
> 
> Yep, I will add it in the next revision.

Uhm... this is actually problematic, as a key point of keeping the
diffstat manageable is converting only the relevant drivers to use the
extended features set - and adjust accordingly local variables and
expressions.

The above means that in other devices a lot of code relies on extended
features being (harmlessly, because nobody is going to set the highest
bits for such features) downgraded to u64, or u64 promoted to
virtio_features_t.

The __bitwise annotation generates warning for each of them; avoiding
that warning require touching the same code I wanted to leave unmodified
(and bring back a terrible diffstat).

/P


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ