From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH FOR-4.5] xen: arm64: Handle memory banks which are not 1GB aligned Date: Mon, 13 Oct 2014 14:09:10 +0100 Message-ID: <543BCEF6.80800@linaro.org> References: <1412952194-3595-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1412952194-3595-1-git-send-email-ian.campbell@citrix.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 , xen-devel@lists.xen.org Cc: Roy Franz , tim@xen.org, Vijay Kilari , Suravee Suthikulanit , stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org Hi Ian, On 10/10/2014 03:43 PM, Ian Campbell wrote: > The code in the arm64 version of setup_xenheap_mappings was making > some very confused attempts to handle this but was bogus. > > As well as adjusting the mapping to start on a 1GB boundary we also > need to account for the offset between the start of the mapping and > the actual start of the heap when converting between page pointers, > virtual addresses and machine addresses. > > I preferred to do this by explicitly accounting for the offset rather > than adding an offset to the frametable because that approach could > potentially waste a large amount of frametable (up to just less than > 1GB worth) but also because of issues with converting mfns from > outside the regions considered for pdx initialisation (which are not > 1GB aligned) back and forth. > > We already have an idea of the distinction between the start of the > direct map and the start of the xenheap in the difference between > DIRECTMAP_VIRT_START and XENHEAP_VIRT_START. Until now these were the > same thing, but now we change XENHEAP_VIRT_START to point to the > actual start of heap not the mapping. Surprisingly there was only one > place which was using the conceptually wrong value. > > Also change xenheap_virt_end to a vaddr_t for consistency. > > We've been lucky so far that most hardware happens to locate memory > on a 1GB boundary (we did have reports of a system with memory at a > half gig boundary which exhibited failures which I didn't manage to > follow up on successfully). The EFI support has exposed this > shortcoming by the way it handles reserved memory, which has a > similar effect to having memory non-1GB aligned. > > arm32 does things differently here due to using a small Xen heap and > a demand mapped domain heap, so isn't affected. > > Signed-off-by: Ian Campbell > Cc: Suravee Suthikulanit > Cc: Roy Franz > Cc: Vijay Kilari > --- > FOR-4.5: This is a bug fix. Looks good to me: Reviewed-by: Julien Grall Regards, -- Julien Grall