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

Re: [PATCH v2 1/2] make ioremap_attr() common


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Thu, 9 Apr 2026 07:26:37 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=suse.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=RqTe4MyzhafXHEhy3dsJVbJEL4twwFvm0mo6XNeqAu8=; b=w3YsEeN+3R12+ilrYO9kMS7TEMbz35GiE8wmOpqmBwMvXLCW+PwXi0Mv8QIL1f4N4aXYMhnRJ8yDBGQJFftDX7F4IX4YtDFAC5L4eIwq+Lx24X/9uj9IqxBELYdRn6OZga0+8u4029HElh9CfF4dWwqwG3aCl+4gg37ifTxwWb9GkE9GvirT4mFQpaJ3a4W1/YAr75bx97YpOSfDOUWN5Z44sTXkydzIKs4km0VIDkd8jHHFhE2+bGBX9zmetu6d1lINT1xlAksyTphMbCux9EUcoxxwzoiaSNhQWd9tNxy2Fr3m90giYY27M0qhAl18BU4jSKtgtNQ/xbx5MZLbig==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=RqTe4MyzhafXHEhy3dsJVbJEL4twwFvm0mo6XNeqAu8=; b=XK0jFilXrRLypUVsvo4bpD6A4z5UaDgpKlzH1dNilsAzByt3gEDOaT1Ocdkm+QCe5HQMrxr2gKpaEfDUcPtGIbgQTYFff2NPPFulncuEddpj+h3oDTh3m//xbc3QZ489gKk2ND2PaQBnMP6Y8xwZU5wrqM2sM6xGhzrghADtpUcQyaRFi29W7u7YfRizC2ml7oYiO0w6pZdR1ramrEuJ7I+1QW8cbT7RI0fNKCnDXgxtiZMr9A+4dzYYdIohgqTUb+uNWTgHMYsTAeicA0WzuaVjgg5fS/DAWgwQ67Rs38qh2/qdod7PwaAwHiuR0qjDUWsXwcvsXWeLBY2tcHkcgQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=oNGGWnYKW+dm8USChQ/J5hvNEmLayg5LviHct/PWVHU8Xva8/tnR9gxMaFmf/PyfuWXLqd688FLLd7z+43JUvkKTR+qYH+jYu1DitZLKFk2yC5UU+ME3cjD2QZTdajJtf7NPMxNwUdUkQFbH5Di8otjrTpmyrmsejp9n6xQ775x0t4cRFNJSMZTpI8a5XCH3yuL0orYUIXk1fAo8IVOHNHhzf6ulLSLQsXDvTBnDaDNyh9Rw7xrKBumvyypO2xFgBj++YURyp/4uqQemJCFEJFqixFOoh8Z09PMLCNkfp3QIHMQi+FtzTLw7WKCKh6CqCp3Mo352H1pVhYwsnyyXGA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NJPFEBLU+V0XX9NBINuhKbmEj9of9t48FisF6Yf5Mp2QTmIF2BP4JCgzPDB347duzdmQIssxMciurblOR1rxtiSKhS91zJcQ5UVkofa4ScYDtOs/mdMtw3YYXgQvNhgUbEAxwKZcTZOKauDvbF/JK+x77SG/6i34H/Op2O1Qp0fuhb88OJAUFoTTcFmz+JbMcDWaep1672JGIKhGcMgADKwzQrz9y/fVg7JlaWCWOi+iMrgu5EhHsCrKpYuXyty4cX/jsvnokE3RaRqD0tbeAuTUFhYPjZYHStURkaUeGkMVOz2EV2HokNkEQobqHoBdt/VXop1fAcHIymVpxgNH7Q==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"; dkim=pass header.s=selector1 header.d=arm.com header.i="@arm.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
  • Delivery-date: Thu, 09 Apr 2026 07:27:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHcx/Izziiqdxydn0S4hdbQtQOHzg==
  • Thread-topic: [PATCH v2 1/2] make ioremap_attr() common

Hi Jan,

> On 8 Apr 2026, at 13:07, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> This core backing function is uniform; what varies across architectures
> are the attributes passed and hence the wrappers around it. Yet of course
> extra checking or special handling may be needed per arch, so introduce a
> suitable hook.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> Declarations (or inline counterparts) aren't being moved around, to avoid
> the need to touch source files using the functions. Quite possibly they
> want to consistently go into xen/io.h and asm/io.h.
> 
> Of course ioremap.c could also go into lib/.
> 
> For RISC-V the wrappers likely should become inline functions?
> 
> PPC doesn't reference any of the functions just yet, so gets only a
> declaration.
> 
> For Arm, a TODO item is deliberately retained, yet seeing the use of
> ioremap_wc() in domain building (which by itself is questionable, see next
> patch) I wonder if that's even feasible as long as we don't have
> memremap() or alike.
> ---
> v2: Use conditional operator in ioremap_attr()'s final return. Re-base and
>    leverage that to simplify ioremap_attr() itself.
> 
> --- a/xen/arch/arm/include/asm/io.h
> +++ b/xen/arch/arm/include/asm/io.h
> @@ -1,6 +1,8 @@
> #ifndef _ASM_IO_H
> #define _ASM_IO_H
> 
> +#include <xen/mm-types.h>
> +
> #if defined(CONFIG_ARM_32)
> # include <asm/arm32/io.h>
> #elif defined(CONFIG_ARM_64)
> @@ -9,6 +11,16 @@
> # error "unknown ARM variant"
> #endif
> 
> +#ifdef CONFIG_MPU
> +void __iomem *mpu_ioremap_attr(paddr_t start, size_t len, pte_attr_t flags);
> +#define arch_ioremap_attr mpu_ioremap_attr
> +#else
> +/*
> + * ioremap_attr() should only be used to remap device address ranges.
> + * TODO: Add an arch hook to verify this assumption.
> + */
> +#endif

I find a bit strange to have an #else with only a comment, but to be fair I’m 
not sure where this
comment can be put otherwise.

For the Arm and common part, I’ve also tested on Arm64 MMU, Arm32 MMU, Arm64 
MPU on virtual platforms:

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx> # arm, common
Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx> # arm, common

Cheers,
Luca


 


Rackspace

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