On Tue, Nov 18 2025, Halil Pasic <[email protected]> wrote: > Hm, the -EINVAL is put into GPR2 which is 'Host Cookie' according to the > virtio specification: > https://docs.oasis-open.org/virtio/virtio/v1.3/csd01/virtio-v1.3-csd01.html#x1-2260002 > > Unfortunately, I did not find any words in the spec according to which > GPR2 can be used to indicate errors. There does seem to be handling in > the linux driver for that. It basically says negative is bad, but I can't > see that in the spec. It just says "For each notification, the driver > SHOULD use GPR4 to pass the host cookie received in GPR2 from the previous > notification." > > Maybe we want to update the spec to reflect what is in the filed.
Saying that the driver SHOULD check GPR2 for negative error values is probably fine, since it matches what is already out there. (Unfortunately, we can't mandate it without either a new feature bit or a new revision, and that would be overkill IMHO.) For the device, we say "The device MAY return a 64-bit host cookie in GPR2 to speed up the notification execution." -- the spec should probably also say that the device MAY return a negative error code.
