Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Nov 2014 09:59:22 -0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, Luigi Rizzo <rizzo@iet.unipi.it>, John Baldwin <jhb@freebsd.org>
Subject:   Re: svn commit: r273266 - in head: lib/libkvm sys/compat/freebsd32 sys/kern sys/sys
Message-ID:  <CAJ-Vmo=rVCnLa%2BR_MetV4AMLYmFe44gF1op6561-7dbD=xuAZw@mail.gmail.com>
In-Reply-To: <23CF9B7D-5AB1-4A16-AC1D-6739B3164771@FreeBSD.org>
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> <CAJ-VmonuyBkHD1grJCQ=7R4U3z0z8d%2BqdoKY4i7%2BcJv6vjLqqw@mail.gmail.com> <23CF9B7D-5AB1-4A16-AC1D-6739B3164771@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10 November 2014 23:22, Dimitry Andric <dim@freebsd.org> wrote:
> It is indeed used to calculate an address offset, but as it is already
> checked against NOCPU, it should be good:
>
> gnu/usr.bin/gdb/kgdb/kthr.c:                    kt->cpu = td.td_oncpu;
> gnu/usr.bin/gdb/kgdb/trgt_i386.c:       if (kt == NULL || kt->cpu == NOCPU)
> gnu/usr.bin/gdb/kgdb/trgt_i386.c:       addr += (kt->cpu * NGDT + GPROC0_SEL) * sizeof(sd);
>
> Maybe the test could be strengthened to check that kt->cpu >= 0, but it
> might be overkill.

Ok, cool.

Yeah, please do check that; it shouldn't ever be used as an address
offset calculator if it's NOCPU.


Thanks!



-adrian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=rVCnLa%2BR_MetV4AMLYmFe44gF1op6561-7dbD=xuAZw>