On 03.09.2026 15:26, Jürgen Groß wrote:
> On 03.09.26 13:53, Jan Beulich wrote:
>> @@ -1914,6 +1914,8 @@ typedef long ret_t;
>>   
>>   ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>>   {
>> +    const struct vcpu *curr = current;
>> +    struct domain *currd = curr->domain;
>>       ret_t ret = 0;
>>   
>>       switch ( cmd )
>> @@ -1938,9 +1940,9 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HAN
>>           if ( copy_from_guest(&sched_shutdown, arg, 1) )
>>               break;
>>   
>> -        TRACE_TIME(TRC_SCHED_SHUTDOWN, current->domain->domain_id,
>> -                   current->vcpu_id, sched_shutdown.reason);
>> -        ret = domain_shutdown(current->domain, (u8)sched_shutdown.reason);
>> +        TRACE_TIME(TRC_SCHED_SHUTDOWN, currd->domain_id, curr->vcpu_id,
>> +                   sched_shutdown.reason);
>> +        ret = domain_shutdown(currd, sched_shutdown.reason);
>>   
>>           break;
>>       }
>> @@ -1948,19 +1950,18 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HAN
>>       case SCHEDOP_shutdown_code:
>>       {
>>           struct sched_shutdown sched_shutdown;
>> -        struct domain *d = current->domain;
>>   
>>           ret = -EFAULT;
>>           if ( copy_from_guest(&sched_shutdown, arg, 1) )
>>               break;
>>   
>> -        TRACE_TIME(TRC_SCHED_SHUTDOWN_CODE, d->domain_id, current->vcpu_id,
>> +        TRACE_TIME(TRC_SCHED_SHUTDOWN_CODE, currd->domain_id, curr->vcpu_id,
>>                      sched_shutdown.reason);
>>   
>> -        spin_lock(&d->shutdown_lock);
>> -        if ( d->shutdown_code == SHUTDOWN_CODE_INVALID )
>> -            d->shutdown_code = (u8)sched_shutdown.reason;
>> -        spin_unlock(&d->shutdown_lock);
>> +        spin_lock(&currd->shutdown_lock);
>> +        if ( currd->shutdown_code == SHUTDOWN_CODE_INVALID )
>> +            currd->shutdown_code = (uint8_t)sched_shutdown.reason;
>> +        spin_unlock(&currd->shutdown_lock);
>>   
>>           ret = 0;
>>           break;
> 
> What about the use of current in SCHEDOP_watchdog and SCHEDOP_pin_override
> handling?

I can change those too if that's wanted, also the one in SCHEDOP_remote_shutdown
handling then.

Jan

Reply via email to