ECC detection in KVM guest

That turns out to be a surprisingly interesting question.

There’s not a whole lot that neither a guest nor a host can do with the ECC information - correctable errors get corrected at the hardware layer, in-correctable errors are presumably signalled by the hypervisor in some way.

Different hypervisors deal with ECC in different ways - VirtualBox doesn’t make anything visible via dmi whereas ESXi does provide the ECC memory error counters via an emulated interface. No idea about KVM (I don’t have anything convenient running under KVM).

I wouldn’t worry about running ZFS in a vm; the host takes care of ECC. ZFS doesn’t really need ECC any more than any other filesystem (there’s a reason why no proper server lacks ECC).