Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Nov 2014 15:17:00 -0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, Luigi Rizzo <rizzo@iet.unipi.it>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, Dimitry Andric <dim@freebsd.org>
Subject:   Re: svn commit: r273266 - in head: lib/libkvm sys/compat/freebsd32 sys/kern sys/sys
Message-ID:  <CAJ-VmonuyBkHD1grJCQ=7R4U3z0z8d%2BqdoKY4i7%2BcJv6vjLqqw@mail.gmail.com>
In-Reply-To: <3279406.bOBVrcribU@ralph.baldwin.cx>
References:  <201410181936.s9IJaCwu018930@svn.freebsd.org> <CAJ-VmomFjkw5iS51qDbG3RTVYa66FNDiSCYuX%2B-o5iGAQxzSuA@mail.gmail.com> <C0A6FC3B-DF34-441E-8EDD-408F61B579A9@FreeBSD.org> <3279406.bOBVrcribU@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
just double-check that the cpu id isn't used to size anything; I've
seen it used as an offset into stuff, and NOCPU would've been entry
255 in the array, not -1.

Ian pointed this out to me recently and I've only just started digging into it.



-adrian


On 10 November 2014 12:35, John Baldwin <jhb@freebsd.org> wrote:
> On Monday, November 10, 2014 09:13:08 PM Dimitry Andric wrote:
>> I noted something similar for kgdb, when compiled with gcc:
>>
>> cc1: warnings being treated as errors
>> /usr/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c: In function
>> 'kgdb_trgt_fetch_tss': /usr/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c:142:
>> warning: comparison is always false due to limited range of data type
>>
>> In gnu/usr.bin/gdb/kgdb/kgdb.h, there is:
>>
>> struct kthr {
>>         struct kthr     *next;
>>         uintptr_t       paddr;
>>         uintptr_t       kaddr;
>>         uintptr_t       kstack;
>>         uintptr_t       pcb;
>>         int             tid;
>>         int             pid;
>>         u_char          cpu;
>> };
>>
>> The cpu field is assigned from td.td_oncpu (which is an int) in
>> kgdb_thr_add_procs(), so I think it should be safe to change it to an
>> int too:
>>
>> Index: gnu/usr.bin/gdb/kgdb/kgdb.h
>> ===================================================================
>> --- gnu/usr.bin/gdb/kgdb/kgdb.h (revision 274350)
>> +++ gnu/usr.bin/gdb/kgdb/kgdb.h (working copy)
>> @@ -41,7 +41,7 @@
>>         uintptr_t       pcb;
>>         int             tid;
>>         int             pid;
>> -       u_char          cpu;
>> +       int             cpu;
>>  };
>>
>>  extern struct kthr *curkthr;
>
> Yes, please commit.
>
> --
> John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmonuyBkHD1grJCQ=7R4U3z0z8d%2BqdoKY4i7%2BcJv6vjLqqw>