Skip to content

Commit

Permalink
sh: Prevent fixed slot PMB remapping from clobbering boot entries.
Browse files Browse the repository at this point in the history
The PMB initialization code walks the entries and synchronizes the
software PMB state with the hardware mappings, preserving the slot index.
Unfortunately pmb_alloc() only tested the bit position in the entry map
and failed to set it, resulting in subsequent remaps being able to be
dynamically assigned a slot that trampled an existing boot mapping with
general badness ensuing.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Feb 16, 2010
1 parent 319c2cc commit 55cef91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sh/mm/pmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
if (pos < 0)
return ERR_PTR(pos);
} else {
if (test_bit(entry, &pmb_map))
if (test_and_set_bit(entry, &pmb_map))
return ERR_PTR(-ENOSPC);
pos = entry;
}
Expand Down

0 comments on commit 55cef91

Please sign in to comment.