From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Mackerras Date: Wed, 20 Nov 2019 21:41:19 +0000 Subject: Re: [PATCH v2] kvm: mpic: limit active IRQ sources to NUM_OUTPUTS Message-Id: <20191120214119.GA12722@blackberry> List-Id: References: <20191115050620.21360-1-ppandit@redhat.com> In-Reply-To: <20191115050620.21360-1-ppandit@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On Wed, Nov 20, 2019 at 04:30:32PM +0530, P J P wrote: > +-- On Wed, 20 Nov 2019, Paul Mackerras wrote --+ > | Still not right, I'm afraid, since it could leave src->output set to > | 3, which would lead to an out-of-bounds array access. I think it > | needs to be > > => #include > > int > main (int argc, char *argv[]) > { > int i = 0; > > for (i = 0; i < 1024; i++) { > printf ("%d: %d\n", i, i % 0x3); > } > > return 0; > } > > -> https://paste.centos.org/view/fb14b3cf > => > It does not seem to set it to 0x3. When a no is divisible by 0x3, > 'src->output' will be set to zero(0). You're right, I misread the '%' as '&'. Paul.