[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH 10/10] arm/smmu: address violation of MISRA C:2012 Rule 8.2


  • To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Mon, 16 Oct 2023 18:07:27 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hp7Fcb1qV6vgMQw+SYtpcDEABPiJ2gUSdJzR9iK15C0=; b=CtHBstNkbeIlYQpjj+JsSUvsqhHB7nOb/TAAXfC+zmgVZjisTSPyp+H86xczr3ModcnlYt8D2gawEBKsc6YYATb2NrPzDSt3suRI8cFUiJkGFpNHEF5D8o8XIXcKtV91uIrNoPJVAmWDxjvwqVLE3ARrxHf3HnSWF7aigwuMnbOrEAMRABZ4F81S57x6bQhZ/q0GfE/cICYMigqU20P2EjPZAmT7grRlfnvC3ccoT8Hfy2EHqydqPRdIUtzz445oYDRPk/YKLyi8jELsbulGv8orpCY8/5RdL7TFR0JjWj7nAoR1A9+Acm8VI4Cm8GuNxQ8dRKzOblIMsya2bclDpA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=legIRmnRitQic34v3Us28itvzo8tVJzZNgECo82Qvw29uFQA5UDU7LMw2y0IG/8UbGvKBbVi1/DUuJkG4Tc2IE5zxroqafkg/V6P/23TRiSs42oARYpnneSXrclsUx7OHgUwHkv95cvy9B9bdangMhTepgVHriNPfMR/jOP6y9Z6dXp+Fcq4o5uXecAA4Z8qkB6SGLRa0u2L1KrxdAk0ePOHveG3CMVOlHjAsjkLhUv5p0HU8SMBFuipeautNa822b7wR2WtVHT6e07A27HX3lL8TqztyUdBtkchlvshQelJQa97qfKBh858CwK9k7yD4aPj4hqJJ3iDKAy/GXomHQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Federico Serafini <federico.serafini@xxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "consulting@xxxxxxxxxxx" <consulting@xxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>
  • Delivery-date: Mon, 16 Oct 2023 18:07:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZ/el7vMVF528FCE+PS9d3vBdu5bBMJIIAgABJvgCAAE0GAA==
  • Thread-topic: [XEN PATCH 10/10] arm/smmu: address violation of MISRA C:2012 Rule 8.2

Hi Bertrand

> On 16 Oct 2023, at 2:31 pm, Bertrand Marquis <bertrand.marquis@xxxxxxx> wrote:
> 
> Hi Julien,
> 
>> On 16 Oct 2023, at 11:07, Julien Grall <julien@xxxxxxx> wrote:
>> 
>> Hi,
>> 
>> On 13/10/2023 16:24, Federico Serafini wrote:
>>> Add missing parameter names, no functional change.
>>> Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>
>>> ---
>>> xen/drivers/passthrough/arm/smmu.c | 6 +++---
>> 
>> This file is using the Linux coding style because it is imported from Linux. 
>> I was under the impression we would exclude such file for now.
>> 
>> Looking at exclude-list.json, it doesn't seem to be present. I think this 
>> patch should be replaced with adding a line in execlude-list.json.
> 
> I think that during one of the discussions we said that this file already 
> deviated quite a lot from the status in Linux and we wanted to turn it to Xen 
> coding style in the future hence it is not listed in the exclude file.
> At the end having a working smmu might be critical in a safety context so it 
> will make sense to also check this part of xen.
> 
> @Rahul: do you agree ?

Yes, you are right current SMMUv3 code already deviates quite a lot from the 
status of Linux
because Xen handles the command queue in a different way than the way Linux 
handles it. 
More detailed can be found at the start of the SMMUv3 file. I am pasting it 
here also.

* 5. Latest version of the Linux SMMUv3 code implements the commands queue
* access functions based on atomic operations implemented in Linux.
* Atomic functions used by the commands queue access functions are not
* implemented in XEN therefore we decided to port the earlier version
* of the code. Atomic operations are introduced to fix the bottleneck of
* the SMMU command queue insertion operation. A new algorithm for
* inserting commands into the queue is introduced, which is
* lock-free on the fast-path.
* Consequence of reverting the patch is that the command queue insertion
* will be slow for large systems as spinlock will be used to serializes
* accesses from all CPUs to the single queue supported by the hardware.
* Once the proper atomic operations will be available in XEN the driver
* can be updated.
 
Anyway because of above reason backporting SMMUv3 Linux driver patches to Xen 
are
not straight forward. If making smmu-v3.c to Xen coding style helps in safety 
context I am okay
with that.

Regards,
Rahul 


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.