Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Nov 2011 11:20:19 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        FreeBSD current <freebsd-current@FreeBSD.org>
Subject:   Re: array index of '-16' indexes before the beginning of the array
Message-ID:  <4ED35253.9030101@FreeBSD.org>
In-Reply-To: <CAFMmRNzXU%2BVyqYmob%2BCy=JW71dTQPKZ9BOzLcnEjdYxBr6xkmw@mail.gmail.com>
References:  <4ED2CAFF.7070608@FreeBSD.org> <CAFMmRNzXU%2BVyqYmob%2BCy=JW71dTQPKZ9BOzLcnEjdYxBr6xkmw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
on 28/11/2011 02:59 Ryan Stone said the following:
> On Sun, Nov 27, 2011 at 6:42 PM, Andriy Gapon <avg@freebsd.org> wrote:
>>
>> Looks like clang has found a real issue here:
>> /usr/src/sys/x86/x86/local_apic.c:311:2: warning: array index of '-16' indexes
>> before the beginning of the array [-Warray-bounds]
>>        lapics[apic_id].la_ioint_irqs[IDT_DTRACE_RET - APIC_IO_INTS] =
>> IRQ_DTRACE_RET;
> 
> Hm, so as far as I can tell the DTrace-related code in local_apic.c is
> bogus.  DTrace's interrupt vectors are 32 and 33, which aren't I/O
> vectors, so local_apic.c shouldn't need to know anything about them.
> I think that the right fix is to remove all of it from local_apic.c.

I think that those vectors fall into a range designated for PIC interrupts.
sys/i386/include/apicvar.h has a nice illustration.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4ED35253.9030101>