summaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2013-07-26 15:04:03 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2013-07-29 09:03:19 +0200
commitee6ee55bb505c5bd8e64bc652281a93fb99c07b3 (patch)
treed967a92ce780c0353a7ceebb03d38c299b3cba4c /arch/s390/mm
parent3eabaee998c787e7e1565574821652548f7fc003 (diff)
downloadop-kernel-dev-ee6ee55bb505c5bd8e64bc652281a93fb99c07b3.zip
op-kernel-dev-ee6ee55bb505c5bd8e64bc652281a93fb99c07b3.tar.gz
KVM: s390: fix task size check
The gmap_map_segment function uses PGDIR_SIZE in the check for the maximum address in the tasks address space. This incorrectly limits the amount of memory usable for a kvm guest to 4TB. The correct limit is (1UL << 53). As the TASK_SIZE has different values (4TB vs 8PB) dependent on the existance of the fourth page table level, create a new define 'TASK_MAX_SIZE' for (1UL << 53). Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/pgtable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 6d33248..967d0bf 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -335,7 +335,7 @@ int gmap_map_segment(struct gmap *gmap, unsigned long from,
if ((from | to | len) & (PMD_SIZE - 1))
return -EINVAL;
- if (len == 0 || from + len > PGDIR_SIZE ||
+ if (len == 0 || from + len > TASK_MAX_SIZE ||
from + len < from || to + len < to)
return -EINVAL;
OpenPOWER on IntegriCloud