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

[PATCH] xen/arm: Fix printk specifiers and arguments in iomem_remove_cb()


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 6 Sep 2023 12:30:14 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=LdAtjaar4ROIVXVYKTPqVQwFRkWwqzCrYvtnNpQFYjI=; b=AU+yNmewweewP5q0iEa+Ss9UtvgctCdiBWKwdOdOdk5cZT05jJS03yzBMeb6qpIe4MEGkcrvyaM7zBFTcMly5aojAbor/xkVNXzAjJdsP7b7gmNwn6nKHhGSaRpzNjVeRMV190T5Uw6bgRaPBMWcnvsw3sBIaIU4kldkCsd3ie6++R4PpQ6JZdP/0BNz1iAj2j8IUj2+8h9Z4mcIGfvOxu9I+XFBQrvM65Vl8ORc5ZKK4HDWiaISNJ4ZS6d0VCtQE3KZL8kKmYzN9WZc71yl9cq4YAg/d3o5RUhu8obqzk+56wFbS0r2KUGloY2Tetg3104S39oWf8LYcmAb2jIrKQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j16RLfOW9C4YiaH7BB6MMRcFU42D1+U1SQcp/GDdtLxhSlRBA0SMvahdDG21hfEfx0Jb1931rci4I7vIXpPeGjphKvhZFKY9812BxxZmpZ/ya6vVobft22b+q3FPb5oAWNvC6oRsZ8sYoHWtsbr6/SPCEBe8OnwL8+1f64ZygCVPcorumcYiFyKwzTrFD9NCMwq89rVxuBZZFufVelq6aXBUmaqRQLu62373350ArOKBT5ZdOZ0zn4VmgjzwBY84ZtCc+KeX1ug1hG1roAW3VwB59kdIGclCwkNaAnuYolfHEDPmysgb7bG5KDEhwXr+aWLd/fB7bwVkLYhfdbPwfQ==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, <vikram.garhwal@xxxxxxx>
  • Delivery-date: Wed, 06 Sep 2023 10:30:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

When building Xen for arm32 with CONFIG_DTB_OVERLAY, the following
error is printed:

common/dt-overlay.c: In function ‘iomem_remove_cb’:
././include/xen/config.h:55:24: error: format ‘%llx’ expects argument of type 
‘long long unsigned int’, but argument 3 has type ‘long unsigned int’ 
[-Werror=format=]

Function parameters s and e (denoting MMIO region) are of type unsigned
long and indicate frame numbers and not addresses. This also means that
the arguments passed to printk() are incorrect (using PAGE_ALIGN() or
PAGE_MASK ANDed with a frame number results in unwanted output). Fix it.

Take the opportunity to switch to %pd specifier to print domain id in
a consolidated way.

Fixes: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal 
functionalities")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
After this patch (and the one for xl), we are left with one issue breaking CI:
https://gitlab.com/xen-project/patchew/xen/-/jobs/5026938514
---
 xen/common/dt-overlay.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/xen/common/dt-overlay.c b/xen/common/dt-overlay.c
index b07a6128dc99..5663a049e90a 100644
--- a/xen/common/dt-overlay.c
+++ b/xen/common/dt-overlay.c
@@ -251,10 +251,8 @@ static int iomem_remove_cb(unsigned long s, unsigned long 
e, void *dom,
     rc = iomem_deny_access(d, s, e);
     if ( rc )
     {
-        printk(XENLOG_ERR "Unable to remove dom%d access to"
-               " 0x%"PRIx64" - 0x%"PRIx64"\n",
-               d->domain_id,
-               s & PAGE_MASK, PAGE_ALIGN(e) - 1);
+        printk(XENLOG_ERR "Unable to remove %pd access to %#lx - %#lx\n",
+               d, s, e);
     }
     else
         *c += e - s + 1;
-- 
2.25.1




 


Rackspace

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