From patchwork Wed Oct 25 09:27:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 117040 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp628250qgn; Wed, 25 Oct 2017 02:29:24 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Sb3dBkYXIoG/vG9+w5605SrH6sgCK+O//gVbVvp8w5+wSEcUaYrRkRXwdXEgIdOlAk7kT4 X-Received: by 10.36.202.3 with SMTP id k3mr1185350itg.87.1508923764895; Wed, 25 Oct 2017 02:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508923764; cv=none; d=google.com; s=arc-20160816; b=squZ0CfouKJFUyvyVXHj8eNZWwJ0qWxRQDdmnfpo6xuOGk7GnPttzAbkGKh4KyuC/Z W4aTLEcY6OJPlYXIm8GKHvFX9qAb1Yjietz4T8rbl5N4agWKDWCZuJuYm9QBO4Vq2mwS LaASBIxnrFfPJxJmhm+ovQvOi15LaiDJXLUyoVFWkDsJ287yRRyCkJIUMj0JcJcU2Yc9 rvqIUraRWenty0W9mSfdNu9r0gYz/F+j4uLBh+ZShFCWLGJKA+PCuTxTyr7XhtFYBf3W mVFQAdE7s1TLbfKE6stLoOoWIeM01a55oLEjh0bfA0N0k8fFxycn9riLhN+WjnNtI21n X4QQ== 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=ODRfyihxpT5NCDiu+4icqtBquAchSPSut1wgxNkaGFZXnKH/wQBW9g1BXI6xHKnFBH HpD3L3PR5UnVs0Fi68CgyR3UBQZOTrk0f0f3189D46OSEVTb+zUWJsTDASJR61qGycN7 VpT/IxydR8cf94iMIo+P0cz/9XLiEpy/34RwcEcJz0q2debu/W0dAGfrcGqdUZWOfWGf EBE5ddF/yQt2i/1UPTLwSEZkjhpMRjS+T/X5Pu/u6IWc8yIV90VxtUjnKeGKjumd2oEo 9OeBO314J0oELlH0vfBMGDPDjPIVA06sblk8TArWq0/8ky6oUCUsF3I7uRNWS65EmKn5 Fo3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=IIb0ul1E; 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 o79si1626233ioi.169.2017.10.25.02.29.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Oct 2017 02:29:24 -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=IIb0ul1E; 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 1e7Hy3-0003eK-C6; Wed, 25 Oct 2017 09:27:19 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7Hy1-0003dV-W1 for xen-devel@lists.xenproject.org; Wed, 25 Oct 2017 09:27:18 +0000 Received: from [193.109.254.147] by server-10.bemta-6.messagelabs.com id CE/0D-07499-5F850F95; Wed, 25 Oct 2017 09:27:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAIsWRWlGSWpSXmKPExsXiVRvsrPsl4kO kweQzOhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8apV79YCo4IV/xtm8TWwDhTsIuRi0NIYAaj xIa151hBHBaBdmaJ8/9mAjmcHBIC71gkjm3XgrDzJGa+P8QGYadJ7PmwjgXCLpeY/v0oE4gtJ KAlcfTUbFaIqS1MEktntgA5HBxsAiYSszokQGpEBJQk7q2azARSwyzwllFi4Z6bYMuEBQokGv 68ALNZBFQlZh5exghi8wp4S0y/sAdqmZzEzXOdzBMY+RcwMqxi1ChOLSpLLdI1NNFLKspMzyj JTczM0TU0MNPLTS0uTkxPzUlMKtZLzs/dxAgMIQYg2MF4fWPAIUZJDiYlUd5wjw+RQnxJ+SmV GYnFGfFFpTmpxYcYZTg4lCR4JYEhKSRYlJqeWpGWmQMMZpi0BAePkgjvq3CgNG9xQWJucWY6R OoUoyXHvj23/jBxdNy8CySfzXzdwCzEkpeflyolzrsfpEEApCGjNA9uHCziLjHKSgnzMgIdKM RTkFqUm1mCKv+KUZyDUUmY9zfIFJ7MvBK4ra+ADmICOqhJFeygkkSElFQDo8PCFfm7dHc1yf6 ewv1qqtCe983H+n6ssJl27GD/urZ/0+69keN7v2BWylfH3ZKz++5J2+qovGRudZ/izHYw03W3 eU0Qyx72cFn+VUHH3LaeZTu0Li7AwfvY0x/2JVzfTjkHJfO3vT62bNa5pXZp/MrnUvyW6sgcW 3dE75Cd8T39L0k7vBkzbiuxFGckGmoxFxUnAgAePlNFswIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-14.tower-27.messagelabs.com!1508923635!100853816!1 X-Originating-IP: [74.125.83.67] 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 3655 invoked from network); 25 Oct 2017 09:27:16 -0000 Received: from mail-pg0-f67.google.com (HELO mail-pg0-f67.google.com) (74.125.83.67) by server-14.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 25 Oct 2017 09:27:16 -0000 Received: by mail-pg0-f67.google.com with SMTP id s2so16838264pge.10 for ; Wed, 25 Oct 2017 02:27:16 -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=IIb0ul1EkfaxsHzEvTxKjfNRSpHnvOpfkylCkN/6pb4W6lroSabgr+tLXxemfuDHrm qYguun4aDA0JOn+Kfyro/jkVuvAOkqvijiMq5l98QM63T0NcXCtYTkRWXtUp5LXYdNH+ RoOW8XFlyprhh+2E5ZL32rXVRN5rXdds4+MQY= 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=J3mx+eEQ4R+FLdnQpLSh2g9Dom+5gyWSTrS/hPUZe4FkmYQXuGypWtHMG5RDpzno3U 3hHHVbOWOt55+PQXFdJFmPd79wdh/E4gGH2bflJ9tlPCrp08LmM9FPyJlPQX8nMt7IbR Ve50vdZmlmkoD5gXQGq7pWX0Bu0nlO+TdMU0tuQVRU0z8QHf2Xd2mZY97tWaA90eERrR /+vAwiFRK7dUatEmpMNT2udp4aBP6GTLw5D6LupI7JD2qbExKNSti6JpneoJL+KbJ/qs NIr0fJ5h3mCXptOq4m44c6ZEwu4fBuT5CHeY/GKlNq5lj6sm3v9zoSXsVJqMfSlDXa50 4sJA== X-Gm-Message-State: AMCzsaXqqGj4Ggg7p7rkbBg9RG4+G3KrMMrmnRTRl98Yd6rnmKaQhHJc 4geyoKC5g5mqhc1If5kCivHZunI8tpI= X-Received: by 10.98.82.85 with SMTP id g82mr1604477pfb.31.1508923634983; Wed, 25 Oct 2017 02:27:14 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id m17sm4022861pfh.28.2017.10.25.02.27.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Oct 2017 02:27:14 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Wed, 25 Oct 2017 14:57:04 +0530 Message-Id: <1508923628-26446-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/5 v2] 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