Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202365
b: refs/heads/master
c: 7ac7709
h: refs/heads/master
i:
  202363: 3a66414
v: v3
  • Loading branch information
Avi Kivity committed Aug 1, 2010
1 parent 2347db7 commit 2894a0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e36d96f7cfaa71870c407131eb4fbd38ea285c01
refs/heads/master: 7ac77099ce88a0c31b75acd0ec5ef3da4415a6d8
7 changes: 6 additions & 1 deletion trunk/arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -5491,6 +5491,11 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
int user_alloc)
{
int npages = memslot->npages;
int map_flags = MAP_PRIVATE | MAP_ANONYMOUS;

/* Prevent internal slot pages from being moved by fork()/COW. */
if (memslot->id >= KVM_MEMORY_SLOTS)
map_flags = MAP_SHARED | MAP_ANONYMOUS;

/*To keep backward compatibility with older userspace,
*x86 needs to hanlde !user_alloc case.
Expand All @@ -5503,7 +5508,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
userspace_addr = do_mmap(NULL, 0,
npages * PAGE_SIZE,
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS,
map_flags,
0);
up_write(&current->mm->mmap_sem);

Expand Down

0 comments on commit 2894a0e

Please sign in to comment.