From patchwork Fri Jan 2 10:45:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 42694 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5CAF626CD1 for ; Fri, 2 Jan 2015 11:17:29 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id l15sf10525168wiw.0 for ; Fri, 02 Jan 2015 03:17:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=9aY3QFS4JSuuJ0zVolv2bX8kS+i5MvuQPM+QPqbRHIk=; b=lhHKp6ERShoScAsBJfHNjxwQALlrD+vGHVvf1l7KS9e0cs0+1wGD4n3QknejR+hE1b 8rk2d1owoMYRTgMkwUfKQI2FtoBqSb6GzYdWjQOJfh8UUrQ/Fr2FfuwAqr1gT+B4V6A3 RM1frdb0qsmSU2exkF53AG1/nEmskYDk8B6lLSwr86yAcDNEO6FN7PM5rWP6As49xxuq Znt4e3bOums0BpoBgM4H5XBIrEgarsr8RzieeiX0+ZBqUYkUz16ieo/4SATBn28Z+a1d 7+sYTiTWev8Knt7EqgfkWevkIfBtacVuaCBeKeb//UPhGxafPKeZplvHiqQqaMtCVn4S qFLg== X-Gm-Message-State: ALoCoQmU0gLUVp0rBqUaz8QKY6Ph+yqCCsrP0WPxxXPly4uRGNc4aNakqh5/yb5AePjv5SqQ0Uqo X-Received: by 10.112.154.232 with SMTP id vr8mr127967lbb.10.1420197448478; Fri, 02 Jan 2015 03:17:28 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.203.136 with SMTP id kq8ls2318219lac.84.gmail; Fri, 02 Jan 2015 03:17:28 -0800 (PST) X-Received: by 10.112.72.168 with SMTP id e8mr17477338lbv.83.1420197448338; Fri, 02 Jan 2015 03:17:28 -0800 (PST) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id g1si2797557lbd.126.2015.01.02.03.17.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 Jan 2015 03:17:27 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by mail-lb0-f172.google.com with SMTP id z12so7167712lbi.3 for ; Fri, 02 Jan 2015 03:17:27 -0800 (PST) X-Received: by 10.112.159.136 with SMTP id xc8mr5095348lbb.98.1420197447806; Fri, 02 Jan 2015 03:17:27 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp170772lbb; Fri, 2 Jan 2015 03:17:26 -0800 (PST) X-Received: by 10.107.13.205 with SMTP id 196mr67144176ion.15.1420197446102; Fri, 02 Jan 2015 03:17:26 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id z8si32666684icx.21.2015.01.02.03.17.25 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 02 Jan 2015 03:17:26 -0800 (PST) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Y70EI-00008u-15; Fri, 02 Jan 2015 11:17:18 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Y70EG-00008d-RY for edk2-devel@lists.sourceforge.net; Fri, 02 Jan 2015 11:17:16 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 74.125.82.170 as permitted sender) client-ip=74.125.82.170; envelope-from=ard.biesheuvel@linaro.org; helo=mail-we0-f170.google.com; Received: from mail-we0-f170.google.com ([74.125.82.170]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Y70EG-0006FG-10 for edk2-devel@lists.sourceforge.net; Fri, 02 Jan 2015 11:17:16 +0000 Received: by mail-we0-f170.google.com with SMTP id w61so4375844wes.29 for ; Fri, 02 Jan 2015 03:17:10 -0800 (PST) X-Received: by 10.194.85.197 with SMTP id j5mr144289468wjz.106.1420195530523; Fri, 02 Jan 2015 02:45:30 -0800 (PST) Received: from ards-macbook-pro.local ([197.131.3.201]) by mx.google.com with ESMTPSA id c10sm64201270wjy.4.2015.01.02.02.45.27 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 Jan 2015 02:45:29 -0800 (PST) From: Ard Biesheuvel To: anthony.perard@citrix.com, christoffer.dall@linaro.org, ijc@hellion.org.uk, stefano.stabellini@eu.citrix.com, lersek@redhat.com, linaro-uefi@lists.linaro.org, edk2-devel@lists.sourceforge.net Date: Fri, 2 Jan 2015 10:45:09 +0000 Message-Id: <1420195510-22100-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1420195510-22100-1-git-send-email-ard.biesheuvel@linaro.org> References: <1420195510-22100-1-git-send-email-ard.biesheuvel@linaro.org> X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1Y70EG-0006FG-10 Subject: [edk2] [RFC PATCH 4/5] Ovmf/Xen: fix pointer to int cast in XenBusDxe X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 On ARM, xen_pfn_t is 64 bits but the size of a pointer is only 32 bits, so casting between them needs to go via (UINTN) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- OvmfPkg/XenBusDxe/GrantTable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/XenBusDxe/GrantTable.c b/OvmfPkg/XenBusDxe/GrantTable.c index ae9059c146f1..0d133db6954e 100644 --- a/OvmfPkg/XenBusDxe/GrantTable.c +++ b/OvmfPkg/XenBusDxe/GrantTable.c @@ -159,7 +159,7 @@ XenGrantTableInit ( Parameters.domid = DOMID_SELF; Parameters.idx = Index; Parameters.space = XENMAPSPACE_grant_table; - Parameters.gpfn = (((xen_pfn_t) GrantTable) >> EFI_PAGE_SHIFT) + Index; + Parameters.gpfn = (((xen_pfn_t)(UINTN) GrantTable) >> EFI_PAGE_SHIFT) + Index; ReturnCode = XenHypercallMemoryOp (Dev, XENMEM_add_to_physmap, &Parameters); if (ReturnCode != 0) { DEBUG ((EFI_D_ERROR, "Xen GrantTable, add_to_physmap hypercall error: %d\n", ReturnCode)); @@ -181,7 +181,7 @@ XenGrantTableDeinit ( for (Index = NR_GRANT_FRAMES - 1; Index >= 0; Index--) { Parameters.domid = DOMID_SELF; - Parameters.gpfn = (((xen_pfn_t) GrantTable) >> EFI_PAGE_SHIFT) + Index; + Parameters.gpfn = (((xen_pfn_t)(UINTN) GrantTable) >> EFI_PAGE_SHIFT) + Index; DEBUG ((EFI_D_INFO, "Xen GrantTable, removing %X\n", Parameters.gpfn)); ReturnCode = XenHypercallMemoryOp (Dev, XENMEM_remove_from_physmap, &Parameters); if (ReturnCode != 0) {