Il 11/12/2013 14:35, Alexander Graf ha scritto: >>> >> + if (kvm_enabled()) { >>> >> + /* >>> >> + * The guest may want to directly execute from the rom >>> >> region, >>> >> + * so we better invalidate its icache >>> >> + */ >>> >> + flush_icache_range((uintptr_t)ptr, (uintptr_t)ptr + l); >>> >> + } >> > >> > Shouldn't KVM itself do that when a memslot is registered? There should >> > be no reason for non-TCG QEMU to flush the icache. > How would KVM know when things changed inside of a memory region? It's up to > user space to manage the contents of a memory region, no?
Yeah, that is true. BTW, shouldn't the same happen when you do migration? I'd prefer the above snippet to be replaced by a function in kvm-stub.c/kvm-all.c (kvm_flush_icache_range). I wonder if there would be a reason to add a KVM_FLUSH_ICACHE ioctl though. Could a virtually-indexed/virtually-tagged icache require flushing by guest address instead of host address? Paolo