Sample Header Ad - 728x90

Mapping Segment of Guest RAM to host file, in PPC QEMU

0 votes
1 answer
319 views
My desire is conceptually simple, I have a file (really a PCIe resource file from /sys/bus/pci/device/.... but that isn't too relevant) on the host that I want to make available somewhere in guest memory, so that changes from either side get reflected to each other. Since my goal was to actually map a limited segment of PCIe address space in the host, I couldn't productively map the entire guest RAM. The base command that I am trying to add is listed below. The goal is to get memory id "bar0.ram" mapped *somewhere* in guest memory. qemu-system-ppc -M ppce500 -cpu e500 -m 64M -d guest_errors,unimp -bios $PWD/test.elf -s -object memory-backend-file,size=1m,id=bar0.ram,mem-path=/sys/bus/pci/devices/0000\:04\:00.0/resource0,share=on -monitor telnet:127.0.0.1:4999,server,nowait -nographic Perhaps this would be easier on ARM or x86, but PPC doesn't offer persistent memory, nvram, multiple memory slots backed by different files, or similar tricks (that I could figure out how to get working). It does offer ivshmem, but I was unable to figure out how to get that to be transparently mapped into the guest address space. Vaguely useful/related resources: - https://unix.stackexchange.com/questions/616596/mapping-guest-ram-to-file-in-qemu - https://superuser.com/questions/1795238/qemu-system-sparc-shared-memory-between-host-and-guest - https://blog.reds.ch/?p=1379
Asked by Seth Robertson (411 rep)
Aug 2, 2023, 02:41 AM