On 04.03.2026 20:29, Oleksii Kurochko wrote:
> On 3/4/26 4:07 PM, Oleksii Kurochko wrote:
>>>> +void vcpu_sync_interrupts(struct vcpu *v)
>>> The sole caller passes "current". Are other uses of this function 
>>> planned?
>>> If not either "current" wants directly using here, or minimally the 
>>> parameter
>>> wants renaming to "curr". In fact ...
>>>
>>>> +{
>>>> +    unsigned long hvip = csr_read(CSR_HVIP);
>>> ... this suggests it's unlikely for the function to be valid to call 
>>> with
>>> other than "current".
>>
>> Agree, I will drop v argument and use current inside 
>> vcpu_sync_interrupts().
> 
> Then would you be okay with using current instead of v argument inside 
> vcpu_update_hvip()
> and vcpu_flush_interrupts() introduced in the next patch?

If they're going to be used only on current - yes, sure. Of course in the
overall picture you still want to consider whether to have every function
fetch "current", or whether to have a caller calling multiple such functions
in a row fetch it once, and pass it into the functions (possibly adding
ASSERT(curr = current) in each of them).

Jan

Reply via email to