From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH v2 6/9] xen: arm: rewrite start of day page table and cpu bring up Date: Thu, 26 Sep 2013 15:31:45 +0100 Message-ID: <20130926143145.GJ54428@ocelot.phlegethon.org> References: <1380192538.29483.63.camel@kazak.uk.xensource.com> <1380192556-30700-6-git-send-email-ian.campbell@citrix.com> <1380200362.29483.81.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1380200362.29483.81.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: julien.grall@linaro.org, stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 13:59 +0100 on 26 Sep (1380203962), Ian Campbell wrote: > From cd92dd41a1bb8de3cf145f90f89e645a5c9049bf Mon Sep 17 00:00:00 2001 > From: Ian Campbell > Date: Thu, 29 Aug 2013 16:25:00 +0100 > Subject: [PATCH] xen: arm: rewrite start of day page table and cpu bring up > > This is unfortunately a rather large monolithic patch. > > Rather than bringing up all CPUs in lockstep as we setup paging and relocate > Xen instead create a simplified set of dedicated boot time pagetables. > > This allows secondary CPUs to remain powered down or in the firmware until we > actually want to enable them. The bringup is now done later on in C and can be > driven by DT etc. I have included code for the vexpress platform, but other > platforms will need to be added. > > The mechanism for deciding how to bring up a CPU differs between arm32 and > arm64. On arm32 it is essentially a per-platform property, with the exception > of PSCI which can be implemented globally (but isn't here). On arm64 there is a > per-cpu property in the device tree. > > Secondary CPUs are brought up directly into the relocated Xen image, instead of > relying on being able to launch on the unrelocated Xen and hoping that it > hasn't been clobbered. > > As part of this change drop support for switching from secure mode to NS HYP as > well as the early CPU kick. Xen now requires that it is launched in NS HYP > mode and that firmware configure things such that secondary CPUs can be woken > up by a primarly CPU in HYP mode. This may require fixes to bootloaders or the > use of a boot wrapper. > > The changes done here (re)exposed an issue with relocating Xen and the compiler > spilling values to the stack between the copy and the actual switch to the > relocaed copy of Xen in setup_pagetables. Therefore switch to doing the copy > and switch in a single asm function where we can control precisely what gets > spilled to the stack etc. > > Since we now have a separate set of boot pagetables it is much easier to build > the real Xen pagetables inplace before relocating rather than the more complex > approach of rewriting the pagetables in the relocated copy before switching. > > This will also enable Xen to be loaded above the 4GB boundary on 64-bit. > > Still TODO: > - integrate with Julien's "Dissociate logical and hardware CPU ID" > - cpu initialisation for other platforms > > Signed-off-by: Ian Campbell Acked-by: Tim Deegan