Skip to content

Commit

Permalink
[S390] VMEM_MAX_PHYS overflow on 31 bit.
Browse files Browse the repository at this point in the history
With the new space saving spinlock_t and a non-debug configuration
the struct page only has 32 bytes for 31 bit s390. The causes an
overflow in the calculation of VMEM_MAX_PHYS which renders the
kernel unbootable.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Martin Schwidefsky committed Feb 9, 2008
1 parent b90b34c commit 522d8dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/asm-s390/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ extern char empty_zero_page[PAGE_SIZE];
* mapping. This needs to be calculated at compile time since the size of the
* VMEM_MAP is static but the size of struct page can change.
*/
#define VMEM_MAX_PHYS min(VMALLOC_START, ((VMEM_MAP_END - VMALLOC_END) / \
sizeof(struct page) * PAGE_SIZE) & ~((16 << 20) - 1))
#define VMEM_MAX_PAGES ((VMEM_MAP_END - VMALLOC_END) / sizeof(struct page))
#define VMEM_MAX_PFN min(VMALLOC_START >> PAGE_SHIFT, VMEM_MAX_PAGES)
#define VMEM_MAX_PHYS ((VMEM_MAX_PFN << PAGE_SHIFT) & ~((16 << 20) - 1))
#define VMEM_MAP ((struct page *) VMALLOC_END)

/*
Expand Down

0 comments on commit 522d8dc

Please sign in to comment.