Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-20 Thread Nicola Vetrini
If the value is always initialized in the callee, then there's no problem configuring ECLAIR so that it knows that this parameter is always written, and therefore any subsequent use in the caller is ok. Another possibility is stating that a function never reads the pointee before writing

Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-20 Thread Nicola Vetrini
On 20/07/23 17:39, Julien Grall wrote: Hi, The e-mail is getting quite long. Can you trim the unnecessary bits when replying? Ok. On 20/07/2023 15:23, Nicola Vetrini wrote: The problem is that _t may be uninitialized, hence assigning its address to t could be problematic. But the

Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-20 Thread Julien Grall
Hi, The e-mail is getting quite long. Can you trim the unnecessary bits when replying? On 20/07/2023 15:23, Nicola Vetrini wrote: The problem is that _t may be uninitialized, hence assigning its address to t could be problematic. But the value is set right after. IOW, there is no read

Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-20 Thread Julien Grall
Hi Nicola, On 20/07/2023 11:14, Nicola Vetrini wrote: On 17/07/23 15:40, Julien Grall wrote: Hi Nicola, On 17/07/2023 13:08, Nicola Vetrini wrote: On 14/07/23 15:00, Julien Grall wrote: Hi Nicola, On 14/07/2023 12:49, Nicola Vetrini wrote: This patch aims to fix some occurrences of

Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-20 Thread Nicola Vetrini
On 20/07/23 12:14, Nicola Vetrini wrote: On 17/07/23 15:40, Julien Grall wrote: Hi Nicola, On 17/07/2023 13:08, Nicola Vetrini wrote: On 14/07/23 15:00, Julien Grall wrote: Hi Nicola, On 14/07/2023 12:49, Nicola Vetrini wrote: This patch aims to fix some occurrences of possibly

Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-20 Thread Nicola Vetrini
On 17/07/23 15:40, Julien Grall wrote: Hi Nicola, On 17/07/2023 13:08, Nicola Vetrini wrote: On 14/07/23 15:00, Julien Grall wrote: Hi Nicola, On 14/07/2023 12:49, Nicola Vetrini wrote: This patch aims to fix some occurrences of possibly uninitialized variables, that may be read before

Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-18 Thread Nicola Vetrini
On 17/07/23 23:15, Julien Grall wrote: Hi Nicola, I am currently looking at the code to check if we can avoid some SAF-*. But I need some clarification on the usage. On 14/07/2023 12:49, Nicola Vetrini wrote: @@ -2914,6 +2924,7 @@ static int __init make_vpl011_uart_node(struct

Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-17 Thread Julien Grall
Hi Nicola, I am currently looking at the code to check if we can avoid some SAF-*. But I need some clarification on the usage. On 14/07/2023 12:49, Nicola Vetrini wrote: @@ -2914,6 +2924,7 @@ static int __init make_vpl011_uart_node(struct kernel_info *kinfo) void *fdt = kinfo->fdt;

Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-17 Thread Julien Grall
Hi Nicola, On 17/07/2023 13:08, Nicola Vetrini wrote: On 14/07/23 15:00, Julien Grall wrote: Hi Nicola, On 14/07/2023 12:49, Nicola Vetrini wrote: This patch aims to fix some occurrences of possibly uninitialized variables, that may be read before being written. This behaviour would violate

Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-17 Thread Nicola Vetrini
On 14/07/23 15:00, Julien Grall wrote: Hi Nicola, On 14/07/2023 12:49, Nicola Vetrini wrote: This patch aims to fix some occurrences of possibly uninitialized variables, that may be read before being written. This behaviour would violate MISRA C:2012 Rule 9.1, besides being generally

Re: [RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-14 Thread Julien Grall
Hi Nicola, On 14/07/2023 12:49, Nicola Vetrini wrote: This patch aims to fix some occurrences of possibly uninitialized variables, that may be read before being written. This behaviour would violate MISRA C:2012 Rule 9.1, besides being generally undesirable. In all the analyzed cases, such

[RFC PATCH 1/4] xen/arm: justify or initialize conditionally uninitialized variables

2023-07-14 Thread Nicola Vetrini
This patch aims to fix some occurrences of possibly uninitialized variables, that may be read before being written. This behaviour would violate MISRA C:2012 Rule 9.1, besides being generally undesirable. In all the analyzed cases, such accesses were actually safe, but it's quite difficult to