On Fri, 25 Mar 2022 at 14:42, <liucong2@xxxxxxxxxx> wrote: > I found this issue on qmeu 4.2 with host linux 4.19, I want to > use qxl on arm64. on arm64, default page size is 64k, and the > qxl_rom_size is fixed 8192. OK, so the fix to this is "use a newer QEMU". > but when I read qxl_rom region in guest, guest os stopped and > I can see error message "load/store instruction decodeing not > implemented" in host side. it is because qxl rom bar memory > region didn't commit to kvm. > I only try qemu 6.0 rather than the latest version because > > I meet some compile issue. commit ce7015d9e8669e > > start v6.1.0-rc0, it will change the default qxl rom bar size > to 64k on my platform. then my problem disappear. but when > others create a memory region with the size less than one > page. when it run into kvm_align_section, it return 0 > again. This is correct behaviour. If the memory region is less than a complete host page then it is not possible for KVM to map it into the guest as directly accessible memory, because that can only be done in host-page sized chunks, and if the MR is a RAM region smaller than the page then there simply is not enough backing RAM there to map without incorrectly exposing to the guest whatever comes after the contents of the MR. For memory regions smaller than a page, KVM and QEMU will fall back to "treat like MMIO device access". As long as the guest is using simple load/store instructions to access the memory region (ie loading or storing a single general purpose register with no writeback, no acquire/release semantics, no load-store exclusives) this will work fine. KVM will drop out to QEMU, which will do the load or store and return the data to KVM, which will simulate the instruction execution and resume the guest. If you see the message about "load/store instruction decoding not implemented", that means the guest was trying to access the region with something other than a simple load/store. In this case you need to either: (1) change the device model to use a page-sized memory region (2) change the guest to use a simple load/store instruction to access it Which of these is the right thing will depend on exactly what the device and memory region is. thanks -- PMM