From nobody Mon Feb 9 16:45:19 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f8rCl4ssMz6RhQL; Mon, 09 Feb 2026 16:45:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f8rCl44LDz3ZY6; Mon, 09 Feb 2026 16:45:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770655523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jyagdVnMhIzV1hezhXqDkFN5wMUyb8G6qRlg5bd0lao=; b=CT/LfKhD5HpH/ldjwU0NKy4RzRlRVbhSM51knH0Yfiy2s849xHsYQC9WKSnZsDK6oNUwdg QSfYqtSnRYu1XhOmmAAe39qZfO0SO5ziajjR0kV59IYRquLNDjkHBePnsR9ZzL4t7MY5K5 jE1/5SLlDpp2WfLMYCt0F9CWnyKeGlyaPr3UriWEFmX661QE6BaSjcGxg1qoynJF2+d4SJ qfVQHuSV0vfzwCDOOw9xQWm1x0Y5J3MDvQPpW6fAMUeekv+HxCejac267RVUMQW0B76G8v QMcNg2Ci1kH1gYLmcf8072fWF/L/TH0BUtDlrctjX6w+XWjlWbBqm/6idI5xWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770655523; a=rsa-sha256; cv=none; b=SrvTGF5TO6//ZdWMXysDMesVKuI9Z5gdrCNDs5+zXsanTlGoycxdZhpXqaAUHVrR/FlRUr ZbqYEOkgmWvn3e+OQRh+SLN+DmOXiKRadUJovojablrvr/6o5XcZnUzskORQzI0fz3wuJ9 VdaFnfQE8lopE4wV67SlVqxwbiVr14h7De7jDgJ6Xn0+xOQL5e13nmQEY2WXQtz1TPX+Hx aQWyWPV9lhN87uPSGvujI3z9cH/QkuvwFusM1VbmAJbq0zQEw+hCbQu8xEiP4xk5mcaQ+E 3JCUTeJejQRx/p6Ti8UMdv5uLbNVPo/Ql+xwBxjoWgIxlrV8LpwdgSkR8adwuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770655523; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jyagdVnMhIzV1hezhXqDkFN5wMUyb8G6qRlg5bd0lao=; b=PIRkHBh2z5oXRXxPlH8ayPs4MZrzbVj8e2sAwPxrdbrKUyHaAp9+ojf2aM1TJbg2z+tSc2 0/6Zuyl5F0Vu/C5nNh9PqalfUr3cJuSAaVYwnf4QANsGA4yFe7CZvsdypDIeRRstLb9oR0 x74tWGdGIdf2rc1pPqdbvFXxtWhmt0JlnkMj0UgGBaEoLPI6mO3yyAId+G/hX/wlKSf6Zm 0rrcVGqn8kH+FMmT6oBhAU16WMl2gKZGx0ZTEm6zWsvDl2iZLH3Va0yQ+tTghjbOh4Xt6O +90yKgOGRuzn//AUwD3X3FTROct0xmUBILy1hsIGP65VbIRRLd+715UDSsJq1g== Received: from [IPV6:2601:5c0:4202:5670:ed0c:b253:7c2f:c8b9] (unknown [IPv6:2601:5c0:4202:5670:ed0c:b253:7c2f:c8b9]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4f8rCl1dTbzms; Mon, 09 Feb 2026 16:45:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 9 Feb 2026 11:45:19 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 8f23665fed2f - main - pcb.h: mark struct pcb to be preserved Content-Language: en-US To: Minsoo Choo Cc: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <69896027.2112e.2852c0dd@gitrepo.freebsd.org> <5bec84ad-a01e-4931-98e6-4ba06adb1237@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/9/26 10:56, Minsoo Choo wrote: > On Monday, February 9th, 2026 at 10:12 AM, John Baldwin wrote: > >> On 2/8/26 23:18, Konstantin Belousov wrote: >> >>> The branch main has been updated by kib: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=8f23665fed2fbaf4481359b4d2fcdd7b9feb40e3 >>> >>> commit 8f23665fed2fbaf4481359b4d2fcdd7b9feb40e3 >>> Author: Minsoo Choo minsoochoo0122@proton.me >>> AuthorDate: 2026-02-06 20:03:53 +0000 >>> Commit: Konstantin Belousov kib@FreeBSD.org >>> CommitDate: 2026-02-09 04:17:16 +0000 >>> >>> pcb.h: mark struct pcb to be preserved >>> >>> There are programs that depend on this structure (e.g. kernel debuggers) >>> that breaks when the ABI changes. >>> >>> Signed-off-by: Minsoo Choo minsoochoo0122@proton.me >>> Reviewed by: kib >>> MFC after: 1 week >>> Differential Revision: https://reviews.freebsd.org/D55149 >> >> >> Hmmm, I think it is useful to know which fields debuggers use (typically just >> registers) vs which ones can be safely changed without impacting debuggers. >> >> -- >> John Baldwin > > In the review, kib said: >> I had to add and preserve the padding fields pcb_pad in the amd64 structure to be compatible with kgdb at least. This makes me sure that the whole pcb layout is fixed by ABI. It is no longer needed and hasn't been needed in a decade. Back when the field was first added, kgdb did indeed assume a fixed size for `struct pcb`. However, back in 2015 I added a pcb_size variable that debuggers can use to determine this size (to properly index the stoppcbs[] array) even if debug symbols weren't present: commit 645743ea99829e6d578cca5a580cf0a4102fb7dd Author: John Baldwin Date: Thu Nov 12 22:00:59 2015 +0000 Export various helper variables describing the layout and size of certain kernel structures for use by debuggers. This mostly aids in examining cores from a kernel without debug symbols as a debugger can infer these values if debug symbols are available. One set of variables describes the layout of 'struct linker_file' to walk the list of loaded kernel modules. A second set of variables describes the layout of 'struct proc' and 'struct thread' to walk the list of processes in the kernel and the threads in each process. The 'pcb_size' variable is used to index into the stoppcbs[] array. The 'vm_maxuser_address' is used to distinguish kernel virtual addresses from user addresses. This doesn't have to be perfect, and 'vm_maxuser_address' is a cheap and simple way to differentiate kernel pointers from simple values like TIDs and PIDs. While here, annotate the fields in struct pcb used by kgdb on amd64 and i386 to note that their ABI should be preserved. Annotations for other platforms will be added in the future. This was even the commit that added the annotations just removed, so a simple blame for why the annotations were present would have turned this up. -- John Baldwin