From patchwork Fri Oct 13 10:44:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 115750 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp575944qgn; Fri, 13 Oct 2017 03:46:28 -0700 (PDT) X-Received: by 10.107.202.2 with SMTP id a2mr1179670iog.140.1507891588570; Fri, 13 Oct 2017 03:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507891588; cv=none; d=google.com; s=arc-20160816; b=KawQ0i2FKdV5XLmVCLLuqeCmyMnvpsNcF74WzofhM2YRx3OUIttElzPmKodZ33PkcC 1jkyEsgUcZkTy0LulQQ8LyFuGSHKTczwbx/mrhheiYWyQMcdg112GSnj2ULe3+4AHYI3 VHWSdv+/S/Qa8Z4npyhKw6/RLtg8+G4BCQfTZ08qoxCV/h4WM/l4hpfQJVBXK9KxQicv TsWJNM3EtBjIQOJhgHog1/IebsKA+jyGczsTmRkRPnw0m0x7oiQgOijk9IW+AKFOHGDJ m77M+bqhNA98wDrglJ4nwwgatt2ogN6ZJyigBcOT/d708JiZf1678XV1qC/8DGyuG4Qk sMmg== 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=rilZW1OZ9OYH7Qvf2zt8mZa6ZkEYj2RAQjHb1z/xI/w=; b=HaOjQyIsZtrgHcuzCN3Y4mRFNNf4j3oLEY38eYU1hVEdncVEY67SvhSc+DHOCHwnuq mNAycprqUqxudFq+LEY1KXisf8x4Rw6deI2oOpcTAiitxuTWcM3ueXrKhBz7jORZfXIH 5cQCbHmeB+a9f0JiToSZ0ddZwGU8OwsscRviWu9m3qx9ythb4ZLrJRx0+JAdgBUTLcVb U7QHxdlCcTrVogirMJqyVz1KhMbOOq2BVhLkiJOWobDPN5DtUbIr4RJQ1h313nmbedR7 clkznJv4Oy1rRgfmvVT0JH6XpXMxgAkc/ZDj46e/DANAnB9RYBZQt6aaAbK0ErYVYSx6 AAkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iduMa2b0; 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 j7si457658iob.34.2017.10.13.03.46.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 03:46:28 -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=iduMa2b0; 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 1e2xSN-00019c-7k; Fri, 13 Oct 2017 10:44:43 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e2xSL-00018c-Ii for xen-devel@lists.xenproject.org; Fri, 13 Oct 2017 10:44:41 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id 9E/A0-26618-81990E95; Fri, 13 Oct 2017 10:44:40 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrIIsWRWlGSWpSXmKPExsVyMfTASl2JmQ8 iDRa08Ft83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBnTbk1iKegTrth4s5upgfGlQBcjF4eQwExG ifmXpzKCOCwC7cwSnRO3M4E4EgLvWCT6Zk8DcjiBnDyJO6++MELYaRILzrxkhbArJe59eAxWI ySgJXH01GxWiLE7mCT6Zz5m62Lk4GATMJGY1SEBUiMioCRxb9VksAXMAm8ZJRbuuQk2SFggUu Lr1TnsIDaLgKrExI2XwOK8Al4Sk399h1osJ3HzXCfzBEb+BYwMqxg1ilOLylKLdA3N9JKKMtM zSnITM3N0DQ1M9XJTi4sT01NzEpOK9ZLzczcxAoOIAQh2ME59H3eIUZKDSUmUVy3yQaQQX1J+ SmVGYnFGfFFpTmrxIUYZDg4lCd5ZM4BygkWp6akVaZk5wHCGSUtw8CiJ8CaApHmLCxJzizPTI VKnGC05Lty59IeJ48CeW0Cy4+bdP0xCLHn5ealS4rxZIA0CIA0ZpXlw42Axd4lRVkqYlxHoQC GegtSi3MwSVPlXjOIcjErCvDumA03hycwrgdv6CuggJqCD3kWAHVSSiJCSamCceNzNdZ1Lxjk 1xSI/pdJl52IrawPPGM96OCtKbo6F0leGVTYpSQLqSXffR27q911pIbe4yND8ihmD/mxtAwtp d6Pobimf/vnvfjXdOv24PXNyTGL5mtbLq4XEQu8orS+Tvhms/yVy7zLBrHe/uy0m+/2a8UHjY tGya1P8Vj9c9fRau6DYLhklluKMREMt5qLiRADjM0t8tAIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-10.tower-206.messagelabs.com!1507891479!78387197!1 X-Originating-IP: [209.85.192.169] 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 19448 invoked from network); 13 Oct 2017 10:44:40 -0000 Received: from mail-pf0-f169.google.com (HELO mail-pf0-f169.google.com) (209.85.192.169) by server-10.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 13 Oct 2017 10:44:40 -0000 Received: by mail-pf0-f169.google.com with SMTP id l188so9607824pfc.6 for ; Fri, 13 Oct 2017 03:44:40 -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=QNPFe1tNXiyF1vbB2XiH2ZdK6MXItTJqUr/+HMIZ8Ig=; b=iduMa2b0f1NU2eLw6Pe8Dq6ZMg3gDmtBYWabSLNh4CPsuH9cG2Z4DeGbW7NeI5ORaQ YUu1Wl9sKzfICf05y2rBGT+mNbNi5yZv1CZ0lgkWqZdp+asmG0WKTz1eP5QaZ6+fWSBA hX+o15SSgACq/8NJHjusGCu4mdwDNqJaQOihQ= 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=QNPFe1tNXiyF1vbB2XiH2ZdK6MXItTJqUr/+HMIZ8Ig=; b=UFkS5Zj43+TXGLrrvSSIP9uLAZmJnMdb1BZjoV9kPJTz3HjK4pP7hb62FxVwbPucWN bkqycUjhHu4xhtit2LFll3ylY2suENXcJJwpONcSiNHSVLAlLRxQWPVyIPUa31rg/sRt wOJuhVQQ19oQRuXxzcL3M5c5Z3+/BRh2xg3PtqPL/954qRGMphnS5RuZzkI6aPv8Dc3c 9YNngqG7aCY18V1olyay3sRzCTtJPB3wayKbMZZICPJv2P4QpiiBJ314xkwaPAXKVRzk qhpsKb+iSBkDEdcj+dalYav1xAD0GFCW3tRS7nFPvkaIfgetPiNcg684fGVAQwrVqecn vkzg== X-Gm-Message-State: AMCzsaWAPHsrEWshyzn03jWiMhtpAffCuPYN8GHWLnlTW6RIwnxK2jji Um/Ivty0z/JJSX65RFZOoyNWNidrH6g= X-Google-Smtp-Source: AOwi7QBql/1ICBFrTHYPViYunxn64Q8PzyXjAExKN+1iWGjupryT9PJpcbhPl5ftAlgNQxEKnWKugw== X-Received: by 10.159.197.66 with SMTP id d2mr1030808plo.130.1507891478598; Fri, 13 Oct 2017 03:44:38 -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 v14sm1731855pgc.78.2017.10.13.03.44.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Oct 2017 03:44:38 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Fri, 13 Oct 2017 16:14:32 +0530 Message-Id: <1507891472-4701-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] libxl: vpl011: Fix hex to dec conversion of vuart_gfn in libxl__device_vuart_add 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. Introduced a new format string "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