From patchwork Fri Jan 23 15:03:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 43661 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A603A218DB for ; Fri, 23 Jan 2015 15:04:24 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id c13sf5137224eek.1 for ; Fri, 23 Jan 2015 07:04:23 -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=iCtvO8p2R5g+Fndp8EfIZGUaX+jGThSpv9ZKbiNT/a8=; b=gek2a4GZxn3m3t/AWYEB5pA47kPxQl4FqGACQcQ05TuvJjunubODH7z9tgb7+upD+B WKgyYIaFCoBuVTaS70J+lGTJB1rU5cgnTJMBcNJSrJscrPGOCHXSuLxhtUNpRgb2jN2y +PQL0ZG5rWnJBdWP0j7WjZPbH+BIwZRW78y6dvlSLkEB+VbXNLVmQN7Fn84H6SzCMbPW AgeBOk40JL04fO11j+3MFDMyIJ6CZFYJmxoFrRfqLoiF/ynDt/XEz7r/SFqKGkN/HzSc 4eAriA5zr33ylkCXq9ieqh2pEojT2ZqENYl5IAsJvMdir6vQSofCevwwzSaY7RUQVH52 5Iug== X-Gm-Message-State: ALoCoQmqTm3tnyigevZL8vyWFBJ/Qt/OZpgKmS+qJREolXpD4deNRu5JUVMIWbl3eouQwFyB/AMp X-Received: by 10.112.99.37 with SMTP id en5mr9260lbb.17.1422025463783; Fri, 23 Jan 2015 07:04:23 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.197.2 with SMTP id iq2ls323773lac.2.gmail; Fri, 23 Jan 2015 07:04:23 -0800 (PST) X-Received: by 10.112.198.233 with SMTP id jf9mr7965837lbc.9.1422025463530; Fri, 23 Jan 2015 07:04:23 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id jq5si1603773lbc.39.2015.01.23.07.04.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 07:04:23 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id l4so7441403lbv.13 for ; Fri, 23 Jan 2015 07:04:23 -0800 (PST) X-Received: by 10.112.14.6 with SMTP id l6mr7829822lbc.91.1422025463438; Fri, 23 Jan 2015 07:04:23 -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 c8csp283146lbb; Fri, 23 Jan 2015 07:04:22 -0800 (PST) X-Received: by 10.50.20.228 with SMTP id q4mr2285519ige.1.1422025460648; Fri, 23 Jan 2015 07:04:20 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id 20si1265705ioo.103.2015.01.23.07.04.18 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 23 Jan 2015 07:04:20 -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-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YEfmN-0001RI-K7; Fri, 23 Jan 2015 15:04:11 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YEfmM-0001R6-3K for edk2-devel@lists.sourceforge.net; Fri, 23 Jan 2015 15:04:10 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of linaro.org designates 74.125.82.177 as permitted sender) client-ip=74.125.82.177; envelope-from=ard.biesheuvel@linaro.org; helo=mail-we0-f177.google.com; Received: from mail-we0-f177.google.com ([74.125.82.177]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YEfmK-00040j-4R for edk2-devel@lists.sourceforge.net; Fri, 23 Jan 2015 15:04:10 +0000 Received: by mail-we0-f177.google.com with SMTP id l61so8042617wev.8 for ; Fri, 23 Jan 2015 07:04:02 -0800 (PST) X-Received: by 10.180.13.7 with SMTP id d7mr4613159wic.57.1422025442094; Fri, 23 Jan 2015 07:04:02 -0800 (PST) Received: from ards-macbook-pro.local ([197.129.136.117]) by mx.google.com with ESMTPSA id pl1sm2176036wic.16.2015.01.23.07.03.59 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Jan 2015 07:04:01 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.sourceforge.net, lersek@redhat.com, olivier.martin@arm.com, roy.franz@linaro.org, leif.lindholm@linaro.org, stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, anthony.perard@citrix.com, christoffer.dall@linaro.org, xen-devel@lists.xen.org, ilias.biris@linaro.org Date: Fri, 23 Jan 2015 15:03:01 +0000 Message-Id: <1422025390-8036-13-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1422025390-8036-1-git-send-email-ard.biesheuvel@linaro.org> References: <1422025390-8036-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 -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1YEfmK-00040j-4R Subject: [edk2] [PATCH v1 12/21] 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.182 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 37d3bf786c64..cc6f045c9827 100644 --- a/OvmfPkg/XenBusDxe/GrantTable.c +++ b/OvmfPkg/XenBusDxe/GrantTable.c @@ -160,7 +160,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)); @@ -182,7 +182,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) {