From: "Jan Beulich" Subject: Re: [PATCH] xen/pvh: trap access to IO port range 0xcf8-0xcfb Date: Fri, 08 May 2015 11:18:16 +0100 Message-ID: <554CA9880200007800078249@mail.emea.novell.com> References: <1431079231-24272-1-git-send-email-roger.pau@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 1YqfMH-0004P2-2b for xen-devel@lists.xenproject.org; Fri, 08 May 2015 10:18:17 +0000 In-Reply-To: <1431079231-24272-1-git-send-email-roger.pau@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: Roger Pau Monne Cc: Andrew Cooper , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 08.05.15 at 12:00, wrote: > --- a/xen/arch/x86/setup.c > +++ b/xen/arch/x86/setup.c > @@ -1527,7 +1527,7 @@ static int __hwdom_init io_bitmap_cb(unsigned long s, > unsigned long e, > > void __hwdom_init setup_io_bitmap(struct domain *d) > { > - int rc; > + int rc, i; The new variable ought to be of unsigned type and could go into the more narrow scope it's needed in. > @@ -1535,6 +1535,12 @@ void __hwdom_init setup_io_bitmap(struct domain *d) > rc = rangeset_report_ranges(d->arch.ioport_caps, 0, 0x10000, > io_bitmap_cb, d); > BUG_ON(rc); > + /* > + * NB: we need to trap accesses to the range 0xcf8-0xcfb in order > + * to intercept 4 byte accesses. > + */ > + for ( i = 0xcf8; i < 0xcfc; i++ ) > + __set_bit(i, d->arch.hvm_domain.io_bitmap); To achieve what the comment says you'd really only need to set any one of the four bits. Jan