Maybe it would be simpler to call xive_source_is_initialized() instead of xive_eas_is_valid() in cases like this, e.g. hcall code since it is shared between emulation and KVM ?Yes but we need a better check than : if (lisn < SPAPR_XIRQ_BASE) { return !!xive_get_field64(EAS_END_INDEX, xive->eat[lisn].w); } This is more an heuristic than a precise test on the "validity" of a source at the KVM level.I guess we should be able to get kvmppc_xive_irq_state::valid from KVM by making the KVM_DEV_XIVE_GRP_SOURCE attribute readable. Would that be enough ?
A bit slow may be. Or an extra bit in the XiveSource 'status' field to reflect KVM initialization. C.
