From patchwork Fri May 10 02:17:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 16822 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0B6FC238F7 for ; Fri, 10 May 2013 02:19:43 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id b10sf4693831qen.1 for ; Thu, 09 May 2013 19:19:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=aHDyYTy5VbcuPYcmiacuGQwLNG+dIuI/Ck7NxkvAUQs=; b=BvTOE5Db32Co84edw+/DyCJEm4y92dz21xqwl4Zg1xGW9Rh1n351+dNcQN0rslr4bD v4y0GbF9PcSHc7hutqdxn2CjRWJwzly7doWfPkt4fUz6KsjG4mRDgLOdmqk5/87OqJdS GAPRv+o9MiphVXrEu7iId5u7BjuvTM70SIcw6DSi8+yTI3mX30HdO4Zlzo52a5pIMlDn vjI8kE8ntMX+WFnDsL34OBGPd3MAV0qhd0kITmAwHC7U9AKGJb29g1sKS/ee/+O+srzy KVhCysi19WCT0KdwhUoq2Y1Rv8o0FZwvubbsxAgO1hSwVSsB7GkfstVOtv7eostKmWGs cXyA== X-Received: by 10.236.91.206 with SMTP id h54mr7215453yhf.27.1368152358026; Thu, 09 May 2013 19:19:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.117.101 with SMTP id kd5ls1776178qeb.45.gmail; Thu, 09 May 2013 19:19:17 -0700 (PDT) X-Received: by 10.58.164.131 with SMTP id yq3mr9821977veb.31.1368152357401; Thu, 09 May 2013 19:19:17 -0700 (PDT) Received: from mail-ve0-x22e.google.com (mail-ve0-x22e.google.com [2607:f8b0:400c:c01::22e]) by mx.google.com with ESMTPS id ha8si328465vdb.113.2013.05.09.19.19.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 May 2013 19:19:17 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22e; Received: by mail-ve0-f174.google.com with SMTP id pb11so3433570veb.5 for ; Thu, 09 May 2013 19:19:17 -0700 (PDT) X-Received: by 10.52.69.109 with SMTP id d13mr8325304vdu.75.1368152357316; Thu, 09 May 2013 19:19:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.217.15 with SMTP id hk15csp36212vcb; Thu, 9 May 2013 19:19:16 -0700 (PDT) X-Received: by 10.180.105.231 with SMTP id gp7mr699198wib.23.1368152356259; Thu, 09 May 2013 19:19:16 -0700 (PDT) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [2a00:1450:400c:c05::235]) by mx.google.com with ESMTPS id bi5si167377wjb.80.2013.05.09.19.19.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 May 2013 19:19:16 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::235 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=2a00:1450:400c:c05::235; Received: by mail-wi0-f181.google.com with SMTP id ey16so153468wid.14 for ; Thu, 09 May 2013 19:19:15 -0700 (PDT) X-Received: by 10.194.133.198 with SMTP id pe6mr21510643wjb.9.1368152355751; Thu, 09 May 2013 19:19:15 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id dj7sm597075wib.6.2013.05.09.19.19.14 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 May 2013 19:19:15 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: Stefano.Stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, Julien Grall , JBeulich@suse.com, keir@xen.org Subject: [PATCH V3 10/41] xen/mm: Align virtual address on PAGE_SIZE in iounmap Date: Fri, 10 May 2013 03:17:56 +0100 Message-Id: <1368152307-598-11-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368152307-598-1-git-send-email-julien.grall@linaro.org> References: <1368152307-598-1-git-send-email-julien.grall@linaro.org> X-Gm-Message-State: ALoCoQlw9Fcmt1QJ82sOxi++fii5aF+jv1Oj6svY7h6xFCwIRpxRQEwLnAb9rnVEzaXY+WmDcKF5 X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22e is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , ioremap function can unlikely return an unaligned virtual address if the physical address itself is unaligned on a page size. Signed-off-by: Julien Grall CC: JBeulich@suse.com CC: keir@xen.org Acked-by: Jan Beulich --- xen/include/xen/vmap.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h index 88e5d99..c713a43 100644 --- a/xen/include/xen/vmap.h +++ b/xen/include/xen/vmap.h @@ -15,7 +15,9 @@ void __iomem *ioremap(paddr_t, size_t); static inline void iounmap(void __iomem *va) { - vunmap((void __force *)va); + vaddr_t addr = (vaddr_t)(void __force *)va; + + vunmap((void *)(addr & PAGE_MASK)); } void vm_init(void);