Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315827
b: refs/heads/master
c: c1a7b32
h: refs/heads/master
i:
  315825: e5a94b6
  315823: 281f746
v: v3
  • Loading branch information
Takuya Yoshikawa authored and Avi Kivity committed Jun 5, 2012
1 parent cdedcb8 commit f83f5b8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 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: 92eca8faad2d1b136c939bc122842dcdabd6ff46
refs/heads/master: c1a7b32a14138f908df52d7c53b5ce3415ec6b50
4 changes: 2 additions & 2 deletions trunk/arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -6304,7 +6304,7 @@ void kvm_arch_free_memslot(struct kvm_memory_slot *free,

for (i = 0; i < KVM_NR_PAGE_SIZES - 1; ++i) {
if (!dont || free->arch.lpage_info[i] != dont->arch.lpage_info[i]) {
vfree(free->arch.lpage_info[i]);
kvm_kvfree(free->arch.lpage_info[i]);
free->arch.lpage_info[i] = NULL;
}
}
Expand All @@ -6323,7 +6323,7 @@ int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages)
slot->base_gfn, level) + 1;

slot->arch.lpage_info[i] =
vzalloc(lpages * sizeof(*slot->arch.lpage_info[i]));
kvm_kvzalloc(lpages * sizeof(*slot->arch.lpage_info[i]));
if (!slot->arch.lpage_info[i])
goto out_free;

Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,9 @@ int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);

void kvm_free_physmem(struct kvm *kvm);

void *kvm_kvzalloc(unsigned long size);
void kvm_kvfree(const void *addr);

#ifndef __KVM_HAVE_ARCH_VM_ALLOC
static inline struct kvm *kvm_arch_alloc_vm(void)
{
Expand Down
4 changes: 2 additions & 2 deletions trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,15 +520,15 @@ static struct kvm *kvm_create_vm(unsigned long type)
* Avoid using vmalloc for a small buffer.
* Should not be used when the size is statically known.
*/
static void *kvm_kvzalloc(unsigned long size)
void *kvm_kvzalloc(unsigned long size)
{
if (size > PAGE_SIZE)
return vzalloc(size);
else
return kzalloc(size, GFP_KERNEL);
}

static void kvm_kvfree(const void *addr)
void kvm_kvfree(const void *addr)
{
if (is_vmalloc_addr(addr))
vfree(addr);
Expand Down

0 comments on commit f83f5b8

Please sign in to comment.