From nobody Mon Jul 21 16:37:23 2025 X-Original-To: dev-commits-src-main@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 4bm5fD4Dsrz62rST; Mon, 21 Jul 2025 16:37:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bm5fD3Qcbz4M90; Mon, 21 Jul 2025 16:37:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753115844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=19elqX94NN8Y9YAGKpj81NDbTZ6edhjdlRw0cJ87sMI=; b=Lm7FB1XA9jvzGFEJ/9vvtew9eb6Iq0BbATdYVC8hecUyIYFScM1EOPwHCyRGgVuk3pTD9a 0jhoB7Cbc7CzQ9exahcsWTKSzORoSqFVa3kGUQKb4M1qlbXrxz6LHiqmAmyXx5WTYreWtZ i7X6Em3nVwrA4FDtBGW63GrQr+KnjrtEgmrTsqCbrC3HKINGRUqJw3tQy/G/5kBtbs8gnw WkWUACX4Dy/GzIbCr8KKVIQpLCn0iXWL1Jxxp6HYiyKnimqKpZHKYTuabp8JGhD/OONrz3 CApp8Lx2+q8mYPIWwmgoqvi2Y4nKyxc33BGKriIdo1sj8qsGlIN8zFbc+bFYWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753115844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=19elqX94NN8Y9YAGKpj81NDbTZ6edhjdlRw0cJ87sMI=; b=l4QQtafme0/d65PTLQS9KDhPgxd4ugQuyZp8+QOIgQGZGFsVS7CH2BLOwvCMHATnupXUaL XYISi+WvOB5MbCVBh/4JFmcvjCLTewHYJ/0LVNTMdco4uyplNKyGwgSfIC4GJtEqIMR7hd AcuUD24AhdXT4npKn9+KlWFQwvYTQr89jVypGMhuqbMQFzBdXuCHRIQ8Wejmew170rPABK C0lxTutWugeBkeGv/ACEvMbdE2wWPmMQoMJtjt1aCpPV5w+wnxqcKK145feXNGx9n0ycDm 9LhkGgMOGYVshV4oWyrccz/nF+sXOS9aMZKYXSj4osDs+K13C6oKh/qheZdvCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753115844; a=rsa-sha256; cv=none; b=q3MfmKCWjGD9pEhqekm5wup15L4pYyh9T5vJ145j/if41/a+0+Lx5UPIAwgeMYwLvC+mod VP0SMDsjgTs/vA5O6wGlact4s0XCS+8UrhXSXu5zYxxQkRI70/ywiyEtFbXNXwt1UA0FN/ +xdkUdnfy/rSjbzbF+h4U7N4zHwBUy7o0nfVyzYMLvGwfETgXN7kfwdhzeLZPGbs4zYeRK JkMzvyndnC6jMsAOVd+QHNusygh8ynEH72HMNHvJyiQ+p2bGFssmxHsZnZJx2prUQoJ/io E7tz+Ew0Sslpk8rmLvrIoyWbWnjFeBipGi95muGDsndmiF9BLlqfnJxlbxTAzg== Received: from [IPV6:2601:5c0:4200:b830:5995:2e3f:98fd:7c0c] (unknown [IPv6:2601:5c0:4200:b830:5995:2e3f:98fd:7c0c]) (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 4bm5fD1LZ3zG0d; Mon, 21 Jul 2025 16:37:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <35003f37-9e55-4a92-ae6e-58b35409700b@FreeBSD.org> Date: Mon, 21 Jul 2025 12:37:23 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: cc21f6e53f43 - main - amd64: Make a comment less confusing Content-Language: en-US To: Mark Johnston , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202507211458.56LEwD36053783@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202507211458.56LEwD36053783@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/21/25 10:58, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=cc21f6e53f43f0e4c082222460d90ea581f3e2d6 > > commit cc21f6e53f43f0e4c082222460d90ea581f3e2d6 > Author: Mark Johnston > AuthorDate: 2025-07-21 13:33:31 +0000 > Commit: Mark Johnston > CommitDate: 2025-07-21 14:57:58 +0000 > > amd64: Make a comment less confusing > > Also merge two printf()s. No functional change intended. > > Reviewed by: kib > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D51452 > --- > sys/amd64/amd64/trap.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c > index d9a5f7096a6e..f3469ed5e2bc 100644 > --- a/sys/amd64/amd64/trap.c > +++ b/sys/amd64/amd64/trap.c > @@ -37,7 +37,6 @@ > * SUCH DAMAGE. > */ > > -#include > /* > * AMD64 Trap and System call handling > */ > @@ -898,9 +897,9 @@ trap_diag(struct trapframe *frame, vm_offset_t eva) > printf("\n\nFatal trap %d: %s while in %s mode\n", type, > type < nitems(trap_msg) ? trap_msg[type] : UNKNOWN, > TRAPF_USERMODE(frame) ? "user" : "kernel"); > - /* two separate prints in case of a trap on an unmapped page */ > - printf("cpuid = %d; ", PCPU_GET(cpuid)); > - printf("apic id = %02x\n", PCPU_GET(apic_id)); > + /* Print these separately in case pcpu accesses trap. */ > + printf("cpuid = %d; apic id = %02x\n", PCPU_GET(cpuid), > + PCPU_GET(apic_id)); > if (type == T_PAGEFLT) { > printf("fault virtual address = 0x%lx\n", eva); > printf("fault code = %s %s %s%s%s, %s\n", > @@ -1021,9 +1020,9 @@ dblfault_handler(struct trapframe *frame) > frame->tf_cs, frame->tf_ss, frame->tf_ds, frame->tf_es, > frame->tf_fs, frame->tf_gs, > rdmsr(MSR_FSBASE), rdmsr(MSR_GSBASE), rdmsr(MSR_KGSBASE)); > - /* two separate prints in case of a trap on an unmapped page */ > - printf("cpuid = %d; ", PCPU_GET(cpuid)); > - printf("apic id = %02x\n", PCPU_GET(apic_id)); > + /* Print these separately in case pcpu accesses trap. */ > + printf("cpuid = %d; apic id = %02x\n", PCPU_GET(cpuid), > + PCPU_GET(apic_id)); > panic("double fault"); Eh, if any of the accesses fault you don't get any of the printf, so once you've merged these, the comment is wrong and should just be removed. FWIW, pre-5.0 (maybe pre-4.0?) per-CPU data on i386 used a fixed virtual address that was mapped to different backing pages on each CPU instead of %gs which is why the comment was probably worded that way originally. (This meant, btw, that each CPU had its own set of top-level kernel page table and that cpu_switch had to munge the kernel-half of the top-level page table of a process, which precluded multiple threads in a process.) -- John Baldwin