From owner-freebsd-current@FreeBSD.ORG Mon Nov 28 09:20:23 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70AA8106566B for ; Mon, 28 Nov 2011 09:20:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BD3778FC13 for ; Mon, 28 Nov 2011 09:20:22 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA29046; Mon, 28 Nov 2011 11:20:20 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RUxNr-000NLg-SH; Mon, 28 Nov 2011 11:20:19 +0200 Message-ID: <4ED35253.9030101@FreeBSD.org> Date: Mon, 28 Nov 2011 11:20:19 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111108 Thunderbird/8.0 MIME-Version: 1.0 To: Ryan Stone References: <4ED2CAFF.7070608@FreeBSD.org> In-Reply-To: X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD current Subject: Re: array index of '-16' indexes before the beginning of the array X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2011 09:20:23 -0000 on 28/11/2011 02:59 Ryan Stone said the following: > On Sun, Nov 27, 2011 at 6:42 PM, Andriy Gapon 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