From owner-svn-src-all@FreeBSD.ORG Tue Nov 11 17:59:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0303E28; Tue, 11 Nov 2014 17:59:24 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D81182; Tue, 11 Nov 2014 17:59:24 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id x13so12317311wgg.8 for ; Tue, 11 Nov 2014 09:59:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=TyfxFAz7/KbqjZOQesFJdJxeWDhhQsPsDvAiYULQJ9o=; b=vNK+5+crzO+MUSqctHPAxGVvd1DrrwAUYGc6ZvU+XdNqK6VxXbfwERBKzsZSoEVHZ7 QZ7t9K8dGH3Brzxh5pF2AHIKCB2XKSccIHaO3oZYkrDDPe11L7h5Z0kevvcPZObhQ5qX 12u59aYkjGp+EjvE+Di7hQMYC8PK6F/YAJAtOyegvOoip2WC+eMhqfr6H5u63TXvpV9k ooW7xmnQau5TnuqNJChAyHVN21qUiHugBSU+g2ke81Mxo7FXV8woZq4us7Cm4fy1eZSN T+NwvAfzjLJCl3HJIjv4kJ/rXdLsmd8PXLCKUwJ3rcIuqL4unBhA6klZoDbsA3a4BnUN /I6w== MIME-Version: 1.0 X-Received: by 10.180.99.105 with SMTP id ep9mr42842814wib.26.1415728762688; Tue, 11 Nov 2014 09:59:22 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Tue, 11 Nov 2014 09:59:22 -0800 (PST) In-Reply-To: <23CF9B7D-5AB1-4A16-AC1D-6739B3164771@FreeBSD.org> References: <201410181936.s9IJaCwu018930@svn.freebsd.org> <3279406.bOBVrcribU@ralph.baldwin.cx> <23CF9B7D-5AB1-4A16-AC1D-6739B3164771@FreeBSD.org> Date: Tue, 11 Nov 2014 09:59:22 -0800 X-Google-Sender-Auth: M1sBJeW5-YbyQ-Lw8a1tKSg5fSo Message-ID: Subject: Re: svn commit: r273266 - in head: lib/libkvm sys/compat/freebsd32 sys/kern sys/sys From: Adrian Chadd To: Dimitry Andric Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Luigi Rizzo , John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2014 17:59:24 -0000 On 10 November 2014 23:22, Dimitry Andric 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