Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 462fce46 authored by Takuya Yoshikawa's avatar Takuya Yoshikawa Committed by Marcelo Tosatti
Browse files

KVM: set_memory_region: Drop user_alloc from prepare/commit_memory_region()



X86 does not use this any more.  The remaining user, s390's !user_alloc
check, can be simply removed since KVM_SET_MEMORY_REGION ioctl is no
longer supported.

Note: fixed powerpc's indentations with spaces to suppress checkpatch
errors.

Signed-off-by: default avatarTakuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent ee2c25ef
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -231,16 +231,14 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
int kvm_arch_prepare_memory_region(struct kvm *kvm,
				   struct kvm_memory_slot *memslot,
				   struct kvm_memory_slot old,
				   struct kvm_userspace_memory_region *mem,
				   bool user_alloc)
				   struct kvm_userspace_memory_region *mem)
{
	return 0;
}

void kvm_arch_commit_memory_region(struct kvm *kvm,
				   struct kvm_userspace_memory_region *mem,
				   struct kvm_memory_slot old,
				   bool user_alloc)
				   struct kvm_memory_slot old)
{
}

+2 −4
Original line number Diff line number Diff line
@@ -1579,8 +1579,7 @@ int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages)
int kvm_arch_prepare_memory_region(struct kvm *kvm,
		struct kvm_memory_slot *memslot,
		struct kvm_memory_slot old,
		struct kvm_userspace_memory_region *mem,
		bool user_alloc)
		struct kvm_userspace_memory_region *mem)
{
	unsigned long i;
	unsigned long pfn;
@@ -1610,8 +1609,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,

void kvm_arch_commit_memory_region(struct kvm *kvm,
		struct kvm_userspace_memory_region *mem,
		struct kvm_memory_slot old,
		bool user_alloc)
		struct kvm_memory_slot old)
{
	return;
}
+5 −7
Original line number Diff line number Diff line
@@ -413,16 +413,14 @@ int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages)
int kvm_arch_prepare_memory_region(struct kvm *kvm,
				   struct kvm_memory_slot *memslot,
				   struct kvm_memory_slot old,
                                   struct kvm_userspace_memory_region *mem,
                                   bool user_alloc)
				   struct kvm_userspace_memory_region *mem)
{
	return kvmppc_core_prepare_memory_region(kvm, memslot, mem);
}

void kvm_arch_commit_memory_region(struct kvm *kvm,
				   struct kvm_userspace_memory_region *mem,
               struct kvm_memory_slot old,
               bool user_alloc)
				   struct kvm_memory_slot old)
{
	kvmppc_core_commit_memory_region(kvm, mem, old);
}
+2 −7
Original line number Diff line number Diff line
@@ -975,8 +975,7 @@ int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages)
int kvm_arch_prepare_memory_region(struct kvm *kvm,
				   struct kvm_memory_slot *memslot,
				   struct kvm_memory_slot old,
				   struct kvm_userspace_memory_region *mem,
				   bool user_alloc)
				   struct kvm_userspace_memory_region *mem)
{
	/* A few sanity checks. We can have exactly one memory slot which has
	   to start at guest virtual zero and which has to be located at a
@@ -997,16 +996,12 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
	if (mem->memory_size & 0xffffful)
		return -EINVAL;

	if (!user_alloc)
		return -EINVAL;

	return 0;
}

void kvm_arch_commit_memory_region(struct kvm *kvm,
				struct kvm_userspace_memory_region *mem,
				struct kvm_memory_slot old,
				bool user_alloc)
				struct kvm_memory_slot old)
{
	int rc;

+2 −4
Original line number Diff line number Diff line
@@ -6907,8 +6907,7 @@ int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages)
int kvm_arch_prepare_memory_region(struct kvm *kvm,
				struct kvm_memory_slot *memslot,
				struct kvm_memory_slot old,
				struct kvm_userspace_memory_region *mem,
				bool user_alloc)
				struct kvm_userspace_memory_region *mem)
{
	int npages = memslot->npages;

@@ -6938,8 +6937,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,

void kvm_arch_commit_memory_region(struct kvm *kvm,
				struct kvm_userspace_memory_region *mem,
				struct kvm_memory_slot old,
				bool user_alloc)
				struct kvm_memory_slot old)
{

	int nr_mmu_pages = 0, npages = mem->memory_size >> PAGE_SHIFT;
Loading