From nobody Mon Feb 9 16:55:41 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 4f8rRm3shsz6Rj7T; Mon, 09 Feb 2026 16:55:48 +0000 (UTC) (envelope-from minsoochoo0122@proton.me) Received: from mail-43101.protonmail.ch (mail-43101.protonmail.ch [185.70.43.101]) (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 "protonmail.com", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f8rRm1bjYz3dX8; Mon, 09 Feb 2026 16:55:48 +0000 (UTC) (envelope-from minsoochoo0122@proton.me) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1770656145; x=1770915345; bh=qZa0EDzox0df18CRqdY4ZHVfsKNPuj0LatCtTK8QMw4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=NiEZgzNVIMVQJqfB5BgUNZSQsO5x9YzvRa2sstA6wTArKWusCVR+Zb1AYjwV07Ll+ p0I5h39f62YnTrN6TjoMHID0YXVZOK0/euGzO+CaX3ZC3PBuDhR2ax/m805TkThXjj yqkNPM4VXmfeYn2SAzhCEv1XPfk47iKach5Fm6pbgri0b1YHwbS3ozSz2ofhpxV8+L A3ghtUxJRY6zTdkmdowevapUAun3z9V+hha7oF8n+N3vNg9cB4R/LnyQ3tIqJTxoKS G5vUsk8eTce9ADaN8j6i2sWJ2Yybjywd+esD8pY7vwcmq+IKG9Ck2BMAZarmnCM47U PoMCoFD9r/ODQ== Date: Mon, 09 Feb 2026 16:55:41 +0000 To: John Baldwin From: Minsoo Choo Cc: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 8f23665fed2f - main - pcb.h: mark struct pcb to be preserved Message-ID: In-Reply-To: References: <69896027.2112e.2852c0dd@gitrepo.freebsd.org> <5bec84ad-a01e-4931-98e6-4ba06adb1237@FreeBSD.org> Feedback-ID: 45891198:user:proton X-Pm-Message-ID: ce1b9b742bf4c298561e6b5041c87278be44afe6 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:62371, ipnet:185.70.43.0/24, country:CH] X-Rspamd-Queue-Id: 4f8rRm1bjYz3dX8 X-Spamd-Bar: ---- On Monday, February 9th, 2026 at 11:45 AM, John Baldwin w= rote: > On 2/9/26 10:56, Minsoo Choo wrote: >=20 > > On Monday, February 9th, 2026 at 10:12 AM, John Baldwin jhb@FreeBSD.org= wrote: > >=20 > > > On 2/8/26 23:18, Konstantin Belousov wrote: > > >=20 > > > > The branch main has been updated by kib: > > > >=20 > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D8f23665fed2fbaf44813= 59b4d2fcdd7b9feb40e3 > > > >=20 > > > > 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 > > > >=20 > > > > pcb.h: mark struct pcb to be preserved > > > >=20 > > > > There are programs that depend on this structure (e.g. kernel debug= gers) > > > > that breaks when the ABI changes. > > > >=20 > > > > Signed-off-by: Minsoo Choo minsoochoo0122@proton.me > > > > Reviewed by: kib > > > > MFC after: 1 week > > > > Differential Revision: https://reviews.freebsd.org/D55149 > > >=20 > > > Hmmm, I think it is useful to know which fields debuggers use (typica= lly just > > > registers) vs which ones can be safely changed without impacting debu= ggers. > > >=20 > > > -- > > > John Baldwin > >=20 > > In the review, kib said: > >=20 > > > I had to add and preserve the padding fields pcb_pad in the amd64 str= ucture to be compatible with kgdb at least. This makes me sure that the who= le pcb layout is fixed by ABI. >=20 >=20 > 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`. Howeve= r, 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 pr= esent: >=20 > commit 645743ea99829e6d578cca5a580cf0a4102fb7dd > Author: John Baldwin jhb@FreeBSD.org >=20 > Date: Thu Nov 12 22:00:59 2015 +0000 >=20 > 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. >=20 > One set of variables describes the layout of 'struct linker_file' to > walk the list of loaded kernel modules. >=20 > 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. >=20 > The 'pcb_size' variable is used to index into the stoppcbs[] array. >=20 > 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. >=20 > 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. >=20 > This was even the commit that added the annotations just removed, so a si= mple > blame for why the annotations were present would have turned this up. >=20 > -- > John Baldwin If this is correct, we should revert this commit. I want to hear kib@ thoug= hts on this and once he confirms someone with commit access can revert this= change. My original patch was marking pcb fields as stable for all architectures (l= ldb aarch64 kernel debugger was broken because of this). I'll create new re= vision with original patch once revert is pushed.