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] [day] [month] [year] [list]
Message-ID: <1945451921.12277.1762774279163.JavaMail.zimbra@couthit.local>
Date: Mon, 10 Nov 2025 17:01:19 +0530 (IST)
From: Parvathi Pudi <parvathi@...thit.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: parvathi <parvathi@...thit.com>, andrew+netdev <andrew+netdev@...n.ch>, 
	davem <davem@...emloft.net>, edumazet <edumazet@...gle.com>, 
	kuba <kuba@...nel.org>, pabeni <pabeni@...hat.com>, 
	danishanwar <danishanwar@...com>, rogerq <rogerq@...nel.org>, 
	pmohan <pmohan@...thit.com>, basharath <basharath@...thit.com>, 
	afd <afd@...com>, linux-kernel <linux-kernel@...r.kernel.org>, 
	netdev <netdev@...r.kernel.org>, 
	linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>, 
	pratheesh <pratheesh@...com>, Prajith Jayarajan <prajith@...com>, 
	Vignesh Raghavendra <vigneshr@...com>, praneeth <praneeth@...com>, 
	srk <srk@...com>, rogerq <rogerq@...com>, 
	krishna <krishna@...thit.com>, mohan <mohan@...thit.com>
Subject: Re: [PATCH net-next v3 1/3] net: ti: icssm-prueth: Adds helper
 functions to configure and maintain FDB

Hi,

> Hi,
> 
>>> +void icssm_prueth_sw_fdb_tbl_init(struct prueth *prueth)
>>> +{
>>> +	struct fdb_tbl *t = prueth->fdb_tbl;
>>> +
>>> +	t->index_a = (struct fdb_index_array_t *)((__force const void *)
>>> +			prueth->mem[V2_1_FDB_TBL_LOC].va +
>>> +			V2_1_FDB_TBL_OFFSET);
>> 
>> We have
>> 
>>> +#define V2_1_FDB_TBL_LOC          PRUETH_MEM_SHARED_RAM
>> 
>> and existing code like:
>> 
>> void __iomem *sram_base = prueth->mem[PRUETH_MEM_SHARED_RAM].va;
>> 
>> so it seems like
>> 
>> t->index_a = sram_base + V2_1_FDB_TBL_OFFSET;
>> 
>> with no needs for any casts, since sram_base is a void * so can be
>> assigned to any pointer type.
>> 
>> And there are lots of cascading defines like:
>> 
>> /* 4 queue descriptors for port 0 (host receive). 32 bytes */
>> #define HOST_QUEUE_DESC_OFFSET          (HOST_QUEUE_SIZE_ADDR + 16)
>> 
>> /* table offset for queue size:
>> * 3 ports * 4 Queues * 1 byte offset = 12 bytes
>> */
>> #define HOST_QUEUE_SIZE_ADDR            (HOST_QUEUE_OFFSET_ADDR + 8)
>> /* table offset for queue:
>> * 4 Queues * 2 byte offset = 8 bytes
>> */
>> #define HOST_QUEUE_OFFSET_ADDR          (HOST_QUEUE_DESCRIPTOR_OFFSET_ADDR + 8)
>> /* table offset for Host queue descriptors:
>> * 1 ports * 4 Queues * 2 byte offset = 8 bytes
>> */
>> #define HOST_QUEUE_DESCRIPTOR_OFFSET_ADDR       (HOST_Q4_RX_CONTEXT_OFFSET + 8)
>> 
>> allowing code like:
>> 
>>	sram = sram_base + HOST_QUEUE_SIZE_ADDR;
>>	sram = sram_base + HOST_Q1_RX_CONTEXT_OFFSET;
>>	sram = sram_base + HOST_QUEUE_OFFSET_ADDR;
>>	sram = sram_base + HOST_QUEUE_DESCRIPTOR_OFFSET_ADDR;
>>	sram = sram_base + HOST_QUEUE_DESC_OFFSET;
>> 
> 
> Sure, we will check the feasibility and come back.
> 

We have updated the code to use sram_base + offset directly without any casts,
added the __iomem attribute to the structure, and modified the usage of its
members at all related places accordingly. With these modifications sparse is
able to check all such accesses.

We will post these changes in the next version for review.

Thanks and Regards,
Parvathi.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ