From patchwork Thu Feb 9 11:33:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9564393 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 1719F60216 for ; Thu, 9 Feb 2017 11:35:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E816E284EB for ; Thu, 9 Feb 2017 11:35:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC8312852B; Thu, 9 Feb 2017 11:35:52 +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 55E97284EB for ; Thu, 9 Feb 2017 11:35:52 +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 1cbmyZ-00018K-ON; Thu, 09 Feb 2017 11:33:23 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbmyY-00018D-0E for xen-devel@lists.xenproject.org; Thu, 09 Feb 2017 11:33:22 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id 01/AB-22349-1835C985; Thu, 09 Feb 2017 11:33:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplkeJIrShJLcpLzFFi42JxWrrBXrc2eE6 EwYtuC4vvWyYzOTB6HP5whSWAMYo1My8pvyKBNePT7rVMBU8FK+Zuu8zcwHiMr4uRk0NCwF9i ev9hRhCbTUBH4uLcnWxdjBwcIgIqErf3GnQxcnEwCxxilFi54j0bSI2wgInElvurmEFsFqCaX W/3s4PYvAKWElMPHGKEmKknsevIb1aIuKDEyZlPWEBsZgFNidbtv9khbHmJ5q2zweYICShK9M 97wDaBkWcWkpZZSFpmIWlZwMi8ilGjOLWoLLVI18hYL6koMz2jJDcxM0fX0MBMLze1uDgxPTU nMalYLzk/dxMjMHgYgGAH45/5gYcYJTmYlER5I/7PjhDiS8pPqcxILM6ILyrNSS0+xCjDwaEk wasUNCdCSLAoNT21Ii0zBxjGMGkJDh4lEV4ukDRvcUFibnFmOkTqFKOilDivKEhCACSRUZoH1 waLnUuMslLCvIxAhwjxFKQW5WaWoMq/YhTnYFQS5uUBmcKTmVcCN/0V0GImoMXXT88CWVySiJ CSamBU+7OtbdW+3CNT3gbP6GXMTBEsLF25xYTn7ibfH3VJUdO0PzY9atmn25ZTJZDptY8v9/r Md5eWv5018dWH7f133M8K6zRM+/lxyrZ75zZ8eNf0aXf+mUV2go/bvV+3MKgXvf837+s5Z4WC EqEup+9yzwRWWjQ/OfvjZ5AB99tquRt80sYSLZMzlFiKMxINtZiLihMBwEtRu5gCAAA= X-Env-Sender: prvs=206367711=roger.pau@citrix.com X-Msg-Ref: server-2.tower-27.messagelabs.com!1486639996!33753440!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 53086 invoked from network); 9 Feb 2017 11:33:17 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 9 Feb 2017 11:33:17 -0000 X-IronPort-AV: E=Sophos;i="5.35,349,1484006400"; d="scan'208";a="414599608" From: Roger Pau Monne To: Date: Thu, 9 Feb 2017 11:33:12 +0000 Message-ID: <20170209113312.63204-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) MIME-Version: 1.0 Cc: Andrew Cooper , Kevin Tian , Jan Beulich , Jun Nakajima , Roger Pau Monne Subject: [Xen-devel] [PATCH] x86/vmx: fix build with clang 3.8.0 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 The usage of the __transparent__ attribute in 991033fa introduces some issues when compiled with clang 3.8.0: xen/include/asm/hvm/vmx/vmx.h:605:15: error: transparent_union attribute can only be applied to a union definition; attribute ignored [-Werror,-Wignored-attributes] typedef union __transparent__ ept_qual { ^ xen/include/xen/compiler.h:50:44: note: expanded from macro '__transparent__' #define __transparent__ __attribute__((__transparent_union__)) This can be easily fixed by moving the attribute to the end of the definition, but then the following error triggers: xen/include/asm/hvm/vmx/vmx.h:607:5: error: size of field '' (16 bits) does not match the size of the first field in transparent union; transparent_union attribute ignored [-Werror,-Wignored-attributes] struct { ^ xen/include/asm/hvm/vmx/vmx.h:606:19: note: size of first field is 64 bits unsigned long raw; ^ Which can be fixed by introducing a new field in the nested structure that contains the padding in order to match the size of an unsigned long. Signed-off-by: Roger Pau Monné --- Cc: Jun Nakajima Cc: Kevin Tian Cc: Jan Beulich Cc: Andrew Cooper --- xen/include/asm-x86/hvm/vmx/vmx.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h index 5f7512b..52646b7 100644 --- a/xen/include/asm-x86/hvm/vmx/vmx.h +++ b/xen/include/asm-x86/hvm/vmx/vmx.h @@ -602,15 +602,16 @@ void vmx_pi_hooks_assign(struct domain *d); void vmx_pi_hooks_deassign(struct domain *d); /* EPT violation qualifications definitions */ -typedef union __transparent__ ept_qual { +typedef union ept_qual { unsigned long raw; struct { bool read:1, write:1, fetch:1, eff_read:1, eff_write:1, eff_exec:1, /* eff_user_exec */:1, gla_valid:1, gla_fault:1; /* Valid iff gla_valid. */ + unsigned long /* pad */:55; }; -} ept_qual_t; +} ept_qual_t __transparent__; #define EPT_L4_PAGETABLE_SHIFT 39 #define EPT_PAGETABLE_ENTRIES 512