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: 10004117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 39E0060360 for ; Fri, 13 Oct 2017 10:46:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C07529023 for ; Fri, 13 Oct 2017 10:46:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20EB929025; Fri, 13 Oct 2017 10:46:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 908F229023 for ; Fri, 13 Oct 2017 10:46:44 +0000 (UTC) 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" X-Virus-Scanned: ClamAV using ClamSMTP 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