From patchwork Fri Jul 4 18:47:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 33114 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 06C4520C88 for ; Fri, 4 Jul 2014 18:48:26 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id y10sf11311988pdj.5 for ; Fri, 04 Jul 2014 11:48:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:message-id:user-agent :mime-version:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type; bh=WnSu3MlvVnS4fhyFBRPp4CvRvC5Q2/f/mnJd2YK4OF4=; b=GEwv3ax9BMgf9FS1qqC91c+tJ2qMxnglqDVt/ujTXKoM/R8f1iRqLW8fZWHk50Ajin HHE0gowzFaI8SchVpiW3PHlgLichllvNfGcIGszFEc/Hoka2dLgfuA2ZlBvqrdLd94WM DiuBqr8RS00Hg4yR5EkGwuDpxJ8pz711HlYJp2K8K2fPRDDF4pfRiF8zOVxD2MiadJUV jTFsz0y04bk1yha/fbrNET1Qcqf0J/6a7w64h2re9Rw4c/tkVNLBzXxtCvFJn8ImAsou UpMHWJRkJ9yKTxdZGllnLEeMzUmKd+xGU0Tgq2WmPauw8jbjtR5DYE/B5+2gUqIbW8NY TyRQ== X-Gm-Message-State: ALoCoQl8CwJwMyCgyepJI6wmsQDdNQ75cWyIKOJxlzrg6M4osLzgaBKhSZy7FrWKO5YROOM1Mlmq X-Received: by 10.70.130.236 with SMTP id oh12mr5712218pdb.7.1404499706345; Fri, 04 Jul 2014 11:48:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.53 with SMTP id q50ls1043342qgd.2.gmail; Fri, 04 Jul 2014 11:48:26 -0700 (PDT) X-Received: by 10.220.195.67 with SMTP id eb3mr8718288vcb.30.1404499706216; Fri, 04 Jul 2014 11:48:26 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id fw8si8798478vdc.60.2014.07.04.11.48.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Jul 2014 11:48:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.176 as permitted sender) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id db12so1949515veb.35 for ; Fri, 04 Jul 2014 11:48:26 -0700 (PDT) X-Received: by 10.52.63.226 with SMTP id j2mr1351436vds.43.1404499706107; Fri, 04 Jul 2014 11:48:26 -0700 (PDT) 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.221.37.5 with SMTP id tc5csp483789vcb; Fri, 4 Jul 2014 11:48:25 -0700 (PDT) X-Received: by 10.140.87.163 with SMTP id r32mr18932019qgd.75.1404499705793; Fri, 04 Jul 2014 11:48:25 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u7si37830434qab.34.2014.07.04.11.48.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 04 Jul 2014 11:48:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:37696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X38X3-00074D-FD for patch@linaro.org; Fri, 04 Jul 2014 14:48:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X38WU-0006kP-Kb for qemu-devel@nongnu.org; Fri, 04 Jul 2014 14:47:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X38WP-0005we-Pl for qemu-devel@nongnu.org; Fri, 04 Jul 2014 14:47:50 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:35786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X38WP-0005vn-LG for qemu-devel@nongnu.org; Fri, 04 Jul 2014 14:47:45 -0400 X-IronPort-AV: E=Sophos;i="5.01,602,1400025600"; d="scan'208";a="150044101" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 04 Jul 2014 18:47:44 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Fri, 4 Jul 2014 14:47:44 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1X38WO-0005Lz-8K; Fri, 04 Jul 2014 19:47:44 +0100 Date: Fri, 4 Jul 2014 19:47:04 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-DLP: MIA1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.63 Cc: xen-devel@lists.xensource.com, Ian Campbell , Stefano Stabellini Subject: [Qemu-devel] [PATCH] compile QEMU with Xen support on ARM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.176 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 Fixes to build QEMU with Xen support on ARM and ARM64. Most fixes are due to the fact that xen_pfn_t is 64-bit sized on arm32, while it is an unsigned long on x86_32. Although QEMU can be compiled with full emulation support, on ARM we only care about the PV backends. Signed-off-by: Stefano Stabellini Reviewed-by: Peter Maydell diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 032eb7a..694e123 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -409,7 +409,7 @@ static void input_event(struct XenDevice *xendev) /* -------------------------------------------------------------------- */ -static void xenfb_copy_mfns(int mode, int count, unsigned long *dst, void *src) +static void xenfb_copy_mfns(int mode, int count, xen_pfn_t *dst, void *src) { uint32_t *src32 = src; uint64_t *src64 = src; @@ -424,8 +424,8 @@ static int xenfb_map_fb(struct XenFB *xenfb) struct xenfb_page *page = xenfb->c.page; char *protocol = xenfb->c.xendev.protocol; int n_fbdirs; - unsigned long *pgmfns = NULL; - unsigned long *fbmfns = NULL; + xen_pfn_t *pgmfns = NULL; + xen_pfn_t *fbmfns = NULL; void *map, *pd; int mode, ret = -1; @@ -483,8 +483,8 @@ static int xenfb_map_fb(struct XenFB *xenfb) n_fbdirs = xenfb->fbpages * mode / 8; n_fbdirs = (n_fbdirs + (XC_PAGE_SIZE - 1)) / XC_PAGE_SIZE; - pgmfns = g_malloc0(sizeof(unsigned long) * n_fbdirs); - fbmfns = g_malloc0(sizeof(unsigned long) * xenfb->fbpages); + pgmfns = g_malloc0(sizeof(xen_pfn_t) * n_fbdirs); + fbmfns = g_malloc0(sizeof(xen_pfn_t) * xenfb->fbpages); xenfb_copy_mfns(mode, n_fbdirs, pgmfns, pd); map = xc_map_foreign_pages(xen_xc, xenfb->c.xendev.dom, diff --git a/xen-hvm.c b/xen-hvm.c index a64486c..8c69b34 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -376,7 +376,7 @@ static int xen_remove_from_physmap(XenIOState *state, start_addr >>= TARGET_PAGE_BITS; phys_offset >>= TARGET_PAGE_BITS; for (i = 0; i < size; i++) { - unsigned long idx = start_addr + i; + xen_pfn_t idx = start_addr + i; xen_pfn_t gpfn = phys_offset + i; rc = xc_domain_add_to_physmap(xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn); diff --git a/xen-mapcache.c b/xen-mapcache.c index eda914a..dde5ae8 100644 --- a/xen-mapcache.c +++ b/xen-mapcache.c @@ -33,10 +33,10 @@ # define DPRINTF(fmt, ...) do { } while (0) #endif -#if defined(__i386__) +#if defined(__i386__) || defined(__arm__) # define MCACHE_BUCKET_SHIFT 16 # define MCACHE_MAX_SIZE (1UL<<31) /* 2GB Cap */ -#elif defined(__x86_64__) +#elif defined(__x86_64__) || defined(__aarch64__) # define MCACHE_BUCKET_SHIFT 20 # define MCACHE_MAX_SIZE (1UL<<35) /* 32GB Cap */ #endif