All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen/pvh: trap access to IO port range 0xcf8-0xcfb
Date: Fri, 8 May 2015 12:22:33 +0200	[thread overview]
Message-ID: <554C8E69.6070002@citrix.com> (raw)
In-Reply-To: <554CA9880200007800078249@mail.emea.novell.com>

El 08/05/15 a les 12.18, Jan Beulich ha escrit:
>>>> On 08.05.15 at 12:00, <roger.pau@citrix.com> 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.

Why of type unsigned? __set_bit expects an int.

>> @@ -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.

Indeed, but I think it's more clear this way, the effect is exactly the
same. If you prefer I can only set 0xcf8 and we can get rid of the extra
i variable.

Roger.

  reply	other threads:[~2015-05-08 10:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 10:00 [PATCH] xen/pvh: trap access to IO port range 0xcf8-0xcfb Roger Pau Monne
2015-05-08 10:18 ` Jan Beulich
2015-05-08 10:22   ` Roger Pau Monné [this message]
2015-05-08 10:38     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=554C8E69.6070002@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.