[PATCH 2/6] ARM: keystone2: move update of the phys-to-virt constants into generic code

Russell King - ARM Linux linux at arm.linux.org.uk
Wed Apr 8 11:00:00 PDT 2015


On Wed, Apr 08, 2015 at 05:56:49PM +0300, Grygorii.Strashko at linaro.org wrote:
> Hi Russell,
> 
> On 04/08/2015 12:45 PM, Russell King wrote:
> > Make the init_meminfo function return the offset to be applied to the
> > phys-to-virt translation constants.  This allows us to move the update
> > into generic code, along with the requirements for this update.
> 
> 
> I have a question (or may be proposition) regarding this patch.
> 
> Could it be reasonable if .init_meminfo() will return new PHYS offset
> of RAM (new start address), instead of translation's offset?

I'm not that interested in such a change, for the simple reason that
what we mostly want to know is what the _difference_ between what's
already in the page tables, and what we want to update them to.

The page table update is a case of merely adding the delta to each
page table entry.

If we were to want to pass the actual new physical address, we would
have to have the fixup code mask out the old address, and insert the
new address, keeping track of the offset into the kernel's mapping.
We'd also have to do something weirder for the DT mapping too.

Using an offset makes the page table update rather trivial and easy.

I actually did start off with passing the new physical address
initially, and I changed to this way because it simplified the
assembly code.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.



More information about the linux-arm-kernel mailing list