From: "Jan Beulich" Subject: Re: [PATCH v15 02/11] x86: add generic resource (e.g. MSR) access hypercall Date: Fri, 05 Sep 2014 12:49:48 +0100 Message-ID: <5409BF7C02000078000316F5@mail.emea.novell.com> References: <1409906249-6057-1-git-send-email-chao.p.peng@linux.intel.com> <1409906249-6057-3-git-send-email-chao.p.peng@linux.intel.com> <5409977F.6060000@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5409977F.6060000@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Chao Peng , xen-devel@lists.xen.org Cc: keir@xen.org, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, George.Dunlap@eu.citrix.com, Ian.Jackson@eu.citrix.com, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org >>> On 05.09.14 at 12:59, wrote: > On 05/09/14 09:37, Chao Peng wrote: >> --- a/xen/include/public/platform.h >> +++ b/xen/include/public/platform.h >> @@ -527,6 +527,20 @@ struct xenpf_core_parking { >> typedef struct xenpf_core_parking xenpf_core_parking_t; >> DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t); >> >> +#define XENPF_resource_op 61 >> + >> +#define XEN_RESOURCE_OP_MSR_READ 0 >> +#define XEN_RESOURCE_OP_MSR_WRITE 1 >> + >> +struct xenpf_resource_op { >> + uint16_t cmd; /* XEN_RESOURCE_OP_* */ > > There is an alignment issue here between 32 and 64bit. Putting an an > explicit unit16_t _resd; field should fix it. In fact there isn't (uint32_t is 4-byte aligned in both cases), but want such padding be spelled out anyway. Even more, to allow using such fields for future extensions, checking that the caller passes zero is pretty desirable (read: I personally wouldn't accept a patch that doesn't). Jan