From nobody Thu Apr 25 22:31:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1593094635; cv=none; d=zohomail.com; s=zohoarc; b=gRN2SK9McGyqA76jTUdrr4OM7uV4DkeFTHYBaY+2Eb7XmXyYeFr8W+sAVLRlwzV9mAj0vSPV/ZS2rEByhXGdZ2xnm32b5QyT1p1qkR63NObcUmLxjNY6TdCNzSVQK/B/qP+raJ1rm5KwukWmrQwtcWPk2zB8B9A1EWWJOQQmTyI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593094635; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=nKUwIEtW3RzS1F2x5W1/pSVlcd0DBruAFwJrFLime3I=; b=BuKudbM+G58dkP0mZ0uB0pacqJzyOjBUFTDUTYhV7/ngUVPF4uUVJuHQGU/c04zjVJq7ErWbkfB5ns0lbobkSwF3HRQ47l/7gWp+yvwEKNW4Zn9JaawnSGwaZv5EaF3L06JFOYBCuWUFHnlMrFeY629iqpzJ5kT5wRpXW4ulxKY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1593094635690339.71234293470764; Thu, 25 Jun 2020 07:17:15 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1joSgX-0007jt-4P; Thu, 25 Jun 2020 14:17:01 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1joSgV-0007jg-Vs for xen-devel@lists.xenproject.org; Thu, 25 Jun 2020 14:17:00 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 87646b58-b6ee-11ea-81cf-12813bfff9fa; Thu, 25 Jun 2020 14:16:58 +0000 (UTC) X-Inumbo-ID: 87646b58-b6ee-11ea-81cf-12813bfff9fa Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: EqW+1j5bkr9fnOD2kB1so+dXq6NAG8gpKPl7tJHqY3zrRXb9WZ63oKOlAOV5E6CbaldIP/UBWy ZWWkWBcI60A7fct9aS1b77grPoYM5x5mPXKxR9AGxqw/yqjsl2RPny6SJo/GHexFpucJrG4jr4 bfE1Bf5UhT8u01/YHFSJF37aUxblWZfyNiCSPNstE+9K6t1gmyk2u6zdkiwgIJnbXPkcB6Fyp1 kMwddKqVP6+e8L/teeDfroCResPyR74rVAakkwBJnIeB0ujQkvI62VlmwKvvCK0hMVTxHWACYe vGg= X-SBRS: 2.7 X-MesageID: 21232246 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,279,1589256000"; d="scan'208";a="21232246" From: Roger Pau Monne To: Subject: [PATCH for-4.14 v2] mm: fix public declaration of struct xen_mem_acquire_resource Date: Thu, 25 Jun 2020 16:16:43 +0200 Message-ID: <20200625141643.82822-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , paul@xen.org, Andrew Cooper , Ian Jackson , George Dunlap , Jan Beulich , Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" XENMEM_acquire_resource and it's related structure is currently inside a __XEN__ or __XEN_TOOLS__ guarded section to limit it's scope to the hypervisor or the toolstack only. This is wrong as the hypercall is already being used by the Linux kernel at least, and as such needs to be public. Also switch the usage of uint64_aligned_t to plain uint64_t, as uint64_aligned_t is only to be used by the toolstack. Note that a padding field is added on 32bit x86, so that the size of the structure is the same. No layout structure change. The structure doesn't need to be adjusted on 32bit Arm, because guest handlers are already expanded to 64bits. Fixes: 3f8f12281dd20 ('x86/mm: add HYPERVISOR_memory_op to acquire guest re= sources') Signed-off-by: Roger Pau Monn=C3=A9 --- Should also be backported. --- Changes since v1: - Add padding on 32bits so structure size matches between arches and the previous layout is kept. --- xen/include/public/memory.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h index dbd35305df..b6d3587cfa 100644 --- a/xen/include/public/memory.h +++ b/xen/include/public/memory.h @@ -607,6 +607,8 @@ struct xen_reserved_device_memory_map { typedef struct xen_reserved_device_memory_map xen_reserved_device_memory_m= ap_t; DEFINE_XEN_GUEST_HANDLE(xen_reserved_device_memory_map_t); =20 +#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */ + /* * Get the pages for a particular guest resource, so that they can be * mapped directly by a tools domain. @@ -645,7 +647,7 @@ struct xen_mem_acquire_resource { * IN - the index of the initial frame to be mapped. This parameter * is ignored if nr_frames is 0. */ - uint64_aligned_t frame; + uint64_t frame; =20 #define XENMEM_resource_ioreq_server_frame_bufioreq 0 #define XENMEM_resource_ioreq_server_frame_ioreq(n) (1 + (n)) @@ -662,12 +664,14 @@ struct xen_mem_acquire_resource { * This parameter may be NULL if nr_frames is 0. */ XEN_GUEST_HANDLE(xen_pfn_t) frame_list; + +#ifdef __i386__ + uint32_t pad2; +#endif }; typedef struct xen_mem_acquire_resource xen_mem_acquire_resource_t; DEFINE_XEN_GUEST_HANDLE(xen_mem_acquire_resource_t); =20 -#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */ - /* * XENMEM_get_vnumainfo used by guest to get * vNUMA topology from hypervisor. --=20 2.26.2