Skip to content

Commit 3eea843

Browse files
borntraegeravikivity
authored andcommitted
KVM: s390: Fix memslot initialization for userspace_addr != 0
Since commit 854b533 Author: Christian Ehrhardt <[email protected]> KVM: s390: streamline memslot handling s390 uses the values of the memslot instead of doing everything in the arch ioctl handler of the KVM_SET_USER_MEMORY_REGION. Unfortunately we missed to set the userspace_addr of our memslot due to our s390 ifdef in __kvm_set_memory_region. Old s390 userspace launchers did not notice, since they started the guest at userspace address 0. Because of CONFIG_DEFAULT_MMAP_MIN_ADDR we now put the guest at 1M userspace, which does not work. This patch makes sure that new.userspace_addr is set on s390. This fix should go in quickly. Nevertheless, looking at the code we should clean up that ifdef in the long term. Any kernel janitors? Signed-off-by: Christian Borntraeger <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
1 parent 4668f05 commit 3eea843

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

virt/kvm/kvm_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,10 @@ int __kvm_set_memory_region(struct kvm *kvm,
11991199
if (old.npages)
12001200
kvm_arch_flush_shadow(kvm);
12011201
}
1202+
#else /* not defined CONFIG_S390 */
1203+
new.user_alloc = user_alloc;
1204+
if (user_alloc)
1205+
new.userspace_addr = mem->userspace_addr;
12021206
#endif /* not defined CONFIG_S390 */
12031207

12041208
if (!npages)

0 commit comments

Comments
 (0)