From patchwork Tue Oct 17 16:46:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 116146 Delivered-To: patch@linaro.org Received: by 10.80.163.170 with SMTP id s39csp1438411edb; Tue, 17 Oct 2017 09:48:38 -0700 (PDT) X-Received: by 10.36.65.84 with SMTP id x81mr6450075ita.61.1508258917926; Tue, 17 Oct 2017 09:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508258917; cv=none; d=google.com; s=arc-20160816; b=m8pEQB6wRwAhWRwTTqeW15K9ln+T3GNxWc2Na9Ff/a8n4k7ArnWFZeqmxt5rnrF00x EUmSRnnsXNZnjWzTF6cjm5VpyJfBQmmk81GG21d8bD88NTmkXw/DZgh4x9vC2itL+LxA /3kTdRYEg5ydBDQBK4d0akJmhJ/FMjt5Dfg/1tOFWyLFZ4U1T+G6ytE+qGciS647oOQf vdLtjDKfZF5X9kA95Q6d1Tk7JLFRxd7PzyH9A3acJ2i7ax0oVw2Fqo19xZFWmmr7Fez7 huV3TwQxEM/nlY3J+Pcge+NVE0Zfn3evXDqbJYHUlov7iAMRKEG/gtgDQmBpcI0JOFrJ n1tg== 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=KZ1tAchHEcYdj+zTrD2Rljo0ljml9m9Ah5/5M26nP66YxS+vxVCGnjj6kPrmiBaswJ 2WknuSvXM1rTAE7/c5VvwnOVQqO/K5Qs8oWOCXljpIiZLsYvy00fLHFTnVA6BsAVCh8n K43VTZclzH6LW9NuJrBPY4P0MbjL4J7r+QrVb7wIExyDEIffehP74ppuM13YX7A1z/37 HZnuT89BIvjdGM3Czx4HObJ13n6UOMx1BzWKYhOJA9kJRXZLk7gGidxCL+F//0bkpLYR 5otrURKvP78ah9YAJFPNcHewK9iS6ft3KcwWqUD/LQW8/GVuGTrGqbH4eSXhPuhNNayF GDvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XBooyG5N; 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 m72si7322885ioe.292.2017.10.17.09.48.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Oct 2017 09:48:37 -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=XBooyG5N; 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 1e4V0v-0001kd-Uo; Tue, 17 Oct 2017 16:46:45 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4V0u-0001kV-0Z for xen-devel@lists.xenproject.org; Tue, 17 Oct 2017 16:46:44 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 68/CC-00983-3F336E95; Tue, 17 Oct 2017 16:46:43 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJIsWRWlGSWpSXmKPExsXiVRtsqPvJ+Fm kwckbOhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8apV79YCo4IV/xtm8TWwDhTsIuRi0NIYBqj xPWvbawgDotAO7PEte57LCCOhMA7FonV204DOZxATp7E1Y3tTBB2msS8U2uZIexKiY93WthAb CEBLYmjp2azQtgtTBLHPmp0MXJwsAmYSMzqkAAJiwgoSdxbNZkJZD6zwFtGiYV7brKC1AgLJE p03ysAqWERUJWYdHktO4jNK+AlMf8wzCo5iZvnOpknMPIvYGRYxahRnFpUllqka2Sml1SUmZ5 RkpuYmaNraGCsl5taXJyYnpqTmFSsl5yfu4kRGED1DAyMOxgb9vodYpTkYFIS5XU2fBIpxJeU n1KZkVicEV9UmpNafIhRhoNDSYLXAxiQQoJFqempFWmZOcBQhklLcPAoifAuMwJK8xYXJOYWZ 6ZDpE4xGnPs23PrDxNHx827f5iEWPLy81KlxHkZQSYJgJRmlObBDYLF2CVGWSlhXkYGBgYhno LUotzMElT5V4ziHIxKwryGIFN4MvNK4Pa9AjqFCeiUdU5PQE4pSURISTUwMjEsSY4yj43t3WO 8XkVg3uNF+WbbuSW8btq4/nqef1tTWs181iG5FzudUyUvLJhjp39Osqiy89D09TMZ485NXvea 9wmrX40st8+Ls9dm/0wrs7JaFHv3/N6Kiz/2i6zxsH/W7Bfjc3JZeU/ERVtfraiZ9ypWdc7Rr k09/8X/6sLpL574aP3bq8RSnJFoqMVcVJwIAEK8GRasAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-9.tower-31.messagelabs.com!1508258801!55218729!1 X-Originating-IP: [74.125.83.49] 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 34549 invoked from network); 17 Oct 2017 16:46:42 -0000 Received: from mail-pg0-f49.google.com (HELO mail-pg0-f49.google.com) (74.125.83.49) by server-9.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Oct 2017 16:46:42 -0000 Received: by mail-pg0-f49.google.com with SMTP id y7so1863049pgb.7 for ; Tue, 17 Oct 2017 09:46:42 -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=XBooyG5NoIT5X6J0V+E7gaXbW0hYhH7ciaBIc5fFUbuRbjz8YcVoM7XuDSIP004eiR vg5yp5mqv985K/QTWgNBBgg9Unbgbo9DtoobhTChiCfTZA9NUdxWxlUO78tSR6lfRhO+ JZvda6hcfRkW9NFGa9aGTyAPzWbR/SDx5gO28= 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=lUfgww6MfIibUravxXAosuJ+Cz2SvLnk0vJWWeMUiEXM2BsGtqg8XF4I+EjWNPFrHt HGQ9C4+NbtSknlCOF7tBdarMCsMmJv0p8eBpLWXs98VeXU0AwS+lL42LzjPPooNeaApb qRE56ND0a4Bfzn9MCQ9dk20ag3mo/0HIUGzfijb0p+CnzeaVFjkLr4SfKD4d63eHcbeK 8Si+Xz5PmngIbZbqCMl35iHrJAWGG/w60dIEHtinamK5VwUM+HuzSINVewtctznWppHa 8/U8bB6mVXC8MeRB66gSJhyB4yQn64vpjitvYaJF0Jo97kkOlzLuTzPp6vdJHQQjcCm0 /9qg== X-Gm-Message-State: AMCzsaV8L4NPhpHHFLxhDs4tkbWq2IgyX4AOHm8Ho75jvT6oHJGbZ/T0 CZlvpxxlh5v5YESwC+pT+wfP60/INMk= X-Google-Smtp-Source: AOwi7QB9gqLcQVqd6EDpGAGeOZ3Zs5tmof5dca/GBYhJPWBwmLEykSGGqPSJiVtmugqYz/uZoGK6EA== X-Received: by 10.99.154.18 with SMTP id o18mr11254507pge.18.1508258800229; Tue, 17 Oct 2017 09:46:40 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id b3sm17926225pgr.81.2017.10.17.09.46.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Oct 2017 09:46:39 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Tue, 17 Oct 2017 22:16:29 +0530 Message-Id: <1508258793-5690-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: 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