On 15.10.2022 15:14, Henry Wang wrote:
> 
>> -----Original Message-----
>> From: Julien Grall <jul...@xen.org>
>> On 14/10/2022 12:19, Henry Wang wrote:
>>
>>>> -----Original Message-----
>>>> From: Julien Grall <jul...@xen.org>
>>>>> +        p2m_teardown(d, false);
>>>>
>>>> Today, it should be fine to ignore p2m_teardown(). But I would prefer if
>>>> we add an ASSERT()/BUG_ON() (or else) to make confirm this is the case.
>>>
>>> Sorry I do not really understand why we can ignore the p2m_teardown()
>>> probably because of my English.
>>
>> No, I forgot a word in my sentence. I was meant to say that the return
>> of p2m_teardown() can be ignored in our situation because it only return
>> 0 or -ERESTART. The latter cannnot happen when the preemption is not
>> enabled.
>>
>> But I would like to add some code (either ASSERT() or BUG_ON()) to
>> confirm that p2m_teardown() will always return 0.
> 
> I added the doc asked in your previous email. Also, I will use a
> 
> ASSERT(p2m_teardown(d, false) == 0);
> 
> in p2m_final_teardown() here.

Hopefully this was meant only as an abstract plan, not the exact code
you mean to add? ASSERT() expressions generally should not have side
effects (which includes function calls).

Jan

Reply via email to