From patchwork Tue Aug 15 14:41:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9901965 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 4E708602C9 for ; Tue, 15 Aug 2017 14:43:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 411572889B for ; Tue, 15 Aug 2017 14:43:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3ED502889D; Tue, 15 Aug 2017 14:43:45 +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 7DAB928887 for ; Tue, 15 Aug 2017 14:43:44 +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 1dhd1w-0002H6-2p; Tue, 15 Aug 2017 14:41:16 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhd1u-0002Ge-Kn for xen-devel@lists.xenproject.org; Tue, 15 Aug 2017 14:41:14 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id 8C/C2-03557-A0803995; Tue, 15 Aug 2017 14:41:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAIsWRWlGSWpSXmKPExsXS6fjDS5eTY3K kwZXlohbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bH949YC5p5K5Zs/sPcwPicvYuRk0NIIE+i 7dEfpi5GDg5eATuJpfe0QMISAoYSpxfeZAGxWQRUJaZP+cgMYrMJqEu0PdvOClIuImAgce5oU hcjFwezwC9GiTkXpoDVCws4Suy8eI4VYnyRxOrnJ8B6OQXsJXY+WMMMsUpQ4u8OYZAws4CWxM Nft1ggbG2JZQtfg5UwC0hLLP/HMYGRbxZCwywkDbOQNMxCaFjAyLKKUaM4tagstUjX0EQvqSg zPaMkNzEzR9fQwEwvN7W4ODE9NScxqVgvOT93EyMw9BiAYAfj9Y0BhxglOZiURHkXnZ0UKcSX lJ9SmZFYnBFfVJqTWnyIUYaDQ0mCt49tcqSQYFFqempFWmYOMApg0hIcPEoivE9B0rzFBYm5x ZnpEKlTjLocryb8/8YkxJKXn5cqJc67FaRIAKQoozQPbgQsIi8xykoJ8zICHSXEU5BalJtZgi r/ilGcg1FJmFeDHWgKT2ZeCdymV0BHMAEdcaV9EsgRJYkIKakGRvE11zokQltmOv/3ljYLq+u arVp4Kq1BwrSkUi1j+ULpzXmhKdWvDnZv8tX5esDUT9FuSVLnnKVv3yUcrn8gfq3t0RUjxff9 2xj172dGvVqz/oWKy5GampPG/p3HbC/7TZ3tyT7l+3a3++7vql0FT1/u3cfXX8pZzJnU9z89I fJag8m13JlhSizFGYmGWsxFxYkANbXFvcMCAAA= X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1502808071!107316481!1 X-Originating-IP: [137.65.248.74] 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 46099 invoked from network); 15 Aug 2017 14:41:13 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-7.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 15 Aug 2017 14:41:13 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Tue, 15 Aug 2017 08:41:10 -0600 Message-Id: <59932422020000780016FED2@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.2 Date: Tue, 15 Aug 2017 08:41:06 -0600 From: "Jan Beulich" To: "xen-devel" References: <59931E0F020000780016FEA3@prv-mh.provo.novell.com> <59931E0F020000780016FEA3@prv-mh.provo.novell.com> In-Reply-To: <59931E0F020000780016FEA3@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Disposition: inline Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan Subject: [Xen-devel] [PATCH 5/8] gnttab: re-arrange struct active_grant_entry 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 While benign to 32-bit arches, this shrinks the size from 56 to 48 bytes on 64-bit ones (while still leaving a 16-bit hole). Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -160,15 +160,15 @@ shared_entry_header(struct grant_table * struct active_grant_entry { uint32_t pin; /* Reference count information. */ domid_t domid; /* Domain being granted access. */ - struct domain *trans_domain; + unsigned int start:15; /* For sub-page grants, the start offset + in the page. */ + bool is_sub_page:1; /* True if this is a sub-page grant. */ + unsigned int length:16; /* For sub-page grants, the length of the + grant. */ grant_ref_t trans_gref; + struct domain *trans_domain; unsigned long frame; /* Frame being granted. */ unsigned long gfn; /* Guest's idea of the frame being granted. */ - unsigned is_sub_page:1; /* True if this is a sub-page grant. */ - unsigned start:15; /* For sub-page grants, the start offset - in the page. */ - unsigned length:16; /* For sub-page grants, the length of the - grant. */ spinlock_t lock; /* lock to protect access of this entry. see docs/misc/grant-tables.txt for locking protocol */