aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/include/asm/kvm_host.h2
-rw-r--r--arch/ia64/kvm/kvm-ia64.c2
-rw-r--r--arch/powerpc/include/asm/kvm_host.h4
-rw-r--r--arch/powerpc/kvm/book3s_hv.c2
-rw-r--r--arch/s390/include/asm/kvm_host.h2
-rw-r--r--arch/x86/include/asm/kvm_host.h4
-rw-r--r--arch/x86/include/asm/vmx.h6
-rw-r--r--arch/x86/kvm/x86.c6
-rw-r--r--include/linux/kvm_host.h2
-rw-r--r--virt/kvm/kvm_main.c8
10 files changed, 19 insertions, 19 deletions
diff --git a/arch/ia64/include/asm/kvm_host.h b/arch/ia64/include/asm/kvm_host.h
index 6d6a5ac48d85..48d7b0e1dba9 100644
--- a/arch/ia64/include/asm/kvm_host.h
+++ b/arch/ia64/include/asm/kvm_host.h
@@ -23,7 +23,7 @@
23#ifndef __ASM_KVM_HOST_H 23#ifndef __ASM_KVM_HOST_H
24#define __ASM_KVM_HOST_H 24#define __ASM_KVM_HOST_H
25 25
26#define KVM_MEMORY_SLOTS 32 26#define KVM_USER_MEM_SLOTS 32
27/* memory slots that does not exposed to userspace */ 27/* memory slots that does not exposed to userspace */
28#define KVM_PRIVATE_MEM_SLOTS 4 28#define KVM_PRIVATE_MEM_SLOTS 4
29 29
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index bd1c51555038..9bacfe207b43 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -1834,7 +1834,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
1834 mutex_lock(&kvm->slots_lock); 1834 mutex_lock(&kvm->slots_lock);
1835 1835
1836 r = -EINVAL; 1836 r = -EINVAL;
1837 if (log->slot >= KVM_MEMORY_SLOTS) 1837 if (log->slot >= KVM_USER_MEM_SLOTS)
1838 goto out; 1838 goto out;
1839 1839
1840 memslot = id_to_memslot(kvm->memslots, log->slot); 1840 memslot = id_to_memslot(kvm->memslots, log->slot);
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index ca9bf459db6a..ac19ad60ae8c 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -37,10 +37,10 @@
37 37
38#define KVM_MAX_VCPUS NR_CPUS 38#define KVM_MAX_VCPUS NR_CPUS
39#define KVM_MAX_VCORES NR_CPUS 39#define KVM_MAX_VCORES NR_CPUS
40#define KVM_MEMORY_SLOTS 32 40#define KVM_USER_MEM_SLOTS 32
41/* memory slots that does not exposed to userspace */ 41/* memory slots that does not exposed to userspace */
42#define KVM_PRIVATE_MEM_SLOTS 4 42#define KVM_PRIVATE_MEM_SLOTS 4
43#define KVM_MEM_SLOTS_NUM (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) 43#define KVM_MEM_SLOTS_NUM (KVM_USER_MEM_SLOTS + KVM_PRIVATE_MEM_SLOTS)
44 44
45#ifdef CONFIG_KVM_MMIO 45#ifdef CONFIG_KVM_MMIO
46#define KVM_COALESCED_MMIO_PAGE_OFFSET 1 46#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 71d0c90b62bf..80dcc53a1aba 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -1549,7 +1549,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
1549 mutex_lock(&kvm->slots_lock); 1549 mutex_lock(&kvm->slots_lock);
1550 1550
1551 r = -EINVAL; 1551 r = -EINVAL;
1552 if (log->slot >= KVM_MEMORY_SLOTS) 1552 if (log->slot >= KVM_USER_MEM_SLOTS)
1553 goto out; 1553 goto out;
1554 1554
1555 memslot = id_to_memslot(kvm->memslots, log->slot); 1555 memslot = id_to_memslot(kvm->memslots, log->slot);
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index b7841546991f..ac3343264040 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -20,7 +20,7 @@
20#include <asm/cpu.h> 20#include <asm/cpu.h>
21 21
22#define KVM_MAX_VCPUS 64 22#define KVM_MAX_VCPUS 64
23#define KVM_MEMORY_SLOTS 32 23#define KVM_USER_MEM_SLOTS 32
24/* memory slots that does not exposed to userspace */ 24/* memory slots that does not exposed to userspace */
25#define KVM_PRIVATE_MEM_SLOTS 4 25#define KVM_PRIVATE_MEM_SLOTS 4
26 26
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index dc87b65e9c3a..c7df6ffd2437 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -33,10 +33,10 @@
33 33
34#define KVM_MAX_VCPUS 254 34#define KVM_MAX_VCPUS 254
35#define KVM_SOFT_MAX_VCPUS 160 35#define KVM_SOFT_MAX_VCPUS 160
36#define KVM_MEMORY_SLOTS 32 36#define KVM_USER_MEM_SLOTS 32
37/* memory slots that does not exposed to userspace */ 37/* memory slots that does not exposed to userspace */
38#define KVM_PRIVATE_MEM_SLOTS 4 38#define KVM_PRIVATE_MEM_SLOTS 4
39#define KVM_MEM_SLOTS_NUM (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) 39#define KVM_MEM_SLOTS_NUM (KVM_USER_MEM_SLOTS + KVM_PRIVATE_MEM_SLOTS)
40 40
41#define KVM_MMIO_SIZE 16 41#define KVM_MMIO_SIZE 16
42 42
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index c2d56b34830d..e385df97bfdc 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -427,9 +427,9 @@ enum vmcs_field {
427 427
428#define AR_RESERVD_MASK 0xfffe0f00 428#define AR_RESERVD_MASK 0xfffe0f00
429 429
430#define TSS_PRIVATE_MEMSLOT (KVM_MEMORY_SLOTS + 0) 430#define TSS_PRIVATE_MEMSLOT (KVM_USER_MEM_SLOTS + 0)
431#define APIC_ACCESS_PAGE_PRIVATE_MEMSLOT (KVM_MEMORY_SLOTS + 1) 431#define APIC_ACCESS_PAGE_PRIVATE_MEMSLOT (KVM_USER_MEM_SLOTS + 1)
432#define IDENTITY_PAGETABLE_PRIVATE_MEMSLOT (KVM_MEMORY_SLOTS + 2) 432#define IDENTITY_PAGETABLE_PRIVATE_MEMSLOT (KVM_USER_MEM_SLOTS + 2)
433 433
434#define VMX_NR_VPIDS (1 << 16) 434#define VMX_NR_VPIDS (1 << 16)
435#define VMX_VPID_EXTENT_SINGLE_CONTEXT 1 435#define VMX_VPID_EXTENT_SINGLE_CONTEXT 1
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 76f54461f7cb..816074757c96 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2518,7 +2518,7 @@ int kvm_dev_ioctl_check_extension(long ext)
2518 r = KVM_MAX_VCPUS; 2518 r = KVM_MAX_VCPUS;
2519 break; 2519 break;
2520 case KVM_CAP_NR_MEMSLOTS: 2520 case KVM_CAP_NR_MEMSLOTS:
2521 r = KVM_MEMORY_SLOTS; 2521 r = KVM_USER_MEM_SLOTS;
2522 break; 2522 break;
2523 case KVM_CAP_PV_MMU: /* obsolete */ 2523 case KVM_CAP_PV_MMU: /* obsolete */
2524 r = 0; 2524 r = 0;
@@ -3435,7 +3435,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
3435 mutex_lock(&kvm->slots_lock); 3435 mutex_lock(&kvm->slots_lock);
3436 3436
3437 r = -EINVAL; 3437 r = -EINVAL;
3438 if (log->slot >= KVM_MEMORY_SLOTS) 3438 if (log->slot >= KVM_USER_MEM_SLOTS)
3439 goto out; 3439 goto out;
3440 3440
3441 memslot = id_to_memslot(kvm->memslots, log->slot); 3441 memslot = id_to_memslot(kvm->memslots, log->slot);
@@ -6845,7 +6845,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
6845 int map_flags = MAP_PRIVATE | MAP_ANONYMOUS; 6845 int map_flags = MAP_PRIVATE | MAP_ANONYMOUS;
6846 6846
6847 /* Prevent internal slot pages from being moved by fork()/COW. */ 6847 /* Prevent internal slot pages from being moved by fork()/COW. */
6848 if (memslot->id >= KVM_MEMORY_SLOTS) 6848 if (memslot->id >= KVM_USER_MEM_SLOTS)
6849 map_flags = MAP_SHARED | MAP_ANONYMOUS; 6849 map_flags = MAP_SHARED | MAP_ANONYMOUS;
6850 6850
6851 /*To keep backward compatibility with older userspace, 6851 /*To keep backward compatibility with older userspace,
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 2c497ab0d03d..abad7f30771e 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -314,7 +314,7 @@ struct kvm_irq_routing_table {};
314#endif 314#endif
315 315
316#ifndef KVM_MEM_SLOTS_NUM 316#ifndef KVM_MEM_SLOTS_NUM
317#define KVM_MEM_SLOTS_NUM (KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS) 317#define KVM_MEM_SLOTS_NUM (KVM_USER_MEM_SLOTS + KVM_PRIVATE_MEM_SLOTS)
318#endif 318#endif
319 319
320/* 320/*
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 4c8c0657e370..5f0638cb6968 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -771,7 +771,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
771 /* Check for overlaps */ 771 /* Check for overlaps */
772 r = -EEXIST; 772 r = -EEXIST;
773 kvm_for_each_memslot(slot, kvm->memslots) { 773 kvm_for_each_memslot(slot, kvm->memslots) {
774 if (slot->id >= KVM_MEMORY_SLOTS || slot == memslot) 774 if (slot->id >= KVM_USER_MEM_SLOTS || slot == memslot)
775 continue; 775 continue;
776 if (!((base_gfn + npages <= slot->base_gfn) || 776 if (!((base_gfn + npages <= slot->base_gfn) ||
777 (base_gfn >= slot->base_gfn + slot->npages))) 777 (base_gfn >= slot->base_gfn + slot->npages)))
@@ -905,7 +905,7 @@ int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
905 kvm_userspace_memory_region *mem, 905 kvm_userspace_memory_region *mem,
906 int user_alloc) 906 int user_alloc)
907{ 907{
908 if (mem->slot >= KVM_MEMORY_SLOTS) 908 if (mem->slot >= KVM_USER_MEM_SLOTS)
909 return -EINVAL; 909 return -EINVAL;
910 return kvm_set_memory_region(kvm, mem, user_alloc); 910 return kvm_set_memory_region(kvm, mem, user_alloc);
911} 911}
@@ -919,7 +919,7 @@ int kvm_get_dirty_log(struct kvm *kvm,
919 unsigned long any = 0; 919 unsigned long any = 0;
920 920
921 r = -EINVAL; 921 r = -EINVAL;
922 if (log->slot >= KVM_MEMORY_SLOTS) 922 if (log->slot >= KVM_USER_MEM_SLOTS)
923 goto out; 923 goto out;
924 924
925 memslot = id_to_memslot(kvm->memslots, log->slot); 925 memslot = id_to_memslot(kvm->memslots, log->slot);
@@ -965,7 +965,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn)
965{ 965{
966 struct kvm_memory_slot *memslot = gfn_to_memslot(kvm, gfn); 966 struct kvm_memory_slot *memslot = gfn_to_memslot(kvm, gfn);
967 967
968 if (!memslot || memslot->id >= KVM_MEMORY_SLOTS || 968 if (!memslot || memslot->id >= KVM_USER_MEM_SLOTS ||
969 memslot->flags & KVM_MEMSLOT_INVALID) 969 memslot->flags & KVM_MEMSLOT_INVALID)
970 return 0; 970 return 0;
971 971