From patchwork Tue Oct 31 06:55:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 117521 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3524203qgn; Mon, 30 Oct 2017 23:57:32 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SZRghj/oo/I9/h+3zMbZLKl1i8DsAB7RKdpsWr3+ZQO91YxkeGH4QJ5uDtga2W1lW4OkQ0 X-Received: by 10.36.198.196 with SMTP id j187mr1685080itg.149.1509433052205; Mon, 30 Oct 2017 23:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509433052; cv=none; d=google.com; s=arc-20160816; b=LOzltyQiOZmVAyzQYbqu7BPZ6ZxdzEQyHvhFvN9xs+Vun3cry+G9u8nuE0NujayUWl RNIUHX5RmL7BzojA1GJT+SLHtnN6zJh/GlRSRfXBSapJFU476xg8iU+HoswjFnIt1DoX 6qwNDU5rDWdLF74Zz9kNGNYuNkB6uza8Grcr8WiQh9lQT9QgT9+MEmwd4sZQbu57pWDH vanMYAmWHSqWTgJBXvw8KaGuFAVMLLh2eYy0wPZWsNlXW+EDB3n/ZiQL989klnbKhqgP yYRQX3yT66Ret43k1hgwSTNf+txkgjQQHZXbtFkcUmhaGutCPqaPf44As5eGS6gvooyG sq/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=UxXlZSuDuVTtjtV8y7g9eTnj4NQQmoj47ze93vuoYOo=; b=QvscTjC16uSlswjkNEh890htVwmG3CwXjSQCfeQacNvD/dkcuGaygCU44HExQFBPTD 8dyQWv5VPIAqV9dk12u44xyeKf+lV4eDibgRhAx1PFE3xmPdP1NJuyBHGAGYTiAOS2BS E9eXnEKcEKk9TrdAOOPm53WYVaha1rmxEHftD+XH8V0Y9m1UxtWkIIeF+KcTL8XPWXNY FARZ5lx363JA+TlGxaUj+ktDVjhxqOX//uvCFUchZ03T8On0oNGL6xtPvIP7LAcnbiE1 /MLHOmionLJsMvJj+GdUhD73WbQP2BZ4yCNjKsDcvXd/STJgERQef9AnZy7HeWuahStl 3Gxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=AMYZ+jq/; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id q74si841074iod.22.2017.10.30.23.57.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Oct 2017 23:57:32 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=AMYZ+jq/; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9QSE-0002xs-4q; Tue, 31 Oct 2017 06:55:18 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e9QSC-0002xm-P0 for xen-devel@lists.xenproject.org; Tue, 31 Oct 2017 06:55:17 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id 6E/3D-29911-45E18F95; Tue, 31 Oct 2017 06:55:16 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsVyMfTAEd1guR+ RBhsWKlt83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBmnXv1iKTgiXPG3bRJbA+NMwS5GLg4hgVmM Env+N7KDOCwC7cwS6+ZOZwVxJATesUhcbNnF0sXICeTkScw5sJq5i5EDyE6TOLwoFyJcKbH3y h02EFtIQEvi6KnZrBBTdzBJzGifwg5SzyZgIjGrQwKkRkRASeLeqslMIDXMAm8ZJRbuuckKkh AWKJB4d/YyK0g9i4CqxLXNFSBhXgFvifs/fzFD7JKTuHmuk3kCI/8CRoZVjBrFqUVlqUW6hoZ 6SUWZ6RkluYmZObqGBmZ6uanFxYnpqTmJScV6yfm5mxiBAcQABDsYPy0LOMQoycGkJMq70/F7 pBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3iLZH5FCgkWp6akVaZk5wFCGSUtw8CiJ8OrKAKV5i wsSc4sz0yFSpxjtOS7cufSHiePAnltAsuPmXSD5bObrBmYhlrz8vFQpcV5nkKkCIG0ZpXlwQ2 Gxd4lRVkqYlxHoTCGegtSi3MwSVPlXjOIcjErCvJwgU3gy80rgdr8COosJ6CwvCbCzShIRUlI NjG6/OyZFxcR1dKev675d0XFzzrEDh2yS61pv/LWJ/Bb//79kbVRRJ++jm03b7q9dn/yzh9tG xn59pjgrv7uX8p7eqJsS11k+RS/T2sNk+uHolQ0fXn7bxKLHe1Zth6Wz7nElw7w9L/0sAtn2d RbNdQmZmmpvPctpfZaOdr3ars+rNt7YXmYip8RSnJFoqMVcVJwIAJmaGA+4AgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-2.tower-27.messagelabs.com!1509432914!54619544!1 X-Originating-IP: [209.85.192.196] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 39617 invoked from network); 31 Oct 2017 06:55:15 -0000 Received: from mail-pf0-f196.google.com (HELO mail-pf0-f196.google.com) (209.85.192.196) by server-2.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 31 Oct 2017 06:55:15 -0000 Received: by mail-pf0-f196.google.com with SMTP id b85so13017859pfj.13 for ; Mon, 30 Oct 2017 23:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=zy8Xnw6+aLmA1Y3jl9pWt1In8uySHj6pszzVRcxZ49A=; b=AMYZ+jq/Hs2ntFlzIxB5/UBpIfycTe1yJ/5kW+KHLhpJVhb9WQsfTnjQPkin+cqP9n ZRjknvEsk7QJdBBECH2jhVHaGayA3nPxPWD7CgsFqaM1Z6CPkBmNRFO7rnLXnfPPZgPp AI/h7mzAq6q/OLigi48QgxDISLRM01vMOoib4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zy8Xnw6+aLmA1Y3jl9pWt1In8uySHj6pszzVRcxZ49A=; b=dHmbjdvM3xD3RvDJD6vtfP9GpdqmB42xzAeD3DGobMkC9Suu/KvG3AyascdJjUHcok DsRbYE9dN7nEe+eWZpXdPVrxK96yb/Om0SXN6o7tzgjX+JeQgoXUP6WXL5kTjCGt0mIy 8z4nAzttvE56B4+qgtFk/Y6tqmOplTcIuq/l5oDSeajX95UktobYQHrAGBM/j9Gq5Bnj gIpLWuf5xHZz8+WTEKd+2JJ6lhxaModTGel4eOrZQ13fRDjthTMB1EEoRgMVmTUQN44s T4RjSgHr5kns2xOklI3dTccgeqO3OsMNfy8cLqBU5Ep+U18WOEjnfzFP894fBU5XImYl WUkw== X-Gm-Message-State: AMCzsaXxpZeZIoKpvwwRvxvzjwlM609z28D7s8tsS533et24LzcAz7UL yIuMoqofj5chpeGSS8cuc5i5w6nGEJ4= X-Received: by 10.159.198.131 with SMTP id g3mr983204plo.337.1509432913840; Mon, 30 Oct 2017 23:55:13 -0700 (PDT) Received: from blr-ubuntu-linaro.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id g16sm1517127pfd.87.2017.10.30.23.55.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Oct 2017 23:55:13 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Tue, 31 Oct 2017 12:25:05 +0530 Message-Id: <1509432908-17449-1-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: Stefano Stabellini , Wei Liu , Andrew Cooper , Ian Jackson , Julien Grall , Jan Beulich Subject: [Xen-devel] [PATCH 1/4 v3] libxl: Fix the bug introduced in commit "libxl: use correct type modifier for vuart_gfn" X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" In libxl__device_vuart_add vuart_gfn is getting stored as a hex value: > flexarray_append(ro_front, GCSPRINTF("%"PRI_xen_pfn, state->vuart_gfn)); However, xenstore reads this value as a decimal value and tries to map the wrong address and fails. This patch introduces a new format specifier "PRIu_xen_pfn" which formats the value as a decimal value. Signed-off-by: Bhupinder Thakur Acked-by: Wei Liu --- CC: Ian Jackson CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich CC: Andrew Cooper tools/libxl/libxl_console.c | 2 +- xen/include/public/arch-arm.h | 1 + xen/include/public/arch-x86/xen.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_console.c b/tools/libxl/libxl_console.c index c05dc28..6bfc0e5 100644 --- a/tools/libxl/libxl_console.c +++ b/tools/libxl/libxl_console.c @@ -376,7 +376,7 @@ int libxl__device_vuart_add(libxl__gc *gc, uint32_t domid, flexarray_append(ro_front, "port"); flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->vuart_port)); flexarray_append(ro_front, "ring-ref"); - flexarray_append(ro_front, GCSPRINTF("%"PRI_xen_pfn, state->vuart_gfn)); + flexarray_append(ro_front, GCSPRINTF("%"PRIu_xen_pfn, state->vuart_gfn)); flexarray_append(ro_front, "limit"); flexarray_append(ro_front, GCSPRINTF("%d", LIBXL_XENCONSOLE_LIMIT)); flexarray_append(ro_front, "type"); diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index 5708cd2..05fd11c 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -274,6 +274,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_core_regs_t); typedef uint64_t xen_pfn_t; #define PRI_xen_pfn PRIx64 +#define PRIu_xen_pfn PRIu64 /* Maximum number of virtual CPUs in legacy multi-processor guests. */ /* Only one. All other VCPUS must use VCPUOP_register_vcpu_info */ diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h index ff91831..3b0b1d6 100644 --- a/xen/include/public/arch-x86/xen.h +++ b/xen/include/public/arch-x86/xen.h @@ -75,6 +75,7 @@ __DeFiNe__ __DECL_REG_LO16(name) e ## name #ifndef __ASSEMBLY__ typedef unsigned long xen_pfn_t; #define PRI_xen_pfn "lx" +#define PRIu_xen_pfn "lu" #endif #define XEN_HAVE_PV_GUEST_ENTRY 1