Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146607
b: refs/heads/master
c: ac04527
h: refs/heads/master
i:
  146605: 23c820c
  146603: 1d113a6
  146599: 940e84c
  146591: ddb9ee6
v: v3
  • Loading branch information
Avi Kivity committed Jun 10, 2009
1 parent e0f20b4 commit d3ab0d7
Show file tree
Hide file tree
Showing 2 changed files with 10 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: a0861c02a981c943573478ea13b29b1fb958ee5b
refs/heads/master: ac04527f7947020c5890090b2ac87af4e98d977e
10 changes: 9 additions & 1 deletion trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
{
int r;
gfn_t base_gfn;
unsigned long npages;
unsigned long npages, ugfn;
int largepages;
unsigned long i;
struct kvm_memory_slot *memslot;
Expand Down Expand Up @@ -1177,6 +1177,14 @@ int __kvm_set_memory_region(struct kvm *kvm,
new.lpage_info[0].write_count = 1;
if ((base_gfn+npages) % KVM_PAGES_PER_HPAGE)
new.lpage_info[largepages-1].write_count = 1;
ugfn = new.userspace_addr >> PAGE_SHIFT;
/*
* If the gfn and userspace address are not aligned wrt each
* other, disable large page support for this slot
*/
if ((base_gfn ^ ugfn) & (KVM_PAGES_PER_HPAGE - 1))
for (i = 0; i < largepages; ++i)
new.lpage_info[i].write_count = 1;
}

/* Allocate page dirty bitmap if needed */
Expand Down

0 comments on commit d3ab0d7

Please sign in to comment.