[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Arm: AArch32: Need suggestions to support 32 bit physical addresses
- To: Ayan Kumar Halder <ayankuma@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 30 Nov 2022 08:09:53 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xpyK08Vqk6dONHsWeVR2ow6OIUp6q0mwqG7BsJwv2po=; b=J3NCgH+z2nOtaGsupPs/yi3L+tc58g3dqk1fobVBUaNb1B+/OFq6M3O8YnW2kk1cDl7Y+Bd9j7ayFA7CLauW7NQaUXWb8GD7TAXiUnV1Xm8V5sdMPylSQK9IU2Or73hWz4lNjC2Cem7QAXgNWEGcccYFG1Vx/ErsfpuMZ345DD/DKm06UyCQp4CIdeXl09Tjzv8ch+RtDc5AtXC+0wRO6RZPpRj4T6eDgbSI3xMH72Igg6WgkyExboERMeH4CAx0xIecZQV9eWNr4wm3IvBY1uADjbaSxC4CdPrHD3WVkbdgtJg5PuvylH/uBofSfEz0n8bRvzrq7G03fAz67Uirlw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZHxEnU+/E5zCMFZd7Od1BV1Ch6nTd7HclqIKC2D/O/+7PztoRpU5o2/wsMCK7m58e7Lz+H2yGht9BAb7ASHXEdku2xCsQz+gooOCHymekjo3FVrUTeFHgThDoa6mTwCALdoZo/ArgCoXdrb+hiI+WDKsENWvXWKiLo6Q2/VgXgfTVgz5m73vq7syeHv0TifZj4QCANqu9nflvNwuvc5sjsT1Ij7Y03stz/A8tob4cVLGLCZy94epBSfl8OrMyPeap42NxvwLPtFEhpg32B9xPXlbggkECQA3LNHMJAEME/Asw6ZjraRmOTkbHenovHf1gmtOBicfqVVLf5ObUVU2Sg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Stabellini, Stefano" <stefano.stabellini@xxxxxxx>, bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Andre Przywara <andre.przywara@xxxxxxx>, "Volodymyr_Babchuk@xxxxxxxx" <Volodymyr_Babchuk@xxxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Vladimir Murzin <vladimir.murzin@xxxxxxx>, Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 30 Nov 2022 07:10:01 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 29.11.2022 19:18, Ayan Kumar Halder wrote:
> On 29/11/2022 15:52, Julien Grall wrote:
>> On 29/11/2022 16:23, Ayan Kumar Halder wrote:
>>> On 29/11/2022 14:52, Julien Grall wrote:
>>>> On 29/11/2022 14:57, Ayan Kumar Halder wrote:
>>> --- a/xen/common/page_alloc.c
>>> +++ b/xen/common/page_alloc.c
>>> @@ -2245,7 +2245,9 @@ void __init xenheap_max_mfn(unsigned long mfn)
>>> {
>>> ASSERT(!first_node_initialised);
>>> ASSERT(!xenheap_bits);
>>> +#ifndef CONFIG_AARCH32_V8R
>>> BUILD_BUG_ON(PADDR_BITS >= BITS_PER_LONG);
>>> +#endif
>>
>> BUILD_BUG_ON() are used to indicate that the code would fall over the
>> check pass. I can't find the justification for this change in the
>> commit message.
>
> I had a look at the following commit which introduced this, but I
> couldn't get the explaination for this.
>
> commit 88e3ed61642bb393458acc7a9bd2f96edc337190
> Author: Jan Beulich <jbeulich@xxxxxxxx>
> Date: Tue Sep 1 14:02:57 2015 +0200
>
> @Jan :- Do you know why BUILD_BUG_ON() was introduced ?
You've cut too much context - the next line explains this all by itself,
I think:
xenheap_bits = min(flsl(mfn + 1) - 1 + PAGE_SHIFT, PADDR_BITS);
Clearly addresses used for the Xen heap need to be representable in an
unsigned long (which we assume to be the same size as void *).
But I'm afraid there's further context missing for your question: Why
would that construct be a problem in your case? Is it just that you'd
need it to be > rather than the >= that's used presently? If so, why
do you add an #ifdef rather than dealing with the (apparent) off-by-1?
(I say "apparent" because I haven't checked whether the >= is really
depended upon anywhere.)
Jan
|