From nobody Mon Jun 05 05:50:08 2023 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 4QZN410cvDz4Zq2Z; Mon, 5 Jun 2023 05:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZN406MNcz3MXX; Mon, 5 Jun 2023 05:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685944209; 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; bh=ijSjajLM6I8+BJVyfohkgFuiUxog45Lp0TmGXG8H5q8=; b=UCJb8PDG3Jl8vbm/OERHUCljf/SMir5Um38gt9PK+jvHYURg1wQ8pvD4pwdo2UQh2AZfjS Lbrd2rUEqDfO/2Sq2QmG3ZF2t88V61noh2TIQKF2y6gvx7oMXudj0ROojetMvZZnOGf0tg MBQA8ivieewyCIkrZEXEccBtdaIF4Y/kWdKfF73eKjRWADTtYlu61a7Yrc+sLbz/pm6vpp r6nmj6iqBjlwY3Bt3MLGAXGF2XKnfFlHutRDt/dXtXBRktLqFtl1LcZmr6DcW3dVljk5GV LAd1Yk2qWJzx+mnuzXdueU8iUD92bBV2L5cl9O5udlespC5aoAQAR5/V37gq+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685944209; 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; bh=ijSjajLM6I8+BJVyfohkgFuiUxog45Lp0TmGXG8H5q8=; b=WtXaDsofiGtnzh5G/kCgTSVJS7ynO0es55BbIYUSfW24Sl6aVclSWWcGfMUY0hiyWBK2L5 OfnD2f5sNBVFVQuFmOtR+RdOMzyXcy96oUNY4C8IrOUqhpadk+10c+jEbPYrx8zHU5YIRo tbKf80TFc84g0dyCQD/4ngWQPMGbwGHKTXDcDljBYBSRjlplb8YjKY5eg/MH/09qLE4RMg yYKj+j163IyMA4DR7RO6C46/62dGKJ8GEcI8U0chV3szmVVJ7sE0IGsNq0yzm2R9CFqt8p Mi4yZ5AXLEqJ0JSMg/fdncuekgfp5KRh0Z+at2ff1hJLKW05DXFtYX6ZJTJLjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685944209; a=rsa-sha256; cv=none; b=JA+X9r8kjn5rJ3esCYSGnGH95bhMLMHqAZQpeHqrL8pCTpOiPWxlhdCfY9+4P9A9/XV7xH Lak2Svz5SMVarXEpkrieKCdB5VKrfHgzrntmDMWctlXrUqYlxuwRh7cAOoLFesozS6gwJ9 oIudQ8tfZjpnywoTsuIOsHDFxAsAJkSAkUv3Y0cgznDZskGyYr8zIEZ9NuhO/G+WfpI3Zg 7crQhGMJRX8PIDnCMJOCXCOIEYnGI/twAqEUprvBcTtLsHiztEqIULeXokk1UnkeOf2SeT a2yTPShCb1+YzVE5dspDzvMRb16OgmZwNt/IdC1g8ljsp1dV+J1qwmCo5f9iNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZN405SB6zc5D; Mon, 5 Jun 2023 05:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3555o83c047950; Mon, 5 Jun 2023 05:50:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3555o8G2047943; Mon, 5 Jun 2023 05:50:08 GMT (envelope-from git) Date: Mon, 5 Jun 2023 05:50:08 GMT Message-Id: <202306050550.3555o8G2047943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 9d6ae1e3c26a - main - Revert "Revert "tslog: Annotate some early boot functions"" 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d6ae1e3c26a0c3334a268b587f17dccb9a503d7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=9d6ae1e3c26a0c3334a268b587f17dccb9a503d7 commit 9d6ae1e3c26a0c3334a268b587f17dccb9a503d7 Author: Colin Percival AuthorDate: 2023-06-04 23:01:31 +0000 Commit: Colin Percival CommitDate: 2023-06-05 05:49:38 +0000 Revert "Revert "tslog: Annotate some early boot functions"" Now that is wrapped in #ifdef _KERNEL, it's safe to have tslog annotations in files which might be built from userland (i.e. in subr_boot.c, which is built as part of the boot loader). This reverts commit 59588a546f55523d6fd37ab42eb08b719311d7d6. --- sys/amd64/amd64/fpu.c | 3 +++ sys/amd64/amd64/initcpu.c | 4 ++++ sys/amd64/amd64/machdep.c | 2 ++ sys/amd64/amd64/pmap.c | 4 ++++ sys/kern/kern_cons.c | 3 +++ sys/kern/link_elf.c | 7 +++++++ sys/kern/subr_boot.c | 5 +++++ sys/kern/subr_kdb.c | 3 +++ sys/kern/subr_param.c | 4 ++++ sys/kern/subr_pcpu.c | 2 ++ sys/kern/subr_prf.c | 3 +++ sys/x86/pci/pci_early_quirks.c | 3 +++ sys/x86/x86/identcpu.c | 7 ++++++- sys/x86/xen/pv.c | 3 +++ 14 files changed, 52 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index a3421cf0d496..1310a27911fe 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -360,6 +361,7 @@ fpuinit(void) u_int mxcsr; u_short control; + TSENTER(); if (IS_BSP()) fpuinit_bsp1(); @@ -401,6 +403,7 @@ fpuinit(void) ldmxcsr(mxcsr); start_emulating(); intr_restore(saveintr); + TSEXIT(); } /* diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index a17ef89ba9f8..0de4bc3e2d60 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -276,6 +276,7 @@ initializecpu(void) uint64_t msr; uint32_t cr4; + TSENTER(); cr4 = rcr4(); if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { cr4 |= CR4_FXSR | CR4_XMM; @@ -311,7 +312,9 @@ initializecpu(void) if (cpu_stdext_feature & CPUID_STDEXT_SMAP) cr4 |= CR4_SMAP; } + TSENTER2("load_cr4"); load_cr4(cr4); + TSEXIT2("load_cr4"); /* Reload cpu ext features to reflect cr4 changes */ if (IS_BSP() && cold) identify_cpu_ext_features(); @@ -340,6 +343,7 @@ initializecpu(void) if (!IS_BSP()) cpu_init_small_core(); + TSEXIT(); } void diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 757606311123..fa3ffe84bfe1 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -874,6 +874,7 @@ getmemsize(caddr_t kmdp, u_int64_t first) quad_t dcons_addr, dcons_size; int page_counter; + TSENTER(); /* * Tell the physical memory allocator about pages used to store * the kernel and preloaded data. See kmem_bootstrap_free(). @@ -1129,6 +1130,7 @@ do_next: /* Map the message buffer. */ msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]); + TSEXIT(); } static caddr_t diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index b2abab429730..123811ed573f 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1668,6 +1668,7 @@ create_pagetables(vm_paddr_t *firstaddr) #endif int i, j, ndm1g, nkpdpe, nkdmpde; + TSENTER(); /* Allocate page table pages for the direct map */ ndmpdp = howmany(ptoa(Maxmem), NBPDP); if (ndmpdp < 4) /* Minimum 4GB of dirmap */ @@ -1884,6 +1885,7 @@ create_pagetables(vm_paddr_t *firstaddr) } kernel_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); + TSEXIT(); } /* @@ -1906,6 +1908,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) u_long res; int i; + TSENTER(); KERNend = *firstaddr; res = atop(KERNend - (vm_paddr_t)kernphys); @@ -2061,6 +2064,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) */ load_cr4(rcr4() | CR4_PCIDE); } + TSEXIT(); } /* diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index 7c63b8e4ed9c..ff57b2bdfd8a 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -134,6 +135,7 @@ cninit(void) { struct consdev *best_cn, *cn, **list; + TSENTER(); /* * Check if we should mute the console (for security reasons perhaps) * It can be changes dynamically using sysctl kern.consmute @@ -195,6 +197,7 @@ cninit(void) */ early_putc = NULL; #endif + TSEXIT(); } void diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index b410469b6270..bd8994ff0e4d 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -1431,6 +1432,7 @@ relocate_file1(elf_file_t ef, elf_lookup_fn lookup, elf_reloc_fn reloc, const Elf_Rela *rela; const char *symname; + TSENTER(); #define APPLY_RELOCS(iter, tbl, tblsize, type) do { \ for ((iter) = (tbl); (iter) != NULL && \ (iter) < (tbl) + (tblsize) / sizeof(*(iter)); (iter)++) { \ @@ -1449,12 +1451,15 @@ relocate_file1(elf_file_t ef, elf_lookup_fn lookup, elf_reloc_fn reloc, } while (0) APPLY_RELOCS(rel, ef->rel, ef->relsize, ELF_RELOC_REL); + TSENTER2("ef->rela"); APPLY_RELOCS(rela, ef->rela, ef->relasize, ELF_RELOC_RELA); + TSEXIT2("ef->rela"); APPLY_RELOCS(rel, ef->pltrel, ef->pltrelsize, ELF_RELOC_REL); APPLY_RELOCS(rela, ef->pltrela, ef->pltrelasize, ELF_RELOC_RELA); #undef APPLY_RELOCS + TSEXIT(); return (0); } @@ -1950,6 +1955,7 @@ link_elf_ireloc(caddr_t kmdp) struct elf_file eff; elf_file_t ef; + TSENTER(); ef = &eff; bzero_early(ef, sizeof(*ef)); @@ -1966,6 +1972,7 @@ link_elf_ireloc(caddr_t kmdp) link_elf_preload_parse_symbols(ef); relocate_file1(ef, elf_lookup_ifunc, elf_reloc, true); + TSEXIT(); } #if defined(__aarch64__) || defined(__amd64__) diff --git a/sys/kern/subr_boot.c b/sys/kern/subr_boot.c index 057ffb5b7e08..73e75ba11750 100644 --- a/sys/kern/subr_boot.c +++ b/sys/kern/subr_boot.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #ifdef _KERNEL #define SETENV(k, v) kern_setenv(k, v) @@ -95,12 +96,14 @@ boot_env_to_howto(void) int i, howto; char *val; + TSENTER(); for (howto = 0, i = 0; howto_names[i].ev != NULL; i++) { val = GETENV(howto_names[i].ev); if (val != NULL && strcasecmp(val, "no") != 0) howto |= howto_names[i].mask; FREE(val); } + TSEXIT(); return (howto); } @@ -193,12 +196,14 @@ boot_parse_cmdline_delim(char *cmdline, const char *delim) char *v; int howto; + TSENTER(); howto = 0; while ((v = strsep(&cmdline, delim)) != NULL) { if (*v == '\0') continue; howto |= boot_parse_arg(v); } + TSEXIT(); return (howto); } diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index f8b37c2319b0..2f419b4d8ad5 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -559,6 +560,7 @@ kdb_init(void) struct kdb_dbbe *be, **iter; int cur_pri, pri; + TSENTER(); kdb_active = 0; kdb_dbbe = NULL; cur_pri = -1; @@ -582,6 +584,7 @@ kdb_init(void) printf("KDB: current backend: %s\n", kdb_dbbe->dbbe_name); } + TSEXIT(); } /* diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index bb8cb5871af2..b988f28944cc 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -171,6 +171,7 @@ void init_param1(void) { + TSENTER(); #if !defined(__arm64__) TUNABLE_INT_FETCH("kern.kstack_pages", &kstack_pages); #endif @@ -245,6 +246,7 @@ init_param1(void) pid_max = 300; TUNABLE_INT_FETCH("vfs.unmapped_buf_allowed", &unmapped_buf_allowed); + TSEXIT(); } /* @@ -254,6 +256,7 @@ void init_param2(long physpages) { + TSENTER(); /* Base parameters */ maxusers = MAXUSERS; TUNABLE_INT_FETCH("kern.maxusers", &maxusers); @@ -335,6 +338,7 @@ init_param2(long physpages) if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64; + TSEXIT(); } /* diff --git a/sys/kern/subr_pcpu.c b/sys/kern/subr_pcpu.c index c4c220d66c97..c13a52dffccd 100644 --- a/sys/kern/subr_pcpu.c +++ b/sys/kern/subr_pcpu.c @@ -103,6 +103,7 @@ dpcpu_init(void *dpcpu, int cpuid) { struct pcpu *pcpu; + TSENTER(); pcpu = pcpu_find(cpuid); pcpu->pc_dynamic = (uintptr_t)dpcpu - DPCPU_START; @@ -115,6 +116,7 @@ dpcpu_init(void *dpcpu, int cpuid) * Place it in the global pcpu offset array. */ dpcpu_off[cpuid] = pcpu->pc_dynamic; + TSEXIT(); } static void diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 0506c21b5ad8..db4ef168bc70 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1037,6 +1038,7 @@ msgbufinit(void *ptr, int size) static struct msgbuf *oldp = NULL; bool print_boot_tag; + TSENTER(); size -= sizeof(*msgbufp); cp = (char *)ptr; print_boot_tag = !msgbufmapped; @@ -1052,6 +1054,7 @@ msgbufinit(void *ptr, int size) if (print_boot_tag && *current_boot_tag != '\0') printf("%s\n", current_boot_tag); oldp = msgbufp; + TSEXIT(); } /* Sysctls for accessing/clearing the msgbuf */ diff --git a/sys/x86/pci/pci_early_quirks.c b/sys/x86/pci/pci_early_quirks.c index 97ba7e1a0631..ab8072b38d14 100644 --- a/sys/x86/pci/pci_early_quirks.c +++ b/sys/x86/pci/pci_early_quirks.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* XXX: enable this once the KPI is available */ @@ -317,5 +318,7 @@ void pci_early_quirks(void) { + TSENTER(); intel_graphics_stolen(); + TSEXIT(); } diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 42cca3250481..3ff59344e17d 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -1424,6 +1424,7 @@ identify_hypervisor(void) u_int regs[4]; char *p; + TSENTER(); /* * If CPUID2_HV is set, we are running in a hypervisor environment. */ @@ -1432,8 +1433,10 @@ identify_hypervisor(void) identify_hypervisor_cpuid_base(); /* If we have a definitive vendor, we can return now. */ - if (*hv_vendor != '\0') + if (*hv_vendor != '\0') { + TSEXIT(); return; + } } /* @@ -1446,11 +1449,13 @@ identify_hypervisor(void) if (regs[1] == VMW_HVMAGIC) { vm_guest = VM_GUEST_VMWARE; freeenv(p); + TSEXIT(); return; } } freeenv(p); } + TSEXIT(); } bool diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c index 367214fe35be..b3da26e9b78e 100644 --- a/sys/x86/xen/pv.c +++ b/sys/x86/xen/pv.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -417,6 +418,7 @@ xen_pvh_parse_preload_data(uint64_t modulep) char *envp; char acpi_rsdp[19]; + TSENTER(); if (start_info->modlist_paddr != 0) { struct hvm_modlist_entry *mod; const char *cmdline; @@ -507,6 +509,7 @@ xen_pvh_parse_preload_data(uint64_t modulep) #ifdef DDB xen_pvh_parse_symtab(); #endif + TSEXIT(); return (kmdp); }