Index: sys/amd64/amd64/efirt_machdep.c =================================================================== --- sys/amd64/amd64/efirt_machdep.c +++ sys/amd64/amd64/efirt_machdep.c @@ -325,5 +325,7 @@ return (error); } -SYSCTL_PROC(_debug, OID_AUTO, efi_time, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, - efi_time_sysctl_handler, "I", ""); +SYSCTL_PROC(_debug, OID_AUTO, efi_time, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, + efi_time_sysctl_handler, "I", + ""); Index: sys/amd64/amd64/machdep.c =================================================================== --- sys/amd64/amd64/machdep.c +++ sys/amd64/amd64/machdep.c @@ -1960,8 +1960,10 @@ } return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, smap, CTLTYPE_OPAQUE|CTLFLAG_RD, NULL, 0, - smap_sysctl_handler, "S,bios_smap_xattr", "Raw BIOS SMAP data"); +SYSCTL_PROC(_machdep, OID_AUTO, smap, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + smap_sysctl_handler, "S,bios_smap_xattr", + "Raw BIOS SMAP data"); static int efi_map_sysctl_handler(SYSCTL_HANDLER_ARGS) @@ -1980,8 +1982,10 @@ efisize = *((uint32_t *)efihdr - 1); return (SYSCTL_OUT(req, efihdr, efisize)); } -SYSCTL_PROC(_machdep, OID_AUTO, efi_map, CTLTYPE_OPAQUE|CTLFLAG_RD, NULL, 0, - efi_map_sysctl_handler, "S,efi_map_header", "Raw EFI Memory Map"); +SYSCTL_PROC(_machdep, OID_AUTO, efi_map, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + efi_map_sysctl_handler, "S,efi_map_header", + "Raw EFI Memory Map"); void spinlock_enter(void) Index: sys/amd64/amd64/pmap.c =================================================================== --- sys/amd64/amd64/pmap.c +++ sys/amd64/amd64/pmap.c @@ -390,7 +390,8 @@ vm_offset_t kernel_vm_end = VM_MIN_KERNEL_ADDRESS; pt_entry_t pg_nx; -static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); +static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "VM/pmap parameters"); static int pg_ps_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, @@ -2196,7 +2197,7 @@ "Maximum number of PML4 entries for use by large map (tunable). " "Each entry corresponds to 512GB of address space."); -static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "2MB page mapping counters"); static u_long pmap_pde_demotions; @@ -2215,7 +2216,7 @@ SYSCTL_ULONG(_vm_pmap_pde, OID_AUTO, promotions, CTLFLAG_RD, &pmap_pde_promotions, 0, "2MB page promotions"); -static SYSCTL_NODE(_vm_pmap, OID_AUTO, pdpe, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_pmap, OID_AUTO, pdpe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "1GB page mapping counters"); static u_long pmap_pdpe_demotions; Index: sys/amd64/amd64/prof_machdep.c =================================================================== --- sys/amd64/amd64/prof_machdep.c +++ sys/amd64/amd64/prof_machdep.c @@ -262,8 +262,10 @@ return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, cputime_clock, CTLTYPE_INT | CTLFLAG_RW, - 0, sizeof(u_int), sysctl_machdep_cputime_clock, "I", ""); +SYSCTL_PROC(_machdep, OID_AUTO, cputime_clock, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(u_int), + sysctl_machdep_cputime_clock, "I", + ""); /* * The start and stop routines need not be here since we turn off profiling Index: sys/amd64/linux32/linux32_sysvec.c =================================================================== --- sys/amd64/linux32/linux32_sysvec.c +++ sys/amd64/linux32/linux32_sysvec.c @@ -837,7 +837,7 @@ return (0); } -static SYSCTL_NODE(_compat, OID_AUTO, linux32, CTLFLAG_RW, 0, +static SYSCTL_NODE(_compat, OID_AUTO, linux32, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "32-bit Linux emulation"); static u_long linux32_maxdsiz = LINUX32_MAXDSIZ; Index: sys/arm/altera/socfpga/socfpga_rstmgr.c =================================================================== --- sys/arm/altera/socfpga/socfpga_rstmgr.c +++ sys/arm/altera/socfpga/socfpga_rstmgr.c @@ -190,13 +190,16 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fpga2hps", - CTLTYPE_UINT | CTLFLAG_RW, sc, RSTMGR_SYSCTL_FPGA2HPS, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, RSTMGR_SYSCTL_FPGA2HPS, rstmgr_sysctl, "I", "Enable fpga2hps bridge"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "lwhps2fpga", - CTLTYPE_UINT | CTLFLAG_RW, sc, RSTMGR_SYSCTL_LWHPS2FPGA, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, RSTMGR_SYSCTL_LWHPS2FPGA, rstmgr_sysctl, "I", "Enable lwhps2fpga bridge"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "hps2fpga", - CTLTYPE_UINT | CTLFLAG_RW, sc, RSTMGR_SYSCTL_HPS2FPGA, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, RSTMGR_SYSCTL_HPS2FPGA, rstmgr_sysctl, "I", "Enable hps2fpga bridge"); return (0); Index: sys/arm/arm/busdma_machdep.c =================================================================== --- sys/arm/arm/busdma_machdep.c +++ sys/arm/arm/busdma_machdep.c @@ -148,7 +148,8 @@ static STAILQ_HEAD(, bounce_zone) bounce_zone_list; -SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Busdma parameters"); SYSCTL_UINT(_hw_busdma, OID_AUTO, tags_total, CTLFLAG_RD, &tags_total, 0, "Number of active tags"); SYSCTL_UINT(_hw_busdma, OID_AUTO, maps_total, CTLFLAG_RD, &maps_total, 0, @@ -1591,7 +1592,7 @@ sysctl_ctx_init(&bz->sysctl_tree); bz->sysctl_tree_top = SYSCTL_ADD_NODE(&bz->sysctl_tree, SYSCTL_STATIC_CHILDREN(_hw_busdma), OID_AUTO, bz->zoneid, - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (bz->sysctl_tree_top == NULL) { sysctl_ctx_free(&bz->sysctl_tree); return (0); /* XXX error code? */ Index: sys/arm/arm/cpuinfo.c =================================================================== --- sys/arm/arm/cpuinfo.c +++ sys/arm/arm/cpuinfo.c @@ -56,9 +56,9 @@ .icache_line_mask = 31, }; -static SYSCTL_NODE(_hw, OID_AUTO, cpu, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw, OID_AUTO, cpu, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "CPU"); -static SYSCTL_NODE(_hw_cpu, OID_AUTO, quirks, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_cpu, OID_AUTO, quirks, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "CPU quirks"); /* Index: sys/arm/arm/machdep_boot.c =================================================================== --- sys/arm/arm/machdep_boot.c +++ sys/arm/arm/machdep_boot.c @@ -88,7 +88,8 @@ static char atags[LBABI_MAX_COMMAND_LINE * 2]; #endif /* defined(LINUX_BOOT_ABI) */ -SYSCTL_NODE(_hw, OID_AUTO, board, CTLFLAG_RD, 0, "Board attributes"); +SYSCTL_NODE(_hw, OID_AUTO, board, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Board attributes"); SYSCTL_UINT(_hw_board, OID_AUTO, revision, CTLFLAG_RD, &board_revision, 0, "Board revision"); SYSCTL_STRING(_hw_board, OID_AUTO, serial, CTLFLAG_RD, Index: sys/arm/arm/pmap-v6.c =================================================================== --- sys/arm/arm/pmap-v6.c +++ sys/arm/arm/pmap-v6.c @@ -1550,7 +1550,8 @@ * *****************************************************************************/ -SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); +SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "VM/pmap parameters"); SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_max, CTLFLAG_RD, &pv_entry_max, 0, "Max number of PV entries"); @@ -1572,7 +1573,7 @@ return (sp_enabled != 0); } -static SYSCTL_NODE(_vm_pmap, OID_AUTO, pte1, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_pmap, OID_AUTO, pte1, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "1MB page mapping counters"); static u_long pmap_pte1_demotions; @@ -2108,8 +2109,9 @@ return (sysctl_handle_long(oidp, &ksize, 0, req)); } -SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG|CTLFLAG_RD, - 0, 0, kvm_size, "IU", "Size of KVM"); +SYSCTL_PROC(_vm, OID_AUTO, kvm_size, + CTLTYPE_LONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, 0, 0, kvm_size, "IU", + "Size of KVM"); static int kvm_free(SYSCTL_HANDLER_ARGS) @@ -2118,8 +2120,9 @@ return (sysctl_handle_long(oidp, &kfree, 0, req)); } -SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, - 0, 0, kvm_free, "IU", "Amount of KVM free"); +SYSCTL_PROC(_vm, OID_AUTO, kvm_free, + CTLTYPE_LONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, 0, 0, kvm_free, "IU", + "Amount of KVM free"); /*********************************************** * Index: sys/arm/broadcom/bcm2835/bcm2835_audio.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_audio.c +++ sys/arm/broadcom/bcm2835/bcm2835_audio.c @@ -810,7 +810,7 @@ tree_node = device_get_sysctl_tree(sc->dev); tree = SYSCTL_CHILDREN(tree_node); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "dest", - CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, sizeof(*sc), sysctl_bcm2835_audio_dest, "IU", "audio destination, " "0 - auto, 1 - headphones, 2 - HDMI"); SYSCTL_ADD_UQUAD(ctx, tree, OID_AUTO, "callbacks", Index: sys/arm/broadcom/bcm2835/bcm2835_bsc.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_bsc.c +++ sys/arm/broadcom/bcm2835/bcm2835_bsc.c @@ -248,16 +248,20 @@ tree_node = device_get_sysctl_tree(sc->sc_dev); tree = SYSCTL_CHILDREN(tree_node); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "frequency", - CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, + sc, sizeof(*sc), bcm_bsc_clock_proc, "IU", "I2C BUS clock frequency"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "clock_stretch", - CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, + sc, sizeof(*sc), bcm_bsc_clkt_proc, "IU", "I2C BUS clock stretch timeout"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "fall_edge_delay", - CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, + sc, sizeof(*sc), bcm_bsc_fall_proc, "IU", "I2C BUS falling edge delay"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "rise_edge_delay", - CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, + sc, sizeof(*sc), bcm_bsc_rise_proc, "IU", "I2C BUS rising edge delay"); SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "debug", CTLFLAG_RWTUN, &sc->sc_debug, 0, Index: sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c +++ sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c @@ -1245,7 +1245,8 @@ ctx = device_get_sysctl_ctx(cpu); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(cpu)), OID_AUTO, - "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + "temperature", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_devcpu_temperature, "IK", "Current SoC temperature"); } @@ -1312,57 +1313,67 @@ /* create node for hw.cpufreq */ oid = SYSCTL_ADD_NODE(&bcm2835_sysctl_ctx, SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, "cpufreq", - CTLFLAG_RD, NULL, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); /* Frequency (Hz) */ SYSCTL_ADD_PROC(&bcm2835_sysctl_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "arm_freq", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + OID_AUTO, "arm_freq", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_cpufreq_arm_freq, "IU", "ARM frequency (Hz)"); SYSCTL_ADD_PROC(&bcm2835_sysctl_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "core_freq", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + OID_AUTO, "core_freq", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_cpufreq_core_freq, "IU", "Core frequency (Hz)"); SYSCTL_ADD_PROC(&bcm2835_sysctl_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "sdram_freq", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + OID_AUTO, "sdram_freq", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_cpufreq_sdram_freq, "IU", "SDRAM frequency (Hz)"); /* Turbo state */ SYSCTL_ADD_PROC(&bcm2835_sysctl_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "turbo", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + OID_AUTO, "turbo", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_cpufreq_turbo, "IU", "Disables dynamic clocking"); /* Voltage (offset from 1.2V in units of 0.025V) */ SYSCTL_ADD_PROC(&bcm2835_sysctl_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "voltage_core", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + OID_AUTO, "voltage_core", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_cpufreq_voltage_core, "I", "ARM/GPU core voltage" "(offset from 1.2V in units of 0.025V)"); SYSCTL_ADD_PROC(&bcm2835_sysctl_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "voltage_sdram", CTLTYPE_INT | CTLFLAG_WR, sc, + OID_AUTO, "voltage_sdram", + CTLTYPE_INT | CTLFLAG_WR | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_cpufreq_voltage_sdram, "I", "SDRAM voltage (offset from 1.2V in units of 0.025V)"); /* Voltage individual SDRAM */ SYSCTL_ADD_PROC(&bcm2835_sysctl_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "voltage_sdram_c", CTLTYPE_INT | CTLFLAG_RW, sc, + OID_AUTO, "voltage_sdram_c", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_cpufreq_voltage_sdram_c, "I", "SDRAM controller voltage" "(offset from 1.2V in units of 0.025V)"); SYSCTL_ADD_PROC(&bcm2835_sysctl_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "voltage_sdram_i", CTLTYPE_INT | CTLFLAG_RW, sc, + OID_AUTO, "voltage_sdram_i", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_cpufreq_voltage_sdram_i, "I", "SDRAM I/O voltage (offset from 1.2V in units of 0.025V)"); SYSCTL_ADD_PROC(&bcm2835_sysctl_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "voltage_sdram_p", CTLTYPE_INT | CTLFLAG_RW, sc, + OID_AUTO, "voltage_sdram_p", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_cpufreq_voltage_sdram_p, "I", "SDRAM phy voltage (offset from 1.2V in units of 0.025V)"); /* Temperature */ SYSCTL_ADD_PROC(&bcm2835_sysctl_ctx, SYSCTL_CHILDREN(oid), - OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + OID_AUTO, "temperature", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_cpufreq_temperature, "I", "SoC temperature (thousandths of a degree C)"); } Index: sys/arm/broadcom/bcm2835/bcm2835_fbd.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_fbd.c +++ sys/arm/broadcom/bcm2835/bcm2835_fbd.c @@ -199,7 +199,7 @@ tree_node = device_get_sysctl_tree(sc->dev); tree = SYSCTL_CHILDREN(tree_node); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "resync", - CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, sizeof(*sc), bcm_fb_resync_sysctl, "IU", "Set to resync framebuffer with VC"); } Index: sys/arm/broadcom/bcm2835/bcm2835_gpio.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_gpio.c +++ sys/arm/broadcom/bcm2835/bcm2835_gpio.c @@ -594,14 +594,14 @@ tree_node = device_get_sysctl_tree(sc->sc_dev); tree = SYSCTL_CHILDREN(tree_node); pin_node = SYSCTL_ADD_NODE(ctx, tree, OID_AUTO, "pin", - CTLFLAG_RD, NULL, "GPIO Pins"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "GPIO Pins"); pin_tree = SYSCTL_CHILDREN(pin_node); for (i = 0; i < sc->sc_gpio_npins; i++) { snprintf(pinbuf, sizeof(pinbuf), "%d", i); pinN_node = SYSCTL_ADD_NODE(ctx, pin_tree, OID_AUTO, pinbuf, - CTLFLAG_RD, NULL, "GPIO Pin"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "GPIO Pin"); pinN_tree = SYSCTL_CHILDREN(pinN_node); sc->sc_sysctl[i].sc = sc; @@ -609,7 +609,7 @@ sc_sysctl->sc = sc; sc_sysctl->pin = sc->sc_gpio_pins[i].gp_pin; SYSCTL_ADD_PROC(ctx, pinN_tree, OID_AUTO, "function", - CTLFLAG_RW | CTLTYPE_STRING, sc_sysctl, + CTLFLAG_RW | CTLTYPE_STRING | CTLFLAG_NEEDGIANT, sc_sysctl, sizeof(struct bcm_gpio_sysctl), bcm_gpio_func_proc, "A", "Pin Function"); } Index: sys/arm/broadcom/bcm2835/bcm2835_pwm.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_pwm.c +++ sys/arm/broadcom/bcm2835/bcm2835_pwm.c @@ -364,7 +364,8 @@ if (bootverbose) { #define RR(x,y) \ SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, y, \ - CTLFLAG_RW | CTLTYPE_UINT, sc, 0x##x, \ + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, \ + sc, 0x##x, \ bcm_pwm_reg_proc, "IU", "Register 0x" #x " " y); RR(24, "DAT2") @@ -379,31 +380,31 @@ } SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "pwm_freq", - CTLFLAG_RD | CTLTYPE_UINT, sc, 0, + CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, 0, bcm_pwm_pwm_freq_proc, "IU", "PWM frequency ch 1 (Hz)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "period", - CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, 0, bcm_pwm_period_proc, "IU", "PWM period ch 1 (#clocks)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "ratio", - CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, 0, bcm_pwm_ratio_proc, "IU", "PWM ratio ch 1 (0...period)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "freq", - CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, 0, bcm_pwm_freq_proc, "IU", "PWM clock (Hz)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "mode", - CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, 0, bcm_pwm_mode_proc, "IU", "PWM mode ch 1 (0=off, 1=pwm, 2=dither)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "pwm_freq2", - CTLFLAG_RD | CTLTYPE_UINT, sc, 0, + CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, 0, bcm_pwm_pwm_freq2_proc, "IU", "PWM frequency ch 2 (Hz)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "period2", - CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, 0, bcm_pwm_period2_proc, "IU", "PWM period ch 2 (#clocks)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "ratio2", - CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, 0, bcm_pwm_ratio2_proc, "IU", "PWM ratio ch 2 (0...period)"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "mode2", - CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, 0, bcm_pwm_mode2_proc, "IU", "PWM mode ch 2 (0=off, 1=pwm, 2=dither)"); } Index: sys/arm/broadcom/bcm2835/bcm2835_rng.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_rng.c +++ sys/arm/broadcom/bcm2835/bcm2835_rng.c @@ -403,14 +403,14 @@ "underrun", CTLFLAG_RD, &sc->sc_underrun, "Number of FIFO underruns"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "2xspeed", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + "2xspeed", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_rng_2xspeed, "I", "Enable RBG 2X SPEED"); SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "stall_count", CTLFLAG_RW, &sc->sc_stall_count, RNG_STALL_COUNT_DEFAULT, "Number of underruns to assume RNG stall"); #ifdef BCM2835_RNG_DEBUG_REGISTERS SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "dumpregs", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + "dumpregs", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_bcm2835_rng_dump, "S", "Dump RNG registers"); #endif Index: sys/arm/broadcom/bcm2835/bcm2835_spi.c =================================================================== --- sys/arm/broadcom/bcm2835/bcm2835_spi.c +++ sys/arm/broadcom/bcm2835/bcm2835_spi.c @@ -204,22 +204,22 @@ tree_node = device_get_sysctl_tree(sc->sc_dev); tree = SYSCTL_CHILDREN(tree_node); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "clock", - CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, sizeof(*sc), bcm_spi_clock_proc, "IU", "SPI BUS clock frequency"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cpol", - CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, sizeof(*sc), bcm_spi_cpol_proc, "IU", "SPI BUS clock polarity"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cpha", - CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, sizeof(*sc), bcm_spi_cpha_proc, "IU", "SPI BUS clock phase"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cspol0", - CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, sizeof(*sc), bcm_spi_cspol0_proc, "IU", "SPI BUS chip select 0 polarity"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cspol1", - CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, sizeof(*sc), bcm_spi_cspol1_proc, "IU", "SPI BUS chip select 1 polarity"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cspol2", - CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, sizeof(*sc), bcm_spi_cspol2_proc, "IU", "SPI BUS chip select 2 polarity"); } Index: sys/arm/freescale/imx/imx6_anatop.c =================================================================== --- sys/arm/freescale/imx/imx6_anatop.c +++ sys/arm/freescale/imx/imx6_anatop.c @@ -400,11 +400,13 @@ "CPU frequency"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), - OID_AUTO, "cpu_minmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, + OID_AUTO, "cpu_minmhz", + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_NEEDGIANT, sc, 0, cpufreq_sysctl_minmhz, "IU", "Minimum CPU frequency"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), - OID_AUTO, "cpu_maxmhz", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, + OID_AUTO, "cpu_maxmhz", + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_NEEDGIANT, sc, 0, cpufreq_sysctl_maxmhz, "IU", "Maximum CPU frequency"); SYSCTL_ADD_INT(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), @@ -627,10 +629,12 @@ 0, tempmon_throttle_check, sc, 0); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), - OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + OID_AUTO, "temperature", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, temp_sysctl_handler, "IK", "Current die temperature"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_imx), - OID_AUTO, "throttle_temperature", CTLTYPE_INT | CTLFLAG_RW, sc, + OID_AUTO, "throttle_temperature", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, temp_throttle_sysctl_handler, "IK", "Throttle CPU when exceeding this temperature"); } Index: sys/arm/freescale/imx/imx_machdep.c =================================================================== --- sys/arm/freescale/imx/imx_machdep.c +++ sys/arm/freescale/imx/imx_machdep.c @@ -47,7 +47,8 @@ #include #include -SYSCTL_NODE(_hw, OID_AUTO, imx, CTLFLAG_RW, NULL, "i.MX container"); +SYSCTL_NODE(_hw, OID_AUTO, imx, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "i.MX container"); static int last_reset_status; SYSCTL_UINT(_hw_imx, OID_AUTO, last_reset_status, CTLFLAG_RD, Index: sys/arm/mv/mv_thermal.c =================================================================== --- sys/arm/mv/mv_thermal.c +++ sys/arm/mv/mv_thermal.c @@ -333,7 +333,7 @@ oid = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); /* There is always at least one sensor */ SYSCTL_ADD_PROC(ctx, oid, OID_AUTO, "internal", - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, 0, mv_thermal_sysctl, "IK", "Internal Temperature"); @@ -342,7 +342,7 @@ snprintf(name, sizeof(name), "cpu%d", i); snprintf(desc, sizeof(desc), "CPU%d Temperature", i); SYSCTL_ADD_PROC(ctx, oid, OID_AUTO, name, - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, i + 1, mv_thermal_sysctl, "IK", desc); Index: sys/arm/mv/mv_ts.c =================================================================== --- sys/arm/mv/mv_ts.c +++ sys/arm/mv/mv_ts.c @@ -150,7 +150,8 @@ } ctx = device_get_sysctl_ctx(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, dev, + OID_AUTO, "temperature", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, 0, ts_sysctl_handler, "IK", "Current Temperature"); return (0); Index: sys/arm/nvidia/tegra124/tegra124_coretemp.c =================================================================== --- sys/arm/nvidia/tegra124/tegra124_coretemp.c +++ sys/arm/nvidia/tegra124/tegra124_coretemp.c @@ -220,7 +220,8 @@ oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(pdev)), OID_AUTO, - "coretemp", CTLFLAG_RD, NULL, "Per-CPU thermal information"); + "coretemp", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Per-CPU thermal information"); /* * Add the MIBs to dev.cpu.N and dev.cpu.N.coretemp. Index: sys/arm/nvidia/tegra_soctherm.c =================================================================== --- sys/arm/nvidia/tegra_soctherm.c +++ sys/arm/nvidia/tegra_soctherm.c @@ -511,7 +511,7 @@ /* create node for hw.temp */ oid = SYSCTL_ADD_NODE(&soctherm_sysctl_ctx, SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, "temperature", - CTLFLAG_RD, NULL, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); if (oid == NULL) return (ENXIO); @@ -519,7 +519,7 @@ for (i = sc->ntsensors - 1; i >= 0; i--) { tmp = SYSCTL_ADD_PROC(&soctherm_sysctl_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, sc->tsensors[i].name, - CTLTYPE_INT | CTLFLAG_RD, sc, i, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, i, soctherm_sysctl_temperature, "IK", "SoC Temperature"); if (tmp == NULL) return (ENXIO); Index: sys/arm/ti/am335x/am335x_ehrpwm.c =================================================================== --- sys/arm/ti/am335x/am335x_ehrpwm.c +++ sys/arm/ti/am335x/am335x_ehrpwm.c @@ -589,23 +589,23 @@ tree = device_get_sysctl_tree(sc->sc_dev); sc->sc_clkdiv_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "clkdiv", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + "clkdiv", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, am335x_ehrpwm_sysctl_clkdiv, "I", "PWM clock prescaler"); sc->sc_freq_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "freq", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + "freq", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, am335x_ehrpwm_sysctl_freq, "I", "PWM frequency"); sc->sc_period_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "period", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + "period", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, am335x_ehrpwm_sysctl_period, "I", "PWM period"); sc->sc_chanA_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "dutyA", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + "dutyA", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, am335x_ehrpwm_sysctl_duty, "I", "Channel A duty cycles"); sc->sc_chanB_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "dutyB", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + "dutyB", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, am335x_ehrpwm_sysctl_duty, "I", "Channel B duty cycles"); /* CONFIGURE EPWM1 */ Index: sys/arm/ti/am335x/am335x_lcd.c =================================================================== --- sys/arm/ti/am335x/am335x_lcd.c +++ sys/arm/ti/am335x/am335x_lcd.c @@ -1025,7 +1025,7 @@ ctx = device_get_sysctl_ctx(sc->sc_dev); tree = device_get_sysctl_tree(sc->sc_dev); sc->sc_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "backlight", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + "backlight", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, am335x_lcd_sysctl_backlight, "I", "LCD backlight"); sc->sc_backlight = 0; /* Check if eCAS interface is available at this point */ Index: sys/arm/ti/am335x/am335x_musb.c =================================================================== --- sys/arm/ti/am335x/am335x_musb.c +++ sys/arm/ti/am335x/am335x_musb.c @@ -115,7 +115,9 @@ #ifdef USB_DEBUG static int usbssdebug = 0; -static SYSCTL_NODE(_hw_usb, OID_AUTO, am335x_usbss, CTLFLAG_RW, 0, "AM335x USBSS"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, am335x_usbss, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "AM335x USBSS"); SYSCTL_INT(_hw_usb_am335x_usbss, OID_AUTO, debug, CTLFLAG_RW, &usbssdebug, 0, "Debug level"); #endif Index: sys/arm/ti/cpsw/if_cpsw.c =================================================================== --- sys/arm/ti/cpsw/if_cpsw.c +++ sys/arm/ti/cpsw/if_cpsw.c @@ -2725,15 +2725,17 @@ CTLFLAG_RW, &sc->debug, 0, "Enable switch debug messages"); SYSCTL_ADD_PROC(ctx, parent, OID_AUTO, "attachedSecs", - CTLTYPE_UINT | CTLFLAG_RD, sc, 0, cpsw_stat_attached, "IU", + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + sc, 0, cpsw_stat_attached, "IU", "Time since driver attach"); SYSCTL_ADD_PROC(ctx, parent, OID_AUTO, "intr_coalesce_us", - CTLTYPE_UINT | CTLFLAG_RW, sc, 0, cpsw_intr_coalesce, "IU", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, 0, cpsw_intr_coalesce, "IU", "minimum time between interrupts"); node = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "ports", - CTLFLAG_RD, NULL, "CPSW Ports Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "CPSW Ports Statistics"); ports_parent = SYSCTL_CHILDREN(node); for (i = 0; i < CPSW_PORTS; i++) { if (!sc->dualemac && i != sc->active_slave) @@ -2741,38 +2743,39 @@ port[0] = '0' + i; port[1] = '\0'; node = SYSCTL_ADD_NODE(ctx, ports_parent, OID_AUTO, - port, CTLFLAG_RD, NULL, "CPSW Port Statistics"); + port, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "CPSW Port Statistics"); port_parent = SYSCTL_CHILDREN(node); SYSCTL_ADD_PROC(ctx, port_parent, OID_AUTO, "uptime", - CTLTYPE_UINT | CTLFLAG_RD, sc, i, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, i, cpsw_stat_uptime, "IU", "Seconds since driver init"); } stats_node = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "stats", - CTLFLAG_RD, NULL, "CPSW Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "CPSW Statistics"); stats_parent = SYSCTL_CHILDREN(stats_node); for (i = 0; i < CPSW_SYSCTL_COUNT; ++i) { SYSCTL_ADD_PROC(ctx, stats_parent, i, cpsw_stat_sysctls[i].oid, - CTLTYPE_U64 | CTLFLAG_RD, sc, 0, - cpsw_stats_sysctl, "IU", + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + sc, 0, cpsw_stats_sysctl, "IU", cpsw_stat_sysctls[i].oid); } queue_node = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "queue", - CTLFLAG_RD, NULL, "CPSW Queue Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "CPSW Queue Statistics"); queue_parent = SYSCTL_CHILDREN(queue_node); node = SYSCTL_ADD_NODE(ctx, queue_parent, OID_AUTO, "tx", - CTLFLAG_RD, NULL, "TX Queue Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TX Queue Statistics"); cpsw_add_queue_sysctls(ctx, node, &sc->tx); node = SYSCTL_ADD_NODE(ctx, queue_parent, OID_AUTO, "rx", - CTLFLAG_RD, NULL, "RX Queue Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "RX Queue Statistics"); cpsw_add_queue_sysctls(ctx, node, &sc->rx); node = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "watchdog", - CTLFLAG_RD, NULL, "Watchdog Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Watchdog Statistics"); cpsw_add_watchdog_sysctls(ctx, node, sc); } Index: sys/arm/ti/ti_adc.c =================================================================== --- sys/arm/ti/ti_adc.c +++ sys/arm/ti/ti_adc.c @@ -562,10 +562,10 @@ tree_node = device_get_sysctl_tree(sc->sc_dev); tree = SYSCTL_CHILDREN(tree_node); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "clockdiv", - CTLFLAG_RW | CTLTYPE_UINT, sc, 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, sc, 0, ti_adc_clockdiv_proc, "IU", "ADC clock prescaler"); inp_node = SYSCTL_ADD_NODE(ctx, tree, OID_AUTO, "ain", - CTLFLAG_RD, NULL, "ADC inputs"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ADC inputs"); inp_tree = SYSCTL_CHILDREN(inp_node); for (i = 0; i < sc->sc_adc_nchannels; i++) { @@ -573,17 +573,20 @@ snprintf(pinbuf, sizeof(pinbuf), "%d", ain); inpN_node = SYSCTL_ADD_NODE(ctx, inp_tree, OID_AUTO, pinbuf, - CTLFLAG_RD, NULL, "ADC input"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ADC input"); inpN_tree = SYSCTL_CHILDREN(inpN_node); SYSCTL_ADD_PROC(ctx, inpN_tree, OID_AUTO, "enable", - CTLFLAG_RW | CTLTYPE_UINT, &ti_adc_inputs[ain], 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, + &ti_adc_inputs[ain], 0, ti_adc_enable_proc, "IU", "Enable ADC input"); SYSCTL_ADD_PROC(ctx, inpN_tree, OID_AUTO, "open_delay", - CTLFLAG_RW | CTLTYPE_UINT, &ti_adc_inputs[ain], 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, + &ti_adc_inputs[ain], 0, ti_adc_open_delay_proc, "IU", "ADC open delay"); SYSCTL_ADD_PROC(ctx, inpN_tree, OID_AUTO, "samples_avg", - CTLFLAG_RW | CTLTYPE_UINT, &ti_adc_inputs[ain], 0, + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, + &ti_adc_inputs[ain], 0, ti_adc_samples_avg_proc, "IU", "ADC samples average"); SYSCTL_ADD_INT(ctx, inpN_tree, OID_AUTO, "input", CTLFLAG_RD, &ti_adc_inputs[ain].value, 0, Index: sys/arm/ti/ti_pruss.c =================================================================== --- sys/arm/ti/ti_pruss.c +++ sys/arm/ti/ti_pruss.c @@ -542,10 +542,11 @@ sc->sc_glob_irqen = false; struct sysctl_oid *irq_root = SYSCTL_ADD_NODE(clist, SYSCTL_CHILDREN(poid), - OID_AUTO, "irq", CTLFLAG_RD, 0, + OID_AUTO, "irq", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "PRUSS Host Interrupts"); SYSCTL_ADD_PROC(clist, SYSCTL_CHILDREN(poid), OID_AUTO, - "global_interrupt_enable", CTLFLAG_RW | CTLTYPE_U8, + "global_interrupt_enable", + CTLFLAG_RW | CTLTYPE_U8 | CTLFLAG_NEEDGIANT, sc, 0, ti_pruss_global_interrupt_enable, "CU", "Global interrupt enable"); @@ -564,16 +565,19 @@ snprintf(name, sizeof(name), "%d", i); struct sysctl_oid *irq_nodes = SYSCTL_ADD_NODE(clist, SYSCTL_CHILDREN(irq_root), - OID_AUTO, name, CTLFLAG_RD, 0, + OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "PRUSS Interrupts"); SYSCTL_ADD_PROC(clist, SYSCTL_CHILDREN(irq_nodes), OID_AUTO, - "channel", CTLFLAG_RW | CTLTYPE_STRING, sc, i, ti_pruss_channel_map, + "channel", CTLFLAG_RW | CTLTYPE_STRING | CTLFLAG_NEEDGIANT, + sc, i, ti_pruss_channel_map, "A", "Channel attached to this irq"); SYSCTL_ADD_PROC(clist, SYSCTL_CHILDREN(irq_nodes), OID_AUTO, - "event", CTLFLAG_RW | CTLTYPE_STRING, sc, i, ti_pruss_event_map, + "event", CTLFLAG_RW | CTLTYPE_STRING | CTLFLAG_NEEDGIANT, + sc, i, ti_pruss_event_map, "A", "Event attached to this irq"); SYSCTL_ADD_PROC(clist, SYSCTL_CHILDREN(irq_nodes), OID_AUTO, - "enable", CTLFLAG_RW | CTLTYPE_U8, sc, i, ti_pruss_interrupt_enable, + "enable", CTLFLAG_RW | CTLTYPE_U8 | CTLFLAG_NEEDGIANT, + sc, i, ti_pruss_interrupt_enable, "CU", "Enable/Disable interrupt"); sc->sc_irq_devs[i].event = -1; Index: sys/arm/ti/twl/twl_clks.c =================================================================== --- sys/arm/ti/twl/twl_clks.c +++ sys/arm/ti/twl/twl_clks.c @@ -471,7 +471,7 @@ /* Add a sysctl entry for the clock */ new->oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, name, - CTLTYPE_INT | CTLFLAG_RD, sc, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, twl_clks_sysctl_clock, "I", "external clock"); /* Finally add the regulator to list of supported regulators */ Index: sys/arm/ti/twl/twl_vreg.c =================================================================== --- sys/arm/ti/twl/twl_vreg.c +++ sys/arm/ti/twl/twl_vreg.c @@ -848,7 +848,7 @@ /* Add a sysctl entry for the voltage */ new->oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, name, - CTLTYPE_INT | CTLFLAG_RD, sc, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, twl_vreg_sysctl_voltage, "I", "voltage regulator"); /* Finally add the regulator to list of supported regulators */ Index: sys/arm/xilinx/zy7_devcfg.c =================================================================== --- sys/arm/xilinx/zy7_devcfg.c +++ sys/arm/xilinx/zy7_devcfg.c @@ -101,12 +101,14 @@ #define RD4(sc, off) (bus_read_4((sc)->mem_res, (off))) #define WR4(sc, off, val) (bus_write_4((sc)->mem_res, (off), (val))) -SYSCTL_NODE(_hw, OID_AUTO, fpga, CTLFLAG_RD, 0, \ - "Xilinx Zynq-7000 PL (FPGA) section"); +SYSCTL_NODE(_hw, OID_AUTO, fpga, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Xilinx Zynq-7000 PL (FPGA) section"); static int zy7_devcfg_sysctl_pl_done(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_hw_fpga, OID_AUTO, pl_done, CTLTYPE_INT | CTLFLAG_RD, NULL, 0, - zy7_devcfg_sysctl_pl_done, "I", "PL section config DONE signal"); +SYSCTL_PROC(_hw_fpga, OID_AUTO, pl_done, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + zy7_devcfg_sysctl_pl_done, "I", + "PL section config DONE signal"); static int zy7_en_level_shifters = 1; SYSCTL_INT(_hw_fpga, OID_AUTO, en_level_shifters, CTLFLAG_RW, @@ -119,9 +121,9 @@ static int zy7_devcfg_fclk_sysctl_level_shifters(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_hw_fpga, OID_AUTO, level_shifters, - CTLFLAG_RW | CTLTYPE_INT, - NULL, 0, zy7_devcfg_fclk_sysctl_level_shifters, - "I", "Enable/disable level shifters"); + CTLFLAG_RW | CTLTYPE_INT | CTLFLAG_NEEDGIANT, NULL, 0, + zy7_devcfg_fclk_sysctl_level_shifters, "I", + "Enable/disable level shifters"); /* cdev entry points. */ static int zy7_devcfg_open(struct cdev *, int, int, struct thread *); @@ -360,7 +362,7 @@ sysctl_ctx_init(&sc->sysctl_tree); sc->sysctl_tree_top = SYSCTL_ADD_NODE(&sc->sysctl_tree, SYSCTL_STATIC_CHILDREN(_hw_fpga), OID_AUTO, "fclk", - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (sc->sysctl_tree_top == NULL) { sysctl_ctx_free(&sc->sysctl_tree); return (-1); @@ -370,7 +372,7 @@ snprintf(fclk_num, sizeof(fclk_num), "%d", i); fclk_node = SYSCTL_ADD_NODE(&sc->sysctl_tree, SYSCTL_CHILDREN(sc->sysctl_tree_top), OID_AUTO, fclk_num, - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); SYSCTL_ADD_INT(&sc->sysctl_tree, SYSCTL_CHILDREN(fclk_node), OID_AUTO, @@ -379,13 +381,13 @@ "Actual frequency"); SYSCTL_ADD_PROC(&sc->sysctl_tree, SYSCTL_CHILDREN(fclk_node), OID_AUTO, - "freq", CTLFLAG_RW | CTLTYPE_INT, + "freq", CTLFLAG_RW | CTLTYPE_INT | CTLFLAG_NEEDGIANT, &fclk_configs[i], i, zy7_devcfg_fclk_sysctl_freq, "I", "Configured frequency"); SYSCTL_ADD_PROC(&sc->sysctl_tree, SYSCTL_CHILDREN(fclk_node), OID_AUTO, - "source", CTLFLAG_RW | CTLTYPE_STRING, + "source", CTLFLAG_RW | CTLTYPE_STRING | CTLFLAG_NEEDGIANT, &fclk_configs[i], i, zy7_devcfg_fclk_sysctl_source, "A", "Clock source"); Index: sys/arm/xilinx/zy7_slcr.c =================================================================== --- sys/arm/xilinx/zy7_slcr.c +++ sys/arm/xilinx/zy7_slcr.c @@ -80,7 +80,8 @@ #define ZYNQ_DEFAULT_PS_CLK_FREQUENCY 33333333 /* 33.3 Mhz */ -SYSCTL_NODE(_hw, OID_AUTO, zynq, CTLFLAG_RD, 0, "Xilinx Zynq-7000"); +SYSCTL_NODE(_hw, OID_AUTO, zynq, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Xilinx Zynq-7000"); static char zynq_bootmode[64]; SYSCTL_STRING(_hw_zynq, OID_AUTO, bootmode, CTLFLAG_RD, zynq_bootmode, 0, Index: sys/arm64/arm64/busdma_bounce.c =================================================================== --- sys/arm64/arm64/busdma_bounce.c +++ sys/arm64/arm64/busdma_bounce.c @@ -113,7 +113,8 @@ static int busdma_zonecount; static STAILQ_HEAD(, bounce_zone) bounce_zone_list; -static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Busdma parameters"); SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); @@ -1146,7 +1147,7 @@ sysctl_ctx_init(&bz->sysctl_tree); bz->sysctl_tree_top = SYSCTL_ADD_NODE(&bz->sysctl_tree, SYSCTL_STATIC_CHILDREN(_hw_busdma), OID_AUTO, bz->zoneid, - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (bz->sysctl_tree_top == NULL) { sysctl_ctx_free(&bz->sysctl_tree); return (0); /* XXX error code? */ Index: sys/arm64/arm64/pmap.c =================================================================== --- sys/arm64/arm64/pmap.c +++ sys/arm64/arm64/pmap.c @@ -268,7 +268,8 @@ static vm_paddr_t physmap[PHYSMAP_SIZE]; static u_int physmap_idx; -static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); +static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "VM/pmap parameters"); /* * This ASID allocator uses a bit vector ("asid_set") to remember which ASIDs @@ -281,7 +282,8 @@ * numbers and INT_MAX are reserved for special cases that are described * below. */ -static SYSCTL_NODE(_vm_pmap, OID_AUTO, asid, CTLFLAG_RD, 0, "ASID allocator"); +static SYSCTL_NODE(_vm_pmap, OID_AUTO, asid, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "ASID allocator"); static int asid_bits; SYSCTL_INT(_vm_pmap_asid, OID_AUTO, bits, CTLFLAG_RD, &asid_bits, 0, "The number of bits in an ASID"); @@ -1009,7 +1011,7 @@ vm_initialized = 1; } -static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "2MB page mapping counters"); static u_long pmap_l2_demotions; Index: sys/cam/ata/ata_da.c =================================================================== --- sys/cam/ata/ata_da.c +++ sys/cam/ata/ata_da.c @@ -879,8 +879,8 @@ static int ada_read_ahead = ADA_DEFAULT_READ_AHEAD; static int ada_write_cache = ADA_DEFAULT_WRITE_CACHE; -static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, - "CAM Direct Access Disk driver"); +static SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CAM Direct Access Disk driver"); SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RWTUN, &ada_retry_count, 0, "Normal I/O retry count"); SYSCTL_INT(_kern_cam_ada, OID_AUTO, default_timeout, CTLFLAG_RWTUN, @@ -1451,7 +1451,7 @@ softc->flags |= ADA_FLAG_SCTX_INIT; softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_cam_ada), OID_AUTO, tmpstr2, - CTLFLAG_RD, 0, tmpstr, "device_index"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr, "device_index"); if (softc->sysctl_tree == NULL) { printf("adasysctlinit: unable to allocate sysctl tree\n"); cam_periph_release(periph); @@ -1459,7 +1459,8 @@ } SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "delete_method", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "delete_method", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, softc, 0, adadeletemethodsysctl, "A", "BIO_DELETE execution method"); SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, @@ -1487,11 +1488,13 @@ OID_AUTO, "rotating", CTLFLAG_RD | CTLFLAG_MPSAFE, &softc->rotating, 0, "Rotating media"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "zone_mode", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "zone_mode", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, softc, 0, adazonemodesysctl, "A", "Zone Mode"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "zone_support", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "zone_support", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, softc, 0, adazonesupsysctl, "A", "Zone Support"); SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, @@ -1536,7 +1539,7 @@ #ifdef CAM_IO_STATS softc->sysctl_stats_tree = SYSCTL_ADD_NODE(&softc->sysctl_stats_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "stats", - CTLFLAG_RD, 0, "Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Statistics"); SYSCTL_ADD_INT(&softc->sysctl_stats_ctx, SYSCTL_CHILDREN(softc->sysctl_stats_tree), OID_AUTO, "timeouts", CTLFLAG_RD | CTLFLAG_MPSAFE, Index: sys/cam/ata/ata_pmp.c =================================================================== --- sys/cam/ata/ata_pmp.c +++ sys/cam/ata/ata_pmp.c @@ -139,8 +139,8 @@ static int pmp_default_timeout = PMP_DEFAULT_TIMEOUT; static int pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL; -static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD, 0, - "CAM Direct Access Disk driver"); +static SYSCTL_NODE(_kern_cam, OID_AUTO, pmp, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CAM Direct Access Disk driver"); SYSCTL_INT(_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RWTUN, &pmp_retry_count, 0, "Normal I/O retry count"); SYSCTL_INT(_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RWTUN, @@ -354,7 +354,7 @@ softc->flags |= PMP_FLAG_SCTX_INIT; softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_cam_pmp), OID_AUTO, tmpstr2, - CTLFLAG_RD, 0, tmpstr, "device_index"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr, "device_index"); if (softc->sysctl_tree == NULL) { printf("pmpsysctlinit: unable to allocate sysctl tree\n"); cam_periph_release(periph); Index: sys/cam/cam.c =================================================================== --- sys/cam/cam.c +++ sys/cam/cam.c @@ -108,7 +108,8 @@ }; #ifdef _KERNEL -SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLAG_RD, 0, "CAM Subsystem"); +SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CAM Subsystem"); #ifndef CAM_DEFAULT_SORT_IO_QUEUES #define CAM_DEFAULT_SORT_IO_QUEUES 1 Index: sys/cam/cam_iosched.c =================================================================== --- sys/cam/cam_iosched.c +++ sys/cam/cam_iosched.c @@ -976,7 +976,7 @@ ios->sysctl_tree = SYSCTL_ADD_NODE(&isc->sysctl_ctx, SYSCTL_CHILDREN(isc->sysctl_tree), OID_AUTO, name, - CTLFLAG_RD, 0, name); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, name); n = SYSCTL_CHILDREN(ios->sysctl_tree); ctx = &ios->sysctl_ctx; @@ -1015,7 +1015,8 @@ "# of transactions completed with an error"); SYSCTL_ADD_PROC(ctx, n, - OID_AUTO, "limiter", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "limiter", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, ios, 0, cam_iosched_limiter_sysctl, "A", "Current limiting type."); SYSCTL_ADD_INT(ctx, n, @@ -1032,7 +1033,8 @@ "current resource"); SYSCTL_ADD_PROC(ctx, n, - OID_AUTO, "latencies", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "latencies", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &ios->latencies, 0, cam_iosched_sysctl_latencies, "A", "Array of power of 2 latency from 1ms to 1.024s"); @@ -1056,24 +1058,28 @@ clp = &isc->cl; clp->sysctl_tree = SYSCTL_ADD_NODE(&isc->sysctl_ctx, SYSCTL_CHILDREN(isc->sysctl_tree), OID_AUTO, "control", - CTLFLAG_RD, 0, "Control loop info"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Control loop info"); n = SYSCTL_CHILDREN(clp->sysctl_tree); ctx = &clp->sysctl_ctx; SYSCTL_ADD_PROC(ctx, n, - OID_AUTO, "type", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "type", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, clp, 0, cam_iosched_control_type_sysctl, "A", "Control loop algorithm"); SYSCTL_ADD_PROC(ctx, n, - OID_AUTO, "steer_interval", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "steer_interval", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &clp->steer_interval, 0, cam_iosched_sbintime_sysctl, "A", "How often to steer (in us)"); SYSCTL_ADD_PROC(ctx, n, - OID_AUTO, "lolat", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "lolat", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &clp->lolat, 0, cam_iosched_sbintime_sysctl, "A", "Low water mark for Latency (in us)"); SYSCTL_ADD_PROC(ctx, n, - OID_AUTO, "hilat", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "hilat", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &clp->hilat, 0, cam_iosched_sbintime_sysctl, "A", "Hi water mark for Latency (in us)"); SYSCTL_ADD_INT(ctx, n, @@ -1186,7 +1192,7 @@ isc->sysctl_tree = SYSCTL_ADD_NODE(&isc->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, "iosched", - CTLFLAG_RD, 0, "I/O scheduler statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "I/O scheduler statistics"); n = SYSCTL_CHILDREN(isc->sysctl_tree); ctx = &isc->sysctl_ctx; @@ -1201,7 +1207,7 @@ "How biased towards read should we be independent of limits"); SYSCTL_ADD_PROC(ctx, n, - OID_AUTO, "quanta", CTLTYPE_UINT | CTLFLAG_RW, + OID_AUTO, "quanta", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &isc->quanta, 0, cam_iosched_quanta_sysctl, "I", "How many quanta per second do we slice the I/O up into"); Index: sys/cam/ctl/ctl.c =================================================================== --- sys/cam/ctl/ctl.c +++ sys/cam/ctl/ctl.c @@ -406,7 +406,8 @@ /*num_speed_descr*/0, }; -SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); +SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CAM Target Layer"); static int worker_threads = -1; SYSCTL_INT(_kern_cam_ctl, OID_AUTO, worker_threads, CTLFLAG_RDTUN, &worker_threads, 1, "Number of worker threads"); @@ -1879,7 +1880,7 @@ sysctl_ctx_init(&softc->sysctl_ctx); softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_cam), OID_AUTO, "ctl", - CTLFLAG_RD, 0, "CAM Target Layer"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "CAM Target Layer"); if (softc->sysctl_tree == NULL) { printf("%s: unable to allocate sysctl tree\n", __func__); @@ -1986,7 +1987,8 @@ } SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "ha_role", CTLTYPE_INT | CTLFLAG_RWTUN, + OID_AUTO, "ha_role", + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, ctl_ha_role_sysctl, "I", "HA role for this head"); if (softc->is_single == 0) { Index: sys/cam/ctl/ctl_backend_block.c =================================================================== --- sys/cam/ctl/ctl_backend_block.c +++ sys/cam/ctl/ctl_backend_block.c @@ -222,7 +222,7 @@ extern struct ctl_softc *control_softc; static int cbb_num_threads = 14; -SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, block, CTLFLAG_RD, 0, +SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, block, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "CAM Target Layer Block Backend"); SYSCTL_INT(_kern_cam_ctl_block, OID_AUTO, num_threads, CTLFLAG_RWTUN, &cbb_num_threads, 0, "Number of threads per backing file"); Index: sys/cam/ctl/ctl_frontend_cam_sim.c =================================================================== --- sys/cam/ctl/ctl_frontend_cam_sim.c +++ sys/cam/ctl/ctl_frontend_cam_sim.c @@ -109,8 +109,8 @@ */ static int cfcs_max_sense = sizeof(struct scsi_sense_data); -SYSCTL_NODE(_kern_cam, OID_AUTO, ctl2cam, CTLFLAG_RD, 0, - "CAM Target Layer SIM frontend"); +SYSCTL_NODE(_kern_cam, OID_AUTO, ctl2cam, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CAM Target Layer SIM frontend"); SYSCTL_INT(_kern_cam_ctl2cam, OID_AUTO, max_sense, CTLFLAG_RW, &cfcs_max_sense, 0, "Maximum sense data size"); Index: sys/cam/ctl/ctl_frontend_iscsi.c =================================================================== --- sys/cam/ctl/ctl_frontend_iscsi.c +++ sys/cam/ctl/ctl_frontend_iscsi.c @@ -88,7 +88,7 @@ static MALLOC_DEFINE(M_CFISCSI, "cfiscsi", "Memory used for CTL iSCSI frontend"); static uma_zone_t cfiscsi_data_wait_zone; -SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD, 0, +SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "CAM Target Layer iSCSI Frontend"); static int debug = 1; SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, Index: sys/cam/ctl/ctl_ha.c =================================================================== --- sys/cam/ctl/ctl_ha.c +++ sys/cam/ctl/ctl_ha.c @@ -957,7 +957,8 @@ ctl_ha_msg_shutdown, ctl_softc, SHUTDOWN_PRI_FIRST); SYSCTL_ADD_PROC(&ctl_softc->sysctl_ctx, SYSCTL_CHILDREN(ctl_softc->sysctl_tree), - OID_AUTO, "ha_peer", CTLTYPE_STRING | CTLFLAG_RWTUN, + OID_AUTO, "ha_peer", + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, ctl_ha_peer_sysctl, "A", "HA peer connection method"); if (ctl_ha_msg_register(CTL_HA_CHAN_DATA, ctl_dt_event_handler) Index: sys/cam/nvme/nvme_da.c =================================================================== --- sys/cam/nvme/nvme_da.c +++ sys/cam/nvme/nvme_da.c @@ -167,8 +167,8 @@ #define NDA_MAX_TRIM_ENTRIES (NVME_MAX_DSM_TRIM / sizeof(struct nvme_dsm_range))/* Number of DSM trims to use, max 256 */ #endif -static SYSCTL_NODE(_kern_cam, OID_AUTO, nda, CTLFLAG_RD, 0, - "CAM Direct Access Disk driver"); +static SYSCTL_NODE(_kern_cam, OID_AUTO, nda, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CAM Direct Access Disk driver"); //static int nda_retry_count = NDA_DEFAULT_RETRY; static int nda_send_ordered = NDA_DEFAULT_SEND_ORDERED; @@ -623,7 +623,7 @@ softc->flags |= NDA_FLAG_SCTX_INIT; softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_cam_nda), OID_AUTO, tmpstr2, - CTLFLAG_RD, 0, tmpstr, "device_index"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr, "device_index"); if (softc->sysctl_tree == NULL) { printf("ndasysctlinit: unable to allocate sysctl tree\n"); cam_periph_release(periph); @@ -658,7 +658,7 @@ #ifdef CAM_IO_STATS softc->sysctl_stats_tree = SYSCTL_ADD_NODE(&softc->sysctl_stats_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "stats", - CTLFLAG_RD, 0, "Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Statistics"); if (softc->sysctl_stats_tree == NULL) { printf("ndasysctlinit: unable to allocate sysctl tree for stats\n"); cam_periph_release(periph); Index: sys/cam/scsi/scsi_all.c =================================================================== --- sys/cam/scsi/scsi_all.c +++ sys/cam/scsi/scsi_all.c @@ -9234,8 +9234,8 @@ return (error); return (set_scsi_delay(delay)); } -SYSCTL_PROC(_kern_cam, OID_AUTO, scsi_delay, CTLTYPE_INT|CTLFLAG_RW, - 0, 0, sysctl_scsi_delay, "I", +SYSCTL_PROC(_kern_cam, OID_AUTO, scsi_delay, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, 0, sysctl_scsi_delay, "I", "Delay to allow devices to settle after a SCSI bus reset (ms)"); static int Index: sys/cam/scsi/scsi_cd.c =================================================================== --- sys/cam/scsi/scsi_cd.c +++ sys/cam/scsi/scsi_cd.c @@ -326,7 +326,8 @@ static int cd_retry_count = CD_DEFAULT_RETRY; static int cd_timeout = CD_DEFAULT_TIMEOUT; -static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD, 0, "CAM CDROM driver"); +static SYSCTL_NODE(_kern_cam, OID_AUTO, cd, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CAM CDROM driver"); SYSCTL_INT(_kern_cam_cd, OID_AUTO, poll_period, CTLFLAG_RWTUN, &cd_poll_period, 0, "Media polling period in seconds"); SYSCTL_INT(_kern_cam_cd, OID_AUTO, retry_count, CTLFLAG_RWTUN, @@ -523,7 +524,8 @@ softc->flags |= CD_FLAG_SCTX_INIT; softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_cam_cd), OID_AUTO, - tmpstr2, CTLFLAG_RD, 0, tmpstr, "device_index"); + tmpstr2, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr, + "device_index"); if (softc->sysctl_tree == NULL) { printf("cdsysctlinit: unable to allocate sysctl tree\n"); @@ -536,7 +538,8 @@ * the fly. */ SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "minimum_cmd_size", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &softc->minimum_command_size, 0, cdcmdsizesysctl, "I", "Minimum CDB size"); Index: sys/cam/scsi/scsi_da.c =================================================================== --- sys/cam/scsi/scsi_da.c +++ sys/cam/scsi/scsi_da.c @@ -1548,8 +1548,8 @@ static int da_send_ordered = DA_DEFAULT_SEND_ORDERED; static int da_disable_wp_detection = 0; -static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, - "CAM Direct Access Disk driver"); +static SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CAM Direct Access Disk driver"); SYSCTL_INT(_kern_cam_da, OID_AUTO, poll_period, CTLFLAG_RWTUN, &da_poll_period, 0, "Media polling period in seconds"); SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RWTUN, @@ -1563,7 +1563,8 @@ "Disable detection of write-protected disks"); SYSCTL_PROC(_kern_cam_da, OID_AUTO, default_softtimeout, - CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, dasysctlsofttimeout, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + dasysctlsofttimeout, "I", "Soft I/O timeout (ms)"); TUNABLE_INT64("kern.cam.da.default_softtimeout", &da_default_softtimeout); @@ -2246,7 +2247,7 @@ cam_periph_unlock(periph); softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_cam_da), OID_AUTO, tmpstr2, - CTLFLAG_RD, 0, tmpstr, "device_index"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr, "device_index"); if (softc->sysctl_tree == NULL) { printf("dasysctlinit: unable to allocate sysctl tree\n"); da_periph_release(periph, DA_REF_SYSCTL); @@ -2258,15 +2259,18 @@ * the fly. */ SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "delete_method", CTLTYPE_STRING | CTLFLAG_RWTUN, + OID_AUTO, "delete_method", + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, dadeletemethodsysctl, "A", "BIO_DELETE execution method"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "delete_max", CTLTYPE_U64 | CTLFLAG_RW, + OID_AUTO, "delete_max", + CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_NEEDGIANT, softc, 0, dadeletemaxsysctl, "Q", "Maximum BIO_DELETE size"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "minimum_cmd_size", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, @@ -2283,11 +2287,13 @@ "Total lbas in the unmap/dsm commands sent"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "zone_mode", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "zone_mode", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, softc, 0, dazonemodesysctl, "A", "Zone Mode"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "zone_support", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "zone_support", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, softc, 0, dazonesupsysctl, "A", "Zone Support"); SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, @@ -2375,7 +2381,7 @@ */ softc->sysctl_stats_tree = SYSCTL_ADD_NODE(&softc->sysctl_stats_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "stats", - CTLFLAG_RD, 0, "Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Statistics"); SYSCTL_ADD_INT(&softc->sysctl_stats_ctx, SYSCTL_CHILDREN(softc->sysctl_stats_tree), OID_AUTO, Index: sys/cam/scsi/scsi_enc.c =================================================================== --- sys/cam/scsi/scsi_enc.c +++ sys/cam/scsi/scsi_enc.c @@ -78,8 +78,8 @@ static void enc_async(void *, uint32_t, struct cam_path *, void *); static enctyp enc_type(struct ccb_getdev *); -SYSCTL_NODE(_kern_cam, OID_AUTO, enc, CTLFLAG_RD, 0, - "CAM Enclosure Services driver"); +SYSCTL_NODE(_kern_cam, OID_AUTO, enc, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CAM Enclosure Services driver"); #if defined(DEBUG) || defined(ENC_DEBUG) int enc_verbose = 1; Index: sys/cam/scsi/scsi_sa.c =================================================================== --- sys/cam/scsi/scsi_sa.c +++ sys/cam/scsi/scsi_sa.c @@ -618,8 +618,8 @@ * is bad behavior, because it hides the true tape block size from the * application. */ -static SYSCTL_NODE(_kern_cam, OID_AUTO, sa, CTLFLAG_RD, 0, - "CAM Sequential Access Tape Driver"); +static SYSCTL_NODE(_kern_cam, OID_AUTO, sa, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CAM Sequential Access Tape Driver"); SYSCTL_INT(_kern_cam_sa, OID_AUTO, allow_io_split, CTLFLAG_RDTUN, &sa_allow_io_split, 0, "Default I/O split value"); @@ -2314,7 +2314,7 @@ softc->flags |= SA_FLAG_SCTX_INIT; softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_cam_sa), OID_AUTO, tmpstr2, - CTLFLAG_RD, 0, tmpstr, "device_index"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr, "device_index"); if (softc->sysctl_tree == NULL) goto bailout; Index: sys/cam/scsi/scsi_xpt.c =================================================================== --- sys/cam/scsi/scsi_xpt.c +++ sys/cam/scsi/scsi_xpt.c @@ -80,7 +80,8 @@ static int cam_srch_hi = 0; static int sysctl_cam_search_luns(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_kern_cam, OID_AUTO, cam_srch_hi, CTLTYPE_INT | CTLFLAG_RWTUN, 0, 0, +SYSCTL_PROC(_kern_cam, OID_AUTO, cam_srch_hi, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, 0, sysctl_cam_search_luns, "I", "allow search above LUN 7 for SCSI3 and greater devices"); Index: sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c =================================================================== --- sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c +++ sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c @@ -36,7 +36,8 @@ static MALLOC_DEFINE(M_KSTAT, "kstat_data", "Kernel statistics"); -SYSCTL_ROOT_NODE(OID_AUTO, kstat, CTLFLAG_RW, 0, "Kernel statistics"); +SYSCTL_ROOT_NODE(OID_AUTO, kstat, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Kernel statistics"); kstat_t * kstat_create(char *module, int instance, char *name, char *class, uchar_t type, @@ -64,8 +65,8 @@ */ sysctl_ctx_init(&ksp->ks_sysctl_ctx); root = SYSCTL_ADD_NODE(&ksp->ks_sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_kstat), OID_AUTO, module, CTLFLAG_RW, 0, - ""); + SYSCTL_STATIC_CHILDREN(_kstat), OID_AUTO, module, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); if (root == NULL) { printf("%s: Cannot create kstat.%s tree!\n", __func__, module); sysctl_ctx_free(&ksp->ks_sysctl_ctx); @@ -73,7 +74,7 @@ return (NULL); } root = SYSCTL_ADD_NODE(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(root), - OID_AUTO, class, CTLFLAG_RW, 0, ""); + OID_AUTO, class, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); if (root == NULL) { printf("%s: Cannot create kstat.%s.%s tree!\n", __func__, module, class); @@ -82,7 +83,7 @@ return (NULL); } root = SYSCTL_ADD_NODE(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(root), - OID_AUTO, name, CTLFLAG_RW, 0, ""); + OID_AUTO, name, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); if (root == NULL) { printf("%s: Cannot create kstat.%s.%s.%s tree!\n", __func__, module, class, name); Index: sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c +++ sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c @@ -236,7 +236,8 @@ #ifdef __FreeBSD__ SYSCTL_DECL(_kern_dtrace); -SYSCTL_NODE(_kern_dtrace, OID_AUTO, fasttrap, CTLFLAG_RD, 0, "DTrace fasttrap parameters"); +SYSCTL_NODE(_kern_dtrace, OID_AUTO, fasttrap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "DTrace fasttrap parameters"); SYSCTL_UINT(_kern_dtrace_fasttrap, OID_AUTO, max_probes, CTLFLAG_RWTUN, &fasttrap_max, FASTTRAP_MAX_DEFAULT, "Maximum number of fasttrap probes"); SYSCTL_ULONG(_kern_dtrace_fasttrap, OID_AUTO, tpoints_hash_size, CTLFLAG_RDTUN, &tpoints_hash_size, Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c @@ -44,7 +44,8 @@ int zfs_dedup_prefetch = 1; SYSCTL_DECL(_vfs_zfs); -SYSCTL_NODE(_vfs_zfs, OID_AUTO, dedup, CTLFLAG_RW, 0, "ZFS DEDUP"); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, dedup, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ZFS DEDUP"); SYSCTL_INT(_vfs_zfs_dedup, OID_AUTO, prefetch, CTLFLAG_RWTUN, &zfs_dedup_prefetch, 0, "Enable/disable prefetching of dedup-ed blocks which are going to be freed"); Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c @@ -57,7 +57,8 @@ SYSCTL_DECL(_vfs_zfs); SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RW, &zfs_prefetch_disable, 0, "Disable prefetch"); -SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH"); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ZFS ZFETCH"); SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RWTUN, &zfetch_max_streams, 0, "Max # of streams per zfetch"); SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RWTUN, Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c @@ -39,7 +39,8 @@ #include SYSCTL_DECL(_vfs_zfs); -SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ZFS metaslab"); #define GANG_ALLOCATION(flags) \ ((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER)) Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c @@ -82,7 +82,8 @@ static u_int trim_vdev_max_pending = 10000; /* Keep up to 10K segments */ SYSCTL_DECL(_vfs_zfs); -SYSCTL_NODE(_vfs_zfs, OID_AUTO, trim, CTLFLAG_RD, 0, "ZFS TRIM"); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, trim, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "ZFS TRIM"); SYSCTL_UINT(_vfs_zfs_trim, OID_AUTO, txg_delay, CTLFLAG_RWTUN, &trim_txg_delay, 0, "Delay TRIMs by up to this many TXGs"); Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c @@ -112,7 +112,8 @@ int zfs_txg_timeout = 5; /* max seconds worth of delta per txg */ SYSCTL_DECL(_vfs_zfs); -SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0, "ZFS TXG"); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ZFS TXG"); SYSCTL_INT(_vfs_zfs_txg, OID_AUTO, timeout, CTLFLAG_RWTUN, &zfs_txg_timeout, 0, "Maximum seconds worth of delta per txg"); Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c @@ -55,7 +55,8 @@ #include SYSCTL_DECL(_vfs_zfs); -SYSCTL_NODE(_vfs_zfs, OID_AUTO, vdev, CTLFLAG_RW, 0, "ZFS VDEV"); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, vdev, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ZFS VDEV"); /* * Virtual device management. Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c @@ -90,7 +90,8 @@ #define VCBS (1 << zfs_vdev_cache_bshift) /* 64KB */ SYSCTL_DECL(_vfs_zfs_vdev); -SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, cache, CTLFLAG_RW, 0, "ZFS VDEV Cache"); +SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, cache, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ZFS VDEV Cache"); SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, max, CTLFLAG_RDTUN, &zfs_vdev_cache_max, 0, "Maximum I/O request size that increase read size"); SYSCTL_INT(_vfs_zfs_vdev_cache, OID_AUTO, size, CTLFLAG_RDTUN, Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c @@ -64,7 +64,8 @@ #ifdef _KERNEL SYSCTL_DECL(_vfs_zfs_vdev); -static SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, mirror, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, mirror, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "ZFS VDEV Mirror"); #endif Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c @@ -71,7 +71,8 @@ struct mtx zfs_debug_mtx; MTX_SYSINIT(zfs_debug_mtx, &zfs_debug_mtx, "zfs_debug", MTX_DEF); -SYSCTL_NODE(_vfs, OID_AUTO, zfs, CTLFLAG_RW, 0, "ZFS file system"); +SYSCTL_NODE(_vfs, OID_AUTO, zfs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ZFS file system"); int zfs_super_owner; SYSCTL_INT(_vfs_zfs, OID_AUTO, super_owner, CTLFLAG_RW, &zfs_super_owner, 0, @@ -81,7 +82,8 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, debug, CTLFLAG_RWTUN, &zfs_debug_level, 0, "Debug level"); -SYSCTL_NODE(_vfs_zfs, OID_AUTO, version, CTLFLAG_RD, 0, "ZFS versions"); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, version, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "ZFS versions"); static int zfs_version_acl = ZFS_ACL_VERSION; SYSCTL_INT(_vfs_zfs_version, OID_AUTO, acl, CTLFLAG_RD, &zfs_version_acl, 0, "ZFS_ACL_VERSION"); Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c @@ -48,7 +48,8 @@ #include SYSCTL_DECL(_vfs_zfs); -SYSCTL_NODE(_vfs_zfs, OID_AUTO, zio, CTLFLAG_RW, 0, "ZFS ZIO"); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, zio, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ZFS ZIO"); #if defined(__amd64__) static int zio_use_uma = 1; #else Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c @@ -133,7 +133,8 @@ #ifndef illumos SYSCTL_DECL(_vfs_zfs); -SYSCTL_NODE(_vfs_zfs, OID_AUTO, vol, CTLFLAG_RW, 0, "ZFS VOLUME"); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, vol, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ZFS VOLUME"); static int volmode = ZFS_VOLMODE_GEOM; SYSCTL_INT(_vfs_zfs_vol, OID_AUTO, mode, CTLFLAG_RWTUN, &volmode, 0, "Expose as GEOM providers (1), device files (2) or neither"); Index: sys/cddl/dev/dtrace/dtrace_sysctl.c =================================================================== --- sys/cddl/dev/dtrace/dtrace_sysctl.c +++ sys/cddl/dev/dtrace/dtrace_sysctl.c @@ -73,13 +73,15 @@ return (error); } -SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace debug parameters"); +SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "DTrace debug parameters"); SYSCTL_PROC(_debug_dtrace, OID_AUTO, providers, CTLTYPE_STRING | CTLFLAG_MPSAFE | CTLFLAG_RD, 0, 0, sysctl_dtrace_providers, "A", "available DTrace providers"); -SYSCTL_NODE(_kern, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace parameters"); +SYSCTL_NODE(_kern, OID_AUTO, dtrace, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "DTrace parameters"); SYSCTL_INT(_kern_dtrace, OID_AUTO, err_verbose, CTLFLAG_RW, &dtrace_err_verbose, 0, Index: sys/cddl/dev/dtrace/dtrace_test.c =================================================================== --- sys/cddl/dev/dtrace/dtrace_test.c +++ sys/cddl/dev/dtrace/dtrace_test.c @@ -75,7 +75,9 @@ return (error); } -static SYSCTL_NODE(_debug, OID_AUTO, dtracetest, CTLFLAG_RD, 0, ""); +static SYSCTL_NODE(_debug, OID_AUTO, dtracetest, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + ""); SYSCTL_PROC(_debug_dtracetest, OID_AUTO, sdttest, CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, dtrace_test_sdttest, Index: sys/cddl/dev/profile/profile.c =================================================================== --- sys/cddl/dev/profile/profile.c +++ sys/cddl/dev/profile/profile.c @@ -239,7 +239,8 @@ static int profile_aframes = PROF_ARTIFICIAL_FRAMES; SYSCTL_DECL(_kern_dtrace); -SYSCTL_NODE(_kern_dtrace, OID_AUTO, profile, CTLFLAG_RD, 0, "DTrace profile parameters"); +SYSCTL_NODE(_kern_dtrace, OID_AUTO, profile, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "DTrace profile parameters"); SYSCTL_INT(_kern_dtrace_profile, OID_AUTO, aframes, CTLFLAG_RW, &profile_aframes, 0, "Skipped frames for profile provider"); Index: sys/compat/ia32/ia32_sysvec.c =================================================================== --- sys/compat/ia32/ia32_sysvec.c +++ sys/compat/ia32/ia32_sysvec.c @@ -86,7 +86,8 @@ extern const char *freebsd32_syscallnames[]; -static SYSCTL_NODE(_compat, OID_AUTO, ia32, CTLFLAG_RW, 0, "ia32 mode"); +static SYSCTL_NODE(_compat, OID_AUTO, ia32, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ia32 mode"); static u_long ia32_maxdsiz = IA32_MAXDSIZ; SYSCTL_ULONG(_compat_ia32, OID_AUTO, maxdsiz, CTLFLAG_RWTUN, &ia32_maxdsiz, 0, ""); Index: sys/compat/linux/linux_mib.c =================================================================== --- sys/compat/linux/linux_mib.c +++ sys/compat/linux/linux_mib.c @@ -60,7 +60,8 @@ static unsigned linux_osd_jail_slot; -SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, "Linux mode"); +SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Linux mode"); int linux_ignore_ip_recverr = 1; SYSCTL_INT(_compat_linux, OID_AUTO, ignore_ip_recverr, CTLFLAG_RWTUN, Index: sys/compat/ndis/subr_ntoskrnl.c =================================================================== --- sys/compat/ndis/subr_ntoskrnl.c +++ sys/compat/ndis/subr_ntoskrnl.c @@ -82,8 +82,9 @@ #ifdef NTOSKRNL_DEBUG_TIMERS static int sysctl_show_timers(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_debug, OID_AUTO, ntoskrnl_timers, CTLTYPE_INT | CTLFLAG_RW, - NULL, 0, sysctl_show_timers, "I", +SYSCTL_PROC(_debug, OID_AUTO, ntoskrnl_timers, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_show_timers, "I", "Show ntoskrnl timer stats"); #endif Index: sys/compat/x86bios/x86bios.c =================================================================== --- sys/compat/x86bios/x86bios.c +++ sys/compat/x86bios/x86bios.c @@ -67,7 +67,7 @@ static struct mtx x86bios_lock; -static SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "x86bios debugging"); static int x86bios_trace_call; SYSCTL_INT(_debug_x86bios, OID_AUTO, call, CTLFLAG_RWTUN, &x86bios_trace_call, 0, Index: sys/contrib/rdma/krping/krping_dev.c =================================================================== --- sys/contrib/rdma/krping/krping_dev.c +++ sys/contrib/rdma/krping/krping_dev.c @@ -30,7 +30,8 @@ #define BUFFERSIZE 512 -SYSCTL_NODE(_dev, OID_AUTO, krping, CTLFLAG_RW, 0, "kernel rping module"); +SYSCTL_NODE(_dev, OID_AUTO, krping, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "kernel rping module"); int krping_debug = 0; SYSCTL_INT(_dev_krping, OID_AUTO, debug, CTLFLAG_RW, &krping_debug, 0 , ""); Index: sys/crypto/ccp/ccp_hardware.c =================================================================== --- sys/crypto/ccp/ccp_hardware.c +++ sys/crypto/ccp/ccp_hardware.c @@ -80,7 +80,8 @@ { CCP_XTS_AES_UNIT_SIZE_4096, 4096 }, }; -SYSCTL_NODE(_hw, OID_AUTO, ccp, CTLFLAG_RD, 0, "ccp node"); +SYSCTL_NODE(_hw, OID_AUTO, ccp, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "ccp node"); unsigned g_ccp_ring_order = 11; SYSCTL_UINT(_hw_ccp, OID_AUTO, ring_order, CTLFLAG_RDTUN, &g_ccp_ring_order, Index: sys/ddb/db_capture.c =================================================================== --- sys/ddb/db_capture.c +++ sys/ddb/db_capture.c @@ -82,7 +82,8 @@ struct sx db_capture_sx; /* Lock against user thread races. */ SX_SYSINIT(db_capture_sx, &db_capture_sx, "db_capture_sx"); -static SYSCTL_NODE(_debug_ddb, OID_AUTO, capture, CTLFLAG_RW, 0, +static SYSCTL_NODE(_debug_ddb, OID_AUTO, capture, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "DDB capture options"); SYSCTL_UINT(_debug_ddb_capture, OID_AUTO, bufoff, CTLFLAG_RD, @@ -165,8 +166,9 @@ return (0); } -SYSCTL_PROC(_debug_ddb_capture, OID_AUTO, bufsize, CTLTYPE_UINT|CTLFLAG_RW, - 0, 0, sysctl_debug_ddb_capture_bufsize, "IU", +SYSCTL_PROC(_debug_ddb_capture, OID_AUTO, bufsize, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + sysctl_debug_ddb_capture_bufsize, "IU", "Size of DDB capture buffer"); /* @@ -191,8 +193,10 @@ ch = '\0'; return (SYSCTL_OUT(req, &ch, sizeof(ch))); } -SYSCTL_PROC(_debug_ddb_capture, OID_AUTO, data, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_debug_ddb_capture_data, "A", "DDB capture data"); +SYSCTL_PROC(_debug_ddb_capture, OID_AUTO, data, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_debug_ddb_capture_data, "A", + "DDB capture data"); /* * Routines for capturing DDB output into a fixed-size buffer. These are Index: sys/ddb/db_main.c =================================================================== --- sys/ddb/db_main.c +++ sys/ddb/db_main.c @@ -48,7 +48,8 @@ #include #include -SYSCTL_NODE(_debug, OID_AUTO, ddb, CTLFLAG_RW, 0, "DDB settings"); +SYSCTL_NODE(_debug, OID_AUTO, ddb, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "DDB settings"); static dbbe_init_f db_init; static dbbe_trap_f db_trap; Index: sys/ddb/db_script.c =================================================================== --- sys/ddb/db_script.c +++ sys/ddb/db_script.c @@ -462,7 +462,8 @@ * like RPCs and a bit less like normal get/set requests. The ddb(8) command * line tool wraps them to make things a bit more user-friendly. */ -static SYSCTL_NODE(_debug_ddb, OID_AUTO, scripting, CTLFLAG_RW, 0, +static SYSCTL_NODE(_debug_ddb, OID_AUTO, scripting, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "DDB script settings"); static int @@ -495,8 +496,9 @@ free(buffer, M_TEMP); return (error); } -SYSCTL_PROC(_debug_ddb_scripting, OID_AUTO, scripts, CTLTYPE_STRING | - CTLFLAG_RD, 0, 0, sysctl_debug_ddb_scripting_scripts, "A", +SYSCTL_PROC(_debug_ddb_scripting, OID_AUTO, scripts, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, + sysctl_debug_ddb_scripting_scripts, "A", "List of defined scripts"); static int @@ -532,8 +534,9 @@ free(buffer, M_TEMP); return (error); } -SYSCTL_PROC(_debug_ddb_scripting, OID_AUTO, script, CTLTYPE_STRING | - CTLFLAG_RW, 0, 0, sysctl_debug_ddb_scripting_script, "A", +SYSCTL_PROC(_debug_ddb_scripting, OID_AUTO, script, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + sysctl_debug_ddb_scripting_script, "A", "Set a script"); /* @@ -559,6 +562,7 @@ return (EINVAL); /* Don't confuse sysctl consumers. */ return (0); } -SYSCTL_PROC(_debug_ddb_scripting, OID_AUTO, unscript, CTLTYPE_STRING | - CTLFLAG_RW, 0, 0, sysctl_debug_ddb_scripting_unscript, "A", +SYSCTL_PROC(_debug_ddb_scripting, OID_AUTO, unscript, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + sysctl_debug_ddb_scripting_unscript, "A", "Unset a script"); Index: sys/ddb/db_textdump.c =================================================================== --- sys/ddb/db_textdump.c +++ sys/ddb/db_textdump.c @@ -76,7 +76,8 @@ #include #include -static SYSCTL_NODE(_debug_ddb, OID_AUTO, textdump, CTLFLAG_RW, 0, +static SYSCTL_NODE(_debug_ddb, OID_AUTO, textdump, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "DDB textdump options"); /* Index: sys/dev/aac/aac.c =================================================================== --- sys/dev/aac/aac.c +++ sys/dev/aac/aac.c @@ -225,7 +225,8 @@ static MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver"); /* sysctl node */ -SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "AAC driver parameters"); /* * Device Interface Index: sys/dev/aacraid/aacraid.c =================================================================== --- sys/dev/aacraid/aacraid.c +++ sys/dev/aacraid/aacraid.c @@ -224,7 +224,8 @@ MALLOC_DEFINE(M_AACRAIDBUF, "aacraid_buf", "Buffers for the AACRAID driver"); /* sysctl node */ -SYSCTL_NODE(_hw, OID_AUTO, aacraid, CTLFLAG_RD, 0, "AACRAID driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, aacraid, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "AACRAID driver parameters"); /* * Device Interface Index: sys/dev/acpi_support/acpi_asus.c =================================================================== --- sys/dev/acpi_support/acpi_asus.c +++ sys/dev/acpi_support/acpi_asus.c @@ -731,7 +731,7 @@ sysctl_ctx_init(&sc->sysctl_ctx); sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), - OID_AUTO, "asus", CTLFLAG_RD, 0, ""); + OID_AUTO, "asus", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); /* Hook up nodes */ for (int i = 0; acpi_asus_sysctls[i].name != NULL; i++) { @@ -742,14 +742,14 @@ SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, acpi_asus_sysctls[i].name, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY, - sc, i, acpi_asus_sysctl, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | + CTLFLAG_NEEDGIANT, sc, i, acpi_asus_sysctl, "I", acpi_asus_sysctls[i].description); } else { SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, acpi_asus_sysctls[i].name, - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, i, acpi_asus_sysctl, "I", acpi_asus_sysctls[i].description); } Index: sys/dev/acpi_support/acpi_asus_wmi.c =================================================================== --- sys/dev/acpi_support/acpi_asus_wmi.c +++ sys/dev/acpi_support/acpi_asus_wmi.c @@ -429,14 +429,14 @@ SYSCTL_ADD_PROC(sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, acpi_asus_wmi_sysctls[i].name, - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, i, acpi_asus_wmi_sysctl, "I", acpi_asus_wmi_sysctls[i].description); } else { SYSCTL_ADD_PROC(sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, acpi_asus_wmi_sysctls[i].name, - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, i, acpi_asus_wmi_sysctl, "I", acpi_asus_wmi_sysctls[i].description); } Index: sys/dev/acpi_support/acpi_fujitsu.c =================================================================== --- sys/dev/acpi_support/acpi_fujitsu.c +++ sys/dev/acpi_support/acpi_fujitsu.c @@ -385,7 +385,7 @@ sysctl_ctx_init(&sc->sysctl_ctx); sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), - OID_AUTO, "fujitsu", CTLFLAG_RD, 0, ""); + OID_AUTO, "fujitsu", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); for (i = 0; sysctl_table[i].name != NULL; i++) { switch(sysctl_table[i].method) { @@ -418,8 +418,8 @@ SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, sysctl_table[i].name, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY, - sc, i, acpi_fujitsu_sysctl, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | + CTLFLAG_NEEDGIANT, sc, i, acpi_fujitsu_sysctl, "I", sysctl_table[i].description); } Index: sys/dev/acpi_support/acpi_hp.c =================================================================== --- sys/dev/acpi_support/acpi_hp.c +++ sys/dev/acpi_support/acpi_hp.c @@ -593,13 +593,15 @@ if (acpi_hp_sysctls[i].flag_rdonly != 0) { SYSCTL_ADD_PROC(sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - acpi_hp_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RD, + acpi_hp_sysctls[i].name, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, i, acpi_hp_sysctl, "I", acpi_hp_sysctls[i].description); } else { SYSCTL_ADD_PROC(sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - acpi_hp_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RW, + acpi_hp_sysctls[i].name, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, i, acpi_hp_sysctl, "I", acpi_hp_sysctls[i].description); } Index: sys/dev/acpi_support/acpi_ibm.c =================================================================== --- sys/dev/acpi_support/acpi_ibm.c +++ sys/dev/acpi_support/acpi_ibm.c @@ -543,13 +543,15 @@ if (acpi_ibm_sysctls[i].flag_rdonly != 0) { SYSCTL_ADD_PROC(sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - acpi_ibm_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RD, + acpi_ibm_sysctls[i].name, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, i, acpi_ibm_sysctl, "I", acpi_ibm_sysctls[i].description); } else { SYSCTL_ADD_PROC(sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, - acpi_ibm_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RW, + acpi_ibm_sysctls[i].name, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, i, acpi_ibm_sysctl, "I", acpi_ibm_sysctls[i].description); } @@ -559,15 +561,15 @@ if (acpi_ibm_sysctl_init(sc, ACPI_IBM_METHOD_THERMAL)) { SYSCTL_ADD_PROC(sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "thermal", - CTLTYPE_INT | CTLFLAG_RD, sc, 0, acpi_ibm_thermal_sysctl, - "I", "Thermal zones"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + acpi_ibm_thermal_sysctl, "I", "Thermal zones"); } /* Hook up handlerevents node */ if (acpi_ibm_sysctl_init(sc, ACPI_IBM_METHOD_HANDLEREVENTS)) { SYSCTL_ADD_PROC(sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "handlerevents", - CTLTYPE_STRING | CTLFLAG_RW, sc, 0, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, acpi_ibm_handlerevents_sysctl, "I", "devd(8) events handled by acpi_ibm"); } Index: sys/dev/acpi_support/acpi_panasonic.c =================================================================== --- sys/dev/acpi_support/acpi_panasonic.c +++ sys/dev/acpi_support/acpi_panasonic.c @@ -168,13 +168,13 @@ sysctl_ctx_init(&sc->sysctl_ctx); sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, - "panasonic", CTLFLAG_RD, 0, ""); + "panasonic", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); for (i = 0; sysctl_table[i].name != NULL; i++) { SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, sysctl_table[i].name, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY, - sc, i, acpi_panasonic_sysctl, "I", ""); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | + CTLFLAG_NEEDGIANT, sc, i, acpi_panasonic_sysctl, "I", ""); } #if 0 Index: sys/dev/acpi_support/acpi_rapidstart.c =================================================================== --- sys/dev/acpi_support/acpi_rapidstart.c +++ sys/dev/acpi_support/acpi_rapidstart.c @@ -90,14 +90,14 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), i, acpi_rapidstart_oids[i].nodename, - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, dev, i, sysctl_acpi_rapidstart_gen_handler, "I", acpi_rapidstart_oids[i].comment); } else { SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), i, acpi_rapidstart_oids[i].nodename, - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, i, sysctl_acpi_rapidstart_gen_handler, "I", acpi_rapidstart_oids[i].comment); } Index: sys/dev/acpi_support/acpi_sony.c =================================================================== --- sys/dev/acpi_support/acpi_sony.c +++ sys/dev/acpi_support/acpi_sony.c @@ -137,14 +137,14 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), i, acpi_sony_oids[i].nodename , - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, dev, i, sysctl_acpi_sony_gen_handler, "I", acpi_sony_oids[i].comment); } else { SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), i, acpi_sony_oids[i].nodename , - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, i, sysctl_acpi_sony_gen_handler, "I", acpi_sony_oids[i].comment); } Index: sys/dev/acpi_support/acpi_toshiba.c =================================================================== --- sys/dev/acpi_support/acpi_toshiba.c +++ sys/dev/acpi_support/acpi_toshiba.c @@ -247,14 +247,14 @@ sysctl_ctx_init(&sc->sysctl_ctx); sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, - "toshiba", CTLFLAG_RD, 0, ""); + "toshiba", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); for (i = 0; sysctl_table[i].name != NULL; i++) { SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, sysctl_table[i].name, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY, - sc, i, acpi_toshiba_sysctl, "I", ""); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | + CTLFLAG_NEEDGIANT, sc, i, acpi_toshiba_sysctl, "I", ""); } if (enable_fn_keys != 0) { Index: sys/dev/acpi_support/atk0110.c =================================================================== --- sys/dev/acpi_support/atk0110.c +++ sys/dev/acpi_support/atk0110.c @@ -234,7 +234,7 @@ #endif SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->sc_dev), SYSCTL_CHILDREN(so), idx, sysctl_name, - CTLTYPE_INT | CTLFLAG_RD, sc, (uintptr_t)sensor, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, (uintptr_t)sensor, sc->sc_ggrp_method ? aibs_sysctl_ggrp : aibs_sysctl, sensor->t == AIBS_SENS_TYPE_TEMP ? "IK" : "I", descr); } @@ -319,7 +319,8 @@ /* sysctl subtree for sensors of this type */ *so = SYSCTL_ADD_NODE(device_get_sysctl_ctx(sc->sc_dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->sc_dev)), - sensor->t, name, CTLFLAG_RD, NULL, NULL); + sensor->t, name, CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, NULL); } aibs_sensor_added(sc, *so, name, *s_idx, sensor, descr); *s_idx += 1; @@ -415,7 +416,7 @@ /* sysctl subtree for sensors of this type */ *so = SYSCTL_ADD_NODE(device_get_sysctl_ctx(sc->sc_dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->sc_dev)), st, - node, CTLFLAG_RD, NULL, NULL); + node, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, NULL); for (i = 0, o++; i < n; i++, o++) { const char *descr; Index: sys/dev/acpica/acpi.c =================================================================== --- sys/dev/acpica/acpi.c +++ sys/dev/acpica/acpi.c @@ -250,7 +250,8 @@ /* Holds the description of the acpi0 device. */ static char acpi_desc[ACPI_OEM_ID_SIZE + ACPI_OEM_TABLE_ID_SIZE + 2]; -SYSCTL_NODE(_debug, OID_AUTO, acpi, CTLFLAG_RD, NULL, "ACPI debugging"); +SYSCTL_NODE(_debug, OID_AUTO, acpi, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "ACPI debugging"); static char acpi_ca_version[12]; SYSCTL_STRING(_debug_acpi, OID_AUTO, acpi_ca_version, CTLFLAG_RD, acpi_ca_version, 0, "Version of Intel ACPI-CA"); @@ -269,7 +270,8 @@ static int acpi_debug_objects; TUNABLE_INT("debug.acpi.enable_debug_objects", &acpi_debug_objects); SYSCTL_PROC(_debug_acpi, OID_AUTO, enable_debug_objects, - CTLFLAG_RW | CTLTYPE_INT, NULL, 0, acpi_debug_objects_sysctl, "I", + CTLFLAG_RW | CTLTYPE_INT | CTLFLAG_NEEDGIANT, NULL, 0, + acpi_debug_objects_sysctl, "I", "Enable Debug objects"); /* Allow the interpreter to ignore common mistakes in BIOS. */ @@ -550,29 +552,35 @@ */ sysctl_ctx_init(&sc->acpi_sysctl_ctx); sc->acpi_sysctl_tree = SYSCTL_ADD_NODE(&sc->acpi_sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, - device_get_name(dev), CTLFLAG_RD, 0, ""); + SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, device_get_name(dev), + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), - OID_AUTO, "supported_sleep_state", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "supported_sleep_state", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, 0, 0, acpi_supported_sleep_state_sysctl, "A", "List supported ACPI sleep states."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), - OID_AUTO, "power_button_state", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "power_button_state", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->acpi_power_button_sx, 0, acpi_sleep_state_sysctl, "A", "Power button ACPI sleep state."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), - OID_AUTO, "sleep_button_state", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "sleep_button_state", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->acpi_sleep_button_sx, 0, acpi_sleep_state_sysctl, "A", "Sleep button ACPI sleep state."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), - OID_AUTO, "lid_switch_state", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "lid_switch_state", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->acpi_lid_switch_sx, 0, acpi_sleep_state_sysctl, "A", "Lid ACPI sleep state. Set to S3 if you want to suspend your laptop when close the Lid."); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), - OID_AUTO, "standby_state", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "standby_state", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->acpi_standby_sx, 0, acpi_sleep_state_sysctl, "A", ""); SYSCTL_ADD_PROC(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), - OID_AUTO, "suspend_state", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "suspend_state", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->acpi_suspend_sx, 0, acpi_sleep_state_sysctl, "A", ""); SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "sleep_delay", CTLFLAG_RW, &sc->acpi_sleep_delay, 0, @@ -3352,7 +3360,7 @@ if (ACPI_SUCCESS(status)) { SYSCTL_ADD_PROC(device_get_sysctl_ctx(child), SYSCTL_CHILDREN(device_get_sysctl_tree(child)), OID_AUTO, - "wake", CTLTYPE_INT | CTLFLAG_RW, child, 0, + "wake", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, child, 0, acpi_wake_set_sysctl, "I", "Device set to wake the system"); } } @@ -4125,10 +4133,14 @@ return (error); } -SYSCTL_PROC(_debug_acpi, OID_AUTO, layer, CTLFLAG_RW | CTLTYPE_STRING, - "debug.acpi.layer", 0, acpi_debug_sysctl, "A", ""); -SYSCTL_PROC(_debug_acpi, OID_AUTO, level, CTLFLAG_RW | CTLTYPE_STRING, - "debug.acpi.level", 0, acpi_debug_sysctl, "A", ""); +SYSCTL_PROC(_debug_acpi, OID_AUTO, layer, + CTLFLAG_RW | CTLTYPE_STRING | CTLFLAG_NEEDGIANT, "debug.acpi.layer", 0, + acpi_debug_sysctl, "A", + ""); +SYSCTL_PROC(_debug_acpi, OID_AUTO, level, + CTLFLAG_RW | CTLTYPE_STRING | CTLFLAG_NEEDGIANT, "debug.acpi.level", 0, + acpi_debug_sysctl, "A", + ""); #endif /* ACPI_DEBUG */ static int Index: sys/dev/acpica/acpi_acad.c =================================================================== --- sys/dev/acpica/acpi_acad.c +++ sys/dev/acpica/acpi_acad.c @@ -170,9 +170,9 @@ if (device_get_unit(dev) == 0) { acpi_sc = acpi_device_get_parent_softc(dev); SYSCTL_ADD_PROC(&acpi_sc->acpi_sysctl_ctx, - SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), - OID_AUTO, "acline", CTLTYPE_INT | CTLFLAG_RD, - &sc->status, 0, acpi_acad_sysctl, "I", ""); + SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "acline", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &sc->status, 0, + acpi_acad_sysctl, "I", ""); } /* Get initial status after whole system is up. */ Index: sys/dev/acpica/acpi_battery.c =================================================================== --- sys/dev/acpica/acpi_battery.c +++ sys/dev/acpica/acpi_battery.c @@ -473,31 +473,31 @@ sysctl_ctx_init(&acpi_battery_sysctl_ctx); acpi_battery_sysctl_tree = SYSCTL_ADD_NODE(&acpi_battery_sysctl_ctx, - SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "battery", CTLFLAG_RD, - 0, "battery status and info"); + SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "battery", + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "battery status and info"); SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, SYSCTL_CHILDREN(acpi_battery_sysctl_tree), - OID_AUTO, "life", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "life", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &acpi_battery_battinfo.cap, 0, acpi_battery_sysctl, "I", "percent capacity remaining"); SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, SYSCTL_CHILDREN(acpi_battery_sysctl_tree), - OID_AUTO, "time", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "time", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &acpi_battery_battinfo.min, 0, acpi_battery_sysctl, "I", "remaining time in minutes"); SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, SYSCTL_CHILDREN(acpi_battery_sysctl_tree), - OID_AUTO, "rate", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "rate", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &acpi_battery_battinfo.rate, 0, acpi_battery_sysctl, "I", "present rate in mW"); SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, SYSCTL_CHILDREN(acpi_battery_sysctl_tree), - OID_AUTO, "state", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "state", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &acpi_battery_battinfo.state, 0, acpi_battery_sysctl, "I", "current status flags"); SYSCTL_ADD_PROC(&acpi_battery_sysctl_ctx, SYSCTL_CHILDREN(acpi_battery_sysctl_tree), - OID_AUTO, "units", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "units", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, acpi_battery_units_sysctl, "I", "number of batteries"); SYSCTL_ADD_INT(&acpi_battery_sysctl_ctx, SYSCTL_CHILDREN(acpi_battery_sysctl_tree), Index: sys/dev/acpica/acpi_cpu.c =================================================================== --- sys/dev/acpica/acpi_cpu.c +++ sys/dev/acpica/acpi_cpu.c @@ -391,7 +391,7 @@ sysctl_ctx_init(&cpu_sysctl_ctx); cpu_sysctl_tree = SYSCTL_ADD_NODE(&cpu_sysctl_ctx, SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "cpu", - CTLFLAG_RD, 0, "node for CPU children"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "node for CPU children"); } /* @@ -1023,7 +1023,7 @@ /* Add a sysctl handler to handle global Cx lowest setting */ SYSCTL_ADD_PROC(&cpu_sysctl_ctx, SYSCTL_CHILDREN(cpu_sysctl_tree), - OID_AUTO, "cx_lowest", CTLTYPE_STRING | CTLFLAG_RW, + OID_AUTO, "cx_lowest", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, acpi_cpu_global_cx_lowest_sysctl, "A", "Global lowest Cx sleep state to use"); @@ -1067,26 +1067,25 @@ sc->cpu_cx_supported, 0, "Cx/microsecond values for supported Cx states"); SYSCTL_ADD_PROC(&sc->cpu_sysctl_ctx, - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->cpu_dev)), - OID_AUTO, "cx_lowest", CTLTYPE_STRING | CTLFLAG_RW, - (void *)sc, 0, acpi_cpu_cx_lowest_sysctl, "A", - "lowest Cx sleep state to use"); + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->cpu_dev)), OID_AUTO, + "cx_lowest", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + (void *)sc, 0, acpi_cpu_cx_lowest_sysctl, "A", + "lowest Cx sleep state to use"); SYSCTL_ADD_PROC(&sc->cpu_sysctl_ctx, - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->cpu_dev)), - OID_AUTO, "cx_usage", CTLTYPE_STRING | CTLFLAG_RD, - (void *)sc, 0, acpi_cpu_usage_sysctl, "A", - "percent usage for each Cx state"); + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->cpu_dev)), OID_AUTO, + "cx_usage", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + (void *)sc, 0, acpi_cpu_usage_sysctl, "A", + "percent usage for each Cx state"); SYSCTL_ADD_PROC(&sc->cpu_sysctl_ctx, - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->cpu_dev)), - OID_AUTO, "cx_usage_counters", CTLTYPE_STRING | CTLFLAG_RD, - (void *)sc, 0, acpi_cpu_usage_counters_sysctl, "A", - "Cx sleep state counters"); + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->cpu_dev)), OID_AUTO, + "cx_usage_counters", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + (void *)sc, 0, acpi_cpu_usage_counters_sysctl, "A", + "Cx sleep state counters"); #if defined(__i386__) || defined(__amd64__) SYSCTL_ADD_PROC(&sc->cpu_sysctl_ctx, - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->cpu_dev)), - OID_AUTO, "cx_method", CTLTYPE_STRING | CTLFLAG_RD, - (void *)sc, 0, acpi_cpu_method_sysctl, "A", - "Cx entrance methods"); + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->cpu_dev)), OID_AUTO, + "cx_method", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + (void *)sc, 0, acpi_cpu_method_sysctl, "A", "Cx entrance methods"); #endif /* Signal platform that we can handle _CST notification. */ Index: sys/dev/acpica/acpi_dock.c =================================================================== --- sys/dev/acpica/acpi_dock.c +++ sys/dev/acpica/acpi_dock.c @@ -515,7 +515,7 @@ SYSCTL_ADD_PROC(sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "status", - CTLTYPE_INT|CTLFLAG_RW, dev, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, dev, 0, acpi_dock_status_sysctl, "I", "Dock/Undock operation"); Index: sys/dev/acpica/acpi_ec.c =================================================================== --- sys/dev/acpica/acpi_ec.c +++ sys/dev/acpica/acpi_ec.c @@ -179,7 +179,9 @@ ACPI_SERIAL_DECL(ec, "ACPI embedded controller"); -static SYSCTL_NODE(_debug_acpi, OID_AUTO, ec, CTLFLAG_RD, NULL, "EC debugging"); +static SYSCTL_NODE(_debug_acpi, OID_AUTO, ec, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "EC debugging"); static int ec_burst_mode; SYSCTL_INT(_debug_acpi_ec, OID_AUTO, burst, CTLFLAG_RWTUN, &ec_burst_mode, 0, Index: sys/dev/acpica/acpi_smbat.c =================================================================== --- sys/dev/acpica/acpi_smbat.c +++ sys/dev/acpica/acpi_smbat.c @@ -62,7 +62,8 @@ ACPI_SERIAL_DECL(smbat, "ACPI Smart Battery"); -static SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Battery debugging"); /* On some laptops with smart batteries, enabling battery monitoring Index: sys/dev/acpica/acpi_thermal.c =================================================================== --- sys/dev/acpica/acpi_thermal.c +++ sys/dev/acpica/acpi_thermal.c @@ -241,8 +241,8 @@ acpi_sc = acpi_device_get_parent_softc(dev); sysctl_ctx_init(&acpi_tz_sysctl_ctx); acpi_tz_sysctl_tree = SYSCTL_ADD_NODE(&acpi_tz_sysctl_ctx, - SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), - OID_AUTO, "thermal", CTLFLAG_RD, 0, ""); + SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "thermal", + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); SYSCTL_ADD_INT(&acpi_tz_sysctl_ctx, SYSCTL_CHILDREN(acpi_tz_sysctl_tree), OID_AUTO, "min_runtime", CTLFLAG_RW, @@ -260,56 +260,52 @@ sysctl_ctx_init(&sc->tz_sysctl_ctx); sprintf(oidname, "tz%d", device_get_unit(dev)); sc->tz_sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&sc->tz_sysctl_ctx, - SYSCTL_CHILDREN(acpi_tz_sysctl_tree), - OID_AUTO, oidname, CTLFLAG_RD, 0, "", "thermal_zone"); + SYSCTL_CHILDREN(acpi_tz_sysctl_tree), OID_AUTO, oidname, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "", "thermal_zone"); SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), - OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, - &sc->tz_temperature, 0, sysctl_handle_int, - "IK", "current thermal zone temperature"); + OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &sc->tz_temperature, 0, sysctl_handle_int, "IK", + "current thermal zone temperature"); SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), - OID_AUTO, "active", CTLTYPE_INT | CTLFLAG_RW, - sc, 0, acpi_tz_active_sysctl, "I", "cooling is active"); + OID_AUTO, "active", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, + 0, acpi_tz_active_sysctl, "I", "cooling is active"); SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), - OID_AUTO, "passive_cooling", CTLTYPE_INT | CTLFLAG_RW, - sc, 0, acpi_tz_cooling_sysctl, "I", - "enable passive (speed reduction) cooling"); + OID_AUTO, "passive_cooling", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + acpi_tz_cooling_sysctl, "I", + "enable passive (speed reduction) cooling"); SYSCTL_ADD_INT(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), OID_AUTO, "thermal_flags", CTLFLAG_RD, &sc->tz_thflags, 0, "thermal zone flags"); SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), - OID_AUTO, "_PSV", CTLTYPE_INT | CTLFLAG_RW, - sc, offsetof(struct acpi_tz_softc, tz_zone.psv), - acpi_tz_temp_sysctl, "IK", "passive cooling temp setpoint"); + OID_AUTO, "_PSV", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, + offsetof(struct acpi_tz_softc, tz_zone.psv), acpi_tz_temp_sysctl, "IK", + "passive cooling temp setpoint"); SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), - OID_AUTO, "_HOT", CTLTYPE_INT | CTLFLAG_RW, - sc, offsetof(struct acpi_tz_softc, tz_zone.hot), - acpi_tz_temp_sysctl, "IK", - "too hot temp setpoint (suspend now)"); + OID_AUTO, "_HOT", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, + offsetof(struct acpi_tz_softc, tz_zone.hot), acpi_tz_temp_sysctl, "IK", + "too hot temp setpoint (suspend now)"); SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), - OID_AUTO, "_CRT", CTLTYPE_INT | CTLFLAG_RW, - sc, offsetof(struct acpi_tz_softc, tz_zone.crt), - acpi_tz_temp_sysctl, "IK", - "critical temp setpoint (shutdown now)"); + OID_AUTO, "_CRT", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, + offsetof(struct acpi_tz_softc, tz_zone.crt), acpi_tz_temp_sysctl, "IK", + "critical temp setpoint (shutdown now)"); SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), - OID_AUTO, "_ACx", CTLTYPE_INT | CTLFLAG_RD, - &sc->tz_zone.ac, sizeof(sc->tz_zone.ac), - sysctl_handle_opaque, "IK", ""); + OID_AUTO, "_ACx", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &sc->tz_zone.ac, sizeof(sc->tz_zone.ac), sysctl_handle_opaque, "IK", + ""); SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), - OID_AUTO, "_TC1", CTLTYPE_INT | CTLFLAG_RW, - sc, offsetof(struct acpi_tz_softc, tz_zone.tc1), - acpi_tz_passive_sysctl, "I", - "thermal constant 1 for passive cooling"); + OID_AUTO, "_TC1", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, + offsetof(struct acpi_tz_softc, tz_zone.tc1), acpi_tz_passive_sysctl, + "I", "thermal constant 1 for passive cooling"); SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), - OID_AUTO, "_TC2", CTLTYPE_INT | CTLFLAG_RW, - sc, offsetof(struct acpi_tz_softc, tz_zone.tc2), - acpi_tz_passive_sysctl, "I", - "thermal constant 2 for passive cooling"); + OID_AUTO, "_TC2", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, + offsetof(struct acpi_tz_softc, tz_zone.tc2), acpi_tz_passive_sysctl, + "I", "thermal constant 2 for passive cooling"); SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), - OID_AUTO, "_TSP", CTLTYPE_INT | CTLFLAG_RW, - sc, offsetof(struct acpi_tz_softc, tz_zone.tsp), - acpi_tz_passive_sysctl, "I", - "thermal sampling period for passive cooling"); + OID_AUTO, "_TSP", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, + offsetof(struct acpi_tz_softc, tz_zone.tsp), acpi_tz_passive_sysctl, + "I", "thermal sampling period for passive cooling"); /* * Register our power profile event handler. Index: sys/dev/acpica/acpi_timer.c =================================================================== --- sys/dev/acpica/acpi_timer.c +++ sys/dev/acpica/acpi_timer.c @@ -368,8 +368,10 @@ return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, acpi_timer_freq, CTLTYPE_INT | CTLFLAG_RW, - 0, sizeof(u_int), acpi_timer_sysctl_freq, "I", "ACPI timer frequency"); +SYSCTL_PROC(_machdep, OID_AUTO, acpi_timer_freq, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(u_int), + acpi_timer_sysctl_freq, "I", + "ACPI timer frequency"); /* * Some ACPI timers are known or believed to suffer from implementation Index: sys/dev/acpica/acpi_video.c =================================================================== --- sys/dev/acpica/acpi_video.c +++ sys/dev/acpica/acpi_video.c @@ -254,9 +254,9 @@ ACPI_SERIAL_BEGIN(video); if (acpi_video_sysctl_tree == NULL) { acpi_video_sysctl_tree = SYSCTL_ADD_NODE(&acpi_video_sysctl_ctx, - SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), - OID_AUTO, "video", CTLFLAG_RD, 0, - "video extension control"); + SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, + "video", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "video extension control"); } ACPI_SERIAL_END(video); @@ -539,39 +539,40 @@ vo->vo_sysctl_tree = SYSCTL_ADD_NODE(&vo->vo_sysctl_ctx, SYSCTL_CHILDREN(acpi_video_sysctl_tree), - OID_AUTO, name, CTLFLAG_RD, 0, desc); + OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, desc); if (vo->vo_sysctl_tree != NULL) { SYSCTL_ADD_PROC(&vo->vo_sysctl_ctx, SYSCTL_CHILDREN(vo->vo_sysctl_tree), OID_AUTO, "active", - CTLTYPE_INT|CTLFLAG_RW, vo, 0, - acpi_video_vo_active_sysctl, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vo, + 0, acpi_video_vo_active_sysctl, "I", "current activity of this device"); SYSCTL_ADD_PROC(&vo->vo_sysctl_ctx, SYSCTL_CHILDREN(vo->vo_sysctl_tree), OID_AUTO, "brightness", - CTLTYPE_INT|CTLFLAG_RW, vo, 0, - acpi_video_vo_bright_sysctl, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vo, + 0, acpi_video_vo_bright_sysctl, "I", "current brightness level"); SYSCTL_ADD_PROC(&vo->vo_sysctl_ctx, SYSCTL_CHILDREN(vo->vo_sysctl_tree), OID_AUTO, "fullpower", - CTLTYPE_INT|CTLFLAG_RW, vo, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vo, POWER_PROFILE_PERFORMANCE, acpi_video_vo_presets_sysctl, "I", "preset level for full power mode"); SYSCTL_ADD_PROC(&vo->vo_sysctl_ctx, SYSCTL_CHILDREN(vo->vo_sysctl_tree), OID_AUTO, "economy", - CTLTYPE_INT|CTLFLAG_RW, vo, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vo, POWER_PROFILE_ECONOMY, acpi_video_vo_presets_sysctl, "I", "preset level for economy mode"); SYSCTL_ADD_PROC(&vo->vo_sysctl_ctx, SYSCTL_CHILDREN(vo->vo_sysctl_tree), OID_AUTO, "levels", - CTLTYPE_INT | CTLFLAG_RD, vo, 0, - acpi_video_vo_levels_sysctl, "I", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, vo, + 0, acpi_video_vo_levels_sysctl, "I", "supported brightness levels"); } else printf("%s: sysctl node creation failed\n", type); Index: sys/dev/adb/adb_kbd.c =================================================================== --- sys/dev/adb/adb_kbd.c +++ sys/dev/adb/adb_kbd.c @@ -370,7 +370,8 @@ tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "fn_keys_function_as_primary", CTLTYPE_INT | CTLFLAG_RW, sc, + "fn_keys_function_as_primary", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, adb_fn_keys, "I", "Set the Fn keys to be their F-key type as default"); } Index: sys/dev/adb/adb_mouse.c =================================================================== --- sys/dev/adb/adb_mouse.c +++ sys/dev/adb/adb_mouse.c @@ -330,8 +330,8 @@ ctx = device_get_sysctl_ctx(dev); tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "tapping", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, adb_tapping_sysctl, - "I", "Tapping the pad causes button events"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + adb_tapping_sysctl, "I", "Tapping the pad causes button events"); return; } Index: sys/dev/ae/if_ae.c =================================================================== --- sys/dev/ae/if_ae.c +++ sys/dev/ae/if_ae.c @@ -419,13 +419,13 @@ ctx = device_get_sysctl_ctx(sc->dev); root = device_get_sysctl_tree(sc->dev); stats = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(root), OID_AUTO, "stats", - CTLFLAG_RD, NULL, "ae statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ae statistics"); /* * Receiver statistcics. */ stats_rx = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(stats), OID_AUTO, "rx", - CTLFLAG_RD, NULL, "Rx MAC statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Rx MAC statistics"); AE_SYSCTL(ctx, SYSCTL_CHILDREN(stats_rx), "bcast", "broadcast frames", &ae_stats->rx_bcast); AE_SYSCTL(ctx, SYSCTL_CHILDREN(stats_rx), "mcast", @@ -451,7 +451,7 @@ * Receiver statistcics. */ stats_tx = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(stats), OID_AUTO, "tx", - CTLFLAG_RD, NULL, "Tx MAC statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx MAC statistics"); AE_SYSCTL(ctx, SYSCTL_CHILDREN(stats_tx), "bcast", "broadcast frames", &ae_stats->tx_bcast); AE_SYSCTL(ctx, SYSCTL_CHILDREN(stats_tx), "mcast", Index: sys/dev/age/if_age.c =================================================================== --- sys/dev/age/if_age.c +++ sys/dev/age/if_age.c @@ -749,13 +749,14 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->age_dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->age_dev)), OID_AUTO, - "stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_age_stats, - "I", "Statistics"); + "stats", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, 0, sysctl_age_stats, "I", "Statistics"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->age_dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->age_dev)), OID_AUTO, - "int_mod", CTLTYPE_INT | CTLFLAG_RW, &sc->age_int_mod, 0, - sysctl_hw_age_int_mod, "I", "age interrupt moderation"); + "int_mod", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &sc->age_int_mod, 0, sysctl_hw_age_int_mod, "I", + "age interrupt moderation"); /* Pull in device tunables. */ sc->age_int_mod = AGE_IM_TIMER_DEFAULT; @@ -773,8 +774,8 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->age_dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->age_dev)), OID_AUTO, - "process_limit", CTLTYPE_INT | CTLFLAG_RW, &sc->age_process_limit, - 0, sysctl_hw_age_proc_limit, "I", + "process_limit", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &sc->age_process_limit, 0, sysctl_hw_age_proc_limit, "I", "max number of Rx events to process"); /* Pull in device tunables. */ Index: sys/dev/ahci/ahci.c =================================================================== --- sys/dev/ahci/ahci.c +++ sys/dev/ahci/ahci.c @@ -904,8 +904,8 @@ ctx = device_get_sysctl_ctx(dev); tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "disable_phy", - CTLFLAG_RW | CTLTYPE_UINT, ch, 0, ahci_ch_disablephy_proc, "IU", - "Disable PHY"); + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, ch, + 0, ahci_ch_disablephy_proc, "IU", "Disable PHY"); return (0); err3: Index: sys/dev/aic7xxx/aic79xx_osm.c =================================================================== --- sys/dev/aic7xxx/aic79xx_osm.c +++ sys/dev/aic7xxx/aic79xx_osm.c @@ -159,22 +159,22 @@ ahd->sysctl_tree[AHD_SYSCTL_ROOT] = SYSCTL_ADD_NODE(&ahd->sysctl_ctx[AHD_SYSCTL_ROOT], - SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, - device_get_nameunit(ahd->dev_softc), CTLFLAG_RD, 0, - ahd_sysctl_node_descriptions[AHD_SYSCTL_ROOT]); + SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, + device_get_nameunit(ahd->dev_softc), + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + ahd_sysctl_node_descriptions[AHD_SYSCTL_ROOT]); SYSCTL_ADD_PROC(&ahd->sysctl_ctx[AHD_SYSCTL_ROOT], - SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_ROOT]), - OID_AUTO, "clear", CTLTYPE_UINT | CTLFLAG_RW, ahd, - 0, ahd_clear_allcounters, "IU", - "Clear all counters"); + SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_ROOT]), OID_AUTO, + "clear", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, ahd, + 0, ahd_clear_allcounters, "IU", "Clear all counters"); for (i = AHD_SYSCTL_SUMMARY; i < AHD_SYSCTL_NUMBER; i++) ahd->sysctl_tree[i] = SYSCTL_ADD_NODE(&ahd->sysctl_ctx[i], - SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_ROOT]), - OID_AUTO, ahd_sysctl_node_elements[i], - CTLFLAG_RD, 0, - ahd_sysctl_node_descriptions[i]); + SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_ROOT]), + OID_AUTO, ahd_sysctl_node_elements[i], + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + ahd_sysctl_node_descriptions[i]); for (i = AHD_ERRORS_CORRECTABLE; i < AHD_ERRORS_NUMBER; i++) { SYSCTL_ADD_UINT(&ahd->sysctl_ctx[AHD_SYSCTL_SUMMARY], @@ -183,11 +183,11 @@ CTLFLAG_RD, &ahd->summerr[i], i, ahd_sysctl_errors_descriptions[i]); SYSCTL_ADD_PROC(&ahd->sysctl_ctx[AHD_SYSCTL_DEBUG], - SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_DEBUG]), - OID_AUTO, ahd_sysctl_errors_elements[i], - CTLFLAG_RW | CTLTYPE_UINT, ahd, i, - ahd_set_debugcounters, "IU", - ahd_sysctl_errors_descriptions[i]); + SYSCTL_CHILDREN(ahd->sysctl_tree[AHD_SYSCTL_DEBUG]), + OID_AUTO, ahd_sysctl_errors_elements[i], + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, ahd, i, + ahd_set_debugcounters, "IU", + ahd_sysctl_errors_descriptions[i]); } } Index: sys/dev/alc/if_alc.c =================================================================== --- sys/dev/alc/if_alc.c +++ sys/dev/alc/if_alc.c @@ -1747,11 +1747,11 @@ child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->alc_dev)); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_rx_mod", - CTLTYPE_INT | CTLFLAG_RW, &sc->alc_int_rx_mod, 0, - sysctl_hw_alc_int_mod, "I", "alc Rx interrupt moderation"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->alc_int_rx_mod, + 0, sysctl_hw_alc_int_mod, "I", "alc Rx interrupt moderation"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_tx_mod", - CTLTYPE_INT | CTLFLAG_RW, &sc->alc_int_tx_mod, 0, - sysctl_hw_alc_int_mod, "I", "alc Tx interrupt moderation"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->alc_int_tx_mod, + 0, sysctl_hw_alc_int_mod, "I", "alc Tx interrupt moderation"); /* Pull in device tunables. */ sc->alc_int_rx_mod = ALC_IM_RX_TIMER_DEFAULT; error = resource_int_value(device_get_name(sc->alc_dev), @@ -1778,8 +1778,8 @@ } } SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", - CTLTYPE_INT | CTLFLAG_RW, &sc->alc_process_limit, 0, - sysctl_hw_alc_proc_limit, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &sc->alc_process_limit, 0, sysctl_hw_alc_proc_limit, "I", "max number of Rx events to process"); /* Pull in device tunables. */ sc->alc_process_limit = ALC_PROC_DEFAULT; @@ -1796,13 +1796,13 @@ } } - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "ALC statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ALC statistics"); parent = SYSCTL_CHILDREN(tree); /* Rx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "Rx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Rx MAC statistics"); child = SYSCTL_CHILDREN(tree); ALC_SYSCTL_STAT_ADD32(ctx, child, "good_frames", &stats->rx_frames, "Good frames"); @@ -1855,8 +1855,8 @@ "Frames dropped due to address filtering"); /* Tx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "Tx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx MAC statistics"); child = SYSCTL_CHILDREN(tree); ALC_SYSCTL_STAT_ADD32(ctx, child, "good_frames", &stats->tx_frames, "Good frames"); Index: sys/dev/ale/if_ale.c =================================================================== --- sys/dev/ale/if_ale.c +++ sys/dev/ale/if_ale.c @@ -792,11 +792,11 @@ child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ale_dev)); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_rx_mod", - CTLTYPE_INT | CTLFLAG_RW, &sc->ale_int_rx_mod, 0, - sysctl_hw_ale_int_mod, "I", "ale Rx interrupt moderation"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->ale_int_rx_mod, + 0, sysctl_hw_ale_int_mod, "I", "ale Rx interrupt moderation"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_tx_mod", - CTLTYPE_INT | CTLFLAG_RW, &sc->ale_int_tx_mod, 0, - sysctl_hw_ale_int_mod, "I", "ale Tx interrupt moderation"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->ale_int_tx_mod, + 0, sysctl_hw_ale_int_mod, "I", "ale Tx interrupt moderation"); /* Pull in device tunables. */ sc->ale_int_rx_mod = ALE_IM_RX_TIMER_DEFAULT; error = resource_int_value(device_get_name(sc->ale_dev), @@ -823,8 +823,8 @@ } } SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", - CTLTYPE_INT | CTLFLAG_RW, &sc->ale_process_limit, 0, - sysctl_hw_ale_proc_limit, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &sc->ale_process_limit, 0, sysctl_hw_ale_proc_limit, "I", "max number of Rx events to process"); /* Pull in device tunables. */ sc->ale_process_limit = ALE_PROC_DEFAULT; @@ -846,13 +846,13 @@ &stats->reset_brk_seq, "Controller resets due to broken Rx sequnce number"); - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "ATE statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ATE statistics"); parent = SYSCTL_CHILDREN(tree); /* Rx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "Rx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Rx MAC statistics"); child = SYSCTL_CHILDREN(tree); ALE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", &stats->rx_frames, "Good frames"); @@ -905,8 +905,8 @@ "Frames dropped due to address filtering"); /* Tx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "Tx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx MAC statistics"); child = SYSCTL_CHILDREN(tree); ALE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", &stats->tx_frames, "Good frames"); Index: sys/dev/altera/atse/if_atse.c =================================================================== --- sys/dev/altera/atse/if_atse.c +++ sys/dev/altera/atse/if_atse.c @@ -1237,7 +1237,8 @@ } SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, - atse_mac_stats_regs[i].name, CTLTYPE_UINT|CTLFLAG_RD, + atse_mac_stats_regs[i].name, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, i, sysctl_atse_mac_stats_proc, "IU", atse_mac_stats_regs[i].descr); } @@ -1250,7 +1251,8 @@ } SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, - atse_rx_err_stats_regs[i].name, CTLTYPE_UINT|CTLFLAG_RD, + atse_rx_err_stats_regs[i].name, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, i, sysctl_atse_rx_err_stats_proc, "IU", atse_rx_err_stats_regs[i].descr); } Index: sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c =================================================================== --- sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c +++ sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c @@ -52,7 +52,8 @@ devclass_t altera_jtag_uart_devclass; -static SYSCTL_NODE(_hw, OID_AUTO, altera_jtag_uart, CTLFLAG_RW, 0, +static SYSCTL_NODE(_hw, OID_AUTO, altera_jtag_uart, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Altera JTAG UART configuration knobs"); /* Index: sys/dev/amd_ecc_inject/ecc_inject.c =================================================================== --- sys/dev/amd_ecc_inject/ecc_inject.c +++ sys/dev/amd_ecc_inject/ecc_inject.c @@ -125,24 +125,26 @@ return (0); } -static SYSCTL_NODE(_hw, OID_AUTO, error_injection, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_hw, OID_AUTO, error_injection, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Hardware error injection"); -static SYSCTL_NODE(_hw_error_injection, OID_AUTO, dram_ecc, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_hw_error_injection, OID_AUTO, dram_ecc, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "DRAM ECC error injection"); SYSCTL_UINT(_hw_error_injection_dram_ecc, OID_AUTO, delay, CTLTYPE_UINT | CTLFLAG_RW, &delay_ms, 0, "Delay in milliseconds between error injections"); SYSCTL_PROC(_hw_error_injection_dram_ecc, OID_AUTO, quadrant, - CTLTYPE_UINT | CTLFLAG_RW, &quadrant, QUADRANT_MASK, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &quadrant, QUADRANT_MASK, sysctl_int_with_max, "IU", "Index of 16-byte quadrant within 64-byte line where errors " "should be injected"); SYSCTL_PROC(_hw_error_injection_dram_ecc, OID_AUTO, word_mask, - CTLTYPE_UINT | CTLFLAG_RW, &word_mask, INJ_WORD_MASK, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &word_mask, INJ_WORD_MASK, sysctl_nonzero_int_with_max, "IU", "9-bit mask of words where errors should be injected (8 data + 1 ECC)"); SYSCTL_PROC(_hw_error_injection_dram_ecc, OID_AUTO, bit_mask, - CTLTYPE_UINT | CTLFLAG_RW, &bit_mask, INJ_VECTOR_MASK, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &bit_mask, INJ_VECTOR_MASK, sysctl_nonzero_int_with_max, "IU", "16-bit mask of bits within each selected word where errors " "should be injected"); Index: sys/dev/amdtemp/amdtemp.c =================================================================== --- sys/dev/amdtemp/amdtemp.c +++ sys/dev/amdtemp/amdtemp.c @@ -496,11 +496,12 @@ "Temperature sensor offset"); sysctlnode = SYSCTL_ADD_NODE(sysctlctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "core0", CTLFLAG_RD, 0, "Core 0"); + "core0", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Core 0"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), - OID_AUTO, "sensor0", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "sensor0", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, CORE0_SENSOR0, amdtemp_sysctl, "IK", "Core 0 / Sensor 0 temperature"); @@ -509,24 +510,28 @@ else if (sc->sc_ntemps > 1) { SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), - OID_AUTO, "sensor1", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "sensor1", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, CORE0_SENSOR1, amdtemp_sysctl, "IK", "Core 0 / Sensor 1 temperature"); if (sc->sc_ncores > 1) { sysctlnode = SYSCTL_ADD_NODE(sysctlctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "core1", CTLFLAG_RD, 0, "Core 1"); + OID_AUTO, "core1", CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, "Core 1"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), - OID_AUTO, "sensor0", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "sensor0", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, CORE1_SENSOR0, amdtemp_sysctl, "IK", "Core 1 / Sensor 0 temperature"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sysctlnode), - OID_AUTO, "sensor1", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "sensor1", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, CORE1_SENSOR1, amdtemp_sysctl, "IK", "Core 1 / Sensor 1 temperature"); } @@ -578,7 +583,8 @@ (i == 0 ? CORE0 : CORE1) : CORE0_SENSOR0; sc->sc_sysctl_cpu[i] = SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(device_get_sysctl_tree(cpu)), - OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "temperature", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, sensor, amdtemp_sysctl, "IK", "Current temparature"); } Index: sys/dev/amr/amr.c =================================================================== --- sys/dev/amr/amr.c +++ sys/dev/amr/amr.c @@ -90,7 +90,8 @@ #define AMR_DEFINE_TABLES #include -SYSCTL_NODE(_hw, OID_AUTO, amr, CTLFLAG_RD, 0, "AMR driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, amr, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "AMR driver parameters"); static d_open_t amr_open; static d_close_t amr_close; Index: sys/dev/an/if_an.c =================================================================== --- sys/dev/an/if_an.c +++ sys/dev/an/if_an.c @@ -206,7 +206,7 @@ /* sysctl vars */ -static SYSCTL_NODE(_hw, OID_AUTO, an, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw, OID_AUTO, an, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Wireless driver parameters"); /* XXX violate ethernet/netgraph callback hooks */ @@ -266,8 +266,10 @@ return error; } -SYSCTL_PROC(_hw_an, OID_AUTO, an_dump, CTLTYPE_STRING | CTLFLAG_RW, - 0, sizeof(an_conf), sysctl_an_dump, "A", ""); +SYSCTL_PROC(_hw_an, OID_AUTO, an_dump, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(an_conf), + sysctl_an_dump, "A", + ""); static int sysctl_an_cache_mode(SYSCTL_HANDLER_ARGS) @@ -302,8 +304,10 @@ return error; } -SYSCTL_PROC(_hw_an, OID_AUTO, an_cache_mode, CTLTYPE_STRING | CTLFLAG_RW, - 0, sizeof(an_conf_cache), sysctl_an_cache_mode, "A", ""); +SYSCTL_PROC(_hw_an, OID_AUTO, an_cache_mode, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(an_conf_cache), + sysctl_an_cache_mode, "A", + ""); /* * We probe for an Aironet 4500/4800 card by attempting to Index: sys/dev/asmc/asmc.c =================================================================== --- sys/dev/asmc/asmc.c +++ sys/dev/asmc/asmc.c @@ -490,7 +490,7 @@ */ sc->sc_fan_tree[0] = SYSCTL_ADD_NODE(sysctlctx, SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "fan", - CTLFLAG_RD, 0, "Fan Root Tree"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Fan Root Tree"); for (i = 1; i <= sc->sc_nfan; i++) { j = i - 1; @@ -498,46 +498,48 @@ name[1] = 0; sc->sc_fan_tree[i] = SYSCTL_ADD_NODE(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[0]), - OID_AUTO, name, CTLFLAG_RD, 0, + OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Fan Subtree"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), - OID_AUTO, "id", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "id", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, j, model->smc_fan_id, "I", "Fan ID"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), - OID_AUTO, "speed", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "speed", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, j, model->smc_fan_speed, "I", "Fan speed in RPM"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "safespeed", - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, j, model->smc_fan_safespeed, "I", "Fan safe speed in RPM"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "minspeed", - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, dev, j, model->smc_fan_minspeed, "I", "Fan minimum speed in RPM"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "maxspeed", - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, dev, j, model->smc_fan_maxspeed, "I", "Fan maximum speed in RPM"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_fan_tree[i]), OID_AUTO, "targetspeed", - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, dev, j, model->smc_fan_targetspeed, "I", "Fan target speed in RPM"); } @@ -547,13 +549,13 @@ */ sc->sc_temp_tree = SYSCTL_ADD_NODE(sysctlctx, SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "temp", - CTLFLAG_RD, 0, "Temperature sensors"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Temperature sensors"); for (i = 0; model->smc_temps[i]; i++) { SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_temp_tree), OID_AUTO, model->smc_tempnames[i], - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, i, asmc_temp_sysctl, "I", model->smc_tempdescs[i]); } @@ -564,25 +566,29 @@ if (model->smc_light_left) { sc->sc_light_tree = SYSCTL_ADD_NODE(sysctlctx, SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "light", - CTLFLAG_RD, 0, "Keyboard backlight sensors"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Keyboard backlight sensors"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_light_tree), - OID_AUTO, "left", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "left", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, 0, model->smc_light_left, "I", "Keyboard backlight left sensor"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_light_tree), - OID_AUTO, "right", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "right", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, 0, model->smc_light_right, "I", "Keyboard backlight right sensor"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_light_tree), OID_AUTO, "control", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY, - dev, 0, model->smc_light_control, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | + CTLFLAG_NEEDGIANT, dev, 0, + model->smc_light_control, "I", "Keyboard backlight brightness control"); } @@ -594,23 +600,26 @@ */ sc->sc_sms_tree = SYSCTL_ADD_NODE(sysctlctx, SYSCTL_CHILDREN(sysctlnode), OID_AUTO, "sms", - CTLFLAG_RD, 0, "Sudden Motion Sensor"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Sudden Motion Sensor"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_sms_tree), - OID_AUTO, "x", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "x", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, 0, model->smc_sms_x, "I", "Sudden Motion Sensor X value"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_sms_tree), - OID_AUTO, "y", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "y", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, 0, model->smc_sms_y, "I", "Sudden Motion Sensor Y value"); SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(sc->sc_sms_tree), - OID_AUTO, "z", CTLTYPE_INT | CTLFLAG_RD, + OID_AUTO, "z", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, 0, model->smc_sms_z, "I", "Sudden Motion Sensor Z value"); Index: sys/dev/ata/ata-all.c =================================================================== --- sys/dev/ata/ata-all.c +++ sys/dev/ata/ata-all.c @@ -78,7 +78,8 @@ int ata_dma_check_80pin = 1; /* sysctl vars */ -static SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "ATA driver parameters"); SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma_check_80pin, CTLFLAG_RWTUN, &ata_dma_check_80pin, 0, "Check for 80pin cable before setting ATA DMA mode"); Index: sys/dev/atkbdc/psm.c =================================================================== --- sys/dev/atkbdc/psm.c +++ sys/dev/atkbdc/psm.c @@ -2943,8 +2943,10 @@ } /* Add all sysctls under the debug.psm and hw.psm nodes */ -static SYSCTL_NODE(_debug, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse"); -static SYSCTL_NODE(_hw, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse"); +static SYSCTL_NODE(_debug, OID_AUTO, psm, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "ps/2 mouse"); +static SYSCTL_NODE(_hw, OID_AUTO, psm, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "ps/2 mouse"); SYSCTL_INT(_debug_psm, OID_AUTO, loglevel, CTLFLAG_RWTUN, &verbose, 0, "Verbosity level"); @@ -5800,7 +5802,8 @@ sc->syninfo.softbuttons_y = sc->synhw.topButtonPad ? -1700 : 1700; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "softbuttons_y", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "softbuttons_y", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_SOFTBUTTONS_Y, synaptics_sysctl, "I", "Vertical size of softbuttons area"); @@ -5809,7 +5812,8 @@ sc->syninfo.softbutton2_x = 3100; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "softbutton2_x", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "softbutton2_x", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_SOFTBUTTON2_X, synaptics_sysctl, "I", "Horisontal position of 2-nd softbutton left edge (0-disable)"); @@ -5818,7 +5822,8 @@ sc->syninfo.softbutton3_x = 3900; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "softbutton3_x", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "softbutton3_x", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_SOFTBUTTON3_X, synaptics_sysctl, "I", "Horisontal position of 3-rd softbutton left edge (0-disable)"); @@ -5835,8 +5840,8 @@ /* Attach extra synaptics sysctl nodes under hw.psm.synaptics */ sysctl_ctx_init(&sc->syninfo.sysctl_ctx); sc->syninfo.sysctl_tree = SYSCTL_ADD_NODE(&sc->syninfo.sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_hw_psm), OID_AUTO, name, CTLFLAG_RD, - 0, descr); + SYSCTL_STATIC_CHILDREN(_hw_psm), OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, descr); /* hw.psm.synaptics.directional_scrolls. */ sc->syninfo.directional_scrolls = 0; @@ -5884,7 +5889,8 @@ sc->syninfo.min_pressure = 32; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "min_pressure", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "min_pressure", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_MIN_PRESSURE, synaptics_sysctl, "I", "Minimum pressure required to start an action"); @@ -5893,7 +5899,8 @@ sc->syninfo.max_pressure = 220; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "max_pressure", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "max_pressure", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_MAX_PRESSURE, synaptics_sysctl, "I", "Maximum pressure to detect palm"); @@ -5902,7 +5909,8 @@ sc->syninfo.max_width = 10; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "max_width", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "max_width", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_MAX_WIDTH, synaptics_sysctl, "I", "Maximum finger width to detect palm"); @@ -5911,7 +5919,8 @@ sc->syninfo.margin_top = 200; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "margin_top", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "margin_top", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_MARGIN_TOP, synaptics_sysctl, "I", "Top margin"); @@ -5920,7 +5929,8 @@ sc->syninfo.margin_right = 200; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "margin_right", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "margin_right", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_MARGIN_RIGHT, synaptics_sysctl, "I", "Right margin"); @@ -5929,7 +5939,8 @@ sc->syninfo.margin_bottom = 200; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "margin_bottom", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "margin_bottom", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_MARGIN_BOTTOM, synaptics_sysctl, "I", "Bottom margin"); @@ -5938,7 +5949,8 @@ sc->syninfo.margin_left = 200; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "margin_left", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "margin_left", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_MARGIN_LEFT, synaptics_sysctl, "I", "Left margin"); @@ -5947,7 +5959,8 @@ sc->syninfo.na_top = 1783; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "na_top", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "na_top", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_NA_TOP, synaptics_sysctl, "I", "Top noisy area, where weight_previous_na is used instead " @@ -5957,7 +5970,8 @@ sc->syninfo.na_right = 563; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "na_right", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "na_right", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_NA_RIGHT, synaptics_sysctl, "I", "Right noisy area, where weight_previous_na is used instead " @@ -5967,7 +5981,8 @@ sc->syninfo.na_bottom = 1408; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "na_bottom", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "na_bottom", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_NA_BOTTOM, synaptics_sysctl, "I", "Bottom noisy area, where weight_previous_na is used instead " @@ -5977,7 +5992,8 @@ sc->syninfo.na_left = 1600; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "na_left", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "na_left", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_NA_LEFT, synaptics_sysctl, "I", "Left noisy area, where weight_previous_na is used instead " @@ -5987,7 +6003,8 @@ sc->syninfo.window_min = 4; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "window_min", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "window_min", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_WINDOW_MIN, synaptics_sysctl, "I", "Minimum window size to start an action"); @@ -5996,7 +6013,8 @@ sc->syninfo.window_max = 10; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "window_max", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "window_max", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_WINDOW_MAX, synaptics_sysctl, "I", "Maximum window size"); @@ -6005,7 +6023,8 @@ sc->syninfo.multiplicator = 10000; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "multiplicator", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "multiplicator", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_MULTIPLICATOR, synaptics_sysctl, "I", "Multiplicator to increase precision in averages and divisions"); @@ -6014,7 +6033,8 @@ sc->syninfo.weight_current = 3; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "weight_current", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "weight_current", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_WEIGHT_CURRENT, synaptics_sysctl, "I", "Weight of the current movement in the new average"); @@ -6023,7 +6043,8 @@ sc->syninfo.weight_previous = 6; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "weight_previous", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "weight_previous", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_WEIGHT_PREVIOUS, synaptics_sysctl, "I", "Weight of the previous average"); @@ -6032,7 +6053,8 @@ sc->syninfo.weight_previous_na = 20; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "weight_previous_na", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "weight_previous_na", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_WEIGHT_PREVIOUS_NA, synaptics_sysctl, "I", "Weight of the previous average (inside the noisy area)"); @@ -6041,7 +6063,8 @@ sc->syninfo.weight_len_squared = 2000; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "weight_len_squared", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "weight_len_squared", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_WEIGHT_LEN_SQUARED, synaptics_sysctl, "I", "Length (squared) of segments where weight_previous " @@ -6051,7 +6074,8 @@ sc->syninfo.div_min = 9; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "div_min", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "div_min", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_DIV_MIN, synaptics_sysctl, "I", "Divisor for fast movements"); @@ -6060,7 +6084,8 @@ sc->syninfo.div_max = 17; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "div_max", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "div_max", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_DIV_MAX, synaptics_sysctl, "I", "Divisor for slow movements"); @@ -6069,7 +6094,8 @@ sc->syninfo.div_max_na = 30; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "div_max_na", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "div_max_na", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_DIV_MAX_NA, synaptics_sysctl, "I", "Divisor with slow movements (inside the noisy area)"); @@ -6078,7 +6104,8 @@ sc->syninfo.div_len = 100; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "div_len", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "div_len", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_DIV_LEN, synaptics_sysctl, "I", "Length of segments where div_max starts to decrease"); @@ -6087,7 +6114,8 @@ sc->syninfo.tap_max_delta = 80; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "tap_max_delta", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "tap_max_delta", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_TAP_MAX_DELTA, synaptics_sysctl, "I", "Length of segments above which a tap is ignored"); @@ -6096,7 +6124,8 @@ sc->syninfo.tap_min_queue = 2; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "tap_min_queue", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "tap_min_queue", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_TAP_MIN_QUEUE, synaptics_sysctl, "I", "Number of packets required to consider a tap"); @@ -6106,7 +6135,8 @@ sc->syninfo.taphold_timeout = tap_timeout; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "taphold_timeout", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "taphold_timeout", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_TAPHOLD_TIMEOUT, synaptics_sysctl, "I", "Maximum elapsed time between two taps to consider a tap-hold " @@ -6116,7 +6146,8 @@ sc->syninfo.vscroll_hor_area = 0; /* 1300 */ SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "vscroll_hor_area", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "vscroll_hor_area", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_VSCROLL_HOR_AREA, synaptics_sysctl, "I", "Area reserved for horizontal virtual scrolling"); @@ -6125,7 +6156,8 @@ sc->syninfo.vscroll_ver_area = -400 - sc->syninfo.margin_right; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "vscroll_ver_area", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "vscroll_ver_area", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_VSCROLL_VER_AREA, synaptics_sysctl, "I", "Area reserved for vertical virtual scrolling"); @@ -6134,7 +6166,8 @@ sc->syninfo.vscroll_min_delta = 50; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "vscroll_min_delta", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "vscroll_min_delta", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_VSCROLL_MIN_DELTA, synaptics_sysctl, "I", "Minimum movement to consider virtual scrolling"); @@ -6143,7 +6176,8 @@ sc->syninfo.vscroll_div_min = 100; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "vscroll_div_min", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "vscroll_div_min", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_VSCROLL_DIV_MIN, synaptics_sysctl, "I", "Divisor for fast scrolling"); @@ -6152,7 +6186,8 @@ sc->syninfo.vscroll_div_max = 150; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "vscroll_div_max", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "vscroll_div_max", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_VSCROLL_DIV_MAX, synaptics_sysctl, "I", "Divisor for slow scrolling"); @@ -6161,7 +6196,8 @@ sc->syninfo.touchpad_off = 0; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "touchpad_off", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "touchpad_off", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_TOUCHPAD_OFF, synaptics_sysctl, "I", "Turn off touchpad"); @@ -6169,7 +6205,8 @@ sc->syninfo.three_finger_drag = 0; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "three_finger_drag", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "three_finger_drag", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_THREE_FINGER_DRAG, synaptics_sysctl, "I", "Enable dragging with three fingers"); @@ -6178,7 +6215,8 @@ sc->syninfo.natural_scroll = 0; SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, - "natural_scroll", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "natural_scroll", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, SYNAPTICS_SYSCTL_NATURAL_SCROLL, synaptics_sysctl, "I", "Enable natural scrolling"); @@ -6763,14 +6801,15 @@ /* Attach extra trackpoint sysctl nodes under hw.psm.trackpoint */ sysctl_ctx_init(&sc->tpinfo.sysctl_ctx); sc->tpinfo.sysctl_tree = SYSCTL_ADD_NODE(&sc->tpinfo.sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_hw_psm), OID_AUTO, "trackpoint", CTLFLAG_RD, - 0, "IBM/Lenovo TrackPoint"); + SYSCTL_STATIC_CHILDREN(_hw_psm), OID_AUTO, "trackpoint", + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "IBM/Lenovo TrackPoint"); /* hw.psm.trackpoint.sensitivity */ sc->tpinfo.sensitivity = 0x80; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "sensitivity", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "sensitivity", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_SENSITIVITY, trackpoint_sysctl, "I", "Sensitivity"); @@ -6779,7 +6818,8 @@ sc->tpinfo.inertia = 0x06; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "negative_inertia", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "negative_inertia", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_NEGATIVE_INERTIA, trackpoint_sysctl, "I", "Negative inertia factor"); @@ -6788,7 +6828,8 @@ sc->tpinfo.uplateau = 0x61; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "upper_plateau", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "upper_plateau", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_UPPER_PLATEAU, trackpoint_sysctl, "I", "Transfer function upper plateau speed"); @@ -6797,7 +6838,8 @@ sc->tpinfo.reach = 0x0a; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "backup_range", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "backup_range", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_BACKUP_RANGE, trackpoint_sysctl, "I", "Backup range"); @@ -6806,7 +6848,8 @@ sc->tpinfo.draghys = 0xff; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "drag_hysteresis", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "drag_hysteresis", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_DRAG_HYSTERESIS, trackpoint_sysctl, "I", "Drag hysteresis"); @@ -6815,7 +6858,8 @@ sc->tpinfo.mindrag = 0x14; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "minimum_drag", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "minimum_drag", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_MINIMUM_DRAG, trackpoint_sysctl, "I", "Minimum drag"); @@ -6824,7 +6868,8 @@ sc->tpinfo.upthresh = 0xff; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "up_threshold", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "up_threshold", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_UP_THRESHOLD, trackpoint_sysctl, "I", "Up threshold for release"); @@ -6833,7 +6878,8 @@ sc->tpinfo.threshold = 0x08; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "threshold", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "threshold", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_THRESHOLD, trackpoint_sysctl, "I", "Threshold"); @@ -6842,7 +6888,8 @@ sc->tpinfo.jenks = 0x87; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "jenks_curvature", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "jenks_curvature", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_JENKS_CURVATURE, trackpoint_sysctl, "I", "Jenks curvature"); @@ -6851,7 +6898,8 @@ sc->tpinfo.ztime = 0x26; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "z_time", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "z_time", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_Z_TIME, trackpoint_sysctl, "I", "Z time constant"); @@ -6860,7 +6908,8 @@ sc->tpinfo.pts = 0x00; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "press_to_select", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "press_to_select", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_PRESS_TO_SELECT, trackpoint_sysctl, "I", "Press to Select"); @@ -6869,7 +6918,8 @@ sc->tpinfo.skipback = 0x00; SYSCTL_ADD_PROC(&sc->tpinfo.sysctl_ctx, SYSCTL_CHILDREN(sc->tpinfo.sysctl_tree), OID_AUTO, - "skip_backups", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + "skip_backups", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, sc, TRACKPOINT_SYSCTL_SKIP_BACKUPS, trackpoint_sysctl, "I", "Skip backups from drags"); Index: sys/dev/bce/if_bce.c =================================================================== --- sys/dev/bce/if_bce.c +++ sys/dev/bce/if_bce.c @@ -535,7 +535,8 @@ /****************************************************************************/ /* Tunable device values */ /****************************************************************************/ -static SYSCTL_NODE(_hw, OID_AUTO, bce, CTLFLAG_RD, 0, "bce driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, bce, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "bce driver parameters"); /* Allowable values are TRUE or FALSE */ static int bce_verbose = TRUE; @@ -9299,13 +9300,13 @@ } SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "nvram_dump", CTLTYPE_OPAQUE | CTLFLAG_RD, + "nvram_dump", CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_nvram_dump, "S", ""); #ifdef BCE_NVRAM_WRITE_SUPPORT SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "nvram_write", CTLTYPE_OPAQUE | CTLFLAG_WR, + "nvram_write", CTLTYPE_OPAQUE | CTLFLAG_WR | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_nvram_write, "S", ""); #endif @@ -9590,84 +9591,85 @@ #ifdef BCE_DEBUG SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "driver_state", CTLTYPE_INT | CTLFLAG_RW, + "driver_state", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_driver_state, "I", "Drive state information"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "hw_state", CTLTYPE_INT | CTLFLAG_RW, + "hw_state", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_hw_state, "I", "Hardware state information"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "status_block", CTLTYPE_INT | CTLFLAG_RW, + "status_block", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_status_block, "I", "Dump status block"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "stats_block", CTLTYPE_INT | CTLFLAG_RW, + "stats_block", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_stats_block, "I", "Dump statistics block"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "stats_clear", CTLTYPE_INT | CTLFLAG_RW, + "stats_clear", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_stats_clear, "I", "Clear statistics block"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "shmem_state", CTLTYPE_INT | CTLFLAG_RW, + "shmem_state", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_shmem_state, "I", "Shared memory state information"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "bc_state", CTLTYPE_INT | CTLFLAG_RW, + "bc_state", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_bc_state, "I", "Bootcode state information"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dump_rx_bd_chain", CTLTYPE_INT | CTLFLAG_RW, + "dump_rx_bd_chain", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_dump_rx_bd_chain, "I", "Dump RX BD chain"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dump_rx_mbuf_chain", CTLTYPE_INT | CTLFLAG_RW, + "dump_rx_mbuf_chain", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_dump_rx_mbuf_chain, "I", "Dump RX MBUF chain"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dump_tx_chain", CTLTYPE_INT | CTLFLAG_RW, + "dump_tx_chain", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_dump_tx_chain, "I", "Dump tx_bd chain"); if (bce_hdr_split == TRUE) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dump_pg_chain", CTLTYPE_INT | CTLFLAG_RW, + "dump_pg_chain", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_dump_pg_chain, "I", "Dump page chain"); } SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dump_ctx", CTLTYPE_INT | CTLFLAG_RW, + "dump_ctx", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_dump_ctx, "I", "Dump context memory"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "breakpoint", CTLTYPE_INT | CTLFLAG_RW, + "breakpoint", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_breakpoint, "I", "Driver breakpoint"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "reg_read", CTLTYPE_INT | CTLFLAG_RW, + "reg_read", CTLTYPE_INT | CTLFLAG_RW| CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_reg_read, "I", "Register read"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "nvram_read", CTLTYPE_INT | CTLFLAG_RW, + "nvram_read", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_nvram_read, "I", "NVRAM read"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "phy_read", CTLTYPE_INT | CTLFLAG_RW, + "phy_read", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, bce_sysctl_phy_read, "I", "PHY register read"); Index: sys/dev/bfe/if_bfe.c =================================================================== --- sys/dev/bfe/if_bfe.c +++ sys/dev/bfe/if_bfe.c @@ -478,8 +478,8 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_bfe_stats, - "I", "Statistics"); + "stats", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_bfe_stats, "I", "Statistics"); /* Set up ifnet structure */ ifp = sc->bfe_ifp = if_alloc(IFT_ETHER); Index: sys/dev/bge/if_bge.c =================================================================== --- sys/dev/bge/if_bge.c +++ sys/dev/bge/if_bge.c @@ -546,7 +546,8 @@ static int bge_allow_asf = 1; -static SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, "BGE driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "BGE driver parameters"); SYSCTL_INT(_hw_bge, OID_AUTO, allow_asf, CTLFLAG_RDTUN, &bge_allow_asf, 0, "Allow ASF mode if available"); @@ -6247,20 +6248,20 @@ #ifdef BGE_REGISTER_DEBUG SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "debug_info", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_debug_info, "I", - "Debug Information"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + bge_sysctl_debug_info, "I", "Debug Information"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "reg_read", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_reg_read, "I", - "MAC Register Read"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + bge_sysctl_reg_read, "I", "MAC Register Read"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "ape_read", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_ape_read, "I", - "APE Register Read"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + bge_sysctl_ape_read, "I", "APE Register Read"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "mem_read", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, bge_sysctl_mem_read, "I", - "Memory Read"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + bge_sysctl_mem_read, "I", "Memory Read"); #endif @@ -6310,9 +6311,9 @@ } #define BGE_SYSCTL_STAT(sc, ctx, desc, parent, node, oid) \ - SYSCTL_ADD_PROC(ctx, parent, OID_AUTO, oid, CTLTYPE_UINT|CTLFLAG_RD, \ - sc, offsetof(struct bge_stats, node), bge_sysctl_stats, "IU", \ - desc) + SYSCTL_ADD_PROC(ctx, parent, OID_AUTO, oid, \ + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, \ + offsetof(struct bge_stats, node), bge_sysctl_stats, "IU", desc) static void bge_add_sysctl_stats(struct bge_softc *sc, struct sysctl_ctx_list *ctx, @@ -6321,8 +6322,8 @@ struct sysctl_oid *tree; struct sysctl_oid_list *children, *schildren; - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "BGE Statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "BGE Statistics"); schildren = children = SYSCTL_CHILDREN(tree); BGE_SYSCTL_STAT(sc, ctx, "Frames Dropped Due To Filters", children, COSFramesDroppedDueToFilters, @@ -6356,8 +6357,8 @@ BGE_SYSCTL_STAT(sc, ctx, "NIC Send Threshold Hit", children, nicSendThresholdHit, "SendThresholdHit"); - tree = SYSCTL_ADD_NODE(ctx, schildren, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "BGE RX Statistics"); + tree = SYSCTL_ADD_NODE(ctx, schildren, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "BGE RX Statistics"); children = SYSCTL_CHILDREN(tree); BGE_SYSCTL_STAT(sc, ctx, "Inbound Octets", children, rxstats.ifHCInOctets, "ifHCInOctets"); @@ -6392,8 +6393,8 @@ BGE_SYSCTL_STAT(sc, ctx, "Outbound Range Length Errors", children, rxstats.outRangeLengthError, "outRangeLengthError"); - tree = SYSCTL_ADD_NODE(ctx, schildren, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "BGE TX Statistics"); + tree = SYSCTL_ADD_NODE(ctx, schildren, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "BGE TX Statistics"); children = SYSCTL_CHILDREN(tree); BGE_SYSCTL_STAT(sc, ctx, "Outbound Octets", children, txstats.ifHCOutOctets, "ifHCOutOctets"); @@ -6452,8 +6453,8 @@ struct bge_mac_stats *stats; stats = &sc->bge_mac_stats; - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "BGE Statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "BGE Statistics"); schild = child = SYSCTL_CHILDREN(tree); BGE_SYSCTL_STAT_ADD64(ctx, child, "FramesDroppedDueToFilters", &stats->FramesDroppedDueToFilters, "Frames Dropped Due to Filters"); @@ -6471,8 +6472,8 @@ BGE_SYSCTL_STAT_ADD64(ctx, child, "RecvThresholdHit", &stats->RecvThresholdHit, "NIC Recv Threshold Hit"); - tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "BGE RX Statistics"); + tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "BGE RX Statistics"); child = SYSCTL_CHILDREN(tree); BGE_SYSCTL_STAT_ADD64(ctx, child, "ifHCInOctets", &stats->ifHCInOctets, "Inbound Octets"); @@ -6503,8 +6504,8 @@ BGE_SYSCTL_STAT_ADD64(ctx, child, "UndersizePkts", &stats->etherStatsUndersizePkts, "Undersized Packets"); - tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "BGE TX Statistics"); + tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "BGE TX Statistics"); child = SYSCTL_CHILDREN(tree); BGE_SYSCTL_STAT_ADD64(ctx, child, "ifHCOutOctets", &stats->ifHCOutOctets, "Outbound Octets"); Index: sys/dev/bhnd/cores/pmu/bhnd_pmu.c =================================================================== --- sys/dev/bhnd/cores/pmu/bhnd_pmu.c +++ sys/dev/bhnd/cores/pmu/bhnd_pmu.c @@ -191,15 +191,15 @@ tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "bus_freq", CTLTYPE_UINT | CTLFLAG_RD, sc, 0, + "bus_freq", CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, bhnd_pmu_sysctl_bus_freq, "IU", "Bus clock frequency"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "cpu_freq", CTLTYPE_UINT | CTLFLAG_RD, sc, 0, + "cpu_freq", CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, bhnd_pmu_sysctl_cpu_freq, "IU", "CPU clock frequency"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "mem_freq", CTLTYPE_UINT | CTLFLAG_RD, sc, 0, + "mem_freq", CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, bhnd_pmu_sysctl_mem_freq, "IU", "Memory clock frequency"); return (0); Index: sys/dev/bktr/bktr_os.c =================================================================== --- sys/dev/bktr/bktr_os.c +++ sys/dev/bktr/bktr_os.c @@ -110,7 +110,8 @@ int bt848_dolby = 0; #endif -static SYSCTL_NODE(_hw, OID_AUTO, bt848, CTLFLAG_RW, 0, "Bt848 Driver mgmt"); +static SYSCTL_NODE(_hw, OID_AUTO, bt848, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bt848 Driver mgmt"); SYSCTL_INT(_hw_bt848, OID_AUTO, card, CTLFLAG_RW, &bt848_card, -1, ""); SYSCTL_INT(_hw_bt848, OID_AUTO, tuner, CTLFLAG_RW, &bt848_tuner, -1, ""); SYSCTL_INT(_hw_bt848, OID_AUTO, reverse_mute, CTLFLAG_RW, &bt848_reverse_mute, -1, ""); Index: sys/dev/bnxt/bnxt_sysctl.c =================================================================== --- sys/dev/bnxt/bnxt_sysctl.c +++ sys/dev/bnxt/bnxt_sysctl.c @@ -58,7 +58,7 @@ ctx = device_get_sysctl_ctx(softc->dev); softc->hw_stats_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO, - "hwstats", CTLFLAG_RD, 0, "hardware statistics"); + "hwstats", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "hardware statistics"); if (!softc->hw_stats_oid) { sysctl_ctx_free(&softc->hw_stats); return ENOMEM; @@ -68,7 +68,8 @@ ctx = device_get_sysctl_ctx(softc->dev); softc->ver_info->ver_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO, - "ver", CTLFLAG_RD, 0, "hardware/firmware version information"); + "ver", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "hardware/firmware version information"); if (!softc->ver_info->ver_oid) { sysctl_ctx_free(&softc->ver_info->ver_ctx); return ENOMEM; @@ -79,7 +80,8 @@ ctx = device_get_sysctl_ctx(softc->dev); softc->nvm_info->nvm_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO, - "nvram", CTLFLAG_RD, 0, "nvram information"); + "nvram", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "nvram information"); if (!softc->nvm_info->nvm_oid) { sysctl_ctx_free(&softc->nvm_info->nvm_ctx); return ENOMEM; @@ -90,7 +92,7 @@ ctx = device_get_sysctl_ctx(softc->dev); softc->hw_lro_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO, - "hw_lro", CTLFLAG_RD, 0, "hardware lro"); + "hw_lro", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "hardware lro"); if (!softc->hw_lro_oid) { sysctl_ctx_free(&softc->hw_lro_ctx); return ENOMEM; @@ -100,7 +102,7 @@ ctx = device_get_sysctl_ctx(softc->dev); softc->flow_ctrl_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO, - "fc", CTLFLAG_RD, 0, "flow ctrl"); + "fc", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "flow ctrl"); if (!softc->flow_ctrl_oid) { sysctl_ctx_free(&softc->flow_ctrl_ctx); return ENOMEM; @@ -166,8 +168,8 @@ sprintf(name, "txq%d", txr); sprintf(desc, "transmit queue %d", txr); oid = SYSCTL_ADD_NODE(&softc->hw_stats, - SYSCTL_CHILDREN(softc->hw_stats_oid), OID_AUTO, name, CTLFLAG_RD, 0, - desc); + SYSCTL_CHILDREN(softc->hw_stats_oid), OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, desc); if (!oid) return ENOMEM; @@ -210,8 +212,8 @@ sprintf(name, "port_stats"); sprintf(desc, "Port Stats"); oid = SYSCTL_ADD_NODE(&softc->hw_stats, - SYSCTL_CHILDREN(softc->hw_stats_oid), OID_AUTO, name, CTLFLAG_RD, 0, - desc); + SYSCTL_CHILDREN(softc->hw_stats_oid), OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, desc); if (!oid) return ENOMEM; @@ -661,8 +663,8 @@ sprintf(name, "rxq%d", rxr); sprintf(desc, "receive queue %d", rxr); oid = SYSCTL_ADD_NODE(&softc->hw_stats, - SYSCTL_CHILDREN(softc->hw_stats_oid), OID_AUTO, name, CTLFLAG_RD, 0, - desc); + SYSCTL_CHILDREN(softc->hw_stats_oid), OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, desc); if (!oid) return ENOMEM; @@ -861,12 +863,12 @@ bnxt_chip_type[MAX_CHIP_TYPE] : bnxt_chip_type[vi->chip_type], 0, "RoCE firmware name"); SYSCTL_ADD_PROC(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "package_ver", CTLTYPE_STRING|CTLFLAG_RD, softc, 0, - bnxt_package_ver_sysctl, "A", + "package_ver", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + softc, 0, bnxt_package_ver_sysctl, "A", "currently installed package version"); SYSCTL_ADD_PROC(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "hwrm_min_ver", CTLTYPE_STRING|CTLFLAG_RWTUN, softc, 0, - bnxt_hwrm_min_ver_sysctl, "A", + "hwrm_min_ver", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + softc, 0, bnxt_hwrm_min_ver_sysctl, "A", "minimum hwrm API vesion to support"); return 0; @@ -1205,44 +1207,49 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev));; SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rss_key", - CTLTYPE_STRING|CTLFLAG_RWTUN, softc, 0, bnxt_rss_key_sysctl, "A", - "RSS key"); + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_rss_key_sysctl, "A", "RSS key"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rss_type", - CTLTYPE_STRING|CTLFLAG_RWTUN, softc, 0, bnxt_rss_type_sysctl, "A", - "RSS type bits"); + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_rss_type_sysctl, "A", "RSS type bits"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_stall", - CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_rx_stall_sysctl, "I", + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_rx_stall_sysctl, "I", "buffer rx packets in hardware until the host posts new buffers"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "vlan_strip", - CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_vlan_strip_sysctl, "I", - "strip VLAN tag in the RX path"); + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_vlan_strip_sysctl, "I", "strip VLAN tag in the RX path"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "if_name", CTLFLAG_RD, iflib_get_ifp(softc->ctx)->if_xname, 0, "interface name"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_usecs", - CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_usecs, - "I", "interrupt coalescing Rx Usecs"); + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_set_coal_rx_usecs, "I", "interrupt coalescing Rx Usecs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_frames", - CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_frames, - "I", "interrupt coalescing Rx Frames"); + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_set_coal_rx_frames, "I", "interrupt coalescing Rx Frames"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_usecs_irq", - CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_usecs_irq, - "I", "interrupt coalescing Rx Usecs IRQ"); + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_set_coal_rx_usecs_irq, "I", + "interrupt coalescing Rx Usecs IRQ"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_frames_irq", - CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_frames_irq, - "I", "interrupt coalescing Rx Frames IRQ"); + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_set_coal_rx_frames_irq, "I", + "interrupt coalescing Rx Frames IRQ"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_usecs", - CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_usecs, - "I", "interrupt coalescing Tx Usces"); + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_set_coal_tx_usecs, "I", "interrupt coalescing Tx Usces"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_frames", - CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_frames, - "I", "interrupt coalescing Tx Frames"); + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_set_coal_tx_frames, "I", "interrupt coalescing Tx Frames"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_usecs_irq", - CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_usecs_irq, - "I", "interrupt coalescing Tx Usecs IRQ"); + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_set_coal_tx_usecs_irq, "I", + "interrupt coalescing Tx Usecs IRQ"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_frames_irq", - CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_frames_irq, - "I", "interrupt coalescing Tx Frames IRQ"); + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_set_coal_tx_frames_irq, "I", + "interrupt coalescing Tx Frames IRQ"); return 0; } @@ -1317,19 +1324,17 @@ return ENOMEM; SYSCTL_ADD_PROC(&softc->flow_ctrl_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "tx", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, - bnxt_flow_ctrl_tx, "A", - "Enable or Disable Tx Flow Ctrl: 0 / 1"); + "tx", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_flow_ctrl_tx, "A", "Enable or Disable Tx Flow Ctrl: 0 / 1"); SYSCTL_ADD_PROC(&softc->flow_ctrl_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "rx", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, - bnxt_flow_ctrl_rx, "A", - "Enable or Disable Tx Flow Ctrl: 0 / 1"); + "rx", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_flow_ctrl_rx, "A", "Enable or Disable Tx Flow Ctrl: 0 / 1"); SYSCTL_ADD_PROC(&softc->flow_ctrl_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "autoneg", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, - bnxt_flow_ctrl_autoneg, "A", - "Enable or Disable Autoneg Flow Ctrl: 0 / 1"); + "autoneg", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, + 0, bnxt_flow_ctrl_autoneg, "A", + "Enable or Disable Autoneg Flow Ctrl: 0 / 1"); return 0; } @@ -1343,31 +1348,31 @@ return ENOMEM; SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "enable", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, - bnxt_hw_lro_enable_disable, "A", - "Enable or Disable HW LRO: 0 / 1"); + "enable", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, + 0, bnxt_hw_lro_enable_disable, "A", + "Enable or Disable HW LRO: 0 / 1"); SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "gro_mode", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, - bnxt_hw_lro_set_mode, "A", - "Set mode: 1 = GRO mode, 0 = RSC mode"); + "gro_mode", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, + 0, bnxt_hw_lro_set_mode, "A", + "Set mode: 1 = GRO mode, 0 = RSC mode"); SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "max_agg_segs", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, - bnxt_hw_lro_set_max_agg_segs, "A", - "Set Max Agg Seg Value (unit is Log2): " - "0 (= 1 seg) / 1 (= 2 segs) / ... / 31 (= 2^31 segs)"); + "max_agg_segs", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + softc, 0, bnxt_hw_lro_set_max_agg_segs, "A", + "Set Max Agg Seg Value (unit is Log2): " + "0 (= 1 seg) / 1 (= 2 segs) / ... / 31 (= 2^31 segs)"); SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "max_aggs", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, - bnxt_hw_lro_set_max_aggs, "A", - "Set Max Aggs Value (unit is Log2): " - "0 (= 1 agg) / 1 (= 2 aggs) / ... / 7 (= 2^7 segs)"); + "max_aggs", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + softc, 0, bnxt_hw_lro_set_max_aggs, "A", + "Set Max Aggs Value (unit is Log2): " + "0 (= 1 agg) / 1 (= 2 aggs) / ... / 7 (= 2^7 segs)"); SYSCTL_ADD_PROC(&softc->hw_lro_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "min_agg_len", CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, - bnxt_hw_lro_set_min_agg_len, "A", - "Min Agg Len: 1 to 9000"); + "min_agg_len", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + softc, 0, bnxt_hw_lro_set_min_agg_len, "A", + "Min Agg Len: 1 to 9000"); return 0; } @@ -1407,7 +1412,8 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev));; SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "vlan_only", - CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_vlan_only_sysctl, "I", + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, softc, 0, + bnxt_vlan_only_sysctl, "I", "require vlan tag on received packets when vlan is enabled"); return 0; Index: sys/dev/bwn/if_bwn.c =================================================================== --- sys/dev/bwn/if_bwn.c +++ sys/dev/bwn/if_bwn.c @@ -98,7 +98,7 @@ #include "gpio_if.h" -static SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Broadcom driver parameters"); /* Index: sys/dev/bxe/bxe.c =================================================================== --- sys/dev/bxe/bxe.c +++ sys/dev/bxe/bxe.c @@ -258,7 +258,8 @@ /* Tunable device values... */ -SYSCTL_NODE(_hw, OID_AUTO, bxe, CTLFLAG_RD, 0, "bxe driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, bxe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "bxe driver parameters"); /* Debug */ unsigned long bxe_debug = 0; @@ -16163,44 +16164,41 @@ CTLFLAG_RW, &sc->rx_budget, 0, "rx processing budget"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pause_param", - CTLTYPE_UINT | CTLFLAG_RW, sc, 0, - bxe_sysctl_pauseparam, "IU", - "need pause frames- DEF:0/TX:1/RX:2/BOTH:3/AUTO:4/AUTOTX:5/AUTORX:6/AUTORXTX:7/NONE:8"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pause_param", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + bxe_sysctl_pauseparam, "IU", + "need pause frames- DEF:0/TX:1/RX:2/BOTH:3/AUTO:4/AUTOTX:5/AUTORX:6/AUTORXTX:7/NONE:8"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "state", - CTLTYPE_UINT | CTLFLAG_RW, sc, 0, - bxe_sysctl_state, "IU", "dump driver state"); + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + bxe_sysctl_state, "IU", "dump driver state"); for (i = 0; i < BXE_NUM_ETH_STATS; i++) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - bxe_eth_stats_arr[i].string, - CTLTYPE_U64 | CTLFLAG_RD, sc, i, - bxe_sysctl_eth_stat, "LU", - bxe_eth_stats_arr[i].string); + bxe_eth_stats_arr[i].string, + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, i, + bxe_sysctl_eth_stat, "LU", bxe_eth_stats_arr[i].string); } /* add a new parent node for all queues "dev.bxe.#.queue" */ queue_top = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "queue", - CTLFLAG_RD, NULL, "queue"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "queue"); queue_top_children = SYSCTL_CHILDREN(queue_top); for (i = 0; i < sc->num_queues; i++) { /* add a new parent node for a single queue "dev.bxe.#.queue.#" */ snprintf(queue_num_buf, sizeof(queue_num_buf), "%d", i); queue = SYSCTL_ADD_NODE(ctx, queue_top_children, OID_AUTO, - queue_num_buf, CTLFLAG_RD, NULL, - "single queue"); + queue_num_buf, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "single queue"); queue_children = SYSCTL_CHILDREN(queue); for (j = 0; j < BXE_NUM_ETH_Q_STATS; j++) { q_stat = ((i << 16) | j); SYSCTL_ADD_PROC(ctx, queue_children, OID_AUTO, - bxe_eth_q_stats_arr[j].string, - CTLTYPE_U64 | CTLFLAG_RD, sc, q_stat, - bxe_sysctl_eth_q_stat, "LU", - bxe_eth_q_stats_arr[j].string); + bxe_eth_q_stats_arr[j].string, + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, q_stat, + bxe_sysctl_eth_q_stat, "LU", bxe_eth_q_stats_arr[j].string); } } } Index: sys/dev/cadence/if_cgem.c =================================================================== --- sys/dev/cadence/if_cgem.c +++ sys/dev/cadence/if_cgem.c @@ -1494,8 +1494,8 @@ &sc->txdefragfails, 0, "Transmit m_defrag() failures"); - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "GEM statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "GEM statistics"); child = SYSCTL_CHILDREN(tree); SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "tx_bytes", CTLFLAG_RD, Index: sys/dev/cardbus/cardbus.c =================================================================== --- sys/dev/cardbus/cardbus.c +++ sys/dev/cardbus/cardbus.c @@ -57,7 +57,8 @@ #include "pcib_if.h" /* sysctl vars */ -static SYSCTL_NODE(_hw, OID_AUTO, cardbus, CTLFLAG_RD, 0, "CardBus parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, cardbus, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CardBus parameters"); int cardbus_debug = 0; SYSCTL_INT(_hw_cardbus, OID_AUTO, debug, CTLFLAG_RWTUN, Index: sys/dev/coretemp/coretemp.c =================================================================== --- sys/dev/coretemp/coretemp.c +++ sys/dev/coretemp/coretemp.c @@ -274,7 +274,8 @@ oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(pdev)), OID_AUTO, - "coretemp", CTLFLAG_RD, NULL, "Per-CPU thermal information"); + "coretemp", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Per-CPU thermal information"); /* * Add the MIBs to dev.cpu.N and dev.cpu.N.coretemp. Index: sys/dev/cxgb/cxgb_main.c =================================================================== --- sys/dev/cxgb/cxgb_main.c +++ sys/dev/cxgb/cxgb_main.c @@ -238,7 +238,8 @@ */ static int msi_allowed = 2; -SYSCTL_NODE(_hw, OID_AUTO, cxgb, CTLFLAG_RD, 0, "CXGB driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, cxgb, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CXGB driver parameters"); SYSCTL_INT(_hw_cxgb, OID_AUTO, msi_allowed, CTLFLAG_RDTUN, &msi_allowed, 0, "MSI-X, MSI, INTx selector"); Index: sys/dev/cxgb/cxgb_sge.c =================================================================== --- sys/dev/cxgb/cxgb_sge.c +++ sys/dev/cxgb/cxgb_sge.c @@ -3451,13 +3451,13 @@ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal", - CTLTYPE_INT|CTLFLAG_RW, sc, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, t3_set_coalesce_usecs, "I", "interrupt coalescing timer (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pkt_timestamp", - CTLTYPE_INT | CTLFLAG_RW, sc, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, t3_pkt_timestamp, "I", "provide packet timestamp instead of connection hash"); @@ -3469,7 +3469,8 @@ snprintf(pi->namebuf, PORT_NAME_LEN, "port%d", i); poid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, - pi->namebuf, CTLFLAG_RD, NULL, "port statistics"); + pi->namebuf, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "port statistics"); poidlist = SYSCTL_CHILDREN(poid); SYSCTL_ADD_UINT(ctx, poidlist, OID_AUTO, "nqsets", CTLFLAG_RD, &pi->nqsets, @@ -3487,7 +3488,8 @@ snprintf(qs->namebuf, QS_NAME_LEN, "qs%d", j); qspoid = SYSCTL_ADD_NODE(ctx, poidlist, OID_AUTO, - qs->namebuf, CTLFLAG_RD, NULL, "qset statistics"); + qs->namebuf, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "qset statistics"); qspoidlist = SYSCTL_CHILDREN(qspoid); SYSCTL_ADD_UINT(ctx, qspoidlist, OID_AUTO, "fl0_empty", @@ -3498,19 +3500,23 @@ "freelist #1 empty"); rspqpoid = SYSCTL_ADD_NODE(ctx, qspoidlist, OID_AUTO, - rspq_name, CTLFLAG_RD, NULL, "rspq statistics"); + rspq_name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "rspq statistics"); rspqpoidlist = SYSCTL_CHILDREN(rspqpoid); txqpoid = SYSCTL_ADD_NODE(ctx, qspoidlist, OID_AUTO, - txq_names[0], CTLFLAG_RD, NULL, "txq statistics"); + txq_names[0], CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "txq statistics"); txqpoidlist = SYSCTL_CHILDREN(txqpoid); ctrlqpoid = SYSCTL_ADD_NODE(ctx, qspoidlist, OID_AUTO, - txq_names[2], CTLFLAG_RD, NULL, "ctrlq statistics"); + txq_names[2], CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "ctrlq statistics"); ctrlqpoidlist = SYSCTL_CHILDREN(ctrlqpoid); lropoid = SYSCTL_ADD_NODE(ctx, qspoidlist, OID_AUTO, - "lro_stats", CTLFLAG_RD, NULL, "LRO statistics"); + "lro_stats", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "LRO statistics"); lropoidlist = SYSCTL_CHILDREN(lropoid); SYSCTL_ADD_UINT(ctx, rspqpoidlist, OID_AUTO, "size", @@ -3535,8 +3541,9 @@ CTLFLAG_RW, &qs->rspq.rspq_dump_count, 0, "#rspq entries to dump"); SYSCTL_ADD_PROC(ctx, rspqpoidlist, OID_AUTO, "qdump", - CTLTYPE_STRING | CTLFLAG_RD, &qs->rspq, - 0, t3_dump_rspq, "A", "dump of the response queue"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &qs->rspq, 0, t3_dump_rspq, "A", + "dump of the response queue"); SYSCTL_ADD_UQUAD(ctx, txqpoidlist, OID_AUTO, "dropped", CTLFLAG_RD, &qs->txq[TXQ_ETH].txq_mr->br_drops, @@ -3595,8 +3602,9 @@ CTLFLAG_RW, &qs->txq[TXQ_ETH].txq_dump_count, 0, "txq #entries to dump"); SYSCTL_ADD_PROC(ctx, txqpoidlist, OID_AUTO, "qdump", - CTLTYPE_STRING | CTLFLAG_RD, &qs->txq[TXQ_ETH], - 0, t3_dump_txq_eth, "A", "dump of the transmit queue"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &qs->txq[TXQ_ETH], 0, t3_dump_txq_eth, "A", + "dump of the transmit queue"); SYSCTL_ADD_UINT(ctx, ctrlqpoidlist, OID_AUTO, "dump_start", CTLFLAG_RW, &qs->txq[TXQ_CTRL].txq_dump_start, @@ -3605,8 +3613,9 @@ CTLFLAG_RW, &qs->txq[TXQ_CTRL].txq_dump_count, 0, "ctrl #entries to dump"); SYSCTL_ADD_PROC(ctx, ctrlqpoidlist, OID_AUTO, "qdump", - CTLTYPE_STRING | CTLFLAG_RD, &qs->txq[TXQ_CTRL], - 0, t3_dump_txq_ctrl, "A", "dump of the transmit queue"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &qs->txq[TXQ_CTRL], 0, t3_dump_txq_ctrl, "A", + "dump of the transmit queue"); SYSCTL_ADD_U64(ctx, lropoidlist, OID_AUTO, "lro_queued", CTLFLAG_RD, &qs->lro.ctrl.lro_queued, 0, NULL); @@ -3620,7 +3629,7 @@ /* Now add a node for mac stats. */ poid = SYSCTL_ADD_NODE(ctx, poidlist, OID_AUTO, "mac_stats", - CTLFLAG_RD, NULL, "MAC statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "MAC statistics"); poidlist = SYSCTL_CHILDREN(poid); /* @@ -3636,8 +3645,8 @@ * all that here. */ #define CXGB_SYSCTL_ADD_QUAD(a) SYSCTL_ADD_OID(ctx, poidlist, OID_AUTO, #a, \ - (CTLTYPE_U64 | CTLFLAG_RD), pi, offsetof(struct mac_stats, a), \ - sysctl_handle_macstat, "QU", 0) + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, pi, \ + offsetof(struct mac_stats, a), sysctl_handle_macstat, "QU", 0) CXGB_SYSCTL_ADD_QUAD(tx_octets); CXGB_SYSCTL_ADD_QUAD(tx_octets_bad); CXGB_SYSCTL_ADD_QUAD(tx_frames); Index: sys/dev/cxgbe/crypto/t4_crypto.c =================================================================== --- sys/dev/cxgbe/crypto/t4_crypto.c +++ sys/dev/cxgbe/crypto/t4_crypto.c @@ -2082,8 +2082,8 @@ /* * dev.ccr.X.stats. */ - oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "statistics"); + oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "statistics"); children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_U64(ctx, children, OID_AUTO, "hash", CTLFLAG_RD, Index: sys/dev/cxgbe/cxgbei/cxgbei.c =================================================================== --- sys/dev/cxgbe/cxgbei/cxgbei.c +++ sys/dev/cxgbe/cxgbei/cxgbei.c @@ -223,8 +223,8 @@ oid = device_get_sysctl_tree(sc->dev); /* dev.t5nex.X */ children = SYSCTL_CHILDREN(oid); - oid = SYSCTL_ADD_NODE(&ci->ctx, children, OID_AUTO, "iscsi", CTLFLAG_RD, - NULL, "iSCSI ULP statistics"); + oid = SYSCTL_ADD_NODE(&ci->ctx, children, OID_AUTO, "iscsi", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "iSCSI ULP statistics"); children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_COUNTER_U64(&ci->ctx, children, OID_AUTO, "ddp_setup_ok", Index: sys/dev/cxgbe/cxgbei/icl_cxgbei.c =================================================================== --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -100,7 +100,8 @@ #include "tom/t4_tom.h" #include "cxgbei.h" -SYSCTL_NODE(_kern_icl, OID_AUTO, cxgbei, CTLFLAG_RD, 0, "Chelsio iSCSI offload"); +SYSCTL_NODE(_kern_icl, OID_AUTO, cxgbei, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Chelsio iSCSI offload"); static int coalesce = 1; SYSCTL_INT(_kern_icl_cxgbei, OID_AUTO, coalesce, CTLFLAG_RWTUN, &coalesce, 0, "Try to coalesce PDUs before sending"); Index: sys/dev/cxgbe/iw_cxgbe/cm.c =================================================================== --- sys/dev/cxgbe/iw_cxgbe/cm.c +++ sys/dev/cxgbe/iw_cxgbe/cm.c @@ -1206,7 +1206,8 @@ } -SYSCTL_NODE(_hw, OID_AUTO, iw_cxgbe, CTLFLAG_RD, 0, "iw_cxgbe driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, iw_cxgbe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "iw_cxgbe driver parameters"); static int dack_mode = 0; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, dack_mode, CTLFLAG_RWTUN, &dack_mode, 0, Index: sys/dev/cxgbe/t4_main.c =================================================================== --- sys/dev/cxgbe/t4_main.c +++ sys/dev/cxgbe/t4_main.c @@ -266,9 +266,12 @@ * Tunables applicable to both T4 and T5 are under hw.cxgbe. Those specific to * T5 are under hw.cxl. */ -SYSCTL_NODE(_hw, OID_AUTO, cxgbe, CTLFLAG_RD, 0, "cxgbe(4) parameters"); -SYSCTL_NODE(_hw, OID_AUTO, cxl, CTLFLAG_RD, 0, "cxgbe(4) T5+ parameters"); -SYSCTL_NODE(_hw_cxgbe, OID_AUTO, toe, CTLFLAG_RD, 0, "cxgbe(4) TOE parameters"); +SYSCTL_NODE(_hw, OID_AUTO, cxgbe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "cxgbe(4) parameters"); +SYSCTL_NODE(_hw, OID_AUTO, cxl, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "cxgbe(4) T5+ parameters"); +SYSCTL_NODE(_hw_cxgbe, OID_AUTO, toe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "cxgbe(4) TOE parameters"); /* * Number of queues for tx and rx, NIC and offload. @@ -364,7 +367,8 @@ static int t4_toe_rexmt_backoff[16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; -SYSCTL_NODE(_hw_cxgbe_toe, OID_AUTO, rexmt_backoff, CTLFLAG_RD, 0, +SYSCTL_NODE(_hw_cxgbe_toe, OID_AUTO, rexmt_backoff, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "cxgbe(4) TOE retransmit backoff values"); SYSCTL_INT(_hw_cxgbe_toe_rexmt_backoff, OID_AUTO, 0, CTLFLAG_RDTUN, &t4_toe_rexmt_backoff[0], 0, ""); @@ -604,7 +608,7 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, kern_tls, CTLFLAG_RDTUN, &t4_kern_tls, 0, "Enable KERN_TLS mode for all supported adapters"); -SYSCTL_NODE(_hw_cxgbe, OID_AUTO, tls, CTLFLAG_RD, 0, +SYSCTL_NODE(_hw_cxgbe, OID_AUTO, tls, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "cxgbe(4) KERN_TLS parameters"); static int t4_tls_inline_keys = 0; @@ -6230,21 +6234,22 @@ sc->params.nports, "# of ports"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells", - CTLTYPE_STRING | CTLFLAG_RD, doorbells, (uintptr_t)&sc->doorbells, - sysctl_bitfield_8b, "A", "available doorbells"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, doorbells, + (uintptr_t)&sc->doorbells, sysctl_bitfield_8b, "A", + "available doorbells"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD, NULL, sc->params.vpd.cclk, "core clock frequency (in KHz)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_timers", - CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.timer_val, - sizeof(sc->params.sge.timer_val), sysctl_int_array, "A", - "interrupt holdoff timer values (us)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + sc->params.sge.timer_val, sizeof(sc->params.sge.timer_val), + sysctl_int_array, "A", "interrupt holdoff timer values (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pkt_counts", - CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.counter_val, - sizeof(sc->params.sge.counter_val), sysctl_int_array, "A", - "interrupt holdoff packet counter values"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + sc->params.sge.counter_val, sizeof(sc->params.sge.counter_val), + sysctl_int_array, "A", "interrupt holdoff packet counter values"); t4_sge_sysctls(sc, ctx, children); @@ -6302,8 +6307,9 @@ #define SYSCTL_CAP(name, n, text) \ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \ - CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], (uintptr_t)&sc->name, \ - sysctl_bitfield_16b, "A", "available " text " capabilities") + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, caps_decoder[n], \ + (uintptr_t)&sc->name, sysctl_bitfield_16b, "A", \ + "available " text " capabilities") SYSCTL_CAP(nbmcaps, 0, "NBM"); SYSCTL_CAP(linkcaps, 1, "link"); @@ -6319,26 +6325,28 @@ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nfilters", CTLFLAG_RD, NULL, sc->tids.nftids, "number of filters"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", CTLTYPE_INT | - CTLFLAG_RD, sc, 0, sysctl_temperature, "I", - "chip temperature (in Celsius)"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "reset_sensor", CTLTYPE_INT | - CTLFLAG_RW, sc, 0, sysctl_reset_sensor, "I", - "reset the chip's temperature sensor."); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_temperature, "I", "chip temperature (in Celsius)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "reset_sensor", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_reset_sensor, "I", "reset the chip's temperature sensor."); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "loadavg", CTLTYPE_STRING | - CTLFLAG_RD, sc, 0, sysctl_loadavg, "A", + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "loadavg", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_loadavg, "A", "microprocessor load averages (debug firmwares only)"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "core_vdd", CTLTYPE_INT | - CTLFLAG_RD, sc, 0, sysctl_vdd, "I", "core Vdd (in mV)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "core_vdd", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_vdd, + "I", "core Vdd (in mV)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "local_cpus", - CTLTYPE_STRING | CTLFLAG_RD, sc, LOCAL_CPUS, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, LOCAL_CPUS, sysctl_cpus, "A", "local CPUs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_cpus", - CTLTYPE_STRING | CTLFLAG_RD, sc, INTR_CPUS, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, INTR_CPUS, sysctl_cpus, "A", "preferred CPUs for interrupts"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "swintr", CTLFLAG_RW, @@ -6348,178 +6356,180 @@ * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. */ oid = SYSCTL_ADD_NODE(ctx, c0, OID_AUTO, "misc", - CTLFLAG_RD | CTLFLAG_SKIP, NULL, + CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_MPSAFE, NULL, "logs and miscellaneous information"); children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cctrl", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_cctrl, "A", "congestion control"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_tp0", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_cim_ibq_obq, "A", "CIM IBQ 0 (TP0)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_tp1", - CTLTYPE_STRING | CTLFLAG_RD, sc, 1, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 1, sysctl_cim_ibq_obq, "A", "CIM IBQ 1 (TP1)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_ulp", - CTLTYPE_STRING | CTLFLAG_RD, sc, 2, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 2, sysctl_cim_ibq_obq, "A", "CIM IBQ 2 (ULP)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_sge0", - CTLTYPE_STRING | CTLFLAG_RD, sc, 3, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 3, sysctl_cim_ibq_obq, "A", "CIM IBQ 3 (SGE0)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_sge1", - CTLTYPE_STRING | CTLFLAG_RD, sc, 4, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 4, sysctl_cim_ibq_obq, "A", "CIM IBQ 4 (SGE1)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_ncsi", - CTLTYPE_STRING | CTLFLAG_RD, sc, 5, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 5, sysctl_cim_ibq_obq, "A", "CIM IBQ 5 (NCSI)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_la", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_cim_la, - "A", "CIM logic analyzer"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_cim_la, "A", "CIM logic analyzer"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ma_la", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_cim_ma_la, "A", "CIM MA logic analyzer"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp0", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0 + CIM_NUM_IBQ, - sysctl_cim_ibq_obq, "A", "CIM OBQ 0 (ULP0)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + 0 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 0 (ULP0)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp1", - CTLTYPE_STRING | CTLFLAG_RD, sc, 1 + CIM_NUM_IBQ, - sysctl_cim_ibq_obq, "A", "CIM OBQ 1 (ULP1)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + 1 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 1 (ULP1)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp2", - CTLTYPE_STRING | CTLFLAG_RD, sc, 2 + CIM_NUM_IBQ, - sysctl_cim_ibq_obq, "A", "CIM OBQ 2 (ULP2)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + 2 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 2 (ULP2)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp3", - CTLTYPE_STRING | CTLFLAG_RD, sc, 3 + CIM_NUM_IBQ, - sysctl_cim_ibq_obq, "A", "CIM OBQ 3 (ULP3)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + 3 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 3 (ULP3)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_sge", - CTLTYPE_STRING | CTLFLAG_RD, sc, 4 + CIM_NUM_IBQ, - sysctl_cim_ibq_obq, "A", "CIM OBQ 4 (SGE)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + 4 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 4 (SGE)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ncsi", - CTLTYPE_STRING | CTLFLAG_RD, sc, 5 + CIM_NUM_IBQ, - sysctl_cim_ibq_obq, "A", "CIM OBQ 5 (NCSI)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + 5 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 5 (NCSI)"); if (chip_id(sc) > CHELSIO_T4) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_sge0_rx", - CTLTYPE_STRING | CTLFLAG_RD, sc, 6 + CIM_NUM_IBQ, - sysctl_cim_ibq_obq, "A", "CIM OBQ 6 (SGE0-RX)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + 6 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", + "CIM OBQ 6 (SGE0-RX)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_sge1_rx", - CTLTYPE_STRING | CTLFLAG_RD, sc, 7 + CIM_NUM_IBQ, - sysctl_cim_ibq_obq, "A", "CIM OBQ 7 (SGE1-RX)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + 7 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", + "CIM OBQ 7 (SGE1-RX)"); } SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_pif_la", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_cim_pif_la, "A", "CIM PIF logic analyzer"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_qcfg", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_cim_qcfg, "A", "CIM queue configuration"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cpl_stats", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_cpl_stats, "A", "CPL statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "ddp_stats", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_ddp_stats, "A", "non-TCP DDP statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "devlog", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_devlog, "A", "firmware's device log"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fcoe_stats", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_fcoe_stats, "A", "FCoE statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "hw_sched", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_hw_sched, "A", "hardware scheduler "); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "l2t", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_l2t, "A", "hardware L2 table"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "smt", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_smt, "A", "hardware source MAC table"); #ifdef INET6 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "clip", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_clip, "A", "active CLIP table entries"); #endif SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "lb_stats", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_lb_stats, "A", "loopback statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "meminfo", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_meminfo, "A", "memory regions"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "mps_tcam", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, chip_id(sc) <= CHELSIO_T5 ? sysctl_mps_tcam : sysctl_mps_tcam_t6, "A", "MPS TCAM entries"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "path_mtus", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_path_mtus, "A", "path MTUs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pm_stats", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_pm_stats, "A", "PM statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rdma_stats", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_rdma_stats, "A", "RDMA statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tcp_stats", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_tcp_stats, "A", "TCP statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tids", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_tids, "A", "TID information"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tp_err_stats", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_tp_err_stats, "A", "TP error statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tp_la_mask", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_tp_la_mask, "I", - "TP logic analyzer event capture mask"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_tp_la_mask, "I", "TP logic analyzer event capture mask"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tp_la", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_tp_la, "A", "TP logic analyzer"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_rate", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_tx_rate, "A", "Tx rate"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "ulprx_la", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_ulprx_la, "A", "ULPRX logic analyzer"); if (chip_id(sc) >= CHELSIO_T5) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "wcwr_stats", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_wcwr_stats, "A", "write combined work requests"); } @@ -6528,8 +6538,8 @@ /* * dev.t4nex.0.tls. */ - oid = SYSCTL_ADD_NODE(ctx, c0, OID_AUTO, "tls", CTLFLAG_RD, - NULL, "KERN_TLS parameters"); + oid = SYSCTL_ADD_NODE(ctx, c0, OID_AUTO, "tls", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "KERN_TLS parameters"); children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "inline_keys", @@ -6550,8 +6560,8 @@ /* * dev.t4nex.X.toe. */ - oid = SYSCTL_ADD_NODE(ctx, c0, OID_AUTO, "toe", CTLFLAG_RD, - NULL, "TOE parameters"); + oid = SYSCTL_ADD_NODE(ctx, c0, OID_AUTO, "toe", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TOE parameters"); children = SYSCTL_CHILDREN(oid); sc->tt.cong_algorithm = -1; @@ -6579,8 +6589,9 @@ &sc->tt.tls, 0, "Inline TLS allowed"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls_rx_ports", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_tls_rx_ports, - "I", "TCP ports that use inline TLS+TOE RX"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_tls_rx_ports, "I", + "TCP ports that use inline TLS+TOE RX"); sc->tt.tx_align = -1; SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_align", @@ -6603,76 +6614,85 @@ "autorcvbuf increment"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "timer_tick", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tp_tick, "A", - "TP timer tick (us)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_tp_tick, "A", "TP timer tick (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "timestamp_tick", - CTLTYPE_STRING | CTLFLAG_RD, sc, 1, sysctl_tp_tick, "A", - "TCP timestamp tick (us)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 1, + sysctl_tp_tick, "A", "TCP timestamp tick (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dack_tick", - CTLTYPE_STRING | CTLFLAG_RD, sc, 2, sysctl_tp_tick, "A", - "DACK tick (us)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 2, + sysctl_tp_tick, "A", "DACK tick (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dack_timer", - CTLTYPE_UINT | CTLFLAG_RD, sc, 0, sysctl_tp_dack_timer, - "IU", "DACK timer (us)"); + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_tp_dack_timer, "IU", "DACK timer (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rexmt_min", - CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_RXT_MIN, - sysctl_tp_timer, "LU", "Minimum retransmit interval (us)"); + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + A_TP_RXT_MIN, sysctl_tp_timer, "LU", + "Minimum retransmit interval (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rexmt_max", - CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_RXT_MAX, - sysctl_tp_timer, "LU", "Maximum retransmit interval (us)"); + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + A_TP_RXT_MAX, sysctl_tp_timer, "LU", + "Maximum retransmit interval (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "persist_min", - CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_PERS_MIN, - sysctl_tp_timer, "LU", "Persist timer min (us)"); + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + A_TP_PERS_MIN, sysctl_tp_timer, "LU", + "Persist timer min (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "persist_max", - CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_PERS_MAX, - sysctl_tp_timer, "LU", "Persist timer max (us)"); + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + A_TP_PERS_MAX, sysctl_tp_timer, "LU", + "Persist timer max (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "keepalive_idle", - CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_KEEP_IDLE, - sysctl_tp_timer, "LU", "Keepalive idle timer (us)"); + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + A_TP_KEEP_IDLE, sysctl_tp_timer, "LU", + "Keepalive idle timer (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "keepalive_interval", - CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_KEEP_INTVL, - sysctl_tp_timer, "LU", "Keepalive interval timer (us)"); + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + A_TP_KEEP_INTVL, sysctl_tp_timer, "LU", + "Keepalive interval timer (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "initial_srtt", - CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_INIT_SRTT, - sysctl_tp_timer, "LU", "Initial SRTT (us)"); + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + A_TP_INIT_SRTT, sysctl_tp_timer, "LU", "Initial SRTT (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "finwait2_timer", - CTLTYPE_ULONG | CTLFLAG_RD, sc, A_TP_FINWAIT2_TIMER, - sysctl_tp_timer, "LU", "FINWAIT2 timer (us)"); + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + A_TP_FINWAIT2_TIMER, sysctl_tp_timer, "LU", + "FINWAIT2 timer (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "syn_rexmt_count", - CTLTYPE_UINT | CTLFLAG_RD, sc, S_SYNSHIFTMAX, - sysctl_tp_shift_cnt, "IU", + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + S_SYNSHIFTMAX, sysctl_tp_shift_cnt, "IU", "Number of SYN retransmissions before abort"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rexmt_count", - CTLTYPE_UINT | CTLFLAG_RD, sc, S_RXTSHIFTMAXR2, - sysctl_tp_shift_cnt, "IU", + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + S_RXTSHIFTMAXR2, sysctl_tp_shift_cnt, "IU", "Number of retransmissions before abort"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "keepalive_count", - CTLTYPE_UINT | CTLFLAG_RD, sc, S_KEEPALIVEMAXR2, - sysctl_tp_shift_cnt, "IU", + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + S_KEEPALIVEMAXR2, sysctl_tp_shift_cnt, "IU", "Number of keepalive probes before abort"); oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "rexmt_backoff", - CTLFLAG_RD, NULL, "TOE retransmit backoffs"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "TOE retransmit backoffs"); children = SYSCTL_CHILDREN(oid); for (i = 0; i < 16; i++) { snprintf(s, sizeof(s), "%u", i); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, s, - CTLTYPE_UINT | CTLFLAG_RD, sc, i, sysctl_tp_backoff, - "IU", "TOE retransmit backoff"); + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + i, sysctl_tp_backoff, "IU", + "TOE retransmit backoff"); } } #endif @@ -6710,7 +6730,8 @@ if (IS_MAIN_VI(vi)) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rsrv_noflowq", - CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_noflowq, "IU", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + sysctl_noflowq, "IU", "Reserve queue 0 for non-flowid packets"); } @@ -6723,11 +6744,11 @@ CTLFLAG_RD, &vi->first_ofld_rxq, 0, "index of first TOE rx queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_tmr_idx_ofld", - CTLTYPE_INT | CTLFLAG_RW, vi, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, sysctl_holdoff_tmr_idx_ofld, "I", "holdoff timer index for TOE queues"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pktc_idx_ofld", - CTLTYPE_INT | CTLFLAG_RW, vi, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, sysctl_holdoff_pktc_idx_ofld, "I", "holdoff packet counter index for TOE queues"); } @@ -6758,18 +6779,18 @@ #endif SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_tmr_idx", - CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_holdoff_tmr_idx, "I", - "holdoff timer index"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + sysctl_holdoff_tmr_idx, "I", "holdoff timer index"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pktc_idx", - CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_holdoff_pktc_idx, "I", - "holdoff packet counter index"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + sysctl_holdoff_pktc_idx, "I", "holdoff packet counter index"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "qsize_rxq", - CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_qsize_rxq, "I", - "rx queue size"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + sysctl_qsize_rxq, "I", "rx queue size"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "qsize_txq", - CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_qsize_txq, "I", - "tx queue size"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + sysctl_qsize_txq, "I", "tx queue size"); } static void @@ -6791,28 +6812,32 @@ oid = device_get_sysctl_tree(pi->dev); children = SYSCTL_CHILDREN(oid); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "linkdnrc", CTLTYPE_STRING | - CTLFLAG_RD, pi, 0, sysctl_linkdnrc, "A", "reason why link is down"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "linkdnrc", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, pi, 0, + sysctl_linkdnrc, "A", "reason why link is down"); if (pi->port_type == FW_PORT_TYPE_BT_XAUI) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", - CTLTYPE_INT | CTLFLAG_RD, pi, 0, sysctl_btphy, "I", - "PHY temperature (in Celsius)"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, pi, 0, + sysctl_btphy, "I", "PHY temperature (in Celsius)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fw_version", - CTLTYPE_INT | CTLFLAG_RD, pi, 1, sysctl_btphy, "I", - "PHY firmware version"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, pi, 1, + sysctl_btphy, "I", "PHY firmware version"); } SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pause_settings", - CTLTYPE_STRING | CTLFLAG_RW, pi, 0, sysctl_pause_settings, "A", - "PAUSE settings (bit 0 = rx_pause, 1 = tx_pause, 2 = pause_autoneg)"); + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, pi, 0, + sysctl_pause_settings, "A", + "PAUSE settings (bit 0 = rx_pause, 1 = tx_pause, 2 = pause_autoneg)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fec", - CTLTYPE_STRING | CTLFLAG_RW, pi, 0, sysctl_fec, "A", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, pi, 0, + sysctl_fec, "A", "FECs to use (bit 0 = RS, 1 = FC, 2 = none, 5 = auto, 6 = module)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "module_fec", - CTLTYPE_STRING, pi, 0, sysctl_module_fec, "A", + CTLTYPE_STRING | CTLFLAG_NEEDGIANT, pi, 0, sysctl_module_fec, "A", "FEC recommended by the cable/transceiver"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "autoneg", - CTLTYPE_INT | CTLFLAG_RW, pi, 0, sysctl_autoneg, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, pi, 0, + sysctl_autoneg, "I", "autonegotiation (-1 = not supported)"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "pcaps", CTLFLAG_RD, @@ -6835,7 +6860,8 @@ /* * dev.(cxgbe|cxl).X.tc. */ - oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "tc", CTLFLAG_RD, NULL, + oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "tc", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx scheduler traffic classes (cl_rl)"); children2 = SYSCTL_CHILDREN(oid); SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "pktsize", @@ -6849,32 +6875,33 @@ snprintf(name, sizeof(name), "%d", i); children2 = SYSCTL_CHILDREN(SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(oid), OID_AUTO, name, CTLFLAG_RD, NULL, - "traffic class")); + SYSCTL_CHILDREN(oid), OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "traffic class")); SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "flags", - CTLTYPE_STRING | CTLFLAG_RD, tc_flags, (uintptr_t)&tc->flags, - sysctl_bitfield_8b, "A", "flags"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, tc_flags, + (uintptr_t)&tc->flags, sysctl_bitfield_8b, "A", "flags"); SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "refcount", CTLFLAG_RD, &tc->refcount, 0, "references to this class"); SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "params", - CTLTYPE_STRING | CTLFLAG_RD, sc, (pi->port_id << 16) | i, - sysctl_tc_params, "A", "traffic class parameters"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + (pi->port_id << 16) | i, sysctl_tc_params, "A", + "traffic class parameters"); } /* * dev.cxgbe.X.stats. */ - oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "port statistics"); + oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "port statistics"); children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "tx_parse_error", CTLFLAG_RD, &pi->tx_parse_error, 0, "# of tx packets with invalid length or # of segments"); #define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ - SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ - CTLTYPE_U64 | CTLFLAG_RD, sc, reg, \ - sysctl_handle_t4_reg64, "QU", desc) + SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, reg, \ + sysctl_handle_t4_reg64, "QU", desc) SYSCTL_ADD_T4_REG64(pi, "tx_octets", "# of octets in good frames", PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_BYTES_L)); Index: sys/dev/cxgbe/t4_sge.c =================================================================== --- sys/dev/cxgbe/t4_sge.c +++ sys/dev/cxgbe/t4_sge.c @@ -935,8 +935,8 @@ struct sge_params *sp = &sc->params.sge; SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "buffer_sizes", - CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_bufsizes, "A", - "freelist buffer sizes"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_bufsizes, "A", "freelist buffer sizes"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pktshift", CTLFLAG_RD, NULL, sp->fl_pktshift, "payload DMA offset in rx buffer (bytes)"); @@ -1006,7 +1006,7 @@ * Control queues, one per port. */ oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, "ctrlq", - CTLFLAG_RD, NULL, "control queues"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "control queues"); for_each_port(sc, i) { struct sge_wrq *ctrlq = &sc->sge.ctrlq[i]; @@ -1094,7 +1094,7 @@ * doesn't set off any congestion signal in the chip. */ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "nm_rxq", - CTLFLAG_RD, NULL, "rx queues"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "rx queues"); for_each_nm_rxq(vi, i, nm_rxq) { rc = alloc_nm_rxq(vi, nm_rxq, intr_idx, i, oid); if (rc != 0) @@ -1103,7 +1103,7 @@ } oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "nm_txq", - CTLFLAG_RD, NULL, "tx queues"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "tx queues"); for_each_nm_txq(vi, i, nm_txq) { iqidx = vi->first_nm_rxq + (i % vi->nnmrxq); rc = alloc_nm_txq(vi, nm_txq, iqidx, i, oid); @@ -1122,7 +1122,7 @@ */ maxp = mtu_to_max_payload(sc, mtu); oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "rxq", - CTLFLAG_RD, NULL, "rx queues"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "rx queues"); for_each_rxq(vi, i, rxq) { init_iq(&rxq->iq, sc, vi->tmr_idx, vi->pktc_idx, vi->qsize_rxq); @@ -1143,7 +1143,7 @@ #endif #ifdef TCP_OFFLOAD oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_rxq", - CTLFLAG_RD, NULL, "rx queues for offloaded TCP connections"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "rx queues for offloaded TCP connections"); for_each_ofld_rxq(vi, i, ofld_rxq) { init_iq(&ofld_rxq->iq, sc, vi->ofld_tmr_idx, vi->ofld_pktc_idx, @@ -1164,8 +1164,8 @@ /* * Now the tx queues. */ - oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "txq", CTLFLAG_RD, - NULL, "tx queues"); + oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "txq", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "tx queues"); for_each_txq(vi, i, txq) { iqidx = vi->first_rxq + (i % vi->nrxq); snprintf(name, sizeof(name), "%s txq%d", @@ -1179,7 +1179,7 @@ } #if defined(TCP_OFFLOAD) || defined(RATELIMIT) oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_txq", - CTLFLAG_RD, NULL, "tx queues for TOE/ETHOFLD"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "tx queues for TOE/ETHOFLD"); for_each_ofld_txq(vi, i, ofld_txq) { struct sysctl_oid *oid2; @@ -1198,7 +1198,7 @@ snprintf(name, sizeof(name), "%d", i); oid2 = SYSCTL_ADD_NODE(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - name, CTLFLAG_RD, NULL, "offload tx queue"); + name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "offload tx queue"); rc = alloc_wrq(sc, vi, ofld_txq, oid2); if (rc != 0) @@ -3381,14 +3381,14 @@ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL, iq->qsize * IQ_ESIZE, "descriptor ring size in bytes"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "abs_id", - CTLTYPE_INT | CTLFLAG_RD, &iq->abs_id, 0, sysctl_uint16, "I", - "absolute id of the queue"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &iq->abs_id, 0, + sysctl_uint16, "I", "absolute id of the queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id", - CTLTYPE_INT | CTLFLAG_RD, &iq->cntxt_id, 0, sysctl_uint16, "I", - "SGE context id of the queue"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &iq->cntxt_id, 0, + sysctl_uint16, "I", "SGE context id of the queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD, &iq->cidx, 0, sysctl_uint16, "I", - "consumer index"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &iq->cidx, 0, + sysctl_uint16, "I", "consumer index"); } static void @@ -3397,8 +3397,8 @@ { struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid); - oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "fl", CTLFLAG_RD, NULL, - "freelist"); + oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "fl", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "freelist"); children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_UAUTO(ctx, children, OID_AUTO, "ba", CTLFLAG_RD, @@ -3407,8 +3407,8 @@ fl->sidx * EQ_ESIZE + sc->params.sge.spg_len, "desc ring size in bytes"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id", - CTLTYPE_INT | CTLFLAG_RD, &fl->cntxt_id, 0, sysctl_uint16, "I", - "SGE context id of the freelist"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &fl->cntxt_id, 0, + sysctl_uint16, "I", "SGE context id of the freelist"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "padding", CTLFLAG_RD, NULL, fl_pad ? 1 : 0, "padding enabled"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "packing", CTLFLAG_RD, NULL, @@ -3449,8 +3449,8 @@ return (rc); } - oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, "fwq", CTLFLAG_RD, - NULL, "firmware event queue"); + oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, "fwq", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "firmware event queue"); add_iq_sysctls(&sc->ctx, oid, fwq); return (0); @@ -3477,8 +3477,8 @@ children = SYSCTL_CHILDREN(oid); snprintf(name, sizeof(name), "%d", idx); - oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, name, CTLFLAG_RD, - NULL, "ctrl queue"); + oid = SYSCTL_ADD_NODE(&sc->ctx, children, OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ctrl queue"); rc = alloc_wrq(sc, NULL, ctrlq, oid); return (rc); @@ -3542,8 +3542,8 @@ children = SYSCTL_CHILDREN(oid); snprintf(name, sizeof(name), "%d", idx); - oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD, - NULL, "rx queue"); + oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "rx queue"); children = SYSCTL_CHILDREN(oid); add_iq_sysctls(&vi->ctx, oid, &rxq->iq); @@ -3600,8 +3600,8 @@ children = SYSCTL_CHILDREN(oid); snprintf(name, sizeof(name), "%d", idx); - oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD, - NULL, "rx queue"); + oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "rx queue"); add_iq_sysctls(&vi->ctx, oid, &ofld_rxq->iq); add_fl_sysctls(pi->adapter, &vi->ctx, oid, &ofld_rxq->fl); @@ -3662,28 +3662,28 @@ children = SYSCTL_CHILDREN(oid); snprintf(name, sizeof(name), "%d", idx); - oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, name, CTLFLAG_RD, NULL, - "rx queue"); + oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "rx queue"); children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "abs_id", - CTLTYPE_INT | CTLFLAG_RD, &nm_rxq->iq_abs_id, 0, sysctl_uint16, - "I", "absolute id of the queue"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_rxq->iq_abs_id, + 0, sysctl_uint16, "I", "absolute id of the queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id", - CTLTYPE_INT | CTLFLAG_RD, &nm_rxq->iq_cntxt_id, 0, sysctl_uint16, - "I", "SGE context id of the queue"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_rxq->iq_cntxt_id, + 0, sysctl_uint16, "I", "SGE context id of the queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD, &nm_rxq->iq_cidx, 0, sysctl_uint16, "I", - "consumer index"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_rxq->iq_cidx, 0, + sysctl_uint16, "I", "consumer index"); children = SYSCTL_CHILDREN(oid); - oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "fl", CTLFLAG_RD, NULL, - "freelist"); + oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "fl", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "freelist"); children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id", - CTLTYPE_INT | CTLFLAG_RD, &nm_rxq->fl_cntxt_id, 0, sysctl_uint16, - "I", "SGE context id of the freelist"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_rxq->fl_cntxt_id, + 0, sysctl_uint16, "I", "SGE context id of the freelist"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cidx", CTLFLAG_RD, &nm_rxq->fl_cidx, 0, "consumer index"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "pidx", CTLFLAG_RD, @@ -3743,18 +3743,18 @@ nm_txq->cntxt_id = INVALID_NM_TXQ_CNTXT_ID; snprintf(name, sizeof(name), "%d", idx); - oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD, - NULL, "netmap tx queue"); + oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "netmap tx queue"); children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD, &nm_txq->cntxt_id, 0, "SGE context id of the queue"); SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD, &nm_txq->cidx, 0, sysctl_uint16, "I", - "consumer index"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_txq->cidx, 0, + sysctl_uint16, "I", "consumer index"); SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "pidx", - CTLTYPE_INT | CTLFLAG_RD, &nm_txq->pidx, 0, sysctl_uint16, "I", - "producer index"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_txq->pidx, 0, + sysctl_uint16, "I", "producer index"); return (rc); } @@ -4071,11 +4071,11 @@ SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD, &wrq->eq.cntxt_id, 0, "SGE context id of the queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD, &wrq->eq.cidx, 0, sysctl_uint16, "I", - "consumer index"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &wrq->eq.cidx, 0, + sysctl_uint16, "I", "consumer index"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pidx", - CTLTYPE_INT | CTLFLAG_RD, &wrq->eq.pidx, 0, sysctl_uint16, "I", - "producer index"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &wrq->eq.pidx, 0, + sysctl_uint16, "I", "producer index"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "sidx", CTLFLAG_RD, NULL, wrq->eq.sidx, "status page index"); SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "tx_wrs_direct", CTLFLAG_RD, @@ -4151,8 +4151,8 @@ M_ZERO | M_WAITOK); snprintf(name, sizeof(name), "%d", idx); - oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, CTLFLAG_RD, - NULL, "tx queue"); + oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "tx queue"); children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_UAUTO(&vi->ctx, children, OID_AUTO, "ba", CTLFLAG_RD, @@ -4165,17 +4165,17 @@ SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD, &eq->cntxt_id, 0, "SGE context id of the queue"); SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD, &eq->cidx, 0, sysctl_uint16, "I", - "consumer index"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &eq->cidx, 0, + sysctl_uint16, "I", "consumer index"); SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "pidx", - CTLTYPE_INT | CTLFLAG_RD, &eq->pidx, 0, sysctl_uint16, "I", - "producer index"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &eq->pidx, 0, + sysctl_uint16, "I", "producer index"); SYSCTL_ADD_INT(&vi->ctx, children, OID_AUTO, "sidx", CTLFLAG_RD, NULL, eq->sidx, "status page index"); SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "tc", - CTLTYPE_INT | CTLFLAG_RW, vi, idx, sysctl_tc, "I", - "traffic class (-1 means none)"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, idx, sysctl_tc, + "I", "traffic class (-1 means none)"); SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txcsum", CTLFLAG_RD, &txq->txcsum, "# of times hardware assisted with checksum"); Index: sys/dev/dcons/dcons_os.c =================================================================== --- sys/dev/dcons/dcons_os.c +++ sys/dev/dcons/dcons_os.c @@ -102,7 +102,8 @@ static struct dcons_softc sc[DCONS_NPORT]; -static SYSCTL_NODE(_kern, OID_AUTO, dcons, CTLFLAG_RD, 0, "Dumb Console"); +static SYSCTL_NODE(_kern, OID_AUTO, dcons, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Dumb Console"); SYSCTL_INT(_kern_dcons, OID_AUTO, poll_hz, CTLFLAG_RW, &poll_hz, 0, "dcons polling rate"); Index: sys/dev/efidev/efirt.c =================================================================== --- sys/dev/efidev/efirt.c +++ sys/dev/efidev/efirt.c @@ -109,7 +109,8 @@ } static struct mtx efi_lock; -static SYSCTL_NODE(_hw, OID_AUTO, efi, CTLFLAG_RWTUN, NULL, "EFI"); +static SYSCTL_NODE(_hw, OID_AUTO, efi, CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL, + "EFI"); static bool efi_poweroff = true; SYSCTL_BOOL(_hw_efi, OID_AUTO, poweroff, CTLFLAG_RWTUN, &efi_poweroff, 0, "If true, use EFI runtime services to power off in preference to ACPI"); Index: sys/dev/ena/ena_sysctl.c =================================================================== --- sys/dev/ena/ena_sysctl.c +++ sys/dev/ena/ena_sysctl.c @@ -38,7 +38,8 @@ static int ena_sysctl_buf_ring_size(SYSCTL_HANDLER_ARGS); static int ena_sysctl_rx_queue_size(SYSCTL_HANDLER_ARGS); -static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD, 0, "ENA driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "ENA driver parameters"); /* * Logging level for changing verbosity of the output @@ -150,12 +151,12 @@ snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, - namebuf, CTLFLAG_RD, NULL, "Queue Name"); + namebuf, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); /* TX specific stats */ tx_node = SYSCTL_ADD_NODE(ctx, queue_list, OID_AUTO, - "tx_ring", CTLFLAG_RD, NULL, "TX ring"); + "tx_ring", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TX ring"); tx_list = SYSCTL_CHILDREN(tx_node); tx_stats = &tx_ring->tx_stats; @@ -203,7 +204,7 @@ /* RX specific stats */ rx_node = SYSCTL_ADD_NODE(ctx, queue_list, OID_AUTO, - "rx_ring", CTLFLAG_RD, NULL, "RX ring"); + "rx_ring", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "RX ring"); rx_list = SYSCTL_CHILDREN(rx_node); rx_stats = &rx_ring->rx_stats; @@ -242,7 +243,7 @@ /* Stats read from device */ hw_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "hw_stats", - CTLFLAG_RD, NULL, "Statistics from hardware"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Statistics from hardware"); hw_list = SYSCTL_CHILDREN(hw_node); SYSCTL_ADD_COUNTER_U64(ctx, hw_list, OID_AUTO, "rx_packets", CTLFLAG_RD, @@ -258,7 +259,7 @@ /* ENA Admin queue stats */ admin_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "admin_stats", - CTLFLAG_RD, NULL, "ENA Admin Queue statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ENA Admin Queue statistics"); admin_list = SYSCTL_CHILDREN(admin_node); SYSCTL_ADD_U32(ctx, admin_list, OID_AUTO, "aborted_cmd", CTLFLAG_RD, @@ -289,15 +290,15 @@ child = SYSCTL_CHILDREN(tree); /* Tuneable number of buffers in the buf-ring (drbr) */ - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "buf_ring_size", CTLTYPE_INT | - CTLFLAG_RW, adapter, 0, ena_sysctl_buf_ring_size, "I", - "Size of the bufring"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "buf_ring_size", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, adapter, 0, + ena_sysctl_buf_ring_size, "I", "Size of the bufring"); /* Tuneable number of Rx ring size */ - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_queue_size", CTLTYPE_INT | - CTLFLAG_RW, adapter, 0, ena_sysctl_rx_queue_size, "I", - "Size of the Rx ring. The size should be a power of 2. " - "Max value is 8K"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_queue_size", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, adapter, 0, + ena_sysctl_rx_queue_size, "I", "Size of the Rx ring. " + "The size should be a power of 2. Max value is 8K"); } Index: sys/dev/et/if_et.c =================================================================== --- sys/dev/et/if_et.c +++ sys/dev/et/if_et.c @@ -2450,10 +2450,11 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_intr_npkts", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, et_sysctl_rx_intr_npkts, "I", - "RX IM, # packets per RX interrupt"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + et_sysctl_rx_intr_npkts, "I", "RX IM, # packets per RX interrupt"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_intr_delay", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, et_sysctl_rx_intr_delay, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + et_sysctl_rx_intr_delay, "I", "RX IM, RX interrupt delay (x10 usec)"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "tx_intr_nsegs", CTLFLAG_RW, &sc->sc_tx_intr_nsegs, 0, @@ -2461,8 +2462,8 @@ SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "timer", CTLFLAG_RW, &sc->sc_timer, 0, "TX timer"); - tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "ET statistics"); + tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "ET statistics"); parent = SYSCTL_CHILDREN(tree); /* TX/RX statistics. */ @@ -2483,8 +2484,8 @@ "1519 to 1522 bytes frames"); /* RX statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "RX MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "RX MAC statistics"); children = SYSCTL_CHILDREN(tree); ET_SYSCTL_STAT_ADD64(ctx, children, "bytes", &stats->rx_bytes, "Good bytes"); @@ -2522,8 +2523,8 @@ &stats->rx_drop, "Dropped frames"); /* TX statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "TX MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TX MAC statistics"); children = SYSCTL_CHILDREN(tree); ET_SYSCTL_STAT_ADD64(ctx, children, "bytes", &stats->tx_bytes, "Good bytes"); Index: sys/dev/etherswitch/mtkswitch/mtkswitch.c =================================================================== --- sys/dev/etherswitch/mtkswitch/mtkswitch.c +++ sys/dev/etherswitch/mtkswitch/mtkswitch.c @@ -64,7 +64,8 @@ #define DEBUG #if defined(DEBUG) -static SYSCTL_NODE(_debug, OID_AUTO, mtkswitch, CTLFLAG_RD, 0, "mtkswitch"); +static SYSCTL_NODE(_debug, OID_AUTO, mtkswitch, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "mtkswitch"); #endif static inline int mtkswitch_portforphy(int phy); Index: sys/dev/etherswitch/rtl8366/rtl8366rb.c =================================================================== --- sys/dev/etherswitch/rtl8366/rtl8366rb.c +++ sys/dev/etherswitch/rtl8366/rtl8366rb.c @@ -107,7 +107,8 @@ static int callout_blocked = 0; static int iic_select_retries = 0; static int phy_access_retries = 0; -static SYSCTL_NODE(_debug, OID_AUTO, rtl8366rb, CTLFLAG_RD, 0, "rtl8366rb"); +static SYSCTL_NODE(_debug, OID_AUTO, rtl8366rb, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "rtl8366rb"); SYSCTL_INT(_debug_rtl8366rb, OID_AUTO, callout_blocked, CTLFLAG_RW, &callout_blocked, 0, "number of times the callout couldn't acquire the bus"); SYSCTL_INT(_debug_rtl8366rb, OID_AUTO, iic_select_retries, CTLFLAG_RW, &iic_select_retries, 0, Index: sys/dev/evdev/evdev.c =================================================================== --- sys/dev/evdev/evdev.c +++ sys/dev/evdev/evdev.c @@ -69,7 +69,8 @@ int evdev_rcpt_mask = EVDEV_RCPT_SYSMOUSE | EVDEV_RCPT_KBDMUX; int evdev_sysmouse_t_axis = 0; -SYSCTL_NODE(_kern, OID_AUTO, evdev, CTLFLAG_RW, 0, "Evdev args"); +SYSCTL_NODE(_kern, OID_AUTO, evdev, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Evdev args"); #ifdef EVDEV_SUPPORT SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RW, &evdev_rcpt_mask, 0, "Who is receiving events: bit0 - sysmouse, bit1 - kbdmux, " @@ -77,7 +78,7 @@ SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RW, &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); #endif -SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD, 0, +SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Evdev input devices"); static void evdev_start_repeat(struct evdev_dev *, uint16_t); @@ -209,7 +210,8 @@ ev_sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&evdev->ev_sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_evdev_input), OID_AUTO, - ev_unit_str, CTLFLAG_RD, NULL, "", "device index"); + ev_unit_str, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "", + "device index"); SYSCTL_ADD_STRING(&evdev->ev_sysctl_ctx, SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "name", CTLFLAG_RD, Index: sys/dev/extres/clk/clk.c =================================================================== --- sys/dev/extres/clk/clk.c +++ sys/dev/extres/clk/clk.c @@ -50,7 +50,8 @@ #endif #include -SYSCTL_NODE(_hw, OID_AUTO, clock, CTLFLAG_RD, NULL, "Clocks"); +SYSCTL_NODE(_hw, OID_AUTO, clock, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Clocks"); MALLOC_DEFINE(M_CLOCK, "clocks", "Clock framework"); @@ -400,12 +401,11 @@ #endif SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "clocks", - CTLTYPE_STRING | CTLFLAG_RD, - clkdom, 0, clkdom_sysctl, - "A", - "Clock list for the domain"); + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "clocks", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + clkdom, 0, clkdom_sysctl, "A", + "Clock list for the domain"); return (clkdom); } @@ -630,7 +630,7 @@ clknode_oid = SYSCTL_ADD_NODE(&clknode->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_hw_clock), OID_AUTO, clknode->name, - CTLFLAG_RD, 0, "A clock node"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "A clock node"); SYSCTL_ADD_U64(&clknode->sysctl_ctx, SYSCTL_CHILDREN(clknode_oid), @@ -639,21 +639,21 @@ SYSCTL_ADD_PROC(&clknode->sysctl_ctx, SYSCTL_CHILDREN(clknode_oid), OID_AUTO, "parent", - CTLTYPE_STRING | CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, clknode, CLKNODE_SYSCTL_PARENT, clknode_sysctl, "A", "The clock parent"); SYSCTL_ADD_PROC(&clknode->sysctl_ctx, SYSCTL_CHILDREN(clknode_oid), OID_AUTO, "parents", - CTLTYPE_STRING | CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, clknode, CLKNODE_SYSCTL_PARENTS_LIST, clknode_sysctl, "A", "The clock parents list"); SYSCTL_ADD_PROC(&clknode->sysctl_ctx, SYSCTL_CHILDREN(clknode_oid), OID_AUTO, "childrens", - CTLTYPE_STRING | CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, clknode, CLKNODE_SYSCTL_CHILDREN_LIST, clknode_sysctl, "A", "The clock childrens list"); Index: sys/dev/extres/regulator/regulator.c =================================================================== --- sys/dev/extres/regulator/regulator.c +++ sys/dev/extres/regulator/regulator.c @@ -51,7 +51,8 @@ #include "regdev_if.h" -SYSCTL_NODE(_hw, OID_AUTO, regulator, CTLFLAG_RD, NULL, "Regulators"); +SYSCTL_NODE(_hw, OID_AUTO, regulator, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Regulators"); MALLOC_DEFINE(M_REGULATOR, "regulator", "Regulator framework"); @@ -402,7 +403,7 @@ regnode_oid = SYSCTL_ADD_NODE(®node->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_hw_regulator), OID_AUTO, regnode->name, - CTLFLAG_RD, 0, "A regulator node"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "A regulator node"); SYSCTL_ADD_INT(®node->sysctl_ctx, SYSCTL_CHILDREN(regnode_oid), @@ -453,7 +454,7 @@ SYSCTL_ADD_PROC(®node->sysctl_ctx, SYSCTL_CHILDREN(regnode_oid), OID_AUTO, "uvolt", - CTLTYPE_INT | CTLFLAG_RD, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, regnode, 0, regnode_uvolt_sysctl, "I", "Current voltage (in uV)"); Index: sys/dev/fb/vesa.c =================================================================== --- sys/dev/fb/vesa.c +++ sys/dev/fb/vesa.c @@ -102,7 +102,8 @@ /* VESA video adapter */ static video_adapter_t *vesa_adp; -static SYSCTL_NODE(_debug, OID_AUTO, vesa, CTLFLAG_RD, NULL, "VESA debugging"); +static SYSCTL_NODE(_debug, OID_AUTO, vesa, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "VESA debugging"); static int vesa_shadow_rom; SYSCTL_INT(_debug_vesa, OID_AUTO, shadow_rom, CTLFLAG_RDTUN, &vesa_shadow_rom, 0, "Enable video BIOS shadow"); Index: sys/dev/fdc/fdc.c =================================================================== --- sys/dev/fdc/fdc.c +++ sys/dev/fdc/fdc.c @@ -270,7 +270,8 @@ static void fdc_reset(struct fdc_data *); static int fd_probe_disk(struct fd_data *, int *); -static SYSCTL_NODE(_debug, OID_AUTO, fdc, CTLFLAG_RW, 0, "fdc driver"); +static SYSCTL_NODE(_debug, OID_AUTO, fdc, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "fdc driver"); static int fifo_threshold = 8; SYSCTL_INT(_debug_fdc, OID_AUTO, fifo, CTLFLAG_RW, &fifo_threshold, 0, Index: sys/dev/fdt/fdt_common.c =================================================================== --- sys/dev/fdt/fdt_common.c +++ sys/dev/fdt/fdt_common.c @@ -63,7 +63,8 @@ #define FDT_REG_CELLS 4 #define FDT_RANGES_SIZE 48 -SYSCTL_NODE(_hw, OID_AUTO, fdt, CTLFLAG_RD, 0, "Flattened Device Tree"); +SYSCTL_NODE(_hw, OID_AUTO, fdt, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Flattened Device Tree"); vm_paddr_t fdt_immr_pa; vm_offset_t fdt_immr_va; Index: sys/dev/firewire/firewire.c =================================================================== --- sys/dev/firewire/firewire.c +++ sys/dev/firewire/firewire.c @@ -68,7 +68,8 @@ int firewire_debug = 0, try_bmr = 1, hold_count = 0; SYSCTL_INT(_debug, OID_AUTO, firewire_debug, CTLFLAG_RW, &firewire_debug, 0, "FireWire driver debug flag"); -SYSCTL_NODE(_hw, OID_AUTO, firewire, CTLFLAG_RD, 0, "FireWire Subsystem"); +SYSCTL_NODE(_hw, OID_AUTO, firewire, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "FireWire Subsystem"); SYSCTL_INT(_hw_firewire, OID_AUTO, try_bmr, CTLFLAG_RW, &try_bmr, 0, "Try to be a bus manager"); SYSCTL_INT(_hw_firewire, OID_AUTO, hold_count, CTLFLAG_RW, &hold_count, 0, Index: sys/dev/firewire/fwmem.c =================================================================== --- sys/dev/firewire/fwmem.c +++ sys/dev/firewire/fwmem.c @@ -65,8 +65,9 @@ static int fwmem_speed = 2, fwmem_debug = 0; static struct fw_eui64 fwmem_eui64; SYSCTL_DECL(_hw_firewire); -static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwmem, CTLFLAG_RD, 0, - "FireWire Memory Access"); +static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwmem, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "FireWire Memory Access"); SYSCTL_UINT(_hw_firewire_fwmem, OID_AUTO, eui64_hi, CTLFLAG_RW, &fwmem_eui64.hi, 0, "Fwmem target EUI64 high"); SYSCTL_UINT(_hw_firewire_fwmem, OID_AUTO, eui64_lo, CTLFLAG_RW, Index: sys/dev/firewire/if_fwe.c =================================================================== --- sys/dev/firewire/if_fwe.c +++ sys/dev/firewire/if_fwe.c @@ -85,8 +85,8 @@ static MALLOC_DEFINE(M_FWE, "if_fwe", "Ethernet over FireWire interface"); SYSCTL_INT(_debug, OID_AUTO, if_fwe_debug, CTLFLAG_RWTUN, &fwedebug, 0, ""); SYSCTL_DECL(_hw_firewire); -static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0, - "Ethernet emulation subsystem"); +static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Ethernet emulation subsystem"); SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, stream_ch, CTLFLAG_RWTUN, &stream_ch, 0, "Stream channel to use"); SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, tx_speed, CTLFLAG_RWTUN, &tx_speed, 0, Index: sys/dev/firewire/if_fwip.c =================================================================== --- sys/dev/firewire/if_fwip.c +++ sys/dev/firewire/if_fwip.c @@ -99,7 +99,7 @@ static MALLOC_DEFINE(M_FWIP, "if_fwip", "IP over FireWire interface"); SYSCTL_INT(_debug, OID_AUTO, if_fwip_debug, CTLFLAG_RW, &fwipdebug, 0, ""); SYSCTL_DECL(_hw_firewire); -static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwip, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_firewire, OID_AUTO, fwip, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Firewire ip subsystem"); SYSCTL_INT(_hw_firewire_fwip, OID_AUTO, rx_queue_len, CTLFLAG_RWTUN, &rx_queue_len, 0, "Length of the receive queue"); Index: sys/dev/firewire/sbp.c =================================================================== --- sys/dev/firewire/sbp.c +++ sys/dev/firewire/sbp.c @@ -112,8 +112,8 @@ static int sbp_tags = 0; SYSCTL_DECL(_hw_firewire); -static SYSCTL_NODE(_hw_firewire, OID_AUTO, sbp, CTLFLAG_RD, 0, - "SBP-II Subsystem"); +static SYSCTL_NODE(_hw_firewire, OID_AUTO, sbp, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "SBP-II Subsystem"); SYSCTL_INT(_debug, OID_AUTO, sbp_debug, CTLFLAG_RWTUN, &debug, 0, "SBP debug flag"); SYSCTL_INT(_hw_firewire_sbp, OID_AUTO, auto_login, CTLFLAG_RWTUN, &auto_login, 0, Index: sys/dev/fxp/if_fxp.c =================================================================== --- sys/dev/fxp/if_fxp.c +++ sys/dev/fxp/if_fxp.c @@ -3153,12 +3153,12 @@ ctx = device_get_sysctl_ctx(sc->dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); - SYSCTL_ADD_PROC(ctx, child, - OID_AUTO, "int_delay", CTLTYPE_INT | CTLFLAG_RW, + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_delay", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->tunable_int_delay, 0, sysctl_hw_fxp_int_delay, "I", "FXP driver receive interrupt microcode bundling delay"); - SYSCTL_ADD_PROC(ctx, child, - OID_AUTO, "bundle_max", CTLTYPE_INT | CTLFLAG_RW, + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "bundle_max", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->tunable_bundle_max, 0, sysctl_hw_fxp_bundle_max, "I", "FXP driver receive interrupt microcode bundle size limit"); SYSCTL_ADD_INT(ctx, child,OID_AUTO, "rnr", CTLFLAG_RD, &sc->rnr, 0, @@ -3176,13 +3176,13 @@ sc->rnr = 0; hsp = &sc->fxp_hwstats; - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "FXP statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "FXP statistics"); parent = SYSCTL_CHILDREN(tree); /* Rx MAC statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "Rx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Rx MAC statistics"); child = SYSCTL_CHILDREN(tree); FXP_SYSCTL_STAT_ADD(ctx, child, "good_frames", &hsp->rx_good, "Good frames"); @@ -3209,8 +3209,8 @@ &hsp->rx_tco, "TCO frames"); /* Tx MAC statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "Tx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx MAC statistics"); child = SYSCTL_CHILDREN(tree); FXP_SYSCTL_STAT_ADD(ctx, child, "good_frames", &hsp->tx_good, "Good frames"); Index: sys/dev/gpio/gpiobacklight.c =================================================================== --- sys/dev/gpio/gpiobacklight.c +++ sys/dev/gpio/gpiobacklight.c @@ -131,7 +131,7 @@ ctx = device_get_sysctl_ctx(dev); tree = device_get_sysctl_tree(dev); sc->sc_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "brightness", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + "brightness", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, gpiobacklight_sysctl, "I", "backlight brightness"); return (0); Index: sys/dev/hifn/hifn7751.c =================================================================== --- sys/dev/hifn/hifn7751.c +++ sys/dev/hifn/hifn7751.c @@ -180,8 +180,8 @@ } #define WRITE_REG_1(sc, reg, val) hifn_write_reg_1(sc, reg, val) -static SYSCTL_NODE(_hw, OID_AUTO, hifn, CTLFLAG_RD, 0, - "Hifn driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, hifn, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Hifn driver parameters"); #ifdef HIFN_DEBUG static int hifn_debug = 0; Index: sys/dev/hptmv/hptproc.c =================================================================== --- sys/dev/hptmv/hptproc.c +++ sys/dev/hptmv/hptproc.c @@ -639,13 +639,16 @@ #if __FreeBSD_version >= 1100024 #define hptregister_node(name) \ - SYSCTL_ROOT_NODE(OID_AUTO, name, CTLFLAG_RW, 0, "Get/Set " #name " state root node"); \ - SYSCTL_OID(_ ## name, OID_AUTO, status, CTLTYPE_STRING|CTLFLAG_RW, \ - NULL, 0, hpt_status, "A", "Get/Set " #name " state") + SYSCTL_ROOT_NODE(OID_AUTO, name, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, \ + "Get/Set " #name " state root node"); \ + SYSCTL_OID(_ ## name, OID_AUTO, status, \ + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, \ + NULL, 0, hpt_status, "A", "Get/Set " #name " state") #else #define hptregister_node(name) \ SYSCTL_NODE(, OID_AUTO, name, CTLFLAG_RW, 0, "Get/Set " #name " state root node"); \ - SYSCTL_OID(_ ## name, OID_AUTO, status, CTLTYPE_STRING|CTLFLAG_RW, \ + SYSCTL_OID(_ ## name, OID_AUTO, status, \ + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, \ NULL, 0, hpt_status, "A", "Get/Set " #name " state") #endif Index: sys/dev/hwpmc/hwpmc_mod.c =================================================================== --- sys/dev/hwpmc/hwpmc_mod.c +++ sys/dev/hwpmc/hwpmc_mod.c @@ -275,7 +275,8 @@ */ SYSCTL_DECL(_kern_hwpmc); -SYSCTL_NODE(_kern_hwpmc, OID_AUTO, stats, CTLFLAG_RW, 0, "HWPMC stats"); +SYSCTL_NODE(_kern_hwpmc, OID_AUTO, stats, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "HWPMC stats"); /* Stats. */ @@ -313,8 +314,9 @@ TUNABLE_STR(PMC_SYSCTL_NAME_PREFIX "debugflags", pmc_debugstr, sizeof(pmc_debugstr)); SYSCTL_PROC(_kern_hwpmc, OID_AUTO, debugflags, - CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NOFETCH, - 0, 0, pmc_debugflags_sysctl_handler, "A", "debug flags"); + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_NEEDGIANT, + 0, 0, pmc_debugflags_sysctl_handler, "A", + "debug flags"); #endif Index: sys/dev/hyperv/netvsc/if_hn.c =================================================================== --- sys/dev/hyperv/netvsc/if_hn.c +++ sys/dev/hyperv/netvsc/if_hn.c @@ -576,12 +576,16 @@ &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); /* VF list */ -SYSCTL_PROC(_hw_hn, OID_AUTO, vflist, CTLFLAG_RD | CTLTYPE_STRING, - 0, 0, hn_vflist_sysctl, "A", "VF list"); +SYSCTL_PROC(_hw_hn, OID_AUTO, vflist, + CTLFLAG_RD | CTLTYPE_STRING | CTLFLAG_NEEDGIANT, 0, 0, + hn_vflist_sysctl, "A", + "VF list"); /* VF mapping */ -SYSCTL_PROC(_hw_hn, OID_AUTO, vfmap, CTLFLAG_RD | CTLTYPE_STRING, - 0, 0, hn_vfmap_sysctl, "A", "VF mapping"); +SYSCTL_PROC(_hw_hn, OID_AUTO, vfmap, + CTLFLAG_RD | CTLTYPE_STRING | CTLFLAG_NEEDGIANT, 0, 0, + hn_vfmap_sysctl, "A", + "VF mapping"); /* Transparent VF */ static int hn_xpnt_vf = 1; Index: sys/dev/if_ndis/if_ndis_usb.c =================================================================== --- sys/dev/if_ndis/if_ndis_usb.c +++ sys/dev/if_ndis/if_ndis_usb.c @@ -68,7 +68,8 @@ #include #include -SYSCTL_NODE(_hw, OID_AUTO, ndisusb, CTLFLAG_RD, 0, "NDIS USB driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, ndisusb, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "NDIS USB driver parameters"); MODULE_DEPEND(ndis, usb, 1, 1, 1); Index: sys/dev/iicbus/ad7417.c =================================================================== --- sys/dev/iicbus/ad7417.c +++ sys/dev/iicbus/ad7417.c @@ -416,7 +416,7 @@ ctx = device_get_sysctl_ctx(dev); sensroot_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor", - CTLFLAG_RD, 0, "AD7417 Sensor Information"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "AD7417 Sensor Information"); /* Now we can fill the properties into the allocated struct. */ sc->sc_nsensors = ad7417_fill_sensor_prop(dev); @@ -432,9 +432,8 @@ sysctl_name[j] = 0; oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), - OID_AUTO, - sysctl_name, CTLFLAG_RD, 0, - "Sensor Information"); + OID_AUTO, sysctl_name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Sensor Information"); if (sc->sc_sensors[i].type == ADC7417_TEMP_SENSOR) { unit = "temp"; @@ -445,10 +444,10 @@ } /* I use i to pass the sensor id. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - unit, CTLTYPE_INT | CTLFLAG_RD, dev, - i, ad7417_sensor_sysctl, - sc->sc_sensors[i].type == ADC7417_TEMP_SENSOR ? - "IK" : "I", desc); + unit, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, + i, ad7417_sensor_sysctl, + sc->sc_sensors[i].type == ADC7417_TEMP_SENSOR ? "IK" : "I", + desc); } /* Dump sensor location, ID & type. */ if (bootverbose) { Index: sys/dev/iicbus/ad7418.c =================================================================== --- sys/dev/iicbus/ad7418.c +++ sys/dev/iicbus/ad7418.c @@ -118,11 +118,11 @@ sx_init(&sc->sc_lock, "ad7418"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "temp", CTLTYPE_INT | CTLFLAG_RD, sc, 0, - ad7418_sysctl_temp, "I", "operating temperature"); + "temp", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + ad7418_sysctl_temp, "I", "operating temperature"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "volt", CTLTYPE_INT | CTLFLAG_RD, sc, 0, - ad7418_sysctl_voltage, "I", "input voltage"); + "volt", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + ad7418_sysctl_voltage, "I", "input voltage"); /* enable chip if configured in shutdown mode */ conf = ad7418_read_1(dev, AD7418_CONF); Index: sys/dev/iicbus/ads111x.c =================================================================== --- sys/dev/iicbus/ads111x.c +++ sys/dev/iicbus/ads111x.c @@ -407,16 +407,18 @@ devtree = device_get_sysctl_tree(sc->dev); snprintf(chanstr, sizeof(chanstr), "%d", chan); chantree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(devtree), OID_AUTO, - chanstr, CTLFLAG_RD, NULL, "channel data"); + chanstr, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "channel data"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(chantree), OID_AUTO, - "gain_index", CTLTYPE_INT | CTLFLAG_RWTUN, sc, chan, - ads111x_sysctl_gainidx, "I", "programmable gain amp setting, 0-7"); + "gain_index", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + sc, chan, ads111x_sysctl_gainidx, "I", + "programmable gain amp setting, 0-7"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(chantree), OID_AUTO, - "rate_index", CTLTYPE_INT | CTLFLAG_RWTUN, sc, chan, - ads111x_sysctl_rateidx, "I", "sample rate setting, 0-7"); + "rate_index", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + sc, chan, ads111x_sysctl_rateidx, "I", "sample rate setting, 0-7"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(chantree), OID_AUTO, - "voltage", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_SKIP, sc, chan, - ads111x_sysctl_voltage, "I", "sampled voltage in microvolts"); + "voltage", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_NEEDGIANT, sc, + chan, ads111x_sysctl_voltage, "I", "sampled voltage in microvolts"); c->configured = true; } @@ -556,13 +558,13 @@ ctx = device_get_sysctl_ctx(dev); tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "config", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, + "config", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, sc, 0, ads111x_sysctl_config, "I", "configuration register word"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "lo_thresh", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, + "lo_thresh", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, sc, 0, ads111x_sysctl_lothresh, "I", "comparator low threshold"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "hi_thresh", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, + "hi_thresh", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, sc, 0, ads111x_sysctl_hithresh, "I", "comparator high threshold"); /* Set up channels based on metadata or default config. */ Index: sys/dev/iicbus/adt746x.c =================================================================== --- sys/dev/iicbus/adt746x.c +++ sys/dev/iicbus/adt746x.c @@ -495,7 +495,7 @@ ctx = device_get_sysctl_ctx(dev); fanroot_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "fans", - CTLFLAG_RD, 0, "ADT Fan Information"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "ADT Fan Information"); /* Now we can fill the properties into the allocated struct. */ sc->sc_nfans = adt746x_fill_fan_prop(dev); @@ -517,12 +517,13 @@ adt746x_fan_get_pwm(&sc->sc_fans[i]); oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(fanroot_oid), - OID_AUTO, sysctl_name, CTLFLAG_RD, 0, "Fan Information"); + OID_AUTO, sysctl_name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Fan Information"); /* I use i to pass the fan id. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "pwm", CTLTYPE_INT | CTLFLAG_RW, dev, i, - adt746x_fanrpm_sysctl, "I", "Fan PWM in %"); + "pwm", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, dev, + i, adt746x_fanrpm_sysctl, "I", "Fan PWM in %"); } /* Dump fan location & type. */ @@ -621,7 +622,7 @@ ctx = device_get_sysctl_ctx(dev); sensroot_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensors", - CTLFLAG_RD, 0, "ADT Sensor Information"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "ADT Sensor Information"); /* Add the sysctl for the sensors. */ for (i = 0; i < sc->sc_nsensors; i++) { @@ -632,9 +633,8 @@ } sysctl_name[j] = 0; oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), - OID_AUTO, - sysctl_name, CTLFLAG_RD, 0, - "Sensor Information"); + OID_AUTO, sysctl_name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Sensor Information"); if (sc->sc_sensors[i].type == ADT746X_SENSOR_TEMP) { unit = "temp"; desc = "sensor unit (C)"; @@ -647,10 +647,10 @@ } /* I use i to pass the sensor id. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - unit, CTLTYPE_INT | CTLFLAG_RD, dev, i, - adt746x_sensor_sysctl, - sc->sc_sensors[i].type == ADT746X_SENSOR_TEMP ? - "IK" : "I", desc); + unit, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, i, + adt746x_sensor_sysctl, + sc->sc_sensors[i].type == ADT746X_SENSOR_TEMP ? + "IK" : "I", desc); } /* Dump sensor location & type. */ Index: sys/dev/iicbus/ds1631.c =================================================================== --- sys/dev/iicbus/ds1631.c +++ sys/dev/iicbus/ds1631.c @@ -314,7 +314,7 @@ ctx = device_get_sysctl_ctx(dev); sensroot_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor", - CTLFLAG_RD, 0, "DS1631 Sensor Information"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "DS1631 Sensor Information"); if (OF_getprop(child, "hwsensor-zone", &sc->sc_sensor.zone, sizeof(int)) < 0) @@ -358,8 +358,8 @@ sprintf(sysctl_desc,"%s %s", sc->sc_sensor.name, "(C)"); oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), - OID_AUTO, sysctl_name, CTLFLAG_RD, 0, - "Sensor Information"); + OID_AUTO, sysctl_name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Sensor Information"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, 0, ds1631_sensor_sysctl, "IK", sysctl_desc); Index: sys/dev/iicbus/ds1775.c =================================================================== --- sys/dev/iicbus/ds1775.c +++ sys/dev/iicbus/ds1775.c @@ -189,7 +189,7 @@ ctx = device_get_sysctl_ctx(dev); sensroot_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor", - CTLFLAG_RD, 0, "DS1775 Sensor Information"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "DS1775 Sensor Information"); if (OF_getprop(child, "hwsensor-zone", &sc->sc_sensor.zone, sizeof(int)) < 0) @@ -225,8 +225,8 @@ sprintf(sysctl_desc,"%s %s", sc->sc_sensor.name, "(C)"); oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), - OID_AUTO, sysctl_name, CTLFLAG_RD, 0, - "Sensor Information"); + OID_AUTO, sysctl_name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Sensor Information"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, 0, ds1775_sensor_sysctl, "IK", sysctl_desc); Index: sys/dev/iicbus/max6690.c =================================================================== --- sys/dev/iicbus/max6690.c +++ sys/dev/iicbus/max6690.c @@ -276,7 +276,7 @@ ctx = device_get_sysctl_ctx(dev); sensroot_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor", - CTLFLAG_RD, 0, "MAX6690 Sensor Information"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "MAX6690 Sensor Information"); /* Now we can fill the properties into the allocated struct. */ sc->sc_nsensors = max6690_fill_sensor_prop(dev); @@ -298,13 +298,12 @@ sprintf(sysctl_desc,"%s %s", sc->sc_sensors[i].therm.name, "(C)"); oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), - OID_AUTO, - sysctl_name, CTLFLAG_RD, 0, - "Sensor Information"); + OID_AUTO, sysctl_name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Sensor Information"); /* I use i to pass the sensor id. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", - CTLTYPE_INT | CTLFLAG_RD, dev, i % 2, - max6690_sensor_sysctl, "IK", sysctl_desc); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, i % 2, + max6690_sensor_sysctl, "IK", sysctl_desc); } /* Dump sensor location & ID. */ Index: sys/dev/ioat/ioat.c =================================================================== --- sys/dev/ioat/ioat.c +++ sys/dev/ioat/ioat.c @@ -114,7 +114,8 @@ } while (0) MALLOC_DEFINE(M_IOAT, "ioat", "ioat driver memory allocations"); -SYSCTL_NODE(_hw, OID_AUTO, ioat, CTLFLAG_RD, 0, "ioat node"); +SYSCTL_NODE(_hw, OID_AUTO, ioat, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "ioat node"); static int g_force_legacy_interrupts; SYSCTL_INT(_hw_ioat, OID_AUTO, force_legacy_interrupts, CTLFLAG_RDTUN, @@ -1932,8 +1933,8 @@ &ioat->intrdelay_max, 0, "Maximum configurable INTRDELAY on this channel (microseconds)"); - tmp = SYSCTL_ADD_NODE(ctx, par, OID_AUTO, "state", CTLFLAG_RD, NULL, - "IOAT channel internal state"); + tmp = SYSCTL_ADD_NODE(ctx, par, OID_AUTO, "state", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "IOAT channel internal state"); state = SYSCTL_CHILDREN(tmp); SYSCTL_ADD_UINT(ctx, state, OID_AUTO, "ring_size_order", CTLFLAG_RD, @@ -1951,23 +1952,24 @@ "submitter processing"); SYSCTL_ADD_PROC(ctx, state, OID_AUTO, "chansts", - CTLTYPE_STRING | CTLFLAG_RD, ioat, 0, sysctl_handle_chansts, "A", - "String of the channel status"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, ioat, 0, + sysctl_handle_chansts, "A", "String of the channel status"); SYSCTL_ADD_U16(ctx, state, OID_AUTO, "intrdelay", CTLFLAG_RD, &ioat->cached_intrdelay, 0, "Current INTRDELAY on this channel (cached, microseconds)"); - tmp = SYSCTL_ADD_NODE(ctx, par, OID_AUTO, "hammer", CTLFLAG_RD, NULL, + tmp = SYSCTL_ADD_NODE(ctx, par, OID_AUTO, "hammer", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Big hammers (mostly for testing)"); hammer = SYSCTL_CHILDREN(tmp); SYSCTL_ADD_PROC(ctx, hammer, OID_AUTO, "force_hw_reset", - CTLTYPE_INT | CTLFLAG_RW, ioat, 0, sysctl_handle_reset, "I", - "Set to non-zero to reset the hardware"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, ioat, 0, + sysctl_handle_reset, "I", "Set to non-zero to reset the hardware"); - tmp = SYSCTL_ADD_NODE(ctx, par, OID_AUTO, "stats", CTLFLAG_RD, NULL, - "IOAT channel statistics"); + tmp = SYSCTL_ADD_NODE(ctx, par, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "IOAT channel statistics"); statpar = SYSCTL_CHILDREN(tmp); SYSCTL_ADD_UQUAD(ctx, statpar, OID_AUTO, "interrupts", @@ -1990,8 +1992,8 @@ "The raw CHANERR when the channel was last halted"); SYSCTL_ADD_PROC(ctx, statpar, OID_AUTO, "desc_per_interrupt", - CTLTYPE_STRING | CTLFLAG_RD, ioat, 0, sysctl_handle_dpi, "A", - "Descriptors per interrupt"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, ioat, 0, + sysctl_handle_dpi, "A", "Descriptors per interrupt"); } static void Index: sys/dev/ioat/ioat_test.c =================================================================== --- sys/dev/ioat/ioat_test.c +++ sys/dev/ioat/ioat_test.c @@ -576,8 +576,9 @@ enable_ioat_test(enabled); return (0); } -SYSCTL_PROC(_hw_ioat, OID_AUTO, enable_ioat_test, CTLTYPE_INT | CTLFLAG_RW, - 0, 0, sysctl_enable_ioat_test, "I", +SYSCTL_PROC(_hw_ioat, OID_AUTO, enable_ioat_test, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_enable_ioat_test, "I", "Non-zero: Enable the /dev/ioat_test device"); void Index: sys/dev/ipmi/ipmi.c =================================================================== --- sys/dev/ipmi/ipmi.c +++ sys/dev/ipmi/ipmi.c @@ -93,7 +93,7 @@ static int wd_pretimeout_countdown = 120; /* sec */ static int cycle_wait = 10; /* sec */ -static SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "IPMI driver parameters"); SYSCTL_INT(_hw_ipmi, OID_AUTO, on, CTLFLAG_RWTUN, &on, 0, ""); Index: sys/dev/ipw/if_ipw.c =================================================================== --- sys/dev/ipw/if_ipw.c +++ sys/dev/ipw/if_ipw.c @@ -330,13 +330,14 @@ */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "radio", - CTLTYPE_INT | CTLFLAG_RD, sc, 0, ipw_sysctl_radio, "I", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + ipw_sysctl_radio, "I", "radio transmitter switch state (0=off, 1=on)"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "stats", - CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0, ipw_sysctl_stats, "S", - "statistics"); + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + ipw_sysctl_stats, "S", "statistics"); /* * Hook our interrupt after all initialization is complete. Index: sys/dev/isci/isci_sysctl.c =================================================================== --- sys/dev/isci/isci_sysctl.c +++ sys/dev/isci/isci_sysctl.c @@ -249,40 +249,44 @@ struct sysctl_oid *sysctl_tree = device_get_sysctl_tree(isci->device); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "coalesce_timeout", CTLTYPE_UINT | CTLFLAG_RW, isci, 0, - isci_sysctl_coalesce_timeout, "IU", + "coalesce_timeout", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + isci, 0, isci_sysctl_coalesce_timeout, "IU", "Interrupt coalescing timeout (in microseconds)"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "coalesce_number", CTLTYPE_UINT | CTLFLAG_RW, isci, 0, - isci_sysctl_coalesce_number, "IU", + "coalesce_number", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + isci, 0, isci_sysctl_coalesce_number, "IU", "Interrupt coalescing number"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "reset_remote_device_on_controller0", CTLTYPE_UINT| CTLFLAG_RW, - isci, 0, isci_sysctl_reset_remote_device_on_controller0, "IU", + "reset_remote_device_on_controller0", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, isci, 0, + isci_sysctl_reset_remote_device_on_controller0, "IU", "Reset remote device on controller 0"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "reset_remote_device_on_controller1", CTLTYPE_UINT| CTLFLAG_RW, + "reset_remote_device_on_controller1", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, isci, 0, isci_sysctl_reset_remote_device_on_controller1, "IU", "Reset remote device on controller 1"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "stop_phy", CTLTYPE_UINT| CTLFLAG_RW, isci, 0, isci_sysctl_stop_phy, - "IU", "Stop PHY on a controller"); + "stop_phy", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, isci, + 0, isci_sysctl_stop_phy, "IU", "Stop PHY on a controller"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "start_phy", CTLTYPE_UINT| CTLFLAG_RW, isci, 0, - isci_sysctl_start_phy, "IU", "Start PHY on a controller"); + "start_phy", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, isci, + 0, isci_sysctl_start_phy, "IU", "Start PHY on a controller"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "log_frozen_lun_masks", CTLTYPE_UINT| CTLFLAG_RW, isci, 0, + "log_frozen_lun_masks", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, isci, 0, isci_sysctl_log_frozen_lun_masks, "IU", "Log frozen lun masks to kernel log"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "fail_on_task_timeout", CTLTYPE_UINT | CTLFLAG_RW, isci, 0, + "fail_on_task_timeout", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, isci, 0, isci_sysctl_fail_on_task_timeout, "IU", "Fail a command that has encountered a task management timeout"); } Index: sys/dev/iscsi_initiator/isc_sm.c =================================================================== --- sys/dev/iscsi_initiator/isc_sm.c +++ sys/dev/iscsi_initiator/isc_sm.c @@ -637,14 +637,14 @@ SYSCTL_CHILDREN(sp->isc->oid), OID_AUTO, devtoname(sp->dev) + 5, // iscsi0 - CTLFLAG_RD, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "initiator"); SYSCTL_ADD_PROC(&sp->clist, SYSCTL_CHILDREN(sp->oid), OID_AUTO, "targetname", - CTLTYPE_STRING | CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, (void *)&sp->opt.targetName, 0, sysctl_handle_string, "A", "target name"); @@ -652,7 +652,7 @@ SYSCTL_CHILDREN(sp->oid), OID_AUTO, "targeaddress", - CTLTYPE_STRING | CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, (void *)&sp->opt.targetAddress, 0, sysctl_handle_string, "A", "target address"); @@ -660,7 +660,7 @@ SYSCTL_CHILDREN(sp->oid), OID_AUTO, "stats", - CTLTYPE_STRING | CTLFLAG_RD, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, (void *)sp, 0, isc_dump_stats, "A", "statistics"); Index: sys/dev/iscsi_initiator/iscsi.c =================================================================== --- sys/dev/iscsi_initiator/iscsi.c +++ sys/dev/iscsi_initiator/iscsi.c @@ -737,7 +737,7 @@ SYSCTL_STATIC_CHILDREN(_net), OID_AUTO, "iscsi_initiator", - CTLFLAG_RD, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "iSCSI Subsystem"); Index: sys/dev/iser/icl_iser.c =================================================================== --- sys/dev/iser/icl_iser.c +++ sys/dev/iser/icl_iser.c @@ -26,7 +26,8 @@ #include "icl_iser.h" -SYSCTL_NODE(_kern, OID_AUTO, iser, CTLFLAG_RW, 0, "iSER module"); +SYSCTL_NODE(_kern, OID_AUTO, iser, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "iSER module"); int iser_debug = 0; SYSCTL_INT(_kern_iser, OID_AUTO, debug, CTLFLAG_RWTUN, &iser_debug, 0, "Enable iser debug messages"); Index: sys/dev/isl/isl.c =================================================================== --- sys/dev/isl/isl.c +++ sys/dev/isl/isl.c @@ -205,38 +205,38 @@ if (use_als) { SYSCTL_ADD_PROC(sysctl_ctx, - SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "als", CTLTYPE_INT | CTLFLAG_RD, - sc, ISL_METHOD_ALS, isl_sysctl, "I", - "Current ALS sensor read-out"); + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "als", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + ISL_METHOD_ALS, isl_sysctl, "I", + "Current ALS sensor read-out"); } if (use_ir) { SYSCTL_ADD_PROC(sysctl_ctx, - SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "ir", CTLTYPE_INT | CTLFLAG_RD, - sc, ISL_METHOD_IR, isl_sysctl, "I", - "Current IR sensor read-out"); + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "ir", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + ISL_METHOD_IR, isl_sysctl, "I", + "Current IR sensor read-out"); } if (use_prox) { SYSCTL_ADD_PROC(sysctl_ctx, - SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "prox", CTLTYPE_INT | CTLFLAG_RD, - sc, ISL_METHOD_PROX, isl_sysctl, "I", - "Current proximity sensor read-out"); + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "prox", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + ISL_METHOD_PROX, isl_sysctl, "I", + "Current proximity sensor read-out"); } SYSCTL_ADD_PROC(sysctl_ctx, - SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "resolution", CTLTYPE_INT | CTLFLAG_RD, - sc, ISL_METHOD_RESOLUTION, isl_sysctl, "I", - "Current proximity sensor resolution"); + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "resolution", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + ISL_METHOD_RESOLUTION, isl_sysctl, "I", + "Current proximity sensor resolution"); SYSCTL_ADD_PROC(sysctl_ctx, - SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "range", CTLTYPE_INT | CTLFLAG_RD, - sc, ISL_METHOD_RANGE, isl_sysctl, "I", + SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "range", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + ISL_METHOD_RANGE, isl_sysctl, "I", "Current proximity sensor range"); return (0); Index: sys/dev/isp/isp_freebsd.c =================================================================== --- sys/dev/isp/isp_freebsd.c +++ sys/dev/isp/isp_freebsd.c @@ -203,7 +203,8 @@ if (chan > 0) { snprintf(name, sizeof(name), "chan%d", chan); tree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), - OID_AUTO, name, CTLFLAG_RW, 0, "Virtual channel"); + OID_AUTO, name, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Virtual channel"); } SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "wwnn", CTLFLAG_RD, &fcp->isp_wwnn, @@ -223,8 +224,8 @@ "Cause a Lost Frame on a Read"); #endif SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "role", CTLTYPE_INT | CTLFLAG_RW, isp, chan, - isp_role_sysctl, "I", "Current role"); + "role", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + isp, chan, isp_role_sysctl, "I", "Current role"); SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "speed", CTLFLAG_RD, &fcp->isp_gbspeed, 0, "Connection speed in gigabits"); Index: sys/dev/iwi/if_iwi.c =================================================================== --- sys/dev/iwi/if_iwi.c +++ sys/dev/iwi/if_iwi.c @@ -3334,12 +3334,13 @@ struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "radio", - CTLTYPE_INT | CTLFLAG_RD, sc, 0, iwi_sysctl_radio, "I", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + iwi_sysctl_radio, "I", "radio transmitter switch state (0=off, 1=on)"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "stats", - CTLTYPE_OPAQUE | CTLFLAG_RD, sc, 0, iwi_sysctl_stats, "S", - "statistics"); + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + iwi_sysctl_stats, "S", "statistics"); sc->bluetooth = 0; SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "bluetooth", @@ -3513,8 +3514,8 @@ callout_init_mtx(&sc->sc_ledtimer, &sc->sc_mtx, 0); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "softled", CTLTYPE_INT | CTLFLAG_RW, sc, 0, - iwi_sysctl_softled, "I", "enable/disable software LED support"); + "softled", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + iwi_sysctl_softled, "I", "enable/disable software LED support"); SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "ledpin", CTLFLAG_RW, &sc->sc_ledpin, 0, "pin setting to turn activity LED on"); Index: sys/dev/jme/if_jme.c =================================================================== --- sys/dev/jme/if_jme.c +++ sys/dev/jme/if_jme.c @@ -994,24 +994,24 @@ child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->jme_dev)); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_to", - CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_to, 0, - sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->jme_tx_coal_to, + 0, sysctl_hw_jme_tx_coal_to, "I", "jme tx coalescing timeout"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_coal_pkt", - CTLTYPE_INT | CTLFLAG_RW, &sc->jme_tx_coal_pkt, 0, - sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->jme_tx_coal_pkt, + 0, sysctl_hw_jme_tx_coal_pkt, "I", "jme tx coalescing packet"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_to", - CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_to, 0, - sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->jme_rx_coal_to, + 0, sysctl_hw_jme_rx_coal_to, "I", "jme rx coalescing timeout"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_coal_pkt", - CTLTYPE_INT | CTLFLAG_RW, &sc->jme_rx_coal_pkt, 0, - sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->jme_rx_coal_pkt, + 0, sysctl_hw_jme_rx_coal_pkt, "I", "jme rx coalescing packet"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", - CTLTYPE_INT | CTLFLAG_RW, &sc->jme_process_limit, 0, - sysctl_hw_jme_proc_limit, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &sc->jme_process_limit, 0, sysctl_hw_jme_proc_limit, "I", "max number of Rx events to process"); /* Pull in device tunables. */ @@ -1084,13 +1084,13 @@ if ((sc->jme_flags & JME_FLAG_HWMIB) == 0) return; - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "JME statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "JME statistics"); parent = SYSCTL_CHILDREN(tree); /* Rx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "Rx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Rx MAC statistics"); child = SYSCTL_CHILDREN(tree); JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", &stats->rx_good_frames, "Good frames"); @@ -1106,8 +1106,8 @@ &stats->rx_bad_frames, "Bad frames"); /* Tx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "Tx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx MAC statistics"); child = SYSCTL_CHILDREN(tree); JME_SYSCTL_STAT_ADD32(ctx, child, "good_frames", &stats->tx_good_frames, "Good frames"); Index: sys/dev/kbd/kbd.c =================================================================== --- sys/dev/kbd/kbd.c +++ sys/dev/kbd/kbd.c @@ -85,7 +85,8 @@ static keyboard_t **keyboard = &kbd_ini; static int keymap_restrict_change; -static SYSCTL_NODE(_hw, OID_AUTO, kbd, CTLFLAG_RD, 0, "kbd"); +static SYSCTL_NODE(_hw, OID_AUTO, kbd, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "kbd"); SYSCTL_INT(_hw_kbd, OID_AUTO, keymap_restrict_change, CTLFLAG_RW, &keymap_restrict_change, 0, "restrict ability to change keymap"); Index: sys/dev/liquidio/lio_sysctl.c =================================================================== --- sys/dev/liquidio/lio_sysctl.c +++ sys/dev/liquidio/lio_sysctl.c @@ -155,48 +155,46 @@ oct_dev->fw_info.lio_firmware_version, 0, "Firmware version"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "stats_interval", - CTLTYPE_INT | CTLFLAG_RW, lio, 0, - lio_set_stats_interval, "I", - "Set Stats Updation Timer in milli seconds"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, lio, 0, + lio_set_stats_interval, "I", + "Set Stats Updation Timer in milli seconds"); SYSCTL_ADD_UQUAD(ctx, child, OID_AUTO, "link_state_changes", CTLFLAG_RD, &lio->link_changes, "Link Change Counter"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "eeprom-dump", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, lio, 0, lio_get_eeprom, "A", "EEPROM information"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "fc", - CTLTYPE_INT | CTLFLAG_RW, lio, 0, - lio_get_set_pauseparam, "I", - "Get and set pause parameters.\n" \ - "0 - off\n" \ - "1 - rx pause\n" \ - "2 - tx pause \n" \ - "3 - rx and tx pause"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, lio, 0, + lio_get_set_pauseparam, "I", + "Get and set pause parameters.\n" \ + "0 - off\n" \ + "1 - rx pause\n" \ + "2 - tx pause \n" \ + "3 - rx and tx pause"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "register-dump", - CTLTYPE_STRING | CTLFLAG_RD, - lio, 0, lio_get_regs, "A", - "Dump registers in raw format"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, lio, 0, + lio_get_regs, "A", "Dump registers in raw format"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "fwmsglevel", - CTLTYPE_INT | CTLFLAG_RW, lio, 0, - lio_get_set_fwmsglevel, - "I", "Get or set firmware message level"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, lio, 0, + lio_get_set_fwmsglevel, "I", "Get or set firmware message level"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxq_descriptors", - CTLTYPE_INT | CTLFLAG_RW, lio, LIO_SET_RING_RX, - lio_set_ringparam, "I", "Set RX ring parameter"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, lio, LIO_SET_RING_RX, + lio_set_ringparam, "I", "Set RX ring parameter"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txq_descriptors", - CTLTYPE_INT | CTLFLAG_RW, lio, LIO_SET_RING_TX, - lio_set_ringparam, "I", "Set TX ring parameter"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, lio, LIO_SET_RING_TX, + lio_set_ringparam, "I", "Set TX ring parameter"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "max_rxq_descriptors", - CTLTYPE_INT | CTLFLAG_RD, lio, LIO_SET_RING_RX, - lio_get_ringparam, "I", "Max RX descriptors"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, lio, LIO_SET_RING_RX, + lio_get_ringparam, "I", "Max RX descriptors"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "max_txq_descriptors", - CTLTYPE_INT | CTLFLAG_RD, lio, LIO_SET_RING_TX, - lio_get_ringparam, "I", "Max TX descriptors"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, lio, LIO_SET_RING_TX, + lio_get_ringparam, "I", "Max TX descriptors"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "active_queues", - CTLTYPE_INT | CTLFLAG_RW, lio, 0, lio_set_channels, - "I", "Set channels information"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, lio, 0, + lio_set_channels, "I", "Set channels information"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "max_queues", - CTLTYPE_INT | CTLFLAG_RD, lio, 0, lio_get_channels, - "I", "Get channels information"); + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, lio, 0, + lio_get_channels, "I", "Get channels information"); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "tx_budget", CTLFLAG_RW, &oct_dev->tx_budget, 0, "TX process pkt budget"); @@ -206,7 +204,7 @@ /* IRQ Coalescing Parameters */ root_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "coalesce", - CTLFLAG_RD, NULL, "Get and Set Coalesce"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Get and Set Coalesce"); root_list = SYSCTL_CHILDREN(root_node); @@ -271,13 +269,13 @@ "QU", NULL); /* Root Node of all the Stats */ - root_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "Root Node of all the Stats"); + root_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Root Node of all the Stats"); root_list = SYSCTL_CHILDREN(root_node); /* Firmware Tx Stats */ - stat_node = SYSCTL_ADD_NODE(ctx, root_list, OID_AUTO, "fwtx",CTLFLAG_RD, - NULL, "Firmware Tx Statistics"); + stat_node = SYSCTL_ADD_NODE(ctx, root_list, OID_AUTO, "fwtx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Firmware Tx Statistics"); stat_list = SYSCTL_CHILDREN(stat_node); SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "tx_total_sent", CTLFLAG_RD, @@ -317,7 +315,7 @@ /* MAC Tx Stats */ stat_node = SYSCTL_ADD_NODE(ctx, root_list, OID_AUTO, "mactx", - CTLFLAG_RD, NULL, "MAC Tx Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "MAC Tx Statistics"); stat_list = SYSCTL_CHILDREN(stat_node); SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "mac_tx_total_pkts", @@ -370,7 +368,7 @@ /* Firmware Rx Stats */ stat_node = SYSCTL_ADD_NODE(ctx, root_list, OID_AUTO, "fwrx", - CTLFLAG_RD, NULL, "Firmware Rx Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Firmware Rx Statistics"); stat_list = SYSCTL_CHILDREN(stat_node); SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "rx_total_rcvd", CTLFLAG_RD, @@ -437,7 +435,7 @@ "Firmware Rx Packets Forward Rate"); /* MAC Rx Stats */ stat_node = SYSCTL_ADD_NODE(ctx, root_list, OID_AUTO, "macrx", - CTLFLAG_RD, NULL, "MAC Rx Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "MAC Rx Statistics"); stat_list = SYSCTL_CHILDREN(stat_node); SYSCTL_ADD_UQUAD(ctx, stat_list, OID_AUTO, "mac_rx_total_rcvd", @@ -484,7 +482,7 @@ snprintf(namebuf, QUEUE_NAME_LEN, "tx-%d", i); queue_node = SYSCTL_ADD_NODE(ctx, root_list, OID_AUTO, namebuf, - CTLFLAG_RD, NULL, "Input Queue Name"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Input Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); /* packets to network port */ @@ -567,8 +565,7 @@ snprintf(namebuf, QUEUE_NAME_LEN, "rx-%d", i); queue_node = SYSCTL_ADD_NODE(ctx, root_list, OID_AUTO, namebuf, - CTLFLAG_RD, NULL, - "Output Queue Name"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Output Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); /* packets send to TCP/IP network stack */ Index: sys/dev/malo/if_malo.c =================================================================== --- sys/dev/malo/if_malo.c +++ sys/dev/malo/if_malo.c @@ -64,7 +64,7 @@ #include -SYSCTL_NODE(_hw, OID_AUTO, malo, CTLFLAG_RD, 0, +SYSCTL_NODE(_hw, OID_AUTO, malo, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Marvell 88w8335 driver parameters"); static int malo_txcoalesce = 8; /* # tx pkts to q before poking f/w*/ Index: sys/dev/malo/if_malo_pci.c =================================================================== --- sys/dev/malo/if_malo_pci.c +++ sys/dev/malo/if_malo_pci.c @@ -84,7 +84,7 @@ * Tunable variables. */ SYSCTL_DECL(_hw_malo); -static SYSCTL_NODE(_hw_malo, OID_AUTO, pci, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_malo, OID_AUTO, pci, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Marvell 88W8335 driver PCI parameters"); static int msi_disable = 0; /* MSI disabled */ Index: sys/dev/mfi/mfi.c =================================================================== --- sys/dev/mfi/mfi.c +++ sys/dev/mfi/mfi.c @@ -130,7 +130,8 @@ static void mfi_check_command_post(struct mfi_softc *sc, struct mfi_command *cm); static int mfi_check_for_sscd(struct mfi_softc *sc, struct mfi_command *cm); -SYSCTL_NODE(_hw, OID_AUTO, mfi, CTLFLAG_RD, 0, "MFI driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, mfi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "MFI driver parameters"); static int mfi_event_locale = MFI_EVT_LOCALE_ALL; SYSCTL_INT(_hw_mfi, OID_AUTO, event_locale, CTLFLAG_RWTUN, &mfi_event_locale, 0, "event message locale"); Index: sys/dev/mge/if_mge.c =================================================================== --- sys/dev/mge/if_mge.c +++ sys/dev/mge/if_mge.c @@ -2143,15 +2143,15 @@ ctx = device_get_sysctl_ctx(sc->dev); children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "int_coal", - CTLFLAG_RD, 0, "MGE Interrupts coalescing"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "MGE Interrupts coalescing"); children = SYSCTL_CHILDREN(tree); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_time", - CTLTYPE_UINT | CTLFLAG_RW, sc, MGE_IC_RX, mge_sysctl_ic, - "I", "IC RX time threshold"); + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, MGE_IC_RX, + mge_sysctl_ic, "I", "IC RX time threshold"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_time", - CTLTYPE_UINT | CTLFLAG_RW, sc, MGE_IC_TX, mge_sysctl_ic, - "I", "IC TX time threshold"); + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, MGE_IC_TX, + mge_sysctl_ic, "I", "IC TX time threshold"); } static int Index: sys/dev/mlx4/mlx4_core/mlx4_main.c =================================================================== --- sys/dev/mlx4/mlx4_core/mlx4_main.c +++ sys/dev/mlx4/mlx4_core/mlx4_main.c @@ -3792,7 +3792,8 @@ ctx = &dev->hw_ctx; sysctl_ctx_init(ctx); node = SYSCTL_ADD_NODE(ctx,SYSCTL_CHILDREN(pdev->dev.kobj.oidp), - OID_AUTO, "hw" , CTLFLAG_RD, 0, "mlx4 dev hw information"); + OID_AUTO, "hw" , CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "mlx4 dev hw information"); if (node != NULL) { node_list = SYSCTL_CHILDREN(node); SYSCTL_ADD_STRING(ctx, node_list, OID_AUTO, Index: sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c =================================================================== --- sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c +++ sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c @@ -2664,9 +2664,10 @@ sysctl_ctx_init(ctx); priv->conf_sysctl = SYSCTL_ADD_NODE(ctx, SYSCTL_STATIC_CHILDREN(_hw), - OID_AUTO, dev->if_xname, CTLFLAG_RD, 0, "mlx4 10gig ethernet"); + OID_AUTO, dev->if_xname, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "mlx4 10gig ethernet"); node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(priv->conf_sysctl), OID_AUTO, - "conf", CTLFLAG_RD, NULL, "Configuration"); + "conf", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Configuration"); node_list = SYSCTL_CHILDREN(node); SYSCTL_ADD_UINT(ctx, node_list, OID_AUTO, "msg_enable", @@ -2698,7 +2699,8 @@ "PCI device name"); /* Add coalescer configuration. */ coal = SYSCTL_ADD_NODE(ctx, node_list, OID_AUTO, - "coalesce", CTLFLAG_RD, NULL, "Interrupt coalesce configuration"); + "coalesce", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Interrupt coalesce configuration"); coal_list = SYSCTL_CHILDREN(coal); SYSCTL_ADD_UINT(ctx, coal_list, OID_AUTO, "pkt_rate_low", CTLFLAG_RW, &priv->pkt_rate_low, 0, @@ -2738,7 +2740,7 @@ ctx = &priv->stat_ctx; sysctl_ctx_init(ctx); priv->stat_sysctl = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(priv->conf_sysctl), OID_AUTO, - "stat", CTLFLAG_RD, NULL, "Statistics"); + "stat", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Statistics"); node_list = SYSCTL_CHILDREN(priv->stat_sysctl); #ifdef MLX4_EN_PERF_STAT @@ -2860,7 +2862,7 @@ tx_ring = priv->tx_ring[i]; snprintf(namebuf, sizeof(namebuf), "tx_ring%d", i); ring_node = SYSCTL_ADD_NODE(ctx, node_list, OID_AUTO, namebuf, - CTLFLAG_RD, NULL, "TX Ring"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TX Ring"); ring_list = SYSCTL_CHILDREN(ring_node); SYSCTL_ADD_U64(ctx, ring_list, OID_AUTO, "packets", CTLFLAG_RD, &tx_ring->packets, 0, "TX packets"); @@ -2877,7 +2879,7 @@ rx_ring = priv->rx_ring[i]; snprintf(namebuf, sizeof(namebuf), "rx_ring%d", i); ring_node = SYSCTL_ADD_NODE(ctx, node_list, OID_AUTO, namebuf, - CTLFLAG_RD, NULL, "RX Ring"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "RX Ring"); ring_list = SYSCTL_CHILDREN(ring_node); SYSCTL_ADD_U64(ctx, ring_list, OID_AUTO, "packets", CTLFLAG_RD, &rx_ring->packets, 0, "RX packets"); Index: sys/dev/mlx5/mlx5_core/mlx5_main.c =================================================================== --- sys/dev/mlx5/mlx5_core/mlx5_main.c +++ sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -56,7 +56,8 @@ MODULE_DEPEND(mlx5, firmware, 1, 1, 1); MODULE_VERSION(mlx5, 1); -SYSCTL_NODE(_hw, OID_AUTO, mlx5, CTLFLAG_RW, 0, "mlx5 hardware controls"); +SYSCTL_NODE(_hw, OID_AUTO, mlx5, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "mlx5 hardware controls"); int mlx5_core_debug_mask; SYSCTL_INT(_hw_mlx5, OID_AUTO, debug_mask, CTLFLAG_RWTUN, @@ -1332,7 +1333,7 @@ pme_sysctl_node = SYSCTL_ADD_NODE(&dev->sysctl_ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(bsddev)), - OID_AUTO, "pme_stats", CTLFLAG_RD, NULL, + OID_AUTO, "pme_stats", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Port module event statistics"); if (pme_sysctl_node == NULL) { err = -ENOMEM; @@ -1340,7 +1341,7 @@ } pme_err_sysctl_node = SYSCTL_ADD_NODE(&dev->sysctl_ctx, SYSCTL_CHILDREN(pme_sysctl_node), - OID_AUTO, "errors", CTLFLAG_RD, NULL, + OID_AUTO, "errors", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Port module event error statistics"); if (pme_err_sysctl_node == NULL) { err = -ENOMEM; Index: sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c =================================================================== --- sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c +++ sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c @@ -39,7 +39,7 @@ sysctl_ctx_init(ctx); node = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, - buffer, CTLFLAG_RD, NULL, "Statistics"); + buffer, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Statistics"); if (node == NULL) return; for (x = 0; x != num; x++) { @@ -59,7 +59,7 @@ sysctl_ctx_init(ctx); node = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, - buffer, CTLFLAG_RD, NULL, "Statistics"); + buffer, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Statistics"); if (node == NULL) return; for (x = 0; x != num; x++) { @@ -1317,7 +1317,7 @@ /* create root node */ node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, - "diagnostics", CTLFLAG_RD, NULL, "Diagnostics"); + "diagnostics", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Diagnostics"); if (node == NULL) return; @@ -1389,7 +1389,7 @@ /* create root node */ node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, - "conf", CTLFLAG_RW, NULL, "Configuration"); + "conf", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Configuration"); if (node == NULL) return; for (x = 0; x != MLX5E_PARAMS_NUM; x++) { @@ -1431,7 +1431,8 @@ /* create fec node */ fec_node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, - "fec", CTLFLAG_RW, NULL, "Forward Error Correction"); + "fec", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "Forward Error Correction"); if (fec_node == NULL) return; @@ -1493,7 +1494,8 @@ /* create qos node */ qos_node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, - "qos", CTLFLAG_RW, NULL, "Quality Of Service configuration"); + "qos", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "Quality Of Service configuration"); if (qos_node == NULL) return; Index: sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c =================================================================== --- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c +++ sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c @@ -143,7 +143,7 @@ node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, - "tls", CTLFLAG_RW, NULL, "Hardware TLS offload"); + "tls", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Hardware TLS offload"); if (node == NULL) return (0); Index: sys/dev/mlx5/mlx5_en/mlx5_en_main.c =================================================================== --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -1108,7 +1108,7 @@ static int mlx5e_fast_calibration = 1; static int mlx5e_normal_calibration = 30; -static SYSCTL_NODE(_hw_mlx5, OID_AUTO, calibr, CTLFLAG_RW, 0, +static SYSCTL_NODE(_hw_mlx5, OID_AUTO, calibr, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "MLX5 timestamp calibration parameteres"); SYSCTL_INT(_hw_mlx5_calibr, OID_AUTO, duration, CTLFLAG_RWTUN, @@ -3843,8 +3843,8 @@ mlx5e_add_hw_stats(struct mlx5e_priv *priv) { SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_hw), - OID_AUTO, "fw_version", CTLTYPE_STRING | CTLFLAG_RD, priv, 0, - sysctl_firmware, "A", "HCA firmware version"); + OID_AUTO, "fw_version", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + priv, 0, sysctl_firmware, "A", "HCA firmware version"); SYSCTL_ADD_STRING(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_hw), OID_AUTO, "board_id", CTLFLAG_RD, priv->mdev->board_id, 0, @@ -4320,14 +4320,16 @@ /* ifnet sysctl tree */ sysctl_ctx_init(&priv->sysctl_ctx); priv->sysctl_ifnet = SYSCTL_ADD_NODE(&priv->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_dev), - OID_AUTO, ifp->if_dname, CTLFLAG_RD, 0, "MLX5 ethernet - interface name"); + OID_AUTO, ifp->if_dname, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "MLX5 ethernet - interface name"); if (priv->sysctl_ifnet == NULL) { mlx5_core_err(mdev, "SYSCTL_ADD_NODE() failed\n"); goto err_free_sysctl; } snprintf(unit, sizeof(unit), "%d", ifp->if_dunit); priv->sysctl_ifnet = SYSCTL_ADD_NODE(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), - OID_AUTO, unit, CTLFLAG_RD, 0, "MLX5 ethernet - interface unit"); + OID_AUTO, unit, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "MLX5 ethernet - interface unit"); if (priv->sysctl_ifnet == NULL) { mlx5_core_err(mdev, "SYSCTL_ADD_NODE() failed\n"); goto err_free_sysctl; @@ -4336,7 +4338,8 @@ /* HW sysctl tree */ child = SYSCTL_CHILDREN(device_get_sysctl_tree(mdev->pdev->dev.bsddev)); priv->sysctl_hw = SYSCTL_ADD_NODE(&priv->sysctl_ctx, child, - OID_AUTO, "hw", CTLFLAG_RD, 0, "MLX5 ethernet dev hw"); + OID_AUTO, "hw", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "MLX5 ethernet dev hw"); if (priv->sysctl_hw == NULL) { mlx5_core_err(mdev, "SYSCTL_ADD_NODE() failed\n"); goto err_free_sysctl; Index: sys/dev/mlx5/mlx5_en/mlx5_en_rl.c =================================================================== --- sys/dev/mlx5/mlx5_en/mlx5_en_rl.c +++ sys/dev/mlx5/mlx5_en/mlx5_en_rl.c @@ -770,7 +770,7 @@ /* create root node */ node = SYSCTL_ADD_NODE(&rl->ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, - "rate_limit", CTLFLAG_RW, NULL, "Rate limiting support"); + "rate_limit", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Rate limiting support"); if (node != NULL) { /* create SYSCTLs */ @@ -782,7 +782,7 @@ } stats = SYSCTL_ADD_NODE(&rl->ctx, SYSCTL_CHILDREN(node), - OID_AUTO, "stats", CTLFLAG_RD, NULL, + OID_AUTO, "stats", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Rate limiting statistics"); if (stats != NULL) { /* create SYSCTLs */ Index: sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c =================================================================== --- sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c +++ sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c @@ -421,12 +421,14 @@ return (err); parent = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(dev->ib_dev.dev.kobj.oidp), - OID_AUTO, "cong", CTLFLAG_RW, NULL, "Congestion control"); + OID_AUTO, "cong", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "Congestion control"); if (parent == NULL) return (-ENOMEM); node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(parent), - OID_AUTO, "conf", CTLFLAG_RW, NULL, "Configuration"); + OID_AUTO, "conf", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "Configuration"); if (node == NULL) { sysctl_ctx_free(&dev->congestion.ctx); return (-ENOMEM); @@ -442,7 +444,8 @@ } node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(parent), - OID_AUTO, "stats", CTLFLAG_RD, NULL, "Statistics"); + OID_AUTO, "stats", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Statistics"); if (node == NULL) { sysctl_ctx_free(&dev->congestion.ctx); return (-ENOMEM); Index: sys/dev/mmc/mmc.c =================================================================== --- sys/dev/mmc/mmc.c +++ sys/dev/mmc/mmc.c @@ -134,7 +134,8 @@ { 0x0, 0x0, NULL, 0x0 } }; -static SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD, NULL, "mmc driver"); +static SYSCTL_NODE(_hw, OID_AUTO, mmc, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "mmc driver"); static int mmc_debug; SYSCTL_INT(_hw_mmc, OID_AUTO, debug, CTLFLAG_RWTUN, &mmc_debug, 0, Index: sys/dev/mmc/mmcsd.c =================================================================== --- sys/dev/mmc/mmcsd.c +++ sys/dev/mmc/mmcsd.c @@ -156,7 +156,8 @@ "NO MEMORY" }; -static SYSCTL_NODE(_hw, OID_AUTO, mmcsd, CTLFLAG_RD, NULL, "mmcsd driver"); +static SYSCTL_NODE(_hw, OID_AUTO, mmcsd, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "mmcsd driver"); static int mmcsd_cache = 1; SYSCTL_INT(_hw_mmcsd, OID_AUTO, cache, CTLFLAG_RDTUN, &mmcsd_cache, 0, Index: sys/dev/mpr/mpr.c =================================================================== --- sys/dev/mpr/mpr.c +++ sys/dev/mpr/mpr.c @@ -112,7 +112,8 @@ static int mpr_dump_reqs(SYSCTL_HANDLER_ARGS); static void mpr_parse_debug(struct mpr_softc *sc, char *list); -SYSCTL_NODE(_hw, OID_AUTO, mpr, CTLFLAG_RD, 0, "MPR Driver Parameters"); +SYSCTL_NODE(_hw, OID_AUTO, mpr, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "MPR Driver Parameters"); MALLOC_DEFINE(M_MPR, "mpr", "mpr driver memory"); @@ -1799,7 +1800,7 @@ sysctl_ctx_init(&sc->sysctl_ctx); sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_hw_mpr), OID_AUTO, tmpstr2, - CTLFLAG_RD, 0, tmpstr); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr); if (sc->sysctl_tree == NULL) return; sysctl_ctx = &sc->sysctl_ctx; @@ -1889,8 +1890,9 @@ "spinup after SATA ID error"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "dump_reqs", CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_SKIP, sc, 0, - mpr_dump_reqs, "I", "Dump Active Requests"); + OID_AUTO, "dump_reqs", + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_NEEDGIANT, + sc, 0, mpr_dump_reqs, "I", "Dump Active Requests"); SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "use_phy_num", CTLFLAG_RD, &sc->use_phynum, 0, Index: sys/dev/mps/mps.c =================================================================== --- sys/dev/mps/mps.c +++ sys/dev/mps/mps.c @@ -110,7 +110,8 @@ static int mps_dump_reqs(SYSCTL_HANDLER_ARGS); static void mps_parse_debug(struct mps_softc *sc, char *list); -SYSCTL_NODE(_hw, OID_AUTO, mps, CTLFLAG_RD, 0, "MPS Driver Parameters"); +SYSCTL_NODE(_hw, OID_AUTO, mps, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "MPS Driver Parameters"); MALLOC_DEFINE(M_MPT2, "mps", "mpt2 driver memory"); MALLOC_DECLARE(M_MPSUSER); @@ -1704,7 +1705,7 @@ sysctl_ctx_init(&sc->sysctl_ctx); sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_hw_mps), OID_AUTO, tmpstr2, - CTLFLAG_RD, 0, tmpstr); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr); if (sc->sysctl_tree == NULL) return; sysctl_ctx = &sc->sysctl_ctx; @@ -1798,16 +1799,19 @@ "spinup after SATA ID error"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "mapping_table_dump", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + OID_AUTO, "mapping_table_dump", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, mps_mapping_dump, "A", "Mapping Table Dump"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "encl_table_dump", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + OID_AUTO, "encl_table_dump", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, mps_mapping_encl_dump, "A", "Enclosure Table Dump"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "dump_reqs", CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_SKIP, sc, 0, - mps_dump_reqs, "I", "Dump Active Requests"); + OID_AUTO, "dump_reqs", + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_NEEDGIANT, + sc, 0, mps_dump_reqs, "I", "Dump Active Requests"); SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, "use_phy_num", CTLFLAG_RD, &sc->use_phynum, 0, Index: sys/dev/mpt/mpt_raid.c =================================================================== --- sys/dev/mpt/mpt_raid.c +++ sys/dev/mpt/mpt_raid.c @@ -1826,19 +1826,19 @@ struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "vol_member_wce", CTLTYPE_STRING | CTLFLAG_RW, mpt, 0, - mpt_raid_sysctl_vol_member_wce, "A", - "volume member WCE(On,Off,On-During-Rebuild,NC)"); + "vol_member_wce", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + mpt, 0, mpt_raid_sysctl_vol_member_wce, "A", + "volume member WCE(On,Off,On-During-Rebuild,NC)"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "vol_queue_depth", CTLTYPE_INT | CTLFLAG_RW, mpt, 0, - mpt_raid_sysctl_vol_queue_depth, "I", - "default volume queue depth"); + "vol_queue_depth", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + mpt, 0, mpt_raid_sysctl_vol_queue_depth, "I", + "default volume queue depth"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "vol_resync_rate", CTLTYPE_INT | CTLFLAG_RW, mpt, 0, - mpt_raid_sysctl_vol_resync_rate, "I", - "volume resync priority (0 == NC, 1 - 255)"); + "vol_resync_rate", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + mpt, 0, mpt_raid_sysctl_vol_resync_rate, "I", + "volume resync priority (0 == NC, 1 - 255)"); SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "nonoptimal_volumes", CTLFLAG_RD, &mpt->raid_nonopt_volumes, 0, Index: sys/dev/mrsas/mrsas.c =================================================================== --- sys/dev/mrsas/mrsas.c +++ sys/dev/mrsas/mrsas.c @@ -178,7 +178,8 @@ u_int32_t req_desc_hi); -SYSCTL_NODE(_hw, OID_AUTO, mrsas, CTLFLAG_RD, 0, "MRSAS Driver Parameters"); +SYSCTL_NODE(_hw, OID_AUTO, mrsas, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "MRSAS Driver Parameters"); /* * PCI device struct and table @@ -429,7 +430,7 @@ sysctl_ctx_init(&sc->sysctl_ctx); sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_hw_mrsas), OID_AUTO, tmpstr2, - CTLFLAG_RD, 0, tmpstr); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr); if (sc->sysctl_tree == NULL) return; sysctl_ctx = &sc->sysctl_ctx; Index: sys/dev/msk/if_msk.c =================================================================== --- sys/dev/msk/if_msk.c +++ sys/dev/msk/if_msk.c @@ -1798,7 +1798,8 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "process_limit", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "process_limit", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->msk_process_limit, 0, sysctl_hw_msk_proc_limit, "I", "max number of Rx events to process"); @@ -4480,11 +4481,13 @@ #undef MSK_READ_MIB64 #define MSK_SYSCTL_STAT32(sc, c, o, p, n, d) \ - SYSCTL_ADD_PROC(c, p, OID_AUTO, o, CTLTYPE_UINT | CTLFLAG_RD, \ + SYSCTL_ADD_PROC(c, p, OID_AUTO, o, \ + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, \ sc, offsetof(struct msk_hw_stats, n), msk_sysctl_stat32, \ "IU", d) #define MSK_SYSCTL_STAT64(sc, c, o, p, n, d) \ - SYSCTL_ADD_PROC(c, p, OID_AUTO, o, CTLTYPE_U64 | CTLFLAG_RD, \ + SYSCTL_ADD_PROC(c, p, OID_AUTO, o, \ + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, \ sc, offsetof(struct msk_hw_stats, n), msk_sysctl_stat64, \ "QU", d) @@ -4498,11 +4501,11 @@ ctx = device_get_sysctl_ctx(sc_if->msk_if_dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc_if->msk_if_dev)); - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "MSK Statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "MSK Statistics"); schild = SYSCTL_CHILDREN(tree); - tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "MSK RX Statistics"); + tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "MSK RX Statistics"); child = SYSCTL_CHILDREN(tree); MSK_SYSCTL_STAT32(sc_if, ctx, "ucast_frames", child, rx_ucast_frames, "Good unicast frames"); @@ -4539,8 +4542,8 @@ MSK_SYSCTL_STAT32(sc_if, ctx, "overflows", child, rx_fifo_oflows, "FIFO overflows"); - tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "MSK TX Statistics"); + tree = SYSCTL_ADD_NODE(ctx, schild, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "MSK TX Statistics"); child = SYSCTL_CHILDREN(tree); MSK_SYSCTL_STAT32(sc_if, ctx, "ucast_frames", child, tx_ucast_frames, "Unicast frames"); Index: sys/dev/mwl/if_mwl.c =================================================================== --- sys/dev/mwl/if_mwl.c +++ sys/dev/mwl/if_mwl.c @@ -188,7 +188,8 @@ static void mwl_sysctlattach(struct mwl_softc *); static void mwl_announce(struct mwl_softc *); -SYSCTL_NODE(_hw, OID_AUTO, mwl, CTLFLAG_RD, 0, "Marvell driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, mwl, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Marvell driver parameters"); static int mwl_rxdesc = MWL_RXDESC; /* # rx desc's to allocate */ SYSCTL_INT(_hw_mwl, OID_AUTO, rxdesc, CTLFLAG_RW, &mwl_rxdesc, @@ -4787,9 +4788,9 @@ struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); sc->sc_debug = mwl_debug; - SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "debug", CTLTYPE_INT | CTLFLAG_RW, sc, 0, - mwl_sysctl_debug, "I", "control debugging printfs"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "debug", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + mwl_sysctl_debug, "I", "control debugging printfs"); #endif } Index: sys/dev/mwl/mwlhal.c =================================================================== --- sys/dev/mwl/mwlhal.c +++ sys/dev/mwl/mwlhal.c @@ -192,7 +192,7 @@ #endif /* MWLHAL_DEBUG */ SYSCTL_DECL(_hw_mwl); -static SYSCTL_NODE(_hw_mwl, OID_AUTO, hal, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw_mwl, OID_AUTO, hal, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Marvell HAL parameters"); static __inline void Index: sys/dev/mxge/if_mxge.c =================================================================== --- sys/dev/mxge/if_mxge.c +++ sys/dev/mxge/if_mxge.c @@ -1507,22 +1507,19 @@ /* performance related tunables */ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "intr_coal_delay", - CTLTYPE_INT|CTLFLAG_RW, sc, - 0, mxge_change_intr_coal, - "I", "interrupt coalescing delay in usecs"); + "intr_coal_delay", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, 0, mxge_change_intr_coal, "I", + "interrupt coalescing delay in usecs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "throttle", - CTLTYPE_INT|CTLFLAG_RW, sc, - 0, mxge_change_throttle, - "I", "transmit throttling"); + "throttle", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + mxge_change_throttle, "I", "transmit throttling"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "flow_control_enabled", - CTLTYPE_INT|CTLFLAG_RW, sc, - 0, mxge_change_flow_control, - "I", "interrupt coalescing delay in usecs"); + "flow_control_enabled", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + mxge_change_flow_control, "I", + "interrupt coalescing delay in usecs"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "deassert_wait", @@ -1532,77 +1529,61 @@ /* stats block from firmware is in network byte order. Need to swap it */ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "link_up", - CTLTYPE_INT|CTLFLAG_RD, &fw->link_up, - 0, mxge_handle_be32, - "I", "link up"); + "link_up", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->link_up, 0, mxge_handle_be32, "I", "link up"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "rdma_tags_available", - CTLTYPE_INT|CTLFLAG_RD, &fw->rdma_tags_available, - 0, mxge_handle_be32, - "I", "rdma_tags_available"); + "rdma_tags_available", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->rdma_tags_available, 0, mxge_handle_be32, "I", + "rdma_tags_available"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dropped_bad_crc32", - CTLTYPE_INT|CTLFLAG_RD, - &fw->dropped_bad_crc32, - 0, mxge_handle_be32, - "I", "dropped_bad_crc32"); + "dropped_bad_crc32", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->dropped_bad_crc32, 0, mxge_handle_be32, "I", + "dropped_bad_crc32"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dropped_bad_phy", - CTLTYPE_INT|CTLFLAG_RD, - &fw->dropped_bad_phy, - 0, mxge_handle_be32, - "I", "dropped_bad_phy"); + "dropped_bad_phy", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->dropped_bad_phy, 0, mxge_handle_be32, "I", "dropped_bad_phy"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dropped_link_error_or_filtered", - CTLTYPE_INT|CTLFLAG_RD, - &fw->dropped_link_error_or_filtered, - 0, mxge_handle_be32, - "I", "dropped_link_error_or_filtered"); + "dropped_link_error_or_filtered", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->dropped_link_error_or_filtered, 0, mxge_handle_be32, "I", + "dropped_link_error_or_filtered"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dropped_link_overflow", - CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_link_overflow, - 0, mxge_handle_be32, - "I", "dropped_link_overflow"); + "dropped_link_overflow", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->dropped_link_overflow, 0, mxge_handle_be32, "I", + "dropped_link_overflow"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dropped_multicast_filtered", - CTLTYPE_INT|CTLFLAG_RD, - &fw->dropped_multicast_filtered, - 0, mxge_handle_be32, - "I", "dropped_multicast_filtered"); + "dropped_multicast_filtered", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->dropped_multicast_filtered, 0, mxge_handle_be32, "I", + "dropped_multicast_filtered"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dropped_no_big_buffer", - CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_no_big_buffer, - 0, mxge_handle_be32, - "I", "dropped_no_big_buffer"); + "dropped_no_big_buffer", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->dropped_no_big_buffer, 0, mxge_handle_be32, "I", + "dropped_no_big_buffer"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dropped_no_small_buffer", - CTLTYPE_INT|CTLFLAG_RD, - &fw->dropped_no_small_buffer, - 0, mxge_handle_be32, - "I", "dropped_no_small_buffer"); + "dropped_no_small_buffer", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->dropped_no_small_buffer, 0, mxge_handle_be32, "I", + "dropped_no_small_buffer"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dropped_overrun", - CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_overrun, - 0, mxge_handle_be32, - "I", "dropped_overrun"); + "dropped_overrun", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->dropped_overrun, 0, mxge_handle_be32, "I", + "dropped_overrun"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dropped_pause", - CTLTYPE_INT|CTLFLAG_RD, - &fw->dropped_pause, - 0, mxge_handle_be32, - "I", "dropped_pause"); + "dropped_pause", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->dropped_pause, 0, mxge_handle_be32, "I", "dropped_pause"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dropped_runt", - CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_runt, - 0, mxge_handle_be32, - "I", "dropped_runt"); + "dropped_runt", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->dropped_runt, 0, mxge_handle_be32, "I", "dropped_runt"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, - "dropped_unicast_filtered", - CTLTYPE_INT|CTLFLAG_RD, &fw->dropped_unicast_filtered, - 0, mxge_handle_be32, - "I", "dropped_unicast_filtered"); + "dropped_unicast_filtered", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &fw->dropped_unicast_filtered, 0, mxge_handle_be32, "I", + "dropped_unicast_filtered"); /* verbose printing? */ SYSCTL_ADD_INT(ctx, children, OID_AUTO, @@ -1614,7 +1595,7 @@ sysctl_ctx_init(&sc->slice_sysctl_ctx); sc->slice_sysctl_tree = SYSCTL_ADD_NODE(&sc->slice_sysctl_ctx, children, OID_AUTO, - "slice", CTLFLAG_RD, 0, ""); + "slice", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); for (slice = 0; slice < sc->num_slices; slice++) { ss = &sc->ss[slice]; @@ -1624,7 +1605,7 @@ sprintf(slice_num, "%d", slice); ss->sysctl_tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, slice_num, - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); children = SYSCTL_CHILDREN(ss->sysctl_tree); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_small_cnt", Index: sys/dev/neta/if_mvneta.c =================================================================== --- sys/dev/neta/if_mvneta.c +++ sys/dev/neta/if_mvneta.c @@ -3479,10 +3479,10 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "rx", - CTLFLAG_RD, 0, "NETA RX"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "NETA RX"); rxchildren = SYSCTL_CHILDREN(tree); tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "mib", - CTLFLAG_RD, 0, "NETA MIB"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "NETA MIB"); mchildren = SYSCTL_CHILDREN(tree); @@ -3502,8 +3502,9 @@ mib_arg->index = i; SYSCTL_ADD_PROC(ctx, mchildren, OID_AUTO, mvneta_mib_list[i].sysctl_name, - CTLTYPE_U64|CTLFLAG_RD, (void *)mib_arg, 0, - sysctl_read_mib, "I", mvneta_mib_list[i].desc); + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + (void *)mib_arg, 0, sysctl_read_mib, "I", + mvneta_mib_list[i].desc); } SYSCTL_ADD_UQUAD(ctx, mchildren, OID_AUTO, "rx_discard", CTLFLAG_RD, &sc->counter_pdfc, "Port Rx Discard Frame Counter"); @@ -3513,8 +3514,8 @@ CTLFLAG_RD, &sc->counter_watchdog, 0, "TX Watchdog Counter"); SYSCTL_ADD_PROC(ctx, mchildren, OID_AUTO, "reset", - CTLTYPE_INT|CTLFLAG_RW, (void *)sc, 0, - sysctl_clear_mib, "I", "Reset MIB counters"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + (void *)sc, 0, sysctl_clear_mib, "I", "Reset MIB counters"); for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) { rxarg = &sc->sysctl_rx_queue[q]; @@ -3525,13 +3526,13 @@ /* hw.mvneta.mvneta[unit].rx.[queue] */ tree = SYSCTL_ADD_NODE(ctx, rxchildren, OID_AUTO, - sysctl_queue_names[q], CTLFLAG_RD, 0, + sysctl_queue_names[q], CTLFLAG_RD | CTLFLAG_MPSAFE, 0, sysctl_queue_descrs[q]); qchildren = SYSCTL_CHILDREN(tree); /* hw.mvneta.mvneta[unit].rx.[queue].threshold_timer_us */ SYSCTL_ADD_PROC(ctx, qchildren, OID_AUTO, "threshold_timer_us", - CTLTYPE_UINT | CTLFLAG_RW, rxarg, 0, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, rxarg, 0, sysctl_set_queue_rxthtime, "I", "interrupt coalescing threshold timer [us]"); } Index: sys/dev/netmap/netmap.c =================================================================== --- sys/dev/netmap/netmap.c +++ sys/dev/netmap/netmap.c @@ -540,7 +540,8 @@ SYSBEGIN(main_init); SYSCTL_DECL(_dev_netmap); -SYSCTL_NODE(_dev, OID_AUTO, netmap, CTLFLAG_RW, 0, "Netmap args"); +SYSCTL_NODE(_dev, OID_AUTO, netmap, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Netmap args"); SYSCTL_INT(_dev_netmap, OID_AUTO, verbose, CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); #ifdef CONFIG_NETMAP_DEBUG Index: sys/dev/nfe/if_nfe.c =================================================================== --- sys/dev/nfe/if_nfe.c +++ sys/dev/nfe/if_nfe.c @@ -3121,8 +3121,8 @@ stats = &sc->nfe_stats; ctx = device_get_sysctl_ctx(sc->nfe_dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->nfe_dev)); - SYSCTL_ADD_PROC(ctx, child, - OID_AUTO, "process_limit", CTLTYPE_INT | CTLFLAG_RW, + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->nfe_process_limit, 0, sysctl_hw_nfe_proc_limit, "I", "max number of Rx events to process"); @@ -3143,13 +3143,13 @@ if ((sc->nfe_flags & (NFE_MIB_V1 | NFE_MIB_V2 | NFE_MIB_V3)) == 0) return; - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "NFE statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "NFE statistics"); parent = SYSCTL_CHILDREN(tree); /* Rx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "Rx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Rx MAC statistics"); child = SYSCTL_CHILDREN(tree); NFE_SYSCTL_STAT_ADD32(ctx, child, "frame_errors", @@ -3186,8 +3186,8 @@ } /* Tx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "Tx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx MAC statistics"); child = SYSCTL_CHILDREN(tree); NFE_SYSCTL_STAT_ADD64(ctx, child, "octets", &stats->tx_octets, "Octets"); Index: sys/dev/nge/if_nge.c =================================================================== --- sys/dev/nge/if_nge.c +++ sys/dev/nge/if_nge.c @@ -2652,8 +2652,8 @@ ctx = device_get_sysctl_ctx(sc->nge_dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->nge_dev)); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_holdoff", - CTLTYPE_INT | CTLFLAG_RW, &sc->nge_int_holdoff, 0, - sysctl_hw_nge_int_holdoff, "I", "NGE interrupt moderation"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->nge_int_holdoff, + 0, sysctl_hw_nge_int_holdoff, "I", "NGE interrupt moderation"); /* Pull in device tunables. */ sc->nge_int_holdoff = NGE_INT_HOLDOFF_DEFAULT; error = resource_int_value(device_get_name(sc->nge_dev), @@ -2671,13 +2671,13 @@ } stats = &sc->nge_stats; - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "NGE statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "NGE statistics"); parent = SYSCTL_CHILDREN(tree); /* Rx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "Rx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Rx MAC statistics"); child = SYSCTL_CHILDREN(tree); NGE_SYSCTL_STAT_ADD32(ctx, child, "pkts_errs", &stats->rx_pkts_errs, @@ -2701,8 +2701,8 @@ &stats->rx_pause, "Pause frames"); /* Tx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "Tx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx MAC statistics"); child = SYSCTL_CHILDREN(tree); NGE_SYSCTL_STAT_ADD32(ctx, child, "pause", &stats->tx_pause, "Pause frames"); Index: sys/dev/ntb/if_ntb/if_ntb.c =================================================================== --- sys/dev/ntb/if_ntb/if_ntb.c +++ sys/dev/ntb/if_ntb/if_ntb.c @@ -75,7 +75,8 @@ CSUM_IP_CHECKED | CSUM_IP_VALID | \ CSUM_SCTP_VALID) -static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); +static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "if_ntb"); static unsigned g_if_ntb_num_queues = UINT_MAX; SYSCTL_UINT(_hw_if_ntb, OID_AUTO, num_queues, CTLFLAG_RWTUN, Index: sys/dev/ntb/ntb.c =================================================================== --- sys/dev/ntb/ntb.c +++ sys/dev/ntb/ntb.c @@ -39,7 +39,8 @@ #include "ntb.h" devclass_t ntb_hw_devclass; -SYSCTL_NODE(_hw, OID_AUTO, ntb, CTLFLAG_RW, 0, "NTB sysctls"); +SYSCTL_NODE(_hw, OID_AUTO, ntb, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "NTB sysctls"); struct ntb_child { device_t dev; Index: sys/dev/ntb/ntb_hw/ntb_hw_intel.c =================================================================== --- sys/dev/ntb/ntb_hw/ntb_hw_intel.c +++ sys/dev/ntb/ntb_hw/ntb_hw_intel.c @@ -583,7 +583,7 @@ .bar5_addr32 = XEON_B2B_BAR5_ADDR32, }; -SYSCTL_NODE(_hw_ntb, OID_AUTO, xeon_b2b, CTLFLAG_RW, 0, +SYSCTL_NODE(_hw_ntb, OID_AUTO, xeon_b2b, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "B2B MW segment overrides -- MUST be the same on both sides"); SYSCTL_UQUAD(_hw_ntb_xeon_b2b, OID_AUTO, usd_bar2_addr64, CTLFLAG_RDTUN, @@ -2225,7 +2225,7 @@ return (NTB_LNK_STA_WIDTH(ntb->lnk_sta)); } -SYSCTL_NODE(_hw_ntb, OID_AUTO, debug_info, CTLFLAG_RW, 0, +SYSCTL_NODE(_hw_ntb, OID_AUTO, debug_info, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Driver state, statistics, and HW registers"); #define NTB_REGSZ_MASK (3ul << 30) @@ -2249,18 +2249,21 @@ globals = SYSCTL_CHILDREN(device_get_sysctl_tree(ntb->device)); SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "link_status", - CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, + CTLFLAG_RD | CTLTYPE_STRING | CTLFLAG_NEEDGIANT, ntb, 0, sysctl_handle_link_status_human, "A", "Link status (human readable)"); SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "active", - CTLFLAG_RD | CTLTYPE_UINT, ntb, 0, sysctl_handle_link_status, - "IU", "Link status (1=active, 0=inactive)"); + CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, ntb, 0, + sysctl_handle_link_status, "IU", + "Link status (1=active, 0=inactive)"); SYSCTL_ADD_PROC(ctx, globals, OID_AUTO, "admin_up", - CTLFLAG_RW | CTLTYPE_UINT, ntb, 0, sysctl_handle_link_admin, - "IU", "Set/get interface status (1=UP, 0=DOWN)"); + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_NEEDGIANT, ntb, 0, + sysctl_handle_link_admin, "IU", + "Set/get interface status (1=UP, 0=DOWN)"); tree = SYSCTL_ADD_NODE(ctx, globals, OID_AUTO, "debug_info", - CTLFLAG_RD, NULL, "Driver state, statistics, and HW registers"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Driver state, statistics, and HW registers"); tree_par = SYSCTL_CHILDREN(tree); SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "conn_type", CTLFLAG_RD, @@ -2280,8 +2283,8 @@ } SYSCTL_ADD_PROC(ctx, tree_par, OID_AUTO, "features", - CTLFLAG_RD | CTLTYPE_STRING, ntb, 0, sysctl_handle_features, "A", - "Features/errata of this NTB device"); + CTLFLAG_RD | CTLTYPE_STRING | CTLFLAG_NEEDGIANT, ntb, 0, + sysctl_handle_features, "A", "Features/errata of this NTB device"); SYSCTL_ADD_UINT(ctx, tree_par, OID_AUTO, "ntb_ctl", CTLFLAG_RD, __DEVOLATILE(uint32_t *, &ntb->ntb_ctl), 0, @@ -2309,67 +2312,68 @@ &ntb->db_mask, "Doorbell mask (cached)"); tmptree = SYSCTL_ADD_NODE(ctx, tree_par, OID_AUTO, "registers", - CTLFLAG_RD, NULL, "Raw HW registers (big-endian)"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Raw HW registers (big-endian)"); regpar = SYSCTL_CHILDREN(tmptree); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "ntbcntl", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, NTB_REG_32 | - ntb->reg->ntb_ctl, sysctl_handle_register, "IU", + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, + NTB_REG_32 | ntb->reg->ntb_ctl, sysctl_handle_register, "IU", "NTB Control register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "lnkcap", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, NTB_REG_32 | - 0x19c, sysctl_handle_register, "IU", + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, + NTB_REG_32 | 0x19c, sysctl_handle_register, "IU", "NTB Link Capabilities"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "lnkcon", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, NTB_REG_32 | - 0x1a0, sysctl_handle_register, "IU", + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, + NTB_REG_32 | 0x1a0, sysctl_handle_register, "IU", "NTB Link Control register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "db_mask", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | NTB_DB_READ | ntb->self_reg->db_mask, sysctl_handle_register, "QU", "Doorbell mask register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "db_bell", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | NTB_DB_READ | ntb->self_reg->db_bell, sysctl_handle_register, "QU", "Doorbell register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "incoming_xlat23", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | ntb->xlat_reg->bar2_xlat, sysctl_handle_register, "QU", "Incoming XLAT23 register"); if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) { SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "incoming_xlat4", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | ntb->xlat_reg->bar4_xlat, sysctl_handle_register, "IU", "Incoming XLAT4 register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "incoming_xlat5", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | ntb->xlat_reg->bar5_xlat, sysctl_handle_register, "IU", "Incoming XLAT5 register"); } else { SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "incoming_xlat45", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | ntb->xlat_reg->bar4_xlat, sysctl_handle_register, "QU", "Incoming XLAT45 register"); } SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "incoming_lmt23", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | ntb->xlat_reg->bar2_limit, sysctl_handle_register, "QU", "Incoming LMT23 register"); if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) { SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "incoming_lmt4", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | ntb->xlat_reg->bar4_limit, sysctl_handle_register, "IU", "Incoming LMT4 register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "incoming_lmt5", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | ntb->xlat_reg->bar5_limit, sysctl_handle_register, "IU", "Incoming LMT5 register"); } else { SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "incoming_lmt45", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | ntb->xlat_reg->bar4_limit, sysctl_handle_register, "QU", "Incoming LMT45 register"); } @@ -2378,67 +2382,67 @@ return; tmptree = SYSCTL_ADD_NODE(ctx, regpar, OID_AUTO, "xeon_stats", - CTLFLAG_RD, NULL, "Xeon HW statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Xeon HW statistics"); statpar = SYSCTL_CHILDREN(tmptree); SYSCTL_ADD_PROC(ctx, statpar, OID_AUTO, "upstream_mem_miss", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_16 | XEON_USMEMMISS_OFFSET, sysctl_handle_register, "SU", "Upstream Memory Miss"); tmptree = SYSCTL_ADD_NODE(ctx, regpar, OID_AUTO, "xeon_hw_err", - CTLFLAG_RD, NULL, "Xeon HW errors"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Xeon HW errors"); errpar = SYSCTL_CHILDREN(tmptree); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "ppd", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_8 | NTB_PCI_REG | NTB_PPD_OFFSET, sysctl_handle_register, "CU", "PPD"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "pbar23_sz", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_8 | NTB_PCI_REG | XEON_PBAR23SZ_OFFSET, sysctl_handle_register, "CU", "PBAR23 SZ (log2)"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "pbar4_sz", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_8 | NTB_PCI_REG | XEON_PBAR4SZ_OFFSET, sysctl_handle_register, "CU", "PBAR4 SZ (log2)"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "pbar5_sz", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_8 | NTB_PCI_REG | XEON_PBAR5SZ_OFFSET, sysctl_handle_register, "CU", "PBAR5 SZ (log2)"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "sbar23_sz", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_8 | NTB_PCI_REG | XEON_SBAR23SZ_OFFSET, sysctl_handle_register, "CU", "SBAR23 SZ (log2)"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "sbar4_sz", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_8 | NTB_PCI_REG | XEON_SBAR4SZ_OFFSET, sysctl_handle_register, "CU", "SBAR4 SZ (log2)"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "sbar5_sz", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_8 | NTB_PCI_REG | XEON_SBAR5SZ_OFFSET, sysctl_handle_register, "CU", "SBAR5 SZ (log2)"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "devsts", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_16 | NTB_PCI_REG | XEON_DEVSTS_OFFSET, sysctl_handle_register, "SU", "DEVSTS"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "lnksts", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_16 | NTB_PCI_REG | XEON_LINK_STATUS_OFFSET, sysctl_handle_register, "SU", "LNKSTS"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "slnksts", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_16 | NTB_PCI_REG | XEON_SLINK_STATUS_OFFSET, sysctl_handle_register, "SU", "SLNKSTS"); SYSCTL_ADD_PROC(ctx, errpar, OID_AUTO, "uncerrsts", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | NTB_PCI_REG | XEON_UNCERRSTS_OFFSET, sysctl_handle_register, "IU", "UNCERRSTS"); SYSCTL_ADD_PROC(ctx, errpar, OID_AUTO, "corerrsts", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | NTB_PCI_REG | XEON_CORERRSTS_OFFSET, sysctl_handle_register, "IU", "CORERRSTS"); @@ -2446,75 +2450,75 @@ return; SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_xlat01l", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | XEON_B2B_XLAT_OFFSETL, sysctl_handle_register, "IU", "Outgoing XLAT0L register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_xlat01u", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | XEON_B2B_XLAT_OFFSETU, sysctl_handle_register, "IU", "Outgoing XLAT0U register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_xlat23", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | ntb->bar_info[NTB_B2B_BAR_1].pbarxlat_off, sysctl_handle_register, "QU", "Outgoing XLAT23 register"); if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) { SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_xlat4", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | ntb->bar_info[NTB_B2B_BAR_2].pbarxlat_off, sysctl_handle_register, "IU", "Outgoing XLAT4 register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_xlat5", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | ntb->bar_info[NTB_B2B_BAR_3].pbarxlat_off, sysctl_handle_register, "IU", "Outgoing XLAT5 register"); } else { SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_xlat45", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | ntb->bar_info[NTB_B2B_BAR_2].pbarxlat_off, sysctl_handle_register, "QU", "Outgoing XLAT45 register"); } SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_lmt23", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | XEON_PBAR2LMT_OFFSET, sysctl_handle_register, "QU", "Outgoing LMT23 register"); if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) { SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_lmt4", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | XEON_PBAR4LMT_OFFSET, sysctl_handle_register, "IU", "Outgoing LMT4 register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_lmt5", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | XEON_PBAR5LMT_OFFSET, sysctl_handle_register, "IU", "Outgoing LMT5 register"); } else { SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "outgoing_lmt45", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | XEON_PBAR4LMT_OFFSET, sysctl_handle_register, "QU", "Outgoing LMT45 register"); } SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "sbar01_base", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | ntb->xlat_reg->bar0_base, sysctl_handle_register, "QU", "Secondary BAR01 base register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "sbar23_base", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | ntb->xlat_reg->bar2_base, sysctl_handle_register, "QU", "Secondary BAR23 base register"); if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) { SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "sbar4_base", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | ntb->xlat_reg->bar4_base, sysctl_handle_register, "IU", "Secondary BAR4 base register"); SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "sbar5_base", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_32 | ntb->xlat_reg->bar5_base, sysctl_handle_register, "IU", "Secondary BAR5 base register"); } else { SYSCTL_ADD_PROC(ctx, regpar, OID_AUTO, "sbar45_base", - CTLFLAG_RD | CTLTYPE_OPAQUE, ntb, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_NEEDGIANT, ntb, NTB_REG_64 | ntb->xlat_reg->bar4_base, sysctl_handle_register, "QU", "Secondary BAR45 base register"); Index: sys/dev/ntb/ntb_transport.c =================================================================== --- sys/dev/ntb/ntb_transport.c +++ sys/dev/ntb/ntb_transport.c @@ -67,7 +67,9 @@ #define NTB_TRANSPORT_VERSION 4 -static SYSCTL_NODE(_hw, OID_AUTO, ntb_transport, CTLFLAG_RW, 0, "ntb_transport"); +static SYSCTL_NODE(_hw, OID_AUTO, ntb_transport, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ntb_transport"); static unsigned g_ntb_transport_debug_level; SYSCTL_UINT(_hw_ntb_transport, OID_AUTO, debug_level, CTLFLAG_RWTUN, Index: sys/dev/ntb/test/ntb_tool.c =================================================================== --- sys/dev/ntb/test/ntb_tool.c +++ sys/dev/ntb/test/ntb_tool.c @@ -1379,8 +1379,8 @@ for (pidx = 0; pidx < tc->peer_cnt; pidx++) { snprintf(buf, sizeof(buf), "peer%d", pidx); - peer = SYSCTL_ADD_NODE(clist, top, OID_AUTO, buf, CTLFLAG_RW, 0, - buf); + peer = SYSCTL_ADD_NODE(clist, top, OID_AUTO, buf, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, buf); peer_top = SYSCTL_CHILDREN(peer); SYSCTL_ADD_PROC(clist, peer_top, OID_AUTO, "port", Index: sys/dev/nvd/nvd.c =================================================================== --- sys/dev/nvd/nvd.c +++ sys/dev/nvd/nvd.c @@ -101,7 +101,8 @@ static TAILQ_HEAD(, nvd_controller) ctrlr_head; static TAILQ_HEAD(disk_list, nvd_disk) disk_head; -static SYSCTL_NODE(_hw, OID_AUTO, nvd, CTLFLAG_RD, 0, "nvd driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, nvd, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "nvd driver parameters"); /* * The NVMe specification does not define a maximum or optimal delete size, so * technically max delete size is min(full size of the namespace, 2^32 - 1 Index: sys/dev/nvme/nvme_sysctl.c =================================================================== --- sys/dev/nvme/nvme_sysctl.c +++ sys/dev/nvme/nvme_sysctl.c @@ -44,7 +44,8 @@ int nvme_use_nvd = NVME_USE_NVD; bool nvme_verbose_cmd_dump = false; -SYSCTL_NODE(_hw, OID_AUTO, nvme, CTLFLAG_RD, 0, "NVMe sysctl tunables"); +SYSCTL_NODE(_hw, OID_AUTO, nvme, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "NVMe sysctl tunables"); SYSCTL_INT(_hw_nvme, OID_AUTO, use_nvd, CTLFLAG_RDTUN, &nvme_use_nvd, 1, "1 = Create NVD devices, 0 = Create NDA devices"); SYSCTL_BOOL(_hw_nvme, OID_AUTO, verbose_cmd_dump, CTLFLAG_RWTUN, @@ -288,8 +289,8 @@ "Number of commands ending in failure after all retries"); SYSCTL_ADD_PROC(ctrlr_ctx, que_list, OID_AUTO, - "dump_debug", CTLTYPE_UINT | CTLFLAG_RW, qpair, 0, - nvme_sysctl_dump_debug, "IU", "Dump debug data"); + "dump_debug", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + qpair, 0, nvme_sysctl_dump_debug, "IU", "Dump debug data"); } void @@ -311,55 +312,57 @@ "Number of I/O queue pairs"); SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, - "int_coal_time", CTLTYPE_UINT | CTLFLAG_RW, ctrlr, 0, - nvme_sysctl_int_coal_time, "IU", + "int_coal_time", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + ctrlr, 0, nvme_sysctl_int_coal_time, "IU", "Interrupt coalescing timeout (in microseconds)"); SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, - "int_coal_threshold", CTLTYPE_UINT | CTLFLAG_RW, ctrlr, 0, + "int_coal_threshold", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, ctrlr, 0, nvme_sysctl_int_coal_threshold, "IU", "Interrupt coalescing threshold"); SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, - "timeout_period", CTLTYPE_UINT | CTLFLAG_RW, ctrlr, 0, - nvme_sysctl_timeout_period, "IU", + "timeout_period", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + ctrlr, 0, nvme_sysctl_timeout_period, "IU", "Timeout period (in seconds)"); SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, - "num_cmds", CTLTYPE_S64 | CTLFLAG_RD, + "num_cmds", CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, ctrlr, 0, nvme_sysctl_num_cmds, "IU", "Number of commands submitted"); SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, - "num_intr_handler_calls", CTLTYPE_S64 | CTLFLAG_RD, - ctrlr, 0, nvme_sysctl_num_intr_handler_calls, "IU", + "num_intr_handler_calls", + CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, ctrlr, 0, + nvme_sysctl_num_intr_handler_calls, "IU", "Number of times interrupt handler was invoked (will " "typically be less than number of actual interrupts " "generated due to coalescing)"); SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, - "num_retries", CTLTYPE_S64 | CTLFLAG_RD, + "num_retries", CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, ctrlr, 0, nvme_sysctl_num_retries, "IU", "Number of commands retried"); SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, - "num_failures", CTLTYPE_S64 | CTLFLAG_RD, + "num_failures", CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, ctrlr, 0, nvme_sysctl_num_failures, "IU", "Number of commands ending in failure after all retries"); SYSCTL_ADD_PROC(ctrlr_ctx, ctrlr_list, OID_AUTO, - "reset_stats", CTLTYPE_UINT | CTLFLAG_RW, ctrlr, 0, - nvme_sysctl_reset_stats, "IU", "Reset statistics to zero"); + "reset_stats", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, ctrlr, + 0, nvme_sysctl_reset_stats, "IU", "Reset statistics to zero"); que_tree = SYSCTL_ADD_NODE(ctrlr_ctx, ctrlr_list, OID_AUTO, "adminq", - CTLFLAG_RD, NULL, "Admin Queue"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Admin Queue"); nvme_sysctl_initialize_queue(&ctrlr->adminq, ctrlr_ctx, que_tree); for (i = 0; i < ctrlr->num_io_queues; i++) { snprintf(queue_name, QUEUE_NAME_LENGTH, "ioq%d", i); que_tree = SYSCTL_ADD_NODE(ctrlr_ctx, ctrlr_list, OID_AUTO, - queue_name, CTLFLAG_RD, NULL, "IO Queue"); + queue_name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "IO Queue"); nvme_sysctl_initialize_queue(&ctrlr->ioq[i], ctrlr_ctx, que_tree); } Index: sys/dev/oce/oce_sysctl.c =================================================================== --- sys/dev/oce/oce_sysctl.c +++ sys/dev/oce/oce_sysctl.c @@ -128,16 +128,16 @@ 0,"PVID"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "loop_back", - CTLTYPE_INT | CTLFLAG_RW, (void *)sc, 0, - oce_sysctl_loopback, "I", "Loop Back Tests"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, + oce_sysctl_loopback, "I", "Loop Back Tests"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "fw_upgrade", - CTLTYPE_STRING | CTLFLAG_RW, (void *)sc, 0, - oce_sys_fwupgrade, "A", "Firmware ufi file"); + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, + oce_sys_fwupgrade, "A", "Firmware ufi file"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "aic_enable", - CTLTYPE_INT | CTLFLAG_RW, (void *)sc, 1, - oce_sys_aic_enable, "I", "aic flags"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 1, + oce_sys_aic_enable, "I", "aic flags"); /* * Dumps Transceiver data @@ -146,14 +146,14 @@ * "sysctl -b dev.oce.0.sfp_vpd_dump_buffer > sfp.bin" for binary dump */ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "sfp_vpd_dump", - CTLTYPE_INT | CTLFLAG_RW, (void *)sc, 0, oce_sysctl_sfp_vpd_dump, - "I", "Initiate a sfp_vpd_dump operation"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)sc, 0, + oce_sysctl_sfp_vpd_dump, "I", "Initiate a sfp_vpd_dump operation"); SYSCTL_ADD_OPAQUE(ctx, child, OID_AUTO, "sfp_vpd_dump_buffer", CTLFLAG_RD, sfp_vpd_dump_buffer, TRANSCEIVER_DATA_SIZE, "IU", "Access sfp_vpd_dump buffer"); stats_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", - CTLFLAG_RD, NULL, "Ethernet Statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Ethernet Statistics"); if (IS_BE(sc) || IS_SH(sc)) oce_add_stats_sysctls_be3(sc, ctx, stats_node); @@ -720,9 +720,8 @@ stats = &sc->oce_stats_info; rx_stats_node = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(stats_node), - OID_AUTO,"rx", CTLFLAG_RD, - NULL, "RX Ethernet Statistics"); + SYSCTL_CHILDREN(stats_node), OID_AUTO,"rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "RX Ethernet Statistics"); rx_stat_list = SYSCTL_CHILDREN(rx_stats_node); @@ -757,9 +756,8 @@ for (i = 0; i < sc->nrqs; i++) { sprintf(prefix, "queue%d",i); queue_stats_node = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(rx_stats_node), - OID_AUTO, prefix, CTLFLAG_RD, - NULL, "Queue name"); + SYSCTL_CHILDREN(rx_stats_node), OID_AUTO, prefix, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue name"); queue_stats_list = SYSCTL_CHILDREN(queue_stats_node); SYSCTL_ADD_QUAD(ctx, queue_stats_list, OID_AUTO, "rx_pkts", @@ -790,9 +788,8 @@ } rx_stats_node = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(rx_stats_node), - OID_AUTO, "err", CTLFLAG_RD, - NULL, "Receive Error Stats"); + SYSCTL_CHILDREN(rx_stats_node), OID_AUTO, "err", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Receive Error Stats"); rx_stat_list = SYSCTL_CHILDREN(rx_stats_node); SYSCTL_ADD_UINT(ctx, rx_stat_list, OID_AUTO, "crc_errs", @@ -853,9 +850,9 @@ "Input FIFO Overflow Drop"); tx_stats_node = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(stats_node), OID_AUTO, - "tx",CTLFLAG_RD, NULL, - "TX Ethernet Statistics"); + SYSCTL_CHILDREN(stats_node), OID_AUTO, + "tx", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "TX Ethernet Statistics"); tx_stat_list = SYSCTL_CHILDREN(tx_stats_node); SYSCTL_ADD_QUAD(ctx, tx_stat_list, OID_AUTO, "total_tx_pkts", @@ -893,9 +890,8 @@ for (i = 0; i < sc->nwqs; i++) { sprintf(prefix, "queue%d",i); queue_stats_node = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(tx_stats_node), - OID_AUTO, prefix, CTLFLAG_RD, - NULL, "Queue name"); + SYSCTL_CHILDREN(tx_stats_node), OID_AUTO, prefix, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue name"); queue_stats_list = SYSCTL_CHILDREN(queue_stats_node); SYSCTL_ADD_QUAD(ctx, queue_stats_list, OID_AUTO, "tx_pkts", @@ -942,9 +938,9 @@ stats = &sc->oce_stats_info; rx_stats_node = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(stats_node), - OID_AUTO, "rx", CTLFLAG_RD, - NULL, "RX Ethernet Statistics"); + SYSCTL_CHILDREN(stats_node), OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "RX Ethernet Statistics"); rx_stat_list = SYSCTL_CHILDREN(rx_stats_node); @@ -976,9 +972,8 @@ for (i = 0; i < sc->nrqs; i++) { sprintf(prefix, "queue%d",i); queue_stats_node = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(rx_stats_node), - OID_AUTO, prefix, CTLFLAG_RD, - NULL, "Queue name"); + SYSCTL_CHILDREN(rx_stats_node), OID_AUTO, prefix, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue name"); queue_stats_list = SYSCTL_CHILDREN(queue_stats_node); SYSCTL_ADD_QUAD(ctx, queue_stats_list, OID_AUTO, "rx_pkts", @@ -1005,9 +1000,8 @@ } rx_stats_node = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(rx_stats_node), - OID_AUTO, "err", CTLFLAG_RD, - NULL, "Receive Error Stats"); + SYSCTL_CHILDREN(rx_stats_node), OID_AUTO, "err", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Receive Error Stats"); rx_stat_list = SYSCTL_CHILDREN(rx_stats_node); SYSCTL_ADD_UQUAD(ctx, rx_stat_list, OID_AUTO, "crc_errs", @@ -1059,9 +1053,8 @@ "Input FIFO Overflow Drop"); tx_stats_node = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(stats_node), - OID_AUTO, "tx", CTLFLAG_RD, - NULL, "TX Ethernet Statistics"); + SYSCTL_CHILDREN(stats_node), OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TX Ethernet Statistics"); tx_stat_list = SYSCTL_CHILDREN(tx_stats_node); SYSCTL_ADD_QUAD(ctx, tx_stat_list, OID_AUTO, "total_tx_pkts", @@ -1096,9 +1089,8 @@ for (i = 0; i < sc->nwqs; i++) { sprintf(prefix, "queue%d",i); queue_stats_node = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(tx_stats_node), - OID_AUTO, prefix, CTLFLAG_RD, - NULL, "Queue name"); + SYSCTL_CHILDREN(tx_stats_node), OID_AUTO, prefix, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue name"); queue_stats_list = SYSCTL_CHILDREN(queue_stats_node); SYSCTL_ADD_QUAD(ctx, queue_stats_list, OID_AUTO, "tx_pkts", Index: sys/dev/ocs_fc/ocs_ioctl.c =================================================================== --- sys/dev/ocs_fc/ocs_ioctl.c +++ sys/dev/ocs_fc/ocs_ioctl.c @@ -1132,38 +1132,38 @@ 0, "SLI Interface"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "fw_upgrade", - CTLTYPE_STRING | CTLFLAG_RW, (void *)ocs, 0, - ocs_sys_fwupgrade, "A", "Firmware grp file"); + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)ocs, 0, + ocs_sys_fwupgrade, "A", "Firmware grp file"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwnn", CTLTYPE_STRING | CTLFLAG_RW, - ocs, 0, ocs_sysctl_wwnn, "A", - "World Wide Node Name, wwnn should be in the format 0x"); + "wwnn", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + ocs, 0, ocs_sysctl_wwnn, "A", + "World Wide Node Name, wwnn should be in the format 0x"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "wwpn", CTLTYPE_STRING | CTLFLAG_RW, - ocs, 0, ocs_sysctl_wwpn, "A", - "World Wide Port Name, wwpn should be in the format 0x"); + "wwpn", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + ocs, 0, ocs_sysctl_wwpn, "A", + "World Wide Port Name, wwpn should be in the format 0x"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "current_topology", CTLTYPE_UINT | CTLFLAG_RD, - ocs, 0, ocs_sysctl_current_topology, "IU", - "Current Topology, 1-NPort; 2-Loop; 3-None"); + "current_topology", CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + ocs, 0, ocs_sysctl_current_topology, "IU", + "Current Topology, 1-NPort; 2-Loop; 3-None"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "current_speed", CTLTYPE_UINT | CTLFLAG_RD, - ocs, 0, ocs_sysctl_current_speed, "IU", - "Current Speed"); + "current_speed", CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + ocs, 0, ocs_sysctl_current_speed, "IU", + "Current Speed"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "configured_topology", CTLTYPE_UINT | CTLFLAG_RW, - ocs, 0, ocs_sysctl_config_topology, "IU", - "Configured Topology, 0-Auto; 1-NPort; 2-Loop"); + "configured_topology", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + ocs, 0, ocs_sysctl_config_topology, "IU", + "Configured Topology, 0-Auto; 1-NPort; 2-Loop"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "configured_speed", CTLTYPE_UINT | CTLFLAG_RW, - ocs, 0, ocs_sysctl_config_speed, "IU", - "Configured Speed, 0-Auto, 2000, 4000, 8000, 16000, 32000"); + "configured_speed", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + ocs, 0, ocs_sysctl_config_speed, "IU", + "Configured Speed, 0-Auto, 2000, 4000, 8000, 16000, 32000"); SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "businfo", CTLFLAG_RD, @@ -1171,14 +1171,12 @@ 0, "Bus Info"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "fcid", CTLTYPE_STRING | CTLFLAG_RD, - ocs, 0, ocs_sysctl_fcid, "A", - "Port FC ID"); + "fcid", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + ocs, 0, ocs_sysctl_fcid, "A", "Port FC ID"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "port_state", CTLTYPE_STRING | CTLFLAG_RW, - ocs, 0, ocs_sysctl_port_state, "A", - "configured port state"); + "port_state", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + ocs, 0, ocs_sysctl_port_state, "A", "configured port state"); for (i = 0; i < ocs->num_vports; i++) { fcp = FCPORT(ocs, i+1); @@ -1186,17 +1184,17 @@ memset(name, 0, sizeof(name)); snprintf(name, sizeof(name), "vport%d", i); vtree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), - OID_AUTO, name, CTLFLAG_RW, 0, "Virtual port"); + OID_AUTO, name, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Virtual port"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(vtree), OID_AUTO, - "wwnn", CTLTYPE_STRING | CTLFLAG_RW, - fcp, 0, ocs_sysctl_vport_wwnn, "A", - "World Wide Node Name"); + "wwnn", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + fcp, 0, ocs_sysctl_vport_wwnn, "A", + "World Wide Node Name"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(vtree), OID_AUTO, - "wwpn", CTLTYPE_STRING | CTLFLAG_RW, - fcp, 0, ocs_sysctl_vport_wwpn, "A", - "World Wide Port Name"); + "wwpn", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + fcp, 0, ocs_sysctl_vport_wwpn, "A", "World Wide Port Name"); } Index: sys/dev/ofw/ofw_fdt.c =================================================================== --- sys/dev/ofw/ofw_fdt.c +++ sys/dev/ofw/ofw_fdt.c @@ -123,8 +123,8 @@ return; SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_fdt), OID_AUTO, "dtb", - CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, sysctl_handle_dtb, "", - "Device Tree Blob"); + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_handle_dtb, "", "Device Tree Blob"); } SYSINIT(dtb_oid, SI_SUB_KMEM, SI_ORDER_ANY, sysctl_register_fdt_oid, NULL); Index: sys/dev/ow/ow.c =================================================================== --- sys/dev/ow/ow.c +++ sys/dev/ow/ow.c @@ -160,10 +160,11 @@ .t_lowr = 1, /* 1 <= t < 2 */ }; -SYSCTL_NODE(_hw, OID_AUTO, ow, CTLFLAG_RD, 0, "1-Wire protocol"); -SYSCTL_NODE(_hw_ow, OID_AUTO, regular, CTLFLAG_RD, 0, +SYSCTL_NODE(_hw, OID_AUTO, ow, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "1-Wire protocol"); +SYSCTL_NODE(_hw_ow, OID_AUTO, regular, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Regular mode timings"); -SYSCTL_NODE(_hw_ow, OID_AUTO, overdrive, CTLFLAG_RD, 0, +SYSCTL_NODE(_hw_ow, OID_AUTO, overdrive, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Overdrive mode timings"); #define _OW_TIMING_SYSCTL(mode, param) \ @@ -183,7 +184,7 @@ return (0); \ } \ SYSCTL_PROC(_hw_ow_ ## mode, OID_AUTO, param, \ - CTLTYPE_INT | CTLFLAG_RWTUN, 0, sizeof(int), \ + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), \ sysctl_ow_timing_ ## mode ## _ ## param, "I", \ "1-Wire timing parameter in microseconds (-1 resets to default)") Index: sys/dev/ow/ow_temp.c =================================================================== --- sys/dev/ow/ow_temp.c +++ sys/dev/ow/ow_temp.c @@ -198,7 +198,8 @@ sc->type = ow_get_family(dev); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "temperature", CTLFLAG_RD | CTLTYPE_INT, + OID_AUTO, "temperature", + CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_NEEDGIANT, &sc->temp, 0, sysctl_handle_int, "IK3", "Current Temperature"); SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), Index: sys/dev/pccard/pccard.c =================================================================== --- sys/dev/pccard/pccard.c +++ sys/dev/pccard/pccard.c @@ -63,7 +63,8 @@ #define PCCARDDEBUG /* sysctl vars */ -static SYSCTL_NODE(_hw, OID_AUTO, pccard, CTLFLAG_RD, 0, "PCCARD parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, pccard, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "PCCARD parameters"); int pccard_debug = 0; SYSCTL_INT(_hw_pccard, OID_AUTO, debug, CTLFLAG_RWTUN, Index: sys/dev/pccbb/pccbb.c =================================================================== --- sys/dev/pccbb/pccbb.c +++ sys/dev/pccbb/pccbb.c @@ -127,7 +127,8 @@ devclass_t cbb_devclass; /* sysctl vars */ -static SYSCTL_NODE(_hw, OID_AUTO, cbb, CTLFLAG_RD, 0, "CBB parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, cbb, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "CBB parameters"); /* There's no way to say TUNEABLE_LONG to get the right types */ u_long cbb_start_mem = CBB_START_MEM; Index: sys/dev/pccbb/pccbb_isa.c =================================================================== --- sys/dev/pccbb/pccbb_isa.c +++ sys/dev/pccbb/pccbb_isa.c @@ -72,7 +72,8 @@ *****************************************************************************/ /* sysctl vars */ -static SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD, 0, "PCIC parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "PCIC parameters"); static int isa_intr_mask = EXCA_INT_MASK_ALLOWED; SYSCTL_INT(_hw_pcic, OID_AUTO, intr_mask, CTLFLAG_RDTUN, &isa_intr_mask, 0, Index: sys/dev/puc/puc.c =================================================================== --- sys/dev/puc/puc.c +++ sys/dev/puc/puc.c @@ -73,7 +73,8 @@ static MALLOC_DEFINE(M_PUC, "PUC", "PUC driver"); -SYSCTL_NODE(_hw, OID_AUTO, puc, CTLFLAG_RD, 0, "puc(9) driver configuration"); +SYSCTL_NODE(_hw, OID_AUTO, puc, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "puc(9) driver configuration"); struct puc_bar * puc_get_bar(struct puc_softc *sc, int rid) Index: sys/dev/qlnx/qlnxe/qlnx_os.c =================================================================== --- sys/dev/qlnx/qlnxe/qlnx_os.c +++ sys/dev/qlnx/qlnxe/qlnx_os.c @@ -276,7 +276,8 @@ -SYSCTL_NODE(_hw, OID_AUTO, qlnxe, CTLFLAG_RD, 0, "qlnxe driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, qlnxe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "qlnxe driver parameters"); /* Number of Queues: 0 (Auto) or 1 to 32 (fixed queue number) */ static int qlnxe_queue_count = QLNX_DEFAULT_RSS; @@ -1549,7 +1550,7 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(ha->pci_dev)); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "spstat", - CTLFLAG_RD, NULL, "spstat"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "spstat"); children = SYSCTL_CHILDREN(ctx_oid); SYSCTL_ADD_QUAD(ctx, children, @@ -1574,7 +1575,7 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(ha->pci_dev)); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "fpstat", - CTLFLAG_RD, NULL, "fpstat"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "fpstat"); children = SYSCTL_CHILDREN(ctx_oid); for (i = 0; i < ha->num_rss; i++) { @@ -1583,7 +1584,7 @@ snprintf(name_str, sizeof(name_str), "%d", i); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, name_str, - CTLFLAG_RD, NULL, name_str); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, name_str); node_children = SYSCTL_CHILDREN(ctx_oid); /* Tx Related */ @@ -1849,7 +1850,7 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(ha->pci_dev)); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "hwstat", - CTLFLAG_RD, NULL, "hwstat"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "hwstat"); children = SYSCTL_CHILDREN(ctx_oid); SYSCTL_ADD_QUAD(ctx, children, @@ -2310,23 +2311,21 @@ "tx_coalesce_usecs"); SYSCTL_ADD_PROC(ctx, children, - OID_AUTO, "trigger_dump", (CTLTYPE_INT | CTLFLAG_RW), - (void *)ha, 0, - qlnx_trigger_dump_sysctl, "I", "trigger_dump"); + OID_AUTO, "trigger_dump", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + (void *)ha, 0, qlnx_trigger_dump_sysctl, "I", "trigger_dump"); SYSCTL_ADD_PROC(ctx, children, - OID_AUTO, "set_rx_coalesce_usecs", - (CTLTYPE_INT | CTLFLAG_RW), - (void *)ha, 0, - qlnx_set_rx_coalesce, "I", - "rx interrupt coalesce period microseconds"); + OID_AUTO, "set_rx_coalesce_usecs", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + (void *)ha, 0, qlnx_set_rx_coalesce, "I", + "rx interrupt coalesce period microseconds"); SYSCTL_ADD_PROC(ctx, children, - OID_AUTO, "set_tx_coalesce_usecs", - (CTLTYPE_INT | CTLFLAG_RW), - (void *)ha, 0, - qlnx_set_tx_coalesce, "I", - "tx interrupt coalesce period microseconds"); + OID_AUTO, "set_tx_coalesce_usecs", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + (void *)ha, 0, qlnx_set_tx_coalesce, "I", + "tx interrupt coalesce period microseconds"); ha->rx_pkt_threshold = 128; SYSCTL_ADD_UINT(ctx, children, Index: sys/dev/qlnx/qlnxr/qlnxr_os.c =================================================================== --- sys/dev/qlnx/qlnxr/qlnxr_os.c +++ sys/dev/qlnx/qlnxr/qlnxr_os.c @@ -34,7 +34,8 @@ #include "qlnxr_def.h" -SYSCTL_NODE(_dev, OID_AUTO, qnxr, CTLFLAG_RW, 0, "Qlogic RDMA module"); +SYSCTL_NODE(_dev, OID_AUTO, qnxr, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Qlogic RDMA module"); uint32_t delayed_ack = 0; SYSCTL_UINT(_dev_qnxr, OID_AUTO, delayed_ack, CTLFLAG_RW, &delayed_ack, 1, Index: sys/dev/qlxgb/qla_os.c =================================================================== --- sys/dev/qlxgb/qla_os.c +++ sys/dev/qlxgb/qla_os.c @@ -151,10 +151,9 @@ device_t dev = ha->pci_dev; SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RD, - (void *)ha, 0, - qla_sysctl_get_stats, "I", "Statistics"); + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + (void *)ha, 0, qla_sysctl_get_stats, "I", "Statistics"); SYSCTL_ADD_STRING(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), Index: sys/dev/qlxgbe/ql_hw.c =================================================================== --- sys/dev/qlxgbe/ql_hw.c +++ sys/dev/qlxgbe/ql_hw.c @@ -263,7 +263,7 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(ha->pci_dev)); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats_hw_mac", - CTLFLAG_RD, NULL, "stats_hw_mac"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "stats_hw_mac"); children = SYSCTL_CHILDREN(ctx_oid); SYSCTL_ADD_QUAD(ctx, children, @@ -480,7 +480,7 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(ha->pci_dev)); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats_hw_rcv", - CTLFLAG_RD, NULL, "stats_hw_rcv"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "stats_hw_rcv"); children = SYSCTL_CHILDREN(ctx_oid); SYSCTL_ADD_QUAD(ctx, children, @@ -600,7 +600,7 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(ha->pci_dev)); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats_hw_xmt", - CTLFLAG_RD, NULL, "stats_hw_xmt"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "stats_hw_xmt"); children = SYSCTL_CHILDREN(ctx_oid); for (i = 0; i < ha->hw.num_tx_rings; i++) { @@ -609,7 +609,7 @@ snprintf(name_str, sizeof(name_str), "%d", i); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, name_str, - CTLFLAG_RD, NULL, name_str); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, name_str); node_children = SYSCTL_CHILDREN(ctx_oid); /* Tx Related */ @@ -779,7 +779,7 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(ha->pci_dev)); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats_drvr_sds", - CTLFLAG_RD, NULL, "stats_drvr_sds"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "stats_drvr_sds"); children = SYSCTL_CHILDREN(ctx_oid); for (i = 0; i < ha->hw.num_sds_rings; i++) { @@ -788,7 +788,7 @@ snprintf(name_str, sizeof(name_str), "%d", i); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, name_str, - CTLFLAG_RD, NULL, name_str); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, name_str); node_children = SYSCTL_CHILDREN(ctx_oid); SYSCTL_ADD_QUAD(ctx, node_children, @@ -818,7 +818,7 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(ha->pci_dev)); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats_drvr_rds", - CTLFLAG_RD, NULL, "stats_drvr_rds"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "stats_drvr_rds"); children = SYSCTL_CHILDREN(ctx_oid); for (i = 0; i < ha->hw.num_rds_rings; i++) { @@ -827,7 +827,7 @@ snprintf(name_str, sizeof(name_str), "%d", i); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, name_str, - CTLFLAG_RD, NULL, name_str); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, name_str); node_children = SYSCTL_CHILDREN(ctx_oid); SYSCTL_ADD_QUAD(ctx, node_children, @@ -863,7 +863,7 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(ha->pci_dev)); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats_drvr_xmt", - CTLFLAG_RD, NULL, "stats_drvr_xmt"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "stats_drvr_xmt"); children = SYSCTL_CHILDREN(ctx_oid); for (i = 0; i < ha->hw.num_tx_rings; i++) { @@ -872,7 +872,7 @@ snprintf(name_str, sizeof(name_str), "%d", i); ctx_oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, name_str, - CTLFLAG_RD, NULL, name_str); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, name_str); node_children = SYSCTL_CHILDREN(ctx_oid); SYSCTL_ADD_QUAD(ctx, node_children, @@ -979,35 +979,32 @@ "\tto take effect \n"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "port_cfg", CTLTYPE_INT | CTLFLAG_RW, - (void *)ha, 0, - qla_sysctl_port_cfg, "I", - "Set Port Configuration if values below " - "otherwise Get Port Configuration\n" - "\tBits 0-3 ; 1 = DCBX Enable; 0 = DCBX Disable\n" - "\tBits 4-7 : 0 = no pause; 1 = std ; 2 = ppm \n" - "\tBits 8-11: std pause cfg; 0 = xmt and rcv;" - " 1 = xmt only; 2 = rcv only;\n" - ); + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "port_cfg", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + (void *)ha, 0, qla_sysctl_port_cfg, "I", + "Set Port Configuration if values below " + "otherwise Get Port Configuration\n" + "\tBits 0-3 ; 1 = DCBX Enable; 0 = DCBX Disable\n" + "\tBits 4-7 : 0 = no pause; 1 = std ; 2 = ppm \n" + "\tBits 8-11: std pause cfg; 0 = xmt and rcv;" + " 1 = xmt only; 2 = rcv only;\n"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "set_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, - (void *)ha, 0, - qla_sysctl_set_cam_search_mode, "I", - "Set CAM Search Mode" - "\t 1 = search mode internal\n" - "\t 2 = search mode auto\n"); + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "set_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + (void *)ha, 0, qla_sysctl_set_cam_search_mode, "I", + "Set CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "get_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, - (void *)ha, 0, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "get_cam_search_mode", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)ha, 0, qla_sysctl_get_cam_search_mode, "I", - "Get CAM Search Mode" - "\t 1 = search mode internal\n" - "\t 2 = search mode auto\n"); + "Get CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); ha->hw.enable_9kb = 1; @@ -1097,10 +1094,9 @@ "\t\t\t 16: tx_buf[next_prod_index].mbuf != NULL\n" ); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "peg_stop", CTLTYPE_INT | CTLFLAG_RW, - (void *)ha, 0, - qla_sysctl_stop_pegs, "I", "Peg Stop"); + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "peg_stop", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + (void *)ha, 0, qla_sysctl_stop_pegs, "I", "Peg Stop"); #endif /* #ifdef QL_DBG */ Index: sys/dev/qlxgbe/ql_os.c =================================================================== --- sys/dev/qlxgbe/ql_os.c +++ sys/dev/qlxgbe/ql_os.c @@ -176,10 +176,9 @@ ha->fw_ver_str, 0, "firmware version"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "link_status", CTLTYPE_INT | CTLFLAG_RW, - (void *)ha, 0, - qla_sysctl_get_link_status, "I", "Link Status"); + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "link_status", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + (void *)ha, 0, qla_sysctl_get_link_status, "I", "Link Status"); ha->dbg_level = 0; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), Index: sys/dev/qlxge/qls_hw.c =================================================================== --- sys/dev/qlxge/qls_hw.c +++ sys/dev/qlxge/qls_hw.c @@ -160,16 +160,16 @@ ha->num_tx_rings, "Number of Transmit Rings"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "mpi_dump", CTLTYPE_INT | CTLFLAG_RW, - (void *)ha, 0, - qls_syctl_mpi_dump, "I", "MPI Dump"); + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "mpi_dump", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)ha, 0, + qls_syctl_mpi_dump, "I", "MPI Dump"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "link_status", CTLTYPE_INT | CTLFLAG_RW, - (void *)ha, 0, - qls_syctl_link_status, "I", "Link Status"); + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "link_status", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)ha, 0, + qls_syctl_link_status, "I", "Link Status"); } /* Index: sys/dev/qlxge/qls_os.c =================================================================== --- sys/dev/qlxge/qls_os.c +++ sys/dev/qlxge/qls_os.c @@ -280,10 +280,10 @@ &qls_dbg_level, qls_dbg_level, "Debug Level"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "drvr_stats", CTLTYPE_INT | CTLFLAG_RW, - (void *)ha, 0, - qls_sysctl_get_drvr_stats, "I", "Driver Maintained Statistics"); + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "drvr_stats", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, (void *)ha, 0, + qls_sysctl_get_drvr_stats, "I", "Driver Maintained Statistics"); return; } Index: sys/dev/random/fortuna.c =================================================================== --- sys/dev/random/fortuna.c +++ sys/dev/random/fortuna.c @@ -299,14 +299,14 @@ fortuna_state.fs_lasttime = 0; random_fortuna_o = SYSCTL_ADD_NODE(&random_clist, SYSCTL_STATIC_CHILDREN(_kern_random), - OID_AUTO, "fortuna", CTLFLAG_RW, 0, + OID_AUTO, "fortuna", CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Fortuna Parameters"); SYSCTL_ADD_PROC(&random_clist, - SYSCTL_CHILDREN(random_fortuna_o), OID_AUTO, - "minpoolsize", CTLTYPE_UINT | CTLFLAG_RWTUN, - &fortuna_state.fs_minpoolsize, RANDOM_FORTUNA_DEFPOOLSIZE, - random_check_uint_fs_minpoolsize, "IU", - "Minimum pool size necessary to cause a reseed"); + SYSCTL_CHILDREN(random_fortuna_o), OID_AUTO, "minpoolsize", + CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + &fortuna_state.fs_minpoolsize, RANDOM_FORTUNA_DEFPOOLSIZE, + random_check_uint_fs_minpoolsize, "IU", + "Minimum pool size necessary to cause a reseed"); KASSERT(fortuna_state.fs_minpoolsize > 0, ("random: Fortuna threshold must be > 0 at startup")); SYSCTL_ADD_BOOL(&random_clist, SYSCTL_CHILDREN(random_fortuna_o), Index: sys/dev/random/ivy.c =================================================================== --- sys/dev/random/ivy.c +++ sys/dev/random/ivy.c @@ -60,7 +60,7 @@ .rs_read = random_ivy_read }; -SYSCTL_NODE(_kern_random, OID_AUTO, rdrand, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern_random, OID_AUTO, rdrand, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "rdrand (ivy) entropy source"); static bool acquire_independent_seed_samples = false; SYSCTL_BOOL(_kern_random_rdrand, OID_AUTO, rdrand_independent_seed, Index: sys/dev/random/random_harvestq.c =================================================================== --- sys/dev/random/random_harvestq.c +++ sys/dev/random/random_harvestq.c @@ -111,7 +111,7 @@ static CK_LIST_HEAD(sources_head, random_sources) source_list = CK_LIST_HEAD_INITIALIZER(source_list); -SYSCTL_NODE(_kern_random, OID_AUTO, harvest, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern_random, OID_AUTO, harvest, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Entropy Device Parameters"); /* @@ -305,8 +305,10 @@ (orig_value & user_immutable_mask); return (0); } -SYSCTL_PROC(_kern_random_harvest, OID_AUTO, mask, CTLTYPE_UINT | CTLFLAG_RW, - NULL, 0, random_check_uint_harvestmask, "IU", "Entropy harvesting mask"); +SYSCTL_PROC(_kern_random_harvest, OID_AUTO, mask, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + random_check_uint_harvestmask, "IU", + "Entropy harvesting mask"); /* ARGSUSED */ static int @@ -326,7 +328,8 @@ return (error); } SYSCTL_PROC(_kern_random_harvest, OID_AUTO, mask_bin, - CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, random_print_harvestmask, "A", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + random_print_harvestmask, "A", "Entropy harvesting mask (printable)"); static const char *random_source_descr[ENTROPYSOURCE] = { @@ -387,8 +390,9 @@ return (error); } SYSCTL_PROC(_kern_random_harvest, OID_AUTO, mask_symbolic, - CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, random_print_harvestmask_symbolic, - "A", "Entropy harvesting mask (symbolic)"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + random_print_harvestmask_symbolic, "A", + "Entropy harvesting mask (symbolic)"); /* ARGSUSED */ static void Index: sys/dev/random/random_infra.c =================================================================== --- sys/dev/random/random_infra.c +++ sys/dev/random/random_infra.c @@ -38,9 +38,10 @@ #include /* Set up the sysctl root node for the entropy device */ -SYSCTL_NODE(_kern, OID_AUTO, random, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern, OID_AUTO, random, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Cryptographically Secure Random Number Generator"); -SYSCTL_NODE(_kern_random, OID_AUTO, initial_seeding, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern_random, OID_AUTO, initial_seeding, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Initial seeding control and information"); /* Index: sys/dev/re/if_re.c =================================================================== --- sys/dev/re/if_re.c +++ sys/dev/re/if_re.c @@ -3969,14 +3969,15 @@ children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->rl_dev)); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "stats", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, re_sysctl_stats, "I", - "Statistics Information"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + re_sysctl_stats, "I", "Statistics Information"); if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) return; SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "int_rx_mod", - CTLTYPE_INT | CTLFLAG_RW, &sc->rl_int_rx_mod, 0, - sysctl_hw_re_int_mod, "I", "re RX interrupt moderation"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &sc->rl_int_rx_mod, 0, sysctl_hw_re_int_mod, "I", + "re RX interrupt moderation"); /* Pull in device tunables. */ sc->rl_int_rx_mod = RL_TIMER_DEFAULT; error = resource_int_value(device_get_name(sc->rl_dev), Index: sys/dev/rndtest/rndtest.c =================================================================== --- sys/dev/rndtest/rndtest.c +++ sys/dev/rndtest/rndtest.c @@ -72,8 +72,8 @@ #define RNDTEST_NTESTS nitems(rndtest_funcs) -static SYSCTL_NODE(_kern, OID_AUTO, rndtest, CTLFLAG_RD, 0, - "RNG test parameters"); +static SYSCTL_NODE(_kern, OID_AUTO, rndtest, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "RNG test parameters"); static int rndtest_retest = 120; /* interval in seconds */ SYSCTL_INT(_kern_rndtest, OID_AUTO, retest, CTLFLAG_RW, &rndtest_retest, 0, "retest interval (seconds)"); Index: sys/dev/rt/if_rt.c =================================================================== --- sys/dev/rt/if_rt.c +++ sys/dev/rt/if_rt.c @@ -184,7 +184,8 @@ static int rt_ifmedia_upd(struct ifnet *); static void rt_ifmedia_sts(struct ifnet *, struct ifmediareq *); -static SYSCTL_NODE(_hw, OID_AUTO, rt, CTLFLAG_RD, 0, "RT driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, rt, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "RT driver parameters"); #ifdef IF_RT_DEBUG static int rt_debug = 0; SYSCTL_INT(_hw_rt, OID_AUTO, debug, CTLFLAG_RWTUN, &rt_debug, 0, @@ -2581,7 +2582,7 @@ /* statistic counters */ stats = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "stats", CTLFLAG_RD, 0, "statistic"); + "stats", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "statistic"); SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(stats), OID_AUTO, "interrupts", CTLFLAG_RD, &sc->interrupts, Index: sys/dev/safe/safe.c =================================================================== --- sys/dev/safe/safe.c +++ sys/dev/safe/safe.c @@ -143,7 +143,7 @@ static int safe_free_entry(struct safe_softc *, struct safe_ringentry *); -static SYSCTL_NODE(_hw, OID_AUTO, safe, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw, OID_AUTO, safe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "SafeNet driver parameters"); #ifdef SAFE_DEBUG @@ -2162,6 +2162,8 @@ } return error; } -SYSCTL_PROC(_hw_safe, OID_AUTO, dump, CTLTYPE_STRING | CTLFLAG_RW, - 0, 0, sysctl_hw_safe_dump, "A", "Dump driver state"); +SYSCTL_PROC(_hw_safe, OID_AUTO, dump, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_hw_safe_dump, "A", + "Dump driver state"); #endif /* SAFE_DEBUG */ Index: sys/dev/sdhci/sdhci.c =================================================================== --- sys/dev/sdhci/sdhci.c +++ sys/dev/sdhci/sdhci.c @@ -67,7 +67,8 @@ #include "opt_mmccam.h" -SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, "sdhci driver"); +SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "sdhci driver"); static int sdhci_debug = 0; SYSCTL_INT(_hw_sdhci, OID_AUTO, debug, CTLFLAG_RWTUN, &sdhci_debug, 0, Index: sys/dev/sfxge/sfxge.c =================================================================== --- sys/dev/sfxge/sfxge.c +++ sys/dev/sfxge/sfxge.c @@ -86,8 +86,8 @@ MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver"); -SYSCTL_NODE(_hw, OID_AUTO, sfxge, CTLFLAG_RD, 0, - "SFXGE driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, sfxge, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "SFXGE driver parameters"); #define SFXGE_PARAM_RX_RING SFXGE_PARAM(rx_ring) static int sfxge_rx_ring_entries = SFXGE_NDESCS; @@ -704,10 +704,9 @@ TUNABLE_INT_FETCH(mcdi_log_param_name, &sc->mcdi_logging); #endif - sc->stats_node = SYSCTL_ADD_NODE( - device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "stats", CTLFLAG_RD, NULL, "Statistics"); + sc->stats_node = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Statistics"); if (sc->stats_node == NULL) { error = ENOMEM; goto fail; @@ -970,10 +969,10 @@ if (efx_vpd_get(sc->enp, sc->vpd_data, sc->vpd_size, &value) != 0) return; - SYSCTL_ADD_PROC( - ctx, list, OID_AUTO, keyword, CTLTYPE_STRING|CTLFLAG_RD, - sc, tag << 16 | EFX_VPD_KEYWORD(keyword[0], keyword[1]), - sfxge_vpd_handler, "A", ""); + SYSCTL_ADD_PROC(ctx, list, OID_AUTO, keyword, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + sc, tag << 16 | EFX_VPD_KEYWORD(keyword[0], keyword[1]), + sfxge_vpd_handler, "A", ""); } static int @@ -1007,9 +1006,9 @@ device_printf(sc->dev, "%s\n", value.evv_value); } - vpd_node = SYSCTL_ADD_NODE( - ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), - OID_AUTO, "vpd", CTLFLAG_RD, NULL, "Vital Product Data"); + vpd_node = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, "vpd", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Vital Product Data"); vpd_list = SYSCTL_CHILDREN(vpd_node); /* Add sysctls for all expected and any vendor-defined keywords. */ Index: sys/dev/sfxge/sfxge_ev.c =================================================================== --- sys/dev/sfxge/sfxge_ev.c +++ sys/dev/sfxge/sfxge_ev.c @@ -494,18 +494,16 @@ snprintf(name, sizeof(name), "%u", evq->index); evq_stats_node = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(sc->evqs_stats_node), - OID_AUTO, name, CTLFLAG_RD, NULL, ""); + SYSCTL_CHILDREN(sc->evqs_stats_node), OID_AUTO, name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); if (evq_stats_node == NULL) return (ENOMEM); for (id = 0; id < EV_NQSTATS; id++) { - SYSCTL_ADD_PROC( - ctx, SYSCTL_CHILDREN(evq_stats_node), - OID_AUTO, efx_ev_qstat_name(sc->enp, id), - CTLTYPE_U64|CTLFLAG_RD, - evq, id, sfxge_evq_stat_handler, "Q", - ""); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(evq_stats_node), + OID_AUTO, efx_ev_qstat_name(sc->enp, id), + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, evq, id, + sfxge_evq_stat_handler, "Q", ""); } return (0); @@ -564,11 +562,9 @@ for (id = 0; id < EV_NQSTATS; id++) { snprintf(name, sizeof(name), "ev_%s", efx_ev_qstat_name(sc->enp, id)); - SYSCTL_ADD_PROC( - ctx, stat_list, - OID_AUTO, name, CTLTYPE_U64|CTLFLAG_RD, - sc, id, sfxge_ev_stat_handler, "Q", - ""); + SYSCTL_ADD_PROC(ctx, stat_list, OID_AUTO, name, + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, + sc, id, sfxge_ev_stat_handler, "Q", ""); } } @@ -1004,14 +1000,15 @@ */ sc->ev_moderation = SFXGE_MODERATION; SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), - OID_AUTO, "int_mod", CTLTYPE_UINT|CTLFLAG_RW, - sc, 0, sfxge_int_mod_handler, "IU", - "sfxge interrupt moderation (us)"); + OID_AUTO, "int_mod", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, + sc, 0, sfxge_int_mod_handler, "IU", + "sfxge interrupt moderation (us)"); #if EFSYS_OPT_QSTATS sc->evqs_stats_node = SYSCTL_ADD_NODE( - device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(sc->stats_node), - OID_AUTO, "evq", CTLFLAG_RD, NULL, "Event queues stats"); + device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(sc->stats_node), + OID_AUTO, "evq", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Event queues stats"); if (sc->evqs_stats_node == NULL) { rc = ENOMEM; goto fail_evqs_stats_node; Index: sys/dev/sfxge/sfxge_port.c =================================================================== --- sys/dev/sfxge/sfxge_port.c +++ sys/dev/sfxge/sfxge_port.c @@ -194,11 +194,9 @@ /* Initialise the named stats */ for (id = 0; id < EFX_MAC_NSTATS; id++) { name = efx_mac_stat_name(sc->enp, id); - SYSCTL_ADD_PROC( - ctx, stat_list, - OID_AUTO, name, CTLTYPE_U64|CTLFLAG_RD, - sc, id, sfxge_mac_stat_handler, "Q", - ""); + SYSCTL_ADD_PROC(ctx, stat_list, OID_AUTO, name, + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, + sc, id, sfxge_mac_stat_handler, "Q", ""); } } @@ -650,12 +648,10 @@ if (!(stat_mask & ((uint64_t)1 << id))) continue; name = efx_phy_stat_name(sc->enp, id); - SYSCTL_ADD_PROC( - ctx, stat_list, - OID_AUTO, name, CTLTYPE_UINT|CTLFLAG_RD, - sc, id, sfxge_phy_stat_handler, - id == EFX_PHY_STAT_OUI ? "IX" : "IU", - ""); + SYSCTL_ADD_PROC(ctx, stat_list, OID_AUTO, name, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, + sc, id, sfxge_phy_stat_handler, + id == EFX_PHY_STAT_OUI ? "IX" : "IU", ""); } } @@ -787,10 +783,10 @@ * ifmedia, provide sysctls for it. */ port->wanted_fc = EFX_FCNTL_RESPOND | EFX_FCNTL_GENERATE; SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "wanted_fc", CTLTYPE_UINT|CTLFLAG_RW, sc, 0, + "wanted_fc", CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, sfxge_port_wanted_fc_handler, "IU", "wanted flow control mode"); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "link_fc", CTLTYPE_UINT|CTLFLAG_RD, sc, 0, + "link_fc", CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sfxge_port_link_fc_handler, "IU", "link flow control mode"); #endif @@ -806,7 +802,8 @@ sfxge_mac_stat_init(sc); SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, - "stats_update_period_ms", CTLTYPE_UINT|CTLFLAG_RW, sc, 0, + "stats_update_period_ms", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, sfxge_port_stats_update_period_ms_handler, "IU", "interface statistics refresh period"); Index: sys/dev/sfxge/sfxge_rx.c =================================================================== --- sys/dev/sfxge/sfxge_rx.c +++ sys/dev/sfxge/sfxge_rx.c @@ -73,8 +73,8 @@ #ifdef SFXGE_LRO -SYSCTL_NODE(_hw_sfxge, OID_AUTO, lro, CTLFLAG_RD, NULL, - "Large receive offload (LRO) parameters"); +SYSCTL_NODE(_hw_sfxge, OID_AUTO, lro, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Large receive offload (LRO) parameters"); #define SFXGE_LRO_PARAM(_param) SFXGE_PARAM(lro._param) @@ -1356,12 +1356,10 @@ stat_list = SYSCTL_CHILDREN(sc->stats_node); for (id = 0; id < nitems(sfxge_rx_stats); id++) { - SYSCTL_ADD_PROC( - ctx, stat_list, - OID_AUTO, sfxge_rx_stats[id].name, - CTLTYPE_UINT|CTLFLAG_RD, - sc, id, sfxge_rx_stat_handler, "IU", - ""); + SYSCTL_ADD_PROC(ctx, stat_list, OID_AUTO, + sfxge_rx_stats[id].name, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + sc, id, sfxge_rx_stat_handler, "IU", ""); } } Index: sys/dev/sfxge/sfxge_tx.c =================================================================== --- sys/dev/sfxge/sfxge_tx.c +++ sys/dev/sfxge/sfxge_tx.c @@ -1760,8 +1760,7 @@ unsigned int id; stat_node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(txq_node), OID_AUTO, - "stats", CTLFLAG_RD, NULL, - "Tx queue statistics"); + "stats", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx queue statistics"); if (stat_node == NULL) return (ENOMEM); @@ -1872,7 +1871,7 @@ snprintf(name, sizeof(name), "%u", txq_index); txq_node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sc->txqs_node), - OID_AUTO, name, CTLFLAG_RD, NULL, ""); + OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); if (txq_node == NULL) { rc = ENOMEM; goto fail_txq_node; @@ -1892,8 +1891,8 @@ SFXGE_TXQ_LOCK_INIT(txq, device_get_nameunit(sc->dev), txq_index); dpl_node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(txq_node), OID_AUTO, - "dpl", CTLFLAG_RD, NULL, - "Deferred packet list statistics"); + "dpl", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Deferred packet list statistics"); if (dpl_node == NULL) { rc = ENOMEM; goto fail_dpl_node; @@ -1966,12 +1965,10 @@ stat_list = SYSCTL_CHILDREN(sc->stats_node); for (id = 0; id < nitems(sfxge_tx_stats); id++) { - SYSCTL_ADD_PROC( - ctx, stat_list, - OID_AUTO, sfxge_tx_stats[id].name, - CTLTYPE_ULONG|CTLFLAG_RD, - sc, id, sfxge_tx_stat_handler, "LU", - ""); + SYSCTL_ADD_PROC(ctx, stat_list, OID_AUTO, + sfxge_tx_stats[id].name, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + sc, id, sfxge_tx_stat_handler, "LU", ""); } } @@ -2054,10 +2051,9 @@ (!encp->enc_fw_assisted_tso_v2_enabled)) sc->tso_fw_assisted &= ~SFXGE_FATSOV2; - sc->txqs_node = SYSCTL_ADD_NODE( - device_get_sysctl_ctx(sc->dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), - OID_AUTO, "txq", CTLFLAG_RD, NULL, "Tx queues"); + sc->txqs_node = SYSCTL_ADD_NODE(device_get_sysctl_ctx(sc->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, + "txq", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx queues"); if (sc->txqs_node == NULL) { rc = ENOMEM; goto fail_txq_node; Index: sys/dev/sk/if_sk.c =================================================================== --- sys/dev/sk/if_sk.c +++ sys/dev/sk/if_sk.c @@ -1596,7 +1596,8 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "int_mod", CTLTYPE_INT|CTLFLAG_RW, + OID_AUTO, "int_mod", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sc->sk_int_mod, 0, sysctl_hw_sk_int_mod, "I", "SK interrupt moderation"); Index: sys/dev/sound/clone.c =================================================================== --- sys/dev/sound/clone.c +++ sys/dev/sound/clone.c @@ -158,8 +158,9 @@ return (err); } -SYSCTL_PROC(_hw_snd, OID_AUTO, timestamp_precision, CTLTYPE_INT | CTLFLAG_RW, - 0, sizeof(int), sysctl_hw_snd_timestamp_precision, "I", +SYSCTL_PROC(_hw_snd, OID_AUTO, timestamp_precision, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_timestamp_precision, "I", "timestamp precision (0=s 1=hz 2=us 3=ns)"); #endif Index: sys/dev/sound/midi/midi.c =================================================================== --- sys/dev/sound/midi/midi.c +++ sys/dev/sound/midi/midi.c @@ -243,8 +243,10 @@ /* * Misc declr. */ -SYSCTL_NODE(_hw, OID_AUTO, midi, CTLFLAG_RD, 0, "Midi driver"); -static SYSCTL_NODE(_hw_midi, OID_AUTO, stat, CTLFLAG_RD, 0, "Status device"); +SYSCTL_NODE(_hw, OID_AUTO, midi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Midi driver"); +static SYSCTL_NODE(_hw_midi, OID_AUTO, stat, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Status device"); int midi_debug; /* XXX: should this be moved into debug.midi? */ Index: sys/dev/sound/midi/sequencer.c =================================================================== --- sys/dev/sound/midi/sequencer.c +++ sys/dev/sound/midi/sequencer.c @@ -159,7 +159,8 @@ * we currently own. */ -SYSCTL_NODE(_hw_midi, OID_AUTO, seq, CTLFLAG_RD, 0, "Midi sequencer"); +SYSCTL_NODE(_hw_midi, OID_AUTO, seq, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Midi sequencer"); int seq_debug; /* XXX: should this be moved into debug.midi? */ Index: sys/dev/sound/pci/atiixp.c =================================================================== --- sys/dev/sound/pci/atiixp.c +++ sys/dev/sound/pci/atiixp.c @@ -1096,8 +1096,8 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, - "polling", CTLTYPE_INT | CTLFLAG_RW, sc->dev, sizeof(sc->dev), - sysctl_atiixp_polling, "I", "Enable polling mode"); + "polling", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc->dev, + sizeof(sc->dev), sysctl_atiixp_polling, "I", "Enable polling mode"); snprintf(status, SND_STATUSLEN, "at memory 0x%jx irq %jd %s", rman_get_start(sc->reg), rman_get_start(sc->irq), Index: sys/dev/sound/pci/emu10kx.c =================================================================== --- sys/dev/sound/pci/emu10kx.c +++ sys/dev/sound/pci/emu10kx.c @@ -1577,10 +1577,9 @@ */ snprintf(sysctl_name, 32, "_%s", mix_name); SYSCTL_ADD_PROC(sc->ctx, - SYSCTL_CHILDREN(sc->root), - OID_AUTO, sysctl_name, - CTLTYPE_INT | CTLFLAG_RW, sc, mix_id, - sysctl_emu_mixer_control, "I", ""); + SYSCTL_CHILDREN(sc->root), OID_AUTO, sysctl_name, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, mix_id, + sysctl_emu_mixer_control, "I", ""); } return (volgpr); @@ -1618,11 +1617,10 @@ emu_digitalswitch(struct emu_sc_info *sc) { /* XXX temporary? */ - SYSCTL_ADD_PROC(sc->ctx, - SYSCTL_CHILDREN(sc->root), - OID_AUTO, "_digital", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, - sysctl_emu_digitalswitch_control, "I", "Enable digital output"); + SYSCTL_ADD_PROC(sc->ctx, SYSCTL_CHILDREN(sc->root), OID_AUTO, + "_digital", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, 0, sysctl_emu_digitalswitch_control, "I", + "Enable digital output"); return; } Index: sys/dev/sound/pci/es137x.c =================================================================== --- sys/dev/sound/pci/es137x.c +++ sys/dev/sound/pci/es137x.c @@ -1647,8 +1647,8 @@ <861wujij2q.fsf@xps.des.no> */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "spdif_enabled", CTLTYPE_INT | CTLFLAG_RW, dev, sizeof(dev), - sysctl_es137x_spdif_enable, "I", + "spdif_enabled", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + dev, sizeof(dev), sysctl_es137x_spdif_enable, "I", "Enable S/PDIF output on primary playback channel"); } else if (devid == ES1370_PCI_ID) { /* @@ -1663,7 +1663,8 @@ <861wujij2q.fsf@xps.des.no> */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "fixed_rate", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "fixed_rate", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, dev, sizeof(dev), sysctl_es137x_fixed_rate, "I", "Enable fixed rate playback/recording"); } @@ -1680,8 +1681,8 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "single_pcm_mixer", - CTLTYPE_INT | CTLFLAG_RW, dev, sizeof(dev), - sysctl_es137x_single_pcm_mixer, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, dev, + sizeof(dev), sysctl_es137x_single_pcm_mixer, "I", "Single PCM mixer controller for both DAC1/DAC2"); } } @@ -1693,14 +1694,13 @@ multimedia@ in msg-id <861wujij2q.fsf@xps.des.no> */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "latency_timer", CTLTYPE_INT | CTLFLAG_RW, dev, sizeof(dev), - sysctl_es137x_latency_timer, "I", + "latency_timer", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + dev, sizeof(dev), sysctl_es137x_latency_timer, "I", "PCI Latency Timer configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "polling", CTLTYPE_INT | CTLFLAG_RW, dev, sizeof(dev), - sysctl_es_polling, "I", - "Enable polling mode"); + "polling", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, dev, + sizeof(dev), sysctl_es_polling, "I", "Enable polling mode"); } static int Index: sys/dev/sound/pci/hda/hdaa.c =================================================================== --- sys/dev/sound/pci/hda/hdaa.c +++ sys/dev/sound/pci/hda/hdaa.c @@ -6671,7 +6671,7 @@ devinfo, 0, hdaa_sysctl_gpo_config, "A", "GPO configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "reconfig", CTLTYPE_INT | CTLFLAG_RW, + "reconfig", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, dev, 0, hdaa_sysctl_reconfig, "I", "Reprocess configuration"); SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, Index: sys/dev/sound/pci/hda/hdac.c =================================================================== --- sys/dev/sound/pci/hda/hdac.c +++ sys/dev/sound/pci/hda/hdac.c @@ -1565,12 +1565,12 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, - "pindump", CTLTYPE_INT | CTLFLAG_RW, sc->dev, sizeof(sc->dev), - sysctl_hdac_pindump, "I", "Dump pin states/data"); + "pindump", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc->dev, + sizeof(sc->dev), sysctl_hdac_pindump, "I", "Dump pin states/data"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO, - "polling", CTLTYPE_INT | CTLFLAG_RW, sc->dev, sizeof(sc->dev), - sysctl_hdac_polling, "I", "Enable polling mode"); + "polling", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc->dev, + sizeof(sc->dev), sysctl_hdac_polling, "I", "Enable polling mode"); } /**************************************************************************** Index: sys/dev/sound/pci/maestro.c =================================================================== --- sys/dev/sound/pci/maestro.c +++ sys/dev/sound/pci/maestro.c @@ -190,7 +190,8 @@ /* XXX: this should move to a device specific sysctl dev.pcm.X.debug.Y via device_get_sysctl_*() as discussed on multimedia@ in msg-id <861wujij2q.fsf@xps.des.no> */ -static SYSCTL_NODE(_debug, OID_AUTO, maestro, CTLFLAG_RD, 0, ""); +static SYSCTL_NODE(_debug, OID_AUTO, maestro, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + ""); SYSCTL_UINT(_debug_maestro, OID_AUTO, powerstate_active, CTLFLAG_RW, &powerstate_active, 0, "The Dx power state when active (0-1)"); SYSCTL_UINT(_debug_maestro, OID_AUTO, powerstate_idle, CTLFLAG_RW, Index: sys/dev/sound/pci/via8233.c =================================================================== --- sys/dev/sound/pci/via8233.c +++ sys/dev/sound/pci/via8233.c @@ -258,19 +258,18 @@ as discussed on multimedia@ in msg-id <861wujij2q.fsf@xps.des.no> */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "spdif_enabled", CTLTYPE_INT | CTLFLAG_RW, dev, sizeof(dev), - sysctl_via8233_spdif_enable, "I", + "spdif_enabled", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + dev, sizeof(dev), sysctl_via8233_spdif_enable, "I", "Enable S/PDIF output on primary playback channel"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "dxs_src", CTLTYPE_INT | CTLFLAG_RW, dev, sizeof(dev), - sysctl_via8233_dxs_src, "I", + "dxs_src", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + dev, sizeof(dev), sysctl_via8233_dxs_src, "I", "Enable VIA DXS Sample Rate Converter"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "polling", CTLTYPE_INT | CTLFLAG_RW, dev, sizeof(dev), - sysctl_via_polling, "I", - "Enable polling mode"); + "polling", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + dev, sizeof(dev), sysctl_via_polling, "I", "Enable polling mode"); } static __inline uint32_t Index: sys/dev/sound/pcm/ac97.c =================================================================== --- sys/dev/sound/pcm/ac97.c +++ sys/dev/sound/pcm/ac97.c @@ -919,7 +919,8 @@ return; SYSCTL_ADD_PROC(device_get_sysctl_ctx(codec->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(codec->dev)), - OID_AUTO, "eapd", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "eapd", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, codec, sizeof(codec), sysctl_hw_snd_ac97_eapd, "I", "AC97 External Amplifier"); } Index: sys/dev/sound/pcm/channel.c =================================================================== --- sys/dev/sound/pcm/channel.c +++ sys/dev/sound/pcm/channel.c @@ -68,9 +68,10 @@ return err; } -SYSCTL_PROC(_hw_snd, OID_AUTO, latency, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_snd_latency, "I", - "buffering latency (0=low ... 10=high)"); +SYSCTL_PROC(_hw_snd, OID_AUTO, latency, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_latency, "I", + "buffering latency (0=low ... 10=high)"); int chn_latency_profile = CHN_LATENCY_PROFILE_DEFAULT; @@ -90,9 +91,10 @@ return err; } -SYSCTL_PROC(_hw_snd, OID_AUTO, latency_profile, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_snd_latency_profile, "I", - "buffering latency profile (0=aggressive 1=safe)"); +SYSCTL_PROC(_hw_snd, OID_AUTO, latency_profile, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_latency_profile, "I", + "buffering latency profile (0=aggressive 1=safe)"); static int chn_timeout = CHN_TIMEOUT; @@ -112,9 +114,10 @@ return err; } -SYSCTL_PROC(_hw_snd, OID_AUTO, timeout, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_snd_timeout, "I", - "interrupt timeout (1 - 10) seconds"); +SYSCTL_PROC(_hw_snd, OID_AUTO, timeout, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_timeout, "I", + "interrupt timeout (1 - 10) seconds"); static int chn_vpc_autoreset = 1; SYSCTL_INT(_hw_snd, OID_AUTO, vpc_autoreset, CTLFLAG_RWTUN, @@ -166,9 +169,10 @@ return (0); } -SYSCTL_PROC(_hw_snd, OID_AUTO, vpc_0db, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_snd_vpc_0db, "I", - "0db relative level"); +SYSCTL_PROC(_hw_snd, OID_AUTO, vpc_0db, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_vpc_0db, "I", + "0db relative level"); static int sysctl_hw_snd_vpc_reset(SYSCTL_HANDLER_ARGS) @@ -185,9 +189,10 @@ return (0); } -SYSCTL_PROC(_hw_snd, OID_AUTO, vpc_reset, CTLTYPE_INT | CTLFLAG_RW, - 0, sizeof(int), sysctl_hw_snd_vpc_reset, "I", - "reset volume on all channels"); +SYSCTL_PROC(_hw_snd, OID_AUTO, vpc_reset, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_vpc_reset, "I", + "reset volume on all channels"); static int chn_usefrags = 0; static int chn_syncdelay = -1; Index: sys/dev/sound/pcm/feeder_eq.c =================================================================== --- sys/dev/sound/pcm/feeder_eq.c +++ sys/dev/sound/pcm/feeder_eq.c @@ -684,8 +684,8 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "eq", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d), - sysctl_dev_pcm_eq, "I", + "eq", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, d, + sizeof(d), sysctl_dev_pcm_eq, "I", "Bass/Treble Equalizer (0=disable, 1=enable, 2=bypass)"); (void)snprintf(buf, sizeof(buf), "Bass/Treble Equalizer Preamp " @@ -696,7 +696,7 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "eq_preamp", CTLTYPE_STRING | CTLFLAG_RWTUN, d, sizeof(d), - sysctl_dev_pcm_eq_preamp, "A", buf); + "eq_preamp", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + d, sizeof(d), sysctl_dev_pcm_eq_preamp, "A", buf); } #endif Index: sys/dev/sound/pcm/feeder_rate.c =================================================================== --- sys/dev/sound/pcm/feeder_rate.c +++ sys/dev/sound/pcm/feeder_rate.c @@ -185,8 +185,9 @@ return (0); } -SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_min, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_snd_feeder_rate_min, "I", +SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_min, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_feeder_rate_min, "I", "minimum allowable rate"); static int @@ -207,8 +208,9 @@ return (0); } -SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_max, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_snd_feeder_rate_max, "I", +SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_max, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_feeder_rate_max, "I", "maximum allowable rate"); static int @@ -229,8 +231,9 @@ return (0); } -SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_round, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_snd_feeder_rate_round, "I", +SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_round, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_feeder_rate_round, "I", "sample rate converter rounding threshold"); static int @@ -281,8 +284,9 @@ return (0); } -SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_quality, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_snd_feeder_rate_quality, "I", +SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_quality, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_feeder_rate_quality, "I", "sample rate converter quality ("__XSTRING(Z_QUALITY_MIN)"=low .. " __XSTRING(Z_QUALITY_MAX)"=high)"); #endif /* _KERNEL */ Index: sys/dev/sound/pcm/mixer.c =================================================================== --- sys/dev/sound/pcm/mixer.c +++ sys/dev/sound/pcm/mixer.c @@ -888,9 +888,9 @@ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "hwvol_step", CTLFLAG_RWTUN, &m->hwvol_step, 0, ""); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "hwvol_mixer", CTLTYPE_STRING | CTLFLAG_RWTUN, m, 0, - sysctl_hw_snd_hwvol_mixer, "A", ""); + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "hwvol_mixer", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + m, 0, sysctl_hw_snd_hwvol_mixer, "A", ""); return 0; } Index: sys/dev/sound/pcm/sndstat.c =================================================================== --- sys/dev/sound/pcm/sndstat.c +++ sys/dev/sound/pcm/sndstat.c @@ -100,8 +100,10 @@ } return (error); } -SYSCTL_PROC(_hw_snd, OID_AUTO, verbose, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_sndverbose, "I", "verbosity level"); +SYSCTL_PROC(_hw_snd, OID_AUTO, verbose, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_sndverbose, "I", + "verbosity level"); static int sndstat_open(struct cdev *i_dev, int flags, int mode, struct thread *td) Index: sys/dev/sound/pcm/sound.c =================================================================== --- sys/dev/sound/pcm/sound.c +++ sys/dev/sound/pcm/sound.c @@ -58,7 +58,8 @@ int snd_maxautovchans = 16; -SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD, 0, "Sound driver"); +SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Sound driver"); static void pcm_sysinit(device_t); @@ -443,9 +444,9 @@ } /* XXX: do we need a way to let the user change the default unit? */ SYSCTL_PROC(_hw_snd, OID_AUTO, default_unit, - CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_ANYBODY, - 0, sizeof(int), sysctl_hw_snd_default_unit, "I", - "default sound device"); + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_ANYBODY | CTLFLAG_NEEDGIANT, 0, + sizeof(int), sysctl_hw_snd_default_unit, "I", + "default sound device"); static int sysctl_hw_snd_maxautovchans(SYSCTL_HANDLER_ARGS) @@ -473,8 +474,10 @@ } return (error); } -SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_snd_maxautovchans, "I", "maximum virtual channel"); +SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_maxautovchans, "I", + "maximum virtual channel"); struct pcm_channel * pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, int dir, int num, void *devinfo) @@ -1007,8 +1010,9 @@ return (err); } -SYSCTL_PROC(_hw_snd, OID_AUTO, clone_gc, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_hw_snd_clone_gc, "I", +SYSCTL_PROC(_hw_snd, OID_AUTO, clone_gc, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_hw_snd_clone_gc, "I", "global clone garbage collector"); #endif @@ -1024,25 +1028,25 @@ OID_AUTO, "buffersize", CTLFLAG_RD, &d->bufsz, 0, "allocated buffer size"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "bitperfect", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d), - sysctl_dev_pcm_bitperfect, "I", + "bitperfect", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, d, + sizeof(d), sysctl_dev_pcm_bitperfect, "I", "bit-perfect playback/recording (0=disable, 1=enable)"); #ifdef SND_DEBUG SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "clone_flags", CTLTYPE_UINT | CTLFLAG_RWTUN, d, sizeof(d), - sysctl_dev_pcm_clone_flags, "IU", + "clone_flags", CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + d, sizeof(d), sysctl_dev_pcm_clone_flags, "IU", "clone flags"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "clone_deadline", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d), - sysctl_dev_pcm_clone_deadline, "I", + "clone_deadline", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + d, sizeof(d), sysctl_dev_pcm_clone_deadline, "I", "clone expiration deadline (ms)"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "clone_gc", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d), - sysctl_dev_pcm_clone_gc, "I", - "clone garbage collector"); + "clone_gc", + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, d, sizeof(d), + sysctl_dev_pcm_clone_gc, "I", "clone garbage collector"); #endif if (d->flags & SD_F_AUTOVCHAN) vchan_initsys(dev); @@ -1126,11 +1130,11 @@ sysctl_ctx_init(&d->play_sysctl_ctx); d->play_sysctl_tree = SYSCTL_ADD_NODE(&d->play_sysctl_ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "play", - CTLFLAG_RD, 0, "playback channels node"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "playback channels node"); sysctl_ctx_init(&d->rec_sysctl_ctx); d->rec_sysctl_tree = SYSCTL_ADD_NODE(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rec", - CTLFLAG_RD, 0, "record channels node"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "record channels node"); if (numplay > 0 || numrec > 0) d->flags |= SD_F_AUTOVCHAN; Index: sys/dev/sound/pcm/vchan.c =================================================================== --- sys/dev/sound/pcm/vchan.c +++ sys/dev/sound/pcm/vchan.c @@ -948,45 +948,52 @@ /* Play */ SYSCTL_ADD_PROC(&d->play_sysctl_ctx, SYSCTL_CHILDREN(d->play_sysctl_tree), - OID_AUTO, "vchans", CTLTYPE_INT | CTLFLAG_RWTUN, + OID_AUTO, "vchans", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchans, "I", "total allocated virtual channel"); SYSCTL_ADD_PROC(&d->play_sysctl_ctx, SYSCTL_CHILDREN(d->play_sysctl_tree), - OID_AUTO, "vchanmode", CTLTYPE_STRING | CTLFLAG_RWTUN, + OID_AUTO, "vchanmode", + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanmode, "A", "vchan format/rate selection: 0=fixed, 1=passthrough, 2=adaptive"); SYSCTL_ADD_PROC(&d->play_sysctl_ctx, SYSCTL_CHILDREN(d->play_sysctl_tree), - OID_AUTO, "vchanrate", CTLTYPE_INT | CTLFLAG_RWTUN, + OID_AUTO, "vchanrate", + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanrate, "I", "virtual channel mixing speed/rate"); SYSCTL_ADD_PROC(&d->play_sysctl_ctx, SYSCTL_CHILDREN(d->play_sysctl_tree), - OID_AUTO, "vchanformat", CTLTYPE_STRING | CTLFLAG_RWTUN, + OID_AUTO, "vchanformat", + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanformat, "A", "virtual channel mixing format"); /* Rec */ SYSCTL_ADD_PROC(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(d->rec_sysctl_tree), - OID_AUTO, "vchans", CTLTYPE_INT | CTLFLAG_RWTUN, + OID_AUTO, "vchans", + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchans, "I", "total allocated virtual channel"); SYSCTL_ADD_PROC(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(d->rec_sysctl_tree), - OID_AUTO, "vchanmode", CTLTYPE_STRING | CTLFLAG_RWTUN, + OID_AUTO, "vchanmode", + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanmode, "A", "vchan format/rate selection: 0=fixed, 1=passthrough, 2=adaptive"); SYSCTL_ADD_PROC(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(d->rec_sysctl_tree), - OID_AUTO, "vchanrate", CTLTYPE_INT | CTLFLAG_RWTUN, + OID_AUTO, "vchanrate", + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanrate, "I", "virtual channel mixing speed/rate"); SYSCTL_ADD_PROC(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(d->rec_sysctl_tree), - OID_AUTO, "vchanformat", CTLTYPE_STRING | CTLFLAG_RWTUN, + OID_AUTO, "vchanformat", + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE, sysctl_dev_pcm_vchanformat, "A", "virtual channel mixing format"); } Index: sys/dev/ste/if_ste.c =================================================================== --- sys/dev/ste/if_ste.c +++ sys/dev/ste/if_ste.c @@ -2053,13 +2053,13 @@ resource_int_value(device_get_name(sc->ste_dev), device_get_unit(sc->ste_dev), "int_rx_mod", &sc->ste_int_rx_mod); - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "STE statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "STE statistics"); parent = SYSCTL_CHILDREN(tree); /* Rx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "Rx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Rx MAC statistics"); child = SYSCTL_CHILDREN(tree); STE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", &stats->rx_bytes, "Good octets"); @@ -2073,8 +2073,8 @@ &stats->rx_lost_frames, "Lost frames"); /* Tx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "Tx MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Tx MAC statistics"); child = SYSCTL_CHILDREN(tree); STE_SYSCTL_STAT_ADD64(ctx, child, "good_octets", &stats->tx_bytes, "Good octets"); Index: sys/dev/stge/if_stge.c =================================================================== --- sys/dev/stge/if_stge.c +++ sys/dev/stge/if_stge.c @@ -476,13 +476,15 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "rxint_nframe", CTLTYPE_INT|CTLFLAG_RW, &sc->sc_rxint_nframe, 0, - sysctl_hw_stge_rxint_nframe, "I", "stge rx interrupt nframe"); + "rxint_nframe", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &sc->sc_rxint_nframe, 0, sysctl_hw_stge_rxint_nframe, "I", + "stge rx interrupt nframe"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "rxint_dmawait", CTLTYPE_INT|CTLFLAG_RW, &sc->sc_rxint_dmawait, 0, - sysctl_hw_stge_rxint_dmawait, "I", "stge rx interrupt dmawait"); + "rxint_dmawait", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &sc->sc_rxint_dmawait, 0, sysctl_hw_stge_rxint_dmawait, "I", + "stge rx interrupt dmawait"); /* Pull in device tunables. */ sc->sc_rxint_nframe = STGE_RXINT_NFRAME_DEFAULT; Index: sys/dev/syscons/syscons.c =================================================================== --- sys/dev/syscons/syscons.c +++ sys/dev/syscons/syscons.c @@ -146,8 +146,11 @@ #endif static int sc_susp_scr; -static SYSCTL_NODE(_hw, OID_AUTO, syscons, CTLFLAG_RD, 0, "syscons"); -static SYSCTL_NODE(_hw_syscons, OID_AUTO, saver, CTLFLAG_RD, 0, "saver"); +static SYSCTL_NODE(_hw, OID_AUTO, syscons, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "syscons"); +static SYSCTL_NODE(_hw_syscons, OID_AUTO, saver, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "saver"); SYSCTL_INT(_hw_syscons_saver, OID_AUTO, keybonly, CTLFLAG_RW, &sc_saver_keyb_only, 0, "screen saver interrupted by input only"); SYSCTL_INT( Index: sys/dev/tsec/if_tsec.c =================================================================== --- sys/dev/tsec/if_tsec.c +++ sys/dev/tsec/if_tsec.c @@ -1680,22 +1680,22 @@ ctx = device_get_sysctl_ctx(sc->dev); children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)); tree = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "int_coal", - CTLFLAG_RD, 0, "TSEC Interrupts coalescing"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "TSEC Interrupts coalescing"); children = SYSCTL_CHILDREN(tree); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_time", - CTLTYPE_UINT | CTLFLAG_RW, sc, TSEC_IC_RX, tsec_sysctl_ic_time, - "I", "IC RX time threshold (0-65535)"); + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, TSEC_IC_RX, + tsec_sysctl_ic_time, "I", "IC RX time threshold (0-65535)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rx_count", - CTLTYPE_UINT | CTLFLAG_RW, sc, TSEC_IC_RX, tsec_sysctl_ic_count, - "I", "IC RX frame count threshold (0-255)"); + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, TSEC_IC_RX, + tsec_sysctl_ic_count, "I", "IC RX frame count threshold (0-255)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_time", - CTLTYPE_UINT | CTLFLAG_RW, sc, TSEC_IC_TX, tsec_sysctl_ic_time, - "I", "IC TX time threshold (0-65535)"); + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, TSEC_IC_TX, + tsec_sysctl_ic_time, "I", "IC TX time threshold (0-65535)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_count", - CTLTYPE_UINT | CTLFLAG_RW, sc, TSEC_IC_TX, tsec_sysctl_ic_count, - "I", "IC TX frame count threshold (0-255)"); + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, TSEC_IC_TX, + tsec_sysctl_ic_count, "I", "IC TX frame count threshold (0-255)"); } /* Index: sys/dev/twa/tw_osl_freebsd.c =================================================================== --- sys/dev/twa/tw_osl_freebsd.c +++ sys/dev/twa/tw_osl_freebsd.c @@ -309,8 +309,8 @@ sysctl_ctx_init(&sc->sysctl_ctxt); sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctxt, - SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, - device_get_nameunit(dev), CTLFLAG_RD, 0, ""); + SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, device_get_nameunit(dev), + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (sc->sysctl_tree == NULL) { tw_osli_printf(sc, "error = %d", TW_CL_SEVERITY_ERROR_STRING, Index: sys/dev/twe/twe_freebsd.c =================================================================== --- sys/dev/twe/twe_freebsd.c +++ sys/dev/twe/twe_freebsd.c @@ -202,7 +202,7 @@ */ sysctl_tree = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev), SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, - device_get_nameunit(dev), CTLFLAG_RD, 0, ""); + device_get_nameunit(dev), CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (sysctl_tree == NULL) { twe_printf(sc, "cannot add sysctl tree node\n"); return (ENXIO); Index: sys/dev/tws/tws.c =================================================================== --- sys/dev/tws/tws.c +++ sys/dev/tws/tws.c @@ -216,9 +216,8 @@ /* sysctl context setup */ sysctl_ctx_init(&sc->tws_clist); sc->tws_oidp = SYSCTL_ADD_NODE(&sc->tws_clist, - SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, - device_get_nameunit(dev), - CTLFLAG_RD, 0, ""); + SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, + device_get_nameunit(dev), CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if ( sc->tws_oidp == NULL ) { tws_log(sc, SYSCTL_TREE_NODE_ADD); goto attach_fail_1; Index: sys/dev/uart/uart_core.c =================================================================== --- sys/dev/uart/uart_core.c +++ sys/dev/uart/uart_core.c @@ -209,8 +209,8 @@ #endif TUNABLE_INT_FETCH("hw.uart.pps_mode", &sc->sc_pps_mode); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "pps_mode", - CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, uart_pps_mode_sysctl, "I", - "pulse mode: 0/1/2=disabled/CTS/DCD; " + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, sc, 0, + uart_pps_mode_sysctl, "I", "pulse mode: 0/1/2=disabled/CTS/DCD; " "add 0x10 to invert, 0x20 for narrow pulse"); if (!uart_pps_mode_valid(sc->sc_pps_mode)) { Index: sys/dev/ubsec/ubsec.c =================================================================== --- sys/dev/ubsec/ubsec.c +++ sys/dev/ubsec/ubsec.c @@ -173,7 +173,7 @@ static void ubsec_kshift_r(u_int, u_int8_t *, u_int, u_int8_t *, u_int); static void ubsec_kshift_l(u_int, u_int8_t *, u_int, u_int8_t *, u_int); -static SYSCTL_NODE(_hw, OID_AUTO, ubsec, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw, OID_AUTO, ubsec, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Broadcom driver parameters"); #ifdef UBSEC_DEBUG Index: sys/dev/vge/if_vge.c =================================================================== --- sys/dev/vge/if_vge.c +++ sys/dev/vge/if_vge.c @@ -2532,13 +2532,13 @@ resource_int_value(device_get_name(sc->vge_dev), device_get_unit(sc->vge_dev), "tx_coal_pkt", &sc->vge_tx_coal_pkt); - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "VGE statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "VGE statistics"); parent = SYSCTL_CHILDREN(tree); /* Rx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "RX MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "RX MAC statistics"); child = SYSCTL_CHILDREN(tree); VGE_SYSCTL_STAT_ADD32(ctx, child, "frames", &stats->rx_frames, "frames"); @@ -2582,8 +2582,8 @@ &stats->rx_lenerrs, "Frames with length mismatched"); /* Tx statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "TX MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TX MAC statistics"); child = SYSCTL_CHILDREN(tree); VGE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", &stats->tx_good_frames, "Good frames"); Index: sys/dev/virtio/block/virtio_blk.c =================================================================== --- sys/dev/virtio/block/virtio_blk.c +++ sys/dev/virtio/block/virtio_blk.c @@ -1392,8 +1392,9 @@ child = SYSCTL_CHILDREN(tree); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "writecache_mode", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, vtblk_write_cache_sysctl, - "I", "Write cache mode (writethrough (0) or writeback (1))"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, + vtblk_write_cache_sysctl, "I", + "Write cache mode (writethrough (0) or writeback (1))"); } static int Index: sys/dev/virtio/network/if_vtnet.c =================================================================== --- sys/dev/virtio/network/if_vtnet.c +++ sys/dev/virtio/network/if_vtnet.c @@ -234,7 +234,8 @@ DEBUGNET_DEFINE(vtnet); /* Tunables. */ -static SYSCTL_NODE(_hw, OID_AUTO, vtnet, CTLFLAG_RD, 0, "VNET driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, vtnet, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "VNET driver parameters"); static int vtnet_csum_disable = 0; TUNABLE_INT("hw.vtnet.csum_disable", &vtnet_csum_disable); SYSCTL_INT(_hw_vtnet, OID_AUTO, csum_disable, CTLFLAG_RDTUN, @@ -3750,7 +3751,7 @@ snprintf(namebuf, sizeof(namebuf), "rxq%d", rxq->vtnrx_id); node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, - CTLFLAG_RD, NULL, "Receive Queue"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Receive Queue"); list = SYSCTL_CHILDREN(node); stats = &rxq->vtnrx_stats; @@ -3783,7 +3784,7 @@ snprintf(namebuf, sizeof(namebuf), "txq%d", txq->vtntx_id); node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, - CTLFLAG_RD, NULL, "Transmit Queue"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Transmit Queue"); list = SYSCTL_CHILDREN(node); stats = &txq->vtntx_stats; Index: sys/dev/vmware/pvscsi/pvscsi.c =================================================================== --- sys/dev/vmware/pvscsi/pvscsi.c +++ sys/dev/vmware/pvscsi/pvscsi.c @@ -130,7 +130,7 @@ #ifdef PVSCSI_DEBUG_LOGGING static int pvscsi_log_level = 0; -static SYSCTL_NODE(_hw, OID_AUTO, pvscsi, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw, OID_AUTO, pvscsi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "PVSCSI driver parameters"); SYSCTL_INT(_hw_pvscsi, OID_AUTO, log_level, CTLFLAG_RWTUN, &pvscsi_log_level, 0, "PVSCSI debug log level"); Index: sys/dev/vmware/vmxnet3/if_vmx.c =================================================================== --- sys/dev/vmware/vmxnet3/if_vmx.c +++ sys/dev/vmware/vmxnet3/if_vmx.c @@ -2168,16 +2168,16 @@ txstats = &txq->vxtxq_ts->stats; snprintf(namebuf, sizeof(namebuf), "txq%d", txq->vxtxq_id); - node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, CTLFLAG_RD, - NULL, "Transmit Queue"); + node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Transmit Queue"); txq->vxtxq_sysctl = list = SYSCTL_CHILDREN(node); /* * Add statistics reported by the host. These are updated by the * iflib txq timer on txq 0. */ - txsnode = SYSCTL_ADD_NODE(ctx, list, OID_AUTO, "hstats", CTLFLAG_RD, - NULL, "Host Statistics"); + txsnode = SYSCTL_ADD_NODE(ctx, list, OID_AUTO, "hstats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Host Statistics"); txslist = SYSCTL_CHILDREN(txsnode); SYSCTL_ADD_UQUAD(ctx, txslist, OID_AUTO, "tso_packets", CTLFLAG_RD, &txstats->TSO_packets, "TSO packets"); @@ -2209,16 +2209,16 @@ rxstats = &rxq->vxrxq_rs->stats; snprintf(namebuf, sizeof(namebuf), "rxq%d", rxq->vxrxq_id); - node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, CTLFLAG_RD, - NULL, "Receive Queue"); + node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Receive Queue"); rxq->vxrxq_sysctl = list = SYSCTL_CHILDREN(node); /* * Add statistics reported by the host. These are updated by the * iflib txq timer on txq 0. */ - rxsnode = SYSCTL_ADD_NODE(ctx, list, OID_AUTO, "hstats", CTLFLAG_RD, - NULL, "Host Statistics"); + rxsnode = SYSCTL_ADD_NODE(ctx, list, OID_AUTO, "hstats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Host Statistics"); rxslist = SYSCTL_CHILDREN(rxsnode); SYSCTL_ADD_UQUAD(ctx, rxslist, OID_AUTO, "lro_packets", CTLFLAG_RD, &rxstats->LRO_packets, "LRO packets"); @@ -2257,7 +2257,7 @@ struct vmxnet3_txqueue *txq = &sc->vmx_txq[i]; node = SYSCTL_ADD_NODE(ctx, txq->vxtxq_sysctl, OID_AUTO, - "debug", CTLFLAG_RD, NULL, ""); + "debug", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); list = SYSCTL_CHILDREN(node); SYSCTL_ADD_UINT(ctx, list, OID_AUTO, "cmd_next", CTLFLAG_RD, @@ -2278,7 +2278,7 @@ struct vmxnet3_rxqueue *rxq = &sc->vmx_rxq[i]; node = SYSCTL_ADD_NODE(ctx, rxq->vxrxq_sysctl, OID_AUTO, - "debug", CTLFLAG_RD, NULL, ""); + "debug", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); list = SYSCTL_CHILDREN(node); SYSCTL_ADD_UINT(ctx, list, OID_AUTO, "cmd0_ndesc", CTLFLAG_RD, Index: sys/dev/vr/if_vr.c =================================================================== --- sys/dev/vr/if_vr.c +++ sys/dev/vr/if_vr.c @@ -626,8 +626,8 @@ callout_init_mtx(&sc->vr_stat_callout, &sc->vr_mtx, 0); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0, - vr_sysctl_stats, "I", "Statistics"); + OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, 0, vr_sysctl_stats, "I", "Statistics"); error = 0; Index: sys/dev/vt/vt_core.c =================================================================== --- sys/dev/vt/vt_core.c +++ sys/dev/vt/vt_core.c @@ -120,7 +120,8 @@ #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ (vw)->vw_number) -static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "vt(9) parameters"); +static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "vt(9) parameters"); static VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); static VT_SYSCTL_INT(enable_bell, 1, "Enable bell"); static VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); Index: sys/dev/vte/if_vte.c =================================================================== --- sys/dev/vte/if_vte.c +++ sys/dev/vte/if_vte.c @@ -564,11 +564,13 @@ child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->vte_dev)); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_rx_mod", - CTLTYPE_INT | CTLFLAG_RW, &sc->vte_int_rx_mod, 0, - sysctl_hw_vte_int_mod, "I", "vte RX interrupt moderation"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &sc->vte_int_rx_mod, 0, sysctl_hw_vte_int_mod, "I", + "vte RX interrupt moderation"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_tx_mod", - CTLTYPE_INT | CTLFLAG_RW, &sc->vte_int_tx_mod, 0, - sysctl_hw_vte_int_mod, "I", "vte TX interrupt moderation"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &sc->vte_int_tx_mod, 0, sysctl_hw_vte_int_mod, "I", + "vte TX interrupt moderation"); /* Pull in device tunables. */ sc->vte_int_rx_mod = VTE_IM_RX_BUNDLE_DEFAULT; error = resource_int_value(device_get_name(sc->vte_dev), @@ -596,13 +598,13 @@ } } - tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, - NULL, "VTE statistics"); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "VTE statistics"); parent = SYSCTL_CHILDREN(tree); /* RX statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, - NULL, "RX MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "RX MAC statistics"); child = SYSCTL_CHILDREN(tree); VTE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", &stats->rx_frames, "Good frames"); @@ -625,8 +627,8 @@ &stats->rx_pause_frames, "Pause control frames"); /* TX statistics. */ - tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, - NULL, "TX MAC statistics"); + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "TX MAC statistics"); child = SYSCTL_CHILDREN(tree); VTE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", &stats->tx_frames, "Good frames"); Index: sys/dev/watchdog/watchdog.c =================================================================== --- sys/dev/watchdog/watchdog.c +++ sys/dev/watchdog/watchdog.c @@ -70,7 +70,8 @@ static u_int wd_last_u_sysctl; /* last timeout value set by kern_do_pat */ static u_int wd_last_u_sysctl_secs; /* wd_last_u in seconds */ -SYSCTL_NODE(_hw, OID_AUTO, watchdog, CTLFLAG_RD, 0, "Main watchdog device"); +SYSCTL_NODE(_hw, OID_AUTO, watchdog, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Main watchdog device"); SYSCTL_UINT(_hw_watchdog, OID_AUTO, wd_last_u, CTLFLAG_RD, &wd_last_u_sysctl, 0, "Watchdog last update time"); SYSCTL_UINT(_hw_watchdog, OID_AUTO, wd_last_u_secs, CTLFLAG_RD, Index: sys/dev/wbwd/wbwd.c =================================================================== --- sys/dev/wbwd/wbwd.c +++ sys/dev/wbwd/wbwd.c @@ -628,14 +628,15 @@ "debug_verbose", CTLFLAG_RW, &sc->debug_verbose, 0, "Enables extra debugging information"); SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "debug", - CTLTYPE_STRING|CTLFLAG_RD, sc, 0, sysctl_wb_debug, "A", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + sysctl_wb_debug, "A", "Selected register information from last change by driver"); SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "debug_current", - CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_SKIP, sc, 0, - sysctl_wb_debug_current, "A", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_NEEDGIANT, + sc, 0, sysctl_wb_debug_current, "A", "Selected register information (may interfere)"); SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "force_timeout", - CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_SKIP, sc, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_NEEDGIANT, sc, 0, sysctl_wb_force_test_nmi, "I", "Enable to force watchdog to fire."); /* Register watchdog. */ Index: sys/dev/wi/if_wi.c =================================================================== --- sys/dev/wi/if_wi.c +++ sys/dev/wi/if_wi.c @@ -171,8 +171,8 @@ return wi_write_rid(sc, rid, &val, sizeof(val)); } -static SYSCTL_NODE(_hw, OID_AUTO, wi, CTLFLAG_RD, 0, - "Wireless driver parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, wi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Wireless driver parameters"); static struct timeval lasttxerror; /* time of last tx error msg */ static int curtxeps; /* current tx error msgs/sec */ Index: sys/fs/cd9660/cd9660_vnops.c =================================================================== --- sys/fs/cd9660/cd9660_vnops.c +++ sys/fs/cd9660/cd9660_vnops.c @@ -844,7 +844,8 @@ return (0); } -SYSCTL_NODE(_vfs, OID_AUTO, cd9660, CTLFLAG_RW, 0, "cd9660 filesystem"); +SYSCTL_NODE(_vfs, OID_AUTO, cd9660, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "cd9660 filesystem"); static int use_buf_pager = 1; SYSCTL_INT(_vfs_cd9660, OID_AUTO, use_buf_pager, CTLFLAG_RWTUN, &use_buf_pager, 0, Index: sys/fs/devfs/devfs_devs.c =================================================================== --- sys/fs/devfs/devfs_devs.c +++ sys/fs/devfs/devfs_devs.c @@ -63,7 +63,8 @@ static MALLOC_DEFINE(M_DEVFS3, "DEVFS3", "DEVFS data 3"); static MALLOC_DEFINE(M_CDEVP, "DEVFS1", "DEVFS cdev_priv storage"); -SYSCTL_NODE(_vfs, OID_AUTO, devfs, CTLFLAG_RW, 0, "DEVFS filesystem"); +SYSCTL_NODE(_vfs, OID_AUTO, devfs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "DEVFS filesystem"); static unsigned devfs_generation; SYSCTL_UINT(_vfs_devfs, OID_AUTO, generation, CTLFLAG_RD, Index: sys/fs/ext2fs/ext2_alloc.c =================================================================== --- sys/fs/ext2fs/ext2_alloc.c +++ sys/fs/ext2fs/ext2_alloc.c @@ -187,7 +187,8 @@ * the previous block allocation will be used. */ -static SYSCTL_NODE(_vfs, OID_AUTO, ext2fs, CTLFLAG_RW, 0, "EXT2FS filesystem"); +static SYSCTL_NODE(_vfs, OID_AUTO, ext2fs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "EXT2FS filesystem"); static int doasyncfree = 1; Index: sys/fs/ext2fs/ext2_lookup.c =================================================================== --- sys/fs/ext2fs/ext2_lookup.c +++ sys/fs/ext2fs/ext2_lookup.c @@ -85,7 +85,8 @@ static int dirchk = 0; #endif -static SYSCTL_NODE(_vfs, OID_AUTO, e2fs, CTLFLAG_RD, 0, "EXT2FS filesystem"); +static SYSCTL_NODE(_vfs, OID_AUTO, e2fs, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "EXT2FS filesystem"); SYSCTL_INT(_vfs_e2fs, OID_AUTO, dircheck, CTLFLAG_RW, &dirchk, 0, ""); /* Index: sys/fs/msdosfs/msdosfs_vnops.c =================================================================== --- sys/fs/msdosfs/msdosfs_vnops.c +++ sys/fs/msdosfs/msdosfs_vnops.c @@ -1803,7 +1803,8 @@ return (0); } -SYSCTL_NODE(_vfs, OID_AUTO, msdosfs, CTLFLAG_RW, 0, "msdos filesystem"); +SYSCTL_NODE(_vfs, OID_AUTO, msdosfs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "msdos filesystem"); static int use_buf_pager = 1; SYSCTL_INT(_vfs_msdosfs, OID_AUTO, use_buf_pager, CTLFLAG_RWTUN, &use_buf_pager, 0, Index: sys/fs/nfs/nfs_commonport.c =================================================================== --- sys/fs/nfs/nfs_commonport.c +++ sys/fs/nfs/nfs_commonport.c @@ -82,7 +82,8 @@ static struct ext_nfsstats oldnfsstats; static struct nfsstatsov1 nfsstatsov1; -SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "NFS filesystem"); +SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "NFS filesystem"); SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, 0, "Number of realign tests done"); SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RW, &nfs_realign_count, Index: sys/fs/nfsclient/nfs_clnfsiod.c =================================================================== --- sys/fs/nfsclient/nfs_clnfsiod.c +++ sys/fs/nfsclient/nfs_clnfsiod.c @@ -124,8 +124,9 @@ NFSUNLOCKIOD(); return (0); } -SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, CTLTYPE_UINT | CTLFLAG_RW, 0, - sizeof (nfs_iodmin), sysctl_iodmin, "IU", +SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmin, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof (nfs_iodmin), + sysctl_iodmin, "IU", "Min number of nfsiod kthreads to keep as spares"); static int @@ -160,8 +161,9 @@ NFSUNLOCKIOD(); return (0); } -SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, CTLTYPE_UINT | CTLFLAG_RW, 0, - sizeof (ncl_iodmax), sysctl_iodmax, "IU", +SYSCTL_PROC(_vfs_nfs, OID_AUTO, iodmax, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof (ncl_iodmax), + sysctl_iodmax, "IU", "Max number of nfsiod kthreads"); static int Index: sys/fs/nfsserver/nfs_fha_new.c =================================================================== --- sys/fs/nfsserver/nfs_fha_new.c +++ sys/fs/nfsserver/nfs_fha_new.c @@ -94,8 +94,8 @@ */ sysctl_ctx_init(&softc->sysctl_ctx); softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_vfs_nfsd), OID_AUTO, "fha", CTLFLAG_RD, - 0, "NFS File Handle Affinity (FHA)"); + SYSCTL_STATIC_CHILDREN(_vfs_nfsd), OID_AUTO, "fha", + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "NFS File Handle Affinity (FHA)"); if (softc->sysctl_tree == NULL) { printf("%s: unable to allocate sysctl tree\n", __func__); return; Index: sys/fs/nfsserver/nfs_nfsdport.c =================================================================== --- sys/fs/nfsserver/nfs_nfsdport.c +++ sys/fs/nfsserver/nfs_nfsdport.c @@ -147,7 +147,8 @@ int nfs_pnfsio(task_fn_t *, void *); -SYSCTL_NODE(_vfs, OID_AUTO, nfsd, CTLFLAG_RW, 0, "NFS server"); +SYSCTL_NODE(_vfs, OID_AUTO, nfsd, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "NFS server"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, mirrormnt, CTLFLAG_RW, &nfsrv_enable_crossmntpt, 0, "Enable nfsd to cross mount points"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, commit_blks, CTLFLAG_RW, &nfs_commit_blks, Index: sys/fs/smbfs/smbfs_vfsops.c =================================================================== --- sys/fs/smbfs/smbfs_vfsops.c +++ sys/fs/smbfs/smbfs_vfsops.c @@ -56,7 +56,8 @@ static int smbfs_version = SMBFS_VERSION; -SYSCTL_NODE(_vfs, OID_AUTO, smbfs, CTLFLAG_RW, 0, "SMB/CIFS filesystem"); +SYSCTL_NODE(_vfs, OID_AUTO, smbfs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "SMB/CIFS filesystem"); SYSCTL_INT(_vfs_smbfs, OID_AUTO, version, CTLFLAG_RD, &smbfs_version, 0, ""); SYSCTL_INT(_vfs_smbfs, OID_AUTO, debuglevel, CTLFLAG_RW, &smbfs_debuglevel, 0, ""); Index: sys/fs/tmpfs/tmpfs_subr.c =================================================================== --- sys/fs/tmpfs/tmpfs_subr.c +++ sys/fs/tmpfs/tmpfs_subr.c @@ -68,7 +68,8 @@ #include #include -SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW, 0, "tmpfs file system"); +SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "tmpfs file system"); static long tmpfs_pages_reserved = TMPFS_PAGES_MINRESERVED; Index: sys/gdb/gdb_main.c =================================================================== --- sys/gdb/gdb_main.c +++ sys/gdb/gdb_main.c @@ -44,7 +44,8 @@ #include #include -SYSCTL_NODE(_debug, OID_AUTO, gdb, CTLFLAG_RW, 0, "GDB settings"); +SYSCTL_NODE(_debug, OID_AUTO, gdb, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "GDB settings"); static dbbe_init_f gdb_init; static dbbe_trap_f gdb_trap; Index: sys/gdb/netgdb.c =================================================================== --- sys/gdb/netgdb.c +++ sys/gdb/netgdb.c @@ -82,7 +82,7 @@ #include FEATURE(netgdb, "NetGDB support"); -SYSCTL_NODE(_debug_gdb, OID_AUTO, netgdb, CTLFLAG_RD, NULL, +SYSCTL_NODE(_debug_gdb, OID_AUTO, netgdb, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "NetGDB parameters"); static unsigned netgdb_debug; Index: sys/geom/cache/g_cache.c =================================================================== --- sys/geom/cache/g_cache.c +++ sys/geom/cache/g_cache.c @@ -51,7 +51,7 @@ static MALLOC_DEFINE(M_GCACHE, "gcache_data", "GEOM_CACHE Data"); SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, cache, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, cache, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_CACHE stuff"); static u_int g_cache_debug = 0; SYSCTL_UINT(_kern_geom_cache, OID_AUTO, debug, CTLFLAG_RW, &g_cache_debug, 0, @@ -84,10 +84,14 @@ *(u_int *)arg1 = val; return (0); } -SYSCTL_PROC(_kern_geom_cache, OID_AUTO, used_lo, CTLTYPE_UINT|CTLFLAG_RW, - &g_cache_used_lo, 0, sysctl_handle_pct, "IU", ""); -SYSCTL_PROC(_kern_geom_cache, OID_AUTO, used_hi, CTLTYPE_UINT|CTLFLAG_RW, - &g_cache_used_hi, 0, sysctl_handle_pct, "IU", ""); +SYSCTL_PROC(_kern_geom_cache, OID_AUTO, used_lo, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &g_cache_used_lo, 0, + sysctl_handle_pct, "IU", + ""); +SYSCTL_PROC(_kern_geom_cache, OID_AUTO, used_hi, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &g_cache_used_hi, 0, + sysctl_handle_pct, "IU", + ""); static int g_cache_destroy(struct g_cache_softc *sc, boolean_t force); Index: sys/geom/concat/g_concat.c =================================================================== --- sys/geom/concat/g_concat.c +++ sys/geom/concat/g_concat.c @@ -48,7 +48,7 @@ static MALLOC_DEFINE(M_CONCAT, "concat_data", "GEOM_CONCAT Data"); SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, concat, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, concat, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_CONCAT stuff"); static u_int g_concat_debug = 0; SYSCTL_UINT(_kern_geom_concat, OID_AUTO, debug, CTLFLAG_RWTUN, &g_concat_debug, 0, Index: sys/geom/gate/g_gate.c =================================================================== --- sys/geom/gate/g_gate.c +++ sys/geom/gate/g_gate.c @@ -62,7 +62,7 @@ static MALLOC_DEFINE(M_GATE, "gg_data", "GEOM Gate Data"); SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, gate, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, gate, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_GATE configuration"); static int g_gate_debug = 0; SYSCTL_INT(_kern_geom_gate, OID_AUTO, debug, CTLFLAG_RWTUN, &g_gate_debug, 0, Index: sys/geom/geom_dev.c =================================================================== --- sys/geom/geom_dev.c +++ sys/geom/geom_dev.c @@ -112,7 +112,8 @@ */ static uint64_t g_dev_del_max_sectors = 262144; SYSCTL_DECL(_kern_geom); -SYSCTL_NODE(_kern_geom, OID_AUTO, dev, CTLFLAG_RW, 0, "GEOM_DEV stuff"); +SYSCTL_NODE(_kern_geom, OID_AUTO, dev, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "GEOM_DEV stuff"); SYSCTL_QUAD(_kern_geom_dev, OID_AUTO, delete_max_sectors, CTLFLAG_RW, &g_dev_del_max_sectors, 0, "Maximum number of sectors in a single " "delete request sent to the provider. Larger requests are chunked " Index: sys/geom/geom_disk.c =================================================================== --- sys/geom/geom_disk.c +++ sys/geom/geom_disk.c @@ -92,7 +92,7 @@ }; SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, disk, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, disk, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_DISK stuff"); DECLARE_GEOM_CLASS(g_disk_class, g_disk); @@ -742,7 +742,7 @@ snprintf(tmpstr, sizeof(tmpstr), "GEOM disk %s", gp->name); sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_geom_disk), OID_AUTO, gp->name, - CTLFLAG_RD, 0, tmpstr); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr); if (sc->sysctl_tree != NULL) { SYSCTL_ADD_STRING(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "led", @@ -750,8 +750,8 @@ "LED name"); SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "flags", - CTLTYPE_STRING | CTLFLAG_RD, dp, 0, g_disk_sysctl_flags, - "A", "Report disk flags"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dp, 0, + g_disk_sysctl_flags, "A", "Report disk flags"); } pp->private = sc; dp->d_geom = gp; Index: sys/geom/geom_kern.c =================================================================== --- sys/geom/geom_kern.c +++ sys/geom/geom_kern.c @@ -204,19 +204,23 @@ return (sysctl_kern_geom_confany(req, g_confxml, &hint)); } -SYSCTL_NODE(_kern, OID_AUTO, geom, CTLFLAG_RW, 0, "GEOMetry management"); - -SYSCTL_PROC(_kern_geom, OID_AUTO, confxml, CTLTYPE_STRING|CTLFLAG_RD, - 0, 0, sysctl_kern_geom_confxml, "", - "Dump the GEOM config in XML"); - -SYSCTL_PROC(_kern_geom, OID_AUTO, confdot, CTLTYPE_STRING|CTLFLAG_RD, - 0, 0, sysctl_kern_geom_confdot, "", - "Dump the GEOM config in dot"); - -SYSCTL_PROC(_kern_geom, OID_AUTO, conftxt, CTLTYPE_STRING|CTLFLAG_RD, - 0, 0, sysctl_kern_geom_conftxt, "", - "Dump the GEOM config in txt"); +SYSCTL_NODE(_kern, OID_AUTO, geom, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "GEOMetry management"); + +SYSCTL_PROC(_kern_geom, OID_AUTO, confxml, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_kern_geom_confxml, "", + "Dump the GEOM config in XML"); + +SYSCTL_PROC(_kern_geom, OID_AUTO, confdot, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_kern_geom_confdot, "", + "Dump the GEOM config in dot"); + +SYSCTL_PROC(_kern_geom, OID_AUTO, conftxt, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_kern_geom_conftxt, "", + "Dump the GEOM config in txt"); SYSCTL_INT(_kern_geom, OID_AUTO, debugflags, CTLFLAG_RWTUN, &g_debugflags, 0, "Set various trace levels for GEOM debugging"); Index: sys/geom/journal/g_journal.c =================================================================== --- sys/geom/journal/g_journal.c +++ sys/geom/journal/g_journal.c @@ -95,7 +95,8 @@ static u_int g_journal_record_entries = GJ_RECORD_HEADER_NENTRIES; static u_int g_journal_do_optimize = 1; -static SYSCTL_NODE(_kern_geom, OID_AUTO, journal, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, journal, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_JOURNAL stuff"); SYSCTL_INT(_kern_geom_journal, OID_AUTO, debug, CTLFLAG_RWTUN, &g_journal_debug, 0, "Debug level"); @@ -128,7 +129,8 @@ return (0); } SYSCTL_PROC(_kern_geom_journal, OID_AUTO, record_entries, - CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, g_journal_record_entries_sysctl, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + g_journal_record_entries_sysctl, "I", "Maximum number of entires in one journal record"); SYSCTL_UINT(_kern_geom_journal, OID_AUTO, optimize, CTLFLAG_RW, &g_journal_do_optimize, 0, "Try to combine bios on flush and copy"); @@ -141,7 +143,8 @@ static u_int g_journal_cache_alloc_failures = 0; static u_long g_journal_cache_low = 0; -static SYSCTL_NODE(_kern_geom_journal, OID_AUTO, cache, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom_journal, OID_AUTO, cache, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_JOURNAL cache"); SYSCTL_ULONG(_kern_geom_journal_cache, OID_AUTO, used, CTLFLAG_RD, &g_journal_cache_used, 0, "Number of allocated bytes"); @@ -160,7 +163,8 @@ return (0); } SYSCTL_PROC(_kern_geom_journal_cache, OID_AUTO, limit, - CTLTYPE_ULONG | CTLFLAG_RWTUN, NULL, 0, g_journal_cache_limit_sysctl, "I", + CTLTYPE_ULONG | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, NULL, 0, + g_journal_cache_limit_sysctl, "I", "Maximum number of allocated bytes"); SYSCTL_UINT(_kern_geom_journal_cache, OID_AUTO, divisor, CTLFLAG_RDTUN, &g_journal_cache_divisor, 0, @@ -182,7 +186,8 @@ return (0); } SYSCTL_PROC(_kern_geom_journal_cache, OID_AUTO, switch, - CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, g_journal_cache_switch_sysctl, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + g_journal_cache_switch_sysctl, "I", "Force switch when we hit this percent of cache use"); SYSCTL_UINT(_kern_geom_journal_cache, OID_AUTO, misses, CTLFLAG_RW, &g_journal_cache_misses, 0, "Number of cache misses"); @@ -196,7 +201,8 @@ static u_long g_journal_stats_journal_full = 0; static u_long g_journal_stats_low_mem = 0; -static SYSCTL_NODE(_kern_geom_journal, OID_AUTO, stats, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom_journal, OID_AUTO, stats, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_JOURNAL statistics"); SYSCTL_ULONG(_kern_geom_journal_stats, OID_AUTO, skipped_bytes, CTLFLAG_RW, &g_journal_stats_bytes_skipped, 0, "Number of skipped bytes"); Index: sys/geom/label/g_label.h =================================================================== --- sys/geom/label/g_label.h +++ sys/geom/label/g_label.h @@ -56,7 +56,8 @@ SYSCTL_DECL(_kern_geom_label); #define G_LABEL_INIT(kind, label, descr) \ - SYSCTL_NODE(_kern_geom_label, OID_AUTO, kind, CTLFLAG_RD, \ + SYSCTL_NODE(_kern_geom_label, OID_AUTO, kind, \ + CTLFLAG_RD | CTLFLAG_MPSAFE, \ NULL, ""); \ SYSCTL_INT(_kern_geom_label_##kind, OID_AUTO, enable, \ CTLFLAG_RWTUN, &label.ld_enabled, 1, descr) Index: sys/geom/label/g_label.c =================================================================== --- sys/geom/label/g_label.c +++ sys/geom/label/g_label.c @@ -52,7 +52,8 @@ FEATURE(geom_label, "GEOM labeling support"); SYSCTL_DECL(_kern_geom); -SYSCTL_NODE(_kern_geom, OID_AUTO, label, CTLFLAG_RW, 0, "GEOM_LABEL stuff"); +SYSCTL_NODE(_kern_geom, OID_AUTO, label, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "GEOM_LABEL stuff"); u_int g_label_debug = 0; SYSCTL_UINT(_kern_geom_label, OID_AUTO, debug, CTLFLAG_RWTUN, &g_label_debug, 0, "Debug level"); Index: sys/geom/linux_lvm/g_linux_lvm.c =================================================================== --- sys/geom/linux_lvm/g_linux_lvm.c +++ sys/geom/linux_lvm/g_linux_lvm.c @@ -79,7 +79,7 @@ static int llvm_textconf_decode_sg(char **, char *, struct g_llvm_lv *); SYSCTL_DECL(_kern_geom); -SYSCTL_NODE(_kern_geom, OID_AUTO, linux_lvm, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern_geom, OID_AUTO, linux_lvm, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_LINUX_LVM stuff"); static u_int g_llvm_debug = 0; SYSCTL_UINT(_kern_geom_linux_lvm, OID_AUTO, debug, CTLFLAG_RWTUN, &g_llvm_debug, 0, Index: sys/geom/mirror/g_mirror.c =================================================================== --- sys/geom/mirror/g_mirror.c +++ sys/geom/mirror/g_mirror.c @@ -55,7 +55,7 @@ static MALLOC_DEFINE(M_MIRROR, "mirror_data", "GEOM_MIRROR Data"); SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, mirror, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, mirror, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_MIRROR stuff"); int g_mirror_debug = 0; SYSCTL_INT(_kern_geom_mirror, OID_AUTO, debug, CTLFLAG_RWTUN, &g_mirror_debug, 0, Index: sys/geom/mountver/g_mountver.c =================================================================== --- sys/geom/mountver/g_mountver.c +++ sys/geom/mountver/g_mountver.c @@ -49,7 +49,7 @@ SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, mountver, CTLFLAG_RW, +static SYSCTL_NODE(_kern_geom, OID_AUTO, mountver, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_MOUNTVER stuff"); static u_int g_mountver_debug = 0; static u_int g_mountver_check_ident = 1; Index: sys/geom/multipath/g_multipath.c =================================================================== --- sys/geom/multipath/g_multipath.c +++ sys/geom/multipath/g_multipath.c @@ -53,7 +53,8 @@ FEATURE(geom_multipath, "GEOM multipath support"); SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, multipath, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, multipath, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_MULTIPATH tunables"); static u_int g_multipath_debug = 0; SYSCTL_UINT(_kern_geom_multipath, OID_AUTO, debug, CTLFLAG_RW, Index: sys/geom/nop/g_nop.c =================================================================== --- sys/geom/nop/g_nop.c +++ sys/geom/nop/g_nop.c @@ -47,7 +47,8 @@ SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, nop, CTLFLAG_RW, 0, "GEOM_NOP stuff"); +static SYSCTL_NODE(_kern_geom, OID_AUTO, nop, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "GEOM_NOP stuff"); static u_int g_nop_debug = 0; SYSCTL_UINT(_kern_geom_nop, OID_AUTO, debug, CTLFLAG_RW, &g_nop_debug, 0, "Debug level"); Index: sys/geom/part/g_part.c =================================================================== --- sys/geom/part/g_part.c +++ sys/geom/part/g_part.c @@ -133,7 +133,7 @@ }; SYSCTL_DECL(_kern_geom); -SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_PART stuff"); static u_int check_integrity = 1; SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, Index: sys/geom/part/g_part_gpt.c =================================================================== --- sys/geom/part/g_part_gpt.c +++ sys/geom/part/g_part_gpt.c @@ -55,7 +55,8 @@ FEATURE(geom_part_gpt, "GEOM partitioning class for GPT partitions support"); SYSCTL_DECL(_kern_geom_part); -static SYSCTL_NODE(_kern_geom_part, OID_AUTO, gpt, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom_part, OID_AUTO, gpt, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_PART_GPT GUID Partition Table"); static u_int allow_nesting = 0; Index: sys/geom/part/g_part_ldm.c =================================================================== --- sys/geom/part/g_part_ldm.c +++ sys/geom/part/g_part_ldm.c @@ -53,7 +53,8 @@ FEATURE(geom_part_ldm, "GEOM partitioning class for LDM support"); SYSCTL_DECL(_kern_geom_part); -static SYSCTL_NODE(_kern_geom_part, OID_AUTO, ldm, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom_part, OID_AUTO, ldm, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_PART_LDM Logical Disk Manager"); static u_int ldm_debug = 0; Index: sys/geom/part/g_part_mbr.c =================================================================== --- sys/geom/part/g_part_mbr.c +++ sys/geom/part/g_part_mbr.c @@ -52,7 +52,8 @@ FEATURE(geom_part_mbr, "GEOM partitioning class for MBR support"); SYSCTL_DECL(_kern_geom_part); -static SYSCTL_NODE(_kern_geom_part, OID_AUTO, mbr, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom_part, OID_AUTO, mbr, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_PART_MBR Master Boot Record"); static u_int enforce_chs = 0; Index: sys/geom/raid/g_raid.h =================================================================== --- sys/geom/raid/g_raid.h +++ sys/geom/raid/g_raid.h @@ -337,7 +337,8 @@ DECLARE_MODULE(g_raid_md_##name, g_raid_md_##name##_mod, \ SI_SUB_DRIVERS, SI_ORDER_SECOND); \ MODULE_DEPEND(g_raid_md_##name, geom_raid, 0, 0, 0); \ - SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ + SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, \ + CTLFLAG_RD | CTLFLAG_MPSAFE, \ NULL, label " metadata module"); \ SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ CTLFLAG_RWTUN, &g_raid_md_##name##_class.mdc_enable, 0, \ @@ -374,7 +375,8 @@ DECLARE_MODULE(g_raid_tr_##name, g_raid_tr_##name##_mod, \ SI_SUB_DRIVERS, SI_ORDER_FIRST); \ MODULE_DEPEND(g_raid_tr_##name, geom_raid, 0, 0, 0); \ - SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, CTLFLAG_RD, \ + SYSCTL_NODE(_kern_geom_raid, OID_AUTO, name, \ + CTLFLAG_RD | CTLFLAG_MPSAFE, \ NULL, label " transformation module"); \ SYSCTL_INT(_kern_geom_raid_##name, OID_AUTO, enable, \ CTLFLAG_RWTUN, &g_raid_tr_##name##_class.trc_enable, 0, \ Index: sys/geom/raid/g_raid.c =================================================================== --- sys/geom/raid/g_raid.c +++ sys/geom/raid/g_raid.c @@ -54,7 +54,8 @@ static MALLOC_DEFINE(M_RAID, "raid_data", "GEOM_RAID Data"); SYSCTL_DECL(_kern_geom); -SYSCTL_NODE(_kern_geom, OID_AUTO, raid, CTLFLAG_RW, 0, "GEOM_RAID stuff"); +SYSCTL_NODE(_kern_geom, OID_AUTO, raid, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "GEOM_RAID stuff"); int g_raid_enable = 1; SYSCTL_INT(_kern_geom_raid, OID_AUTO, enable, CTLFLAG_RWTUN, &g_raid_enable, 0, "Enable on-disk metadata taste"); Index: sys/geom/raid3/g_raid3.c =================================================================== --- sys/geom/raid3/g_raid3.c +++ sys/geom/raid3/g_raid3.c @@ -54,7 +54,7 @@ static MALLOC_DEFINE(M_RAID3, "raid3_data", "GEOM_RAID3 Data"); SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, raid3, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, raid3, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_RAID3 stuff"); u_int g_raid3_debug = 0; SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, debug, CTLFLAG_RWTUN, &g_raid3_debug, 0, @@ -85,7 +85,8 @@ SYSCTL_UINT(_kern_geom_raid3, OID_AUTO, n4k, CTLFLAG_RDTUN, &g_raid3_n4k, 0, "Maximum number of 4kB allocations"); -static SYSCTL_NODE(_kern_geom_raid3, OID_AUTO, stat, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom_raid3, OID_AUTO, stat, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_RAID3 statistics"); static u_int g_raid3_parity_mismatch = 0; SYSCTL_UINT(_kern_geom_raid3_stat, OID_AUTO, parity_mismatch, CTLFLAG_RD, Index: sys/geom/shsec/g_shsec.c =================================================================== --- sys/geom/shsec/g_shsec.c +++ sys/geom/shsec/g_shsec.c @@ -71,7 +71,7 @@ }; SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, shsec, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, shsec, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_SHSEC stuff"); static u_int g_shsec_debug = 0; SYSCTL_UINT(_kern_geom_shsec, OID_AUTO, debug, CTLFLAG_RWTUN, &g_shsec_debug, 0, Index: sys/geom/stripe/g_stripe.c =================================================================== --- sys/geom/stripe/g_stripe.c +++ sys/geom/stripe/g_stripe.c @@ -71,7 +71,7 @@ }; SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, stripe, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, stripe, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_STRIPE stuff"); static u_int g_stripe_debug = 0; SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, debug, CTLFLAG_RWTUN, &g_stripe_debug, 0, @@ -88,8 +88,10 @@ g_stripe_fast = fast; return (error); } -SYSCTL_PROC(_kern_geom_stripe, OID_AUTO, fast, CTLTYPE_INT | CTLFLAG_RWTUN, - NULL, 0, g_sysctl_stripe_fast, "I", "Fast, but memory-consuming, mode"); +SYSCTL_PROC(_kern_geom_stripe, OID_AUTO, fast, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, NULL, 0, + g_sysctl_stripe_fast, "I", + "Fast, but memory-consuming, mode"); static u_int g_stripe_maxmem = MAXPHYS * 100; SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, maxmem, CTLFLAG_RDTUN, &g_stripe_maxmem, 0, "Maximum memory that can be allocated in \"fast\" mode (in bytes)"); Index: sys/geom/uzip/g_uzip.c =================================================================== --- sys/geom/uzip/g_uzip.c +++ sys/geom/uzip/g_uzip.c @@ -103,7 +103,8 @@ sizeof(g_uzip_noattach_to)); SYSCTL_DECL(_kern_geom); -SYSCTL_NODE(_kern_geom, OID_AUTO, uzip, CTLFLAG_RW, 0, "GEOM_UZIP stuff"); +SYSCTL_NODE(_kern_geom, OID_AUTO, uzip, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "GEOM_UZIP stuff"); static u_int g_uzip_debug = GEOM_UZIP_DBG_DEFAULT; SYSCTL_UINT(_kern_geom_uzip, OID_AUTO, debug, CTLFLAG_RWTUN, &g_uzip_debug, 0, "Debug level (0-4)"); Index: sys/geom/vinum/geom_vinum.c =================================================================== --- sys/geom/vinum/geom_vinum.c +++ sys/geom/vinum/geom_vinum.c @@ -50,7 +50,7 @@ #include SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, vinum, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, vinum, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_VINUM stuff"); u_int g_vinum_debug = 0; SYSCTL_UINT(_kern_geom_vinum, OID_AUTO, debug, CTLFLAG_RWTUN, &g_vinum_debug, 0, Index: sys/geom/virstor/g_virstor.c =================================================================== --- sys/geom/virstor/g_virstor.c +++ sys/geom/virstor/g_virstor.c @@ -83,7 +83,8 @@ /* Declare sysctl's and loader tunables */ SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, virstor, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, virstor, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_GVIRSTOR information"); static u_int g_virstor_debug = 2; /* XXX: lower to 2 when released to public */ Index: sys/geom/zero/g_zero.c =================================================================== --- sys/geom/zero/g_zero.c +++ sys/geom/zero/g_zero.c @@ -46,11 +46,13 @@ static int g_zero_clear_sysctl(SYSCTL_HANDLER_ARGS); SYSCTL_DECL(_kern_geom); -static SYSCTL_NODE(_kern_geom, OID_AUTO, zero, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern_geom, OID_AUTO, zero, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_ZERO stuff"); static int g_zero_clear = 1; -SYSCTL_PROC(_kern_geom_zero, OID_AUTO, clear, CTLTYPE_INT|CTLFLAG_RW, - &g_zero_clear, 0, g_zero_clear_sysctl, "I", "Clear read data buffer"); +SYSCTL_PROC(_kern_geom_zero, OID_AUTO, clear, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &g_zero_clear, 0, + g_zero_clear_sysctl, "I", + "Clear read data buffer"); static int g_zero_byte = 0; SYSCTL_INT(_kern_geom_zero, OID_AUTO, byte, CTLFLAG_RW, &g_zero_byte, 0, "Byte (octet) value to clear the buffers with"); Index: sys/gnu/gcov/gcov_subr.c =================================================================== --- sys/gnu/gcov/gcov_subr.c +++ sys/gnu/gcov/gcov_subr.c @@ -161,9 +161,13 @@ SYSINIT(gcov_init, SI_SUB_EVENTHANDLER, SI_ORDER_ANY, gcov_init, NULL); -static SYSCTL_NODE(_debug, OID_AUTO, gcov, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_debug, OID_AUTO, gcov, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "gcov code coverage"); -SYSCTL_PROC(_debug_gcov, OID_AUTO, reset, CTLTYPE_INT | CTLFLAG_RW, - NULL, 0, gcov_stats_reset_sysctl, "I", "Reset all profiling counts"); -SYSCTL_PROC(_debug_gcov, OID_AUTO, enable, CTLTYPE_INT | CTLFLAG_RW, - NULL, 0, gcov_stats_enable_sysctl, "I", "Enable code coverage"); +SYSCTL_PROC(_debug_gcov, OID_AUTO, reset, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + gcov_stats_reset_sysctl, "I", + "Reset all profiling counts"); +SYSCTL_PROC(_debug_gcov, OID_AUTO, enable, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + gcov_stats_enable_sysctl, "I", + "Enable code coverage"); Index: sys/i386/i386/elan-mmcr.c =================================================================== --- sys/i386/i386/elan-mmcr.c +++ sys/i386/i386/elan-mmcr.c @@ -221,8 +221,10 @@ return (0); } -SYSCTL_OID(_machdep, OID_AUTO, elan_gpio_config, CTLTYPE_STRING | CTLFLAG_RW, - NULL, 0, sysctl_machdep_elan_gpio_config, "A", "Elan CPU GPIO pin config"); +SYSCTL_OID(_machdep, OID_AUTO, elan_gpio_config, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_machdep_elan_gpio_config, "A", + "Elan CPU GPIO pin config"); #ifdef CPU_ELAN_PPS static void @@ -321,8 +323,10 @@ return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, elan_freq, CTLTYPE_UINT | CTLFLAG_RW, - 0, sizeof (u_int), sysctl_machdep_elan_freq, "IU", ""); +SYSCTL_PROC(_machdep, OID_AUTO, elan_freq, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof (u_int), + sysctl_machdep_elan_freq, "IU", + ""); /* * Positively identifying the Elan can only be done through the PCI id of Index: sys/i386/i386/longrun.c =================================================================== --- sys/i386/i386/longrun.c +++ sys/i386/i386/longrun.c @@ -276,31 +276,34 @@ sysctl_ctx_init(&crusoe_sysctl_ctx); crusoe_sysctl_tree = SYSCTL_ADD_NODE(&crusoe_sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, - "crusoe", CTLFLAG_RD, 0, - "Transmeta Crusoe LongRun support"); + SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, "crusoe", + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Transmeta Crusoe LongRun support"); SYSCTL_ADD_PROC(&crusoe_sysctl_ctx, SYSCTL_CHILDREN(crusoe_sysctl_tree), - OID_AUTO, "longrun", CTLTYPE_INT | CTLFLAG_RW, - &crusoe_longrun, 0, tmx86_longrun_sysctl, "I", - "LongRun mode [0-3]"); + OID_AUTO, "longrun", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &crusoe_longrun, 0, tmx86_longrun_sysctl, "I", + "LongRun mode [0-3]"); SYSCTL_ADD_PROC(&crusoe_sysctl_ctx, SYSCTL_CHILDREN(crusoe_sysctl_tree), - OID_AUTO, "frequency", CTLTYPE_INT | CTLFLAG_RD, - &crusoe_frequency, 0, tmx86_status_sysctl, "I", - "Current frequency (MHz)"); + OID_AUTO, "frequency", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &crusoe_frequency, 0, tmx86_status_sysctl, "I", + "Current frequency (MHz)"); SYSCTL_ADD_PROC(&crusoe_sysctl_ctx, SYSCTL_CHILDREN(crusoe_sysctl_tree), - OID_AUTO, "voltage", CTLTYPE_INT | CTLFLAG_RD, - &crusoe_voltage, 0, tmx86_status_sysctl, "I", - "Current voltage (mV)"); + OID_AUTO, "voltage", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + &crusoe_voltage, 0, tmx86_status_sysctl, "I", + "Current voltage (mV)"); SYSCTL_ADD_PROC(&crusoe_sysctl_ctx, SYSCTL_CHILDREN(crusoe_sysctl_tree), - OID_AUTO, "percentage", CTLTYPE_INT | CTLFLAG_RD, - &crusoe_percentage, 0, tmx86_status_sysctl, "I", - "Processing performance (%)"); + OID_AUTO, "percentage", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &crusoe_percentage, + 0, tmx86_status_sysctl, "I", "Processing performance (%)"); SYSCTL_ADD_PROC(&crusoe_sysctl_ctx, SYSCTL_CHILDREN(crusoe_sysctl_tree), - OID_AUTO, "performance_longrun", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_RW, - &crusoe_performance_longrun, 0, tmx86_longrun_profile_sysctl, "I", ""); + OID_AUTO, "performance_longrun", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &crusoe_performance_longrun, 0, tmx86_longrun_profile_sysctl, "I", + ""); SYSCTL_ADD_PROC(&crusoe_sysctl_ctx, SYSCTL_CHILDREN(crusoe_sysctl_tree), - OID_AUTO, "economy_longrun", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_RW, - &crusoe_economy_longrun, 0, tmx86_longrun_profile_sysctl, "I", ""); + OID_AUTO, "economy_longrun", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &crusoe_economy_longrun, 0, tmx86_longrun_profile_sysctl, "I", ""); /* register performance profile change handler */ EVENTHANDLER_REGISTER(power_profile_change, tmx86_longrun_power_profile, NULL, 0); Index: sys/i386/i386/machdep.c =================================================================== --- sys/i386/i386/machdep.c +++ sys/i386/i386/machdep.c @@ -2666,8 +2666,10 @@ } return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, smap, CTLTYPE_OPAQUE|CTLFLAG_RD, NULL, 0, - smap_sysctl_handler, "S,bios_smap_xattr", "Raw BIOS SMAP data"); +SYSCTL_PROC(_machdep, OID_AUTO, smap, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + smap_sysctl_handler, "S,bios_smap_xattr", + "Raw BIOS SMAP data"); void spinlock_enter(void) Index: sys/i386/i386/mp_clock.c =================================================================== --- sys/i386/i386/mp_clock.c +++ sys/i386/i386/mp_clock.c @@ -81,8 +81,10 @@ return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, piix_freq, CTLTYPE_INT | CTLFLAG_RW, - 0, sizeof(u_int), sysctl_machdep_piix_freq, "I", ""); +SYSCTL_PROC(_machdep, OID_AUTO, piix_freq, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(u_int), + sysctl_machdep_piix_freq, "I", + ""); static unsigned piix_get_timecount(struct timecounter *tc) Index: sys/i386/i386/pmap_base.c =================================================================== --- sys/i386/i386/pmap_base.c +++ sys/i386/i386/pmap_base.c @@ -107,7 +107,8 @@ #endif #include -static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); +static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "VM/pmap parameters"); #include #include @@ -164,7 +165,7 @@ &shpgperproc, 0, "Page share factor per proc"); -static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_pmap, OID_AUTO, pde, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "2/4MB page mapping counters"); u_long pmap_pde_demotions; Index: sys/i386/i386/prof_machdep.c =================================================================== --- sys/i386/i386/prof_machdep.c +++ sys/i386/i386/prof_machdep.c @@ -300,8 +300,10 @@ return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, cputime_clock, CTLTYPE_INT | CTLFLAG_RW, - 0, sizeof(u_int), sysctl_machdep_cputime_clock, "I", ""); +SYSCTL_PROC(_machdep, OID_AUTO, cputime_clock, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(u_int), + sysctl_machdep_cputime_clock, "I", + ""); /* * The start and stop routines need not be here since we turn off profiling Index: sys/kern/imgact_binmisc.c =================================================================== --- sys/kern/imgact_binmisc.c +++ sys/kern/imgact_binmisc.c @@ -506,7 +506,7 @@ return (error); } -SYSCTL_NODE(_kern, OID_AUTO, binmisc, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern, OID_AUTO, binmisc, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Image activator for miscellaneous binaries"); SYSCTL_PROC(_kern_binmisc, OID_AUTO, add, Index: sys/kern/imgact_elf.c =================================================================== --- sys/kern/imgact_elf.c +++ sys/kern/imgact_elf.c @@ -102,7 +102,8 @@ static vm_prot_t __elfN(trans_prot)(Elf_Word); static Elf_Word __elfN(untrans_prot)(vm_prot_t); -SYSCTL_NODE(_kern, OID_AUTO, __CONCAT(elf, __ELF_WORD_SIZE), CTLFLAG_RW, 0, +SYSCTL_NODE(_kern, OID_AUTO, __CONCAT(elf, __ELF_WORD_SIZE), + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); #define CORE_BUF_SIZE (16 * 1024) @@ -156,7 +157,8 @@ sysctl_pie_base, "LU", "PIE load base without randomization"); -SYSCTL_NODE(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, aslr, CTLFLAG_RW, 0, +SYSCTL_NODE(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, aslr, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); #define ASLR_NODE_OID __CONCAT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), _aslr) Index: sys/kern/kern_acct.c =================================================================== --- sys/kern/kern_acct.c +++ sys/kern/kern_acct.c @@ -187,8 +187,9 @@ acctchkfreq = value; return (0); } -SYSCTL_PROC(_kern, OID_AUTO, acct_chkfreq, CTLTYPE_INT|CTLFLAG_RW, - &acctchkfreq, 0, sysctl_acct_chkfreq, "I", +SYSCTL_PROC(_kern, OID_AUTO, acct_chkfreq, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &acctchkfreq, 0, + sysctl_acct_chkfreq, "I", "frequency for checking the free space"); SYSCTL_INT(_kern, OID_AUTO, acct_configured, CTLFLAG_RD, &acct_configured, 0, Index: sys/kern/kern_clock.c =================================================================== --- sys/kern/kern_clock.c +++ sys/kern/kern_clock.c @@ -304,7 +304,7 @@ SYSINIT(deadlkres, SI_SUB_CLOCKS, SI_ORDER_ANY, kthread_start, &deadlkres_kd); -static SYSCTL_NODE(_debug, OID_AUTO, deadlkres, CTLFLAG_RW, 0, +static SYSCTL_NODE(_debug, OID_AUTO, deadlkres, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Deadlock resolver"); SYSCTL_INT(_debug_deadlkres, OID_AUTO, slptime_threshold, CTLFLAG_RW, &slptime_threshold, 0, Index: sys/kern/kern_cons.c =================================================================== --- sys/kern/kern_cons.c +++ sys/kern/kern_cons.c @@ -360,8 +360,10 @@ return (error); } -SYSCTL_PROC(_kern, OID_AUTO, console, CTLTYPE_STRING|CTLFLAG_RW, - 0, 0, sysctl_kern_console, "A", "Console device control"); +SYSCTL_PROC(_kern, OID_AUTO, console, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_kern_console, "A", + "Console device control"); /* * User has changed the state of the console muting. @@ -378,9 +380,10 @@ return (error); } -SYSCTL_PROC(_kern, OID_AUTO, consmute, CTLTYPE_INT|CTLFLAG_RW, - 0, sizeof(cn_mute), sysctl_kern_consmute, "I", - "State of the console muting"); +SYSCTL_PROC(_kern, OID_AUTO, consmute, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(cn_mute), + sysctl_kern_consmute, "I", + "State of the console muting"); void cngrab() Index: sys/kern/kern_cpu.c =================================================================== --- sys/kern/kern_cpu.c +++ sys/kern/kern_cpu.c @@ -136,7 +136,7 @@ static int cf_lowest_freq; static int cf_verbose; -static SYSCTL_NODE(_debug, OID_AUTO, cpufreq, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_debug, OID_AUTO, cpufreq, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "cpufreq debugging"); SYSCTL_INT(_debug_cpufreq, OID_AUTO, lowest, CTLFLAG_RWTUN, &cf_lowest_freq, 1, "Don't provide levels below this frequency."); @@ -183,11 +183,12 @@ M_DEVBUF, M_WAITOK); SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(parent)), - OID_AUTO, "freq", CTLTYPE_INT | CTLFLAG_RW, sc, 0, - cpufreq_curr_sysctl, "I", "Current CPU frequency"); + OID_AUTO, "freq", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + sc, 0, cpufreq_curr_sysctl, "I", "Current CPU frequency"); SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(parent)), - OID_AUTO, "freq_levels", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, + OID_AUTO, "freq_levels", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, cpufreq_levels_sysctl, "A", "CPU frequency levels"); /* @@ -1080,7 +1081,8 @@ /* Add a sysctl to get each driver's settings separately. */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "freq_settings", CTLTYPE_STRING | CTLFLAG_RD, dev, 0, + OID_AUTO, "freq_settings", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, 0, cpufreq_settings_sysctl, "A", "CPU frequency driver settings"); /* Index: sys/kern/kern_et.c =================================================================== --- sys/kern/kern_et.c +++ sys/kern/kern_et.c @@ -45,8 +45,11 @@ struct mtx et_eventtimers_mtx; MTX_SYSINIT(et_eventtimers_init, &et_eventtimers_mtx, "et_mtx", MTX_DEF); -SYSCTL_NODE(_kern, OID_AUTO, eventtimer, CTLFLAG_RW, 0, "Event timers"); -static SYSCTL_NODE(_kern_eventtimer, OID_AUTO, et, CTLFLAG_RW, 0, ""); +SYSCTL_NODE(_kern, OID_AUTO, eventtimer, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Event timers"); +static SYSCTL_NODE(_kern_eventtimer, OID_AUTO, et, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + ""); /* * Register a new event timer hardware. @@ -70,7 +73,8 @@ KASSERT(et->et_start, ("et_register: timer has no start function")); et->et_sysctl = SYSCTL_ADD_NODE_WITH_LABEL(NULL, SYSCTL_STATIC_CHILDREN(_kern_eventtimer_et), OID_AUTO, et->et_name, - CTLFLAG_RW, 0, "event timer description", "eventtimer"); + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "event timer description", "eventtimer"); SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, "flags", CTLFLAG_RD, &(et->et_flags), 0, "Event timer capabilities"); Index: sys/kern/kern_fail.c =================================================================== --- sys/kern/kern_fail.c +++ sys/kern/kern_fail.c @@ -1131,7 +1131,8 @@ } /* The fail point sysctl tree. */ -SYSCTL_NODE(_debug, OID_AUTO, fail_point, CTLFLAG_RW, 0, "fail points"); +SYSCTL_NODE(_debug, OID_AUTO, fail_point, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "fail points"); /* Debugging/testing stuff for fail point */ static int @@ -1142,5 +1143,6 @@ return (0); } SYSCTL_OID(_debug_fail_point, OID_AUTO, test_trigger_fail_point, - CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_test_fail_point, "A", - "Trigger test fail points"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_test_fail_point, "A", + "Trigger test fail points"); Index: sys/kern/kern_ffclock.c =================================================================== --- sys/kern/kern_ffclock.c +++ sys/kern/kern_ffclock.c @@ -155,9 +155,9 @@ * live under the ffclock subnode. */ -SYSCTL_NODE(_kern, OID_AUTO, sysclock, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern, OID_AUTO, sysclock, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "System clock related configuration"); -SYSCTL_NODE(_kern_sysclock, OID_AUTO, ffclock, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern_sysclock, OID_AUTO, ffclock, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Feed-forward clock configuration"); static char *sysclocks[] = {"feedback", "feed-forward"}; @@ -191,8 +191,9 @@ return (error); } -SYSCTL_PROC(_kern_sysclock, OID_AUTO, available, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, sysctl_kern_sysclock_available, "A", +SYSCTL_PROC(_kern_sysclock, OID_AUTO, available, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_kern_sysclock_available, "A", "List of available system clocks"); /* @@ -231,8 +232,9 @@ return (error); } -SYSCTL_PROC(_kern_sysclock, OID_AUTO, active, CTLTYPE_STRING | CTLFLAG_RW, - 0, 0, sysctl_kern_sysclock_active, "A", +SYSCTL_PROC(_kern_sysclock, OID_AUTO, active, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_kern_sysclock_active, "A", "Name of the active system clock which is currently serving time"); static int sysctl_kern_ffclock_ffcounter_bypass = 0; Index: sys/kern/kern_fork.c =================================================================== --- sys/kern/kern_fork.c +++ sys/kern/kern_fork.c @@ -236,8 +236,10 @@ return (error); } -SYSCTL_PROC(_kern, OID_AUTO, randompid, CTLTYPE_INT|CTLFLAG_RW, - 0, 0, sysctl_kern_randompid, "I", "Random PID modulus. Special values: 0: disable, 1: choose random value"); +SYSCTL_PROC(_kern, OID_AUTO, randompid, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + sysctl_kern_randompid, "I", + "Random PID modulus. Special values: 0: disable, 1: choose random value"); extern bitstr_t proc_id_pidmap; extern bitstr_t proc_id_grpidmap; Index: sys/kern/kern_intr.c =================================================================== --- sys/kern/kern_intr.c +++ sys/kern/kern_intr.c @@ -1591,8 +1591,10 @@ return (sysctl_handle_opaque(oidp, intrnames, sintrnames, req)); } -SYSCTL_PROC(_hw, OID_AUTO, intrnames, CTLTYPE_OPAQUE | CTLFLAG_RD, - NULL, 0, sysctl_intrnames, "", "Interrupt Names"); +SYSCTL_PROC(_hw, OID_AUTO, intrnames, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_intrnames, "", + "Interrupt Names"); static int sysctl_intrcnt(SYSCTL_HANDLER_ARGS) @@ -1618,8 +1620,10 @@ return (sysctl_handle_opaque(oidp, intrcnt, sintrcnt, req)); } -SYSCTL_PROC(_hw, OID_AUTO, intrcnt, CTLTYPE_OPAQUE | CTLFLAG_RD, - NULL, 0, sysctl_intrcnt, "", "Interrupt Counts"); +SYSCTL_PROC(_hw, OID_AUTO, intrcnt, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_intrcnt, "", + "Interrupt Counts"); #ifdef DDB /* Index: sys/kern/kern_jail.c =================================================================== --- sys/kern/kern_jail.c +++ sys/kern/kern_jail.c @@ -3404,7 +3404,7 @@ /* * Jail-related sysctls. */ -static SYSCTL_NODE(_security, OID_AUTO, jail, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security, OID_AUTO, jail, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Jails"); static int @@ -3643,7 +3643,7 @@ * is returned in the string itself, and the other parameters exist merely * to make themselves and their types known. */ -SYSCTL_NODE(_security_jail, OID_AUTO, param, CTLFLAG_RW, 0, +SYSCTL_NODE(_security_jail, OID_AUTO, param, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Jail parameters"); int @@ -3853,7 +3853,7 @@ parent = prefix ? SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(&sysctl___security_jail_param_allow), - OID_AUTO, prefix, 0, 0, prefix_descr) + OID_AUTO, prefix, CTLFLAG_MPSAFE, 0, prefix_descr) : &sysctl___security_jail_param_allow; (void)SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(parent), OID_AUTO, name, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, Index: sys/kern/kern_kcov.c =================================================================== --- sys/kern/kern_kcov.c +++ sys/kern/kern_kcov.c @@ -149,7 +149,8 @@ .d_name = "kcov", }; -SYSCTL_NODE(_kern, OID_AUTO, kcov, CTLFLAG_RW, 0, "Kernel coverage"); +SYSCTL_NODE(_kern, OID_AUTO, kcov, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Kernel coverage"); static u_int kcov_max_entries = KCOV_MAXENTRIES; SYSCTL_UINT(_kern_kcov, OID_AUTO, max_entries, CTLFLAG_RW, Index: sys/kern/kern_ktr.c =================================================================== --- sys/kern/kern_ktr.c +++ sys/kern/kern_ktr.c @@ -102,7 +102,8 @@ struct ktr_entry *ktr_buf = ktr_buf_init; cpuset_t ktr_cpumask = CPUSET_T_INITIALIZER(KTR_CPUMASK); -static SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options"); +static SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "KTR options"); SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD, &ktr_version, 0, "Version of the KTR interface"); @@ -150,8 +151,10 @@ return (error); } -SYSCTL_PROC(_debug_ktr, OID_AUTO, clear, CTLTYPE_INT|CTLFLAG_RW, 0, 0, - sysctl_debug_ktr_clear, "I", "Clear KTR Buffer"); +SYSCTL_PROC(_debug_ktr, OID_AUTO, clear, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_debug_ktr_clear, "I", + "Clear KTR Buffer"); /* * This is a sysctl proc so that it is serialized as !MPSAFE along with @@ -171,8 +174,9 @@ return (error); } -SYSCTL_PROC(_debug_ktr, OID_AUTO, mask, CTLTYPE_U64 | CTLFLAG_RWTUN, 0, 0, - sysctl_debug_ktr_mask, "QU", +SYSCTL_PROC(_debug_ktr, OID_AUTO, mask, + CTLTYPE_U64 | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_debug_ktr_mask, "QU", "Bitmask of KTR event classes for which logging is enabled"); #if KTR_ENTRIES > KTR_BOOT_ENTRIES @@ -242,8 +246,10 @@ return (error); } -SYSCTL_PROC(_debug_ktr, OID_AUTO, entries, CTLTYPE_INT|CTLFLAG_RW, 0, 0, - sysctl_debug_ktr_entries, "I", "Number of entries in the KTR buffer"); +SYSCTL_PROC(_debug_ktr, OID_AUTO, entries, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_debug_ktr_entries, "I", + "Number of entries in the KTR buffer"); #ifdef KTR_VERBOSE int ktr_verbose = KTR_VERBOSE; @@ -305,8 +311,9 @@ return (error); } SYSCTL_PROC(_debug_ktr, OID_AUTO, alq_enable, - CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_debug_ktr_alq_enable, - "I", "Enable KTR logging"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, 0, + sysctl_debug_ktr_alq_enable, "I", + "Enable KTR logging"); #endif void Index: sys/kern/kern_ktrace.c =================================================================== --- sys/kern/kern_ktrace.c +++ sys/kern/kern_ktrace.c @@ -131,7 +131,8 @@ static STAILQ_HEAD(, ktr_request) ktr_free; -static SYSCTL_NODE(_kern, OID_AUTO, ktrace, CTLFLAG_RD, 0, "KTRACE options"); +static SYSCTL_NODE(_kern, OID_AUTO, ktrace, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "KTRACE options"); static u_int ktr_requestpool = KTRACE_REQUEST_POOL; TUNABLE_INT("kern.ktrace.request_pool", &ktr_requestpool); @@ -233,8 +234,9 @@ return (ENOSPC); return (0); } -SYSCTL_PROC(_kern_ktrace, OID_AUTO, request_pool, CTLTYPE_UINT|CTLFLAG_RW, - &ktr_requestpool, 0, sysctl_kern_ktrace_request_pool, "IU", +SYSCTL_PROC(_kern_ktrace, OID_AUTO, request_pool, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &ktr_requestpool, 0, + sysctl_kern_ktrace_request_pool, "IU", "Pool buffer size for ktrace(1)"); static u_int Index: sys/kern/kern_linker.c =================================================================== --- sys/kern/kern_linker.c +++ sys/kern/kern_linker.c @@ -2258,5 +2258,7 @@ return (SYSCTL_OUT(req, "", 1)); } -SYSCTL_PROC(_kern, OID_AUTO, function_list, CTLTYPE_OPAQUE | CTLFLAG_RD, - NULL, 0, sysctl_kern_function_list, "", "kernel function list"); +SYSCTL_PROC(_kern, OID_AUTO, function_list, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kern_function_list, "", + "kernel function list"); Index: sys/kern/kern_malloc.c =================================================================== --- sys/kern/kern_malloc.c +++ sys/kern/kern_malloc.c @@ -232,7 +232,7 @@ static time_t t_malloc_fail; #if defined(MALLOC_MAKE_FAILURES) || (MALLOC_DEBUG_MAXZONES > 1) -static SYSCTL_NODE(_debug, OID_AUTO, malloc, CTLFLAG_RD, 0, +static SYSCTL_NODE(_debug, OID_AUTO, malloc, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Kernel malloc debugging options"); #endif @@ -1266,8 +1266,9 @@ return (error); } -SYSCTL_PROC(_kern, OID_AUTO, malloc_stats, CTLFLAG_RD|CTLTYPE_STRUCT, - 0, 0, sysctl_kern_malloc_stats, "s,malloc_type_ustats", +SYSCTL_PROC(_kern, OID_AUTO, malloc_stats, + CTLFLAG_RD | CTLTYPE_STRUCT | CTLFLAG_MPSAFE, 0, 0, + sysctl_kern_malloc_stats, "s,malloc_type_ustats", "Return malloc types"); SYSCTL_INT(_kern, OID_AUTO, malloc_count, CTLFLAG_RD, &kmemcount, 0, @@ -1471,6 +1472,8 @@ return (error); } -SYSCTL_OID(_kern, OID_AUTO, mprof, CTLTYPE_STRING|CTLFLAG_RD, - NULL, 0, sysctl_kern_mprof, "A", "Malloc Profiling"); +SYSCTL_OID(_kern, OID_AUTO, mprof, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_kern_mprof, "A", + "Malloc Profiling"); #endif /* MALLOC_PROFILE */ Index: sys/kern/kern_mbuf.c =================================================================== --- sys/kern/kern_mbuf.c +++ sys/kern/kern_mbuf.c @@ -193,8 +193,9 @@ } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, CTLTYPE_INT|CTLFLAG_RW, -&nmbclusters, 0, sysctl_nmbclusters, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &nmbclusters, 0, + sysctl_nmbclusters, "IU", "Maximum number of mbuf clusters allowed"); static int @@ -214,8 +215,9 @@ } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbop, CTLTYPE_INT|CTLFLAG_RW, -&nmbjumbop, 0, sysctl_nmbjumbop, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbop, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &nmbjumbop, 0, + sysctl_nmbjumbop, "IU", "Maximum number of mbuf page size jumbo clusters allowed"); static int @@ -235,8 +237,9 @@ } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo9, CTLTYPE_INT|CTLFLAG_RW, -&nmbjumbo9, 0, sysctl_nmbjumbo9, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo9, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &nmbjumbo9, 0, + sysctl_nmbjumbo9, "IU", "Maximum number of mbuf 9k jumbo clusters allowed"); static int @@ -256,8 +259,9 @@ } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo16, CTLTYPE_INT|CTLFLAG_RW, -&nmbjumbo16, 0, sysctl_nmbjumbo16, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbjumbo16, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &nmbjumbo16, 0, + sysctl_nmbjumbo16, "IU", "Maximum number of mbuf 16k jumbo clusters allowed"); static int @@ -277,8 +281,9 @@ } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, CTLTYPE_INT|CTLFLAG_RW, -&nmbufs, 0, sysctl_nmbufs, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &nmbufs, 0, sysctl_nmbufs, "IU", "Maximum number of mbufs allowed"); /* Index: sys/kern/kern_mib.c =================================================================== --- sys/kern/kern_mib.c +++ sys/kern/kern_mib.c @@ -60,38 +60,38 @@ #include #include -SYSCTL_ROOT_NODE(0, sysctl, CTLFLAG_RW, 0, - "Sysctl internal magic"); -SYSCTL_ROOT_NODE(CTL_KERN, kern, CTLFLAG_RW|CTLFLAG_CAPRD, 0, - "High kernel, proc, limits &c"); -SYSCTL_ROOT_NODE(CTL_VM, vm, CTLFLAG_RW, 0, - "Virtual memory"); -SYSCTL_ROOT_NODE(CTL_VFS, vfs, CTLFLAG_RW, 0, - "File system"); -SYSCTL_ROOT_NODE(CTL_NET, net, CTLFLAG_RW, 0, - "Network, (see socket.h)"); -SYSCTL_ROOT_NODE(CTL_DEBUG, debug, CTLFLAG_RW, 0, - "Debugging"); -SYSCTL_NODE(_debug, OID_AUTO, sizeof, CTLFLAG_RW, 0, - "Sizeof various things"); -SYSCTL_ROOT_NODE(CTL_HW, hw, CTLFLAG_RW, 0, - "hardware"); -SYSCTL_ROOT_NODE(CTL_MACHDEP, machdep, CTLFLAG_RW, 0, - "machine dependent"); -SYSCTL_NODE(_machdep, OID_AUTO, mitigations, CTLFLAG_RW, 0, - "Machine dependent platform mitigations."); -SYSCTL_ROOT_NODE(CTL_USER, user, CTLFLAG_RW, 0, - "user-level"); -SYSCTL_ROOT_NODE(CTL_P1003_1B, p1003_1b, CTLFLAG_RW, 0, - "p1003_1b, (see p1003_1b.h)"); - -SYSCTL_ROOT_NODE(OID_AUTO, compat, CTLFLAG_RW, 0, - "Compatibility code"); -SYSCTL_ROOT_NODE(OID_AUTO, security, CTLFLAG_RW, 0, - "Security"); +SYSCTL_ROOT_NODE(0, sysctl, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Sysctl internal magic"); +SYSCTL_ROOT_NODE(CTL_KERN, kern, CTLFLAG_RW | CTLFLAG_CAPRD | CTLFLAG_MPSAFE, 0, + "High kernel, proc, limits &c"); +SYSCTL_ROOT_NODE(CTL_VM, vm, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Virtual memory"); +SYSCTL_ROOT_NODE(CTL_VFS, vfs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "File system"); +SYSCTL_ROOT_NODE(CTL_NET, net, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Network, (see socket.h)"); +SYSCTL_ROOT_NODE(CTL_DEBUG, debug, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Debugging"); +SYSCTL_NODE(_debug, OID_AUTO, sizeof, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Sizeof various things"); +SYSCTL_ROOT_NODE(CTL_HW, hw, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "hardware"); +SYSCTL_ROOT_NODE(CTL_MACHDEP, machdep, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "machine dependent"); +SYSCTL_NODE(_machdep, OID_AUTO, mitigations, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Machine dependent platform mitigations."); +SYSCTL_ROOT_NODE(CTL_USER, user, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "user-level"); +SYSCTL_ROOT_NODE(CTL_P1003_1B, p1003_1b, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "p1003_1b, (see p1003_1b.h)"); + +SYSCTL_ROOT_NODE(OID_AUTO, compat, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Compatibility code"); +SYSCTL_ROOT_NODE(OID_AUTO, security, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Security"); #ifdef REGRESSION -SYSCTL_ROOT_NODE(OID_AUTO, regression, CTLFLAG_RW, 0, - "Regression test MIB"); +SYSCTL_ROOT_NODE(OID_AUTO, regression, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Regression test MIB"); #endif SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD|CTLFLAG_MPSAFE, @@ -182,8 +182,9 @@ val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } -SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "LU", +SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, + sysctl_hw_physmem, "LU", "Amount of physical memory (in bytes)"); static int @@ -197,8 +198,9 @@ val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } -SYSCTL_PROC(_hw, HW_REALMEM, realmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_realmem, "LU", +SYSCTL_PROC(_hw, HW_REALMEM, realmem, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, + sysctl_hw_realmem, "LU", "Amount of memory (in bytes) reported by the firmware"); static int @@ -213,8 +215,9 @@ val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } -SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_usermem, "LU", +SYSCTL_PROC(_hw, HW_USERMEM, usermem, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, + sysctl_hw_usermem, "LU", "Amount of memory (in bytes) which is not wired"); SYSCTL_LONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, @@ -244,8 +247,10 @@ error = SYSCTL_OUT(req, pagesizes, sizeof(pagesizes)); return (error); } -SYSCTL_PROC(_hw, OID_AUTO, pagesizes, CTLTYPE_ULONG | CTLFLAG_RD, - NULL, 0, sysctl_hw_pagesizes, "LU", "Supported page sizes"); +SYSCTL_PROC(_hw, OID_AUTO, pagesizes, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_hw_pagesizes, "LU", + "Supported page sizes"); #ifdef SCTL_MASK32 int adaptive_machine_arch = 1; @@ -393,8 +398,9 @@ } SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel, - CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, sysctl_kern_securelvl, - "I", "Current secure level"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE, 0, 0, + sysctl_kern_securelvl, "I", + "Current secure level"); #ifdef INCLUDE_CONFIG_FILE /* Actual kernel configuration options. */ @@ -531,7 +537,8 @@ CTLTYPE_STRING | CTLFLAG_CAPRD | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_build_id, "A", "Operating system build-id"); -SYSCTL_NODE(_kern, OID_AUTO, features, CTLFLAG_RD, 0, "Kernel Features"); +SYSCTL_NODE(_kern, OID_AUTO, features, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Kernel Features"); #ifdef COMPAT_FREEBSD4 FEATURE(compat_freebsd4, "Compatible with FreeBSD 4"); Index: sys/kern/kern_mutex.c =================================================================== --- sys/kern/kern_mutex.c +++ sys/kern/kern_mutex.c @@ -141,7 +141,8 @@ #ifdef ADAPTIVE_MUTEXES #ifdef MUTEX_CUSTOM_BACKOFF -static SYSCTL_NODE(_debug, OID_AUTO, mtx, CTLFLAG_RD, NULL, "mtx debugging"); +static SYSCTL_NODE(_debug, OID_AUTO, mtx, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "mtx debugging"); static struct lock_delay_config __read_frequently mtx_delay; @@ -157,7 +158,8 @@ #endif #ifdef MUTEX_SPIN_CUSTOM_BACKOFF -static SYSCTL_NODE(_debug, OID_AUTO, mtx_spin, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_debug, OID_AUTO, mtx_spin, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "mtx spin debugging"); static struct lock_delay_config __read_frequently mtx_spin_delay; Index: sys/kern/kern_ntptime.c =================================================================== --- sys/kern/kern_ntptime.c +++ sys/kern/kern_ntptime.c @@ -309,7 +309,8 @@ return (sysctl_handle_opaque(oidp, &ntv, sizeof(ntv), req)); } -SYSCTL_NODE(_kern, OID_AUTO, ntp_pll, CTLFLAG_RW, 0, ""); +SYSCTL_NODE(_kern, OID_AUTO, ntp_pll, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + ""); SYSCTL_PROC(_kern_ntp_pll, OID_AUTO, gettime, CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, sizeof(struct ntptimeval) , ntp_sysctl, "S,ntptimeval", ""); Index: sys/kern/kern_pmc.c =================================================================== --- sys/kern/kern_pmc.c +++ sys/kern/kern_pmc.c @@ -108,7 +108,8 @@ * PMC Soft use a global table to store registered events. */ -SYSCTL_NODE(_kern, OID_AUTO, hwpmc, CTLFLAG_RW, 0, "HWPMC parameters"); +SYSCTL_NODE(_kern, OID_AUTO, hwpmc, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "HWPMC parameters"); static int pmc_softevents = 16; SYSCTL_INT(_kern_hwpmc, OID_AUTO, softevents, CTLFLAG_RDTUN, Index: sys/kern/kern_poll.c =================================================================== --- sys/kern/kern_poll.c +++ sys/kern/kern_poll.c @@ -101,8 +101,8 @@ static uint32_t poll_burst_max = 150; /* good for 100Mbit net and HZ=1000 */ static uint32_t poll_each_burst = 5; -static SYSCTL_NODE(_kern, OID_AUTO, polling, CTLFLAG_RW, 0, - "Device polling parameters"); +static SYSCTL_NODE(_kern, OID_AUTO, polling, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Device polling parameters"); SYSCTL_UINT(_kern_polling, OID_AUTO, burst, CTLFLAG_RD, &poll_burst, 0, "Current polling burst size"); @@ -132,8 +132,10 @@ return (0); } -SYSCTL_PROC(_kern_polling, OID_AUTO, burst_max, CTLTYPE_UINT | CTLFLAG_RW, - 0, sizeof(uint32_t), poll_burst_max_sysctl, "I", "Max Polling burst size"); +SYSCTL_PROC(_kern_polling, OID_AUTO, burst_max, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof(uint32_t), + poll_burst_max_sysctl, "I", + "Max Polling burst size"); static int poll_each_burst_sysctl(SYSCTL_HANDLER_ARGS) { @@ -156,9 +158,10 @@ return (0); } -SYSCTL_PROC(_kern_polling, OID_AUTO, each_burst, CTLTYPE_UINT | CTLFLAG_RW, - 0, sizeof(uint32_t), poll_each_burst_sysctl, "I", - "Max size of each burst"); +SYSCTL_PROC(_kern_polling, OID_AUTO, each_burst, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof(uint32_t), + poll_each_burst_sysctl, "I", + "Max size of each burst"); static uint32_t poll_in_idle_loop=0; /* do we poll in idle loop ? */ SYSCTL_UINT(_kern_polling, OID_AUTO, idle_poll, CTLFLAG_RW, @@ -182,9 +185,10 @@ return (0); } -SYSCTL_PROC(_kern_polling, OID_AUTO, user_frac, CTLTYPE_UINT | CTLFLAG_RW, - 0, sizeof(uint32_t), user_frac_sysctl, "I", - "Desired user fraction of cpu time"); +SYSCTL_PROC(_kern_polling, OID_AUTO, user_frac, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof(uint32_t), + user_frac_sysctl, "I", + "Desired user fraction of cpu time"); static uint32_t reg_frac_count = 0; static uint32_t reg_frac = 20 ; @@ -207,9 +211,10 @@ return (0); } -SYSCTL_PROC(_kern_polling, OID_AUTO, reg_frac, CTLTYPE_UINT | CTLFLAG_RW, - 0, sizeof(uint32_t), reg_frac_sysctl, "I", - "Every this many cycles check registers"); +SYSCTL_PROC(_kern_polling, OID_AUTO, reg_frac, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, sizeof(uint32_t), + reg_frac_sysctl, "I", + "Every this many cycles check registers"); static uint32_t short_ticks; SYSCTL_UINT(_kern_polling, OID_AUTO, short_ticks, CTLFLAG_RD, Index: sys/kern/kern_proc.c =================================================================== --- sys/kern/kern_proc.c +++ sys/kern/kern_proc.c @@ -3033,7 +3033,8 @@ return (error); } -SYSCTL_NODE(_kern, KERN_PROC, proc, CTLFLAG_RD, 0, "Process table"); +SYSCTL_NODE(_kern, KERN_PROC, proc, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Process table"); SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT| CTLFLAG_MPSAFE, 0, 0, sysctl_kern_proc, "S,proc", Index: sys/kern/kern_prot.c =================================================================== --- sys/kern/kern_prot.c +++ sys/kern/kern_prot.c @@ -84,7 +84,8 @@ static MALLOC_DEFINE(M_CRED, "cred", "credentials"); -SYSCTL_NODE(_security, OID_AUTO, bsd, CTLFLAG_RW, 0, "BSD security policy"); +SYSCTL_NODE(_security, OID_AUTO, bsd, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "BSD security policy"); static void crsetgroups_locked(struct ucred *cr, int ngrp, gid_t *groups); @@ -1678,8 +1679,8 @@ * systems. */ SYSCTL_PROC(_security_bsd, OID_AUTO, unprivileged_proc_debug, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_SECURE, 0, 0, - sysctl_unprivileged_proc_debug, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_SECURE | + CTLFLAG_MPSAFE, 0, 0, sysctl_unprivileged_proc_debug, "I", "Unprivileged processes may use process debugging facilities"); /*- Index: sys/kern/kern_racct.c =================================================================== --- sys/kern/kern_racct.c +++ sys/kern/kern_racct.c @@ -79,7 +79,8 @@ bool __read_frequently racct_enable = true; #endif -SYSCTL_NODE(_kern, OID_AUTO, racct, CTLFLAG_RW, 0, "Resource Accounting"); +SYSCTL_NODE(_kern, OID_AUTO, racct, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Resource Accounting"); SYSCTL_BOOL(_kern_racct, OID_AUTO, enable, CTLFLAG_RDTUN, &racct_enable, 0, "Enable RACCT/RCTL"); SYSCTL_UINT(_kern_racct, OID_AUTO, pcpu_threshold, CTLFLAG_RW, &pcpu_threshold, Index: sys/kern/kern_rwlock.c =================================================================== --- sys/kern/kern_rwlock.c +++ sys/kern/kern_rwlock.c @@ -97,7 +97,8 @@ #ifdef RWLOCK_CUSTOM_BACKOFF static u_short __read_frequently rowner_retries; static u_short __read_frequently rowner_loops; -static SYSCTL_NODE(_debug, OID_AUTO, rwlock, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_debug, OID_AUTO, rwlock, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "rwlock debugging"); SYSCTL_U16(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, ""); SYSCTL_U16(_debug_rwlock, OID_AUTO, loops, CTLFLAG_RW, &rowner_loops, 0, ""); Index: sys/kern/kern_sendfile.c =================================================================== --- sys/kern/kern_sendfile.c +++ sys/kern/kern_sendfile.c @@ -126,8 +126,10 @@ COUNTER_ARRAY_ZERO(sfstat, sizeof(s) / sizeof(uint64_t)); return (SYSCTL_OUT(req, &s, sizeof(s))); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, sfstat, CTLTYPE_OPAQUE | CTLFLAG_RW, - NULL, 0, sfstat_sysctl, "I", "sendfile statistics"); +SYSCTL_PROC(_kern_ipc, OID_AUTO, sfstat, + CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + sfstat_sysctl, "I", + "sendfile statistics"); static void sendfile_free_mext(struct mbuf *m) Index: sys/kern/kern_shutdown.c =================================================================== --- sys/kern/kern_shutdown.c +++ sys/kern/kern_shutdown.c @@ -158,7 +158,7 @@ SYSCTL_BOOL(_kern, OID_AUTO, powercycle_on_panic, CTLFLAG_RWTUN, &powercycle_on_panic, 0, "Do a power cycle instead of a reboot on a panic"); -static SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Shutdown environment"); #ifndef DIAGNOSTIC @@ -687,7 +687,8 @@ static int kassert_suppress_in_panic = 0; static int kassert_warnings = 0; -SYSCTL_NODE(_debug, OID_AUTO, kassert, CTLFLAG_RW, NULL, "kassert options"); +SYSCTL_NODE(_debug, OID_AUTO, kassert, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "kassert options"); #ifdef KASSERT_PANIC_OPTIONAL #define KASSERT_RWTUN CTLFLAG_RWTUN @@ -734,8 +735,9 @@ static int kassert_sysctl_kassert(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_debug_kassert, OID_AUTO, kassert, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE, NULL, 0, - kassert_sysctl_kassert, "I", "set to trigger a test kassert"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE | CTLFLAG_NEEDGIANT, NULL, 0, + kassert_sysctl_kassert, "I", + "set to trigger a test kassert"); static int kassert_sysctl_kassert(SYSCTL_HANDLER_ARGS) @@ -1011,8 +1013,9 @@ sbuf_delete(&sb); return (error); } -SYSCTL_PROC(_kern_shutdown, OID_AUTO, dumpdevname, CTLTYPE_STRING | CTLFLAG_RD, - &dumper_configs, 0, dumpdevname_sysctl_handler, "A", +SYSCTL_PROC(_kern_shutdown, OID_AUTO, dumpdevname, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &dumper_configs, 0, + dumpdevname_sysctl_handler, "A", "Device(s) for kernel dumps"); static int _dump_append(struct dumperinfo *di, void *virtual, Index: sys/kern/kern_sig.c =================================================================== --- sys/kern/kern_sig.c +++ sys/kern/kern_sig.c @@ -134,7 +134,7 @@ SYSCTL_INT(_kern, OID_AUTO, forcesigexit, CTLFLAG_RW, &kern_forcesigexit, 0, "Force trap signal to be handled"); -static SYSCTL_NODE(_kern, OID_AUTO, sigqueue, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern, OID_AUTO, sigqueue, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "POSIX real time signal"); static int max_pending_per_proc = 128; @@ -3344,9 +3344,10 @@ num_cores = new_val; return (0); } -SYSCTL_PROC(_debug, OID_AUTO, ncores, CTLTYPE_INT|CTLFLAG_RW, - 0, sizeof(int), sysctl_debug_num_cores_check, "I", - "Maximum number of generated process corefiles while using index format"); +SYSCTL_PROC(_debug, OID_AUTO, ncores, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_debug_num_cores_check, "I", + "Maximum number of generated process corefiles while using index format"); #define GZIP_SUFFIX ".gz" #define ZSTD_SUFFIX ".zst" @@ -3367,8 +3368,9 @@ compress_user_cores = val; return (error); } -SYSCTL_PROC(_kern, OID_AUTO, compress_user_cores, CTLTYPE_INT | CTLFLAG_RWTUN, - 0, sizeof(int), sysctl_compress_user_cores, "I", +SYSCTL_PROC(_kern, OID_AUTO, compress_user_cores, + CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_compress_user_cores, "I", "Enable compression of user corefiles (" __XSTRING(COMPRESS_GZIP) " = gzip, " __XSTRING(COMPRESS_ZSTD) " = zstd)"); Index: sys/kern/kern_switch.c =================================================================== --- sys/kern/kern_switch.c +++ sys/kern/kern_switch.c @@ -80,7 +80,8 @@ * with SCHED_STAT_DEFINE(). */ #ifdef SCHED_STATS -SYSCTL_NODE(_kern_sched, OID_AUTO, stats, CTLFLAG_RW, 0, "switch stats"); +SYSCTL_NODE(_kern_sched, OID_AUTO, stats, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "switch stats"); /* Switch reasons from mi_switch(). */ DPCPU_DEFINE(long, sched_switch_stats[SWT_COUNT]); @@ -141,8 +142,10 @@ return (0); } -SYSCTL_PROC(_kern_sched_stats, OID_AUTO, reset, CTLTYPE_INT | CTLFLAG_WR, NULL, - 0, sysctl_stats_reset, "I", "Reset scheduler statistics"); +SYSCTL_PROC(_kern_sched_stats, OID_AUTO, reset, + CTLTYPE_INT | CTLFLAG_WR | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_stats_reset, "I", + "Reset scheduler statistics"); #endif /************************************************************************ Index: sys/kern/kern_sx.c =================================================================== --- sys/kern/kern_sx.c +++ sys/kern/kern_sx.c @@ -146,7 +146,8 @@ #ifdef SX_CUSTOM_BACKOFF static u_short __read_frequently asx_retries; static u_short __read_frequently asx_loops; -static SYSCTL_NODE(_debug, OID_AUTO, sx, CTLFLAG_RD, NULL, "sxlock debugging"); +static SYSCTL_NODE(_debug, OID_AUTO, sx, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "sxlock debugging"); SYSCTL_U16(_debug_sx, OID_AUTO, retries, CTLFLAG_RW, &asx_retries, 0, ""); SYSCTL_U16(_debug_sx, OID_AUTO, loops, CTLFLAG_RW, &asx_loops, 0, ""); Index: sys/kern/kern_tc.c =================================================================== --- sys/kern/kern_tc.c +++ sys/kern/kern_tc.c @@ -104,11 +104,16 @@ volatile time_t time_uptime = 1; static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_kern, KERN_BOOTTIME, boottime, CTLTYPE_STRUCT|CTLFLAG_RD, - NULL, 0, sysctl_kern_boottime, "S,timeval", "System boottime"); +SYSCTL_PROC(_kern, KERN_BOOTTIME, boottime, + CTLTYPE_STRUCT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kern_boottime, "S,timeval", + "System boottime"); -SYSCTL_NODE(_kern, OID_AUTO, timecounter, CTLFLAG_RW, 0, ""); -static SYSCTL_NODE(_kern_timecounter, OID_AUTO, tc, CTLFLAG_RW, 0, ""); +SYSCTL_NODE(_kern, OID_AUTO, timecounter, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + ""); +static SYSCTL_NODE(_kern_timecounter, OID_AUTO, tc, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + ""); static int timestepwarnings; SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, @@ -1169,16 +1174,19 @@ */ tc_root = SYSCTL_ADD_NODE_WITH_LABEL(NULL, SYSCTL_STATIC_CHILDREN(_kern_timecounter_tc), OID_AUTO, tc->tc_name, - CTLFLAG_RW, 0, "timecounter description", "timecounter"); + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "timecounter description", "timecounter"); SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(tc_root), OID_AUTO, "mask", CTLFLAG_RD, &(tc->tc_counter_mask), 0, "mask for implemented bits"); SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(tc_root), OID_AUTO, - "counter", CTLTYPE_UINT | CTLFLAG_RD, tc, sizeof(*tc), - sysctl_kern_timecounter_get, "IU", "current timecounter value"); + "counter", CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, tc, + sizeof(*tc), sysctl_kern_timecounter_get, "IU", + "current timecounter value"); SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(tc_root), OID_AUTO, - "frequency", CTLTYPE_U64 | CTLFLAG_RD, tc, sizeof(*tc), - sysctl_kern_timecounter_freq, "QU", "timecounter frequency"); + "frequency", CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, tc, + sizeof(*tc), sysctl_kern_timecounter_freq, "QU", + "timecounter frequency"); SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(tc_root), OID_AUTO, "quality", CTLFLAG_RD, &(tc->tc_quality), 0, "goodness of time counter"); @@ -1478,8 +1486,9 @@ return (EINVAL); } -SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, CTLTYPE_STRING | CTLFLAG_RW, - 0, 0, sysctl_kern_timecounter_hardware, "A", +SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + sysctl_kern_timecounter_hardware, "A", "Timecounter hardware selected"); /* Report the available timecounter hardware. */ @@ -1501,8 +1510,10 @@ return (error); } -SYSCTL_PROC(_kern_timecounter, OID_AUTO, choice, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, sysctl_kern_timecounter_choice, "A", "Timecounter hardware detected"); +SYSCTL_PROC(_kern_timecounter, OID_AUTO, choice, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, + sysctl_kern_timecounter_choice, "A", + "Timecounter hardware detected"); /* * RFC 2783 PPS-API implementation. Index: sys/kern/kern_thr.c =================================================================== --- sys/kern/kern_thr.c +++ sys/kern/kern_thr.c @@ -64,7 +64,7 @@ #include -static SYSCTL_NODE(_kern, OID_AUTO, threads, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern, OID_AUTO, threads, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "thread allocation"); static int max_threads_per_proc = 1500; Index: sys/kern/kern_umtx.c =================================================================== --- sys/kern/kern_umtx.c +++ sys/kern/kern_umtx.c @@ -247,7 +247,8 @@ static MALLOC_DEFINE(M_UMTX, "umtx", "UMTX queue memory"); static int umtx_pi_allocated; -static SYSCTL_NODE(_debug, OID_AUTO, umtx, CTLFLAG_RW, 0, "umtx debug"); +static SYSCTL_NODE(_debug, OID_AUTO, umtx, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "umtx debug"); SYSCTL_INT(_debug_umtx, OID_AUTO, umtx_pi_allocated, CTLFLAG_RD, &umtx_pi_allocated, 0, "Allocated umtx_pi"); static int umtx_verbose_rb = 1; @@ -258,7 +259,8 @@ #ifdef UMTX_PROFILING static long max_length; SYSCTL_LONG(_debug_umtx, OID_AUTO, max_length, CTLFLAG_RD, &max_length, 0, "max_length"); -static SYSCTL_NODE(_debug_umtx, OID_AUTO, chains, CTLFLAG_RD, 0, "umtx chain stats"); +static SYSCTL_NODE(_debug_umtx, OID_AUTO, chains, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "umtx chain stats"); #endif static void abs_timeout_update(struct abs_timeout *timo); @@ -302,7 +304,8 @@ snprintf(chain_name, sizeof(chain_name), "%d", i); chain_oid = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_debug_umtx_chains), OID_AUTO, - chain_name, CTLFLAG_RD, NULL, "umtx hash stats"); + chain_name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "umtx hash stats"); SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(chain_oid), OID_AUTO, "max_length0", CTLFLAG_RD, &umtxq_chains[0][i].max_length, 0, NULL); SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(chain_oid), OID_AUTO, @@ -416,10 +419,12 @@ SYSCTL_PROC(_debug_umtx_chains, OID_AUTO, clear, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, - sysctl_debug_umtx_chains_clear, "I", "Clear umtx chains statistics"); + sysctl_debug_umtx_chains_clear, "I", + "Clear umtx chains statistics"); SYSCTL_PROC(_debug_umtx_chains, OID_AUTO, peaks, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, - sysctl_debug_umtx_chains_peaks, "A", "Highest peaks in chains max length"); + sysctl_debug_umtx_chains_peaks, "A", + "Highest peaks in chains max length"); #endif static void Index: sys/kern/posix4_mib.c =================================================================== --- sys/kern/posix4_mib.c +++ sys/kern/posix4_mib.c @@ -62,7 +62,8 @@ SYSCTL_INT(_p1003_1b, num, name, CTLFLAG_RD | CTLFLAG_CAPRD, \ facility + num - 1, 0, ""); #define P1B_SYSCTL_RW(num, name) \ - SYSCTL_PROC(_p1003_1b, num, name, CTLTYPE_INT | CTLFLAG_RW, NULL, num, \ + SYSCTL_PROC(_p1003_1b, num, name, \ + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, num, \ p31b_sysctl_proc, "I", ""); #else @@ -75,7 +76,8 @@ #define P1B_SYSCTL_RW(num, name) \ SYSCTL_PROC(_p1003_1b, OID_AUTO, name, CTLTYPE_INT | CTLFLAG_RW, NULL, \ num, p31b_sysctl_proc, "I", ""); -SYSCTL_NODE(_kern, OID_AUTO, p1003_1b, CTLFLAG_RW, 0, "P1003.1B"); +SYSCTL_NODE(_kern, OID_AUTO, p1003_1b, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "P1003.1B"); #endif Index: sys/kern/sched_4bsd.c =================================================================== --- sys/kern/sched_4bsd.c +++ sys/kern/sched_4bsd.c @@ -209,18 +209,21 @@ return (0); } -SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RD, 0, "Scheduler"); +SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Scheduler"); SYSCTL_STRING(_kern_sched, OID_AUTO, name, CTLFLAG_RD, "4BSD", 0, "Scheduler name"); -SYSCTL_PROC(_kern_sched, OID_AUTO, quantum, CTLTYPE_INT | CTLFLAG_RW, - NULL, 0, sysctl_kern_quantum, "I", +SYSCTL_PROC(_kern_sched, OID_AUTO, quantum, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kern_quantum, "I", "Quantum for timeshare threads in microseconds"); SYSCTL_INT(_kern_sched, OID_AUTO, slice, CTLFLAG_RW, &sched_slice, 0, "Quantum for timeshare threads in stathz ticks"); #ifdef SMP /* Enable forwarding of wakeups to all other cpus */ -static SYSCTL_NODE(_kern_sched, OID_AUTO, ipiwakeup, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_kern_sched, OID_AUTO, ipiwakeup, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Kernel SMP"); static int runq_fuzz = 1; Index: sys/kern/sched_ule.c =================================================================== --- sys/kern/sched_ule.c +++ sys/kern/sched_ule.c @@ -3083,11 +3083,13 @@ return (0); } -SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RW, 0, "Scheduler"); +SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Scheduler"); SYSCTL_STRING(_kern_sched, OID_AUTO, name, CTLFLAG_RD, "ULE", 0, "Scheduler name"); -SYSCTL_PROC(_kern_sched, OID_AUTO, quantum, CTLTYPE_INT | CTLFLAG_RW, - NULL, 0, sysctl_kern_quantum, "I", +SYSCTL_PROC(_kern_sched, OID_AUTO, quantum, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kern_quantum, "I", "Quantum for timeshare threads in microseconds"); SYSCTL_INT(_kern_sched, OID_AUTO, slice, CTLFLAG_RW, &sched_slice, 0, "Quantum for timeshare threads in stathz ticks"); Index: sys/kern/subr_bus.c =================================================================== --- sys/kern/subr_bus.c +++ sys/kern/subr_bus.c @@ -72,8 +72,10 @@ #include -SYSCTL_NODE(_hw, OID_AUTO, bus, CTLFLAG_RW, NULL, NULL); -SYSCTL_ROOT_NODE(OID_AUTO, dev, CTLFLAG_RW, NULL, NULL); +SYSCTL_NODE(_hw, OID_AUTO, bus, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + NULL); +SYSCTL_ROOT_NODE(OID_AUTO, dev, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + NULL); /* * Used to attach drivers to devclasses. @@ -238,9 +240,10 @@ sysctl_ctx_init(&dc->sysctl_ctx); dc->sysctl_tree = SYSCTL_ADD_NODE(&dc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_dev), OID_AUTO, dc->name, - CTLFLAG_RD, NULL, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); SYSCTL_ADD_PROC(&dc->sysctl_ctx, SYSCTL_CHILDREN(dc->sysctl_tree), - OID_AUTO, "%parent", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "%parent", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dc, DEVCLASS_SYSCTL_PARENT, devclass_sysctl_handler, "A", "parent class"); } @@ -302,25 +305,29 @@ dev->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&dev->sysctl_ctx, SYSCTL_CHILDREN(dc->sysctl_tree), OID_AUTO, dev->nameunit + strlen(dc->name), - CTLFLAG_RD, NULL, "", "device_index"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "", "device_index"); SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree), - OID_AUTO, "%desc", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "%desc", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, DEVICE_SYSCTL_DESC, device_sysctl_handler, "A", "device description"); SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree), - OID_AUTO, "%driver", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "%driver", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, DEVICE_SYSCTL_DRIVER, device_sysctl_handler, "A", "device driver name"); SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree), - OID_AUTO, "%location", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "%location", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, DEVICE_SYSCTL_LOCATION, device_sysctl_handler, "A", "device location relative to parent"); SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree), - OID_AUTO, "%pnpinfo", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "%pnpinfo", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, DEVICE_SYSCTL_PNPINFO, device_sysctl_handler, "A", "device identification"); SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree), - OID_AUTO, "%parent", CTLTYPE_STRING | CTLFLAG_RD, + OID_AUTO, "%parent", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, dev, DEVICE_SYSCTL_PARENT, device_sysctl_handler, "A", "parent device"); if (bus_get_domain(dev, &domain) == 0) @@ -5456,7 +5463,7 @@ return (SYSCTL_OUT(req, &ubus, sizeof(ubus))); } -SYSCTL_NODE(_hw_bus, OID_AUTO, info, CTLFLAG_RW, sysctl_bus, +SYSCTL_NODE(_hw_bus, OID_AUTO, info, CTLFLAG_RW | CTLFLAG_NEEDGIANT, sysctl_bus, "bus-related data"); static int @@ -5531,7 +5538,8 @@ return (error); } -SYSCTL_NODE(_hw_bus, OID_AUTO, devices, CTLFLAG_RD, sysctl_devices, +SYSCTL_NODE(_hw_bus, OID_AUTO, devices, + CTLFLAG_RD | CTLFLAG_NEEDGIANT, sysctl_devices, "system device tree"); int Index: sys/kern/subr_devstat.c =================================================================== --- sys/kern/subr_devstat.c +++ sys/kern/subr_devstat.c @@ -436,11 +436,13 @@ * Sysctl entries for devstat. The first one is a node that all the rest * hang off of. */ -static SYSCTL_NODE(_kern, OID_AUTO, devstat, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_kern, OID_AUTO, devstat, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Device Statistics"); -SYSCTL_PROC(_kern_devstat, OID_AUTO, all, CTLFLAG_RD|CTLTYPE_OPAQUE, - NULL, 0, sysctl_devstat, "S,devstat", "All devices in the devstat list"); +SYSCTL_PROC(_kern_devstat, OID_AUTO, all, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_MPSAFE, NULL, 0, + sysctl_devstat, "S,devstat", + "All devices in the devstat list"); /* * Export the number of devices in the system so that userland utilities * can determine how much memory to allocate to hold all the devices. Index: sys/kern/subr_epoch.c =================================================================== --- sys/kern/subr_epoch.c +++ sys/kern/subr_epoch.c @@ -92,8 +92,10 @@ #define MAX_EPOCHS 64 CTASSERT(sizeof(ck_epoch_entry_t) == sizeof(struct epoch_context)); -SYSCTL_NODE(_kern, OID_AUTO, epoch, CTLFLAG_RW, 0, "epoch information"); -SYSCTL_NODE(_kern_epoch, OID_AUTO, stats, CTLFLAG_RW, 0, "epoch stats"); +SYSCTL_NODE(_kern, OID_AUTO, epoch, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "epoch information"); +SYSCTL_NODE(_kern_epoch, OID_AUTO, stats, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "epoch stats"); /* Stats. */ static counter_u64_t block_count; Index: sys/kern/subr_kdb.c =================================================================== --- sys/kern/subr_kdb.c +++ sys/kern/subr_kdb.c @@ -86,33 +86,43 @@ static int kdb_sysctl_trap_code(SYSCTL_HANDLER_ARGS); static int kdb_sysctl_stack_overflow(SYSCTL_HANDLER_ARGS); -static SYSCTL_NODE(_debug, OID_AUTO, kdb, CTLFLAG_RW, NULL, "KDB nodes"); +static SYSCTL_NODE(_debug, OID_AUTO, kdb, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "KDB nodes"); -SYSCTL_PROC(_debug_kdb, OID_AUTO, available, CTLTYPE_STRING | CTLFLAG_RD, NULL, - 0, kdb_sysctl_available, "A", "list of available KDB backends"); +SYSCTL_PROC(_debug_kdb, OID_AUTO, available, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + kdb_sysctl_available, "A", + "list of available KDB backends"); -SYSCTL_PROC(_debug_kdb, OID_AUTO, current, CTLTYPE_STRING | CTLFLAG_RW, NULL, - 0, kdb_sysctl_current, "A", "currently selected KDB backend"); +SYSCTL_PROC(_debug_kdb, OID_AUTO, current, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, + kdb_sysctl_current, "A", + "currently selected KDB backend"); SYSCTL_PROC(_debug_kdb, OID_AUTO, enter, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE, NULL, 0, - kdb_sysctl_enter, "I", "set to enter the debugger"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE | CTLFLAG_MPSAFE, NULL, 0, + kdb_sysctl_enter, "I", + "set to enter the debugger"); SYSCTL_PROC(_debug_kdb, OID_AUTO, panic, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE, NULL, 0, - kdb_sysctl_panic, "I", "set to panic the kernel"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE | CTLFLAG_MPSAFE, NULL, 0, + kdb_sysctl_panic, "I", + "set to panic the kernel"); SYSCTL_PROC(_debug_kdb, OID_AUTO, trap, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE, NULL, 0, - kdb_sysctl_trap, "I", "set to cause a page fault via data access"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE | CTLFLAG_MPSAFE, NULL, 0, + kdb_sysctl_trap, "I", + "set to cause a page fault via data access"); SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_code, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE, NULL, 0, - kdb_sysctl_trap_code, "I", "set to cause a page fault via code access"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE | CTLFLAG_MPSAFE, NULL, 0, + kdb_sysctl_trap_code, "I", + "set to cause a page fault via code access"); SYSCTL_PROC(_debug_kdb, OID_AUTO, stack_overflow, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE, NULL, 0, - kdb_sysctl_stack_overflow, "I", "set to cause a stack overflow"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE | CTLFLAG_MPSAFE, NULL, 0, + kdb_sysctl_stack_overflow, "I", + "set to cause a stack overflow"); SYSCTL_INT(_debug_kdb, OID_AUTO, break_to_debugger, CTLFLAG_RWTUN | CTLFLAG_SECURE, Index: sys/kern/subr_lock.c =================================================================== --- sys/kern/subr_lock.c +++ sys/kern/subr_lock.c @@ -107,8 +107,10 @@ lock->lo_flags &= ~LO_INITIALIZED; } -static SYSCTL_NODE(_debug, OID_AUTO, lock, CTLFLAG_RD, NULL, "lock debugging"); -static SYSCTL_NODE(_debug_lock, OID_AUTO, delay, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_debug, OID_AUTO, lock, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "lock debugging"); +static SYSCTL_NODE(_debug_lock, OID_AUTO, delay, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "lock delay"); static u_int __read_mostly starvation_limit = 131072; @@ -725,7 +727,8 @@ critical_exit(); } -static SYSCTL_NODE(_debug_lock, OID_AUTO, prof, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_debug_lock, OID_AUTO, prof, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "lock profiling"); SYSCTL_INT(_debug_lock_prof, OID_AUTO, skipspin, CTLFLAG_RW, &lock_prof_skipspin, 0, "Skip profiling on spinlocks."); @@ -733,11 +736,17 @@ &lock_prof_skipcount, 0, "Sample approximately every N lock acquisitions."); SYSCTL_INT(_debug_lock_prof, OID_AUTO, rejected, CTLFLAG_RD, &lock_prof_rejected, 0, "Number of rejected profiling records"); -SYSCTL_PROC(_debug_lock_prof, OID_AUTO, stats, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, dump_lock_prof_stats, "A", "Lock profiling statistics"); -SYSCTL_PROC(_debug_lock_prof, OID_AUTO, reset, CTLTYPE_INT | CTLFLAG_RW, - NULL, 0, reset_lock_prof_stats, "I", "Reset lock profiling statistics"); -SYSCTL_PROC(_debug_lock_prof, OID_AUTO, enable, CTLTYPE_INT | CTLFLAG_RW, - NULL, 0, enable_lock_prof, "I", "Enable lock profiling"); +SYSCTL_PROC(_debug_lock_prof, OID_AUTO, stats, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + dump_lock_prof_stats, "A", + "Lock profiling statistics"); +SYSCTL_PROC(_debug_lock_prof, OID_AUTO, reset, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + reset_lock_prof_stats, "I", + "Reset lock profiling statistics"); +SYSCTL_PROC(_debug_lock_prof, OID_AUTO, enable, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, + enable_lock_prof, "I", + "Enable lock profiling"); #endif Index: sys/kern/subr_param.c =================================================================== --- sys/kern/subr_param.c +++ sys/kern/subr_param.c @@ -137,8 +137,9 @@ "Maximum stack size"); SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, &sgrowsiz, 0, "Amount to grow stack on a stack fault"); -SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING, - NULL, 0, sysctl_kern_vm_guest, "A", +SYSCTL_PROC(_kern, OID_AUTO, vm_guest, + CTLFLAG_RD | CTLTYPE_STRING | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kern_vm_guest, "A", "Virtual machine guest detected?"); /* Index: sys/kern/subr_prof.c =================================================================== --- sys/kern/subr_prof.c +++ sys/kern/subr_prof.c @@ -386,7 +386,9 @@ /* NOTREACHED */ } -static SYSCTL_NODE(_kern, KERN_PROF, prof, CTLFLAG_RW, sysctl_kern_prof, ""); +static SYSCTL_NODE(_kern, KERN_PROF, prof, + CTLFLAG_RW | CTLFLAG_MPSAFE, sysctl_kern_prof, + ""); #endif /* GPROF */ /* Index: sys/kern/subr_rman.c =================================================================== --- sys/kern/subr_rman.c +++ sys/kern/subr_rman.c @@ -1068,7 +1068,8 @@ return (error); } -static SYSCTL_NODE(_hw_bus, OID_AUTO, rman, CTLFLAG_RD, sysctl_rman, +static SYSCTL_NODE(_hw_bus, OID_AUTO, rman, CTLFLAG_RD | CTLFLAG_MPSAFE, + sysctl_rman, "kernel resource manager"); #ifdef DDB Index: sys/kern/subr_rtc.c =================================================================== --- sys/kern/subr_rtc.c +++ sys/kern/subr_rtc.c @@ -81,8 +81,8 @@ "Enable debug printing of RTC clock I/O; 1=reads, 2=writes, 3=both."); static int sysctl_clock_do_io(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_debug, OID_AUTO, clock_do_io, CTLTYPE_INT | CTLFLAG_RW, - 0, 0, sysctl_clock_do_io, "I", +SYSCTL_PROC(_debug, OID_AUTO, clock_do_io, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, sysctl_clock_do_io, "I", "Trigger one-time IO on RTC clocks; 1=read (and discard), 2=write"); /* XXX: should be kern. now, it's no longer machdep. */ Index: sys/kern/subr_sleepqueue.c =================================================================== --- sys/kern/subr_sleepqueue.c +++ sys/kern/subr_sleepqueue.c @@ -147,8 +147,10 @@ #ifdef SLEEPQUEUE_PROFILING u_int sleepq_max_depth; -static SYSCTL_NODE(_debug, OID_AUTO, sleepq, CTLFLAG_RD, 0, "sleepq profiling"); -static SYSCTL_NODE(_debug_sleepq, OID_AUTO, chains, CTLFLAG_RD, 0, +static SYSCTL_NODE(_debug, OID_AUTO, sleepq, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "sleepq profiling"); +static SYSCTL_NODE(_debug_sleepq, OID_AUTO, chains, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "sleepq chain stats"); SYSCTL_UINT(_debug_sleepq, OID_AUTO, max_depth, CTLFLAG_RD, &sleepq_max_depth, 0, "maxmimum depth achieved of a single chain"); @@ -195,7 +197,8 @@ snprintf(chain_name, sizeof(chain_name), "%u", i); chain_oid = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_debug_sleepq_chains), OID_AUTO, - chain_name, CTLFLAG_RD, NULL, "sleepq chain stats"); + chain_name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "sleepq chain stats"); SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(chain_oid), OID_AUTO, "depth", CTLFLAG_RD, &sleepq_chains[i].sc_depth, 0, NULL); SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(chain_oid), OID_AUTO, @@ -1426,13 +1429,18 @@ return (error); } -SYSCTL_PROC(_debug_sleepq, OID_AUTO, stats, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, dump_sleepq_prof_stats, "A", "Sleepqueue profiling statistics"); -SYSCTL_PROC(_debug_sleepq, OID_AUTO, reset, CTLTYPE_INT | CTLFLAG_RW, - NULL, 0, reset_sleepq_prof_stats, "I", +SYSCTL_PROC(_debug_sleepq, OID_AUTO, stats, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + dump_sleepq_prof_stats, "A", + "Sleepqueue profiling statistics"); +SYSCTL_PROC(_debug_sleepq, OID_AUTO, reset, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, + reset_sleepq_prof_stats, "I", "Reset sleepqueue profiling statistics"); -SYSCTL_PROC(_debug_sleepq, OID_AUTO, enable, CTLTYPE_INT | CTLFLAG_RW, - NULL, 0, enable_sleepq_prof, "I", "Enable sleepqueue profiling"); +SYSCTL_PROC(_debug_sleepq, OID_AUTO, enable, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, + enable_sleepq_prof, "I", + "Enable sleepqueue profiling"); #endif #ifdef DDB Index: sys/kern/subr_smp.c =================================================================== --- sys/kern/subr_smp.c +++ sys/kern/subr_smp.c @@ -76,7 +76,8 @@ volatile int smp_started; u_int mp_maxid; -static SYSCTL_NODE(_kern, OID_AUTO, smp, CTLFLAG_RD|CTLFLAG_CAPRD, NULL, +static SYSCTL_NODE(_kern, OID_AUTO, smp, + CTLFLAG_RD | CTLFLAG_CAPRD | CTLFLAG_MPSAFE, NULL, "Kernel SMP"); SYSCTL_INT(_kern_smp, OID_AUTO, maxid, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_maxid, 0, Index: sys/kern/subr_smr.c =================================================================== --- sys/kern/subr_smr.c +++ sys/kern/subr_smr.c @@ -164,7 +164,8 @@ #define SMR_SEQ_MAX_ADVANCE SMR_SEQ_MAX_DELTA / 2 #endif -static SYSCTL_NODE(_debug, OID_AUTO, smr, CTLFLAG_RW, NULL, "SMR Stats"); +static SYSCTL_NODE(_debug, OID_AUTO, smr, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "SMR Stats"); static counter_u64_t advance = EARLY_COUNTER; SYSCTL_COUNTER_U64(_debug_smr, OID_AUTO, advance, CTLFLAG_RD, &advance, ""); static counter_u64_t advance_wait = EARLY_COUNTER; Index: sys/kern/subr_stats.c =================================================================== --- sys/kern/subr_stats.c +++ sys/kern/subr_stats.c @@ -3890,11 +3890,12 @@ return (err); } -SYSCTL_NODE(_kern, OID_AUTO, stats, CTLFLAG_RW, NULL, +SYSCTL_NODE(_kern, OID_AUTO, stats, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "stats(9) MIB"); -SYSCTL_PROC(_kern_stats, OID_AUTO, templates, CTLTYPE_STRING|CTLFLAG_RD, - NULL, 0, stats_tpl_list_available, "A", +SYSCTL_PROC(_kern_stats, OID_AUTO, templates, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + stats_tpl_list_available, "A", "list the name/hash of all available stats(9) templates"); #else /* ! _KERNEL */ Index: sys/kern/subr_turnstile.c =================================================================== --- sys/kern/subr_turnstile.c +++ sys/kern/subr_turnstile.c @@ -141,9 +141,10 @@ #ifdef TURNSTILE_PROFILING u_int turnstile_max_depth; -static SYSCTL_NODE(_debug, OID_AUTO, turnstile, CTLFLAG_RD, 0, +static SYSCTL_NODE(_debug, OID_AUTO, turnstile, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "turnstile profiling"); -static SYSCTL_NODE(_debug_turnstile, OID_AUTO, chains, CTLFLAG_RD, 0, +static SYSCTL_NODE(_debug_turnstile, OID_AUTO, chains, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "turnstile chain stats"); SYSCTL_UINT(_debug_turnstile, OID_AUTO, max_depth, CTLFLAG_RD, &turnstile_max_depth, 0, "maximum depth achieved of a single chain"); @@ -406,7 +407,8 @@ snprintf(chain_name, sizeof(chain_name), "%d", i); chain_oid = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_debug_turnstile_chains), OID_AUTO, - chain_name, CTLFLAG_RD, NULL, "turnstile chain stats"); + chain_name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "turnstile chain stats"); SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(chain_oid), OID_AUTO, "depth", CTLFLAG_RD, &turnstile_chains[i].tc_depth, 0, NULL); Index: sys/kern/subr_witness.c =================================================================== --- sys/kern/subr_witness.c +++ sys/kern/subr_witness.c @@ -361,7 +361,7 @@ static int witness_voutput(const char *fmt, va_list ap) __printflike(1, 0); static void witness_setflag(struct lock_object *lock, int flag, int set); -static SYSCTL_NODE(_debug, OID_AUTO, witness, CTLFLAG_RW, NULL, +static SYSCTL_NODE(_debug, OID_AUTO, witness, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Witness Locking"); /* @@ -372,8 +372,10 @@ * completely disabled. */ static int witness_watch = 1; -SYSCTL_PROC(_debug_witness, OID_AUTO, watch, CTLFLAG_RWTUN | CTLTYPE_INT, NULL, 0, - sysctl_debug_witness_watch, "I", "witness is watching lock operations"); +SYSCTL_PROC(_debug_witness, OID_AUTO, watch, + CTLFLAG_RWTUN | CTLTYPE_INT | CTLFLAG_MPSAFE, NULL, 0, + sysctl_debug_witness_watch, "I", + "witness is watching lock operations"); #ifdef KDB /* @@ -424,21 +426,26 @@ }; static enum witness_channel witness_channel = WITNESS_CONSOLE; -SYSCTL_PROC(_debug_witness, OID_AUTO, output_channel, CTLTYPE_STRING | - CTLFLAG_RWTUN, NULL, 0, sysctl_debug_witness_channel, "A", +SYSCTL_PROC(_debug_witness, OID_AUTO, output_channel, + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL, 0, + sysctl_debug_witness_channel, "A", "Output channel for warnings"); /* * Call this to print out the relations between locks. */ -SYSCTL_PROC(_debug_witness, OID_AUTO, fullgraph, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_debug_witness_fullgraph, "A", "Show locks relation graphs"); +SYSCTL_PROC(_debug_witness, OID_AUTO, fullgraph, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_debug_witness_fullgraph, "A", + "Show locks relation graphs"); /* * Call this to print out the witness faulty stacks. */ -SYSCTL_PROC(_debug_witness, OID_AUTO, badstacks, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_debug_witness_badstacks, "A", "Show bad witness stacks"); +SYSCTL_PROC(_debug_witness, OID_AUTO, badstacks, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_debug_witness_badstacks, "A", + "Show bad witness stacks"); static struct mtx w_mtx; Index: sys/kern/sys_socket.c =================================================================== --- sys/kern/sys_socket.c +++ sys/kern/sys_socket.c @@ -77,7 +77,7 @@ #include #include -static SYSCTL_NODE(_kern_ipc, OID_AUTO, aio, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_kern_ipc, OID_AUTO, aio, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "socket AIO stats"); static int empty_results; Index: sys/kern/uipc_accf.c =================================================================== --- sys/kern/uipc_accf.c +++ sys/kern/uipc_accf.c @@ -62,7 +62,8 @@ static int unloadable = 0; -SYSCTL_NODE(_net, OID_AUTO, accf, CTLFLAG_RW, 0, "Accept filters"); +SYSCTL_NODE(_net, OID_AUTO, accf, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Accept filters"); SYSCTL_INT(_net_accf, OID_AUTO, unloadable, CTLFLAG_RW, &unloadable, 0, "Allow unload of accept filters (not recommended)"); Index: sys/kern/uipc_ktls.c =================================================================== --- sys/kern/uipc_ktls.c +++ sys/kern/uipc_ktls.c @@ -87,9 +87,9 @@ static uma_zone_t ktls_session_zone; static uint16_t ktls_cpuid_lookup[MAXCPU]; -SYSCTL_NODE(_kern_ipc, OID_AUTO, tls, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern_ipc, OID_AUTO, tls, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Kernel TLS offload"); -SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, stats, CTLFLAG_RW, 0, +SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, stats, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Kernel TLS offload stats"); static int ktls_allow_unload; @@ -162,12 +162,12 @@ SYSCTL_COUNTER_U64(_kern_ipc_tls_stats, OID_AUTO, switch_failed, CTLFLAG_RD, &ktls_switch_failed, "TLS sessions unable to switch between SW and ifnet"); -SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, sw, CTLFLAG_RD, 0, +SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, sw, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Software TLS session stats"); -SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, ifnet, CTLFLAG_RD, 0, +SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, ifnet, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Hardware (ifnet) TLS session stats"); #ifdef TCP_OFFLOAD -SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, toe, CTLFLAG_RD, 0, +SYSCTL_NODE(_kern_ipc_tls, OID_AUTO, toe, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "TOE TLS session stats"); #endif Index: sys/kern/uipc_mbuf.c =================================================================== --- sys/kern/uipc_mbuf.c +++ sys/kern/uipc_mbuf.c @@ -2113,10 +2113,14 @@ return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, mbufprofile, CTLTYPE_STRING|CTLFLAG_RD, - NULL, 0, mbprof_handler, "A", "mbuf profiling statistics"); - -SYSCTL_PROC(_kern_ipc, OID_AUTO, mbufprofileclr, CTLTYPE_INT|CTLFLAG_RW, - NULL, 0, mbprof_clr_handler, "I", "clear mbuf profiling statistics"); +SYSCTL_PROC(_kern_ipc, OID_AUTO, mbufprofile, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + mbprof_handler, "A", + "mbuf profiling statistics"); + +SYSCTL_PROC(_kern_ipc, OID_AUTO, mbufprofileclr, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + mbprof_clr_handler, "I", + "clear mbuf profiling statistics"); #endif Index: sys/kern/uipc_mqueue.c =================================================================== --- sys/kern/uipc_mqueue.c +++ sys/kern/uipc_mqueue.c @@ -199,7 +199,7 @@ /* following real data... */ }; -static SYSCTL_NODE(_kern, OID_AUTO, mqueue, CTLFLAG_RW, 0, +static SYSCTL_NODE(_kern, OID_AUTO, mqueue, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "POSIX real time message queue"); static int default_maxmsg = 10; Index: sys/kern/uipc_sockbuf.c =================================================================== --- sys/kern/uipc_sockbuf.c +++ sys/kern/uipc_sockbuf.c @@ -1523,7 +1523,9 @@ /* This takes the place of kern.maxsockbuf, which moved to kern.ipc. */ static int dummy; SYSCTL_INT(_kern, KERN_DUMMY, dummy, CTLFLAG_RW | CTLFLAG_SKIP, &dummy, 0, ""); -SYSCTL_OID(_kern_ipc, KIPC_MAXSOCKBUF, maxsockbuf, CTLTYPE_ULONG|CTLFLAG_RW, - &sb_max, 0, sysctl_handle_sb_max, "LU", "Maximum socket buffer size"); +SYSCTL_OID(_kern_ipc, KIPC_MAXSOCKBUF, maxsockbuf, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &sb_max, 0, + sysctl_handle_sb_max, "LU", + "Maximum socket buffer size"); SYSCTL_ULONG(_kern_ipc, KIPC_SOCKBUF_WASTE, sockbuf_waste_factor, CTLFLAG_RW, &sb_efficiency, 0, "Socket buffer size waste factor"); Index: sys/kern/uipc_socket.c =================================================================== --- sys/kern/uipc_socket.c +++ sys/kern/uipc_socket.c @@ -235,12 +235,13 @@ somaxconn = val; return (0); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, soacceptqueue, CTLTYPE_UINT | CTLFLAG_RW, - 0, sizeof(int), sysctl_somaxconn, "I", +SYSCTL_PROC(_kern_ipc, OID_AUTO, soacceptqueue, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_somaxconn, "I", "Maximum listen socket pending connection accept queue size"); SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, - CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP, - 0, sizeof(int), sysctl_somaxconn, "I", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_SKIP | CTLFLAG_NEEDGIANT, 0, + sizeof(int), sysctl_somaxconn, "I", "Maximum listen socket pending connection accept queue size (compat)"); static int numopensockets; @@ -265,7 +266,8 @@ * General IPC sysctl name space, used by sockets and a variety of other IPC * types. */ -SYSCTL_NODE(_kern, KERN_IPC, ipc, CTLFLAG_RW, 0, "IPC"); +SYSCTL_NODE(_kern, KERN_IPC, ipc, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "IPC"); /* * Initialize the socket subsystem and set up the socket @@ -369,8 +371,9 @@ } return (error); } -SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, CTLTYPE_INT|CTLFLAG_RW, - &maxsockets, 0, sysctl_maxsockets, "IU", +SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &maxsockets, 0, + sysctl_maxsockets, "IU", "Maximum number of sockets available"); /* Index: sys/kern/uipc_usrreq.c =================================================================== --- sys/kern/uipc_usrreq.c +++ sys/kern/uipc_usrreq.c @@ -163,11 +163,16 @@ static u_long unpsp_sendspace = PIPSIZ; /* really max datagram size */ static u_long unpsp_recvspace = PIPSIZ; -static SYSCTL_NODE(_net, PF_LOCAL, local, CTLFLAG_RW, 0, "Local domain"); -static SYSCTL_NODE(_net_local, SOCK_STREAM, stream, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net, PF_LOCAL, local, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Local domain"); +static SYSCTL_NODE(_net_local, SOCK_STREAM, stream, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "SOCK_STREAM"); -static SYSCTL_NODE(_net_local, SOCK_DGRAM, dgram, CTLFLAG_RW, 0, "SOCK_DGRAM"); -static SYSCTL_NODE(_net_local, SOCK_SEQPACKET, seqpacket, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_local, SOCK_DGRAM, dgram, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "SOCK_DGRAM"); +static SYSCTL_NODE(_net_local, SOCK_SEQPACKET, seqpacket, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "SOCK_SEQPACKET"); SYSCTL_ULONG(_net_local_stream, OID_AUTO, sendspace, CTLFLAG_RW, @@ -1898,14 +1903,16 @@ return (error); } -SYSCTL_PROC(_net_local_dgram, OID_AUTO, pcblist, CTLTYPE_OPAQUE | CTLFLAG_RD, +SYSCTL_PROC(_net_local_dgram, OID_AUTO, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, (void *)(intptr_t)SOCK_DGRAM, 0, unp_pcblist, "S,xunpcb", "List of active local datagram sockets"); -SYSCTL_PROC(_net_local_stream, OID_AUTO, pcblist, CTLTYPE_OPAQUE | CTLFLAG_RD, +SYSCTL_PROC(_net_local_stream, OID_AUTO, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, (void *)(intptr_t)SOCK_STREAM, 0, unp_pcblist, "S,xunpcb", "List of active local stream sockets"); SYSCTL_PROC(_net_local_seqpacket, OID_AUTO, pcblist, - CTLTYPE_OPAQUE | CTLFLAG_RD, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, (void *)(intptr_t)SOCK_SEQPACKET, 0, unp_pcblist, "S,xunpcb", "List of active local seqpacket sockets"); Index: sys/kern/vfs_aio.c =================================================================== --- sys/kern/vfs_aio.c +++ sys/kern/vfs_aio.c @@ -107,7 +107,7 @@ static MALLOC_DEFINE(M_LIO, "lio", "listio aio control block list"); static MALLOC_DEFINE(M_AIOS, "aios", "aio_suspend aio control block list"); -static SYSCTL_NODE(_vfs, OID_AUTO, aio, CTLFLAG_RW, 0, +static SYSCTL_NODE(_vfs, OID_AUTO, aio, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Async IO management"); static int enable_aio_unsafe = 0; Index: sys/kern/vfs_cache.c =================================================================== --- sys/kern/vfs_cache.c +++ sys/kern/vfs_cache.c @@ -342,7 +342,7 @@ /* * The new name cache statistics */ -static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 0, +static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Name cache statistics"); #define STATNODE_ULONG(name, descr) \ SYSCTL_ULONG(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, 0, descr); @@ -576,7 +576,8 @@ /* * Grab an atomic snapshot of the name cache hash chain lengths */ -static SYSCTL_NODE(_debug, OID_AUTO, hashstat, CTLFLAG_RW, NULL, +static SYSCTL_NODE(_debug, OID_AUTO, hashstat, + CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "hash table stats"); static int Index: sys/libkern/iconv.c =================================================================== --- sys/libkern/iconv.c +++ sys/libkern/iconv.c @@ -42,7 +42,8 @@ SYSCTL_DECL(_kern_iconv); -SYSCTL_NODE(_kern, OID_AUTO, iconv, CTLFLAG_RW, NULL, "kernel iconv interface"); +SYSCTL_NODE(_kern, OID_AUTO, iconv, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "kernel iconv interface"); MALLOC_DEFINE(M_ICONV, "iconv", "ICONV structures"); static MALLOC_DEFINE(M_ICONVDATA, "iconv_data", "ICONV data"); @@ -348,8 +349,10 @@ return error; } -SYSCTL_PROC(_kern_iconv, OID_AUTO, drvlist, CTLFLAG_RD | CTLTYPE_OPAQUE, - NULL, 0, iconv_sysctl_drvlist, "S,xlat", "registered converters"); +SYSCTL_PROC(_kern_iconv, OID_AUTO, drvlist, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_MPSAFE, NULL, 0, + iconv_sysctl_drvlist, "S,xlat", + "registered converters"); /* * List all available charset pairs. @@ -379,8 +382,10 @@ return error; } -SYSCTL_PROC(_kern_iconv, OID_AUTO, cslist, CTLFLAG_RD | CTLTYPE_OPAQUE, - NULL, 0, iconv_sysctl_cslist, "S,xlat", "registered charset pairs"); +SYSCTL_PROC(_kern_iconv, OID_AUTO, cslist, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_MPSAFE, NULL, 0, + iconv_sysctl_cslist, "S,xlat", + "registered charset pairs"); int iconv_add(const char *converter, const char *to, const char *from) @@ -446,8 +451,10 @@ return error; } -SYSCTL_PROC(_kern_iconv, OID_AUTO, add, CTLFLAG_RW | CTLTYPE_OPAQUE, - NULL, 0, iconv_sysctl_add, "S,xlat", "register charset pair"); +SYSCTL_PROC(_kern_iconv, OID_AUTO, add, + CTLFLAG_RW | CTLTYPE_OPAQUE | CTLFLAG_MPSAFE, NULL, 0, + iconv_sysctl_add, "S,xlat", + "register charset pair"); /* * Default stubs for converters Index: sys/mips/atheros/ar531x/ar5315_machdep.c =================================================================== --- sys/mips/atheros/ar531x/ar5315_machdep.c +++ sys/mips/atheros/ar531x/ar5315_machdep.c @@ -109,7 +109,7 @@ } #if defined(SOC_VENDOR) || defined(SOC_MODEL) || defined(SOC_REV) -static SYSCTL_NODE(_hw, OID_AUTO, soc, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw, OID_AUTO, soc, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "System on Chip information"); #endif #if defined(SOC_VENDOR) @@ -129,7 +129,8 @@ #endif #if defined(DEVICE_VENDOR) || defined(DEVICE_MODEL) || defined(DEVICE_REV) -static SYSCTL_NODE(_hw, OID_AUTO, device, CTLFLAG_RD, 0, "Board information"); +static SYSCTL_NODE(_hw, OID_AUTO, device, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Board information"); #endif #if defined(DEVICE_VENDOR) static char hw_device_vendor[] = DEVICE_VENDOR; Index: sys/mips/atheros/if_arge.c =================================================================== --- sys/mips/atheros/if_arge.c +++ sys/mips/atheros/if_arge.c @@ -292,7 +292,7 @@ int i; tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "intr", - CTLFLAG_RD, NULL, "Interrupt statistics"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Interrupt statistics"); child = SYSCTL_CHILDREN(tree); for (i = 0; i < 32; i++) { snprintf(sn, sizeof(sn), "%d", i); Index: sys/mips/cavium/octe/mv88e61xxphy.c =================================================================== --- sys/mips/cavium/octe/mv88e61xxphy.c +++ sys/mips/cavium/octe/mv88e61xxphy.c @@ -172,7 +172,7 @@ * Add per-port sysctl tree/handlers. */ port_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "port", - CTLFLAG_RD, NULL, "Switch Ports"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Switch Ports"); port_tree = SYSCTL_CHILDREN(port_node); for (port = 0; port < MV88E61XX_PORTS; port++) { struct mv88e61xxphy_port_softc *psc; @@ -181,41 +181,41 @@ portbuf[0] = '0' + port; portN_node = SYSCTL_ADD_NODE(ctx, port_tree, OID_AUTO, portbuf, - CTLFLAG_RD, NULL, "Switch Port"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Switch Port"); portN_tree = SYSCTL_CHILDREN(portN_node); SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "duplex", - CTLFLAG_RD | CTLTYPE_INT, psc, + CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_NEEDGIANT, psc, MV88E61XXPHY_LINK_SYSCTL_DUPLEX, mv88e61xxphy_sysctl_link_proc, "IU", "Media duplex status (0 = half duplex; 1 = full duplex)"); SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "link", - CTLFLAG_RD | CTLTYPE_INT, psc, + CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_NEEDGIANT, psc, MV88E61XXPHY_LINK_SYSCTL_LINK, mv88e61xxphy_sysctl_link_proc, "IU", "Link status (0 = down; 1 = up)"); SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "media", - CTLFLAG_RD | CTLTYPE_INT, psc, + CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_NEEDGIANT, psc, MV88E61XXPHY_LINK_SYSCTL_MEDIA, mv88e61xxphy_sysctl_link_proc, "IU", "Media speed (0 = unknown; 10 = 10Mbps; 100 = 100Mbps; 1000 = 1Gbps)"); SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "domain", - CTLFLAG_RW | CTLTYPE_INT, psc, + CTLFLAG_RW | CTLTYPE_INT | CTLFLAG_NEEDGIANT, psc, MV88E61XXPHY_PORT_SYSCTL_DOMAIN, mv88e61xxphy_sysctl_port_proc, "IU", "Broadcast domain (ports can only talk to other ports in the same domain)"); SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "vlan", - CTLFLAG_RW | CTLTYPE_INT, psc, + CTLFLAG_RW | CTLTYPE_INT | CTLFLAG_NEEDGIANT, psc, MV88E61XXPHY_PORT_SYSCTL_VLAN, mv88e61xxphy_sysctl_port_proc, "IU", "Tag packets from/for this port with a given VLAN."); SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "priority", - CTLFLAG_RW | CTLTYPE_INT, psc, + CTLFLAG_RW | CTLTYPE_INT | CTLFLAG_NEEDGIANT, psc, MV88E61XXPHY_PORT_SYSCTL_PRIORITY, mv88e61xxphy_sysctl_port_proc, "IU", "Default packet priority for this port."); Index: sys/mips/cavium/octeon_machdep.c =================================================================== --- sys/mips/cavium/octeon_machdep.c +++ sys/mips/cavium/octeon_machdep.c @@ -446,8 +446,9 @@ return (0); } -SYSCTL_PROC(_machdep, OID_AUTO, led_display, CTLTYPE_STRING | CTLFLAG_WR, - NULL, 0, sysctl_machdep_led_display, "A", +SYSCTL_PROC(_machdep, OID_AUTO, led_display, + CTLTYPE_STRING | CTLFLAG_WR | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_machdep_led_display, "A", "String to display on LED display"); void Index: sys/mips/cavium/usb/octusb.c =================================================================== --- sys/mips/cavium/usb/octusb.c +++ sys/mips/cavium/usb/octusb.c @@ -83,7 +83,8 @@ #ifdef USB_DEBUG static int octusbdebug = 0; -static SYSCTL_NODE(_hw_usb, OID_AUTO, octusb, CTLFLAG_RW, 0, "OCTUSB"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, octusb, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "OCTUSB"); SYSCTL_INT(_hw_usb_octusb, OID_AUTO, debug, CTLFLAG_RWTUN, &octusbdebug, 0, "OCTUSB debug level"); #endif Index: sys/mips/ingenic/jz4780_aic.c =================================================================== --- sys/mips/ingenic/jz4780_aic.c +++ sys/mips/ingenic/jz4780_aic.c @@ -769,7 +769,8 @@ /* Create device sysctl node. */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "internal_codec", CTLTYPE_INT | CTLFLAG_RW, + OID_AUTO, "internal_codec", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, scp, 0, sysctl_hw_pcm_internal_codec, "I", "use internal audio codec"); Index: sys/mips/mips/busdma_machdep.c =================================================================== --- sys/mips/mips/busdma_machdep.c +++ sys/mips/mips/busdma_machdep.c @@ -142,7 +142,8 @@ static int busdma_zonecount; static STAILQ_HEAD(, bounce_zone) bounce_zone_list; -static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, + "Busdma parameters"); SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); @@ -1374,7 +1375,7 @@ sysctl_ctx_init(&bz->sysctl_tree); bz->sysctl_tree_top = SYSCTL_ADD_NODE(&bz->sysctl_tree, SYSCTL_STATIC_CHILDREN(_hw_busdma), OID_AUTO, bz->zoneid, - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (bz->sysctl_tree_top == NULL) { sysctl_ctx_free(&bz->sysctl_tree); return (0); /* XXX error code? */ Index: sys/mips/mips/pmap.c =================================================================== --- sys/mips/mips/pmap.c +++ sys/mips/mips/pmap.c @@ -1382,7 +1382,8 @@ #endif }; -static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); +static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "VM/pmap parameters"); SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_count, CTLFLAG_RD, &pv_entry_count, 0, "Current number of pv entries"); Index: sys/mips/mips/tick.c =================================================================== --- sys/mips/mips/tick.c +++ sys/mips/mips/tick.c @@ -178,8 +178,9 @@ return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, counter_freq, CTLTYPE_U64 | CTLFLAG_RW, - NULL, 0, sysctl_machdep_counter_freq, "QU", +SYSCTL_PROC(_machdep, OID_AUTO, counter_freq, + CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_machdep_counter_freq, "QU", "Timecounter frequency in Hz"); static unsigned Index: sys/mips/nlm/cms.c =================================================================== --- sys/mips/nlm/cms.c +++ sys/mips/nlm/cms.c @@ -493,5 +493,7 @@ return (error); } -SYSCTL_PROC(_debug, OID_AUTO, msgring, CTLTYPE_STRING | CTLFLAG_RD, 0, 0, - sys_print_debug, "A", "msgring debug info"); +SYSCTL_PROC(_debug, OID_AUTO, msgring, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, 0, 0, + sys_print_debug, "A", + "msgring debug info"); Index: sys/mips/nlm/dev/net/xlpge.c =================================================================== --- sys/mips/nlm/dev/net/xlpge.c +++ sys/mips/nlm/dev/net/xlpge.c @@ -1160,10 +1160,10 @@ tree = device_get_sysctl_tree(dev); child = SYSCTL_CHILDREN(tree); -#define XLPGE_STAT(name, offset, desc) \ - SYSCTL_ADD_PROC(ctx, child, OID_AUTO, name, \ - CTLTYPE_UINT | CTLFLAG_RD, sc, offset, \ - xlpge_stats_sysctl, "IU", desc) +#define XLPGE_STAT(name, offset, desc) \ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, name, \ + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, \ + sc, offset, xlpge_stats_sysctl, "IU", desc) XLPGE_STAT("tr127", nlm_sgmii_stats_tr127, "TxRx 64 - 127 Bytes"); XLPGE_STAT("tr255", nlm_sgmii_stats_tr255, "TxRx 128 - 255 Bytes"); Index: sys/mips/nlm/tick.c =================================================================== --- sys/mips/nlm/tick.c +++ sys/mips/nlm/tick.c @@ -179,8 +179,9 @@ return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, counter_freq, CTLTYPE_U64 | CTLFLAG_RW, - NULL, 0, sysctl_machdep_counter_freq, "QU", +SYSCTL_PROC(_machdep, OID_AUTO, counter_freq, + CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_machdep_counter_freq, "QU", "Timecounter frequency in Hz"); static unsigned Index: sys/net/bpf.c =================================================================== --- sys/net/bpf.c +++ sys/net/bpf.c @@ -214,7 +214,8 @@ static void bpf_drvinit(void *); static int bpf_stats_sysctl(SYSCTL_HANDLER_ARGS); -SYSCTL_NODE(_net, OID_AUTO, bpf, CTLFLAG_RW, 0, "bpf sysctl"); +SYSCTL_NODE(_net, OID_AUTO, bpf, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "bpf sysctl"); int bpf_maxinsns = BPF_MAXINSNS; SYSCTL_INT(_net_bpf, OID_AUTO, maxinsns, CTLFLAG_RW, &bpf_maxinsns, 0, "Maximum bpf program instructions"); Index: sys/net/bpf_jitter.c =================================================================== --- sys/net/bpf_jitter.c +++ sys/net/bpf_jitter.c @@ -57,7 +57,8 @@ #ifdef _KERNEL MALLOC_DEFINE(M_BPFJIT, "BPF_JIT", "BPF JIT compiler"); -SYSCTL_NODE(_net, OID_AUTO, bpf_jitter, CTLFLAG_RW, 0, "BPF JIT compiler"); +SYSCTL_NODE(_net, OID_AUTO, bpf_jitter, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "BPF JIT compiler"); int bpf_jitter_enable = 1; SYSCTL_INT(_net_bpf_jitter, OID_AUTO, enable, CTLFLAG_RW, &bpf_jitter_enable, 0, "enable BPF JIT compiler"); Index: sys/net/debugnet.c =================================================================== --- sys/net/debugnet.c +++ sys/net/debugnet.c @@ -72,7 +72,7 @@ FEATURE(debugnet, "Debugnet support"); -SYSCTL_NODE(_net, OID_AUTO, debugnet, CTLFLAG_RD, NULL, +SYSCTL_NODE(_net, OID_AUTO, debugnet, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "debugnet parameters"); unsigned debugnet_debug; Index: sys/net/ieee8023ad_lacp.c =================================================================== --- sys/net/ieee8023ad_lacp.c +++ sys/net/ieee8023ad_lacp.c @@ -197,7 +197,8 @@ VNET_DEFINE_STATIC(int, lacp_debug); #define V_lacp_debug VNET(lacp_debug) -SYSCTL_NODE(_net_link_lagg, OID_AUTO, lacp, CTLFLAG_RD, 0, "ieee802.3ad"); +SYSCTL_NODE(_net_link_lagg, OID_AUTO, lacp, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "ieee802.3ad"); SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(lacp_debug), 0, "Enable LACP debug logging (1=debug, 2=trace)"); Index: sys/net/if.c =================================================================== --- sys/net/if.c +++ sys/net/if.c @@ -192,8 +192,10 @@ #endif }; -SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); -SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); +SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Link layers"); +SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Generic link-management"); SYSCTL_INT(_net_link, OID_AUTO, ifqmaxlen, CTLFLAG_RDTUN, &ifqmaxlen, 0, "max send queue size"); Index: sys/net/if_bridge.c =================================================================== --- sys/net/if_bridge.c +++ sys/net/if_bridge.c @@ -360,7 +360,8 @@ }; SYSCTL_DECL(_net_link); -static SYSCTL_NODE(_net_link, IFT_BRIDGE, bridge, CTLFLAG_RW, 0, "Bridge"); +static SYSCTL_NODE(_net_link, IFT_BRIDGE, bridge, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bridge"); /* only pass IP[46] packets when pfil is enabled */ VNET_DEFINE_STATIC(int, pfil_onlyip) = 1; @@ -622,7 +623,7 @@ return (error); } SYSCTL_PROC(_net_link_bridge, OID_AUTO, ipfw, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_VNET, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_VNET | CTLFLAG_NEEDGIANT, &VNET_NAME(pfil_ipfw), 0, &sysctl_pfil_ipfw, "I", "Layer2 filter with IPFW"); Index: sys/net/if_enc.c =================================================================== --- sys/net/if_enc.c +++ sys/net/if_enc.c @@ -120,9 +120,12 @@ #define V_filter_mask_out VNET(filter_mask_out) #define V_bpf_mask_out VNET(bpf_mask_out) -static SYSCTL_NODE(_net, OID_AUTO, enc, CTLFLAG_RW, 0, "enc sysctl"); -static SYSCTL_NODE(_net_enc, OID_AUTO, in, CTLFLAG_RW, 0, "enc input sysctl"); -static SYSCTL_NODE(_net_enc, OID_AUTO, out, CTLFLAG_RW, 0, "enc output sysctl"); +static SYSCTL_NODE(_net, OID_AUTO, enc, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "enc sysctl"); +static SYSCTL_NODE(_net_enc, OID_AUTO, in, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "enc input sysctl"); +static SYSCTL_NODE(_net_enc, OID_AUTO, out, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "enc output sysctl"); SYSCTL_INT(_net_enc_in, OID_AUTO, ipsec_filter_mask, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(filter_mask_in), 0, "IPsec input firewall filter mask"); Index: sys/net/if_epair.c =================================================================== --- sys/net/if_epair.c +++ sys/net/if_epair.c @@ -81,7 +81,8 @@ #include SYSCTL_DECL(_net_link); -static SYSCTL_NODE(_net_link, OID_AUTO, epair, CTLFLAG_RW, 0, "epair sysctl"); +static SYSCTL_NODE(_net_link, OID_AUTO, epair, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "epair sysctl"); #ifdef EPAIR_DEBUG static int epair_debug = 0; @@ -132,8 +133,9 @@ return (EINVAL); return (netisr_setqlimit(&epair_nh, qlimit)); } -SYSCTL_PROC(_net_link_epair, OID_AUTO, netisr_maxqlen, CTLTYPE_INT|CTLFLAG_RW, - 0, 0, sysctl_epair_netisr_maxqlen, "I", +SYSCTL_PROC(_net_link_epair, OID_AUTO, netisr_maxqlen, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + sysctl_epair_netisr_maxqlen, "I", "Maximum if_epair(4) netisr \"hw\" queue length"); struct epair_softc { Index: sys/net/if_ethersubr.c =================================================================== --- sys/net/if_ethersubr.c +++ sys/net/if_ethersubr.c @@ -1049,7 +1049,8 @@ #endif SYSCTL_DECL(_net_link); -SYSCTL_NODE(_net_link, IFT_ETHER, ether, CTLFLAG_RW, 0, "Ethernet"); +SYSCTL_NODE(_net_link, IFT_ETHER, ether, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Ethernet"); #if 0 /* @@ -1331,9 +1332,10 @@ return (m); } -static SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "IEEE 802.1Q VLAN"); -static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "for consistency"); VNET_DEFINE_STATIC(int, soft_pad); Index: sys/net/if_gif.c =================================================================== --- sys/net/if_gif.c +++ sys/net/if_gif.c @@ -114,7 +114,7 @@ #define V_gif_cloner VNET(gif_cloner) SYSCTL_DECL(_net_link); -static SYSCTL_NODE(_net_link, IFT_GIF, gif, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_link, IFT_GIF, gif, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Generic Tunnel Interface"); #ifndef MAX_GIF_NEST /* Index: sys/net/if_gre.c =================================================================== --- sys/net/if_gre.c +++ sys/net/if_gre.c @@ -115,7 +115,7 @@ static void gre_delete_tunnel(struct gre_softc *); SYSCTL_DECL(_net_link); -static SYSCTL_NODE(_net_link, IFT_TUNNEL, gre, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_link, IFT_TUNNEL, gre, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Generic Routing Encapsulation"); #ifndef MAX_GRE_NEST /* Index: sys/net/if_lagg.c =================================================================== --- sys/net/if_lagg.c +++ sys/net/if_lagg.c @@ -268,7 +268,7 @@ }; SYSCTL_DECL(_net_link); -SYSCTL_NODE(_net_link, OID_AUTO, lagg, CTLFLAG_RW, 0, +SYSCTL_NODE(_net_link, OID_AUTO, lagg, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Link Aggregation"); /* Allow input on any failover links */ Index: sys/net/if_me.c =================================================================== --- sys/net/if_me.c +++ sys/net/if_me.c @@ -124,7 +124,7 @@ static void me_delete_tunnel(struct me_softc *); SYSCTL_DECL(_net_link); -static SYSCTL_NODE(_net_link, IFT_TUNNEL, me, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_link, IFT_TUNNEL, me, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Minimal Encapsulation for IP (RFC 2004)"); #ifndef MAX_ME_NEST #define MAX_ME_NEST 1 Index: sys/net/if_mib.c =================================================================== --- sys/net/if_mib.c +++ sys/net/if_mib.c @@ -65,8 +65,9 @@ */ SYSCTL_DECL(_net_link_generic); -static SYSCTL_NODE(_net_link_generic, IFMIB_SYSTEM, system, CTLFLAG_RW, 0, - "Variables global to all interfaces"); +static SYSCTL_NODE(_net_link_generic, IFMIB_SYSTEM, system, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Variables global to all interfaces"); SYSCTL_INT(_net_link_generic_system, IFMIB_IFCOUNT, ifcount, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(if_index), 0, @@ -150,6 +151,7 @@ return error; } -static SYSCTL_NODE(_net_link_generic, IFMIB_IFDATA, ifdata, CTLFLAG_RW, - sysctl_ifdata, "Interface table"); +static SYSCTL_NODE(_net_link_generic, IFMIB_IFDATA, ifdata, + CTLFLAG_RW | CTLFLAG_NEEDGIANT, sysctl_ifdata, + "Interface table"); Index: sys/net/if_stf.c =================================================================== --- sys/net/if_stf.c +++ sys/net/if_stf.c @@ -122,7 +122,8 @@ #include SYSCTL_DECL(_net_link); -static SYSCTL_NODE(_net_link, IFT_STF, stf, CTLFLAG_RW, 0, "6to4 Interface"); +static SYSCTL_NODE(_net_link, IFT_STF, stf, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "6to4 Interface"); static int stf_permit_rfc1918 = 0; SYSCTL_INT(_net_link_stf, OID_AUTO, permit_rfc1918, CTLFLAG_RWTUN, Index: sys/net/if_tuntap.c =================================================================== --- sys/net/if_tuntap.c +++ sys/net/if_tuntap.c @@ -195,13 +195,13 @@ SYSCTL_DECL(_net_link); /* tun */ -static SYSCTL_NODE(_net_link, OID_AUTO, tun, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_link, OID_AUTO, tun, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "IP tunnel software network interface"); SYSCTL_INT(_net_link_tun, OID_AUTO, devfs_cloning, CTLFLAG_RWTUN, &tundclone, 0, "Enable legacy devfs interface creation"); /* tap */ -static SYSCTL_NODE(_net_link, OID_AUTO, tap, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_link, OID_AUTO, tap, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Ethernet tunnel software network interface"); SYSCTL_INT(_net_link_tap, OID_AUTO, user_open, CTLFLAG_RW, &tap_allow_uopen, 0, "Enable legacy devfs interface creation for all users"); Index: sys/net/if_vxlan.c =================================================================== --- sys/net/if_vxlan.c +++ sys/net/if_vxlan.c @@ -399,7 +399,7 @@ static eventhandler_tag vxlan_ifdetach_event_tag; SYSCTL_DECL(_net_link); -SYSCTL_NODE(_net_link, OID_AUTO, vxlan, CTLFLAG_RW, 0, +SYSCTL_NODE(_net_link, OID_AUTO, vxlan, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Virtual eXtensible Local Area Network"); static int vxlan_legacy_port = 0; @@ -3060,10 +3060,10 @@ sysctl_ctx_init(ctx); sc->vxl_sysctl_node = SYSCTL_ADD_NODE(ctx, SYSCTL_STATIC_CHILDREN(_net_link_vxlan), OID_AUTO, namebuf, - CTLFLAG_RD, NULL, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sc->vxl_sysctl_node), - OID_AUTO, "ftable", CTLFLAG_RD, NULL, ""); + OID_AUTO, "ftable", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(node), OID_AUTO, "count", CTLFLAG_RD, &sc->vxl_ftable_cnt, 0, "Number of entries in fowarding table"); @@ -3079,7 +3079,7 @@ "Dump the forwarding table entries"); node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sc->vxl_sysctl_node), - OID_AUTO, "stats", CTLFLAG_RD, NULL, ""); + OID_AUTO, "stats", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(node), OID_AUTO, "ftable_nospace", CTLFLAG_RD, &stats->ftable_nospace, 0, "Fowarding table reached maximum entries"); Index: sys/net/iflib.c =================================================================== --- sys/net/iflib.c +++ sys/net/iflib.c @@ -575,8 +575,8 @@ #endif /* !INVARIANTS */ #endif -static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD, 0, - "iflib driver parameters"); +static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "iflib driver parameters"); /* * XXX need to ensure that this can't accidentally cause the head to be moved backwards @@ -6279,7 +6279,7 @@ info->iidi_value = value; SYSCTL_ADD_PROC(device_get_sysctl_ctx(ctx->ifc_dev), SYSCTL_CHILDREN(device_get_sysctl_tree(ctx->ifc_dev)), - OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, + OID_AUTO, name, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, info, 0, iflib_sysctl_int_delay, "I", description); } @@ -6541,7 +6541,7 @@ ctx_list = device_get_sysctl_ctx(dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); ctx->ifc_sysctl_node = node = SYSCTL_ADD_NODE(ctx_list, child, OID_AUTO, "iflib", - CTLFLAG_RD, NULL, "IFLIB fields"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "IFLIB fields"); oid_list = SYSCTL_CHILDREN(node); SYSCTL_ADD_CONST_STRING(ctx_list, oid_list, OID_AUTO, "driver_version", @@ -6576,13 +6576,13 @@ /* XXX change for per-queue sizes */ SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds", - CTLTYPE_STRING|CTLFLAG_RWTUN, ctx, IFLIB_NTXD_HANDLER, - mp_ndesc_handler, "A", - "list of # of TX descriptors to use, 0 = use default #"); + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, ctx, + IFLIB_NTXD_HANDLER, mp_ndesc_handler, "A", + "list of # of TX descriptors to use, 0 = use default #"); SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_nrxds", - CTLTYPE_STRING|CTLFLAG_RWTUN, ctx, IFLIB_NRXD_HANDLER, - mp_ndesc_handler, "A", - "list of # of RX descriptors to use, 0 = use default #"); + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, ctx, + IFLIB_NRXD_HANDLER, mp_ndesc_handler, "A", + "list of # of RX descriptors to use, 0 = use default #"); } static void @@ -6615,7 +6615,7 @@ for (i = 0, txq = ctx->ifc_txqs; i < scctx->isc_ntxqsets; i++, txq++) { snprintf(namebuf, NAME_BUFLEN, qfmt, i); queue_node = SYSCTL_ADD_NODE(ctx_list, child, OID_AUTO, namebuf, - CTLFLAG_RD, NULL, "Queue Name"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); #if MEMORY_LOGGING SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "txq_dequeued", @@ -6665,8 +6665,9 @@ CTLFLAG_RD, &txq->ift_cleaned, "total cleaned"); SYSCTL_ADD_PROC(ctx_list, queue_list, OID_AUTO, "ring_state", - CTLTYPE_STRING | CTLFLAG_RD, __DEVOLATILE(uint64_t *, &txq->ift_br->state), - 0, mp_ring_state_handler, "A", "soft ring state"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + __DEVOLATILE(uint64_t *, &txq->ift_br->state), 0, + mp_ring_state_handler, "A", "soft ring state"); SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, "r_enqueues", CTLFLAG_RD, &txq->ift_br->enqueues, "# of enqueues to the mp_ring for this queue"); @@ -6696,7 +6697,7 @@ for (i = 0, rxq = ctx->ifc_rxqs; i < scctx->isc_nrxqsets; i++, rxq++) { snprintf(namebuf, NAME_BUFLEN, qfmt, i); queue_node = SYSCTL_ADD_NODE(ctx_list, child, OID_AUTO, namebuf, - CTLFLAG_RD, NULL, "Queue Name"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); if (sctx->isc_flags & IFLIB_HAS_RXCQ) { SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "rxq_cq_cidx", @@ -6707,7 +6708,7 @@ for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) { snprintf(namebuf, NAME_BUFLEN, "rxq_fl%d", j); fl_node = SYSCTL_ADD_NODE(ctx_list, queue_list, OID_AUTO, namebuf, - CTLFLAG_RD, NULL, "freelist Name"); + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "freelist Name"); fl_list = SYSCTL_CHILDREN(fl_node); SYSCTL_ADD_U16(ctx_list, fl_list, OID_AUTO, "pidx", CTLFLAG_RD, Index: sys/net/netisr.c =================================================================== --- sys/net/netisr.c +++ sys/net/netisr.c @@ -127,7 +127,8 @@ #define NETISR_WUNLOCK() rm_wunlock(&netisr_rmlock) /* #define NETISR_LOCKING */ -static SYSCTL_NODE(_net, OID_AUTO, isr, CTLFLAG_RW, 0, "netisr"); +static SYSCTL_NODE(_net, OID_AUTO, isr, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "netisr"); /*- * Three global direct dispatch policies are supported: @@ -152,7 +153,8 @@ #define NETISR_DISPATCH_POLICY_MAXSTR 20 /* Used for temporary buffers. */ static u_int netisr_dispatch_policy = NETISR_DISPATCH_POLICY_DEFAULT; static int sysctl_netisr_dispatch_policy(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_net_isr, OID_AUTO, dispatch, CTLTYPE_STRING | CTLFLAG_RWTUN, +SYSCTL_PROC(_net_isr, OID_AUTO, dispatch, + CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, 0, 0, sysctl_netisr_dispatch_policy, "A", "netisr dispatch policy"); Index: sys/net/raw_cb.c =================================================================== --- sys/net/raw_cb.c +++ sys/net/raw_cb.c @@ -61,7 +61,7 @@ struct mtx rawcb_mtx; VNET_DEFINE(struct rawcb_list_head, rawcb_list); -static SYSCTL_NODE(_net, OID_AUTO, raw, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net, OID_AUTO, raw, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Raw socket infrastructure"); static u_long raw_sendspace = RAWSNDQ; Index: sys/net/route.c =================================================================== --- sys/net/route.c +++ sys/net/route.c @@ -179,8 +179,10 @@ return (error); } -SYSCTL_PROC(_net, OID_AUTO, my_fibnum, CTLTYPE_INT|CTLFLAG_RD, - NULL, 0, &sysctl_my_fibnum, "I", "default FIB of caller"); +SYSCTL_PROC(_net, OID_AUTO, my_fibnum, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + &sysctl_my_fibnum, "I", + "default FIB of caller"); static __inline struct rib_head ** rt_tables_get_rnh_ptr(int table, int fam) Index: sys/net/rss_config.c =================================================================== --- sys/net/rss_config.c +++ sys/net/rss_config.c @@ -81,7 +81,8 @@ */ SYSCTL_DECL(_net_inet); -SYSCTL_NODE(_net_inet, OID_AUTO, rss, CTLFLAG_RW, 0, "Receive-side steering"); +SYSCTL_NODE(_net_inet, OID_AUTO, rss, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Receive-side steering"); /* * Toeplitz is the only required hash function in the RSS spec, so use it by @@ -549,5 +550,5 @@ return (error); } SYSCTL_PROC(_net_inet_rss, OID_AUTO, bucket_mapping, - CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_rss_bucket_mapping, "", "RSS bucket -> CPU mapping"); Index: sys/net/rtsock.c =================================================================== --- sys/net/rtsock.c +++ sys/net/rtsock.c @@ -158,7 +158,8 @@ #define RTSOCK_UNLOCK() mtx_unlock(&rtsock_mtx) #define RTSOCK_LOCK_ASSERT() mtx_assert(&rtsock_mtx, MA_OWNED) -static SYSCTL_NODE(_net, OID_AUTO, route, CTLFLAG_RD, 0, ""); +static SYSCTL_NODE(_net, OID_AUTO, route, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + ""); struct walkarg { int w_tmemsize; @@ -211,7 +212,8 @@ return (EINVAL); return (netisr_setqlimit(&rtsock_nh, qlimit)); } -SYSCTL_PROC(_net_route, OID_AUTO, netisr_maxqlen, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_net_route, OID_AUTO, netisr_maxqlen, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, sysctl_route_netisr_maxqlen, "I", "maximum routing socket dispatch queue length"); Index: sys/net/vnet.h =================================================================== --- sys/net/vnet.h +++ sys/net/vnet.h @@ -141,7 +141,8 @@ sizeof(type) / sizeof(uint64_t)); \ return (SYSCTL_OUT(req, &s, sizeof(type))); \ } \ -SYSCTL_PROC(parent, nbr, name, CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_RW, \ +SYSCTL_PROC(parent, nbr, name, \ + CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_NEEDGIANT, \ NULL, 0, array ## _sysctl, "I", desc) #endif /* SYSCTL_OID */ Index: sys/netgraph/bluetooth/common/ng_bluetooth.c =================================================================== --- sys/netgraph/bluetooth/common/ng_bluetooth.c +++ sys/netgraph/bluetooth/common/ng_bluetooth.c @@ -57,7 +57,8 @@ * Define sysctl tree that shared by other parts of Bluetooth stack */ -SYSCTL_NODE(_net, OID_AUTO, bluetooth, CTLFLAG_RW, 0, "Bluetooth family"); +SYSCTL_NODE(_net, OID_AUTO, bluetooth, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth family"); SYSCTL_INT(_net_bluetooth, OID_AUTO, version, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, NG_BLUETOOTH_VERSION, "Version of the stack"); @@ -65,8 +66,8 @@ * HCI */ -SYSCTL_NODE(_net_bluetooth, OID_AUTO, hci, CTLFLAG_RW, - 0, "Bluetooth HCI family"); +SYSCTL_NODE(_net_bluetooth, OID_AUTO, hci, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth HCI family"); static int bluetooth_set_hci_command_timeout_value(SYSCTL_HANDLER_ARGS) @@ -87,7 +88,7 @@ } /* bluetooth_set_hci_command_timeout_value */ SYSCTL_PROC(_net_bluetooth_hci, OID_AUTO, command_timeout, - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &bluetooth_hci_command_timeout_value, 5, bluetooth_set_hci_command_timeout_value, "I", "HCI command timeout (sec)"); @@ -111,7 +112,7 @@ } /* bluetooth_set_hci_connect_timeout_value */ SYSCTL_PROC(_net_bluetooth_hci, OID_AUTO, connection_timeout, - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &bluetooth_hci_connect_timeout_value, 60, bluetooth_set_hci_connect_timeout_value, "I", "HCI connect timeout (sec)"); @@ -124,8 +125,8 @@ * L2CAP */ -SYSCTL_NODE(_net_bluetooth, OID_AUTO, l2cap, CTLFLAG_RW, - 0, "Bluetooth L2CAP family"); +SYSCTL_NODE(_net_bluetooth, OID_AUTO, l2cap, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth L2CAP family"); static int bluetooth_set_l2cap_rtx_timeout_value(SYSCTL_HANDLER_ARGS) @@ -147,7 +148,7 @@ } /* bluetooth_set_l2cap_rtx_timeout_value */ SYSCTL_PROC(_net_bluetooth_l2cap, OID_AUTO, rtx_timeout, - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &bluetooth_l2cap_rtx_timeout_value, 60, bluetooth_set_l2cap_rtx_timeout_value, "I", "L2CAP RTX timeout (sec)"); @@ -171,7 +172,7 @@ } /* bluetooth_set_l2cap_ertx_timeout_value */ SYSCTL_PROC(_net_bluetooth_l2cap, OID_AUTO, ertx_timeout, - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &bluetooth_l2cap_ertx_timeout_value, 300, bluetooth_set_l2cap_ertx_timeout_value, "I", "L2CAP ERTX timeout (sec)"); @@ -220,15 +221,15 @@ * RFCOMM */ -SYSCTL_NODE(_net_bluetooth, OID_AUTO, rfcomm, CTLFLAG_RW, - 0, "Bluetooth RFCOMM family"); +SYSCTL_NODE(_net_bluetooth, OID_AUTO, rfcomm, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth RFCOMM family"); /* * SCO */ -SYSCTL_NODE(_net_bluetooth, OID_AUTO, sco, CTLFLAG_RW, - 0, "Bluetooth SCO family"); +SYSCTL_NODE(_net_bluetooth, OID_AUTO, sco, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth SCO family"); static int bluetooth_set_sco_rtx_timeout_value(SYSCTL_HANDLER_ARGS) @@ -249,7 +250,7 @@ } /* bluetooth_set_sco_rtx_timeout_value */ SYSCTL_PROC(_net_bluetooth_sco, OID_AUTO, rtx_timeout, - CTLTYPE_INT | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &bluetooth_sco_rtx_timeout_value, 60, bluetooth_set_sco_rtx_timeout_value, "I", "SCO RTX timeout (sec)"); Index: sys/netgraph/bluetooth/socket/ng_btsocket.c =================================================================== --- sys/netgraph/bluetooth/socket/ng_btsocket.c +++ sys/netgraph/bluetooth/socket/ng_btsocket.c @@ -234,14 +234,18 @@ * Socket sysctl tree */ -SYSCTL_NODE(_net_bluetooth_hci, OID_AUTO, sockets, CTLFLAG_RW, - 0, "Bluetooth HCI sockets family"); -SYSCTL_NODE(_net_bluetooth_l2cap, OID_AUTO, sockets, CTLFLAG_RW, - 0, "Bluetooth L2CAP sockets family"); -SYSCTL_NODE(_net_bluetooth_rfcomm, OID_AUTO, sockets, CTLFLAG_RW, - 0, "Bluetooth RFCOMM sockets family"); -SYSCTL_NODE(_net_bluetooth_sco, OID_AUTO, sockets, CTLFLAG_RW, - 0, "Bluetooth SCO sockets family"); +SYSCTL_NODE(_net_bluetooth_hci, OID_AUTO, sockets, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth HCI sockets family"); +SYSCTL_NODE(_net_bluetooth_l2cap, OID_AUTO, sockets, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth L2CAP sockets family"); +SYSCTL_NODE(_net_bluetooth_rfcomm, OID_AUTO, sockets, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth RFCOMM sockets family"); +SYSCTL_NODE(_net_bluetooth_sco, OID_AUTO, sockets, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth SCO sockets family"); /* * Module Index: sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c =================================================================== --- sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c +++ sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c @@ -128,8 +128,9 @@ /* Sysctl tree */ SYSCTL_DECL(_net_bluetooth_hci_sockets); -static SYSCTL_NODE(_net_bluetooth_hci_sockets, OID_AUTO, raw, CTLFLAG_RW, - 0, "Bluetooth raw HCI sockets family"); +static SYSCTL_NODE(_net_bluetooth_hci_sockets, OID_AUTO, raw, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth raw HCI sockets family"); SYSCTL_UINT(_net_bluetooth_hci_sockets_raw, OID_AUTO, debug_level, CTLFLAG_RW, &ng_btsocket_hci_raw_debug_level, NG_BTSOCKET_WARN_LEVEL, "Bluetooth raw HCI sockets debug level"); Index: sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c =================================================================== --- sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c +++ sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c @@ -113,8 +113,9 @@ /* Sysctl tree */ SYSCTL_DECL(_net_bluetooth_l2cap_sockets); -static SYSCTL_NODE(_net_bluetooth_l2cap_sockets, OID_AUTO, seq, CTLFLAG_RW, - 0, "Bluetooth SEQPACKET L2CAP sockets family"); +static SYSCTL_NODE(_net_bluetooth_l2cap_sockets, OID_AUTO, seq, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth SEQPACKET L2CAP sockets family"); SYSCTL_UINT(_net_bluetooth_l2cap_sockets_seq, OID_AUTO, debug_level, CTLFLAG_RW, &ng_btsocket_l2cap_debug_level, NG_BTSOCKET_WARN_LEVEL, Index: sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c =================================================================== --- sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c +++ sys/netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c @@ -128,8 +128,9 @@ /* Sysctl tree */ SYSCTL_DECL(_net_bluetooth_l2cap_sockets); -static SYSCTL_NODE(_net_bluetooth_l2cap_sockets, OID_AUTO, raw, CTLFLAG_RW, - 0, "Bluetooth raw L2CAP sockets family"); +static SYSCTL_NODE(_net_bluetooth_l2cap_sockets, OID_AUTO, raw, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth raw L2CAP sockets family"); SYSCTL_UINT(_net_bluetooth_l2cap_sockets_raw, OID_AUTO, debug_level, CTLFLAG_RW, &ng_btsocket_l2cap_raw_debug_level, NG_BTSOCKET_WARN_LEVEL, Index: sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c =================================================================== --- sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c +++ sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c @@ -205,8 +205,9 @@ /* Sysctl tree */ SYSCTL_DECL(_net_bluetooth_rfcomm_sockets); -static SYSCTL_NODE(_net_bluetooth_rfcomm_sockets, OID_AUTO, stream, CTLFLAG_RW, - 0, "Bluetooth STREAM RFCOMM sockets family"); +static SYSCTL_NODE(_net_bluetooth_rfcomm_sockets, OID_AUTO, stream, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth STREAM RFCOMM sockets family"); SYSCTL_UINT(_net_bluetooth_rfcomm_sockets_stream, OID_AUTO, debug_level, CTLFLAG_RW, &ng_btsocket_rfcomm_debug_level, NG_BTSOCKET_INFO_LEVEL, Index: sys/netgraph/bluetooth/socket/ng_btsocket_sco.c =================================================================== --- sys/netgraph/bluetooth/socket/ng_btsocket_sco.c +++ sys/netgraph/bluetooth/socket/ng_btsocket_sco.c @@ -112,8 +112,9 @@ /* Sysctl tree */ SYSCTL_DECL(_net_bluetooth_sco_sockets); -static SYSCTL_NODE(_net_bluetooth_sco_sockets, OID_AUTO, seq, CTLFLAG_RW, - 0, "Bluetooth SEQPACKET SCO sockets family"); +static SYSCTL_NODE(_net_bluetooth_sco_sockets, OID_AUTO, seq, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Bluetooth SEQPACKET SCO sockets family"); SYSCTL_UINT(_net_bluetooth_sco_sockets_seq, OID_AUTO, debug_level, CTLFLAG_RW, &ng_btsocket_sco_debug_level, NG_BTSOCKET_WARN_LEVEL, Index: sys/netgraph/ng_base.c =================================================================== --- sys/netgraph/ng_base.c +++ sys/netgraph/ng_base.c @@ -3250,7 +3250,8 @@ (NULL) }; DECLARE_MODULE(netgraph, netgraph_mod, SI_SUB_NETGRAPH, SI_ORDER_FIRST); -SYSCTL_NODE(_net, OID_AUTO, graph, CTLFLAG_RW, 0, "netgraph Family"); +SYSCTL_NODE(_net, OID_AUTO, graph, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "netgraph Family"); SYSCTL_INT(_net_graph, OID_AUTO, abi_version, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, NG_ABI_VERSION,""); SYSCTL_INT(_net_graph, OID_AUTO, msg_version, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, NG_VERSION, ""); @@ -3384,8 +3385,10 @@ return (0); } -SYSCTL_PROC(_debug, OID_AUTO, ng_dump_items, CTLTYPE_INT | CTLFLAG_RW, - 0, sizeof(int), sysctl_debug_ng_dump_items, "I", "Number of allocated items"); +SYSCTL_PROC(_debug, OID_AUTO, ng_dump_items, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(int), + sysctl_debug_ng_dump_items, "I", + "Number of allocated items"); #endif /* NETGRAPH_DEBUG */ /*********************************************************************** Index: sys/netgraph/ng_iface.c =================================================================== --- sys/netgraph/ng_iface.c +++ sys/netgraph/ng_iface.c @@ -93,7 +93,7 @@ #define M_NETGRAPH_IFACE M_NETGRAPH #endif -static SYSCTL_NODE(_net_graph, OID_AUTO, iface, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_graph, OID_AUTO, iface, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Point to point netgraph interface"); VNET_DEFINE_STATIC(int, ng_iface_max_nest) = 2; #define V_ng_iface_max_nest VNET(ng_iface_max_nest) Index: sys/netgraph/ng_mppc.c =================================================================== --- sys/netgraph/ng_mppc.c +++ sys/netgraph/ng_mppc.c @@ -107,7 +107,8 @@ */ #define MPPE_MAX_REKEY 1000 -SYSCTL_NODE(_net_graph, OID_AUTO, mppe, CTLFLAG_RW, 0, "MPPE"); +SYSCTL_NODE(_net_graph, OID_AUTO, mppe, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "MPPE"); static int mppe_block_on_max_rekey = 0; SYSCTL_INT(_net_graph_mppe, OID_AUTO, block_on_max_rekey, CTLFLAG_RWTUN, Index: sys/netgraph/ng_pptpgre.c =================================================================== --- sys/netgraph/ng_pptpgre.c +++ sys/netgraph/ng_pptpgre.c @@ -145,7 +145,8 @@ #define SESSHASHSIZE 0x0020 #define SESSHASH(x) (((x) ^ ((x) >> 8)) & (SESSHASHSIZE - 1)) -SYSCTL_NODE(_net_graph, OID_AUTO, pptpgre, CTLFLAG_RW, 0, "PPTPGRE"); +SYSCTL_NODE(_net_graph, OID_AUTO, pptpgre, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "PPTPGRE"); /* * Reorder queue maximum length. Zero disables reorder. Index: sys/netgraph/ng_socket.c =================================================================== --- sys/netgraph/ng_socket.c +++ sys/netgraph/ng_socket.c @@ -1208,8 +1208,10 @@ VNET_DOMAIN_SET(ng); SYSCTL_INT(_net_graph, OID_AUTO, family, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, AF_NETGRAPH, ""); -static SYSCTL_NODE(_net_graph, OID_AUTO, data, CTLFLAG_RW, 0, "DATA"); +static SYSCTL_NODE(_net_graph, OID_AUTO, data, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "DATA"); SYSCTL_INT(_net_graph_data, OID_AUTO, proto, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, NG_DATA, ""); -static SYSCTL_NODE(_net_graph, OID_AUTO, control, CTLFLAG_RW, 0, "CONTROL"); +static SYSCTL_NODE(_net_graph, OID_AUTO, control, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "CONTROL"); SYSCTL_INT(_net_graph_control, OID_AUTO, proto, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, NG_CONTROL, ""); Index: sys/netinet/accf_http.c =================================================================== --- sys/netinet/accf_http.c +++ sys/netinet/accf_http.c @@ -71,8 +71,9 @@ static int parse_http_version = 1; -static SYSCTL_NODE(_net_inet_accf, OID_AUTO, http, CTLFLAG_RW, 0, -"HTTP accept filter"); +static SYSCTL_NODE(_net_inet_accf, OID_AUTO, http, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "HTTP accept filter"); SYSCTL_INT(_net_inet_accf_http, OID_AUTO, parsehttpversion, CTLFLAG_RW, &parse_http_version, 1, "Parse http version so that non 1.x requests work"); Index: sys/netinet/cc/cc.c =================================================================== --- sys/netinet/cc/cc.c +++ sys/netinet/cc/cc.c @@ -317,14 +317,16 @@ SYSINIT(cc, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST, cc_init, NULL); /* Declare sysctl tree and populate it. */ -SYSCTL_NODE(_net_inet_tcp, OID_AUTO, cc, CTLFLAG_RW, NULL, +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, cc, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Congestion control related settings"); SYSCTL_PROC(_net_inet_tcp_cc, OID_AUTO, algorithm, - CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RW, - NULL, 0, cc_default_algo, "A", "Default congestion control algorithm"); + CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, + NULL, 0, cc_default_algo, "A", + "Default congestion control algorithm"); -SYSCTL_PROC(_net_inet_tcp_cc, OID_AUTO, available, CTLTYPE_STRING|CTLFLAG_RD, +SYSCTL_PROC(_net_inet_tcp_cc, OID_AUTO, available, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, cc_list_available, "A", "List available congestion control algorithms"); Index: sys/netinet/cc/cc_cdg.c =================================================================== --- sys/netinet/cc/cc_cdg.c +++ sys/netinet/cc/cc_cdg.c @@ -670,7 +670,7 @@ cdg_init_vnet, NULL); SYSCTL_DECL(_net_inet_tcp_cc_cdg); -SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, cdg, CTLFLAG_RW, NULL, +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, cdg, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "CAIA delay-gradient congestion control related settings"); SYSCTL_STRING(_net_inet_tcp_cc_cdg, OID_AUTO, version, @@ -683,19 +683,19 @@ "alpha_inc RTTs during congestion avoidance mode."); SYSCTL_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_delay, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(cdg_beta_delay), 70, - &cdg_beta_handler, "IU", + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(cdg_beta_delay), 70, &cdg_beta_handler, "IU", "Delay-based window decrease factor as a percentage " "(on delay-based backoff, w = w * beta_delay / 100)"); SYSCTL_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_loss, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(cdg_beta_loss), 50, - &cdg_beta_handler, "IU", + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(cdg_beta_loss), 50, &cdg_beta_handler, "IU", "Loss-based window decrease factor as a percentage " "(on loss-based backoff, w = w * beta_loss / 100)"); SYSCTL_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, exp_backoff_scale, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(cdg_exp_backoff_scale), 2, &cdg_exp_backoff_scale_handler, "IU", "Scaling parameter for the probabilistic exponential backoff"); Index: sys/netinet/cc/cc_chd.c =================================================================== --- sys/netinet/cc/cc_chd.c +++ sys/netinet/cc/cc_chd.c @@ -465,21 +465,21 @@ } SYSCTL_DECL(_net_inet_tcp_cc_chd); -SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, chd, CTLFLAG_RW, NULL, +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, chd, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "CAIA Hamilton delay-based congestion control related settings"); SYSCTL_PROC(_net_inet_tcp_cc_chd, OID_AUTO, loss_fair, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(chd_loss_fair), 1, &chd_loss_fair_handler, "IU", "Flag to enable shadow window functionality."); SYSCTL_PROC(_net_inet_tcp_cc_chd, OID_AUTO, pmax, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(chd_pmax), 5, &chd_pmax_handler, "IU", "Per RTT maximum backoff probability as a percentage"); SYSCTL_PROC(_net_inet_tcp_cc_chd, OID_AUTO, queue_threshold, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(chd_qthresh), 20, &chd_qthresh_handler, "IU", "Queueing congestion threshold in ticks"); Index: sys/netinet/cc/cc_dctcp.c =================================================================== --- sys/netinet/cc/cc_dctcp.c +++ sys/netinet/cc/cc_dctcp.c @@ -446,22 +446,23 @@ } SYSCTL_DECL(_net_inet_tcp_cc_dctcp); -SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, dctcp, CTLFLAG_RW, NULL, +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, dctcp, + CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "dctcp congestion control related settings"); SYSCTL_PROC(_net_inet_tcp_cc_dctcp, OID_AUTO, alpha, - CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(dctcp_alpha), 0, - &dctcp_alpha_handler, - "IU", "dctcp alpha parameter at start of session"); + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(dctcp_alpha), 0, &dctcp_alpha_handler, "IU", + "dctcp alpha parameter at start of session"); SYSCTL_PROC(_net_inet_tcp_cc_dctcp, OID_AUTO, shift_g, - CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(dctcp_shift_g), 4, - &dctcp_shift_g_handler, - "IU", "dctcp shift parameter"); + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(dctcp_shift_g), 4, &dctcp_shift_g_handler, "IU", + "dctcp shift parameter"); SYSCTL_PROC(_net_inet_tcp_cc_dctcp, OID_AUTO, slowstart, - CTLFLAG_VNET|CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(dctcp_slowstart), 0, - &dctcp_slowstart_handler, - "IU", "half CWND reduction after the first slow start"); + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(dctcp_slowstart), 0, &dctcp_slowstart_handler, "IU", + "half CWND reduction after the first slow start"); DECLARE_CC_MODULE(dctcp, &dctcp_cc_algo); Index: sys/netinet/cc/cc_hd.c =================================================================== --- sys/netinet/cc/cc_hd.c +++ sys/netinet/cc/cc_hd.c @@ -232,21 +232,23 @@ } SYSCTL_DECL(_net_inet_tcp_cc_hd); -SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, hd, CTLFLAG_RW, NULL, +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, hd, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Hamilton delay-based congestion control related settings"); SYSCTL_PROC(_net_inet_tcp_cc_hd, OID_AUTO, queue_threshold, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(hd_qthresh), 20, - &hd_qthresh_handler, "IU", "queueing congestion threshold (qth) in ticks"); + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(hd_qthresh), 20, &hd_qthresh_handler, "IU", + "queueing congestion threshold (qth) in ticks"); SYSCTL_PROC(_net_inet_tcp_cc_hd, OID_AUTO, pmax, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(hd_pmax), 5, - &hd_pmax_handler, "IU", + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(hd_pmax), 5, &hd_pmax_handler, "IU", "per packet maximum backoff probability as a percentage"); SYSCTL_PROC(_net_inet_tcp_cc_hd, OID_AUTO, queue_min, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(hd_qmin), 5, - &hd_qmin_handler, "IU", "minimum queueing delay threshold (qmin) in ticks"); + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(hd_qmin), 5, &hd_qmin_handler, "IU", + "minimum queueing delay threshold (qmin) in ticks"); DECLARE_CC_MODULE(hd, &hd_cc_algo); MODULE_DEPEND(hd, ertt, 1, 1, 1); Index: sys/netinet/cc/cc_htcp.c =================================================================== --- sys/netinet/cc/cc_htcp.c +++ sys/netinet/cc/cc_htcp.c @@ -520,8 +520,8 @@ SYSCTL_DECL(_net_inet_tcp_cc_htcp); -SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, htcp, CTLFLAG_RW, - NULL, "H-TCP related settings"); +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, htcp, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "H-TCP related settings"); SYSCTL_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, adaptive_backoff, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(htcp_adaptive_backoff), 0, "enable H-TCP adaptive backoff"); Index: sys/netinet/cc/cc_newreno.c =================================================================== --- sys/netinet/cc/cc_newreno.c +++ sys/netinet/cc/cc_newreno.c @@ -381,17 +381,18 @@ } SYSCTL_DECL(_net_inet_tcp_cc_newreno); -SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, newreno, CTLFLAG_RW, NULL, +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, newreno, + CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "New Reno related settings"); SYSCTL_PROC(_net_inet_tcp_cc_newreno, OID_AUTO, beta, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, - &VNET_NAME(newreno_beta), 3, &newreno_beta_handler, "IU", - "New Reno beta, specified as number between 1 and 100"); + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(newreno_beta), 3, &newreno_beta_handler, "IU", + "New Reno beta, specified as number between 1 and 100"); SYSCTL_PROC(_net_inet_tcp_cc_newreno, OID_AUTO, beta_ecn, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, - &VNET_NAME(newreno_beta_ecn), 3, &newreno_beta_handler, "IU", - "New Reno beta ecn, specified as number between 1 and 100"); + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(newreno_beta_ecn), 3, &newreno_beta_handler, "IU", + "New Reno beta ecn, specified as number between 1 and 100"); DECLARE_CC_MODULE(newreno, &newreno_cc_algo); Index: sys/netinet/cc/cc_vegas.c =================================================================== --- sys/netinet/cc/cc_vegas.c +++ sys/netinet/cc/cc_vegas.c @@ -286,16 +286,17 @@ } SYSCTL_DECL(_net_inet_tcp_cc_vegas); -SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, vegas, CTLFLAG_RW, NULL, +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, vegas, + CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Vegas related settings"); SYSCTL_PROC(_net_inet_tcp_cc_vegas, OID_AUTO, alpha, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(vegas_alpha), 1, &vegas_alpha_handler, "IU", "vegas alpha, specified as number of \"buffers\" (0 < alpha < beta)"); SYSCTL_PROC(_net_inet_tcp_cc_vegas, OID_AUTO, beta, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(vegas_beta), 3, &vegas_beta_handler, "IU", "vegas beta, specified as number of \"buffers\" (0 < alpha < beta)"); Index: sys/netinet/if_ether.c =================================================================== --- sys/netinet/if_ether.c +++ sys/netinet/if_ether.c @@ -91,8 +91,12 @@ }; SYSCTL_DECL(_net_link_ether); -static SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, ""); -static SYSCTL_NODE(_net_link_ether, PF_ARP, arp, CTLFLAG_RW, 0, ""); +static SYSCTL_NODE(_net_link_ether, PF_INET, inet, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + ""); +static SYSCTL_NODE(_net_link_ether, PF_ARP, arp, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + ""); /* timer values */ VNET_DEFINE_STATIC(int, arpt_keep) = (20*60); /* once resolved, good for 20 Index: sys/netinet/in_mcast.c =================================================================== --- sys/netinet/in_mcast.c +++ sys/netinet/in_mcast.c @@ -177,7 +177,8 @@ static int inp_set_source_filters(struct inpcb *, struct sockopt *); static int sysctl_ip_mcast_filters(SYSCTL_HANDLER_ARGS); -static SYSCTL_NODE(_net_inet_ip, OID_AUTO, mcast, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_inet_ip, OID_AUTO, mcast, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "IPv4 multicast"); static u_long in_mcast_maxgrpsrc = IP_MAX_GROUP_SRC_FILTER; Index: sys/netinet/in_pcb.c =================================================================== --- sys/netinet/in_pcb.c +++ sys/netinet/in_pcb.c @@ -172,27 +172,34 @@ #undef RANGECHK -static SYSCTL_NODE(_net_inet_ip, IPPROTO_IP, portrange, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_inet_ip, IPPROTO_IP, portrange, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "IP Ports"); SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowfirst, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, - &VNET_NAME(ipport_lowfirstauto), 0, &sysctl_net_ipport_check, "I", ""); + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(ipport_lowfirstauto), 0, &sysctl_net_ipport_check, "I", + ""); SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowlast, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, - &VNET_NAME(ipport_lowlastauto), 0, &sysctl_net_ipport_check, "I", ""); + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(ipport_lowlastauto), 0, &sysctl_net_ipport_check, "I", + ""); SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, first, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, - &VNET_NAME(ipport_firstauto), 0, &sysctl_net_ipport_check, "I", ""); + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(ipport_firstauto), 0, &sysctl_net_ipport_check, "I", + ""); SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, last, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, - &VNET_NAME(ipport_lastauto), 0, &sysctl_net_ipport_check, "I", ""); + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(ipport_lastauto), 0, &sysctl_net_ipport_check, "I", + ""); SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hifirst, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, - &VNET_NAME(ipport_hifirstauto), 0, &sysctl_net_ipport_check, "I", ""); + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(ipport_hifirstauto), 0, &sysctl_net_ipport_check, "I", + ""); SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hilast, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, - &VNET_NAME(ipport_hilastauto), 0, &sysctl_net_ipport_check, "I", ""); + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(ipport_hilastauto), 0, &sysctl_net_ipport_check, "I", + ""); SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, reservedhigh, CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(ipport_reservedhigh), 0, ""); @@ -216,7 +223,7 @@ counter_u64_t rate_limit_alloc_fail; counter_u64_t rate_limit_set_ok; -static SYSCTL_NODE(_net_inet_ip, OID_AUTO, rl, CTLFLAG_RD, 0, +static SYSCTL_NODE(_net_inet_ip, OID_AUTO, rl, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "IP Rate Limiting"); SYSCTL_COUNTER_U64(_net_inet_ip_rl, OID_AUTO, active, CTLFLAG_RD, &rate_limit_active, "Active rate limited connections"); Index: sys/netinet/in_proto.c =================================================================== --- sys/netinet/in_proto.c +++ sys/netinet/in_proto.c @@ -320,25 +320,37 @@ VNET_DOMAIN_SET(inet); #endif /* INET */ -SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW, 0, - "Internet Family"); +SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Internet Family"); -SYSCTL_NODE(_net_inet, IPPROTO_IP, ip, CTLFLAG_RW, 0, "IP"); -SYSCTL_NODE(_net_inet, IPPROTO_ICMP, icmp, CTLFLAG_RW, 0, "ICMP"); -SYSCTL_NODE(_net_inet, IPPROTO_UDP, udp, CTLFLAG_RW, 0, "UDP"); -SYSCTL_NODE(_net_inet, IPPROTO_TCP, tcp, CTLFLAG_RW, 0, "TCP"); +SYSCTL_NODE(_net_inet, IPPROTO_IP, ip, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "IP"); +SYSCTL_NODE(_net_inet, IPPROTO_ICMP, icmp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ICMP"); +SYSCTL_NODE(_net_inet, IPPROTO_UDP, udp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "UDP"); +SYSCTL_NODE(_net_inet, IPPROTO_TCP, tcp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TCP"); #ifdef SCTP -SYSCTL_NODE(_net_inet, IPPROTO_SCTP, sctp, CTLFLAG_RW, 0, "SCTP"); +SYSCTL_NODE(_net_inet, IPPROTO_SCTP, sctp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "SCTP"); #endif -SYSCTL_NODE(_net_inet, IPPROTO_IGMP, igmp, CTLFLAG_RW, 0, "IGMP"); +SYSCTL_NODE(_net_inet, IPPROTO_IGMP, igmp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "IGMP"); #if defined(IPSEC) || defined(IPSEC_SUPPORT) /* XXX no protocol # to use, pick something "reserved" */ -SYSCTL_NODE(_net_inet, 253, ipsec, CTLFLAG_RW, 0, "IPSEC"); -SYSCTL_NODE(_net_inet, IPPROTO_AH, ah, CTLFLAG_RW, 0, "AH"); -SYSCTL_NODE(_net_inet, IPPROTO_ESP, esp, CTLFLAG_RW, 0, "ESP"); -SYSCTL_NODE(_net_inet, IPPROTO_IPCOMP, ipcomp, CTLFLAG_RW, 0, "IPCOMP"); -SYSCTL_NODE(_net_inet, IPPROTO_IPIP, ipip, CTLFLAG_RW, 0, "IPIP"); +SYSCTL_NODE(_net_inet, 253, ipsec, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "IPSEC"); +SYSCTL_NODE(_net_inet, IPPROTO_AH, ah, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "AH"); +SYSCTL_NODE(_net_inet, IPPROTO_ESP, esp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ESP"); +SYSCTL_NODE(_net_inet, IPPROTO_IPCOMP, ipcomp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "IPCOMP"); +SYSCTL_NODE(_net_inet, IPPROTO_IPIP, ipip, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "IPIP"); #endif /* IPSEC */ -SYSCTL_NODE(_net_inet, IPPROTO_RAW, raw, CTLFLAG_RW, 0, "RAW"); -SYSCTL_NODE(_net_inet, OID_AUTO, accf, CTLFLAG_RW, 0, +SYSCTL_NODE(_net_inet, IPPROTO_RAW, raw, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "RAW"); +SYSCTL_NODE(_net_inet, OID_AUTO, accf, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Accept filters"); Index: sys/netinet/ip_divert.c =================================================================== --- sys/netinet/ip_divert.c +++ sys/netinet/ip_divert.c @@ -737,10 +737,13 @@ } #ifdef SYSCTL_NODE -static SYSCTL_NODE(_net_inet, IPPROTO_DIVERT, divert, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_inet, IPPROTO_DIVERT, divert, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "IPDIVERT"); -SYSCTL_PROC(_net_inet_divert, OID_AUTO, pcblist, CTLTYPE_OPAQUE | CTLFLAG_RD, - NULL, 0, div_pcblist, "S,xinpcb", "List of active divert sockets"); +SYSCTL_PROC(_net_inet_divert, OID_AUTO, pcblist, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, div_pcblist, "S,xinpcb", + "List of active divert sockets"); #endif struct pr_usrreqs div_usrreqs = { Index: sys/netinet/ip_id.c =================================================================== --- sys/netinet/ip_id.c +++ sys/netinet/ip_id.c @@ -137,14 +137,14 @@ SYSCTL_DECL(_net_inet_ip); SYSCTL_PROC(_net_inet_ip, OID_AUTO, random_id, - CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW, + CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_MPSAFE, &VNET_NAME(ip_do_randomid), 0, sysctl_ip_randomid, "IU", "Assign random ip_id values"); SYSCTL_INT(_net_inet_ip, OID_AUTO, rfc6864, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_rfc6864), 0, "Use constant IP ID for atomic datagrams"); SYSCTL_PROC(_net_inet_ip, OID_AUTO, random_id_period, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_VNET, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_VNET | CTLFLAG_MPSAFE, &VNET_NAME(array_size), 0, sysctl_ip_id_change, "IU", "IP ID Array size"); SYSCTL_INT(_net_inet_ip, OID_AUTO, random_id_collisions, CTLFLAG_RD | CTLFLAG_VNET, Index: sys/netinet/ip_input.c =================================================================== --- sys/netinet/ip_input.c +++ sys/netinet/ip_input.c @@ -230,7 +230,8 @@ return (netisr_setqlimit(&ip_nh, qlimit)); } SYSCTL_PROC(_net_inet_ip, IPCTL_INTRQMAXLEN, intr_queue_maxlen, - CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet_intr_queue_maxlen, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + sysctl_netinet_intr_queue_maxlen, "I", "Maximum size of the IP input queue"); static int @@ -251,7 +252,8 @@ } SYSCTL_PROC(_net_inet_ip, IPCTL_INTRQDROPS, intr_queue_drops, - CTLTYPE_INT|CTLFLAG_RD, 0, 0, sysctl_netinet_intr_queue_drops, "I", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, 0, sysctl_netinet_intr_queue_drops, "I", "Number of packets dropped from the IP input queue"); #ifdef RSS @@ -269,7 +271,8 @@ return (netisr_setqlimit(&ip_direct_nh, qlimit)); } SYSCTL_PROC(_net_inet_ip, IPCTL_INTRDQMAXLEN, intr_direct_queue_maxlen, - CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet_intr_direct_queue_maxlen, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + 0, 0, sysctl_netinet_intr_direct_queue_maxlen, "I", "Maximum size of the IP direct input queue"); static int @@ -290,7 +293,8 @@ } SYSCTL_PROC(_net_inet_ip, IPCTL_INTRDQDROPS, intr_direct_queue_drops, - CTLTYPE_INT|CTLFLAG_RD, 0, 0, sysctl_netinet_intr_direct_queue_drops, "I", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, + sysctl_netinet_intr_direct_queue_drops, "I", "Number of packets dropped from the IP direct input queue"); #endif /* RSS */ Index: sys/netinet/ip_mroute.c =================================================================== --- sys/netinet/ip_mroute.c +++ sys/netinet/ip_mroute.c @@ -237,7 +237,8 @@ VNET_PCPUSTAT_SYSINIT(pimstat); VNET_PCPUSTAT_SYSUNINIT(pimstat); -SYSCTL_NODE(_net_inet, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM"); +SYSCTL_NODE(_net_inet, IPPROTO_PIM, pim, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "PIM"); SYSCTL_VNET_PCPUSTAT(_net_inet_pim, PIMCTL_STATS, stats, struct pimstat, pimstat, "PIM Statistics (struct pimstat, netinet/pim_var.h)"); @@ -2797,8 +2798,9 @@ return (error); } -static SYSCTL_NODE(_net_inet_ip, OID_AUTO, mfctable, CTLFLAG_RD, - sysctl_mfctable, "IPv4 Multicast Forwarding Table " +static SYSCTL_NODE(_net_inet_ip, OID_AUTO, mfctable, + CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_mfctable, + "IPv4 Multicast Forwarding Table " "(struct *mfc[mfchashsize], netinet/ip_mroute.h)"); static void Index: sys/netinet/ip_reass.c =================================================================== --- sys/netinet/ip_reass.c +++ sys/netinet/ip_reass.c @@ -147,8 +147,9 @@ VNET_DEFINE_STATIC(uma_zone_t, ipq_zone); #define V_ipq_zone VNET(ipq_zone) -SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxfragpackets, CTLFLAG_VNET | - CTLTYPE_INT | CTLFLAG_RW, NULL, 0, sysctl_maxfragpackets, "I", +SYSCTL_PROC(_net_inet_ip, OID_AUTO, maxfragpackets, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + NULL, 0, sysctl_maxfragpackets, "I", "Maximum number of IPv4 fragment reassembly queue entries"); SYSCTL_UMA_CUR(_net_inet_ip, OID_AUTO, fragpackets, CTLFLAG_VNET, &VNET_NAME(ipq_zone), Index: sys/netinet/libalias/alias.c =================================================================== --- sys/netinet/libalias/alias.c +++ sys/netinet/libalias/alias.c @@ -153,7 +153,8 @@ SYSCTL_DECL(_net_inet); SYSCTL_DECL(_net_inet_ip); -SYSCTL_NODE(_net_inet_ip, OID_AUTO, alias, CTLFLAG_RW, NULL, "Libalias sysctl API"); +SYSCTL_NODE(_net_inet_ip, OID_AUTO, alias, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "Libalias sysctl API"); #endif Index: sys/netinet/netdump/netdump_client.c =================================================================== --- sys/netinet/netdump/netdump_client.c +++ sys/netinet/netdump/netdump_client.c @@ -131,15 +131,17 @@ FEATURE(netdump, "Netdump client support"); -static SYSCTL_NODE(_net, OID_AUTO, netdump, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_net, OID_AUTO, netdump, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "netdump parameters"); static int nd_debug; SYSCTL_INT(_net_netdump, OID_AUTO, debug, CTLFLAG_RWTUN, &nd_debug, 0, "Debug message verbosity"); -SYSCTL_PROC(_net_netdump, OID_AUTO, enabled, CTLFLAG_RD | CTLTYPE_INT, NULL, 0, - netdump_enabled_sysctl, "I", "netdump configuration status"); +SYSCTL_PROC(_net_netdump, OID_AUTO, enabled, + CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_MPSAFE, NULL, 0, + netdump_enabled_sysctl, "I", + "netdump configuration status"); static char nd_path[MAXPATHLEN]; SYSCTL_STRING(_net_netdump, OID_AUTO, path, CTLFLAG_RW, nd_path, sizeof(nd_path), Index: sys/netinet/raw_ip.c =================================================================== --- sys/netinet/raw_ip.c +++ sys/netinet/raw_ip.c @@ -1137,8 +1137,9 @@ } SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX*/, pcblist, - CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, - rip_pcblist, "S,xinpcb", "List of active raw IP sockets"); + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + rip_pcblist, "S,xinpcb", + "List of active raw IP sockets"); #ifdef INET struct pr_usrreqs rip_usrreqs = { Index: sys/netinet/siftr.c =================================================================== --- sys/netinet/siftr.c +++ sys/netinet/siftr.c @@ -300,16 +300,18 @@ SYSCTL_DECL(_net_inet_siftr); -SYSCTL_NODE(_net_inet, OID_AUTO, siftr, CTLFLAG_RW, NULL, +SYSCTL_NODE(_net_inet, OID_AUTO, siftr, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "siftr related settings"); -SYSCTL_PROC(_net_inet_siftr, OID_AUTO, enabled, CTLTYPE_UINT|CTLFLAG_RW, +SYSCTL_PROC(_net_inet_siftr, OID_AUTO, enabled, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &siftr_enabled, 0, &siftr_sysctl_enabled_handler, "IU", "switch siftr module operations on/off"); -SYSCTL_PROC(_net_inet_siftr, OID_AUTO, logfile, CTLTYPE_STRING|CTLFLAG_RW, - &siftr_logfile_shadow, sizeof(siftr_logfile_shadow), &siftr_sysctl_logfile_name_handler, - "A", "file to save siftr log messages to"); +SYSCTL_PROC(_net_inet_siftr, OID_AUTO, logfile, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &siftr_logfile_shadow, + sizeof(siftr_logfile_shadow), &siftr_sysctl_logfile_name_handler, "A", + "file to save siftr log messages to"); SYSCTL_UINT(_net_inet_siftr, OID_AUTO, ppl, CTLFLAG_RW, &siftr_pkts_per_log, 1, Index: sys/netinet/tcp_fastopen.c =================================================================== --- sys/netinet/tcp_fastopen.c +++ sys/netinet/tcp_fastopen.c @@ -255,7 +255,8 @@ static void tcp_fastopen_ccache_entry_drop(struct tcp_fastopen_ccache_entry *, struct tcp_fastopen_ccache_bucket *); -SYSCTL_NODE(_net_inet_tcp, OID_AUTO, fastopen, CTLFLAG_RW, 0, "TCP Fast Open"); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, fastopen, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TCP Fast Open"); VNET_DEFINE_STATIC(int, tcp_fastopen_acceptany) = 0; #define V_tcp_fastopen_acceptany VNET(tcp_fastopen_acceptany) @@ -267,14 +268,14 @@ #define V_tcp_fastopen_autokey VNET(tcp_fastopen_autokey) static int sysctl_net_inet_tcp_fastopen_autokey(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, autokey, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, - &sysctl_net_inet_tcp_fastopen_autokey, "IU", + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, + NULL, 0, &sysctl_net_inet_tcp_fastopen_autokey, "IU", "Number of seconds between auto-generation of a new key; zero disables"); static int sysctl_net_inet_tcp_fastopen_ccache_bucket_limit(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, ccache_bucket_limit, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RWTUN, NULL, 0, - &sysctl_net_inet_tcp_fastopen_ccache_bucket_limit, "IU", + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, + NULL, 0, &sysctl_net_inet_tcp_fastopen_ccache_bucket_limit, "IU", "Max entries per bucket in client cookie cache"); VNET_DEFINE_STATIC(unsigned int, tcp_fastopen_ccache_buckets) = @@ -287,8 +288,8 @@ VNET_DEFINE(unsigned int, tcp_fastopen_client_enable) = 1; static int sysctl_net_inet_tcp_fastopen_client_enable(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, client_enable, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, - &sysctl_net_inet_tcp_fastopen_client_enable, "IU", + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + NULL, 0, &sysctl_net_inet_tcp_fastopen_client_enable, "IU", "Enable/disable TCP Fast Open client functionality"); SYSCTL_INT(_net_inet_tcp_fastopen, OID_AUTO, keylen, @@ -326,33 +327,33 @@ #define V_tcp_fastopen_psk_enable VNET(tcp_fastopen_psk_enable) static int sysctl_net_inet_tcp_fastopen_psk_enable(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, psk_enable, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, - &sysctl_net_inet_tcp_fastopen_psk_enable, "IU", + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, + NULL, 0, &sysctl_net_inet_tcp_fastopen_psk_enable, "IU", "Enable/disable TCP Fast Open server pre-shared key mode"); VNET_DEFINE(unsigned int, tcp_fastopen_server_enable) = 0; static int sysctl_net_inet_tcp_fastopen_server_enable(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, server_enable, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, NULL, 0, - &sysctl_net_inet_tcp_fastopen_server_enable, "IU", + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, + NULL, 0, &sysctl_net_inet_tcp_fastopen_server_enable, "IU", "Enable/disable TCP Fast Open server functionality"); static int sysctl_net_inet_tcp_fastopen_setkey(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, setkey, - CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_WR, NULL, 0, - &sysctl_net_inet_tcp_fastopen_setkey, "", + CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_WR | CTLFLAG_MPSAFE, + NULL, 0, &sysctl_net_inet_tcp_fastopen_setkey, "", "Install a new key"); static int sysctl_net_inet_tcp_fastopen_setpsk(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, setpsk, - CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_WR, NULL, 0, - &sysctl_net_inet_tcp_fastopen_setpsk, "", + CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_WR | CTLFLAG_MPSAFE, + NULL, 0, &sysctl_net_inet_tcp_fastopen_setpsk, "", "Install a new pre-shared key"); static int sysctl_net_inet_tcp_fastopen_ccache_list(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_net_inet_tcp_fastopen, OID_AUTO, ccache_list, - CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP, NULL, 0, - sysctl_net_inet_tcp_fastopen_ccache_list, "A", + CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_MPSAFE, + NULL, 0, sysctl_net_inet_tcp_fastopen_ccache_list, "A", "List of all client cookie cache entries"); VNET_DEFINE_STATIC(struct rmlock, tcp_fastopen_keylock); Index: sys/netinet/tcp_hostcache.c =================================================================== --- sys/netinet/tcp_hostcache.c +++ sys/netinet/tcp_hostcache.c @@ -125,7 +125,8 @@ static void tcp_hc_purge_internal(int); static void tcp_hc_purge(void *); -static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hostcache, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hostcache, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP Host cache"); VNET_DEFINE(int, tcp_use_hostcache) = 1; @@ -163,12 +164,14 @@ "Expire all entires on next purge run"); SYSCTL_PROC(_net_inet_tcp_hostcache, OID_AUTO, list, - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP, 0, 0, - sysctl_tcp_hc_list, "A", "List of all hostcache entries"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_MPSAFE, + 0, 0, sysctl_tcp_hc_list, "A", + "List of all hostcache entries"); SYSCTL_PROC(_net_inet_tcp_hostcache, OID_AUTO, purgenow, - CTLTYPE_INT | CTLFLAG_RW, NULL, 0, - sysctl_tcp_hc_purgenow, "I", "Immediately purge all entries"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + NULL, 0, sysctl_tcp_hc_purgenow, "I", + "Immediately purge all entries"); static MALLOC_DEFINE(M_HOSTCACHE, "hostcache", "TCP hostcache"); Index: sys/netinet/tcp_hpts.c =================================================================== --- sys/netinet/tcp_hpts.c +++ sys/netinet/tcp_hpts.c @@ -203,7 +203,8 @@ int32_t tcp_min_hptsi_time = DEFAULT_MIN_SLEEP; static int32_t tcp_hpts_callout_skip_swi = 0; -SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hpts, CTLFLAG_RW, 0, "TCP Hpts controls"); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hpts, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TCP Hpts controls"); #define timersub(tvp, uvp, vvp) \ do { \ @@ -293,7 +294,7 @@ } SYSCTL_PROC(_net_inet_tcp_hpts, OID_AUTO, maxsleep, - CTLTYPE_UINT | CTLFLAG_RW, + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &hpts_sleep_max, 0, &sysctl_net_inet_tcp_hpts_max_sleep, "IU", "Maximum time hpts will sleep"); @@ -1903,7 +1904,7 @@ SYSCTL_STATIC_CHILDREN(_net_inet_tcp_hpts), OID_AUTO, unit, - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); SYSCTL_ADD_INT(&hpts->hpts_ctx, SYSCTL_CHILDREN(hpts->hpts_root), Index: sys/netinet/tcp_input.c =================================================================== --- sys/netinet/tcp_input.c +++ sys/netinet/tcp_input.c @@ -188,7 +188,9 @@ &VNET_NAME(tcp_abc_l_var), 2, "Cap the max cwnd increment during slow-start to this number of segments"); -static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, CTLFLAG_RW, 0, "TCP ECN"); +static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, ecn, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TCP ECN"); VNET_DEFINE(int, tcp_do_ecn) = 2; SYSCTL_INT(_net_inet_tcp_ecn, OID_AUTO, enable, CTLFLAG_VNET | CTLFLAG_RW, Index: sys/netinet/tcp_log_buf.c =================================================================== --- sys/netinet/tcp_log_buf.c +++ sys/netinet/tcp_log_buf.c @@ -82,7 +82,8 @@ RB_PROTOTYPE_STATIC(tcp_log_id_tree, tcp_log_id_bucket, tlb_rb, tcp_log_id_cmp) -SYSCTL_NODE(_net_inet_tcp, OID_AUTO, bb, CTLFLAG_RW, 0, "TCP Black Box controls"); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, bb, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TCP Black Box controls"); SYSCTL_BOOL(_net_inet_tcp_bb, OID_AUTO, log_verbose, CTLFLAG_RW, &tcp_log_verbose, 0, "Force verbose logging for TCP traces"); Index: sys/netinet/tcp_ratelimit.c =================================================================== --- sys/netinet/tcp_ratelimit.c +++ sys/netinet/tcp_ratelimit.c @@ -131,7 +131,7 @@ uint32_t rs_number_alive; uint32_t rs_number_dead; -SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rl, CTLFLAG_RW, 0, +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, rl, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP Ratelimit stats"); SYSCTL_UINT(_net_inet_tcp_rl, OID_AUTO, alive, CTLFLAG_RW, &rs_number_alive, 0, @@ -205,7 +205,7 @@ SYSCTL_CHILDREN(rl_sysctl_root), OID_AUTO, "rate", - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Ratelist"); for( i = 0; i < rs->rs_rate_cnt; i++) { sprintf(rate_num, "%d", i); @@ -213,7 +213,7 @@ SYSCTL_CHILDREN(rl_rates), OID_AUTO, rate_num, - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Individual Rate"); SYSCTL_ADD_U32(&rs->sysctl_ctx, SYSCTL_CHILDREN(rl_rate_num), @@ -407,7 +407,7 @@ SYSCTL_STATIC_CHILDREN(_net_inet_tcp_rl), OID_AUTO, rs->rs_ifp->if_xname, - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); mtx_lock(&rs_mtx); @@ -425,7 +425,7 @@ SYSCTL_STATIC_CHILDREN(_net_inet_tcp_rl), OID_AUTO, rs->rs_ifp->if_xname, - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); mtx_lock(&rs_mtx); @@ -580,7 +580,7 @@ SYSCTL_STATIC_CHILDREN(_net_inet_tcp_rl), OID_AUTO, rs->rs_ifp->if_xname, - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); rl_add_syctl_entries(rl_sysctl_root, rs); mtx_lock(&rs_mtx); Index: sys/netinet/tcp_reass.c =================================================================== --- sys/netinet/tcp_reass.c +++ sys/netinet/tcp_reass.c @@ -98,10 +98,12 @@ #define TCP_R_LOG_DUMP 10 #define TCP_R_LOG_TRIM 11 -static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP Segment Reassembly Queue"); -static SYSCTL_NODE(_net_inet_tcp_reass, OID_AUTO, stats, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_inet_tcp_reass, OID_AUTO, stats, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP Segment Reassembly stats"); Index: sys/netinet/tcp_sack.c =================================================================== --- sys/netinet/tcp_sack.c +++ sys/netinet/tcp_sack.c @@ -128,7 +128,8 @@ VNET_DECLARE(struct uma_zone *, sack_hole_zone); #define V_sack_hole_zone VNET(sack_hole_zone) -SYSCTL_NODE(_net_inet_tcp, OID_AUTO, sack, CTLFLAG_RW, 0, "TCP SACK"); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, sack, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TCP SACK"); VNET_DEFINE(int, tcp_do_sack) = 1; #define V_tcp_do_sack VNET(tcp_do_sack) SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, enable, CTLFLAG_VNET | CTLFLAG_RW, Index: sys/netinet/tcp_stacks/bbr.c =================================================================== --- sys/netinet/tcp_stacks/bbr.c +++ sys/netinet/tcp_stacks/bbr.c @@ -1190,7 +1190,7 @@ SYSCTL_CHILDREN(bbr_sysctl_root), OID_AUTO, "probertt", - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); SYSCTL_ADD_S32(&bbr_sysctl_ctx, SYSCTL_CHILDREN(bbr_probertt), @@ -1258,7 +1258,7 @@ SYSCTL_CHILDREN(bbr_sysctl_root), OID_AUTO, "pacing", - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); SYSCTL_ADD_U32(&bbr_sysctl_ctx, SYSCTL_CHILDREN(bbr_hptsi), @@ -1360,7 +1360,7 @@ SYSCTL_CHILDREN(bbr_sysctl_root), OID_AUTO, "measure", - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Measurement controls"); SYSCTL_ADD_U32(&bbr_sysctl_ctx, SYSCTL_CHILDREN(bbr_measure), @@ -1427,7 +1427,7 @@ SYSCTL_CHILDREN(bbr_sysctl_root), OID_AUTO, "states", - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "State controls"); SYSCTL_ADD_S32(&bbr_sysctl_ctx, SYSCTL_CHILDREN(bbr_states), @@ -1519,7 +1519,7 @@ SYSCTL_CHILDREN(bbr_sysctl_root), OID_AUTO, "startup", - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Startup controls"); SYSCTL_ADD_S32(&bbr_sysctl_ctx, SYSCTL_CHILDREN(bbr_startup), @@ -1556,7 +1556,7 @@ SYSCTL_CHILDREN(bbr_sysctl_root), OID_AUTO, "cwnd", - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Cwnd controls"); SYSCTL_ADD_S32(&bbr_sysctl_ctx, SYSCTL_CHILDREN(bbr_cwnd), @@ -1629,7 +1629,7 @@ SYSCTL_CHILDREN(bbr_sysctl_root), OID_AUTO, "timeout", - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Time out controls"); SYSCTL_ADD_S32(&bbr_sysctl_ctx, SYSCTL_CHILDREN(bbr_timeout), @@ -1701,7 +1701,7 @@ SYSCTL_CHILDREN(bbr_sysctl_root), OID_AUTO, "policer", - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Policer controls"); SYSCTL_ADD_S32(&bbr_sysctl_ctx, SYSCTL_CHILDREN(bbr_policer), @@ -15135,7 +15135,7 @@ #else __XSTRING(STACKNAME), #endif - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); if (bbr_sysctl_root == NULL) { printf("Failed to add sysctl node\n"); Index: sys/netinet/tcp_stacks/rack.c =================================================================== --- sys/netinet/tcp_stacks/rack.c +++ sys/netinet/tcp_stacks/rack.c @@ -668,7 +668,7 @@ SYSCTL_CHILDREN(rack_sysctl_root), OID_AUTO, "stats", - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Rack Counters"); rack_badfr = counter_u64_alloc(M_WAITOK); SYSCTL_ADD_COUNTER_U64(&rack_sysctl_ctx, @@ -874,7 +874,7 @@ SYSCTL_CHILDREN(rack_sysctl_root), OID_AUTO, "sack_attack", - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Rack Sack Attack Counters and Controls"); SYSCTL_ADD_U32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_attack), @@ -10512,7 +10512,7 @@ #else __XSTRING(STACKNAME), #endif - CTLFLAG_RW, 0, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); if (rack_sysctl_root == NULL) { printf("Failed to add sysctl node\n"); Index: sys/netinet/tcp_stats.c =================================================================== --- sys/netinet/tcp_stats.c +++ sys/netinet/tcp_stats.c @@ -79,7 +79,7 @@ "Enable per-connection TCP stats gathering; 1 enables for all connections, " "2 enables random sampling across log id connection groups"); SYSCTL_PROC(_net_inet_tcp, OID_AUTO, perconn_stats_sample_rates, - CTLTYPE_STRING | CTLFLAG_RW, tcp_stats_tpl_sr_cb, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, tcp_stats_tpl_sr_cb, sizeof(struct rm_priotracker), stats_tpl_sample_rates, "A", "TCP stats per template random sampling rates, in CSV tpl_spec=percent " "key-value pairs (see stats(9) for template spec details)"); Index: sys/netinet/tcp_subr.c =================================================================== --- sys/netinet/tcp_subr.c +++ sys/netinet/tcp_subr.c @@ -140,7 +140,8 @@ #ifdef NETFLIX_EXP_DETECTION /* Sack attack detection thresholds and such */ -SYSCTL_NODE(_net_inet_tcp, OID_AUTO, sack_attack, CTLFLAG_RW, 0, +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, sack_attack, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Sack Attack detection thresholds"); int32_t tcp_force_detection = 0; SYSCTL_INT(_net_inet_tcp_sack_attack, OID_AUTO, force_detection, @@ -209,8 +210,8 @@ } SYSCTL_PROC(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, &VNET_NAME(tcp_mssdflt), 0, - &sysctl_net_inet_tcp_mss_check, "I", + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(tcp_mssdflt), 0, &sysctl_net_inet_tcp_mss_check, "I", "Default TCP Maximum Segment Size"); #ifdef INET6 @@ -231,8 +232,8 @@ } SYSCTL_PROC(_net_inet_tcp, TCPCTL_V6MSSDFLT, v6mssdflt, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, &VNET_NAME(tcp_v6mssdflt), 0, - &sysctl_net_inet_tcp_mss_v6_check, "I", + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &VNET_NAME(tcp_v6mssdflt), 0, &sysctl_net_inet_tcp_mss_v6_check, "I", "Default TCP Maximum Segment Size for IPv6"); #endif /* INET6 */ @@ -311,7 +312,7 @@ return (error); } SYSCTL_PROC(_net_inet_tcp, OID_AUTO, map_limit, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(tcp_map_entries_limit), 0, &sysctl_net_inet_tcp_map_limit_check, "IU", "Total sendmap entries limit"); @@ -532,9 +533,9 @@ } SYSCTL_PROC(_net_inet_tcp, OID_AUTO, functions_default, - CTLTYPE_STRING | CTLFLAG_RW, - NULL, 0, sysctl_net_inet_default_tcp_functions, "A", - "Set/get the default TCP functions"); + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + NULL, 0, sysctl_net_inet_default_tcp_functions, "A", + "Set/get the default TCP functions"); static int sysctl_net_inet_list_available(SYSCTL_HANDLER_ARGS) @@ -588,9 +589,9 @@ } SYSCTL_PROC(_net_inet_tcp, OID_AUTO, functions_available, - CTLTYPE_STRING|CTLFLAG_RD, - NULL, 0, sysctl_net_inet_list_available, "A", - "list available TCP Function sets"); + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + NULL, 0, sysctl_net_inet_list_available, "A", + "list available TCP Function sets"); /* * Exports one (struct tcp_function_info) for each alias/name. @@ -2315,8 +2316,9 @@ } SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, - CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, - tcp_pcblist, "S,xtcpcb", "List of active TCP connections"); + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + NULL, 0, tcp_pcblist, "S,xtcpcb", + "List of active TCP connections"); #ifdef INET static int @@ -2354,8 +2356,9 @@ } SYSCTL_PROC(_net_inet_tcp, OID_AUTO, getcred, - CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, - tcp_getcred, "S,xucred", "Get the xucred of a TCP connection"); + CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_NEEDGIANT, + 0, 0, tcp_getcred, "S,xucred", + "Get the xucred of a TCP connection"); #endif /* INET */ #ifdef INET6 @@ -2421,8 +2424,9 @@ } SYSCTL_PROC(_net_inet6_tcp6, OID_AUTO, getcred, - CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, - tcp6_getcred, "S,xucred", "Get the xucred of a TCP6 connection"); + CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_NEEDGIANT, + 0, 0, tcp6_getcred, "S,xucred", + "Get the xucred of a TCP6 connection"); #endif /* INET6 */ @@ -3153,8 +3157,9 @@ } SYSCTL_PROC(_net_inet_tcp, TCPCTL_DROP, drop, - CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_WR | CTLFLAG_SKIP, NULL, - 0, sysctl_drop, "", "Drop TCP connection"); + CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_WR | CTLFLAG_SKIP | + CTLFLAG_NEEDGIANT, NULL, 0, sysctl_drop, "", + "Drop TCP connection"); #ifdef KERN_TLS static int @@ -3263,11 +3268,13 @@ } SYSCTL_PROC(_net_inet_tcp, OID_AUTO, switch_to_sw_tls, - CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_WR | CTLFLAG_SKIP, NULL, - 0, sysctl_switch_tls, "", "Switch TCP connection to SW TLS"); + CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_WR | CTLFLAG_SKIP | + CTLFLAG_NEEDGIANT, NULL, 0, sysctl_switch_tls, "", + "Switch TCP connection to SW TLS"); SYSCTL_PROC(_net_inet_tcp, OID_AUTO, switch_to_ifnet_tls, - CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_WR | CTLFLAG_SKIP, NULL, - 1, sysctl_switch_tls, "", "Switch TCP connection to ifnet TLS"); + CTLFLAG_VNET | CTLTYPE_STRUCT | CTLFLAG_WR | CTLFLAG_SKIP | + CTLFLAG_NEEDGIANT, NULL, 1, sysctl_switch_tls, "", + "Switch TCP connection to ifnet TLS"); #endif /* Index: sys/netinet/tcp_syncache.c =================================================================== --- sys/netinet/tcp_syncache.c +++ sys/netinet/tcp_syncache.c @@ -172,7 +172,8 @@ VNET_DEFINE_STATIC(struct tcp_syncache, tcp_syncache); #define V_tcp_syncache VNET(tcp_syncache) -static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, syncache, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, syncache, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TCP SYN cache"); SYSCTL_UINT(_net_inet_tcp_syncache, OID_AUTO, bucketlimit, CTLFLAG_VNET | CTLFLAG_RDTUN, @@ -208,7 +209,7 @@ } SYSCTL_PROC(_net_inet_tcp_syncache, OID_AUTO, rexmtlimit, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &VNET_NAME(tcp_syncache.rexmt_limit), 0, sysctl_net_inet_tcp_syncache_rexmtlimit_check, "UI", "Limit on SYN/ACK retransmissions"); Index: sys/netinet/tcp_timer.c =================================================================== --- sys/netinet/tcp_timer.c +++ sys/netinet/tcp_timer.c @@ -82,46 +82,62 @@ #endif int tcp_persmin; -SYSCTL_PROC(_net_inet_tcp, OID_AUTO, persmin, CTLTYPE_INT|CTLFLAG_RW, - &tcp_persmin, 0, sysctl_msec_to_ticks, "I", "minimum persistence interval"); +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, persmin, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &tcp_persmin, 0, sysctl_msec_to_ticks, "I", + "minimum persistence interval"); int tcp_persmax; -SYSCTL_PROC(_net_inet_tcp, OID_AUTO, persmax, CTLTYPE_INT|CTLFLAG_RW, - &tcp_persmax, 0, sysctl_msec_to_ticks, "I", "maximum persistence interval"); +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, persmax, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &tcp_persmax, 0, sysctl_msec_to_ticks, "I", + "maximum persistence interval"); int tcp_keepinit; -SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit, CTLTYPE_INT|CTLFLAG_RW, - &tcp_keepinit, 0, sysctl_msec_to_ticks, "I", "time to establish connection"); +SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &tcp_keepinit, 0, sysctl_msec_to_ticks, "I", + "time to establish connection"); int tcp_keepidle; -SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPIDLE, keepidle, CTLTYPE_INT|CTLFLAG_RW, - &tcp_keepidle, 0, sysctl_msec_to_ticks, "I", "time before keepalive probes begin"); +SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPIDLE, keepidle, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &tcp_keepidle, 0, sysctl_msec_to_ticks, "I", + "time before keepalive probes begin"); int tcp_keepintvl; -SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPINTVL, keepintvl, CTLTYPE_INT|CTLFLAG_RW, - &tcp_keepintvl, 0, sysctl_msec_to_ticks, "I", "time between keepalive probes"); +SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPINTVL, keepintvl, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &tcp_keepintvl, 0, sysctl_msec_to_ticks, "I", + "time between keepalive probes"); int tcp_delacktime; -SYSCTL_PROC(_net_inet_tcp, TCPCTL_DELACKTIME, delacktime, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_net_inet_tcp, TCPCTL_DELACKTIME, delacktime, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &tcp_delacktime, 0, sysctl_msec_to_ticks, "I", "Time before a delayed ACK is sent"); int tcp_msl; -SYSCTL_PROC(_net_inet_tcp, OID_AUTO, msl, CTLTYPE_INT|CTLFLAG_RW, - &tcp_msl, 0, sysctl_msec_to_ticks, "I", "Maximum segment lifetime"); +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, msl, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &tcp_msl, 0, sysctl_msec_to_ticks, "I", + "Maximum segment lifetime"); int tcp_rexmit_initial; -SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_initial, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_initial, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &tcp_rexmit_initial, 0, sysctl_msec_to_ticks, "I", "Initial Retransmission Timeout"); int tcp_rexmit_min; -SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_min, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_min, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &tcp_rexmit_min, 0, sysctl_msec_to_ticks, "I", "Minimum Retransmission Timeout"); int tcp_rexmit_slop; -SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I", "Retransmission Timer Slop"); @@ -136,8 +152,10 @@ "Recycle closed FIN_WAIT_2 connections faster"); int tcp_finwait2_timeout; -SYSCTL_PROC(_net_inet_tcp, OID_AUTO, finwait2_timeout, CTLTYPE_INT|CTLFLAG_RW, - &tcp_finwait2_timeout, 0, sysctl_msec_to_ticks, "I", "FIN-WAIT2 timeout"); +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, finwait2_timeout, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + &tcp_finwait2_timeout, 0, sysctl_msec_to_ticks, "I", + "FIN-WAIT2 timeout"); int tcp_keepcnt = TCPTV_KEEPCNT; SYSCTL_INT(_net_inet_tcp, OID_AUTO, keepcnt, CTLFLAG_RW, &tcp_keepcnt, 0, Index: sys/netinet/tcp_timewait.c =================================================================== --- sys/netinet/tcp_timewait.c +++ sys/netinet/tcp_timewait.c @@ -169,7 +169,8 @@ return (error); } -SYSCTL_PROC(_net_inet_tcp, OID_AUTO, maxtcptw, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, maxtcptw, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, &maxtcptw, 0, sysctl_maxtcptw, "IU", "Maximum number of compressed TCP TIME_WAIT entries"); Index: sys/netinet/udp_usrreq.c =================================================================== --- sys/netinet/udp_usrreq.c +++ sys/netinet/udp_usrreq.c @@ -916,8 +916,9 @@ } SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIST, pcblist, - CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, - udp_pcblist, "S,xinpcb", "List of active UDP sockets"); + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + udp_pcblist, "S,xinpcb", + "List of active UDP sockets"); #ifdef INET static int @@ -957,8 +958,9 @@ } SYSCTL_PROC(_net_inet_udp, OID_AUTO, getcred, - CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0, - udp_getcred, "S,xucred", "Get the xucred of a UDP connection"); + CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE, + 0, 0, udp_getcred, "S,xucred", + "Get the xucred of a UDP connection"); #endif /* INET */ int Index: sys/netinet6/frag6.c =================================================================== --- sys/netinet6/frag6.c +++ sys/netinet6/frag6.c @@ -197,8 +197,8 @@ return (0); } SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, NULL, 0, - sysctl_ip6_maxfragpackets, "I", + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + NULL, 0, sysctl_ip6_maxfragpackets, "I", "Default maximum number of outstanding fragmented IPv6 packets. " "A value of 0 means no fragmented packets will be accepted, while a " "a value of -1 means no limit"); Index: sys/netinet6/in6_mcast.c =================================================================== --- sys/netinet6/in6_mcast.c +++ sys/netinet6/in6_mcast.c @@ -168,7 +168,8 @@ SYSCTL_DECL(_net_inet6_ip6); /* XXX Not in any common header. */ -static SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, mcast, CTLFLAG_RW, 0, +static SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, mcast, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "IPv6 multicast"); static u_long in6_mcast_maxgrpsrc = IPV6_MAX_GROUP_SRC_FILTER; Index: sys/netinet6/in6_proto.c =================================================================== --- sys/netinet6/in6_proto.c +++ sys/netinet6/in6_proto.c @@ -424,19 +424,25 @@ /* * sysctl related items. */ -SYSCTL_NODE(_net, PF_INET6, inet6, CTLFLAG_RW, 0, - "Internet6 Family"); +SYSCTL_NODE(_net, PF_INET6, inet6, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Internet6 Family"); /* net.inet6 */ -SYSCTL_NODE(_net_inet6, IPPROTO_IPV6, ip6, CTLFLAG_RW, 0, "IP6"); -SYSCTL_NODE(_net_inet6, IPPROTO_ICMPV6, icmp6, CTLFLAG_RW, 0, "ICMP6"); -SYSCTL_NODE(_net_inet6, IPPROTO_UDP, udp6, CTLFLAG_RW, 0, "UDP6"); -SYSCTL_NODE(_net_inet6, IPPROTO_TCP, tcp6, CTLFLAG_RW, 0, "TCP6"); +SYSCTL_NODE(_net_inet6, IPPROTO_IPV6, ip6, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "IP6"); +SYSCTL_NODE(_net_inet6, IPPROTO_ICMPV6, icmp6, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "ICMP6"); +SYSCTL_NODE(_net_inet6, IPPROTO_UDP, udp6, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "UDP6"); +SYSCTL_NODE(_net_inet6, IPPROTO_TCP, tcp6, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TCP6"); #ifdef SCTP -SYSCTL_NODE(_net_inet6, IPPROTO_SCTP, sctp6, CTLFLAG_RW, 0, "SCTP6"); +SYSCTL_NODE(_net_inet6, IPPROTO_SCTP, sctp6, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "SCTP6"); #endif #if defined(IPSEC) || defined(IPSEC_SUPPORT) -SYSCTL_NODE(_net_inet6, IPPROTO_ESP, ipsec6, CTLFLAG_RW, 0, "IPSEC6"); +SYSCTL_NODE(_net_inet6, IPPROTO_ESP, ipsec6, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "IPSEC6"); #endif /* IPSEC */ /* net.inet6.ip6 */ @@ -528,11 +534,11 @@ CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_use_tempaddr), 0, "Create RFC3041 temporary addresses for autoconfigured addresses"); SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_TEMPPLTIME, temppltime, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, sysctl_ip6_temppltime, "I", "Maximum preferred lifetime for temporary addresses"); SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_TEMPVLTIME, tempvltime, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, sysctl_ip6_tempvltime, "I", "Maximum valid lifetime for temporary addresses"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_V6ONLY, v6only, Index: sys/netinet6/in6_src.c =================================================================== --- sys/netinet6/in6_src.c +++ sys/netinet6/in6_src.c @@ -1040,7 +1040,8 @@ static int in6_src_sysctl(SYSCTL_HANDLER_ARGS); SYSCTL_DECL(_net_inet6_ip6); static SYSCTL_NODE(_net_inet6_ip6, IPV6CTL_ADDRCTLPOLICY, addrctlpolicy, - CTLFLAG_RD, in6_src_sysctl, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, in6_src_sysctl, + ""); static int in6_src_sysctl(SYSCTL_HANDLER_ARGS) Index: sys/netinet6/ip6_input.c =================================================================== --- sys/netinet6/ip6_input.c +++ sys/netinet6/ip6_input.c @@ -159,7 +159,8 @@ } SYSCTL_DECL(_net_inet6_ip6); SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_INTRQMAXLEN, intr_queue_maxlen, - CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet6_intr_queue_maxlen, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + 0, 0, sysctl_netinet6_intr_queue_maxlen, "I", "Maximum size of the IPv6 input queue"); #ifdef RSS @@ -186,8 +187,9 @@ return (netisr_setqlimit(&ip6_direct_nh, qlimit)); } SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_INTRDQMAXLEN, intr_direct_queue_maxlen, - CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet6_intr_direct_queue_maxlen, - "I", "Maximum size of the IPv6 direct input queue"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + 0, 0, sysctl_netinet6_intr_direct_queue_maxlen, "I", + "Maximum size of the IPv6 direct input queue"); #endif Index: sys/netinet6/ip6_mroute.c =================================================================== --- sys/netinet6/ip6_mroute.c +++ sys/netinet6/ip6_mroute.c @@ -155,7 +155,9 @@ SYSCTL_DECL(_net_inet6); SYSCTL_DECL(_net_inet6_ip6); -static SYSCTL_NODE(_net_inet6, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM"); +static SYSCTL_NODE(_net_inet6, IPPROTO_PIM, pim, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "PIM"); static struct mrt6stat mrt6stat; SYSCTL_STRUCT(_net_inet6_ip6, OID_AUTO, mrt6stat, CTLFLAG_RW, @@ -222,7 +224,8 @@ free(out, M_TEMP); return (error); } -SYSCTL_PROC(_net_inet6_ip6, OID_AUTO, mif6table, CTLTYPE_OPAQUE | CTLFLAG_RD, +SYSCTL_PROC(_net_inet6_ip6, OID_AUTO, mif6table, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, sysctl_mif6table, "S,mif6_sctl[MAXMIFS]", "IPv6 Multicast Interfaces (struct mif6_sctl[MAXMIFS], " "netinet6/ip6_mroute.h)"); Index: sys/netinet6/mld6.c =================================================================== --- sys/netinet6/mld6.c +++ sys/netinet6/mld6.c @@ -222,7 +222,7 @@ SYSCTL_DECL(_net_inet6); /* Note: Not in any common header. */ -SYSCTL_NODE(_net_inet6, OID_AUTO, mld, CTLFLAG_RW, 0, +SYSCTL_NODE(_net_inet6, OID_AUTO, mld, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "IPv6 Multicast Listener Discovery"); /* Index: sys/netinet6/udp6_usrreq.c =================================================================== --- sys/netinet6/udp6_usrreq.c +++ sys/netinet6/udp6_usrreq.c @@ -682,8 +682,10 @@ return (error); } -SYSCTL_PROC(_net_inet6_udp6, OID_AUTO, getcred, CTLTYPE_OPAQUE|CTLFLAG_RW, 0, - 0, udp6_getcred, "S,xucred", "Get the xucred of a UDP6 connection"); +SYSCTL_PROC(_net_inet6_udp6, OID_AUTO, getcred, + CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_MPSAFE, + 0, 0, udp6_getcred, "S,xucred", + "Get the xucred of a UDP6 connection"); static int udp6_output(struct socket *so, int flags_arg, struct mbuf *m, Index: sys/netipsec/ipsec.c =================================================================== --- sys/netipsec/ipsec.c +++ sys/netipsec/ipsec.c @@ -175,8 +175,9 @@ /* net.inet.ipsec */ SYSCTL_PROC(_net_inet_ipsec, IPSECCTL_DEF_POLICY, def_policy, - CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW, 0, 0, sysctl_def_policy, "I", - "IPsec default policy."); + CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_def_policy, "I", + "IPsec default policy."); SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEF_ESP_TRANSLEV, esp_trans_deflev, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_esp_trans_deflev), 0, "Default ESP transport mode level"); @@ -261,8 +262,9 @@ /* net.inet6.ipsec6 */ SYSCTL_PROC(_net_inet6_ipsec6, IPSECCTL_DEF_POLICY, def_policy, - CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW, 0, 0, sysctl_def_policy, "I", - "IPsec default policy."); + CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_def_policy, "I", + "IPsec default policy."); SYSCTL_INT(_net_inet6_ipsec6, IPSECCTL_DEF_ESP_TRANSLEV, esp_trans_deflev, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_esp_trans_deflev), 0, "Default ESP transport mode level."); Index: sys/netipsec/key.c =================================================================== --- sys/netipsec/key.c +++ sys/netipsec/key.c @@ -508,7 +508,9 @@ SYSCTL_INT(_net_key, KEYCTL_PREFERED_OLDSA, preferred_oldsa, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(key_preferred_oldsa), 0, ""); -static SYSCTL_NODE(_net_key, OID_AUTO, spdcache, CTLFLAG_RW, 0, "SPD cache"); +static SYSCTL_NODE(_net_key, OID_AUTO, spdcache, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "SPD cache"); SYSCTL_UINT(_net_key_spdcache, OID_AUTO, maxentries, CTLFLAG_VNET | CTLFLAG_RDTUN, &VNET_NAME(key_spdcache_maxentries), 0, Index: sys/netipsec/keysock.c =================================================================== --- sys/netipsec/keysock.c +++ sys/netipsec/keysock.c @@ -431,7 +431,8 @@ }; /* sysctl */ -SYSCTL_NODE(_net, PF_KEY, key, CTLFLAG_RW, 0, "Key Family"); +SYSCTL_NODE(_net, PF_KEY, key, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Key Family"); /* * Definitions of protocols supported in the KEY domain. Index: sys/netpfil/ipfw/dn_aqm_codel.c =================================================================== --- sys/netpfil/ipfw/dn_aqm_codel.c +++ sys/netpfil/ipfw/dn_aqm_codel.c @@ -118,17 +118,20 @@ SYSCTL_DECL(_net_inet); SYSCTL_DECL(_net_inet_ip); SYSCTL_DECL(_net_inet_ip_dummynet); -static SYSCTL_NODE(_net_inet_ip_dummynet, OID_AUTO, - codel, CTLFLAG_RW, 0, "CODEL"); +static SYSCTL_NODE(_net_inet_ip_dummynet, OID_AUTO, codel, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "CODEL"); #ifdef SYSCTL_NODE SYSCTL_PROC(_net_inet_ip_dummynet_codel, OID_AUTO, target, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0,codel_sysctl_target_handler, "L", - "CoDel target in microsecond"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + NULL, 0,codel_sysctl_target_handler, "L", + "CoDel target in microsecond"); SYSCTL_PROC(_net_inet_ip_dummynet_codel, OID_AUTO, interval, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, codel_sysctl_interval_handler, "L", - "CoDel interval in microsecond"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + NULL, 0, codel_sysctl_interval_handler, "L", + "CoDel interval in microsecond"); #endif /* This function computes codel_interval/sqrt(count) Index: sys/netpfil/ipfw/dn_aqm_pie.c =================================================================== --- sys/netpfil/ipfw/dn_aqm_pie.c +++ sys/netpfil/ipfw/dn_aqm_pie.c @@ -162,36 +162,37 @@ SYSCTL_DECL(_net_inet); SYSCTL_DECL(_net_inet_ip); SYSCTL_DECL(_net_inet_ip_dummynet); -static SYSCTL_NODE(_net_inet_ip_dummynet, OID_AUTO, - pie, CTLFLAG_RW, 0, "PIE"); +static SYSCTL_NODE(_net_inet_ip_dummynet, OID_AUTO, pie, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "PIE"); #ifdef SYSCTL_NODE SYSCTL_PROC(_net_inet_ip_dummynet_pie, OID_AUTO, target, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - pie_sysctl_target_tupdate_maxb_handler, "L", - "queue target in microsecond"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + pie_sysctl_target_tupdate_maxb_handler, "L", + "queue target in microsecond"); SYSCTL_PROC(_net_inet_ip_dummynet_pie, OID_AUTO, tupdate, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - pie_sysctl_target_tupdate_maxb_handler, "L", - "the frequency of drop probability calculation in microsecond"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + pie_sysctl_target_tupdate_maxb_handler, "L", + "the frequency of drop probability calculation in microsecond"); SYSCTL_PROC(_net_inet_ip_dummynet_pie, OID_AUTO, max_burst, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - pie_sysctl_target_tupdate_maxb_handler, "L", - "Burst allowance interval in microsecond"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + pie_sysctl_target_tupdate_maxb_handler, "L", + "Burst allowance interval in microsecond"); SYSCTL_PROC(_net_inet_ip_dummynet_pie, OID_AUTO, max_ecnth, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - pie_sysctl_max_ecnth_handler, "L", - "ECN safeguard threshold scaled by 1000"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + pie_sysctl_max_ecnth_handler, "L", + "ECN safeguard threshold scaled by 1000"); SYSCTL_PROC(_net_inet_ip_dummynet_pie, OID_AUTO, alpha, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - pie_sysctl_alpha_beta_handler, "L", - "PIE alpha scaled by 1000"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + pie_sysctl_alpha_beta_handler, "L", + "PIE alpha scaled by 1000"); SYSCTL_PROC(_net_inet_ip_dummynet_pie, OID_AUTO, beta, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - pie_sysctl_alpha_beta_handler, "L", - "beta scaled by 1000"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + pie_sysctl_alpha_beta_handler, "L", + "beta scaled by 1000"); #endif Index: sys/netpfil/ipfw/dn_sched_fq_codel.c =================================================================== --- sys/netpfil/ipfw/dn_sched_fq_codel.c +++ sys/netpfil/ipfw/dn_sched_fq_codel.c @@ -130,16 +130,19 @@ SYSCTL_DECL(_net_inet_ip); SYSCTL_DECL(_net_inet_ip_dummynet); static SYSCTL_NODE(_net_inet_ip_dummynet, OID_AUTO, fqcodel, - CTLFLAG_RW, 0, "FQ_CODEL"); + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "FQ_CODEL"); #ifdef SYSCTL_NODE SYSCTL_PROC(_net_inet_ip_dummynet_fqcodel, OID_AUTO, target, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, fqcodel_sysctl_target_handler, "L", - "FQ_CoDel target in microsecond"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + NULL, 0, fqcodel_sysctl_target_handler, "L", + "FQ_CoDel target in microsecond"); SYSCTL_PROC(_net_inet_ip_dummynet_fqcodel, OID_AUTO, interval, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, fqcodel_sysctl_interval_handler, "L", - "FQ_CoDel interval in microsecond"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + NULL, 0, fqcodel_sysctl_interval_handler, "L", + "FQ_CoDel interval in microsecond"); SYSCTL_UINT(_net_inet_ip_dummynet_fqcodel, OID_AUTO, quantum, CTLFLAG_RW, &fq_codel_sysctl.quantum, 1514, "FQ_CoDel quantum"); Index: sys/netpfil/ipfw/dn_sched_fq_pie.c =================================================================== --- sys/netpfil/ipfw/dn_sched_fq_pie.c +++ sys/netpfil/ipfw/dn_sched_fq_pie.c @@ -238,37 +238,40 @@ SYSCTL_DECL(_net_inet_ip); SYSCTL_DECL(_net_inet_ip_dummynet); static SYSCTL_NODE(_net_inet_ip_dummynet, OID_AUTO, fqpie, - CTLFLAG_RW, 0, "FQ_PIE"); + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "FQ_PIE"); #ifdef SYSCTL_NODE SYSCTL_PROC(_net_inet_ip_dummynet_fqpie, OID_AUTO, target, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - fqpie_sysctl_target_tupdate_maxb_handler, "L", - "queue target in microsecond"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + fqpie_sysctl_target_tupdate_maxb_handler, "L", + "queue target in microsecond"); SYSCTL_PROC(_net_inet_ip_dummynet_fqpie, OID_AUTO, tupdate, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - fqpie_sysctl_target_tupdate_maxb_handler, "L", - "the frequency of drop probability calculation in microsecond"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + fqpie_sysctl_target_tupdate_maxb_handler, "L", + "the frequency of drop probability calculation in microsecond"); SYSCTL_PROC(_net_inet_ip_dummynet_fqpie, OID_AUTO, max_burst, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - fqpie_sysctl_target_tupdate_maxb_handler, "L", - "Burst allowance interval in microsecond"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + fqpie_sysctl_target_tupdate_maxb_handler, "L", + "Burst allowance interval in microsecond"); SYSCTL_PROC(_net_inet_ip_dummynet_fqpie, OID_AUTO, max_ecnth, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - fqpie_sysctl_max_ecnth_handler, "L", - "ECN safeguard threshold scaled by 1000"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + fqpie_sysctl_max_ecnth_handler, "L", + "ECN safeguard threshold scaled by 1000"); SYSCTL_PROC(_net_inet_ip_dummynet_fqpie, OID_AUTO, alpha, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - fqpie_sysctl_alpha_beta_handler, "L", "PIE alpha scaled by 1000"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + fqpie_sysctl_alpha_beta_handler, "L", + "PIE alpha scaled by 1000"); SYSCTL_PROC(_net_inet_ip_dummynet_fqpie, OID_AUTO, beta, - CTLTYPE_LONG | CTLFLAG_RW, NULL, 0, - fqpie_sysctl_alpha_beta_handler, "L", "beta scaled by 1000"); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, + fqpie_sysctl_alpha_beta_handler, "L", + "beta scaled by 1000"); SYSCTL_UINT(_net_inet_ip_dummynet_fqpie, OID_AUTO, quantum, CTLFLAG_RW, &fq_pie_sysctl.quantum, 1514, "quantum for FQ_PIE"); Index: sys/netpfil/ipfw/ip_dn_io.c =================================================================== --- sys/netpfil/ipfw/ip_dn_io.c +++ sys/netpfil/ipfw/ip_dn_io.c @@ -159,9 +159,12 @@ SYSCTL_DECL(_net_inet); SYSCTL_DECL(_net_inet_ip); #ifdef NEW_AQM -SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW, 0, "Dummynet"); +SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Dummynet"); #else -static SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW, 0, "Dummynet"); +static SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Dummynet"); #endif /* wrapper to pass dn_cfg fields to SYSCTL_* */ @@ -171,16 +174,19 @@ SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, hash_size, - CTLTYPE_INT | CTLFLAG_RW, 0, 0, sysctl_hash_size, - "I", "Default hash table size"); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_hash_size, "I", + "Default hash table size"); SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, pipe_slot_limit, - CTLTYPE_LONG | CTLFLAG_RW, 0, 1, sysctl_limits, - "L", "Upper limit in slots for pipe queue."); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 1, sysctl_limits, "L", + "Upper limit in slots for pipe queue."); SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, pipe_byte_limit, - CTLTYPE_LONG | CTLFLAG_RW, 0, 0, sysctl_limits, - "L", "Upper limit in bytes for pipe queue."); + CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_limits, "L", + "Upper limit in bytes for pipe queue."); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, io_fast, CTLFLAG_RW, DC(io_fast), 0, "Enable fast dummynet io."); SYSCTL_INT(_net_inet_ip_dummynet, OID_AUTO, debug, Index: sys/netpfil/ipfw/ip_fw2.c =================================================================== --- sys/netpfil/ipfw/ip_fw2.c +++ sys/netpfil/ipfw/ip_fw2.c @@ -179,7 +179,8 @@ SYSBEGIN(f3) -SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall"); +SYSCTL_NODE(_net_inet_ip, OID_AUTO, fw, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Firewall"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, one_pass, CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_SECURE3, &VNET_NAME(fw_one_pass), 0, "Only do a single pass through ipfw when using dummynet(4)"); @@ -196,10 +197,11 @@ &dummy_def, 0, "The default/max possible rule number."); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, tables_max, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, 0, 0, sysctl_ipfw_table_num, "IU", + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, + 0, 0, sysctl_ipfw_table_num, "IU", "Maximum number of concurrently used tables"); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, tables_sets, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, sysctl_ipfw_tables_sets, "IU", "Use per-set namespace for tables"); SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, default_to_accept, CTLFLAG_RDTUN, @@ -212,7 +214,8 @@ #ifdef INET6 SYSCTL_DECL(_net_inet6_ip6); -SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall"); +SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, fw, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Firewall"); SYSCTL_INT(_net_inet6_ip6_fw, OID_AUTO, deny_unknown_exthdrs, CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_deny_unknown_exthdrs), 0, Index: sys/netpfil/ipfw/ip_fw_dynamic.c =================================================================== --- sys/netpfil/ipfw/ip_fw_dynamic.c +++ sys/netpfil/ipfw/ip_fw_dynamic.c @@ -453,14 +453,17 @@ CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(curr_max_length), 0, "Current maximum length of states chains in hash buckets."); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_buckets, - CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_buckets, - "IU", "Max number of buckets for dynamic states hash table."); + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_dyn_buckets, "IU", + "Max number of buckets for dynamic states hash table."); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_max, - CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_max, - "IU", "Max number of dynamic states."); + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_dyn_max, "IU", + "Max number of dynamic states."); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_parent_max, - CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_parent_max, - "IU", "Max number of parent dynamic states."); + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_dyn_parent_max, "IU", + "Max number of parent dynamic states."); SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_ack_lifetime), 0, "Lifetime of dynamic states for TCP ACK."); Index: sys/netpfil/ipfw/ip_fw_pfil.c =================================================================== --- sys/netpfil/ipfw/ip_fw_pfil.c +++ sys/netpfil/ipfw/ip_fw_pfil.c @@ -93,19 +93,21 @@ SYSCTL_DECL(_net_inet_ip_fw); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, enable, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, - &VNET_NAME(fw_enable), 0, ipfw_chg_hook, "I", "Enable ipfw"); + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | + CTLFLAG_NEEDGIANT, &VNET_NAME(fw_enable), 0, ipfw_chg_hook, "I", + "Enable ipfw"); #ifdef INET6 SYSCTL_DECL(_net_inet6_ip6_fw); SYSCTL_PROC(_net_inet6_ip6_fw, OID_AUTO, enable, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, - &VNET_NAME(fw6_enable), 0, ipfw_chg_hook, "I", "Enable ipfw+6"); + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | + CTLFLAG_NEEDGIANT, &VNET_NAME(fw6_enable), 0, ipfw_chg_hook, "I", + "Enable ipfw+6"); #endif /* INET6 */ SYSCTL_DECL(_net_link_ether); SYSCTL_PROC(_net_link_ether, OID_AUTO, ipfw, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3, - &VNET_NAME(fwlink_enable), 0, ipfw_chg_hook, "I", + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_SECURE3 | + CTLFLAG_NEEDGIANT, &VNET_NAME(fwlink_enable), 0, ipfw_chg_hook, "I", "Pass ether pkts through firewall"); SYSEND Index: sys/netpfil/ipfw/nat64/ip_fw_nat64.c =================================================================== --- sys/netpfil/ipfw/nat64/ip_fw_nat64.c +++ sys/netpfil/ipfw/nat64/ip_fw_nat64.c @@ -72,7 +72,8 @@ return (0); } SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, nat64_direct_output, - CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_direct_output, "IU", + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_direct_output, "IU", "Use if_output directly instead of deffered netisr-based processing"); static int Index: sys/netsmb/smb_conn.c =================================================================== --- sys/netsmb/smb_conn.c +++ sys/netsmb/smb_conn.c @@ -54,7 +54,8 @@ static struct smb_connobj smb_vclist; static int smb_vcnext = 1; /* next unique id for VC */ -SYSCTL_NODE(_net, OID_AUTO, smb, CTLFLAG_RW, NULL, "SMB protocol"); +SYSCTL_NODE(_net, OID_AUTO, smb, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "SMB protocol"); static MALLOC_DEFINE(M_SMBCONN, "smb_conn", "SMB connection"); @@ -69,8 +70,10 @@ static int smb_sysctl_treedump(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_net_smb, OID_AUTO, treedump, CTLFLAG_RD | CTLTYPE_OPAQUE, - NULL, 0, smb_sysctl_treedump, "S,treedump", "Requester tree"); +SYSCTL_PROC(_net_smb, OID_AUTO, treedump, + CTLFLAG_RD | CTLTYPE_OPAQUE | CTLFLAG_MPSAFE, + NULL, 0, smb_sysctl_treedump, "S,treedump", + "Requester tree"); int smb_sm_init(void) Index: sys/nfs/nfs_fha.c =================================================================== --- sys/nfs/nfs_fha.c +++ sys/nfs/nfs_fha.c @@ -98,8 +98,8 @@ "single nfsd thread should be working on at any time"); SYSCTL_ADD_OID(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "fhe_stats", CTLTYPE_STRING | CTLFLAG_RD, 0, 0, - softc->callbacks.fhe_stats_sysctl, "A", ""); + OID_AUTO, "fhe_stats", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, 0, softc->callbacks.fhe_stats_sysctl, "A", ""); } Index: sys/nlm/nlm_prot_impl.c =================================================================== --- sys/nlm/nlm_prot_impl.c +++ sys/nlm/nlm_prot_impl.c @@ -86,9 +86,11 @@ /* * Support for sysctl vfs.nlm.sysid */ -static SYSCTL_NODE(_vfs, OID_AUTO, nlm, CTLFLAG_RW, NULL, +static SYSCTL_NODE(_vfs, OID_AUTO, nlm, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Network Lock Manager"); -static SYSCTL_NODE(_vfs_nlm, OID_AUTO, sysid, CTLFLAG_RW, NULL, ""); +static SYSCTL_NODE(_vfs_nlm, OID_AUTO, sysid, + CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + ""); /* * Syscall hooks @@ -850,7 +852,8 @@ sysctl_ctx_init(&host->nh_sysctl); oid = SYSCTL_ADD_NODE(&host->nh_sysctl, SYSCTL_STATIC_CHILDREN(_vfs_nlm_sysid), - OID_AUTO, host->nh_sysid_string, CTLFLAG_RD, NULL, ""); + OID_AUTO, host->nh_sysid_string, CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, ""); SYSCTL_ADD_STRING(&host->nh_sysctl, SYSCTL_CHILDREN(oid), OID_AUTO, "hostname", CTLFLAG_RD, host->nh_caller_name, 0, ""); SYSCTL_ADD_UINT(&host->nh_sysctl, SYSCTL_CHILDREN(oid), OID_AUTO, @@ -858,11 +861,11 @@ SYSCTL_ADD_UINT(&host->nh_sysctl, SYSCTL_CHILDREN(oid), OID_AUTO, "monitored", CTLFLAG_RD, &host->nh_monstate, 0, ""); SYSCTL_ADD_PROC(&host->nh_sysctl, SYSCTL_CHILDREN(oid), OID_AUTO, - "lock_count", CTLTYPE_INT | CTLFLAG_RD, host, 0, - nlm_host_lock_count_sysctl, "I", ""); + "lock_count", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, host, + 0, nlm_host_lock_count_sysctl, "I", ""); SYSCTL_ADD_PROC(&host->nh_sysctl, SYSCTL_CHILDREN(oid), OID_AUTO, - "client_lock_count", CTLTYPE_INT | CTLFLAG_RD, host, 0, - nlm_host_client_lock_count_sysctl, "I", ""); + "client_lock_count", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + host, 0, nlm_host_client_lock_count_sysctl, "I", ""); mtx_lock(&nlm_global_lock); Index: sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c =================================================================== --- sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c +++ sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c @@ -1881,10 +1881,12 @@ return (error); } -SYSCTL_NODE(_net_inet, -1, sdp, CTLFLAG_RW, 0, "SDP"); +SYSCTL_NODE(_net_inet, -1, sdp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "SDP"); SYSCTL_PROC(_net_inet_sdp, TCPCTL_PCBLIST, pcblist, - CTLFLAG_RD | CTLTYPE_STRUCT, 0, 0, sdp_pcblist, "S,xtcpcb", + CTLFLAG_RD | CTLTYPE_STRUCT | CTLFLAG_MPSAFE, + 0, 0, sdp_pcblist, "S,xtcpcb", "List of active SDP connections"); static void Index: sys/opencrypto/ktls_ocf.c =================================================================== --- sys/opencrypto/ktls_ocf.c +++ sys/opencrypto/ktls_ocf.c @@ -60,7 +60,8 @@ SYSCTL_DECL(_kern_ipc_tls); SYSCTL_DECL(_kern_ipc_tls_stats); -static SYSCTL_NODE(_kern_ipc_tls_stats, OID_AUTO, ocf, CTLFLAG_RD, 0, +static SYSCTL_NODE(_kern_ipc_tls_stats, OID_AUTO, ocf, + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Kernel TLS offload via OCF stats"); static counter_u64_t ocf_tls12_gcm_crypts; Index: sys/powerpc/amigaone/cpld_x5000.c =================================================================== --- sys/powerpc/amigaone/cpld_x5000.c +++ sys/powerpc/amigaone/cpld_x5000.c @@ -183,7 +183,7 @@ tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "cpu_fan", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + "cpu_fan", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, cpld_fan_sysctl, "I", "CPU Fan speed in RPM"); make_dev_args_init(&mda); Index: sys/powerpc/fpu/fpu_emu.c =================================================================== --- sys/powerpc/fpu/fpu_emu.c +++ sys/powerpc/fpu/fpu_emu.c @@ -99,7 +99,8 @@ #include #include -static SYSCTL_NODE(_hw, OID_AUTO, fpu_emu, CTLFLAG_RW, 0, "FPU emulator"); +static SYSCTL_NODE(_hw, OID_AUTO, fpu_emu, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "FPU emulator"); #define FPU_EMU_EVCNT_DECL(name) \ static u_int fpu_emu_evcnt_##name; \ Index: sys/powerpc/ofw/ofw_syscons.c =================================================================== --- sys/powerpc/ofw/ofw_syscons.c +++ sys/powerpc/ofw/ofw_syscons.c @@ -60,7 +60,8 @@ static int ofwfb_ignore_mmap_checks = 1; static int ofwfb_reset_on_switch = 1; -static SYSCTL_NODE(_hw, OID_AUTO, ofwfb, CTLFLAG_RD, 0, "ofwfb"); +static SYSCTL_NODE(_hw, OID_AUTO, ofwfb, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "ofwfb"); SYSCTL_INT(_hw_ofwfb, OID_AUTO, relax_mmap, CTLFLAG_RW, &ofwfb_ignore_mmap_checks, 0, "relaxed mmap bounds checking"); SYSCTL_INT(_hw_ofwfb, OID_AUTO, reset_on_mode_switch, CTLFLAG_RW, Index: sys/powerpc/powermac/atibl.c =================================================================== --- sys/powerpc/powermac/atibl.c +++ sys/powerpc/powermac/atibl.c @@ -160,7 +160,7 @@ tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "level", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + "level", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, atibl_sysctl, "I", "Backlight level (0-100)"); return (0); Index: sys/powerpc/powermac/fcu.c =================================================================== --- sys/powerpc/powermac/fcu.c +++ sys/powerpc/powermac/fcu.c @@ -600,7 +600,7 @@ ctx = device_get_sysctl_ctx(dev); fanroot_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "fans", - CTLFLAG_RD, 0, "FCU Fan Information"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "FCU Fan Information"); /* Now we can fill the properties into the allocated struct. */ sc->sc_nfans = fcu_fill_fan_prop(dev); @@ -620,8 +620,8 @@ if (sc->sc_fans[i].type == FCU_FAN_RPM) { oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(fanroot_oid), - OID_AUTO, sysctl_name, - CTLFLAG_RD, 0, "Fan Information"); + OID_AUTO, sysctl_name, CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, "Fan Information"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "minrpm", CTLFLAG_RD, &(sc->sc_fans[i].fan.min_rpm), 0, @@ -632,16 +632,16 @@ "Maximum allowed RPM"); /* I use i to pass the fan id. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "rpm", CTLTYPE_INT | CTLFLAG_RW, dev, i, - fcu_fanrpm_sysctl, "I", "Fan RPM"); + "rpm", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + dev, i, fcu_fanrpm_sysctl, "I", "Fan RPM"); } else { fcu_fan_get_pwm(dev, &sc->sc_fans[i], &sc->sc_fans[i].setpoint, &sc->sc_fans[i].rpm); oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(fanroot_oid), - OID_AUTO, sysctl_name, - CTLFLAG_RD, 0, "Fan Information"); + OID_AUTO, sysctl_name, CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, "Fan Information"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "minpwm", CTLFLAG_RD, &(sc->sc_fans[i].fan.min_rpm), 0, @@ -654,13 +654,13 @@ * of info I want to display/modify. */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "pwm", CTLTYPE_INT | CTLFLAG_RW, dev, - FCU_PWM_SYSCTL_PWM | i, - fcu_fanrpm_sysctl, "I", "Fan PWM in %"); + "pwm", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + dev, FCU_PWM_SYSCTL_PWM | i, fcu_fanrpm_sysctl, "I", + "Fan PWM in %"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "rpm", CTLTYPE_INT | CTLFLAG_RD, dev, - FCU_PWM_SYSCTL_RPM | i, - fcu_fanrpm_sysctl, "I", "Fan RPM"); + "rpm", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + dev, FCU_PWM_SYSCTL_RPM | i, fcu_fanrpm_sysctl, "I", + "Fan RPM"); } } Index: sys/powerpc/powermac/nvbl.c =================================================================== --- sys/powerpc/powermac/nvbl.c +++ sys/powerpc/powermac/nvbl.c @@ -144,8 +144,8 @@ tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "level", CTLTYPE_INT | CTLFLAG_RW, sc, 0, - nvbl_sysctl, "I", "Backlight level (0-100)"); + "level", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + nvbl_sysctl, "I", "Backlight level (0-100)"); return (0); } Index: sys/powerpc/powermac/pmu.c =================================================================== --- sys/powerpc/powermac/pmu.c +++ sys/powerpc/powermac/pmu.c @@ -433,7 +433,7 @@ tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "server_mode", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + "server_mode", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, pmu_server_mode, "I", "Enable reboot after power failure"); if (sc->sc_batteries > 0) { @@ -443,58 +443,68 @@ /* Only start the battery monitor if we have a battery. */ kproc_start(&pmu_batt_kp); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "monitor_batteries", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + "monitor_batteries", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, pmu_battmon, "I", "Post battery events to devd"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "acline", CTLTYPE_INT | CTLFLAG_RD, sc, 0, - pmu_acline_state, "I", "AC Line Status"); + "acline", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, + 0, pmu_acline_state, "I", "AC Line Status"); battroot = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "batteries", CTLFLAG_RD, 0, "Battery Information"); + "batteries", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Battery Information"); for (i = 0; i < sc->sc_batteries; i++) { battnum[0] = i + '0'; battnum[1] = '\0'; oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(battroot), - OID_AUTO, battnum, CTLFLAG_RD, 0, + OID_AUTO, battnum, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Battery Information"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "present", CTLTYPE_INT | CTLFLAG_RD, sc, + "present", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, PMU_BATSYSCTL_PRESENT | i, pmu_battquery_sysctl, "I", "Battery present"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "charging", CTLTYPE_INT | CTLFLAG_RD, sc, + "charging", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, PMU_BATSYSCTL_CHARGING | i, pmu_battquery_sysctl, "I", "Battery charging"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "charge", CTLTYPE_INT | CTLFLAG_RD, sc, + "charge", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, PMU_BATSYSCTL_CHARGE | i, pmu_battquery_sysctl, "I", "Battery charge (mAh)"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "maxcharge", CTLTYPE_INT | CTLFLAG_RD, sc, + "maxcharge", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, PMU_BATSYSCTL_MAXCHARGE | i, pmu_battquery_sysctl, "I", "Maximum battery capacity (mAh)"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "rate", CTLTYPE_INT | CTLFLAG_RD, sc, + "rate", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, PMU_BATSYSCTL_CURRENT | i, pmu_battquery_sysctl, "I", "Battery discharge rate (mA)"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "voltage", CTLTYPE_INT | CTLFLAG_RD, sc, + "voltage", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, PMU_BATSYSCTL_VOLTAGE | i, pmu_battquery_sysctl, "I", "Battery voltage (mV)"); /* Knobs for mental compatibility with ACPI */ SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "time", CTLTYPE_INT | CTLFLAG_RD, sc, + "time", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, PMU_BATSYSCTL_TIME | i, pmu_battquery_sysctl, "I", "Time Remaining (minutes)"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, - "life", CTLTYPE_INT | CTLFLAG_RD, sc, + "life", + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, PMU_BATSYSCTL_LIFE | i, pmu_battquery_sysctl, "I", "Capacity remaining (percent)"); } Index: sys/powerpc/powermac/smu.c =================================================================== --- sys/powerpc/powermac/smu.c +++ sys/powerpc/powermac/smu.c @@ -379,8 +379,8 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "server_mode", CTLTYPE_INT | CTLFLAG_RW, dev, 0, - smu_server_mode, "I", "Enable reboot after power failure"); + "server_mode", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, dev, + 0, smu_server_mode, "I", "Enable reboot after power failure"); /* * Set up doorbell interrupt. @@ -1022,7 +1022,7 @@ ctx = device_get_sysctl_ctx(dev); fanroot_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "fans", - CTLFLAG_RD, 0, "SMU Fan Information"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "SMU Fan Information"); /* Add sysctls */ for (i = 0; i < sc->sc_nfans; i++) { @@ -1035,9 +1035,9 @@ sysctl_name[j] = 0; if (fan->type == SMU_FAN_RPM) { oid = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(fanroot_oid), - OID_AUTO, sysctl_name, - CTLFLAG_RD, 0, "Fan Information"); + SYSCTL_CHILDREN(fanroot_oid), OID_AUTO, + sysctl_name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Fan Information"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "minrpm", CTLFLAG_RD, &fan->fan.min_rpm, 0, @@ -1056,9 +1056,9 @@ } else { oid = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(fanroot_oid), - OID_AUTO, sysctl_name, - CTLFLAG_RD, 0, "Fan Information"); + SYSCTL_CHILDREN(fanroot_oid), OID_AUTO, + sysctl_name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Fan Information"); SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "minpwm", CTLFLAG_RD, &fan->fan.min_rpm, 0, @@ -1205,7 +1205,7 @@ ctx = device_get_sysctl_ctx(dev); sensroot_oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensors", - CTLFLAG_RD, 0, "SMU Sensor Information"); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "SMU Sensor Information"); for (child = OF_child(sensroot); child != 0; child = OF_peer(child)) { char sysctl_name[40], sysctl_desc[40]; Index: sys/powerpc/powernv/opal_sensor.c =================================================================== --- sys/powerpc/powernv/opal_sensor.c +++ sys/powerpc/powernv/opal_sensor.c @@ -206,9 +206,9 @@ sc->sc_handle = sensor_id; SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "sensor", CTLTYPE_INT | CTLFLAG_RD, sc, sensor_id, - opal_sensor_sysctl, (sc->sc_type == OPAL_SENSOR_TEMP) ? "IK" : "I", - "current value"); + "sensor", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, + sensor_id, opal_sensor_sysctl, + (sc->sc_type == OPAL_SENSOR_TEMP) ? "IK" : "I", "current value"); SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "type", CTLFLAG_RD, __DECONST(char *, opal_sensor_types[sc->sc_type]), @@ -222,8 +222,8 @@ &sensor_id, sizeof(sensor_id)) > 0) { sc->sc_min_handle = sensor_id; SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "sensor_min", CTLTYPE_INT | CTLFLAG_RD, sc, sensor_id, - opal_sensor_sysctl, + "sensor_min", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + sc, sensor_id, opal_sensor_sysctl, (sc->sc_type == OPAL_SENSOR_TEMP) ? "IK" : "I", "minimum value"); } @@ -232,8 +232,8 @@ &sensor_id, sizeof(sensor_id)) > 0) { sc->sc_max_handle = sensor_id; SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "sensor_max", CTLTYPE_INT | CTLFLAG_RD, sc, sensor_id, - opal_sensor_sysctl, + "sensor_max", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + sc, sensor_id, opal_sensor_sysctl, (sc->sc_type == OPAL_SENSOR_TEMP) ? "IK" : "I", "maximum value"); } Index: sys/powerpc/powerpc/busdma_machdep.c =================================================================== --- sys/powerpc/powerpc/busdma_machdep.c +++ sys/powerpc/powerpc/busdma_machdep.c @@ -120,7 +120,8 @@ static int busdma_zonecount; static STAILQ_HEAD(, bounce_zone) bounce_zone_list; -static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Busdma parameters"); SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); @@ -1072,7 +1073,7 @@ sysctl_ctx_init(&bz->sysctl_tree); bz->sysctl_tree_top = SYSCTL_ADD_NODE(&bz->sysctl_tree, SYSCTL_STATIC_CHILDREN(_hw_busdma), OID_AUTO, bz->zoneid, - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (bz->sysctl_tree_top == NULL) { sysctl_ctx_free(&bz->sysctl_tree); return (0); /* XXX error code? */ Index: sys/powerpc/powerpc/elf32_machdep.c =================================================================== --- sys/powerpc/powerpc/elf32_machdep.c +++ sys/powerpc/powerpc/elf32_machdep.c @@ -68,7 +68,8 @@ extern const char *freebsd32_syscallnames[]; static void ppc32_fixlimit(struct rlimit *rl, int which); -static SYSCTL_NODE(_compat, OID_AUTO, ppc32, CTLFLAG_RW, 0, "32-bit mode"); +static SYSCTL_NODE(_compat, OID_AUTO, ppc32, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "32-bit mode"); #define PPC32_MAXDSIZ (1024*1024*1024) static u_long ppc32_maxdsiz = PPC32_MAXDSIZ; Index: sys/powerpc/ps3/ps3disk.c =================================================================== --- sys/powerpc/ps3/ps3disk.c +++ sys/powerpc/ps3/ps3disk.c @@ -68,7 +68,7 @@ #define LV1_STORAGE_ATA_HDDOUT 0x23 -static SYSCTL_NODE(_hw, OID_AUTO, ps3disk, CTLFLAG_RD, 0, +static SYSCTL_NODE(_hw, OID_AUTO, ps3disk, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "PS3 Disk driver parameters"); #ifdef PS3DISK_DEBUG @@ -681,8 +681,8 @@ sc->sc_debug = ps3disk_debug; SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "debug", CTLTYPE_INT | CTLFLAG_RW, sc, 0, - ps3disk_sysctl_debug, "I", "control debugging printfs"); + "debug", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + ps3disk_sysctl_debug, "I", "control debugging printfs"); #endif } Index: sys/riscv/riscv/busdma_bounce.c =================================================================== --- sys/riscv/riscv/busdma_bounce.c +++ sys/riscv/riscv/busdma_bounce.c @@ -113,7 +113,8 @@ static int busdma_zonecount; static STAILQ_HEAD(, bounce_zone) bounce_zone_list; -static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Busdma parameters"); SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); @@ -1119,7 +1120,7 @@ sysctl_ctx_init(&bz->sysctl_tree); bz->sysctl_tree_top = SYSCTL_ADD_NODE(&bz->sysctl_tree, SYSCTL_STATIC_CHILDREN(_hw_busdma), OID_AUTO, bz->zoneid, - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (bz->sysctl_tree_top == NULL) { sysctl_ctx_free(&bz->sysctl_tree); return (0); /* XXX error code? */ Index: sys/riscv/riscv/pmap.c =================================================================== --- sys/riscv/riscv/pmap.c +++ sys/riscv/riscv/pmap.c @@ -234,7 +234,7 @@ static struct rwlock_padalign pvh_global_lock; static struct mtx_padalign allpmaps_lock; -static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "VM/pmap parameters"); static int superpages_enabled = 1; @@ -242,7 +242,7 @@ CTLFLAG_RDTUN, &superpages_enabled, 0, "Enable support for transparent superpages"); -static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "2MB page mapping counters"); static u_long pmap_l2_demotions; Index: sys/rpc/rpcsec_gss/svc_rpcsec_gss.c =================================================================== --- sys/rpc/rpcsec_gss/svc_rpcsec_gss.c +++ sys/rpc/rpcsec_gss/svc_rpcsec_gss.c @@ -174,8 +174,10 @@ u_int svc_rpc_gss_client_max = CLIENT_MAX; u_int svc_rpc_gss_client_hash_size = CLIENT_HASH_SIZE; -SYSCTL_NODE(_kern, OID_AUTO, rpc, CTLFLAG_RW, 0, "RPC"); -SYSCTL_NODE(_kern_rpc, OID_AUTO, gss, CTLFLAG_RW, 0, "GSS"); +SYSCTL_NODE(_kern, OID_AUTO, rpc, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "RPC"); +SYSCTL_NODE(_kern_rpc, OID_AUTO, gss, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "GSS"); SYSCTL_UINT(_kern_rpc_gss, OID_AUTO, client_max, CTLFLAG_RW, &svc_rpc_gss_client_max, 0, Index: sys/rpc/svc.c =================================================================== --- sys/rpc/svc.c +++ sys/rpc/svc.c @@ -128,15 +128,15 @@ sysctl_ctx_init(&pool->sp_sysctl); if (sysctl_base) { SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, - "minthreads", CTLTYPE_INT | CTLFLAG_RW, + "minthreads", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, pool, 0, svcpool_minthread_sysctl, "I", "Minimal number of threads"); SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, - "maxthreads", CTLTYPE_INT | CTLFLAG_RW, + "maxthreads", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, pool, 0, svcpool_maxthread_sysctl, "I", "Maximal number of threads"); SYSCTL_ADD_PROC(&pool->sp_sysctl, sysctl_base, OID_AUTO, - "threads", CTLTYPE_INT | CTLFLAG_RD, + "threads", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, pool, 0, svcpool_threads_sysctl, "I", "Current number of threads"); SYSCTL_ADD_INT(&pool->sp_sysctl, sysctl_base, OID_AUTO, Index: sys/security/audit/audit.c =================================================================== --- sys/security/audit/audit.c +++ sys/security/audit/audit.c @@ -90,7 +90,7 @@ MALLOC_DEFINE(M_AUDITTEXT, "audit_text", "Audit text storage"); MALLOC_DEFINE(M_AUDITGIDSET, "audit_gidset", "Audit GID set storage"); -static SYSCTL_NODE(_security, OID_AUTO, audit, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security, OID_AUTO, audit, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD audit controls"); /* Index: sys/security/mac/mac_framework.c =================================================================== --- sys/security/mac/mac_framework.c +++ sys/security/mac/mac_framework.c @@ -103,7 +103,7 @@ /* * Root sysctl node for all MAC and MAC policy controls. */ -SYSCTL_NODE(_security, OID_AUTO, mac, CTLFLAG_RW, 0, +SYSCTL_NODE(_security, OID_AUTO, mac, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD MAC policy controls"); /* Index: sys/security/mac_biba/mac_biba.c =================================================================== --- sys/security/mac_biba/mac_biba.c +++ sys/security/mac_biba/mac_biba.c @@ -92,7 +92,8 @@ SYSCTL_DECL(_security_mac); -static SYSCTL_NODE(_security_mac, OID_AUTO, biba, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac, OID_AUTO, biba, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_biba policy controls"); static int biba_label_size = sizeof(struct mac_biba); Index: sys/security/mac_bsdextended/mac_bsdextended.c =================================================================== --- sys/security/mac_bsdextended/mac_bsdextended.c +++ sys/security/mac_bsdextended/mac_bsdextended.c @@ -72,7 +72,8 @@ SYSCTL_DECL(_security_mac); -static SYSCTL_NODE(_security_mac, OID_AUTO, bsdextended, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac, OID_AUTO, bsdextended, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD extended BSD MAC policy controls"); static int ugidfw_enabled = 1; Index: sys/security/mac_ifoff/mac_ifoff.c =================================================================== --- sys/security/mac_ifoff/mac_ifoff.c +++ sys/security/mac_ifoff/mac_ifoff.c @@ -62,7 +62,8 @@ SYSCTL_DECL(_security_mac); -static SYSCTL_NODE(_security_mac, OID_AUTO, ifoff, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac, OID_AUTO, ifoff, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_ifoff policy controls"); static int ifoff_enabled = 1; Index: sys/security/mac_lomac/mac_lomac.c =================================================================== --- sys/security/mac_lomac/mac_lomac.c +++ sys/security/mac_lomac/mac_lomac.c @@ -93,7 +93,8 @@ SYSCTL_DECL(_security_mac); -static SYSCTL_NODE(_security_mac, OID_AUTO, lomac, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac, OID_AUTO, lomac, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_lomac policy controls"); static int lomac_label_size = sizeof(struct mac_lomac); Index: sys/security/mac_mls/mac_mls.c =================================================================== --- sys/security/mac_mls/mac_mls.c +++ sys/security/mac_mls/mac_mls.c @@ -93,7 +93,8 @@ SYSCTL_DECL(_security_mac); -static SYSCTL_NODE(_security_mac, OID_AUTO, mls, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac, OID_AUTO, mls, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_mls policy controls"); static int mls_label_size = sizeof(struct mac_mls); Index: sys/security/mac_ntpd/mac_ntpd.c =================================================================== --- sys/security/mac_ntpd/mac_ntpd.c +++ sys/security/mac_ntpd/mac_ntpd.c @@ -38,7 +38,8 @@ SYSCTL_DECL(_security_mac); -static SYSCTL_NODE(_security_mac, OID_AUTO, ntpd, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac, OID_AUTO, ntpd, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "mac_ntpd policy controls"); static int ntpd_enabled = 1; Index: sys/security/mac_partition/mac_partition.c =================================================================== --- sys/security/mac_partition/mac_partition.c +++ sys/security/mac_partition/mac_partition.c @@ -65,7 +65,8 @@ SYSCTL_DECL(_security_mac); -static SYSCTL_NODE(_security_mac, OID_AUTO, partition, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac, OID_AUTO, partition, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_partition policy controls"); static int partition_enabled = 1; Index: sys/security/mac_portacl/mac_portacl.c =================================================================== --- sys/security/mac_portacl/mac_portacl.c +++ sys/security/mac_portacl/mac_portacl.c @@ -83,7 +83,8 @@ SYSCTL_DECL(_security_mac); -static SYSCTL_NODE(_security_mac, OID_AUTO, portacl, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac, OID_AUTO, portacl, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_portacl policy controls"); static int portacl_enabled = 1; @@ -372,7 +373,9 @@ } SYSCTL_PROC(_security_mac_portacl, OID_AUTO, rules, - CTLTYPE_STRING|CTLFLAG_RW, 0, 0, sysctl_rules, "A", "Rules"); + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, + 0, 0, sysctl_rules, "A", + "Rules"); static int rules_check(struct ucred *cred, int family, int type, u_int16_t port) Index: sys/security/mac_seeotheruids/mac_seeotheruids.c =================================================================== --- sys/security/mac_seeotheruids/mac_seeotheruids.c +++ sys/security/mac_seeotheruids/mac_seeotheruids.c @@ -63,7 +63,8 @@ SYSCTL_DECL(_security_mac); -static SYSCTL_NODE(_security_mac, OID_AUTO, seeotheruids, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac, OID_AUTO, seeotheruids, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_seeotheruids policy controls"); static int seeotheruids_enabled = 1; Index: sys/security/mac_stub/mac_stub.c =================================================================== --- sys/security/mac_stub/mac_stub.c +++ sys/security/mac_stub/mac_stub.c @@ -89,7 +89,8 @@ SYSCTL_DECL(_security_mac); -static SYSCTL_NODE(_security_mac, OID_AUTO, stub, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac, OID_AUTO, stub, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_stub policy controls"); static int stub_enabled = 1; Index: sys/security/mac_test/mac_test.c =================================================================== --- sys/security/mac_test/mac_test.c +++ sys/security/mac_test/mac_test.c @@ -80,7 +80,8 @@ SYSCTL_DECL(_security_mac); -static SYSCTL_NODE(_security_mac, OID_AUTO, test, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac, OID_AUTO, test, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_test policy controls"); #define MAGIC_BPF 0xfe1ad1b6 @@ -112,7 +113,8 @@ SYSCTL_INT(_security_mac_test, OID_AUTO, slot, CTLFLAG_RD, &test_slot, 0, "Slot allocated by framework"); -static SYSCTL_NODE(_security_mac_test, OID_AUTO, counter, CTLFLAG_RW, 0, +static SYSCTL_NODE(_security_mac_test, OID_AUTO, counter, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "TrustedBSD mac_test counters controls"); #define COUNTER_DECL(variable) \ Index: sys/security/mac_veriexec/mac_veriexec.c =================================================================== --- sys/security/mac_veriexec/mac_veriexec.c +++ sys/security/mac_veriexec/mac_veriexec.c @@ -76,7 +76,7 @@ SYSCTL_DECL(_security_mac); -SYSCTL_NODE(_security_mac, OID_AUTO, veriexec, CTLFLAG_RW, 0, +SYSCTL_NODE(_security_mac, OID_AUTO, veriexec, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "MAC/veriexec policy controls"); int mac_veriexec_debug; @@ -85,11 +85,13 @@ static int mac_veriexec_state; SYSCTL_PROC(_security_mac_veriexec, OID_AUTO, state, - CTLTYPE_STRING | CTLFLAG_RD, 0, 0, sysctl_mac_veriexec_state, "A", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_mac_veriexec_state, "A", "Verified execution subsystem state"); SYSCTL_PROC(_security_mac_veriexec, OID_AUTO, db, - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP, 0, 0, sysctl_mac_veriexec_db, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_mac_veriexec_db, "A", "Verified execution fingerprint database"); static int mac_veriexec_slot; Index: sys/security/mac_veriexec/veriexec_fingerprint.c =================================================================== --- sys/security/mac_veriexec/veriexec_fingerprint.c +++ sys/security/mac_veriexec/veriexec_fingerprint.c @@ -64,7 +64,8 @@ static int sysctl_mac_veriexec_algorithms(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_security_mac_veriexec, OID_AUTO, algorithms, - CTLTYPE_STRING | CTLFLAG_RD, 0, 0, sysctl_mac_veriexec_algorithms, "A", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_mac_veriexec_algorithms, "A", "Verified execution supported hashing algorithms"); static int Index: sys/sys/jail.h =================================================================== --- sys/sys/jail.h +++ sys/sys/jail.h @@ -353,9 +353,11 @@ CTLTYPE_STRUCT | CTLFLAG_MPSAFE | (access), NULL, len, \ sysctl_jail_param, fmt, descr) #define SYSCTL_JAIL_PARAM_NODE(module, descr) \ - SYSCTL_NODE(_security_jail_param, OID_AUTO, module, 0, 0, descr) + SYSCTL_NODE(_security_jail_param, OID_AUTO, module, CTLFLAG_MPSAFE, \ + 0, descr) #define SYSCTL_JAIL_PARAM_SUBNODE(parent, module, descr) \ - SYSCTL_NODE(_security_jail_param_##parent, OID_AUTO, module, 0, 0, descr) + SYSCTL_NODE(_security_jail_param_##parent, OID_AUTO, module, \ + CTLFLAG_MPSAFE, 0, descr) #define SYSCTL_JAIL_PARAM_SYS_NODE(module, access, descr) \ SYSCTL_JAIL_PARAM_NODE(module, descr); \ SYSCTL_JAIL_PARAM(_##module, , CTLTYPE_INT | (access), "E,jailsys", \ Index: sys/sys/sysctl.h =================================================================== --- sys/sys/sysctl.h +++ sys/sys/sysctl.h @@ -324,6 +324,7 @@ SYSCTL_OID_RAW(sysctl___##name, &sysctl__children, \ nbr, #name, CTLTYPE_NODE|(access), NULL, 0, \ handler, "N", descr, NULL); \ + SYSCTL_ENFORCE_FLAGS(access); \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE) Index: sys/tests/epoch/epoch_test.c =================================================================== --- sys/tests/epoch/epoch_test.c +++ sys/tests/epoch/epoch_test.c @@ -185,9 +185,12 @@ return (0); } -SYSCTL_NODE(_kern, OID_AUTO, epochtest, CTLFLAG_RW, 0, "Epoch Test Framework"); -SYSCTL_PROC(_kern_epochtest, OID_AUTO, runtest, (CTLTYPE_INT | CTLFLAG_RW), - 0, 0, epochtest_execute, "I", "Execute an epoch test"); +SYSCTL_NODE(_kern, OID_AUTO, epochtest, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Epoch Test Framework"); +SYSCTL_PROC(_kern_epochtest, OID_AUTO, runtest, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + 0, 0, epochtest_execute, "I", + "Execute an epoch test"); static int epoch_test_module_event_handler(module_t mod, int what, void *arg __unused) Index: sys/tests/framework/kern_testfrwk.c =================================================================== --- sys/tests/framework/kern_testfrwk.c +++ sys/tests/framework/kern_testfrwk.c @@ -166,9 +166,12 @@ static int kerntest_execute(SYSCTL_HANDLER_ARGS); -SYSCTL_NODE(_kern, OID_AUTO, testfrwk, CTLFLAG_RW, 0, "Kernel Test Framework"); -SYSCTL_PROC(_kern_testfrwk, OID_AUTO, runtest, (CTLTYPE_STRUCT | CTLFLAG_RW), - 0, 0, kerntest_execute, "IU", "Execute a kernel test"); +SYSCTL_NODE(_kern, OID_AUTO, testfrwk, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Kernel Test Framework"); +SYSCTL_PROC(_kern_testfrwk, OID_AUTO, runtest, + CTLTYPE_STRUCT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, kerntest_execute, "IU", + "Execute a kernel test"); int kerntest_execute(SYSCTL_HANDLER_ARGS) Index: sys/ufs/ffs/ffs_alloc.c =================================================================== --- sys/ufs/ffs/ffs_alloc.c +++ sys/ufs/ffs/ffs_alloc.c @@ -476,7 +476,8 @@ * allocation will be used. */ -SYSCTL_NODE(_vfs, OID_AUTO, ffs, CTLFLAG_RW, 0, "FFS filesystem"); +SYSCTL_NODE(_vfs, OID_AUTO, ffs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "FFS filesystem"); static int doasyncfree = 1; SYSCTL_INT(_vfs_ffs, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, @@ -3101,56 +3102,74 @@ static int sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS); -SYSCTL_PROC(_vfs_ffs, FFS_ADJ_REFCNT, adjrefcnt, CTLFLAG_WR|CTLTYPE_STRUCT, - 0, 0, sysctl_ffs_fsck, "S,fsck", "Adjust Inode Reference Count"); +SYSCTL_PROC(_vfs_ffs, FFS_ADJ_REFCNT, adjrefcnt, + CTLFLAG_WR | CTLTYPE_STRUCT | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_ffs_fsck, "S,fsck", + "Adjust Inode Reference Count"); -static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_BLKCNT, adjblkcnt, CTLFLAG_WR, - sysctl_ffs_fsck, "Adjust Inode Used Blocks Count"); +static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_BLKCNT, adjblkcnt, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Adjust Inode Used Blocks Count"); -static SYSCTL_NODE(_vfs_ffs, FFS_SET_SIZE, setsize, CTLFLAG_WR, - sysctl_ffs_fsck, "Set the inode size"); +static SYSCTL_NODE(_vfs_ffs, FFS_SET_SIZE, setsize, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Set the inode size"); -static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NDIR, adjndir, CTLFLAG_WR, - sysctl_ffs_fsck, "Adjust number of directories"); +static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NDIR, adjndir, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Adjust number of directories"); -static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NBFREE, adjnbfree, CTLFLAG_WR, - sysctl_ffs_fsck, "Adjust number of free blocks"); +static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NBFREE, adjnbfree, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Adjust number of free blocks"); -static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NIFREE, adjnifree, CTLFLAG_WR, - sysctl_ffs_fsck, "Adjust number of free inodes"); +static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NIFREE, adjnifree, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Adjust number of free inodes"); -static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NFFREE, adjnffree, CTLFLAG_WR, - sysctl_ffs_fsck, "Adjust number of free frags"); +static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NFFREE, adjnffree, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Adjust number of free frags"); -static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NUMCLUSTERS, adjnumclusters, CTLFLAG_WR, - sysctl_ffs_fsck, "Adjust number of free clusters"); +static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NUMCLUSTERS, adjnumclusters, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Adjust number of free clusters"); -static SYSCTL_NODE(_vfs_ffs, FFS_DIR_FREE, freedirs, CTLFLAG_WR, - sysctl_ffs_fsck, "Free Range of Directory Inodes"); +static SYSCTL_NODE(_vfs_ffs, FFS_DIR_FREE, freedirs, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Free Range of Directory Inodes"); -static SYSCTL_NODE(_vfs_ffs, FFS_FILE_FREE, freefiles, CTLFLAG_WR, - sysctl_ffs_fsck, "Free Range of File Inodes"); +static SYSCTL_NODE(_vfs_ffs, FFS_FILE_FREE, freefiles, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Free Range of File Inodes"); -static SYSCTL_NODE(_vfs_ffs, FFS_BLK_FREE, freeblks, CTLFLAG_WR, - sysctl_ffs_fsck, "Free Range of Blocks"); +static SYSCTL_NODE(_vfs_ffs, FFS_BLK_FREE, freeblks, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Free Range of Blocks"); -static SYSCTL_NODE(_vfs_ffs, FFS_SET_FLAGS, setflags, CTLFLAG_WR, - sysctl_ffs_fsck, "Change Filesystem Flags"); +static SYSCTL_NODE(_vfs_ffs, FFS_SET_FLAGS, setflags, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Change Filesystem Flags"); -static SYSCTL_NODE(_vfs_ffs, FFS_SET_CWD, setcwd, CTLFLAG_WR, - sysctl_ffs_fsck, "Set Current Working Directory"); +static SYSCTL_NODE(_vfs_ffs, FFS_SET_CWD, setcwd, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Set Current Working Directory"); -static SYSCTL_NODE(_vfs_ffs, FFS_SET_DOTDOT, setdotdot, CTLFLAG_WR, - sysctl_ffs_fsck, "Change Value of .. Entry"); +static SYSCTL_NODE(_vfs_ffs, FFS_SET_DOTDOT, setdotdot, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Change Value of .. Entry"); -static SYSCTL_NODE(_vfs_ffs, FFS_UNLINK, unlink, CTLFLAG_WR, - sysctl_ffs_fsck, "Unlink a Duplicate Name"); +static SYSCTL_NODE(_vfs_ffs, FFS_UNLINK, unlink, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Unlink a Duplicate Name"); -static SYSCTL_NODE(_vfs_ffs, FFS_SET_INODE, setinode, CTLFLAG_WR, - sysctl_ffs_fsck, "Update an On-Disk Inode"); +static SYSCTL_NODE(_vfs_ffs, FFS_SET_INODE, setinode, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Update an On-Disk Inode"); -static SYSCTL_NODE(_vfs_ffs, FFS_SET_BUFOUTPUT, setbufoutput, CTLFLAG_WR, - sysctl_ffs_fsck, "Set Buffered Writing for Descriptor"); +static SYSCTL_NODE(_vfs_ffs, FFS_SET_BUFOUTPUT, setbufoutput, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Set Buffered Writing for Descriptor"); #ifdef DIAGNOSTIC static int fsckcmds = 0; Index: sys/ufs/ffs/ffs_softdep.c =================================================================== --- sys/ufs/ffs/ffs_softdep.c +++ sys/ufs/ffs/ffs_softdep.c @@ -613,15 +613,19 @@ FEATURE(softupdates, "FFS soft-updates support"); -static SYSCTL_NODE(_debug, OID_AUTO, softdep, CTLFLAG_RW, 0, +static SYSCTL_NODE(_debug, OID_AUTO, softdep, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "soft updates stats"); -static SYSCTL_NODE(_debug_softdep, OID_AUTO, total, CTLFLAG_RW, 0, +static SYSCTL_NODE(_debug_softdep, OID_AUTO, total, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "total dependencies allocated"); -static SYSCTL_NODE(_debug_softdep, OID_AUTO, highuse, CTLFLAG_RW, 0, +static SYSCTL_NODE(_debug_softdep, OID_AUTO, highuse, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "high use dependencies allocated"); -static SYSCTL_NODE(_debug_softdep, OID_AUTO, current, CTLFLAG_RW, 0, +static SYSCTL_NODE(_debug_softdep, OID_AUTO, current, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "current dependencies allocated"); -static SYSCTL_NODE(_debug_softdep, OID_AUTO, write, CTLFLAG_RW, 0, +static SYSCTL_NODE(_debug_softdep, OID_AUTO, write, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "current dependencies written"); unsigned long dep_current[D_LAST + 1]; Index: sys/ufs/ufs/ufs_dirhash.c =================================================================== --- sys/ufs/ufs/ufs_dirhash.c +++ sys/ufs/ufs/ufs_dirhash.c @@ -90,7 +90,8 @@ static int ufs_dirhashreclaimpercent = 10; static int ufsdirhash_set_reclaimpercent(SYSCTL_HANDLER_ARGS); SYSCTL_PROC(_vfs_ufs, OID_AUTO, dirhash_reclaimpercent, - CTLTYPE_INT | CTLFLAG_RW, 0, 0, ufsdirhash_set_reclaimpercent, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, ufsdirhash_set_reclaimpercent, "I", "set percentage of dirhash cache to be removed in low VM events"); Index: sys/ufs/ufs/ufs_vnops.c =================================================================== --- sys/ufs/ufs/ufs_vnops.c +++ sys/ufs/ufs/ufs_vnops.c @@ -125,7 +125,8 @@ static vop_close_t ufsfifo_close; static vop_kqfilter_t ufsfifo_kqfilter; -SYSCTL_NODE(_vfs, OID_AUTO, ufs, CTLFLAG_RD, 0, "UFS filesystem"); +SYSCTL_NODE(_vfs, OID_AUTO, ufs, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "UFS filesystem"); /* * A virgin directory (no blushing please). Index: sys/vm/memguard.c =================================================================== --- sys/vm/memguard.c +++ sys/vm/memguard.c @@ -64,7 +64,8 @@ #include #include -static SYSCTL_NODE(_vm, OID_AUTO, memguard, CTLFLAG_RW, NULL, "MemGuard data"); +static SYSCTL_NODE(_vm, OID_AUTO, memguard, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "MemGuard data"); /* * The vm_memguard_divisor variable controls how much of kernel_arena should be * reserved for MemGuard. Index: sys/vm/redzone.c =================================================================== --- sys/vm/redzone.c +++ sys/vm/redzone.c @@ -38,7 +38,8 @@ #include -static SYSCTL_NODE(_vm, OID_AUTO, redzone, CTLFLAG_RW, NULL, "RedZone data"); +static SYSCTL_NODE(_vm, OID_AUTO, redzone, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "RedZone data"); static u_long redzone_extra_mem = 0; SYSCTL_ULONG(_vm_redzone, OID_AUTO, extra_mem, CTLFLAG_RD, &redzone_extra_mem, 0, "Extra memory allocated by redzone"); Index: sys/vm/swap_pager.c =================================================================== --- sys/vm/swap_pager.c +++ sys/vm/swap_pager.c @@ -156,7 +156,8 @@ static u_long swap_total; static int sysctl_page_shift(SYSCTL_HANDLER_ARGS); -static SYSCTL_NODE(_vm_stats, OID_AUTO, swap, CTLFLAG_RD, 0, "VM swap stats"); +static SYSCTL_NODE(_vm_stats, OID_AUTO, swap, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "VM swap stats"); SYSCTL_PROC(_vm, OID_AUTO, swap_reserved, CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, &swap_reserved, 0, sysctl_page_shift, "A", Index: sys/vm/uma_core.c =================================================================== --- sys/vm/uma_core.c +++ sys/vm/uma_core.c @@ -323,7 +323,7 @@ static uint64_t uma_zone_get_allocs(uma_zone_t zone); -static SYSCTL_NODE(_vm, OID_AUTO, debug, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm, OID_AUTO, debug, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Memory allocation debugging"); #ifdef INVARIANTS @@ -350,7 +350,8 @@ SYSINIT(uma_startup3, SI_SUB_VM_CONF, SI_ORDER_SECOND, uma_startup3, NULL); -SYSCTL_NODE(_vm, OID_AUTO, uma, CTLFLAG_RW, 0, "Universal Memory Allocator"); +SYSCTL_NODE(_vm, OID_AUTO, uma, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Universal Memory Allocator"); SYSCTL_PROC(_vm, OID_AUTO, zone_count, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLTYPE_INT, 0, 0, sysctl_vm_zone_count, "I", "Number of UMA zones"); @@ -2235,7 +2236,7 @@ * Basic parameters at the root. */ zone->uz_oid = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_vm_uma), - OID_AUTO, zone->uz_ctlname, CTLFLAG_RD, NULL, ""); + OID_AUTO, zone->uz_ctlname, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); oid = zone->uz_oid; SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "size", CTLFLAG_RD, &zone->uz_size, 0, "Allocation size"); @@ -2258,7 +2259,7 @@ else domains = 1; oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(zone->uz_oid), OID_AUTO, - "keg", CTLFLAG_RD, NULL, ""); + "keg", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); keg = zone->uz_keg; if ((zone->uz_flags & UMA_ZFLAG_CACHE) == 0) { SYSCTL_ADD_CONST_STRING(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, @@ -2280,12 +2281,12 @@ keg, 0, sysctl_handle_uma_slab_efficiency, "I", "Slab utilization (100 - internal fragmentation %)"); domainoid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(oid), - OID_AUTO, "domain", CTLFLAG_RD, NULL, ""); + OID_AUTO, "domain", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); for (i = 0; i < domains; i++) { dom = &keg->uk_domain[i]; oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(domainoid), - OID_AUTO, VM_DOMAIN(i)->vmd_name, CTLFLAG_RD, - NULL, ""); + OID_AUTO, VM_DOMAIN(i)->vmd_name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "pages", CTLFLAG_RD, &dom->ud_pages, 0, "Total pages currently allocated from VM"); @@ -2301,7 +2302,7 @@ * Information about zone limits. */ oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(zone->uz_oid), OID_AUTO, - "limit", CTLFLAG_RD, NULL, ""); + "limit", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "items", CTLFLAG_RD | CTLTYPE_U64 | CTLFLAG_MPSAFE, zone, 0, sysctl_handle_uma_zone_items, "QU", @@ -2326,13 +2327,14 @@ * Per-domain zone information. */ domainoid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(zone->uz_oid), - OID_AUTO, "domain", CTLFLAG_RD, NULL, ""); + OID_AUTO, "domain", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); if ((zone->uz_flags & UMA_ZONE_FIRSTTOUCH) == 0) domains = 1; for (i = 0; i < domains; i++) { zdom = &zone->uz_domain[i]; oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(domainoid), - OID_AUTO, VM_DOMAIN(i)->vmd_name, CTLFLAG_RD, NULL, ""); + OID_AUTO, VM_DOMAIN(i)->vmd_name, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); SYSCTL_ADD_LONG(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "nitems", CTLFLAG_RD, &zdom->uzd_nitems, "number of items in this domain"); @@ -2351,7 +2353,7 @@ * General statistics. */ oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(zone->uz_oid), OID_AUTO, - "stats", CTLFLAG_RD, NULL, ""); + "stats", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "current", CTLFLAG_RD | CTLTYPE_INT | CTLFLAG_MPSAFE, zone, 1, sysctl_handle_uma_zone_cur, "I", Index: sys/vm/vm_meter.c =================================================================== --- sys/vm/vm_meter.c +++ sys/vm/vm_meter.c @@ -313,12 +313,14 @@ SYSCTL_PROC(_vm, VM_TOTAL, vmtotal, CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, vmtotal, "S,vmtotal", "System virtual memory statistics"); -SYSCTL_NODE(_vm, OID_AUTO, stats, CTLFLAG_RW, 0, "VM meter stats"); -static SYSCTL_NODE(_vm_stats, OID_AUTO, sys, CTLFLAG_RW, 0, - "VM meter sys stats"); -static SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, - "VM meter vm stats"); -SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats"); +SYSCTL_NODE(_vm, OID_AUTO, stats, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "VM meter stats"); +static SYSCTL_NODE(_vm_stats, OID_AUTO, sys, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "VM meter sys stats"); +static SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "VM meter vm stats"); +SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "VM meter misc stats"); static int sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) @@ -501,9 +503,9 @@ struct sysctl_oid *oid; vmd->vmd_oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(parent), OID_AUTO, - vmd->vmd_name, CTLFLAG_RD, NULL, ""); + vmd->vmd_name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(vmd->vmd_oid), OID_AUTO, - "stats", CTLFLAG_RD, NULL, ""); + "stats", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "free_count", CTLFLAG_RD, &vmd->vmd_free_count, 0, "Free pages"); @@ -560,7 +562,7 @@ int i; oid = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_vm), OID_AUTO, - "domain", CTLFLAG_RD, NULL, ""); + "domain", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); for (i = 0; i < vm_ndomains; i++) vm_domain_stats_init(VM_DOMAIN(i), oid); } Index: sys/vm/vm_object.c =================================================================== --- sys/vm/vm_object.c +++ sys/vm/vm_object.c @@ -149,7 +149,7 @@ struct vm_object kernel_object_store; -static SYSCTL_NODE(_vm_stats, OID_AUTO, object, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_stats, OID_AUTO, object, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "VM object stats"); static counter_u64_t object_collapses = EARLY_COUNTER; Index: sys/vm/vm_page.c =================================================================== --- sys/vm/vm_page.c +++ sys/vm/vm_page.c @@ -127,7 +127,7 @@ static int vm_severe_waiters; static int vm_pageproc_waiters; -static SYSCTL_NODE(_vm_stats, OID_AUTO, page, CTLFLAG_RD, 0, +static SYSCTL_NODE(_vm_stats, OID_AUTO, page, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "VM page statistics"); static counter_u64_t pqstate_commit_retries = EARLY_COUNTER; Index: sys/vm/vm_pageout.c =================================================================== --- sys/vm/vm_pageout.c +++ sys/vm/vm_pageout.c @@ -2133,7 +2133,7 @@ vmd->vmd_free_target, PIDCTRL_BOUND, PIDCTRL_KPD, PIDCTRL_KID, PIDCTRL_KDD); oid = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(vmd->vmd_oid), OID_AUTO, - "pidctrl", CTLFLAG_RD, NULL, ""); + "pidctrl", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); pidctrl_init_sysctl(&vmd->vmd_pid, SYSCTL_CHILDREN(oid)); } Index: sys/vm/vm_phys.c =================================================================== --- sys/vm/vm_phys.c +++ sys/vm/vm_phys.c @@ -148,17 +148,23 @@ #endif static int sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS); -SYSCTL_OID(_vm, OID_AUTO, phys_free, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_vm_phys_free, "A", "Phys Free Info"); +SYSCTL_OID(_vm, OID_AUTO, phys_free, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_vm_phys_free, "A", + "Phys Free Info"); static int sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS); -SYSCTL_OID(_vm, OID_AUTO, phys_segs, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_vm_phys_segs, "A", "Phys Seg Info"); +SYSCTL_OID(_vm, OID_AUTO, phys_segs, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_vm_phys_segs, "A", + "Phys Seg Info"); #ifdef NUMA static int sysctl_vm_phys_locality(SYSCTL_HANDLER_ARGS); -SYSCTL_OID(_vm, OID_AUTO, phys_locality, CTLTYPE_STRING | CTLFLAG_RD, - NULL, 0, sysctl_vm_phys_locality, "A", "Phys Locality Info"); +SYSCTL_OID(_vm, OID_AUTO, phys_locality, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_vm_phys_locality, "A", + "Phys Locality Info"); #endif SYSCTL_INT(_vm, OID_AUTO, ndomains, CTLFLAG_RD, Index: sys/vm/vm_reserv.c =================================================================== --- sys/vm/vm_reserv.c +++ sys/vm/vm_reserv.c @@ -261,7 +261,8 @@ #define vm_reserv_domain_scan_lock(d) mtx_lock(&vm_rvd[(d)].marker.lock) #define vm_reserv_domain_scan_unlock(d) mtx_unlock(&vm_rvd[(d)].marker.lock) -static SYSCTL_NODE(_vm, OID_AUTO, reserv, CTLFLAG_RD, 0, "Reservation Info"); +static SYSCTL_NODE(_vm, OID_AUTO, reserv, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Reservation Info"); static counter_u64_t vm_reserv_broken = EARLY_COUNTER; SYSCTL_COUNTER_U64(_vm_reserv, OID_AUTO, broken, CTLFLAG_RD, @@ -278,8 +279,10 @@ static int sysctl_vm_reserv_partpopq(SYSCTL_HANDLER_ARGS); -SYSCTL_OID(_vm_reserv, OID_AUTO, partpopq, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, - sysctl_vm_reserv_partpopq, "A", "Partially populated reservation queues"); +SYSCTL_OID(_vm_reserv, OID_AUTO, partpopq, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, NULL, 0, + sysctl_vm_reserv_partpopq, "A", + "Partially populated reservation queues"); static counter_u64_t vm_reserv_reclaimed = EARLY_COUNTER; SYSCTL_COUNTER_U64(_vm_reserv, OID_AUTO, reclaimed, CTLFLAG_RD, Index: sys/x86/bios/vpd.c =================================================================== --- sys/x86/bios/vpd.c +++ sys/x86/bios/vpd.c @@ -105,14 +105,29 @@ static int vpd_cksum (struct vpd *); -static SYSCTL_NODE(_hw, OID_AUTO, vpd, CTLFLAG_RD, NULL, NULL); -static SYSCTL_NODE(_hw_vpd, OID_AUTO, machine, CTLFLAG_RD, NULL, NULL); -static SYSCTL_NODE(_hw_vpd_machine, OID_AUTO, type, CTLFLAG_RD, NULL, NULL); -static SYSCTL_NODE(_hw_vpd_machine, OID_AUTO, model, CTLFLAG_RD, NULL, NULL); -static SYSCTL_NODE(_hw_vpd, OID_AUTO, build_id, CTLFLAG_RD, NULL, NULL); -static SYSCTL_NODE(_hw_vpd, OID_AUTO, serial, CTLFLAG_RD, NULL, NULL); -static SYSCTL_NODE(_hw_vpd_serial, OID_AUTO, box, CTLFLAG_RD, NULL, NULL); -static SYSCTL_NODE(_hw_vpd_serial, OID_AUTO, planar, CTLFLAG_RD, NULL, NULL); +static SYSCTL_NODE(_hw, OID_AUTO, vpd, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + NULL); +static SYSCTL_NODE(_hw_vpd, OID_AUTO, machine, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + NULL); +static SYSCTL_NODE(_hw_vpd_machine, OID_AUTO, type, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + NULL); +static SYSCTL_NODE(_hw_vpd_machine, OID_AUTO, model, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + NULL); +static SYSCTL_NODE(_hw_vpd, OID_AUTO, build_id, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + NULL); +static SYSCTL_NODE(_hw_vpd, OID_AUTO, serial, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + NULL); +static SYSCTL_NODE(_hw_vpd_serial, OID_AUTO, box, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + NULL); +static SYSCTL_NODE(_hw_vpd_serial, OID_AUTO, planar, + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + NULL); static void vpd_identify (driver_t *driver, device_t parent) Index: sys/x86/cpufreq/hwpstate_intel.c =================================================================== --- sys/x86/cpufreq/hwpstate_intel.c +++ sys/x86/cpufreq/hwpstate_intel.c @@ -505,12 +505,12 @@ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_STATIC_CHILDREN(_debug), OID_AUTO, device_get_nameunit(dev), - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_NEEDGIANT, sc, 0, intel_hwp_dump_sysctl_handler, "A", ""); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, - "epp", CTLTYPE_INT | CTLFLAG_RWTUN, dev, 0, + "epp", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, dev, 0, sysctl_epp_select, "I", "Efficiency/Performance Preference " "(range from 0, most performant, through 100, most efficient)"); Index: sys/x86/iommu/intel_utils.c =================================================================== --- sys/x86/iommu/intel_utils.c +++ sys/x86/iommu/intel_utils.c @@ -654,7 +654,8 @@ return (error); } -static SYSCTL_NODE(_hw, OID_AUTO, dmar, CTLFLAG_RD, NULL, ""); +static SYSCTL_NODE(_hw, OID_AUTO, dmar, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + ""); SYSCTL_INT(_hw_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, &dmar_tbl_pagecnt, 0, "Count of pages used for DMAR pagetables"); Index: sys/x86/isa/clock.c =================================================================== --- sys/x86/isa/clock.c +++ sys/x86/isa/clock.c @@ -473,7 +473,8 @@ return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, i8254_freq, CTLTYPE_INT | CTLFLAG_RW, +SYSCTL_PROC(_machdep, OID_AUTO, i8254_freq, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(u_int), sysctl_machdep_i8254_freq, "IU", "i8254 timer frequency"); Index: sys/x86/x86/busdma_bounce.c =================================================================== --- sys/x86/x86/busdma_bounce.c +++ sys/x86/x86/busdma_bounce.c @@ -114,7 +114,8 @@ static int busdma_zonecount; static STAILQ_HEAD(, bounce_zone) bounce_zone_list; -static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters"); +static SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Busdma parameters"); SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0, "Total bounce pages"); @@ -1125,7 +1126,7 @@ sysctl_ctx_init(&bz->sysctl_tree); bz->sysctl_tree_top = SYSCTL_ADD_NODE(&bz->sysctl_tree, SYSCTL_STATIC_CHILDREN(_hw_busdma), OID_AUTO, bz->zoneid, - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (bz->sysctl_tree_top == NULL) { sysctl_ctx_free(&bz->sysctl_tree); return (0); /* XXX error code? */ Index: sys/x86/x86/cpu_machdep.c =================================================================== --- sys/x86/x86/cpu_machdep.c +++ sys/x86/x86/cpu_machdep.c @@ -741,8 +741,10 @@ return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, idle_sysctl_available, "A", "list of available idle functions"); +SYSCTL_PROC(_machdep, OID_AUTO, idle_available, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + 0, 0, idle_sysctl_available, "A", + "list of available idle functions"); static bool cpu_idle_selector(const char *new_idle_name) @@ -786,8 +788,10 @@ return (cpu_idle_selector(buf) ? 0 : EINVAL); } -SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, - cpu_idle_sysctl, "A", "currently selected idle function"); +SYSCTL_PROC(_machdep, OID_AUTO, idle, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, cpu_idle_sysctl, "A", + "currently selected idle function"); static void cpu_idle_tun(void *unused __unused) @@ -877,7 +881,8 @@ SYSCTL_INT(_hw, OID_AUTO, ibrs_active, CTLFLAG_RD, &hw_ibrs_active, 0, "Indirect Branch Restricted Speculation active"); -SYSCTL_NODE(_machdep_mitigations, OID_AUTO, ibrs, CTLFLAG_RW, 0, +SYSCTL_NODE(_machdep_mitigations, OID_AUTO, ibrs, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Indirect Branch Restricted Speculation active"); SYSCTL_INT(_machdep_mitigations_ibrs, OID_AUTO, active, CTLFLAG_RD, @@ -925,7 +930,8 @@ &hw_ssb_active, 0, "Speculative Store Bypass Disable active"); -SYSCTL_NODE(_machdep_mitigations, OID_AUTO, ssb, CTLFLAG_RW, 0, +SYSCTL_NODE(_machdep_mitigations, OID_AUTO, ssb, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Speculative Store Bypass Disable active"); SYSCTL_INT(_machdep_mitigations_ssb, OID_AUTO, active, CTLFLAG_RD, @@ -1038,7 +1044,8 @@ sysctl_hw_mds_disable_state_handler, "A", "Microarchitectural Data Sampling Mitigation state"); -SYSCTL_NODE(_machdep_mitigations, OID_AUTO, mds, CTLFLAG_RW, 0, +SYSCTL_NODE(_machdep_mitigations, OID_AUTO, mds, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Microarchitectural Data Sampling Mitigation state"); SYSCTL_PROC(_machdep_mitigations_mds, OID_AUTO, state, @@ -1321,8 +1328,9 @@ } SYSINIT(taa_recalc, SI_SUB_SMP, SI_ORDER_ANY, taa_recalculate_boot, NULL); -SYSCTL_NODE(_machdep_mitigations, OID_AUTO, taa, CTLFLAG_RW, 0, - "TSX Asynchronous Abort Mitigation"); +SYSCTL_NODE(_machdep_mitigations, OID_AUTO, taa, + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TSX Asynchronous Abort Mitigation"); static int sysctl_taa_handler(SYSCTL_HANDLER_ARGS) Index: sys/x86/x86/intr_machdep.c =================================================================== --- sys/x86/x86/intr_machdep.c +++ sys/x86/x86/intr_machdep.c @@ -750,8 +750,10 @@ sbuf_delete(&sbuf); return (error); } -SYSCTL_PROC(_hw, OID_AUTO, intrs, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, sysctl_hw_intrs, "A", "interrupt:number @cpu: count"); +SYSCTL_PROC(_hw, OID_AUTO, intrs, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + 0, 0, sysctl_hw_intrs, "A", + "interrupt:number @cpu: count"); /* * Compare two, possibly NULL, entries in the interrupt source array Index: sys/x86/x86/local_apic.c =================================================================== --- sys/x86/x86/local_apic.c +++ sys/x86/x86/local_apic.c @@ -204,7 +204,8 @@ #endif unsigned int max_apic_id; -SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options"); +SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "APIC options"); SYSCTL_INT(_hw_apic, OID_AUTO, x2apic_mode, CTLFLAG_RD, &x2apic_mode, 0, ""); SYSCTL_INT(_hw_apic, OID_AUTO, eoi_suppression, CTLFLAG_RD, &lapic_eoi_suppression, 0, ""); Index: sys/x86/x86/mca.c =================================================================== --- sys/x86/x86/mca.c +++ sys/x86/x86/mca.c @@ -102,7 +102,7 @@ static int mca_banks; /* Number of per-CPU register banks. */ static int mca_maxcount = -1; /* Limit on records stored. (-1 = unlimited) */ -static SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD, NULL, +static SYSCTL_NODE(_hw, OID_AUTO, mca, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Machine Check Architecture"); static int mca_enabled = 1; @@ -1041,7 +1041,8 @@ 0, sysctl_positive_int, "I", "Periodic interval in seconds to scan for machine checks"); SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, - "records", CTLFLAG_RD, sysctl_mca_records, "Machine check records"); + "records", CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_mca_records, + "Machine check records"); SYSCTL_ADD_PROC(NULL, SYSCTL_STATIC_CHILDREN(_hw_mca), OID_AUTO, "force_scan", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, sysctl_mca_scan, "I", "Force an immediate scan for machine checks"); Index: sys/x86/x86/mp_watchdog.c =================================================================== --- sys/x86/x86/mp_watchdog.c +++ sys/x86/x86/mp_watchdog.c @@ -149,8 +149,10 @@ watchdog_change(temp); return (0); } -SYSCTL_PROC(_debug, OID_AUTO, watchdog, CTLTYPE_INT|CTLFLAG_RW, 0, 0, - sysctl_watchdog, "I", ""); +SYSCTL_PROC(_debug, OID_AUTO, watchdog, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_watchdog, "I", + ""); /* * Drop into the debugger by sending an IPI NMI to the boot processor. Index: sys/x86/x86/mp_x86.c =================================================================== --- sys/x86/x86/mp_x86.c +++ sys/x86/x86/mp_x86.c @@ -1150,7 +1150,8 @@ u_int xhits_gbl[MAXCPU]; u_int xhits_pg[MAXCPU]; u_int xhits_rng[MAXCPU]; -static SYSCTL_NODE(_debug, OID_AUTO, xhits, CTLFLAG_RW, 0, ""); +static SYSCTL_NODE(_debug, OID_AUTO, xhits, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + ""); SYSCTL_OPAQUE(_debug_xhits, OID_AUTO, global, CTLFLAG_RW, &xhits_gbl, sizeof(xhits_gbl), "IU", ""); SYSCTL_OPAQUE(_debug_xhits, OID_AUTO, page, CTLFLAG_RW, &xhits_pg, Index: sys/x86/x86/tsc.c =================================================================== --- sys/x86/x86/tsc.c +++ sys/x86/x86/tsc.c @@ -754,8 +754,10 @@ return (error); } -SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_U64 | CTLFLAG_RW, - 0, 0, sysctl_machdep_tsc_freq, "QU", "Time Stamp Counter frequency"); +SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, + CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_NEEDGIANT, + 0, 0, sysctl_machdep_tsc_freq, "QU", + "Time Stamp Counter frequency"); static u_int tsc_get_timecount(struct timecounter *tc __unused)