[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN v4] xen/page_alloc: Relax the BUILD_BUG_ON() in xenheap_max_mfn()


  • To: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 5 Dec 2022 12:46:17 +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=D4uMqlszxZ0mJbFNuNvJaoVNgRkxAW+T2BdokKWruKM=; b=FyLwEiYuhf/LYRfVkEGlxuHEij+PmRBG00LyQqdjE4Bl+GHsSsCCkXObNyPpoVCeYx8BKN0EqBLqHPjo6tw757DM6/StDjEhnNpVYWQPiGuJqSD27fo9ivraGCeuW8PBMRq/Z1LIIOTQaqWDCFP+aAhgaNcNvgi5PKjqX0eL6Cd5wzjxOypUSPLVPGvNBXqF/Xy4eG0TAbskert/NkA72H3aLLAm70A5FnTaK37GYvlcjUDzIIEXULSKObMj6L+cNOd4SbyrBSKLs5Otw7OieUHHS4p8H7pp0lke/HQ/k5tjFW89kuWJxbqH+D/tp26LLbNMI2XczsqUh9QdvE/cfA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fnj7mpk6XrUC+aXR+0RVfvcNMHc1iiP+JOdq0OzUnbofCyYolJi3EYB9p+eKVTKm/WixrOPTQj+Mqn1u1WrvvXP3xdjFpisf4HKuGJBRGvqN5Ye89O4DjOaLUarzdDGnPob1fovQqCCQG/+zJetNPaKfL63GNXN88MiNB0EXGPunTNP14Kr0iB3KDHPykP2RZmXUgNRPFB+kKnliLjgqmojzMhviDmYAOnoJ4jsuafqTKzb7hH/6n75xW5VYbg5/U5265SnqmRwDMBNBg8NRmm/u/Fu+XXOFhc2dMl/Gmcf5MJuxEg5tV6NLRHvmfyH3+jApTe9VHQ1sIHxvfrYJ6Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, stefanos@xxxxxxxxxx, julien@xxxxxxx, andrew.cooper3@xxxxxxxxxx, george.dunlap@xxxxxxxxxx, wl@xxxxxxx, bobbyeshleman@xxxxxxxxx
  • Delivery-date: Mon, 05 Dec 2022 11:46:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 05.12.2022 10:48, Ayan Kumar Halder wrote:
> In the near future, we are considering to use a common xen/domain heap for
> Arm 32-bit V8-R. In this setup, both PADDR_BITS and BITS_PER_LONG will be
> 32. Therefore, the condition PADDR_BITS >= BITS_PER_LONG will become true.
> 
> Looking at the commit that introduce the BUILD_BUG_ON (88e3ed61642b
> "x86/NUMA: make init_node_heap() respect Xen heap limit") and the current
> use, it seems this check was mainly to ensure that the shift of xenheap_bits
> is not going to be undefined (>> N for a N-bit type is undefined).
> 
> So far, all the shifts are using "xenheap_bits - PAGE_SHIFT". Therefore, the
> existing code should work for 32-bit architecture as long as the result of
> the substraction is below 32.
> 
> Therefore relax the BUILD_BUG_ON() to check that (PADDR_BITS - PAGE_SHIFT)
> is not equal of above BITS_PER_LONG.
> 
> Note that we would need further precaution if we ended up to use
> 'xenheap_bits' alone in shifts.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
> Signed-off-by: Julien Grall <julien@xxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.