Thank-you for the simple example. I reproduced the failure.
To fix, add "-machine aux-ram-share=on -machine memory-backend=ram0"
(The previous longer example had the former but lacked the latter).
Without that, the volatile pc.ram region is still in the mix.
There you go, that kvm-tpr-opt message is almost always indicative of
user error. I think because it's the first vmstate to be loaded.
Nonetheless, we better update the documentation to:
-object memory-backend-file,id=ram0,size=4G,mem-path=/dev/shm/ram0,share=on -m
-4G \
-machine memory-backend=ram0 \
-machine aux-ram-share=on