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

Re: [XEN v2 09/11] xen/arm: Introduce ARM_PA_32 to support 32 bit physical address


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Wed, 18 Jan 2023 11:57:17 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.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=53o/4KDeUpLeu/3KOTvm152saLu89gsSRqp0bP1KkCE=; b=VIVW6T6MX41moYojSTWAV4GeJXHJh2q24TuAcLEr8VC0m9wuW2BsuHHVtWvgy24ntEtUKlnCawTHOBQxvhJhFnoX9h7O7JKpEToo9hoFE/KXLjxs45dZLQSb9dQgGaSJZA+iOEPFb+vY8X3nYqhuY0B78Z3mLaYUZoBYXKhWchH9sBAEngU6gzGdOUFyjBXeEKq40vDZa4pC42tJ7WQJErLY5FwGYl5XJi2+Ckf0Ke5ruqNrH4F7d8/imKFpIBMcPCFvlbe4BWDuL69Lm/CiUjeI7MiDJ8IdyFzuoK5mwEotOR62UKGxu/mRrX7LLuHnxzPpSBiA9HIy0i/xPjQ2Rw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MuG5v32okDEGtAO2b8J5k8mVgheW6TUeYRPk8lfN7lirahGf9WOk+0EvUlClxo3Z9lC/R2XyqAKQvho/ab0w6DP0pqOL8qW7r/yvRglvF+i3XhIUWXjj9/yURDZ7adOR1ts7nQmRh+1/fowwqCfQil9uczsJH1TQqBwf8MQ4tah4Ekkej+yUMyWCRhBlh9bBVkRhYtHuZHvjE//UiSPPirFtSZNfRQpC350+JqsENsYvkwDwqR2+c+led9Suet9IiWfM/GZEngRLVGBuzxOdOkXExYvZ5G3uGTMsbGAAJ4Er+CnfoeEUyVrSJbTyL3pqeZ4AD1Xuz9dJOmrOkBsW5A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: sstabellini@xxxxxxxxxx, stefano.stabellini@xxxxxxx, julien@xxxxxxx, Volodymyr_Babchuk@xxxxxxxx, bertrand.marquis@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 18 Jan 2023 11:57:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Jan,

On 18/01/2023 08:50, Jan Beulich wrote:
On 17.01.2023 18:43, Ayan Kumar Halder wrote:
--- a/xen/arch/arm/include/asm/types.h
+++ b/xen/arch/arm/include/asm/types.h
@@ -37,9 +37,16 @@ typedef signed long long s64;
  typedef unsigned long long u64;
  typedef u32 vaddr_t;
  #define PRIvaddr PRIx32
+#if defined(CONFIG_ARM_PA_32)
+typedef u32 paddr_t;
+#define INVALID_PADDR (~0UL)
+#define PADDR_SHIFT BITS_PER_LONG
+#define PRIpaddr PRIx32
+#else
With our plan to consolidate basic type definitions into xen/types.h
the use of ARM_PA_32 is problematic: Preferably we'd have an arch-
independent Kconfig setting, much like Linux'es PHYS_ADDR_T_64BIT
(I don't think we should re-use the name directly, as we have no
phys_addr_t type), which each arch selects (or not) accordingly.
Perhaps architectures already selecting 64BIT wouldn't need to do
this explicitly, and instead 64BIT could select the new setting
(or the new setting could default to Y when 64BIT=y).

Looking at some of the instances where 64BIT is currently used (xen/drivers/passthrough/arm/smmu.c), I understand that it is used to define the width of **virtual** address.

Thus, it would not conflict with ARM_PA_32 (which is for physical address).

Later on if we wish to introduce something similar to Linux's PHYS_ADDR_T_64BIT (which is arch agnostic), then ARM_PA_32 can be selected by "!PHYS_ADDR_T_64BIT" && "CONFIG_ARM_32". (We may decide to drop ARM_PA_32 config option, but we can still reuse ARM_PA_32 specific changes).

Also, then we will need to support 32 bit physical address (ie !PHYS_ADDR_T_64BIT) with 32 bit virtual address (ie !64BIT) and 64 bit virtual address (ie 64BIT).

Let's confine the current changes to Arm architecture only (as I don't have knowledge about x86 or RISCV). When similar changes will be done for other architectures, then we can think about introducing an architecture agnostic option.

- Ayan


Jan



 


Rackspace

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