From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v5 04/16] x86/hvm: restrict port numbers to uint16_t and sizes to unsigned int Date: Thu, 2 Jul 2015 16:54:48 +0100 Message-ID: <55955EC8.8010506@citrix.com> References: <1435669558-5421-1-git-send-email-paul.durrant@citrix.com> <1435669558-5421-5-git-send-email-paul.durrant@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZAgpC-0005JF-Ci for xen-devel@lists.xenproject.org; Thu, 02 Jul 2015 15:54:54 +0000 In-Reply-To: <1435669558-5421-5-git-send-email-paul.durrant@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Paul Durrant , xen-devel@lists.xenproject.org Cc: Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 30/06/15 14:05, Paul Durrant wrote: > diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h > index d1d79dc..1ed0c13 100644 > --- a/xen/include/asm-x86/hvm/io.h > +++ b/xen/include/asm-x86/hvm/io.h > @@ -41,12 +41,12 @@ typedef int (*hvm_mmio_write_t)(struct vcpu *v, > typedef int (*hvm_mmio_check_t)(struct vcpu *v, unsigned long addr); > > typedef int (*portio_action_t)( > - int dir, uint32_t port, uint32_t bytes, uint32_t *val); > + int dir, uint16_t port, unsigned int bytes, uint32_t *val); > typedef int (*mmio_action_t)(ioreq_t *); > struct io_handler { > int type; > unsigned long addr; > - unsigned long size; > + unsigned int size; You want to reorder size above addr to fill a 4 byte hole and avoid introducing a second. Otherwise, Reviewed-by: Andrew Cooper