On 11.02.2026 15:16, Jan Beulich wrote:
> On 09.02.2026 17:52, Oleksii Kurochko wrote:
>> @@ -124,3 +125,72 @@ void arch_vcpu_destroy(struct vcpu *v)
>> {
>> vfree((char *)v->arch.cpu_info + sizeof(struct cpu_info) - STACK_SIZE);
>> }
>> +
>> +int vcpu_set_interrupt(struct vcpu *v, unsigned int irq)
>> +{
>> + /*
>> + * We only allow VS-mode software, timer, and external
>> + * interrupts when irq is one of the local interrupts
>> + * defined by RISC-V privilege specification.
>> + */
>
> What is "when irq is one ..." intended to be telling me? There's no ...
>
>> + if ( irq != IRQ_VS_SOFT &&
>> + irq != IRQ_VS_TIMER &&
>> + irq != IRQ_VS_EXT )
>> + return -EINVAL;
>
> ... corresponding code (anymore), afaict.
>
> Further, who are the prospected callers of this function and its sibling
> below? If they're all internal (i.e. not reachable via hypercalls or
> emulation on behalf of the guest), this may want to be assertions.
Having seen a use in patch 08, I should clarify the "reachable" part here:
It's not the "reachable" alone, but whether the guest has control over the
"irq" value passed. For the example in patch 08 this isn't the case.
Jan