From patchwork Sun Aug 6 16:44:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mikko Rapeli X-Patchwork-Id: 9883875 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 EC32A603F2 for ; Sun, 6 Aug 2017 16:50:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDEDF2853F for ; Sun, 6 Aug 2017 16:50:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D143C285A8; Sun, 6 Aug 2017 16:50:41 +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 405D9285C6 for ; Sun, 6 Aug 2017 16:50:40 +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 1deOin-0000lg-RL; Sun, 06 Aug 2017 16:48:09 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1deOim-0000la-Iy for xen-devel@lists.xenproject.org; Sun, 06 Aug 2017 16:48:08 +0000 Received: from [85.158.143.35] by server-10.bemta-6.messagelabs.com id 63/83-03582-74847895; Sun, 06 Aug 2017 16:48:07 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHIsWRWlGSWpSXmKPExsUS/WKWpK6LR3u kweYblhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8abu59YC5bxVSy6f5a5gXEdTxcjF4eQwA4m ie3zzjB1MXJysAloSDyZc4i9i5GDQ0TARmLuW1WQGmaB/UwSz2fMYgOpERbwlri44y0jiM0io Cpx8fx/dhCbV8BC4ty2FrC4hIC8xMTeaWA2J1D88YGlYDVCAuYSO5atYoGoF5Q4OfMJC8guZg F1ifXzhEDCzECtzVtnM0OMsZI48xPkNA4gW0Pi2jVziLCnxOEtS9kmMArMQjJoFsKgWUgGLWB kXsWoXpxaVJZapGuql1SUmZ5RkpuYmaNraGCml5taXJyYnpqTmFSsl5yfu4kRGJYMQLCDcfpl /0OMkhxMSqK88SvaIoX4kvJTKjMSizPii0pzUosPMcpwcChJ8Mq5t0cKCRalpqdWpGXmACMEJ i3BwaMkwnvbDSjNW1yQmFucmQ6ROsWoy/Fqwv9vTEIsefl5qVLivPdAigRAijJK8+BGwKL1Eq OslDAvI9BRQjwFqUW5mSWo8q8YxTkYlYR5t4NM4cnMK4Hb9AroCCagI94ktoIcUZKIkJJqYJy 8xqRqgcXJle+a1ly7yME8w+36l+icQhM9rqbtNgcc4ltWyC3j3P963o4fZkH72Bka/G6GWnnF Sl7NKSs4s2Y+bx0zY/EBe3OvfiuD+zP36h78kbq78Z7y/3Vpl3ZGzN2qWG6q4vz0eaVMk19x9 GfVDAYWtcv653fs1HK+92aT1A7uEheXYCWW4oxEQy3mouJEANay6GvRAgAA X-Env-Sender: mikko.rapeli@iki.fi X-Msg-Ref: server-7.tower-21.messagelabs.com!1502038084!76716151!1 X-Originating-IP: [91.232.154.25] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 59270 invoked from network); 6 Aug 2017 16:48:04 -0000 Received: from mail.kapsi.fi (HELO mail.kapsi.fi) (91.232.154.25) by server-7.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 6 Aug 2017 16:48:04 -0000 Received: from p2003006ccd28d4000219d2fffe03c7a9.dip0.t-ipconnect.de ([2003:6c:cd28:d400:219:d2ff:fe03:c7a9] helo=totoro.fritz.box) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1deOiV-0003Hi-NV; Sun, 06 Aug 2017 19:47:51 +0300 From: Mikko Rapeli To: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Date: Sun, 6 Aug 2017 18:44:17 +0200 Message-Id: <20170806164428.2273-27-mikko.rapeli@iki.fi> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170806164428.2273-1-mikko.rapeli@iki.fi> References: <20170806164428.2273-1-mikko.rapeli@iki.fi> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2003:6c:cd28:d400:219:d2ff:fe03:c7a9 X-SA-Exim-Mail-From: mikko.rapeli@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Cc: Juergen Gross , Stefano Stabellini , Mikko Rapeli , Russell King , Paul Durrant , David Vrabel , xen-devel@lists.xenproject.org, Boris Ostrovsky Subject: [Xen-devel] [PATCH v06 26/36] uapi xen/privcmd.h: fix compilation in userspace 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP xen/interface/xen.h is not exported from kernel headers so remove the dependency and provide needed defines for domid_t and xen_pfn_t if they are not already defined by some other e.g. Xen specific headers. Suggested by Andrew Cooper on lkml message <5569F9C9.8000607@citrix.com>. The ifdef for ARM is ugly but did not find better solutions for it. Then use __kernel_size_t instead of size_t since that is available in uapi headers in user space. Fixes userspace compilation errors: xen/privcmd.h:38:31: fatal error: xen/interface/xen.h: No such file or directory xen/privcmd.h:92:2: error: unknown type name ‘size_t’ Signed-off-by: Mikko Rapeli Cc: Paul Durrant Cc: David Vrabel Cc: Stefano Stabellini Cc: Russell King Reviewed-by: Stefano Stabellini --- include/uapi/xen/privcmd.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/uapi/xen/privcmd.h b/include/uapi/xen/privcmd.h index 63ee95c9dabb..565f3003741d 100644 --- a/include/uapi/xen/privcmd.h +++ b/include/uapi/xen/privcmd.h @@ -35,7 +35,17 @@ #include #include -#include + +/* Defined by include/xen/interface/xen.h, but it is not part of Linux uapi */ +#ifndef __XEN_PUBLIC_XEN_H__ +typedef __u16 domid_t; + +#if (defined __ARMEL__ || defined __ARMEB__) +typedef __u64 xen_pfn_t; +#else +typedef unsigned long xen_pfn_t; +#endif /* (defined __ARMEL__ || defined __ARMEB__) */ +#endif /* __XEN_PUBLIC_XEN_H__ */ struct privcmd_hypercall { __u64 op; @@ -79,7 +89,7 @@ struct privcmd_mmapbatch_v2 { struct privcmd_dm_op_buf { void __user *uptr; - size_t size; + __kernel_size_t size; }; struct privcmd_dm_op {