diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-05-11 13:50:29 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-05-11 13:50:29 +0900 |
commit | dfbca89987b74c34d9b1a2414b0e5ccee65347e0 (patch) | |
tree | 9fc1f978381864f53e81ff7a017d3ddee2dca89c /arch/sh/mm | |
parent | 4bc277ac9cae60e11fe2e557e4ea4acb56d3dc9a (diff) | |
download | op-kernel-dev-dfbca89987b74c34d9b1a2414b0e5ccee65347e0.zip op-kernel-dev-dfbca89987b74c34d9b1a2414b0e5ccee65347e0.tar.gz |
sh: Reject small mappings for PMB bolting.
The minimum section size for the PMB is 16M, so just always error
out early if the specified size is too small. This permits us to
unconditionally call in to pmb_bolt_mapping() with variable sizes
without wasting a TLB and cache flush for the range.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm')
-rw-r--r-- | arch/sh/mm/pmb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index e9f5384..18623ba 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c @@ -341,6 +341,8 @@ int pmb_bolt_mapping(unsigned long vaddr, phys_addr_t phys, unsigned long flags, pmb_flags; int i, mapped; + if (size < SZ_16M) + return -EINVAL; if (!pmb_addr_valid(vaddr, size)) return -EFAULT; if (pmb_mapping_exists(vaddr, phys, size)) |