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

Re: [PATCH 1/2] xen/dom0less: mark domain_p2m_set_allocation __init


  • To: Julien Grall <julien@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Wed, 14 May 2025 09:59:43 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=fYGQKwvDMibWlZyTnauyqqfrjFM0hj1b3c2yT7Z/Eeg=; b=Xi2KWf2Lv5VJTIm7DzuxfCKK2Yda//4zvuFABJR05p/iOXrk0e55070vtJisbvhLtuLYxXIi0jZ13PaDxk7rPxCgYVIjXfoPLnLoPBPAqhmPl7VUM2K/FA74AL0ezcWhOiN9FVCj99hA8qnOOM108w71jMSwTHY+vYpJ/RqSBmwWp1y339hpJMnCUd2GI81u0QPLLRqMK64VGKge+8DRJ30HPbjg6IyPkknFeVSuHcHjbNX+hKATxkuAacnq5VC8S7hNPN7GTKgZs78KLGP01JIDSzUjjPFhyjvsPOa63RJNT5i2GgOhO/iBv3Vn6RFXEfR+xrKO0b10JsVhXB1JqA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XsuZRKs89S2qSUO2xPZmRvD0QEKtKs1hZaFV4v2geDLnhnSdxfOuQh4DT5NHbGYxV33QYDUk6DuJEERpcA8L7FgPU/R2mrwVOfj3JaleYTBcmK3YgI2khpJpRpgwGRmUCB4ZxRIwzmUl7K6WeYstpyHjC9yZDlL+H/mASacKdByTLXpfCM25l7NJzAp6lJogpNT1INhQz6kCVqskGr0nTbgOdIAvnsTcRccI7V5FiXYJopVGcxy+TlOgp5ihg6RV5dVQLfHHWRUJRqs3/DqlaoZ1YM7O1RSwMwhijoKveETVxLUh9SiR1sdwmlr88xBAoqp4uhyma6NuX/UWWVymVw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Delivery-date: Wed, 14 May 2025 08:00:02 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 14/05/2025 09:55, Julien Grall wrote:
> 
> 
> On 14/05/2025 08:52, Orzel, Michal wrote:
>>
>>
>> On 14/05/2025 09:37, Julien Grall wrote:
>>> Hi Michal,
>>>
>>> On 14/05/2025 08:04, Orzel, Michal wrote:
>>>>
>>>>
>>>> On 14/05/2025 08:56, Jan Beulich wrote:
>>>>> On 14.05.2025 08:31, Orzel, Michal wrote:
>>>>>> On 14/05/2025 02:07, Stefano Stabellini wrote:
>>>>>>> On Tue, 13 May 2025, Stewart Hildebrand wrote:
>>>>>>>> All functions in dom0less-build.c should be __init.
>>>>>> Why? This patch is first in your series and by that time there is no 
>>>>>> build time
>>>>>> enforcement. Together with the Fixes tag it implies that this is somehow 
>>>>>> an
>>>>>> issue (i.e. build/runtime issue) other than inconsistency for which we 
>>>>>> surely
>>>>>> don't need Fixes tag.
>>>>>
>>>>> I disagree: Code not called post-init should be in .init.*. While not 
>>>>> formally
>>>>> a Misra violation (and wrongly so, I think), it imo effectively is: Such 
>>>>> code
>>>>> is otherwise unreachable post-init.
>>>> You have a point here, I agree. Although I don't think MISRA differentiates
>>>> between unreachable in general vs pre or post init. It defines it as code 
>>>> that
>>>> cannot be executed. It does not go into stages of runtime execution.
>>>>
>>>> I'm thinking how this is different from a function that is called e.g. 
>>>> only once
>>>> at specific point at runtime execution for which we did not come up with a
>>>> separate section?
>>>
>>> Along with what Jan said, in general there is some relaxation for the
>>> boot code. For instance, we could accept if it panic.
>>>
>>> There is at least one of the place in domain_build.c which panic() and
>>> the parsing is not meant to be fully robust. So this code either need to
>>> be __init (as this was the intention from when the feature was created)
>>> or you need to fully harden the code.
>> What is this place?
> 
> static void __init initialize_domU_xenstore(void)
> {
> [...]
>          rc = alloc_xenstore_evtchn(d);
>          if ( rc < 0 )
>              panic("%pd: Failed to allocate xenstore_evtchn\n", d);
> }
Sorry, I am a bit lost, maybe I don't understand your reply. Do you mean we need
to do sth about it (I can see it's __init and we have panic) or this is just an
example?

~Michal




 


Rackspace

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