linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Greg Ungerer <gerg@uclinux.org>
Cc: Rabin Vincent <rabin@rab.in>, Will Deacon <will.deacon@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-xtensa@linux-xtensa.org, linux-m32r@ml.linux-m32r.org,
	linux-c6x-dev@linux-c6x.org, microblaze-uclinux@itee.uq.edu.au,
	linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>,
	linux-mm@kvack.org, linux-m68k@lists.linux-m68k.org,
	kernel@pengutronix.de, uclinux-dist-devel@blackfin.uclinux.org,
	Andrew Morton <akpm@linux-foundation.org>,
	panchaxari <panchaxari.prasannamurthy@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: TASK_SIZE for !MMU
Date: Tue, 3 Jun 2014 16:11:38 +0200	[thread overview]
Message-ID: <20140603141138.GH16741@pengutronix.de> (raw)
In-Reply-To: <538DBC3F.9060207@uclinux.org>

Hello Greg,

thanks for your reply.

On Tue, Jun 03, 2014 at 10:14:55PM +1000, Greg Ungerer wrote:
> >>I think it would be OK to define TASK_SIZE to 0xffffffff for !MMU.
> >>blackfin, frv and m68k also do this. c6x does define it to 0xFFFFF000 to
> >>leave space for error codes.
> 
> I did that same change for m68k in commit cc24c40 ("m68knommu: remove
> size limit on non-MMU TASK_SIZE"). For similar reasons as you need to
> now.
ok.
 
> >>Thoughts?
> >The problem is that current linus/master (and also next) doesn't boot on
> >my ARM-nommu machine because the user string functions (strnlen_user,
> >strncpy_from_user et al.) refuse to work on strings above TASK_SIZE
> >which in my case also includes the XIP kernel image.
> 
> I seem to recall that we were not considering flash or anything else
> other than RAM when defining that original TASK_SIZE (back many, many
> years ago). Some of the address checks you list above made some sense
> if you had everything in RAM (though only upper bounds are checked).
> The thinking was some checking is better than none I suppose.
What is the actual meaning of TASK_SIZE? The maximal value of a valid
userspace address?

> Setting a hard coded memory size in CONFIG_DRAM_SIZE is not all that
> fantastic either...
Not sure what you mean? Having CONFIG_DRAM_SIZE at all or use it for
boundary checking?

CONFIG_DRAM_SIZE is hardly used apart from defining TASK_SIZE:

 - #define END_MEM (UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE)
   which is only used to define MODULES_END. Ap
 - Some memory configuration using cp15 registers in
   arch/arm/mm/proc-arm{740,940,946}.S

For the former I'd say better use 0xffffffff, too. For the latter I
wonder if we should just drop CPU_ARM740T, CPU_ARM940T and CPU_ARM946E.
These are only selectable if ARCH_INTEGRATOR and are not selected by
other symbols. As ARCH_INTEGRATOR selects ARM_PATCH_PHYS_VIRT since
commit fe9891454473 (ARM: integrator: Default enable
ARM_PATCH_PHYS_VIRT, AUTO_ZRELADDR) for Linux 3.13 and
ARM_PATCH_PHYS_VIRT depends on MMU the Integrator-noMMU targets are
broken anyhow.

I will prepare a patch series with some cleanups.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-Konig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2014-06-03 14:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140429100028.GH28564@pengutronix.de>
2014-06-02  8:51 ` TASK_SIZE for !MMU Uwe Kleine-König
2014-06-03 12:14   ` Greg Ungerer
2014-06-03 14:11     ` Uwe Kleine-König [this message]
2014-06-03 15:19       ` Geert Uytterhoeven
2014-06-04 11:57       ` Greg Ungerer

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=20140603141138.GH16741@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=gerg@uclinux.org \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-c6x-dev@linux-c6x.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m32r@ml.linux-m32r.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=microblaze-uclinux@itee.uq.edu.au \
    --cc=panchaxari.prasannamurthy@linaro.org \
    --cc=rabin@rab.in \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=will.deacon@arm.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).