LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 05/11] VMEM_MAX_PHYS overflow on 31 bit.
Date: Sat, 09 Feb 2008 13:02:02 +0100	[thread overview]
Message-ID: <20080209120308.269844869@de.ibm.com> (raw)
In-Reply-To: <20080209120157.885371603@de.ibm.com>

[-- Attachment #1: 005-overflow.diff --]
[-- Type: text/plain, Size: 1316 bytes --]

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

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>
---

 include/asm-s390/pgtable.h |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: quilt-2.6/include/asm-s390/pgtable.h
===================================================================
--- quilt-2.6.orig/include/asm-s390/pgtable.h
+++ quilt-2.6/include/asm-s390/pgtable.h
@@ -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)
 
 /*

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


  parent reply	other threads:[~2008-02-09 12:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 12:01 [patch 00/11] s390 patch set #3 for 2.6.25 Martin Schwidefsky
2008-02-09 12:01 ` [patch 01/11] Update default configuration Martin Schwidefsky
2008-02-09 12:01 ` [patch 02/11] Wire up new timerfd syscalls Martin Schwidefsky
2008-02-09 12:02 ` [patch 03/11] Fix __ffs_word_loop/__ffz_word_loop inlnie assembly Martin Schwidefsky
2008-02-09 12:02 ` [patch 04/11] zcrypt: Do not start ap poll thread per default Martin Schwidefsky
2008-02-09 12:02 ` Martin Schwidefsky [this message]
2008-02-09 12:02 ` [patch 06/11] qdio: avoid hang when establishing qdio queues Martin Schwidefsky
2008-02-09 12:02 ` [patch 07/11] sclp_vt220: Fix vt220 initialization Martin Schwidefsky
2008-02-09 12:02 ` [patch 08/11] Remove a.out header file Martin Schwidefsky
2008-02-09 12:02 ` [patch 09/11] 1K/2K page table pages Martin Schwidefsky
2008-02-09 12:02 ` [patch 10/11] Add four level page tables for CONFIG_64BIT=y Martin Schwidefsky
2008-02-09 12:02 ` [patch 11/11] dynamic page tables Martin Schwidefsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080209120308.269844869@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --subject='Re: [patch 05/11] VMEM_MAX_PHYS overflow on 31 bit.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).