All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>, Jan Beulich <JBeulich@suse.com>
Cc: xen-devel@lists.xenproject.org,
	Julien Grall <julien.grall@arm.com>,
	Chao Gao <chao.gao@intel.com>
Subject: Re: [PATCH for-4.9] x86/vioapic: allow holes in the GSI range for PVH Dom0
Date: Tue, 18 Apr 2017 09:51:10 +0100	[thread overview]
Message-ID: <248a1747-73dc-2d4d-ecb4-582a205b98ed@citrix.com> (raw)
In-Reply-To: <20170418084926.3vklr3q4zrgb6mn6@dhcp-3-128.uk.xensource.com>

On 18/04/2017 09:49, Roger Pau Monne wrote:
> On Tue, Apr 18, 2017 at 02:39:34AM -0600, Jan Beulich wrote:
>>>>> On 17.04.17 at 18:09, <roger.pau@citrix.com> wrote:
>>> @@ -601,7 +587,12 @@ int vioapic_init(struct domain *d)
>>>          nr_gsis += nr_pins;
>>>      }
>>>  
>>> -    ASSERT(hvm_domain_irq(d)->nr_gsis == nr_gsis);
>>> +    /*
>>> +     * NB: hvm_domain_irq(d)->nr_gsis is actually the highest GSI + 1, but
>>> +     * there might be holes in this range (ie: GSIs that don't belong to any
>>> +     * vIO APIC).
>>> +     */
>>> +    ASSERT(hvm_domain_irq(d)->nr_gsis >= nr_gsis);
>> This becomes too weak then, as you want to index the array using
>> the GSI (and not some compressed representation with the holes
>> squashed). Which in turn means the nr_gsis calculation in this
>> function is now wrong - you need to accumulate the maximum
>> base_gsi + nr_pins value here instead. With that >= will actually
>> be fine to use here.
> Is the array of IO APICs guaranteed to be ordered from lower GSI to highest
> one?

I would certainly not bet on it.

>   So far it seems like it is on all the machines I've tested, but I'm not
> sure this is a guarantee, thus I'm going to use:
>
> nr_gsis = max(nr_gsis, base_gsi + nr_pins);

This is indeed the right thing to do.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-04-18  8:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-17 16:09 [PATCH for-4.9] x86/vioapic: allow holes in the GSI range for PVH Dom0 Roger Pau Monne
2017-04-17 18:20 ` Chao Gao
2017-04-18  7:02 ` Roger Pau Monne
2017-04-18  8:39 ` Jan Beulich
2017-04-18  8:49   ` Roger Pau Monne
2017-04-18  8:51     ` Andrew Cooper [this message]
2017-04-18  9:00     ` 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=248a1747-73dc-2d4d-ecb4-582a205b98ed@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=chao.gao@intel.com \
    --cc=julien.grall@arm.com \
    --cc=roger.pau@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.