From patchwork Fri Oct 21 20:06:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9390045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A9FF60762 for ; Fri, 21 Oct 2016 20:09:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C1572A296 for ; Fri, 21 Oct 2016 20:09:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 807362A29A; Fri, 21 Oct 2016 20:09:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 619A92A299 for ; Fri, 21 Oct 2016 20:09:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bxg5s-00029i-JO; Fri, 21 Oct 2016 20:07:08 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bxg5r-00028e-H7 for xen-devel@lists.xenproject.org; Fri, 21 Oct 2016 20:07:07 +0000 Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id 05/F2-12614-A657A085; Fri, 21 Oct 2016 20:07:06 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRWlGSWpSXmKPExsVybKJsh25WKVe EQdt0aYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNePz9X7Wgg7uij+7dzI1MF7h6GLk4hASmMoo 8fTtHxYIZzuTxJXHrYxdjJwcbAKGEn+fbGIDsUUEZCQ6Ly0CizML5Es8ufyUHcQWFjCXOPZ1J jOIzSKgKrFk/imwGl4BN4kTBx4wgdgSAnISJ49NZu1i5ODgFPCW+PohGMQUEvCSmPmSB6IiQ2 JezxxWCNtLYtGNS1C2msTVc5uYJzDyLWBkWMWoXpxaVJZapGuol1SUmZ5RkpuYmaNraGCql5t aXJyYnpqTmFSsl5yfu4kRGCL1DAyMOxibep0PMUpyMCmJ8i6ayBkhxJeUn1KZkVicEV9UmpNa fIhRhoNDSYLXvYQrQkiwKDU9tSItMwcYrDBpCQ4eJRFeXpA0b3FBYm5xZjpE6hSjopQ4bxJIQ gAkkVGaB9cGi5BLjLJSwryMDAwMQjwFqUW5mSWo8q8YxTkYlYR5s0Gm8GTmlcBNfwW0mAlocU 0aB8jikkSElFQDY6XAktlNJ1L3WBldaHU/uDAlxO0O/zGvsjKz1VWH5vyUYVhv9LsoYP+JAFY vuwDGR49b3rIdeKfnWcyh/1Eni4/3uC/Lqp3nLV7viIj11npxd0Vl4Y3m6sp1z09W2Lj4zmte J5fTLy1au4B516tABy2d0LDWax/CbvMc2tRZuenu3zlc62WtlFiKMxINtZiLihMBheUPkosCA AA= X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-10.tower-206.messagelabs.com!1477080424!48988338!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2886 invoked from network); 21 Oct 2016 20:07:05 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-10.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 21 Oct 2016 20:07:05 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DEA7F20117; Fri, 21 Oct 2016 20:07:02 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (96-82-76-110-static.hfc.comcastbusiness.net [96.82.76.110]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 68EB02010B; Fri, 21 Oct 2016 20:07:01 +0000 (UTC) From: Stefano Stabellini To: peter.maydell@linaro.org Date: Fri, 21 Oct 2016 13:06:57 -0700 Message-Id: <1477080419-19730-1-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP Cc: anthony.perard@citrix.com, xen-devel@lists.xenproject.org, sstabellini@kernel.org, qemu-devel@nongnu.org Subject: [Xen-devel] [PULL 1/3] xen-usb: do not reference PAGE_SIZE 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" X-Virus-Scanned: ClamAV using ClamSMTP PAGE_SIZE is undefined on ARM64. Use XC_PAGE_SIZE instead, which is always 4096 even when page granularity is 64K. For this to actually work with 64K pages, more changes are required. Signed-off-by: Stefano Stabellini Reviewed-by: Juergen Gross Release-acked-by: Wei Liu --- hw/usb/xen-usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c index 174d715..de2ebd6 100644 --- a/hw/usb/xen-usb.c +++ b/hw/usb/xen-usb.c @@ -160,7 +160,7 @@ static int usbback_gnttab_map(struct usbback_req *usbback_req) for (i = 0; i < nr_segs; i++) { if ((unsigned)usbback_req->req.seg[i].offset + - (unsigned)usbback_req->req.seg[i].length > PAGE_SIZE) { + (unsigned)usbback_req->req.seg[i].length > XC_PAGE_SIZE) { xen_be_printf(xendev, 0, "segment crosses page boundary\n"); return -EINVAL; } @@ -183,7 +183,7 @@ static int usbback_gnttab_map(struct usbback_req *usbback_req) for (i = 0; i < usbback_req->nr_buffer_segs; i++) { seg = usbback_req->req.seg + i; - addr = usbback_req->buffer + i * PAGE_SIZE + seg->offset; + addr = usbback_req->buffer + i * XC_PAGE_SIZE + seg->offset; qemu_iovec_add(&usbback_req->packet.iov, addr, seg->length); } }