From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 13:43:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DAD04E27FC; Mon, 25 Jan 2021 13:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPWK71GpDz4RkT; Mon, 25 Jan 2021 13:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13E8917179; Mon, 25 Jan 2021 13:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PDh7qp023040; Mon, 25 Jan 2021 13:43:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PDh7Fm023039; Mon, 25 Jan 2021 13:43:07 GMT (envelope-from git) Date: Mon, 25 Jan 2021 13:43:07 GMT Message-Id: <202101251343.10PDh7Fm023039@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 28388d8abf8e - stable/12 - ddb: add ability to print user registers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 28388d8abf8e2c7ac9247b138479832f96bcddc3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 13:43:07 -0000 The branch stable/12 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=28388d8abf8e2c7ac9247b138479832f96bcddc3 commit 28388d8abf8e2c7ac9247b138479832f96bcddc3 Author: mhorne AuthorDate: 2020-12-18 20:06:46 +0000 Commit: Mitchell Horne CommitDate: 2021-01-25 13:41:39 +0000 ddb: add ability to print user registers Reviewed by: jhb (earlier version), markj, bcr (manpages) Sponsored by: The FreeBSD Foundation (cherry picked from commit 088a7eef95b1f1919fe6eee722a57c4d4e1e0656) --- share/man/man4/ddb.4 | 10 +++------- sys/ddb/db_print.c | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index 188b5c8fc5ec..28a54a49322d 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -934,14 +934,10 @@ at address Display the register set. If the .Cm u -modifier is specified, it displays user registers instead of -kernel registers or the currently saved one. +modifier is specified, the register contents of the thread's previous +trapframe are displayed instead. +Usually, this corresponds to the saved state from userspace. .Pp -.Sy Warning : -The support of the -.Cm u -modifier depends on the machine. -If not supported, incorrect information will be displayed. .\" .Pp .It Ic show Cm rman Ar addr diff --git a/sys/ddb/db_print.c b/sys/ddb/db_print.c index 3ff0b781532d..da929457984d 100644 --- a/sys/ddb/db_print.c +++ b/sys/ddb/db_print.c @@ -49,12 +49,32 @@ __FBSDID("$FreeBSD$"); #include void -db_show_regs(db_expr_t _1, bool _2, db_expr_t _3, char *_4) +db_show_regs(db_expr_t _1, bool _2, db_expr_t _3, char *modif) { + struct trapframe *oldtf; struct db_variable *regp; db_expr_t value, offset; const char *name; + /* + * The 'u' modifier instructs us to print the previous trapframe, most + * often containing state from userspace. This is done by temporarily + * switching out kdb_frame. + * + * NB: curthread is used instead of kdb_thread, so that behaviour is + * consistent with regular `show registers`, which always prints + * curthread's trapframe. + */ + oldtf = kdb_frame; + if (modif[0] == 'u') { + if (curthread->td_frame == NULL || + curthread->td_frame == oldtf) { + db_printf("previous trapframe unavailable"); + return; + } + kdb_frame = curthread->td_frame; + } + for (regp = db_regs; regp < db_eregs; regp++) { if (!db_read_variable(regp, &value)) continue; @@ -70,4 +90,6 @@ db_show_regs(db_expr_t _1, bool _2, db_expr_t _3, char *_4) db_printf("\n"); } db_print_loc_and_inst(PC_REGS()); + + kdb_frame = oldtf; } From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 14:09:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF7CB4E32EC; Mon, 25 Jan 2021 14:09:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPWvc4WRKz4Sqj; Mon, 25 Jan 2021 14:09:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DCB817D88; Mon, 25 Jan 2021 14:09:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PE9WhG049800; Mon, 25 Jan 2021 14:09:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PE9Whu049799; Mon, 25 Jan 2021 14:09:32 GMT (envelope-from git) Date: Mon, 25 Jan 2021 14:09:32 GMT Message-Id: <202101251409.10PE9Whu049799@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 0fd0e98e50f3 - stable/12 - arm64: don't pass user trapframe to kdb_trap() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0fd0e98e50f3332c9f57c4046070237647da2ef9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 14:09:32 -0000 The branch stable/12 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=0fd0e98e50f3332c9f57c4046070237647da2ef9 commit 0fd0e98e50f3332c9f57c4046070237647da2ef9 Author: mhorne AuthorDate: 2020-12-18 18:43:52 +0000 Commit: Mitchell Horne CommitDate: 2021-01-25 13:55:25 +0000 arm64: don't pass user trapframe to kdb_trap() Reviewed by: jhb (slightly earlier version) Sponsored by: The FreeBSD Foundation (cherry picked from commit e9bb4ce3d0e714d35b12ffdc7ecb56cade01f4a0) --- sys/arm64/arm64/trap.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index cfd90e425593..5d14052d7789 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -271,7 +271,6 @@ print_registers(struct trapframe *frame) void do_el1h_sync(struct thread *td, struct trapframe *frame) { - struct trapframe *oframe; uint32_t exception; uint64_t esr, far; @@ -288,18 +287,6 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) "do_el1_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", td, esr, frame->tf_elr, frame); - oframe = td->td_frame; - - switch (exception) { - case EXCP_BRK: - case EXCP_WATCHPT_EL1: - case EXCP_SOFTSTP_EL1: - break; - default: - td->td_frame = frame; - break; - } - switch(exception) { case EXCP_FP_SIMD: case EXCP_TRAP_FP: @@ -330,18 +317,15 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) } #endif #ifdef KDB - kdb_trap(exception, 0, - (td->td_frame != NULL) ? td->td_frame : frame); + kdb_trap(exception, 0, frame); #else panic("No debugger in kernel.\n"); #endif - frame->tf_elr += 4; break; case EXCP_WATCHPT_EL1: case EXCP_SOFTSTP_EL1: #ifdef KDB - kdb_trap(exception, 0, - (td->td_frame != NULL) ? td->td_frame : frame); + kdb_trap(exception, 0, frame); #else panic("No debugger in kernel.\n"); #endif @@ -355,8 +339,6 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) panic("Unknown kernel exception %x esr_el1 %lx\n", exception, esr); } - - td->td_frame = oframe; } void From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 14:09:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C90F4E32F5; Mon, 25 Jan 2021 14:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPWvs353nz4SrJ; Mon, 25 Jan 2021 14:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D06717C32; Mon, 25 Jan 2021 14:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PE9jWC049936; Mon, 25 Jan 2021 14:09:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PE9jr8049935; Mon, 25 Jan 2021 14:09:45 GMT (envelope-from git) Date: Mon, 25 Jan 2021 14:09:45 GMT Message-Id: <202101251409.10PE9jr8049935@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 7937837f11b6 - stable/12 - arm64: remove pcb_pc MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7937837f11b648193cb1ad44947eb941b63cc197 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 14:09:45 -0000 The branch stable/12 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=7937837f11b648193cb1ad44947eb941b63cc197 commit 7937837f11b648193cb1ad44947eb941b63cc197 Author: mhorne AuthorDate: 2020-12-21 16:16:09 +0000 Commit: Mitchell Horne CommitDate: 2021-01-25 13:57:30 +0000 arm64: remove pcb_pc Reviewed by: markj, jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit 5f66d5a313bf2b2254de92b2915e48e5cf528893) --- sys/arm64/arm64/db_trace.c | 2 +- sys/arm64/arm64/exception.S | 2 +- sys/arm64/arm64/genassym.c | 1 + sys/arm64/arm64/machdep.c | 6 +++--- sys/arm64/arm64/stack_machdep.c | 2 +- sys/arm64/arm64/swtch.S | 8 ++++---- sys/arm64/arm64/vm_machdep.c | 6 +++--- sys/arm64/include/db_machdep.h | 2 +- sys/arm64/include/pcb.h | 6 +++--- 9 files changed, 18 insertions(+), 17 deletions(-) diff --git a/sys/arm64/arm64/db_trace.c b/sys/arm64/arm64/db_trace.c index ee20e9f14f0a..82b6e07fc261 100644 --- a/sys/arm64/arm64/db_trace.c +++ b/sys/arm64/arm64/db_trace.c @@ -111,7 +111,7 @@ db_trace_thread(struct thread *thr, int count) frame.sp = (uint64_t)ctx->pcb_sp; frame.fp = (uint64_t)ctx->pcb_x[29]; - frame.pc = (uint64_t)ctx->pcb_x[30]; + frame.pc = (uintptr_t)ctx->pcb_lr; db_stack_trace_cmd(&frame); } else db_trace_self(); diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index d3242f4ac0b7..19dd9e9d85e2 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); sub sp, sp, #128 .endif sub sp, sp, #(TF_SIZE + 16) - stp x29, x30, [sp, #(TF_SIZE)] + stp x29, lr, [sp, #(TF_SIZE)] stp x28, x29, [sp, #(TF_X + 28 * 8)] stp x26, x27, [sp, #(TF_X + 26 * 8)] stp x24, x25, [sp, #(TF_X + 24 * 8)] diff --git a/sys/arm64/arm64/genassym.c b/sys/arm64/arm64/genassym.c index debe63c62659..8bd4b791d417 100644 --- a/sys/arm64/arm64/genassym.c +++ b/sys/arm64/arm64/genassym.c @@ -49,6 +49,7 @@ ASSYM(PC_SSBD, offsetof(struct pcpu, pc_ssbd)); ASSYM(PCB_SIZE, roundup2(sizeof(struct pcb), STACKALIGNBYTES + 1)); ASSYM(PCB_SINGLE_STEP_SHIFT, PCB_SINGLE_STEP_SHIFT); ASSYM(PCB_REGS, offsetof(struct pcb, pcb_x)); +ASSYM(PCB_LR, offsetof(struct pcb, pcb_lr)); ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); ASSYM(PCB_TPIDRRO, offsetof(struct pcb, pcb_tpidrro_el0)); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 90a2659d9521..c0df74bd1f6f 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -631,11 +631,11 @@ makectx(struct trapframe *tf, struct pcb *pcb) { int i; - for (i = 0; i < PCB_LR; i++) + for (i = 0; i < nitems(pcb->pcb_x); i++) pcb->pcb_x[i] = tf->tf_x[i]; - pcb->pcb_x[PCB_LR] = tf->tf_lr; - pcb->pcb_pc = tf->tf_elr; + /* NB: pcb_lr is the PC, see PC_REGS() in db_machdep.h */ + pcb->pcb_lr = tf->tf_elr; pcb->pcb_sp = tf->tf_sp; } diff --git a/sys/arm64/arm64/stack_machdep.c b/sys/arm64/arm64/stack_machdep.c index 0212c6335a05..feba7e41286d 100644 --- a/sys/arm64/arm64/stack_machdep.c +++ b/sys/arm64/arm64/stack_machdep.c @@ -67,7 +67,7 @@ stack_save_td(struct stack *st, struct thread *td) frame.sp = td->td_pcb->pcb_sp; frame.fp = td->td_pcb->pcb_x[29]; - frame.pc = td->td_pcb->pcb_x[30]; + frame.pc = td->td_pcb->pcb_lr; stack_capture(st, &frame); } diff --git a/sys/arm64/arm64/swtch.S b/sys/arm64/arm64/swtch.S index d9921f7e9528..bc87114dd0ee 100644 --- a/sys/arm64/arm64/swtch.S +++ b/sys/arm64/arm64/swtch.S @@ -101,7 +101,7 @@ ENTRY(cpu_throw) ldp x24, x25, [x4, #PCB_REGS + 24 * 8] ldp x26, x27, [x4, #PCB_REGS + 26 * 8] ldp x28, x29, [x4, #PCB_REGS + 28 * 8] - ldr x30, [x4, #PCB_REGS + 30 * 8] + ldr lr, [x4, #PCB_LR] ret END(cpu_throw) @@ -132,7 +132,7 @@ ENTRY(cpu_switch) stp x24, x25, [x4, #PCB_REGS + 24 * 8] stp x26, x27, [x4, #PCB_REGS + 26 * 8] stp x28, x29, [x4, #PCB_REGS + 28 * 8] - str x30, [x4, #PCB_REGS + 30 * 8] + str lr, [x4, #PCB_LR] /* And the old stack pointer */ mov x5, sp mrs x6, tpidrro_el0 @@ -198,7 +198,7 @@ ENTRY(cpu_switch) ldp x24, x25, [x4, #PCB_REGS + 24 * 8] ldp x26, x27, [x4, #PCB_REGS + 26 * 8] ldp x28, x29, [x4, #PCB_REGS + 28 * 8] - ldr x30, [x4, #PCB_REGS + 30 * 8] + ldr lr, [x4, #PCB_LR] str xzr, [x4, #PCB_REGS + 18 * 8] ret @@ -270,7 +270,7 @@ ENTRY(savectx) stp x24, x25, [x0, #PCB_REGS + 24 * 8] stp x26, x27, [x0, #PCB_REGS + 26 * 8] stp x28, x29, [x0, #PCB_REGS + 28 * 8] - str x30, [x0, #PCB_REGS + 30 * 8] + str lr, [x0, #PCB_LR] /* And the old stack pointer */ mov x5, sp mrs x6, tpidrro_el0 diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index 8f0dfa1a15e7..1d6ccace82ed 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -104,7 +104,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct thread *td2, int flags) /* Set the return value registers for fork() */ td2->td_pcb->pcb_x[8] = (uintptr_t)fork_return; td2->td_pcb->pcb_x[9] = (uintptr_t)td2; - td2->td_pcb->pcb_x[PCB_LR] = (uintptr_t)fork_trampoline; + td2->td_pcb->pcb_lr = (uintptr_t)fork_trampoline; td2->td_pcb->pcb_sp = (uintptr_t)td2->td_frame; td2->td_pcb->pcb_fpusaved = &td2->td_pcb->pcb_fpustate; td2->td_pcb->pcb_vfpcpu = UINT_MAX; @@ -175,7 +175,7 @@ cpu_copy_thread(struct thread *td, struct thread *td0) td->td_pcb->pcb_x[8] = (uintptr_t)fork_return; td->td_pcb->pcb_x[9] = (uintptr_t)td; - td->td_pcb->pcb_x[PCB_LR] = (uintptr_t)fork_trampoline; + td->td_pcb->pcb_lr = (uintptr_t)fork_trampoline; td->td_pcb->pcb_sp = (uintptr_t)td->td_frame; td->td_pcb->pcb_fpusaved = &td->td_pcb->pcb_fpustate; td->td_pcb->pcb_vfpcpu = UINT_MAX; @@ -253,7 +253,7 @@ cpu_fork_kthread_handler(struct thread *td, void (*func)(void *), void *arg) td->td_pcb->pcb_x[8] = (uintptr_t)func; td->td_pcb->pcb_x[9] = (uintptr_t)arg; - td->td_pcb->pcb_x[PCB_LR] = (uintptr_t)fork_trampoline; + td->td_pcb->pcb_lr = (uintptr_t)fork_trampoline; td->td_pcb->pcb_sp = (uintptr_t)td->td_frame; td->td_pcb->pcb_fpusaved = &td->td_pcb->pcb_fpustate; td->td_pcb->pcb_vfpcpu = UINT_MAX; diff --git a/sys/arm64/include/db_machdep.h b/sys/arm64/include/db_machdep.h index 45d548c750bc..f2fd2a57a9c3 100644 --- a/sys/arm64/include/db_machdep.h +++ b/sys/arm64/include/db_machdep.h @@ -43,7 +43,7 @@ typedef vm_offset_t db_addr_t; typedef long db_expr_t; -#define PC_REGS() ((db_addr_t)kdb_thrctx->pcb_pc) +#define PC_REGS() ((db_addr_t)kdb_thrctx->pcb_lr) #define BKPT_INST (0xd4200000) #define BKPT_SIZE (4) diff --git a/sys/arm64/include/pcb.h b/sys/arm64/include/pcb.h index bd8b1b4235a8..cbf43133e9ad 100644 --- a/sys/arm64/include/pcb.h +++ b/sys/arm64/include/pcb.h @@ -35,10 +35,10 @@ struct trapframe; -#define PCB_LR 30 struct pcb { - uint64_t pcb_x[31]; - uint64_t pcb_pc; + uint64_t pcb_x[30]; + uint64_t pcb_lr; + uint64_t _reserved; /* Was pcb_pc */ /* These two need to be in order as we access them together */ uint64_t pcb_sp; uint64_t pcb_tpidr_el0; From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 14:10:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 349B04E378A; Mon, 25 Jan 2021 14:10:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPWw80vSPz4TGJ; Mon, 25 Jan 2021 14:10:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1039D17E02; Mon, 25 Jan 2021 14:10:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PE9x4m050072; Mon, 25 Jan 2021 14:09:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PE9xwI050071; Mon, 25 Jan 2021 14:09:59 GMT (envelope-from git) Date: Mon, 25 Jan 2021 14:09:59 GMT Message-Id: <202101251409.10PE9xwI050071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: e94c638b484e - stable/12 - arm64: gdb(4) machine-dependent bits MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e94c638b484e48e108e1d1238938a8d1dc4757b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 14:10:00 -0000 The branch stable/12 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=e94c638b484e48e108e1d1238938a8d1dc4757b3 commit e94c638b484e48e108e1d1238938a8d1dc4757b3 Author: mhorne AuthorDate: 2020-12-09 20:38:42 +0000 Commit: Mitchell Horne CommitDate: 2021-01-25 13:59:16 +0000 arm64: gdb(4) machine-dependent bits Sponsored by: The FreeBSD Foundation (cherry picked from commit bbfa199cbc1698631a0e932848e62dd76559d4d7) --- sys/arm64/arm64/gdb_machdep.c | 112 ++++++++++++++++++++++++++++++++++++++++ sys/arm64/include/gdb_machdep.h | 81 +++++++++++++++++++++++++++++ sys/conf/files.arm64 | 1 + 3 files changed, 194 insertions(+) diff --git a/sys/arm64/arm64/gdb_machdep.c b/sys/arm64/arm64/gdb_machdep.c new file mode 100644 index 000000000000..dc0a7eeba692 --- /dev/null +++ b/sys/arm64/arm64/gdb_machdep.c @@ -0,0 +1,112 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Mitchell Horne under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +void * +gdb_cpu_getreg(int regnum, size_t *regsz) +{ + + *regsz = gdb_cpu_regsz(regnum); + + if (kdb_thread == curthread) { + switch (regnum) { + case GDB_REG_LR: return (&kdb_frame->tf_lr); + case GDB_REG_SP: return (&kdb_frame->tf_sp); + case GDB_REG_PC: return (&kdb_frame->tf_elr); + case GDB_REG_CSPR: return (&kdb_frame->tf_spsr); + } + } + switch (regnum) { + case GDB_REG_SP: return (&kdb_thrctx->pcb_sp); + case GDB_REG_PC: /* FALLTHROUGH */ + case GDB_REG_LR: return (&kdb_thrctx->pcb_lr); + default: + if (regnum >= GDB_REG_X0 && regnum <= GDB_REG_X29) + return (&kdb_thrctx->pcb_x[regnum]); + break; + } + + return (NULL); +} + +void +gdb_cpu_setreg(int regnum, void *val) +{ + register_t regval = *(register_t *)val; + + /* For curthread, keep the pcb and trapframe in sync. */ + if (kdb_thread == curthread) { + switch (regnum) { + case GDB_REG_PC: kdb_frame->tf_elr = regval; break; + case GDB_REG_SP: kdb_frame->tf_sp = regval; break; + default: + if (regnum >= GDB_REG_X0 && regnum <= GDB_REG_X29) { + kdb_frame->tf_x[regnum] = regval; + } + break; + } + } + switch (regnum) { + case GDB_REG_PC: /* FALLTHROUGH */ + case GDB_REG_LR: kdb_thrctx->pcb_lr = regval; break; + case GDB_REG_SP: kdb_thrctx->pcb_sp = regval; break; + default: + if (regnum >= GDB_REG_X0 && regnum <= GDB_REG_X29) { + kdb_thrctx->pcb_x[regnum] = regval; + } + break; + } +} + +int +gdb_cpu_signal(int type, int code __unused) +{ + + switch (type) { + case EXCP_WATCHPT_EL1: + case EXCP_SOFTSTP_EL1: + case EXCP_BRK: + return (SIGTRAP); + } + return (SIGEMT); +} diff --git a/sys/arm64/include/gdb_machdep.h b/sys/arm64/include/gdb_machdep.h new file mode 100644 index 000000000000..755c5d1657c0 --- /dev/null +++ b/sys/arm64/include/gdb_machdep.h @@ -0,0 +1,81 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Mitchell Horne under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _MACHINE_GDB_MACHDEP_H_ +#define _MACHINE_GDB_MACHDEP_H_ + +#define GDB_BUFSZ 4096 +#define GDB_NREGS 68 +#define GDB_REG_X0 0 +#define GDB_REG_X29 29 +#define GDB_REG_LR 30 +#define GDB_REG_SP 31 +#define GDB_REG_PC 32 +#define GDB_REG_CSPR 33 +#define GDB_REG_V0 34 +#define GDB_REG_V31 65 +#define GDB_REG_FPSR 66 +#define GDB_REG_FPCR 67 +_Static_assert(GDB_BUFSZ >= (GDB_NREGS * 16), "buffer fits 'g' regs"); + +static __inline size_t +gdb_cpu_regsz(int regnum) +{ + if (regnum == GDB_REG_CSPR || regnum == GDB_REG_FPSR || + regnum == GDB_REG_FPCR) + return (4); + else if (regnum >= GDB_REG_V0 && regnum <= GDB_REG_V31) + return (16); + + return (8); +} + +static __inline int +gdb_cpu_query(void) +{ + return (0); +} + +static __inline void * +gdb_begin_write(void) +{ + return (NULL); +} + +static __inline void +gdb_end_write(void *arg __unused) +{ +} + +void *gdb_cpu_getreg(int, size_t *); +void gdb_cpu_setreg(int, void *); +int gdb_cpu_signal(int, int); + +#endif /* !_MACHINE_GDB_MACHDEP_H_ */ diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 8d4a6bcac15f..ea1fdaf59e8c 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -144,6 +144,7 @@ arm64/arm64/elf32_machdep.c optional compat_freebsd32 arm64/arm64/elf_machdep.c standard arm64/arm64/exception.S standard arm64/arm64/freebsd32_machdep.c optional compat_freebsd32 +arm64/arm64/gdb_machdep.c optional gdb arm64/arm64/gicv3_its.c optional intrng fdt arm64/arm64/gic_v3.c standard arm64/arm64/gic_v3_acpi.c optional acpi From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 14:11:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68EF64E390F; Mon, 25 Jan 2021 14:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPWxw2TJVz4TVw; Mon, 25 Jan 2021 14:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4689317AC8; Mon, 25 Jan 2021 14:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PEBWsD062246; Mon, 25 Jan 2021 14:11:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PEBWL0062245; Mon, 25 Jan 2021 14:11:32 GMT (envelope-from git) Date: Mon, 25 Jan 2021 14:11:32 GMT Message-Id: <202101251411.10PEBWL0062245@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: f773a868350d - stable/12 - gdb: only return signal values for powerpc's gdb_cpu_signal() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f773a868350de075ecd0aaa00af370a82ebebcd1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 14:11:32 -0000 The branch stable/12 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=f773a868350de075ecd0aaa00af370a82ebebcd1 commit f773a868350de075ecd0aaa00af370a82ebebcd1 Author: Mitchell Horne AuthorDate: 2021-01-22 18:56:56 +0000 Commit: Mitchell Horne CommitDate: 2021-01-25 14:10:40 +0000 gdb: only return signal values for powerpc's gdb_cpu_signal() Reviewed by: alfredo (cherry picked from commit 57a543d8b85065f77e0b68162d09a03335970f90) --- sys/powerpc/powerpc/gdb_machdep.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/powerpc/powerpc/gdb_machdep.c b/sys/powerpc/powerpc/gdb_machdep.c index 6248ce70e070..e5ce60c25d9c 100644 --- a/sys/powerpc/powerpc/gdb_machdep.c +++ b/sys/powerpc/powerpc/gdb_machdep.c @@ -94,8 +94,5 @@ gdb_cpu_signal(int vector, int dummy __unused) return (SIGTRAP); #endif - if (vector <= 255) - return (vector); - else - return (SIGEMT); + return (SIGEMT); } From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 14:14:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 814704E3776; Mon, 25 Jan 2021 14:14:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPX153Dtsz4Tmb; Mon, 25 Jan 2021 14:14:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61AE417DA5; Mon, 25 Jan 2021 14:14:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PEEHPB062762; Mon, 25 Jan 2021 14:14:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PEEHWA062761; Mon, 25 Jan 2021 14:14:17 GMT (envelope-from git) Date: Mon, 25 Jan 2021 14:14:17 GMT Message-Id: <202101251414.10PEEHWA062761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 8e0504d1654d - stable/13 - gdb: only return signal values for powerpc's gdb_cpu_signal() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8e0504d1654d92995abeddef2af7241f902675ed Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 14:14:17 -0000 The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8e0504d1654d92995abeddef2af7241f902675ed commit 8e0504d1654d92995abeddef2af7241f902675ed Author: Mitchell Horne AuthorDate: 2021-01-22 18:56:56 +0000 Commit: Mitchell Horne CommitDate: 2021-01-25 14:13:50 +0000 gdb: only return signal values for powerpc's gdb_cpu_signal() Reviewed by: alfredo (cherry picked from commit 57a543d8b85065f77e0b68162d09a03335970f90) --- sys/powerpc/powerpc/gdb_machdep.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/powerpc/powerpc/gdb_machdep.c b/sys/powerpc/powerpc/gdb_machdep.c index 83b3245f4e69..a7f1de512e31 100644 --- a/sys/powerpc/powerpc/gdb_machdep.c +++ b/sys/powerpc/powerpc/gdb_machdep.c @@ -98,10 +98,7 @@ gdb_cpu_signal(int vector, int dummy __unused) return (SIGTRAP); #endif - if (vector <= 255) - return (vector); - else - return (SIGEMT); + return (SIGEMT); } void From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 14:21:46 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A8AD4E3CA8; Mon, 25 Jan 2021 14:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPX9k1cmQz4TtX; Mon, 25 Jan 2021 14:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A92318155; Mon, 25 Jan 2021 14:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PELkWU074536; Mon, 25 Jan 2021 14:21:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PELknQ074535; Mon, 25 Jan 2021 14:21:46 GMT (envelope-from git) Date: Mon, 25 Jan 2021 14:21:46 GMT Message-Id: <202101251421.10PELknQ074535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5ade41213f19 - stable/12 - safexcel: Dispatch requests to the current CPU's ring MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5ade41213f19c340ad022b2add816404442b1160 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 14:21:46 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5ade41213f19c340ad022b2add816404442b1160 commit 5ade41213f19c340ad022b2add816404442b1160 Author: Mark Johnston AuthorDate: 2021-01-18 22:07:55 +0000 Commit: Mark Johnston CommitDate: 2021-01-25 14:19:20 +0000 safexcel: Dispatch requests to the current CPU's ring This gives better performance in some tests than the previous policy of statically binding each session to a ring. Sponsored by: Rubicon Communications, LLC (Netgate) (cherry picked from commit e934d455ba37ea777bd32cdcb0f9754865f9e818) --- sys/dev/safexcel/safexcel.c | 25 ++++++++++++++----------- sys/dev/safexcel/safexcel_var.h | 3 +-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index c1736fc5f080..ea48cf1b8879 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -189,6 +190,8 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) req = STAILQ_FIRST(&ring->queued_requests); KASSERT(req != NULL, ("%s: expected %d pending requests", __func__, nreqs)); + KASSERT(req->ringidx == ringidx, + ("%s: ring index mismatch", __func__)); STAILQ_REMOVE_HEAD(&ring->queued_requests, link); mtx_unlock(&ring->mtx); @@ -748,9 +751,7 @@ safexcel_execute(struct safexcel_softc *sc, struct safexcel_ring *ring, mtx_assert(&ring->mtx, MA_OWNED); - ringidx = req->sess->ringidx; - if (STAILQ_EMPTY(&ring->ready_requests)) - return; + ringidx = req->ringidx; busy = !STAILQ_EMPTY(&ring->queued_requests); ncdescs = nrdescs = nreqs = 0; while ((req = STAILQ_FIRST(&ring->ready_requests)) != NULL && @@ -1024,7 +1025,7 @@ safexcel_init_hw(struct safexcel_softc *sc) static int safexcel_setup_dev_interrupts(struct safexcel_softc *sc) { - int i, j; + int error, i, j; for (i = 0; i < SAFEXCEL_MAX_RINGS && sc->sc_intr[i] != NULL; i++) { sc->sc_ih[i].sc = sc; @@ -1037,6 +1038,11 @@ safexcel_setup_dev_interrupts(struct safexcel_softc *sc) "couldn't setup interrupt %d\n", i); goto err; } + + error = bus_bind_intr(sc->sc_dev, sc->sc_intr[i], i % mp_ncpus); + if (error != 0) + device_printf(sc->sc_dev, + "failed to bind ring %d\n", error); } return (0); @@ -1181,6 +1187,7 @@ safexcel_attach(device_t dev) for (i = 0; i < SAFEXCEL_REQUESTS_PER_RING; i++) { req = &ring->requests[i]; req->sc = sc; + req->ringidx = ringidx; if (bus_dmamap_create(ring->data_dtag, BUS_DMA_COHERENT, &req->dmap) != 0) { for (j = 0; j < i; j++) @@ -1770,7 +1777,7 @@ safexcel_set_token(struct safexcel_request *req) cdesc = req->cdesc; sc = req->sc; - ringidx = req->sess->ringidx; + ringidx = req->ringidx; safexcel_set_command(req, cdesc); @@ -1983,7 +1990,7 @@ safexcel_create_chain_cb(void *arg, bus_dma_segment_t *segs, int nseg, crp = req->crp; sess = req->sess; - ring = &req->sc->sc_ring[sess->ringidx]; + ring = &req->sc->sc_ring[req->ringidx]; mtx_assert(&ring->mtx, MA_OWNED); @@ -2577,10 +2584,6 @@ safexcel_newsession(device_t dev, crypto_session_t cses, struct cryptoini *cri) } } - /* Bind each session to a fixed ring to minimize lock contention. */ - sess->ringidx = atomic_fetchadd_int(&sc->sc_ringidx, 1); - sess->ringidx %= sc->sc_config.rings; - return (0); } @@ -2655,7 +2658,7 @@ safexcel_process(device_t dev, struct cryptop *crp, int hint) } } - ring = &sc->sc_ring[sess->ringidx]; + ring = &sc->sc_ring[curcpu % sc->sc_config.rings]; mtx_lock(&ring->mtx); req = safexcel_alloc_request(sc, ring); if (__predict_false(req == NULL)) { diff --git a/sys/dev/safexcel/safexcel_var.h b/sys/dev/safexcel/safexcel_var.h index 3ced5055545a..089a2bc1171c 100644 --- a/sys/dev/safexcel/safexcel_var.h +++ b/sys/dev/safexcel/safexcel_var.h @@ -339,7 +339,6 @@ struct safexcel_res_descr_ring { }; struct safexcel_session { - int ringidx; uint32_t alg; /* cipher algorithm */ uint32_t digest; /* digest type */ uint32_t hash; /* hash algorithm */ @@ -366,6 +365,7 @@ struct safexcel_softc; struct safexcel_request { STAILQ_ENTRY(safexcel_request) link; bool dmap_loaded; + int ringidx; bus_dmamap_t dmap; int error; int cdescs, rdescs; @@ -414,7 +414,6 @@ struct safexcel_softc { struct safexcel_intr_handle sc_ih[SAFEXCEL_MAX_RINGS]; struct safexcel_ring sc_ring[SAFEXCEL_MAX_RINGS]; - int sc_ringidx; int32_t sc_cid; struct safexcel_reg_offsets sc_offsets; From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 14:21:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C7F54E3B31; Mon, 25 Jan 2021 14:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPX9l2Dftz4VKZ; Mon, 25 Jan 2021 14:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FD4617EC2; Mon, 25 Jan 2021 14:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PELl61074559; Mon, 25 Jan 2021 14:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PELl8m074558; Mon, 25 Jan 2021 14:21:47 GMT (envelope-from git) Date: Mon, 25 Jan 2021 14:21:47 GMT Message-Id: <202101251421.10PELl8m074558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 24ee73604483 - stable/12 - safexcel: Add counters for some resource exhaustion conditions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 24ee73604483152ba2222ff9e5e3cf61047eb1c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 14:21:47 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=24ee73604483152ba2222ff9e5e3cf61047eb1c3 commit 24ee73604483152ba2222ff9e5e3cf61047eb1c3 Author: Mark Johnston AuthorDate: 2021-01-18 22:07:55 +0000 Commit: Mark Johnston CommitDate: 2021-01-25 14:19:39 +0000 safexcel: Add counters for some resource exhaustion conditions This is useful when analyzing performance problems. Sponsored by: Rubicon Communications, LLC (Netgate) (cherry picked from commit 0371c3faaa2412413d4fb44254b03124f97dfe66) --- sys/dev/safexcel/safexcel.c | 36 +++++++++++++++++++++++++++++++++--- sys/dev/safexcel/safexcel_var.h | 6 ++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index ea48cf1b8879..467b118dacdf 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1155,7 +1156,9 @@ safexcel_crypto_register(struct safexcel_softc *sc, int alg) static int safexcel_attach(device_t dev) { - struct sysctl_ctx_list *sctx; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *oid; + struct sysctl_oid_list *children; struct safexcel_softc *sc; struct safexcel_request *req; struct safexcel_ring *ring; @@ -1209,11 +1212,30 @@ safexcel_attach(device_t dev) } } - sctx = device_get_sysctl_ctx(dev); - SYSCTL_ADD_INT(sctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + ctx = device_get_sysctl_ctx(dev); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "debug", CTLFLAG_RWTUN, &sc->sc_debug, 0, "Debug message verbosity"); + oid = device_get_sysctl_tree(sc->sc_dev); + children = SYSCTL_CHILDREN(oid); + oid = SYSCTL_ADD_NODE(ctx, children, OID_AUTO, "stats", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "statistics"); + children = SYSCTL_CHILDREN(oid); + + sc->sc_req_alloc_failures = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "req_alloc_failures", + CTLFLAG_RD, &sc->sc_req_alloc_failures, + "Number of request allocation failures"); + sc->sc_cdesc_alloc_failures = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "cdesc_alloc_failures", + CTLFLAG_RD, &sc->sc_cdesc_alloc_failures, + "Number of command descriptor ring overflows"); + sc->sc_rdesc_alloc_failures = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(ctx, children, OID_AUTO, "rdesc_alloc_failures", + CTLFLAG_RD, &sc->sc_rdesc_alloc_failures, + "Number of result descriptor ring overflows"); + sc->sc_cid = crypto_get_driverid(dev, sizeof(struct safexcel_session), CRYPTOCAP_F_HARDWARE); if (sc->sc_cid < 0) @@ -1260,6 +1282,11 @@ safexcel_detach(device_t dev) if (sc->sc_cid >= 0) crypto_unregister_all(sc->sc_cid); + + counter_u64_free(sc->sc_req_alloc_failures); + counter_u64_free(sc->sc_cdesc_alloc_failures); + counter_u64_free(sc->sc_rdesc_alloc_failures); + for (ringidx = 0; ringidx < sc->sc_config.rings; ringidx++) { ring = &sc->sc_ring[ringidx]; for (i = 0; i < SAFEXCEL_REQUESTS_PER_RING; i++) { @@ -2056,6 +2083,7 @@ safexcel_create_chain_cb(void *arg, bus_dma_segment_t *segs, int nseg, (uint32_t)inlen, req->ctx.paddr); if (cdesc == NULL) { safexcel_cmd_descr_rollback(ring, i); + counter_u64_add(req->sc->sc_cdesc_alloc_failures, 1); req->error = EAGAIN; return; } @@ -2083,6 +2111,7 @@ safexcel_create_chain_cb(void *arg, bus_dma_segment_t *segs, int nseg, safexcel_cmd_descr_rollback(ring, ring->cmd_data->sg_nseg); safexcel_res_descr_rollback(ring, i); + counter_u64_add(req->sc->sc_rdesc_alloc_failures, 1); req->error = EAGAIN; return; } @@ -2664,6 +2693,7 @@ safexcel_process(device_t dev, struct cryptop *crp, int hint) if (__predict_false(req == NULL)) { ring->blocked = CRYPTO_SYMQ; mtx_unlock(&ring->mtx); + counter_u64_add(sc->sc_req_alloc_failures, 1); return (ERESTART); } diff --git a/sys/dev/safexcel/safexcel_var.h b/sys/dev/safexcel/safexcel_var.h index 089a2bc1171c..8417f47a1055 100644 --- a/sys/dev/safexcel/safexcel_var.h +++ b/sys/dev/safexcel/safexcel_var.h @@ -29,6 +29,8 @@ #ifndef _SAFEXCEL_VAR_H_ #define _SAFEXCEL_VAR_H_ +#include + #define SAFEXCEL_MAX_RINGS 4 #define SAFEXCEL_MAX_BATCH_SIZE 64 #define SAFEXCEL_MAX_FRAGMENTS 64 @@ -413,6 +415,10 @@ struct safexcel_softc { struct resource *sc_intr[SAFEXCEL_MAX_RINGS]; struct safexcel_intr_handle sc_ih[SAFEXCEL_MAX_RINGS]; + counter_u64_t sc_req_alloc_failures; + counter_u64_t sc_cdesc_alloc_failures; + counter_u64_t sc_rdesc_alloc_failures; + struct safexcel_ring sc_ring[SAFEXCEL_MAX_RINGS]; int32_t sc_cid; From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 14:21:50 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23D0D4E3B35; Mon, 25 Jan 2021 14:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPX9n64xTz4VBD; Mon, 25 Jan 2021 14:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAFC817AD6; Mon, 25 Jan 2021 14:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PELnJ5074599; Mon, 25 Jan 2021 14:21:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PELnr1074598; Mon, 25 Jan 2021 14:21:49 GMT (envelope-from git) Date: Mon, 25 Jan 2021 14:21:49 GMT Message-Id: <202101251421.10PELnr1074598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5071cbacfb34 - stable/12 - safexcel: Simplify request allocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5071cbacfb343f024bc1c9969aa43d20daa8241a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 14:21:54 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5071cbacfb343f024bc1c9969aa43d20daa8241a commit 5071cbacfb343f024bc1c9969aa43d20daa8241a Author: Mark Johnston AuthorDate: 2021-01-18 22:07:56 +0000 Commit: Mark Johnston CommitDate: 2021-01-25 14:20:15 +0000 safexcel: Simplify request allocation Rather than preallocating a set of requests and moving them between queues during state transitions, maintain a shadow of the command descriptor ring to track the driver context of each request. This is simpler and requires less synchronization between safexcel_process() and the ring interrupt handler. Sponsored by: Rubicon Communications, LLC (Netgate) (cherry picked from commit 1a6ffed5d73a22858182e68e629662afda1b9f6d) --- sys/dev/safexcel/safexcel.c | 121 ++++++++++++++++++++-------------------- sys/dev/safexcel/safexcel_var.h | 20 ++++--- 2 files changed, 73 insertions(+), 68 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index db7bc9d90a00..0d209513ebdb 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$"); #include "safexcel_reg.h" #include "safexcel_var.h" -static MALLOC_DEFINE(M_SAFEXCEL, "safexcel_req", "safexcel request buffers"); - /* * We only support the EIP97 for now. */ @@ -93,6 +91,17 @@ const struct safexcel_reg_offsets eip197_regs_offset = { .pe = SAFEXCEL_EIP197_PE_BASE, }; +static struct safexcel_request * +safexcel_next_request(struct safexcel_ring *ring) +{ + int i; + + i = ring->cdr.read; + KASSERT(i >= 0 && i < SAFEXCEL_RING_SIZE, + ("%s: out of bounds request index %d", __func__, i)); + return (&ring->requests[i]); +} + static struct safexcel_cmd_descr * safexcel_cmd_descr_next(struct safexcel_cmd_descr_ring *ring) { @@ -120,13 +129,14 @@ safexcel_res_descr_next(struct safexcel_res_descr_ring *ring) static struct safexcel_request * safexcel_alloc_request(struct safexcel_softc *sc, struct safexcel_ring *ring) { - struct safexcel_request *req; + int i; mtx_assert(&ring->mtx, MA_OWNED); - if ((req = STAILQ_FIRST(&ring->free_requests)) != NULL) - STAILQ_REMOVE_HEAD(&ring->free_requests, link); - return (req); + i = ring->cdr.write; + if ((i + 1) % SAFEXCEL_RING_SIZE == ring->cdr.read) + return (NULL); + return (&ring->requests[i]); } static void @@ -143,21 +153,13 @@ safexcel_free_request(struct safexcel_ring *ring, struct safexcel_request *req) ctx = (struct safexcel_context_record *)req->ctx.vaddr; explicit_bzero(ctx->data, sizeof(ctx->data)); explicit_bzero(req->iv, sizeof(req->iv)); - STAILQ_INSERT_TAIL(&ring->free_requests, req, link); -} - -static void -safexcel_enqueue_request(struct safexcel_softc *sc, struct safexcel_ring *ring, - struct safexcel_request *req) -{ - mtx_assert(&ring->mtx, MA_OWNED); - - STAILQ_INSERT_TAIL(&ring->ready_requests, req, link); } static void safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) { + TAILQ_HEAD(, cryptop) cq; + struct cryptop *crp, *tmp; struct safexcel_cmd_descr *cdesc; struct safexcel_res_descr *rdesc; struct safexcel_request *req; @@ -167,7 +169,6 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) blocked = 0; ring = &sc->sc_ring[ringidx]; - mtx_lock(&ring->mtx); nreqs = SAFEXCEL_READ(sc, SAFEXCEL_HIA_RDR(sc, ringidx) + SAFEXCEL_HIA_xDR_PROC_COUNT); nreqs >>= SAFEXCEL_xDR_PROC_xD_PKT_OFFSET; @@ -175,9 +176,12 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) if (nreqs == 0) { SAFEXCEL_DPRINTF(sc, 1, "zero pending requests on ring %d\n", ringidx); + mtx_lock(&ring->mtx); goto out; } + TAILQ_INIT(&cq); + ring = &sc->sc_ring[ringidx]; bus_dmamap_sync(ring->rdr.dma.tag, ring->rdr.dma.map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); @@ -188,13 +192,7 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) ncdescs = nrdescs = 0; for (i = 0; i < nreqs; i++) { - req = STAILQ_FIRST(&ring->queued_requests); - KASSERT(req != NULL, ("%s: expected %d pending requests", - __func__, nreqs)); - KASSERT(req->ringidx == ringidx, - ("%s: ring index mismatch", __func__)); - STAILQ_REMOVE_HEAD(&ring->queued_requests, link); - mtx_unlock(&ring->mtx); + req = safexcel_next_request(ring); bus_dmamap_sync(req->ctx.tag, req->ctx.map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); @@ -226,12 +224,16 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) } } - crypto_done(req->crp); - mtx_lock(&ring->mtx); - safexcel_free_request(ring, req); + TAILQ_INSERT_TAIL(&cq, req->crp, crp_next); } + mtx_lock(&ring->mtx); if (nreqs != 0) { + KASSERT(ring->queued >= nreqs, + ("%s: request count underflow, %d queued %d completed", + __func__, ring->queued, nreqs)); + ring->queued -= nreqs; + SAFEXCEL_WRITE(sc, SAFEXCEL_HIA_RDR(sc, ringidx) + SAFEXCEL_HIA_xDR_PROC_COUNT, SAFEXCEL_xDR_PROC_xD_PKT(nreqs) | @@ -240,15 +242,18 @@ safexcel_rdr_intr(struct safexcel_softc *sc, int ringidx) ring->blocked = 0; } out: - if (!STAILQ_EMPTY(&ring->queued_requests)) { + if (ring->queued != 0) { SAFEXCEL_WRITE(sc, SAFEXCEL_HIA_RDR(sc, ringidx) + SAFEXCEL_HIA_xDR_THRESH, - SAFEXCEL_HIA_CDR_THRESH_PKT_MODE | 1); + SAFEXCEL_HIA_CDR_THRESH_PKT_MODE | imin(ring->queued, 16)); } mtx_unlock(&ring->mtx); if (blocked) crypto_unblock(sc->sc_cid, blocked); + + TAILQ_FOREACH_SAFE(crp, &cq, crp_next, tmp) + crypto_done(crp); } static void @@ -744,38 +749,40 @@ safexcel_enable_pe_engine(struct safexcel_softc *sc, int pe) static void safexcel_execute(struct safexcel_softc *sc, struct safexcel_ring *ring, - struct safexcel_request *req) + struct safexcel_request *req, int hint) { - uint32_t ncdescs, nrdescs, nreqs; - int ringidx; + int ringidx, ncdesc, nrdesc; bool busy; mtx_assert(&ring->mtx, MA_OWNED); - ringidx = req->ringidx; - busy = !STAILQ_EMPTY(&ring->queued_requests); - ncdescs = nrdescs = nreqs = 0; - while ((req = STAILQ_FIRST(&ring->ready_requests)) != NULL && - req->cdescs + ncdescs <= SAFEXCEL_MAX_BATCH_SIZE && - req->rdescs + nrdescs <= SAFEXCEL_MAX_BATCH_SIZE) { - STAILQ_REMOVE_HEAD(&ring->ready_requests, link); - STAILQ_INSERT_TAIL(&ring->queued_requests, req, link); - ncdescs += req->cdescs; - nrdescs += req->rdescs; - nreqs++; + if ((hint & CRYPTO_HINT_MORE) != 0) { + ring->pending++; + ring->pending_cdesc += req->cdescs; + ring->pending_rdesc += req->rdescs; + return; } + ringidx = req->ringidx; + + busy = ring->queued != 0; + ncdesc = ring->pending_cdesc + req->cdescs; + nrdesc = ring->pending_rdesc + req->rdescs; + ring->queued += ring->pending + 1; + if (!busy) { SAFEXCEL_WRITE(sc, SAFEXCEL_HIA_RDR(sc, ringidx) + SAFEXCEL_HIA_xDR_THRESH, - SAFEXCEL_HIA_CDR_THRESH_PKT_MODE | nreqs); + SAFEXCEL_HIA_CDR_THRESH_PKT_MODE | ring->queued); } SAFEXCEL_WRITE(sc, SAFEXCEL_HIA_RDR(sc, ringidx) + SAFEXCEL_HIA_xDR_PREP_COUNT, - nrdescs * sc->sc_config.rd_offset * sizeof(uint32_t)); + nrdesc * sc->sc_config.rd_offset * sizeof(uint32_t)); SAFEXCEL_WRITE(sc, SAFEXCEL_HIA_CDR(sc, ringidx) + SAFEXCEL_HIA_xDR_PREP_COUNT, - ncdescs * sc->sc_config.cd_offset * sizeof(uint32_t)); + ncdesc * sc->sc_config.cd_offset * sizeof(uint32_t)); + + ring->pending = ring->pending_cdesc = ring->pending_rdesc = 0; } static void @@ -792,10 +799,9 @@ safexcel_init_rings(struct safexcel_softc *sc) snprintf(ring->lockname, sizeof(ring->lockname), "safexcel_ring%d", i); mtx_init(&ring->mtx, ring->lockname, NULL, MTX_DEF); - STAILQ_INIT(&ring->free_requests); - STAILQ_INIT(&ring->ready_requests); - STAILQ_INIT(&ring->queued_requests); + ring->pending = ring->pending_cdesc = ring->pending_rdesc = 0; + ring->queued = 0; ring->cdr.read = ring->cdr.write = 0; ring->rdr.read = ring->rdr.write = 0; for (j = 0; j < SAFEXCEL_RING_SIZE; j++) { @@ -1183,11 +1189,7 @@ safexcel_attach(device_t dev) ring->cmd_data = sglist_alloc(SAFEXCEL_MAX_FRAGMENTS, M_WAITOK); ring->res_data = sglist_alloc(SAFEXCEL_MAX_FRAGMENTS, M_WAITOK); - ring->requests = mallocarray(SAFEXCEL_REQUESTS_PER_RING, - sizeof(struct safexcel_request), M_SAFEXCEL, - M_WAITOK | M_ZERO); - - for (i = 0; i < SAFEXCEL_REQUESTS_PER_RING; i++) { + for (i = 0; i < SAFEXCEL_RING_SIZE; i++) { req = &ring->requests[i]; req->sc = sc; req->ringidx = ringidx; @@ -1208,7 +1210,6 @@ safexcel_attach(device_t dev) } goto err2; } - STAILQ_INSERT_TAIL(&ring->free_requests, req, link); } } @@ -1289,12 +1290,11 @@ safexcel_detach(device_t dev) for (ringidx = 0; ringidx < sc->sc_config.rings; ringidx++) { ring = &sc->sc_ring[ringidx]; - for (i = 0; i < SAFEXCEL_REQUESTS_PER_RING; i++) { + for (i = 0; i < SAFEXCEL_RING_SIZE; i++) { bus_dmamap_destroy(ring->data_dtag, ring->requests[i].dmap); safexcel_dma_free_mem(&ring->requests[i].ctx); } - free(ring->requests, M_SAFEXCEL); sglist_free(ring->cmd_data); sglist_free(ring->res_data); } @@ -2068,7 +2068,8 @@ safexcel_create_chain_cb(void *arg, bus_dma_segment_t *segs, int nseg, * length zero. The EIP97 apparently does not handle * zero-length packets properly since subsequent requests return * bogus errors, so provide a dummy segment using the context - * descriptor. + * descriptor. Also, we must allocate at least one command ring + * entry per request to keep the request shadow ring in sync. */ (void)sglist_append_phys(sg, req->ctx.paddr, 1); } @@ -2749,10 +2750,8 @@ safexcel_process(device_t dev, struct cryptop *crp, int hint) bus_dmamap_sync(ring->rdr.dma.tag, ring->rdr.dma.map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - safexcel_enqueue_request(sc, ring, req); + safexcel_execute(sc, ring, req, hint); - if ((hint & CRYPTO_HINT_MORE) == 0) - safexcel_execute(sc, ring, req); mtx_unlock(&ring->mtx); return (0); diff --git a/sys/dev/safexcel/safexcel_var.h b/sys/dev/safexcel/safexcel_var.h index 8417f47a1055..3ce883b19673 100644 --- a/sys/dev/safexcel/safexcel_var.h +++ b/sys/dev/safexcel/safexcel_var.h @@ -38,7 +38,6 @@ #define SAFEXCEL_MAX_REQUEST_SIZE 65535 #define SAFEXCEL_RING_SIZE 512 -#define SAFEXCEL_REQUESTS_PER_RING 64 #define SAFEXCEL_MAX_ITOKENS 4 #define SAFEXCEL_MAX_ATOKENS 16 #define SAFEXCEL_FETCH_COUNT 1 @@ -49,7 +48,8 @@ * Context Record format. * * In this driver the context control words are always set in the control data. - * This is configured by setting SAFEXCEL_OPTION_CTX_CTRL_IN_CMD. + * This helps optimize fetching of the context record. This is configured by + * setting SAFEXCEL_OPTION_CTX_CTRL_IN_CMD. */ struct safexcel_context_record { uint32_t control0; /* Unused. */ @@ -387,12 +387,18 @@ struct safexcel_ring { struct sglist *res_data; struct safexcel_res_descr_ring rdr; - int blocked; + /* Shadows the command descriptor ring. */ + struct safexcel_request requests[SAFEXCEL_RING_SIZE]; + + /* Count of requests pending submission. */ + int pending; + int pending_cdesc, pending_rdesc; - struct safexcel_request *requests; - STAILQ_HEAD(, safexcel_request) ready_requests; - STAILQ_HEAD(, safexcel_request) queued_requests; - STAILQ_HEAD(, safexcel_request) free_requests; + /* Count of outstanding requests. */ + int queued; + + /* Requests were deferred due to a resource shortage. */ + int blocked; struct safexcel_dma_mem dma_atok; bus_dma_tag_t data_dtag; From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 14:21:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB7094E3D1B; Mon, 25 Jan 2021 14:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPX9m3QC4z4Ttc; Mon, 25 Jan 2021 14:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62DE318158; Mon, 25 Jan 2021 14:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PELmka074577; Mon, 25 Jan 2021 14:21:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PELmsX074576; Mon, 25 Jan 2021 14:21:48 GMT (envelope-from git) Date: Mon, 25 Jan 2021 14:21:48 GMT Message-Id: <202101251421.10PELmsX074576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 804d63c0ee8f - stable/12 - safexcel: Handle command/result descriptor exhaustion gracefully MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 804d63c0ee8f56dfac29e1fe5879740a3549d0cb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 14:21:48 -0000 The branch stable/12 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=804d63c0ee8f56dfac29e1fe5879740a3549d0cb commit 804d63c0ee8f56dfac29e1fe5879740a3549d0cb Author: Mark Johnston AuthorDate: 2021-01-18 22:07:56 +0000 Commit: Mark Johnston CommitDate: 2021-01-25 14:20:01 +0000 safexcel: Handle command/result descriptor exhaustion gracefully Rather than returning a hard error in this case, return ERESTART so that upper layers get a chance to retry the request (or drop it, depending on the desired policy). This case is hard to hit due to the somewhat low bound on queued requests, but that will no longer be true after an upcoming change. Sponsored by: Rubicon Communications, LLC (Netgate) (cherry picked from commit b7e27af36b7df05f4b6cdc706750413f3a048640) --- sys/dev/safexcel/safexcel.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index 467b118dacdf..db7bc9d90a00 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -2084,7 +2084,7 @@ safexcel_create_chain_cb(void *arg, bus_dma_segment_t *segs, int nseg, if (cdesc == NULL) { safexcel_cmd_descr_rollback(ring, i); counter_u64_add(req->sc->sc_cdesc_alloc_failures, 1); - req->error = EAGAIN; + req->error = ERESTART; return; } if (i == 0) @@ -2112,7 +2112,7 @@ safexcel_create_chain_cb(void *arg, bus_dma_segment_t *segs, int nseg, ring->cmd_data->sg_nseg); safexcel_res_descr_rollback(ring, i); counter_u64_add(req->sc->sc_rdesc_alloc_failures, 1); - req->error = EAGAIN; + req->error = ERESTART; return; } } @@ -2724,10 +2724,16 @@ safexcel_process(device_t dev, struct cryptop *crp, int hint) error = safexcel_create_chain(ring, req); if (__predict_false(error != 0)) { safexcel_free_request(ring, req); + if (error == ERESTART) + ring->blocked = CRYPTO_SYMQ; mtx_unlock(&ring->mtx); - crp->crp_etype = error; - crypto_done(crp); - return (0); + if (error != ERESTART) { + crp->crp_etype = error; + crypto_done(crp); + return (0); + } else { + return (ERESTART); + } } safexcel_set_token(req); From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 21:56:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B839B4F333A; Mon, 25 Jan 2021 21:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPkGh4vyqz3QCc; Mon, 25 Jan 2021 21:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B7781D7EF; Mon, 25 Jan 2021 21:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PLuiJG061562; Mon, 25 Jan 2021 21:56:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PLuigw061561; Mon, 25 Jan 2021 21:56:44 GMT (envelope-from git) Date: Mon, 25 Jan 2021 21:56:44 GMT Message-Id: <202101252156.10PLuigw061561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 7b49246c89dd - stable/13 - contrib/tzdata: import tzdata 2021a MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7b49246c89dd3f6a2b780a732424905eca1860c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 21:56:44 -0000 The branch stable/13 has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=7b49246c89dd3f6a2b780a732424905eca1860c7 commit 7b49246c89dd3f6a2b780a732424905eca1860c7 Author: Philip Paeps AuthorDate: 2021-01-25 21:52:24 +0000 Commit: Philip Paeps CommitDate: 2021-01-25 21:52:24 +0000 contrib/tzdata: import tzdata 2021a Merge commit '4cd7e1071de16a7392b0e466287f13e9e6f2081a' Changes: https://github.com/eggert/tz/blob/2021a/NEWS (cherry picked from commit 8c5bef2eb24cb191c87712a56a9860d8c29415a0) --- contrib/tzdata/NEWS | 8 ++++++++ contrib/tzdata/africa | 8 +++++++- contrib/tzdata/leap-seconds.list | 8 ++++---- contrib/tzdata/leapseconds | 8 ++++---- contrib/tzdata/version | 2 +- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/contrib/tzdata/NEWS b/contrib/tzdata/NEWS index 19470cc41c3d..a60847beae81 100644 --- a/contrib/tzdata/NEWS +++ b/contrib/tzdata/NEWS @@ -1,5 +1,13 @@ News for the tz database +Release 2021a - 2021-01-24 10:54:57 -0800 + + Changes to future timestamps + + South Sudan changes from +03 to +02 on 2021-02-01 at 00:00. + (Thanks to Steffen Thorsen.) + + Release 2020f - 2020-12-29 00:17:46 -0800 Change to build procedure diff --git a/contrib/tzdata/africa b/contrib/tzdata/africa index 59cf501ec954..28168cfc17f8 100644 --- a/contrib/tzdata/africa +++ b/contrib/tzdata/africa @@ -1527,11 +1527,17 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 3:00 - EAT 2017 Nov 1 2:00 - CAT +# From Steffen Thorsen (2021-01-18): +# "South Sudan will change its time zone by setting the clock back 1 +# hour on February 1, 2021...." +# from https://eyeradio.org/south-sudan-adopts-new-time-zone-makuei/ + # South Sudan # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Juba 2:06:28 - LMT 1931 2:00 Sudan CA%sT 2000 Jan 15 12:00 - 3:00 - EAT + 3:00 - EAT 2021 Feb 1 00:00 + 2:00 - CAT # Tanzania # See Africa/Nairobi. diff --git a/contrib/tzdata/leap-seconds.list b/contrib/tzdata/leap-seconds.list index e897a867e164..3198d65146a5 100644 --- a/contrib/tzdata/leap-seconds.list +++ b/contrib/tzdata/leap-seconds.list @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C60 -# File expires on: 28 June 2021 +# Updated through IERS Bulletin C61 +# File expires on: 28 December 2021 # -#@ 3833827200 +#@ 3849638400 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 064356a8 39268b92 76e4d5ef 3e22fae1 0cca529c +#h 2ab8253d d4380d28 75f01343 381504f8 8f8a4bfc diff --git a/contrib/tzdata/leapseconds b/contrib/tzdata/leapseconds index bf0d2d749214..cf0df04c3c8e 100644 --- a/contrib/tzdata/leapseconds +++ b/contrib/tzdata/leapseconds @@ -72,11 +72,11 @@ Leap 2016 Dec 31 23:59:60 + S # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2021 Jun 28 00:00:00 +#Expires 2021 Dec 28 00:00:00 # POSIX timestamps for the data in this file: #updated 1467936000 (2016-07-08 00:00:00 UTC) -#expires 1624838400 (2021-06-28 00:00:00 UTC) +#expires 1640649600 (2021-12-28 00:00:00 UTC) -# Updated through IERS Bulletin C60 -# File expires on: 28 June 2021 +# Updated through IERS Bulletin C61 +# File expires on: 28 December 2021 diff --git a/contrib/tzdata/version b/contrib/tzdata/version index a481df8cb9d4..1d590958afd8 100644 --- a/contrib/tzdata/version +++ b/contrib/tzdata/version @@ -1 +1 @@ -2020f +2021a From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 21:56:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C2864F321A; Mon, 25 Jan 2021 21:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPkGv6cdJz3QQB; Mon, 25 Jan 2021 21:56:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A23B81DFD8; Mon, 25 Jan 2021 21:56:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PLutaO061691; Mon, 25 Jan 2021 21:56:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PLutuh061690; Mon, 25 Jan 2021 21:56:55 GMT (envelope-from git) Date: Mon, 25 Jan 2021 21:56:55 GMT Message-Id: <202101252156.10PLutuh061690@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 085997e8f05e - stable/12 - contrib/tzdata: import tzdata 2021a MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 085997e8f05e69c66a8ffc0804b275a386ba1ca8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 21:56:57 -0000 The branch stable/12 has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=085997e8f05e69c66a8ffc0804b275a386ba1ca8 commit 085997e8f05e69c66a8ffc0804b275a386ba1ca8 Author: Philip Paeps AuthorDate: 2021-01-25 00:18:14 +0000 Commit: Philip Paeps CommitDate: 2021-01-25 21:55:20 +0000 contrib/tzdata: import tzdata 2021a Merge commit '4cd7e1071de16a7392b0e466287f13e9e6f2081a' Changes: https://github.com/eggert/tz/blob/2021a/NEWS (cherry picked from commit 8c5bef2eb24cb191c87712a56a9860d8c29415a0) --- contrib/tzdata/NEWS | 8 ++++++++ contrib/tzdata/africa | 8 +++++++- contrib/tzdata/leap-seconds.list | 8 ++++---- contrib/tzdata/leapseconds | 8 ++++---- contrib/tzdata/version | 2 +- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/contrib/tzdata/NEWS b/contrib/tzdata/NEWS index 19470cc41c3d..a60847beae81 100644 --- a/contrib/tzdata/NEWS +++ b/contrib/tzdata/NEWS @@ -1,5 +1,13 @@ News for the tz database +Release 2021a - 2021-01-24 10:54:57 -0800 + + Changes to future timestamps + + South Sudan changes from +03 to +02 on 2021-02-01 at 00:00. + (Thanks to Steffen Thorsen.) + + Release 2020f - 2020-12-29 00:17:46 -0800 Change to build procedure diff --git a/contrib/tzdata/africa b/contrib/tzdata/africa index 59cf501ec954..28168cfc17f8 100644 --- a/contrib/tzdata/africa +++ b/contrib/tzdata/africa @@ -1527,11 +1527,17 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 3:00 - EAT 2017 Nov 1 2:00 - CAT +# From Steffen Thorsen (2021-01-18): +# "South Sudan will change its time zone by setting the clock back 1 +# hour on February 1, 2021...." +# from https://eyeradio.org/south-sudan-adopts-new-time-zone-makuei/ + # South Sudan # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Juba 2:06:28 - LMT 1931 2:00 Sudan CA%sT 2000 Jan 15 12:00 - 3:00 - EAT + 3:00 - EAT 2021 Feb 1 00:00 + 2:00 - CAT # Tanzania # See Africa/Nairobi. diff --git a/contrib/tzdata/leap-seconds.list b/contrib/tzdata/leap-seconds.list index e897a867e164..3198d65146a5 100644 --- a/contrib/tzdata/leap-seconds.list +++ b/contrib/tzdata/leap-seconds.list @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C60 -# File expires on: 28 June 2021 +# Updated through IERS Bulletin C61 +# File expires on: 28 December 2021 # -#@ 3833827200 +#@ 3849638400 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 064356a8 39268b92 76e4d5ef 3e22fae1 0cca529c +#h 2ab8253d d4380d28 75f01343 381504f8 8f8a4bfc diff --git a/contrib/tzdata/leapseconds b/contrib/tzdata/leapseconds index bf0d2d749214..cf0df04c3c8e 100644 --- a/contrib/tzdata/leapseconds +++ b/contrib/tzdata/leapseconds @@ -72,11 +72,11 @@ Leap 2016 Dec 31 23:59:60 + S # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2021 Jun 28 00:00:00 +#Expires 2021 Dec 28 00:00:00 # POSIX timestamps for the data in this file: #updated 1467936000 (2016-07-08 00:00:00 UTC) -#expires 1624838400 (2021-06-28 00:00:00 UTC) +#expires 1640649600 (2021-12-28 00:00:00 UTC) -# Updated through IERS Bulletin C60 -# File expires on: 28 June 2021 +# Updated through IERS Bulletin C61 +# File expires on: 28 December 2021 diff --git a/contrib/tzdata/version b/contrib/tzdata/version index a481df8cb9d4..1d590958afd8 100644 --- a/contrib/tzdata/version +++ b/contrib/tzdata/version @@ -1 +1 @@ -2020f +2021a From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 21:57:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B3104F3446; Mon, 25 Jan 2021 21:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPkHB0FGpz3QbW; Mon, 25 Jan 2021 21:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2BD11DB6E; Mon, 25 Jan 2021 21:57:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PLv6X4061820; Mon, 25 Jan 2021 21:57:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PLv6kV061819; Mon, 25 Jan 2021 21:57:06 GMT (envelope-from git) Date: Mon, 25 Jan 2021 21:57:06 GMT Message-Id: <202101252157.10PLv6kV061819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Philip Paeps Subject: git: 09bdde595dd7 - stable/11 - contrib/tzdata: import tzdata 2021a MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 09bdde595dd761fd3499b0b0eb085088b3d3276d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 21:57:10 -0000 The branch stable/11 has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=09bdde595dd761fd3499b0b0eb085088b3d3276d commit 09bdde595dd761fd3499b0b0eb085088b3d3276d Author: Philip Paeps AuthorDate: 2021-01-25 00:18:14 +0000 Commit: Philip Paeps CommitDate: 2021-01-25 21:55:41 +0000 contrib/tzdata: import tzdata 2021a Merge commit '4cd7e1071de16a7392b0e466287f13e9e6f2081a' Changes: https://github.com/eggert/tz/blob/2021a/NEWS (cherry picked from commit 8c5bef2eb24cb191c87712a56a9860d8c29415a0) --- contrib/tzdata/NEWS | 8 ++++++++ contrib/tzdata/africa | 8 +++++++- contrib/tzdata/leap-seconds.list | 8 ++++---- contrib/tzdata/leapseconds | 8 ++++---- contrib/tzdata/version | 2 +- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/contrib/tzdata/NEWS b/contrib/tzdata/NEWS index 19470cc41c3d..a60847beae81 100644 --- a/contrib/tzdata/NEWS +++ b/contrib/tzdata/NEWS @@ -1,5 +1,13 @@ News for the tz database +Release 2021a - 2021-01-24 10:54:57 -0800 + + Changes to future timestamps + + South Sudan changes from +03 to +02 on 2021-02-01 at 00:00. + (Thanks to Steffen Thorsen.) + + Release 2020f - 2020-12-29 00:17:46 -0800 Change to build procedure diff --git a/contrib/tzdata/africa b/contrib/tzdata/africa index 59cf501ec954..28168cfc17f8 100644 --- a/contrib/tzdata/africa +++ b/contrib/tzdata/africa @@ -1527,11 +1527,17 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 3:00 - EAT 2017 Nov 1 2:00 - CAT +# From Steffen Thorsen (2021-01-18): +# "South Sudan will change its time zone by setting the clock back 1 +# hour on February 1, 2021...." +# from https://eyeradio.org/south-sudan-adopts-new-time-zone-makuei/ + # South Sudan # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Juba 2:06:28 - LMT 1931 2:00 Sudan CA%sT 2000 Jan 15 12:00 - 3:00 - EAT + 3:00 - EAT 2021 Feb 1 00:00 + 2:00 - CAT # Tanzania # See Africa/Nairobi. diff --git a/contrib/tzdata/leap-seconds.list b/contrib/tzdata/leap-seconds.list index e897a867e164..3198d65146a5 100644 --- a/contrib/tzdata/leap-seconds.list +++ b/contrib/tzdata/leap-seconds.list @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C60 -# File expires on: 28 June 2021 +# Updated through IERS Bulletin C61 +# File expires on: 28 December 2021 # -#@ 3833827200 +#@ 3849638400 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h 064356a8 39268b92 76e4d5ef 3e22fae1 0cca529c +#h 2ab8253d d4380d28 75f01343 381504f8 8f8a4bfc diff --git a/contrib/tzdata/leapseconds b/contrib/tzdata/leapseconds index bf0d2d749214..cf0df04c3c8e 100644 --- a/contrib/tzdata/leapseconds +++ b/contrib/tzdata/leapseconds @@ -72,11 +72,11 @@ Leap 2016 Dec 31 23:59:60 + S # Any additional leap seconds will come after this. # This Expires line is commented out for now, # so that pre-2020a zic implementations do not reject this file. -#Expires 2021 Jun 28 00:00:00 +#Expires 2021 Dec 28 00:00:00 # POSIX timestamps for the data in this file: #updated 1467936000 (2016-07-08 00:00:00 UTC) -#expires 1624838400 (2021-06-28 00:00:00 UTC) +#expires 1640649600 (2021-12-28 00:00:00 UTC) -# Updated through IERS Bulletin C60 -# File expires on: 28 June 2021 +# Updated through IERS Bulletin C61 +# File expires on: 28 December 2021 diff --git a/contrib/tzdata/version b/contrib/tzdata/version index a481df8cb9d4..1d590958afd8 100644 --- a/contrib/tzdata/version +++ b/contrib/tzdata/version @@ -1 +1 @@ -2020f +2021a From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 22:17:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A3B74F3CFC; Mon, 25 Jan 2021 22:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPkkC2Wvxz3j5x; Mon, 25 Jan 2021 22:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4909C1E50F; Mon, 25 Jan 2021 22:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PMH7VK087593; Mon, 25 Jan 2021 22:17:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMH7kQ087592; Mon, 25 Jan 2021 22:17:07 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:17:07 GMT Message-Id: <202101252217.10PMH7kQ087592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 2a0be7b0331c - stable/12 - VFS_QUOTACTL: Remove needless casts of arg MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2a0be7b0331c5245418cdf2893c8ba6b42a0afa5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 22:17:07 -0000 The branch stable/12 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=2a0be7b0331c5245418cdf2893c8ba6b42a0afa5 commit 2a0be7b0331c5245418cdf2893c8ba6b42a0afa5 Author: Brooks Davis AuthorDate: 2021-01-25 22:16:26 +0000 Commit: Brooks Davis CommitDate: 2021-01-25 22:16:26 +0000 VFS_QUOTACTL: Remove needless casts of arg The argument is a void * so there's no need to cast it to caddr_t. Update documentation to match function decleration. Reviewed by: freqlabs Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27093 (cherry picked from commit 52e63ec2f1ddf76c9411b6833bc5d021457b5005) --- share/man/man9/VFS_QUOTACTL.9 | 4 ++-- sys/fs/nfs/nfs_commonsubs.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/share/man/man9/VFS_QUOTACTL.9 b/share/man/man9/VFS_QUOTACTL.9 index fded4d6b883c..8d0cb113ce1e 100644 --- a/share/man/man9/VFS_QUOTACTL.9 +++ b/share/man/man9/VFS_QUOTACTL.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2009 +.Dd December 17, 2020 .Dt VFS_QUOTACTL 9 .Os .Sh NAME @@ -39,7 +39,7 @@ .In sys/mount.h .In sys/vnode.h .Ft int -.Fn VFS_QUOTACTL "struct mount *mp" "int cmds" "uid_t uid" "caddr_t arg" +.Fn VFS_QUOTACTL "struct mount *mp" "int cmds" "uid_t uid" "void *arg" .Sh DESCRIPTION Implement file system quotas. See diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 167b404007bd..7c54b503b286 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -1882,7 +1882,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, savuid = p->p_cred->p_ruid; p->p_cred->p_ruid = cred->cr_uid; if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA, - USRQUOTA), cred->cr_uid, (caddr_t)&dqb)) + USRQUOTA), cred->cr_uid, &dqb)) freenum = min(dqb.dqb_bhardlimit, freenum); p->p_cred->p_ruid = savuid; #endif /* QUOTA */ @@ -1911,7 +1911,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, savuid = p->p_cred->p_ruid; p->p_cred->p_ruid = cred->cr_uid; if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA, - USRQUOTA), cred->cr_uid, (caddr_t)&dqb)) + USRQUOTA), cred->cr_uid, &dqb)) freenum = min(dqb.dqb_bsoftlimit, freenum); p->p_cred->p_ruid = savuid; #endif /* QUOTA */ @@ -1937,7 +1937,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, savuid = p->p_cred->p_ruid; p->p_cred->p_ruid = cred->cr_uid; if (!VFS_QUOTACTL(vnode_mount(vp),QCMD(Q_GETQUOTA, - USRQUOTA), cred->cr_uid, (caddr_t)&dqb)) + USRQUOTA), cred->cr_uid, &dqb)) freenum = dqb.dqb_curblocks; p->p_cred->p_ruid = savuid; #endif /* QUOTA */ @@ -2662,7 +2662,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, savuid = p->p_cred->p_ruid; p->p_cred->p_ruid = cred->cr_uid; if (!VFS_QUOTACTL(mp, QCMD(Q_GETQUOTA,USRQUOTA), - cred->cr_uid, (caddr_t)&dqb)) + cred->cr_uid, &dqb)) freenum = min(dqb.dqb_isoftlimit-dqb.dqb_curinodes, freenum); p->p_cred->p_ruid = savuid; @@ -2769,7 +2769,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, savuid = p->p_cred->p_ruid; p->p_cred->p_ruid = cred->cr_uid; if (!VFS_QUOTACTL(mp, QCMD(Q_GETQUOTA,USRQUOTA), - cred->cr_uid, (caddr_t)&dqb)) + cred->cr_uid, &dqb)) freenum = min(dqb.dqb_bhardlimit, freenum); p->p_cred->p_ruid = savuid; #endif /* QUOTA */ @@ -2793,7 +2793,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, savuid = p->p_cred->p_ruid; p->p_cred->p_ruid = cred->cr_uid; if (!VFS_QUOTACTL(mp, QCMD(Q_GETQUOTA,USRQUOTA), - cred->cr_uid, (caddr_t)&dqb)) + cred->cr_uid, &dqb)) freenum = min(dqb.dqb_bsoftlimit, freenum); p->p_cred->p_ruid = savuid; #endif /* QUOTA */ @@ -2814,7 +2814,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, savuid = p->p_cred->p_ruid; p->p_cred->p_ruid = cred->cr_uid; if (!VFS_QUOTACTL(mp, QCMD(Q_GETQUOTA,USRQUOTA), - cred->cr_uid, (caddr_t)&dqb)) + cred->cr_uid, &dqb)) freenum = dqb.dqb_curblocks; p->p_cred->p_ruid = savuid; #endif /* QUOTA */ From owner-dev-commits-src-branches@freebsd.org Mon Jan 25 22:17:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86F264F3E68; Mon, 25 Jan 2021 22:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPkkD3Rz8z3hq0; Mon, 25 Jan 2021 22:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69E331E05D; Mon, 25 Jan 2021 22:17:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10PMH8Ip087611; Mon, 25 Jan 2021 22:17:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10PMH8RS087610; Mon, 25 Jan 2021 22:17:08 GMT (envelope-from git) Date: Mon, 25 Jan 2021 22:17:08 GMT Message-Id: <202101252217.10PMH8RS087610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 7baf7a453859 - stable/12 - ndis: Per user request, delay removal to 14 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7baf7a45385962d06cd2a2213109b910d40a7936 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2021 22:17:08 -0000 The branch stable/12 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=7baf7a45385962d06cd2a2213109b910d40a7936 commit 7baf7a45385962d06cd2a2213109b910d40a7936 Author: Brooks Davis AuthorDate: 2021-01-25 22:16:27 +0000 Commit: Brooks Davis CommitDate: 2021-01-25 22:16:27 +0000 ndis: Per user request, delay removal to 14 We will remove ndis shortly after the 13 branch. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D28049 (cherry picked from commit d7a7d6a7c3c6a9b6e03e4739df6801e2a0a296e9) --- share/man/man4/ndis.4 | 2 +- sys/dev/if_ndis/if_ndis_pci.c | 2 +- sys/dev/if_ndis/if_ndis_usb.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/ndis.4 b/share/man/man4/ndis.4 index 4f0b0ab2ed22..1d36d5622b4b 100644 --- a/share/man/man4/ndis.4 +++ b/share/man/man4/ndis.4 @@ -122,7 +122,7 @@ which can be configured via the command. .Sh DEPRECATION NOTICE This driver is scheduled for removal prior to the release of -.Fx 13.0 +.Fx 14.0 .Sh DIAGNOSTICS .Bl -diag .It "ndis%d: watchdog timeout" diff --git a/sys/dev/if_ndis/if_ndis_pci.c b/sys/dev/if_ndis/if_ndis_pci.c index ba83652d1289..cf1685a920ea 100644 --- a/sys/dev/if_ndis/if_ndis_pci.c +++ b/sys/dev/if_ndis/if_ndis_pci.c @@ -338,7 +338,7 @@ ndis_attach_pci(dev) error = ndis_attach(dev); if (error == 0) - gone_in_dev(dev, 13, "ndis removed"); + gone_in_dev(dev, 14, "ndis removed"); fail: diff --git a/sys/dev/if_ndis/if_ndis_usb.c b/sys/dev/if_ndis/if_ndis_usb.c index 40fa32c4b93e..b259db894911 100644 --- a/sys/dev/if_ndis/if_ndis_usb.c +++ b/sys/dev/if_ndis/if_ndis_usb.c @@ -198,7 +198,7 @@ ndisusb_attach(device_t self) if (ndis_attach(self) != 0) return (ENXIO); - gone_in_dev(self, 13, "ndis removed"); + gone_in_dev(self, 14, "ndis removed"); return (0); } From owner-dev-commits-src-branches@freebsd.org Tue Jan 26 03:56:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 230174FDF27; Tue, 26 Jan 2021 03:56:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPtFM0Gp4z4gGn; Tue, 26 Jan 2021 03:56:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F05B92294F; Tue, 26 Jan 2021 03:56:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10Q3u65u030856; Tue, 26 Jan 2021 03:56:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10Q3u6kF030855; Tue, 26 Jan 2021 03:56:06 GMT (envelope-from git) Date: Tue, 26 Jan 2021 03:56:06 GMT Message-Id: <202101260356.10Q3u6kF030855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Jason A. Harmening" Subject: git: 70cdab054c8f - stable/12 - rctl(4): support throttling resource usage to 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 70cdab054c8ffe7f5561ab8f31db33ee62d12c9c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2021 03:56:07 -0000 The branch stable/12 has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=70cdab054c8ffe7f5561ab8f31db33ee62d12c9c commit 70cdab054c8ffe7f5561ab8f31db33ee62d12c9c Author: Jason A. Harmening AuthorDate: 2020-12-30 23:29:44 +0000 Commit: Jason A. Harmening CommitDate: 2021-01-26 03:57:44 +0000 rctl(4): support throttling resource usage to 0 For rate-based resources that support throttling (e.g. readiops/writeips), this fixes a divide-by-zero panic when rctl(8) passes 0 as the throttle value. For these resources, treat zero-throttle requests as requests to suspend forward progress as long as possible using the duration specified in kern.racct.rctl.throttle_max. PR: 251803 Reported by: chris@cretaforce.gr (cherry picked from commit e8a5a1ad7154dc34e3a5234267e19faa86d5ff33) --- sys/kern/kern_rctl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/kern/kern_rctl.c b/sys/kern/kern_rctl.c index d79192927b54..138f73eabb21 100644 --- a/sys/kern/kern_rctl.c +++ b/sys/kern/kern_rctl.c @@ -596,6 +596,11 @@ rctl_enforce(struct proc *p, int resource, uint64_t amount) if (p->p_state != PRS_NORMAL) continue; + if (rule->rr_amount == 0) { + racct_proc_throttle(p, rctl_throttle_max); + continue; + } + /* * Make the process sleep for a fraction of second * proportional to the ratio of process' resource From owner-dev-commits-src-branches@freebsd.org Tue Jan 26 04:53:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C8584FF2D1; Tue, 26 Jan 2021 04:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DPvX644xqz4jns; Tue, 26 Jan 2021 04:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F0E5236B1; Tue, 26 Jan 2021 04:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10Q4rwwH008835; Tue, 26 Jan 2021 04:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10Q4rwFr008834; Tue, 26 Jan 2021 04:53:58 GMT (envelope-from git) Date: Tue, 26 Jan 2021 04:53:58 GMT Message-Id: <202101260453.10Q4rwFr008834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Oleksandr Tymoshenko Subject: git: da2dfec8f752 - stable/13 - Add RELNOTES entry for AES-GCM in armv8crypto(4) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gonzo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: da2dfec8f752f0ebde7851644d074678cb9470cf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2021 04:53:58 -0000 The branch stable/13 has been updated by gonzo: URL: https://cgit.FreeBSD.org/src/commit/?id=da2dfec8f752f0ebde7851644d074678cb9470cf commit da2dfec8f752f0ebde7851644d074678cb9470cf Author: Oleksandr Tymoshenko AuthorDate: 2021-01-26 04:50:26 +0000 Commit: Oleksandr Tymoshenko CommitDate: 2021-01-26 04:53:33 +0000 Add RELNOTES entry for AES-GCM in armv8crypto(4) Reviewed by: gjb, jhb Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D28297 --- RELNOTES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELNOTES b/RELNOTES index 136a6123ee72..602170394523 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,10 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +f76393a6305b6: + Add AES-GCM support to armv8crypto(4) providing accelerated + support for KTLS, IPsec, and other crypto API consumers. + 074a91f746bd: The aesni(4) and armv8crypto(4) devices are now included in GENERIC on amd64, i386, and arm64. From owner-dev-commits-src-branches@freebsd.org Tue Jan 26 14:45:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 578C74F1742; Tue, 26 Jan 2021 14:45:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQ8fY1crgz4SYy; Tue, 26 Jan 2021 14:45:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AC813305; Tue, 26 Jan 2021 14:45:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10QEjP8M077603; Tue, 26 Jan 2021 14:45:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QEjPDI077602; Tue, 26 Jan 2021 14:45:25 GMT (envelope-from git) Date: Tue, 26 Jan 2021 14:45:25 GMT Message-Id: <202101261445.10QEjPDI077602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 49d3dcb041f0 - stable/12 - elfctl: add backwards compatibility for "no" prefixes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 49d3dcb041f058880486e3489ca79c9476ac7abf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2021 14:45:25 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=49d3dcb041f058880486e3489ca79c9476ac7abf commit 49d3dcb041f058880486e3489ca79c9476ac7abf Author: Ed Maste AuthorDate: 2021-01-13 19:21:38 +0000 Commit: Ed Maste CommitDate: 2021-01-26 14:43:42 +0000 elfctl: add backwards compatibility for "no" prefixes I am going to prefix opt-out ELF feature flag names with "no" to make their meaning more clear (review D28139), but there are some uses of the existing names already (e.g., the PR referenced below). For now accept the older, unprefixed name as well, and emit a warning. We can revert this after FreeBSD 13 branches. % elfctl -e +aslr foo elfctl: interpreting aslr as noaslr; please specify noaslr PR: 239873 (related) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28140 (cherry picked from commit 3dfcb70b6ae9bcb9fd6a66721bebdb8c6a53c329) --- usr.bin/elfctl/elfctl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c index 725752375d16..efc993302c60 100644 --- a/usr.bin/elfctl/elfctl.c +++ b/usr.bin/elfctl/elfctl.c @@ -234,6 +234,16 @@ convert_to_feature_val(char *feature_str, uint32_t *feature_val) input |= featurelist[i].value; break; } + /* XXX Backwards compatibility for "no"-prefix flags. */ + if (strncmp(featurelist[i].alias, "no", 2) == 0 && + strcmp(featurelist[i].alias + 2, feature) == 0) { + input |= featurelist[i].value; + warnx( + "interpreting %s as %s; please specify %s", + feature, featurelist[i].alias, + featurelist[i].alias); + break; + } } if (i == len) { warnx("%s is not a valid feature", feature); From owner-dev-commits-src-branches@freebsd.org Tue Jan 26 14:47:23 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 770CA4F1BB7; Tue, 26 Jan 2021 14:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQ8hq2gyPz4THb; Tue, 26 Jan 2021 14:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DE613286; Tue, 26 Jan 2021 14:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10QElNRR077994; Tue, 26 Jan 2021 14:47:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QElN3M077993; Tue, 26 Jan 2021 14:47:23 GMT (envelope-from git) Date: Tue, 26 Jan 2021 14:47:23 GMT Message-Id: <202101261447.10QElN3M077993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: d7e23b5cdd84 - stable/12 - elfctl: allow features to be specified by value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d7e23b5cdd8465bd50f88b1e38cb695a361a26f5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2021 14:47:23 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d7e23b5cdd8465bd50f88b1e38cb695a361a26f5 commit d7e23b5cdd8465bd50f88b1e38cb695a361a26f5 Author: Ed Maste AuthorDate: 2021-01-22 17:22:35 +0000 Commit: Ed Maste CommitDate: 2021-01-26 14:46:00 +0000 elfctl: allow features to be specified by value This will allow elfctl on older releases to set bits that are not yet known there, so that the binary will have the correct settings applied if run on a later FreeBSD version. PR: 252629 (related) Suggested by: kib Reviewed by: gbe (manpage, earlier), kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28284 (cherry picked from commit 86f33b5fcf6087bf4439881011b920ff99e6e300) elfctl: fix typo from last-minute refactoring Reported by: jkim (cherry picked from commit f302fd1aa6730facd53a3f761e0a57302731b03e) elfctl: Fix type errors. Target value for val has uint32_t type, not uint, adjust used constant. Change val type to unsigned so that left and right sides of comparision operator do not expose different signed types of same range [*]. Switch to unsigned long long and strtoll(3) so that 0x80000000 is accepted by conversion function [**]. Reported by: kargl [*] Noted by: emaste [**] Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28301 (cherry picked from commit 9940ac808de7b7d4ed0408c3e739f667dca06d3b) --- usr.bin/elfctl/elfctl.1 | 15 +++++++++++++-- usr.bin/elfctl/elfctl.c | 26 +++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/usr.bin/elfctl/elfctl.1 b/usr.bin/elfctl/elfctl.1 index f93b558fdf0d..23e2dabea49c 100644 --- a/usr.bin/elfctl/elfctl.1 +++ b/usr.bin/elfctl/elfctl.1 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2021 +.Dd January 22, 2021 .Dt ELFCTL 1 .Os .Sh NAME @@ -64,7 +64,8 @@ to turn on the features, to turn off the features, .Dq Li = to only turn on the given features. -A comma separated list of feature names follows the operation. +A comma separated list of feature names or numeric values follows the +operation. .El .Pp If @@ -86,6 +87,16 @@ command: elfctl file elfctl -e +aslr file .Ed +.Pp +Features may be specified as numerical values: +.Bd -literal -offset -indent +elfctl -e =0x0001,0x0004 file +.Ed +.Pp +Features may also be specified as a single combined value: +.Bd -literal -offset -indent +elfctl -e =0x5 file +.Ed .Sh HISTORY .Nm first appeared in diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c index efc993302c60..15b35a5fec4b 100644 --- a/usr.bin/elfctl/elfctl.c +++ b/usr.bin/elfctl/elfctl.c @@ -33,12 +33,15 @@ #include #include +#include #include +#include #include #include #include #include #include +#include #include #include #include @@ -246,9 +249,26 @@ convert_to_feature_val(char *feature_str, uint32_t *feature_val) } } if (i == len) { - warnx("%s is not a valid feature", feature); - if (!iflag) - return (false); + if (isdigit(feature[0])) { + char *eptr; + unsigned long long val; + + errno = 0; + val = strtoll(feature, &eptr, 0); + if (eptr == feature || *eptr != '\0') + errno = EINVAL; + else if (val > UINT32_MAX) + errno = ERANGE; + if (errno != 0) { + warn("%s invalid", feature); + return (false); + } + input |= val; + } else { + warnx("%s is not a valid feature", feature); + if (!iflag) + return (false); + } } } From owner-dev-commits-src-branches@freebsd.org Tue Jan 26 14:48:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84AF64F1C85; Tue, 26 Jan 2021 14:48:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQ8kf3H0xz4TLd; Tue, 26 Jan 2021 14:48:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6398B30C6; Tue, 26 Jan 2021 14:48:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10QEmwVi078352; Tue, 26 Jan 2021 14:48:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10QEmwkg078351; Tue, 26 Jan 2021 14:48:58 GMT (envelope-from git) Date: Tue, 26 Jan 2021 14:48:58 GMT Message-Id: <202101261448.10QEmwkg078351@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f56d7f838f5b - stable/12 - elfctl: prefix disable flags with "no" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f56d7f838f5b3aa0f55b10406eaa7eb760a3ba18 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jan 2021 14:48:58 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f56d7f838f5b3aa0f55b10406eaa7eb760a3ba18 commit f56d7f838f5b3aa0f55b10406eaa7eb760a3ba18 Author: Ed Maste AuthorDate: 2021-01-13 18:08:31 +0000 Commit: Ed Maste CommitDate: 2021-01-26 14:48:14 +0000 elfctl: prefix disable flags with "no" Some ELF feature flags indicate a request to opt-out of some feature, for example NT_FREEBSD_FCTL_ASLR_DISABLE indicates that ASLR should be disabled for the tagged binary. Using "aslr" as the short name for the flag is confusing as it seems to indicate a request for ASLR to be enabled. Rename "noaslr", and make a similar change for other opt-out flags. Reviewed by: bapt, manu, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28139 (cherry picked from commit c763f99d11fdc9641308124c4a030c90b6a7fdbb) --- usr.bin/elfctl/elfctl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c index 15b35a5fec4b..205be39fadc7 100644 --- a/usr.bin/elfctl/elfctl.c +++ b/usr.bin/elfctl/elfctl.c @@ -65,15 +65,16 @@ struct ControlFeatures { }; static struct ControlFeatures featurelist[] = { - { "aslr", NT_FREEBSD_FCTL_ASLR_DISABLE, "Disable ASLR" }, - { "protmax", NT_FREEBSD_FCTL_PROTMAX_DISABLE, + { "noaslr", NT_FREEBSD_FCTL_ASLR_DISABLE, "Disable ASLR" }, + { "noprotmax", NT_FREEBSD_FCTL_PROTMAX_DISABLE, "Disable implicit PROT_MAX" }, - { "stackgap", NT_FREEBSD_FCTL_STKGAP_DISABLE, "Disable stack gap" }, + { "nostackgap", NT_FREEBSD_FCTL_STKGAP_DISABLE, "Disable stack gap" }, { "wxneeded", NT_FREEBSD_FCTL_WXNEEDED, "Requires W+X mappings" }, #ifdef NT_FREEBSD_FCTL_LA48 { "la48", NT_FREEBSD_FCTL_LA48, "amd64: Limit user VA to 48bit" }, #endif - { "aslrstkgap", NT_FREEBSD_FCTL_ASG_DISABLE, "Disable ASLR stack gap" }, + { "noaslrstkgap", NT_FREEBSD_FCTL_ASG_DISABLE, + "Disable ASLR stack gap" }, }; static struct option long_opts[] = { From owner-dev-commits-src-branches@freebsd.org Wed Jan 27 00:26:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA3364E7311; Wed, 27 Jan 2021 00:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQPXW5LZbz4hnk; Wed, 27 Jan 2021 00:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA519136EA; Wed, 27 Jan 2021 00:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10R0Q3LA036594; Wed, 27 Jan 2021 00:26:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10R0Q3KZ036593; Wed, 27 Jan 2021 00:26:03 GMT (envelope-from git) Date: Wed, 27 Jan 2021 00:26:03 GMT Message-Id: <202101270026.10R0Q3KZ036593@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f2b5999b2166 - stable/13 - elfctl: allow features to be specified by value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f2b5999b2166579a2ebd4b5e117a17574f18d50f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2021 00:26:03 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f2b5999b2166579a2ebd4b5e117a17574f18d50f commit f2b5999b2166579a2ebd4b5e117a17574f18d50f Author: Ed Maste AuthorDate: 2021-01-22 17:22:35 +0000 Commit: Ed Maste CommitDate: 2021-01-26 14:44:12 +0000 elfctl: allow features to be specified by value This will allow elfctl on older releases to set bits that are not yet known there, so that the binary will have the correct settings applied if run on a later FreeBSD version. PR: 252629 (related) Suggested by: kib Reviewed by: gbe (manpage, earlier), kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28284 (cherry picked from commit 86f33b5fcf6087bf4439881011b920ff99e6e300) elfctl: fix typo from last-minute refactoring Reported by: jkim (cherry picked from commit f302fd1aa6730facd53a3f761e0a57302731b03e) elfctl: Fix type errors. Target value for val has uint32_t type, not uint, adjust used constant. Change val type to unsigned so that left and right sides of comparision operator do not expose different signed types of same range [*]. Switch to unsigned long long and strtoll(3) so that 0x80000000 is accepted by conversion function [**]. Reported by: kargl [*] Noted by: emaste [**] Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28301 (cherry picked from commit 9940ac808de7b7d4ed0408c3e739f667dca06d3b) --- usr.bin/elfctl/elfctl.1 | 15 +++++++++++++-- usr.bin/elfctl/elfctl.c | 26 +++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/usr.bin/elfctl/elfctl.1 b/usr.bin/elfctl/elfctl.1 index f93b558fdf0d..23e2dabea49c 100644 --- a/usr.bin/elfctl/elfctl.1 +++ b/usr.bin/elfctl/elfctl.1 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2021 +.Dd January 22, 2021 .Dt ELFCTL 1 .Os .Sh NAME @@ -64,7 +64,8 @@ to turn on the features, to turn off the features, .Dq Li = to only turn on the given features. -A comma separated list of feature names follows the operation. +A comma separated list of feature names or numeric values follows the +operation. .El .Pp If @@ -86,6 +87,16 @@ command: elfctl file elfctl -e +aslr file .Ed +.Pp +Features may be specified as numerical values: +.Bd -literal -offset -indent +elfctl -e =0x0001,0x0004 file +.Ed +.Pp +Features may also be specified as a single combined value: +.Bd -literal -offset -indent +elfctl -e =0x5 file +.Ed .Sh HISTORY .Nm first appeared in diff --git a/usr.bin/elfctl/elfctl.c b/usr.bin/elfctl/elfctl.c index 20a2c5b95444..bcdd1be394a9 100644 --- a/usr.bin/elfctl/elfctl.c +++ b/usr.bin/elfctl/elfctl.c @@ -33,12 +33,15 @@ #include #include +#include #include +#include #include #include #include #include #include +#include #include #include #include @@ -245,9 +248,26 @@ convert_to_feature_val(char *feature_str, uint32_t *feature_val) } } if (i == len) { - warnx("%s is not a valid feature", feature); - if (!iflag) - return (false); + if (isdigit(feature[0])) { + char *eptr; + unsigned long long val; + + errno = 0; + val = strtoll(feature, &eptr, 0); + if (eptr == feature || *eptr != '\0') + errno = EINVAL; + else if (val > UINT32_MAX) + errno = ERANGE; + if (errno != 0) { + warn("%s invalid", feature); + return (false); + } + input |= val; + } else { + warnx("%s is not a valid feature", feature); + if (!iflag) + return (false); + } } } From owner-dev-commits-src-branches@freebsd.org Wed Jan 27 00:26:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 982D84E748C; Wed, 27 Jan 2021 00:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQPYK3xtyz4hrf; Wed, 27 Jan 2021 00:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A3B713774; Wed, 27 Jan 2021 00:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10R0QjXV036809; Wed, 27 Jan 2021 00:26:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10R0QjCE036808; Wed, 27 Jan 2021 00:26:45 GMT (envelope-from git) Date: Wed, 27 Jan 2021 00:26:45 GMT Message-Id: <202101270026.10R0QjCE036808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 03d837b565a9 - stable/13 - Remove Binutils from src.conf(5) option descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 03d837b565a96b450d62b904ee108677f23122f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2021 00:26:45 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=03d837b565a96b450d62b904ee108677f23122f8 commit 03d837b565a96b450d62b904ee108677f23122f8 Author: Ed Maste AuthorDate: 2021-01-24 17:22:01 +0000 Commit: Ed Maste CommitDate: 2021-01-27 00:26:16 +0000 Remove Binutils from src.conf(5) option descriptions All binutils remnants have been removed before FreeBSD 13. PR: 252842 MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit b23665f3169b7b0364416060855541b450204d6d) --- tools/build/options/WITHOUT_LLD_BOOTSTRAP | 3 +-- tools/build/options/WITHOUT_LLD_IS_LD | 7 ++++++- tools/build/options/WITH_LLD_IS_LD | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/build/options/WITHOUT_LLD_BOOTSTRAP b/tools/build/options/WITHOUT_LLD_BOOTSTRAP index 646edd341c35..d9824c51b23c 100644 --- a/tools/build/options/WITHOUT_LLD_BOOTSTRAP +++ b/tools/build/options/WITHOUT_LLD_BOOTSTRAP @@ -1,5 +1,4 @@ .\" $FreeBSD$ Set to not build the LLD linker during the bootstrap phase of the build. -To be able to build the system, either Binutils or LLD bootstrap must be -enabled unless an alternate linker is provided via XLD. +To be able to build the system an alternate linker must be provided via XLD. diff --git a/tools/build/options/WITHOUT_LLD_IS_LD b/tools/build/options/WITHOUT_LLD_IS_LD index 0d48f205d85d..8ca789dfdc45 100644 --- a/tools/build/options/WITHOUT_LLD_IS_LD +++ b/tools/build/options/WITHOUT_LLD_IS_LD @@ -1,2 +1,7 @@ .\" $FreeBSD$ -Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. +Do not install a +.Pa /usr/bin/ld symlink +to +.Pa ld.lld . +The system will not have a usable tool chain unless a linker is provided +some other way. diff --git a/tools/build/options/WITH_LLD_IS_LD b/tools/build/options/WITH_LLD_IS_LD index a291b099bf06..9a07c71fdeda 100644 --- a/tools/build/options/WITH_LLD_IS_LD +++ b/tools/build/options/WITH_LLD_IS_LD @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. +Set to use LLVM's LLD as the system linker. From owner-dev-commits-src-branches@freebsd.org Fri Jan 29 00:00:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 504824F14DC; Fri, 29 Jan 2021 00:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DRct40lPsz4tBG; Fri, 29 Jan 2021 00:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04A5018BDA; Fri, 29 Jan 2021 00:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10T00Rpq061390; Fri, 29 Jan 2021 00:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T00RPQ061389; Fri, 29 Jan 2021 00:00:27 GMT (envelope-from git) Date: Fri, 29 Jan 2021 00:00:27 GMT Message-Id: <202101290000.10T00RPQ061389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 40cb0344eb27 - stable/13 - release: set stable/13 to ALPHA3 as part of the 13.0 cycle MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 40cb0344eb27e0bb9a112ff50812a7e77816d6be Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2021 00:00:28 -0000 The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=40cb0344eb27e0bb9a112ff50812a7e77816d6be commit 40cb0344eb27e0bb9a112ff50812a7e77816d6be Author: Glen Barber AuthorDate: 2021-01-28 23:59:57 +0000 Commit: Glen Barber CommitDate: 2021-01-28 23:59:57 +0000 release: set stable/13 to ALPHA3 as part of the 13.0 cycle Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/conf/newvers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 8739cf6fc498..a40392d91b9b 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.0" -BRANCH="ALPHA2" +BRANCH="ALPHA3" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-dev-commits-src-branches@freebsd.org Fri Jan 29 00:38:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C484F4F2B48; Fri, 29 Jan 2021 00:38:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DRdkF5Ccfz3D3K; Fri, 29 Jan 2021 00:38:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A59B219631; Fri, 29 Jan 2021 00:38:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10T0cjAd006134; Fri, 29 Jan 2021 00:38:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T0cjqV006133; Fri, 29 Jan 2021 00:38:45 GMT (envelope-from git) Date: Fri, 29 Jan 2021 00:38:45 GMT Message-Id: <202101290038.10T0cjqV006133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ryan Moeller Subject: git: 5d58f58b0d61 - stable/13 - sbin/sysctl: Fix CTLFLAG_SKIP for adjacent nodes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5d58f58b0d612913fd280a6acaf174019bd465ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2021 00:38:45 -0000 The branch stable/13 has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=5d58f58b0d612913fd280a6acaf174019bd465ba commit 5d58f58b0d612913fd280a6acaf174019bd465ba Author: Ryan Moeller AuthorDate: 2021-01-27 19:27:46 +0000 Commit: Ryan Moeller CommitDate: 2021-01-29 00:36:46 +0000 sbin/sysctl: Fix CTLFLAG_SKIP for adjacent nodes The OID is saved when we encounter CTLFLAG_SKIP so that descendants can be skipped as well. We then must not update the skip OID until we are out of the node. This was achieved by resetting the skip OID once the prefix no longer matches, but the case where the OID we reset on has CTLFLAG_SKIP was not accounted for. Reported by: mav Reviewed by: mav Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D28364 (cherry picked from commit 65efb73fbddd44116fd39b03991386a67422ba6d) --- sbin/sysctl/sysctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index bd1e357065dc..30d6d94723fa 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -1030,7 +1030,8 @@ show_var(int *oid, int nlen, bool honor_skip) } /* keep track of encountered skip nodes, ignoring descendants */ - if (skip_len == 0 && (kind & CTLFLAG_SKIP) != 0) { + if ((skip_len == 0 || skip_len >= nlen * (int)sizeof(int)) && + (kind & CTLFLAG_SKIP) != 0) { /* Save this oid so we can skip descendants. */ skip_len = nlen * sizeof(int); memcpy(skip_oid, oid, skip_len); From owner-dev-commits-src-branches@freebsd.org Fri Jan 29 01:23:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE07D4F47E5; Fri, 29 Jan 2021 01:23:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DRfjL5n94z3Jkr; Fri, 29 Jan 2021 01:23:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B978D1A020; Fri, 29 Jan 2021 01:23:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10T1N2qQ070892; Fri, 29 Jan 2021 01:23:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T1N2kj070891; Fri, 29 Jan 2021 01:23:02 GMT (envelope-from git) Date: Fri, 29 Jan 2021 01:23:02 GMT Message-Id: <202101290123.10T1N2kj070891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: ed05bfceb819 - stable/13 - build: remove LIBPTHREAD/LIBTHR build options MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed05bfceb8191c2d50742203512bb0378d831aba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2021 01:23:02 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ed05bfceb8191c2d50742203512bb0378d831aba commit ed05bfceb8191c2d50742203512bb0378d831aba Author: Kyle Evans AuthorDate: 2021-01-20 14:01:25 +0000 Commit: Kyle Evans CommitDate: 2021-01-29 01:21:46 +0000 build: remove LIBPTHREAD/LIBTHR build options WITHOUT_LIBTHR has been broken for a little over five years now, since the xz 5.2.0 update introduced a hard liblzma dependency on libthr, and building a useful system without threading support is becoming increasingly more difficult. Additionally, in the five plus years that it's been broken more reverse dependencies have cropped up in libzstd, libsqlite3, and libcrypto (among others) that make it more and more difficult to reconcile the effort needed to fix these options. Remove the broken options. PR: 252760 (cherry picked from commit 123ae3045dd21badb93ce52445e18e364b3ac807) (cherry picked from commit 251a6ddfbdcd72e0de922e8320d2f0cc6806a423) --- Makefile.inc1 | 6 +----- cddl/lib/Makefile | 2 -- cddl/usr.bin/Makefile | 2 -- cddl/usr.sbin/Makefile | 2 -- lib/Makefile | 4 ++-- sbin/ggate/Makefile | 9 ++------- share/man/man3/Makefile | 2 -- share/man/man5/src.conf.5 | 18 +----------------- share/mk/src.opts.mk | 6 ------ tools/build/mk/OptionalObsoleteFiles.inc | 7 ------- tools/build/options/WITHOUT_LIBPTHREAD | 5 ----- tools/build/options/WITHOUT_LIBTHR | 5 ----- usr.sbin/Makefile | 2 -- usr.sbin/ngctl/Makefile | 2 -- 14 files changed, 6 insertions(+), 66 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index d9ef01eefde5..f27cd2706359 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2898,7 +2898,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ lib/libzstd \ ${_lib_casper} \ lib/ncurses/ncurses \ - lib/libopie lib/libpam/libpam ${_lib_libthr} \ + lib/libopie lib/libpam/libpam lib/libthr \ ${_lib_libradius} lib/libsbuf lib/libtacplus \ lib/libgeom \ ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ @@ -2932,10 +2932,6 @@ _prebuild_libs+= lib/libc++ lib/libgeom__L: lib/libexpat__L lib/libsbuf__L lib/libkvm__L: lib/libelf__L -.if ${MK_LIBTHR} != "no" -_lib_libthr= lib/libthr -.endif - .if ${MK_RADIUS_SUPPORT} != "no" _lib_libradius= lib/libradius .endif diff --git a/cddl/lib/Makefile b/cddl/lib/Makefile index 38ab0358dde6..2f360a8684a2 100644 --- a/cddl/lib/Makefile +++ b/cddl/lib/Makefile @@ -28,11 +28,9 @@ _libicp_rescue= libicp_rescue _libzfs= libzfs _libzutil= libzutil _libzfsbootenv= libzfsbootenv -.if ${MK_LIBTHR} != "no" _libzpool= libzpool _libtpool= libtpool .endif -.endif SUBDIR_DEPEND_libctf= libspl SUBDIR_DEPEND_libdtrace= libctf diff --git a/cddl/usr.bin/Makefile b/cddl/usr.bin/Makefile index 8c7fa3ac83fa..5c2595df1c9f 100644 --- a/cddl/usr.bin/Makefile +++ b/cddl/usr.bin/Makefile @@ -15,12 +15,10 @@ SUBDIR.${MK_TESTS}+= tests .if ${MK_ZFS} != "no" _zinject= zinject -.if ${MK_LIBTHR} != "no" _ztest= ztest _zstream = zstream _zstreamdump = zstreamdump .endif -.endif SUBDIR_PARALLEL= diff --git a/cddl/usr.sbin/Makefile b/cddl/usr.sbin/Makefile index a736a75a73ec..42de5c96c53a 100644 --- a/cddl/usr.sbin/Makefile +++ b/cddl/usr.sbin/Makefile @@ -13,10 +13,8 @@ SUBDIR= ${_dtrace} \ SUBDIR.${MK_TESTS}+= tests .if ${MK_ZFS} != "no" -.if ${MK_LIBTHR} != "no" _zdb= zdb _zhack= zhack -.endif . if ${MK_CXX} != "no" _zfsd= zfsd . endif diff --git a/lib/Makefile b/lib/Makefile index 5d7caa6b9423..ddb627917215 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -93,6 +93,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libstdthreads \ libsysdecode \ libtacplus \ + libthr \ libthread_db \ libucl \ libufs \ @@ -137,7 +138,7 @@ SUBDIR_DEPEND_libsmb= libkiconv SUBDIR_DEPEND_libtacplus= libmd SUBDIR_DEPEND_libulog= libmd SUBDIR_DEPEND_libunbound= ${_libldns} -SUBDIR_DEPEND_liblzma= ${_libthr} +SUBDIR_DEPEND_liblzma= libthr .if ${MK_OFED} != "no" SUBDIR_DEPEND_libpcap= ofed .endif @@ -189,7 +190,6 @@ _libcplusplus+= libc++experimental SUBDIR.${MK_EFI}+= libefivar SUBDIR.${MK_GOOGLETEST}+= googletest -SUBDIR.${MK_LIBTHR}+= libthr SUBDIR.${MK_NETGRAPH}+= libnetgraph SUBDIR.${MK_NIS}+= libypclnt diff --git a/sbin/ggate/Makefile b/sbin/ggate/Makefile index b46335991671..22532cc18512 100644 --- a/sbin/ggate/Makefile +++ b/sbin/ggate/Makefile @@ -2,13 +2,8 @@ .include -SUBDIR= ${_ggatec} \ - ${_ggated} \ +SUBDIR= ggatec \ + ggated \ ggatel -.if ${MK_LIBTHR} != "no" -_ggatec= ggatec -_ggated= ggated -.endif - .include diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile index 7fb09f970a26..d33c0d63ea0d 100644 --- a/share/man/man3/Makefile +++ b/share/man/man3/Makefile @@ -370,7 +370,6 @@ MLINKS+= tree.3 RB_EMPTY.3 \ tree.3 SPLAY_RIGHT.3 \ tree.3 SPLAY_ROOT.3 -.if ${MK_LIBTHR} != "no" PTHREAD_MAN= pthread.3 \ pthread_affinity_np.3 \ pthread_atfork.3 \ @@ -504,6 +503,5 @@ PTHREAD_MLINKS+=pthread_testcancel.3 pthread_setcancelstate.3 \ pthread_testcancel.3 pthread_setcanceltype.3 PTHREAD_MLINKS+=pthread_join.3 pthread_peekjoin_np.3 \ pthread_join.3 pthread_timedjoin_np.3 -.endif .include diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 9ac4df055194..9230c2b9fd84 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 22, 2021 +.Dd January 28, 2021 .Dt SRC.CONF 5 .Os .Sh NAME @@ -861,25 +861,9 @@ This is a default setting on arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mips, powerpc/powerpc, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LIBCPLUSPLUS Set to avoid building libcxxrt and libc++. -.It Va WITHOUT_LIBPTHREAD -Set to not build the -.Nm libpthread -providing library, -.Nm libthr . -When set, it enforces these options: -.Pp -.Bl -item -compact -.It -.Va WITHOUT_LIBTHR -.El .It Va WITH_LIBSOFT On armv6 only, set to enable soft float ABI compatibility libraries. This option is for transitioning to the new hard float ABI. -.It Va WITHOUT_LIBTHR -Set to not build the -.Nm libthr -(1:1 threading) -library. .It Va WITHOUT_LLD Set to not build LLVM's lld linker. .It Va WITHOUT_LLDB diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index a088adbd91f7..a7eddb12d2c8 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -126,8 +126,6 @@ __DEFAULT_YES_OPTIONS = \ LDNS_UTILS \ LEGACY_CONSOLE \ LIBCPLUSPLUS \ - LIBPTHREAD \ - LIBTHR \ LLD \ LLD_BOOTSTRAP \ LLD_IS_LD \ @@ -378,10 +376,6 @@ BROKEN_OPTIONS+=CLANG_BOOTSTRAP LLD_BOOTSTRAP MK_CASPER:= no .endif -.if ${MK_LIBPTHREAD} == "no" -MK_LIBTHR:= no -.endif - .if ${MK_SOURCELESS} == "no" MK_SOURCELESS_HOST:= no MK_SOURCELESS_UCODE:= no diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 0484ad6fa30a..b517cff65338 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -4110,13 +4110,6 @@ OLD_DIRS+=usr/include/c++/v1/ext OLD_DIRS+=usr/include/c++/v1 .endif -.if ${MK_LIBTHR} == no -OLD_LIBS+=lib/libthr.so.3 -OLD_FILES+=usr/lib/libthr.a -OLD_FILES+=usr/lib/libthr_p.a -OLD_FILES+=usr/share/man/man3/libthr.3.gz -.endif - .if ${MK_LLD} == no OLD_FILES+=usr/bin/ld.lld .endif diff --git a/tools/build/options/WITHOUT_LIBPTHREAD b/tools/build/options/WITHOUT_LIBPTHREAD deleted file mode 100644 index 28a6200bfc92..000000000000 --- a/tools/build/options/WITHOUT_LIBPTHREAD +++ /dev/null @@ -1,5 +0,0 @@ -.\" $FreeBSD$ -Set to not build the -.Nm libpthread -providing library, -.Nm libthr . diff --git a/tools/build/options/WITHOUT_LIBTHR b/tools/build/options/WITHOUT_LIBTHR deleted file mode 100644 index 836473511983..000000000000 --- a/tools/build/options/WITHOUT_LIBTHR +++ /dev/null @@ -1,5 +0,0 @@ -.\" $FreeBSD$ -Set to not build the -.Nm libthr -(1:1 threading) -library. diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index da61617e408b..39913a327b87 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -162,10 +162,8 @@ SUBDIR.${MK_LEGACY_CONSOLE}+= kbdcontrol SUBDIR.${MK_LEGACY_CONSOLE}+= kbdmap SUBDIR.${MK_LEGACY_CONSOLE}+= moused SUBDIR.${MK_LEGACY_CONSOLE}+= vidcontrol -.if ${MK_LIBTHR} != "no" || ${MK_LIBPTHREAD} != "no" SUBDIR.${MK_PPP}+= pppctl SUBDIR.${MK_NS_CACHING}+= nscd -.endif SUBDIR.${MK_LPR}+= lpr SUBDIR.${MK_MAN_UTILS}+= manctl SUBDIR.${MK_MLX5TOOL}+= mlx5tool diff --git a/usr.sbin/ngctl/Makefile b/usr.sbin/ngctl/Makefile index 519bf98c7813..a4831523c3fc 100644 --- a/usr.sbin/ngctl/Makefile +++ b/usr.sbin/ngctl/Makefile @@ -11,9 +11,7 @@ WARNS?= 3 LIBADD= netgraph -.if ${MK_LIBTHR} != "no" CFLAGS+= -DEDITLINE LIBADD+= edit pthread -.endif .include From owner-dev-commits-src-branches@freebsd.org Fri Jan 29 01:23:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 058B54F47E7; Fri, 29 Jan 2021 01:23:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DRfjM6mpwz3Jsb; Fri, 29 Jan 2021 01:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB7FF19DDF; Fri, 29 Jan 2021 01:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10T1N3Kd070911; Fri, 29 Jan 2021 01:23:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T1N3U5070910; Fri, 29 Jan 2021 01:23:03 GMT (envelope-from git) Date: Fri, 29 Jan 2021 01:23:03 GMT Message-Id: <202101290123.10T1N3U5070910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 2e8149046432 - stable/13 - Regenerate src.conf(5) after 03d837b565a9 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2e814904643242895a99e71233e1f17585d093e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2021 01:23:04 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2e814904643242895a99e71233e1f17585d093e3 commit 2e814904643242895a99e71233e1f17585d093e3 Author: Kyle Evans AuthorDate: 2021-01-29 01:21:58 +0000 Commit: Kyle Evans CommitDate: 2021-01-29 01:21:58 +0000 Regenerate src.conf(5) after 03d837b565a9 (direct commit) --- share/man/man5/src.conf.5 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 9230c2b9fd84..dafeb1efa248 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -879,10 +879,14 @@ amd64/amd64, arm64/aarch64 and i386/i386. .It Va WITHOUT_LLD_BOOTSTRAP Set to not build the LLD linker during the bootstrap phase of the build. -To be able to build the system, either Binutils or LLD bootstrap must be -enabled unless an alternate linker is provided via XLD. +To be able to build the system an alternate linker must be provided via XLD. .It Va WITHOUT_LLD_IS_LD -Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. +Do not install a +.Pa /usr/bin/ld symlink +to +.Pa ld.lld . +The system will not have a usable tool chain unless a linker is provided +some other way. .It Va WITH_LLVM_ASSERTIONS Set to enable debugging assertions in LLVM. .It Va WITHOUT_LLVM_COV From owner-dev-commits-src-branches@freebsd.org Fri Jan 29 05:26:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B5004FDDB7; Fri, 29 Jan 2021 05:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DRm6l1g3Mz3s8Z; Fri, 29 Jan 2021 05:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21DF21D3F9; Fri, 29 Jan 2021 05:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10T5QtIB085226; Fri, 29 Jan 2021 05:26:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10T5QtlU085225; Fri, 29 Jan 2021 05:26:55 GMT (envelope-from git) Date: Fri, 29 Jan 2021 05:26:55 GMT Message-Id: <202101290526.10T5QtlU085225@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 633f82126b28 - stable/13 - lualoader: improve loader.conf var processing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 633f82126b28d6c44beae579a7f71eb85ca1453c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2021 05:26:55 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=633f82126b28d6c44beae579a7f71eb85ca1453c commit 633f82126b28d6c44beae579a7f71eb85ca1453c Author: Kyle Evans AuthorDate: 2021-01-24 19:25:34 +0000 Commit: Kyle Evans CommitDate: 2021-01-29 05:26:30 +0000 lualoader: improve loader.conf var processing lualoader was previously not processing \ as escapes; this commit fixes that and does better error checking on the value as well. Additionally, loader.conf had some odd restrictions on values that make little sense. Previously, lines like: kernel=foo Would simply be discarded with a malformed line complaint you might not see unless you disable beastie. lualoader tries to process these as well as it can and manipulates the environment, while forthloader did minimal processing and constructed a `set` command to do the heavy lifting instead. The lua approach was re-envisioned from building a `set` command so that we can appropriately reset the environment when, for example, boot environments change. Lift the previous restrictions to allow unquoted values on the right hand side of an expression. Note that an unquoted value is effectively: [A-Za-z0-9-][A-Za-z0-9-_.]* This commit also stops trying to weirdly limit what it can handle in a quoted value. Previously it only allowed spaces, alphanumeric, and punctuation, which is kind of weird. Change it here to grab as much as it can between two sets of quotes, then let processEnvVar() do the needful and complain if it finds something malformed looking. My extremely sophisticated test suite is as follows: < Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79A504E6C6C; Fri, 29 Jan 2021 10:56:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DRvR11YHJz4hwx; Fri, 29 Jan 2021 10:56:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25EA8217C6; Fri, 29 Jan 2021 10:56:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10TAuTxi015568; Fri, 29 Jan 2021 10:56:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TAuTYO015567; Fri, 29 Jan 2021 10:56:29 GMT (envelope-from git) Date: Fri, 29 Jan 2021 10:56:29 GMT Message-Id: <202101291056.10TAuTYO015567@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: e6341fd7220e - stable/13 - Adjust line length in tcp_prr_partialack MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6341fd7220e8f5a3c03a7bf1ad91906e709b5ca Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2021 10:56:29 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=e6341fd7220e8f5a3c03a7bf1ad91906e709b5ca commit e6341fd7220e8f5a3c03a7bf1ad91906e709b5ca Author: Richard Scheffenegger AuthorDate: 2021-01-26 13:47:19 +0000 Commit: Richard Scheffenegger CommitDate: 2021-01-29 10:53:19 +0000 Adjust line length in tcp_prr_partialack No functional changes. Reviewed By: tuexen, mm, #transport MFC: 3 days Subscribers: imp, melifaro Differential Revision: https://reviews.freebsd.org/D28329 (cherry picked from commit 84761f3df508aed50783b60f028af9d98a684b41) --- sys/netinet/tcp_input.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 75718352da00..4b8f91ed9d0b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3949,14 +3949,17 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) * Proportional Rate Reduction */ if (pipe > tp->snd_ssthresh) - snd_cnt = (tp->sackhint.prr_delivered * tp->snd_ssthresh / tp->sackhint.recover_fs) - - tp->sackhint.sack_bytes_rexmit; + snd_cnt = (tp->sackhint.prr_delivered * tp->snd_ssthresh / + tp->sackhint.recover_fs) - tp->sackhint.sack_bytes_rexmit; else { if (V_tcp_do_prr_conservative) - limit = tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit; + limit = tp->sackhint.prr_delivered - + tp->sackhint.sack_bytes_rexmit; else - if ((tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit) > del_data) - limit = tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit + maxseg; + if ((tp->sackhint.prr_delivered - + tp->sackhint.sack_bytes_rexmit) > del_data) + limit = tp->sackhint.prr_delivered - + tp->sackhint.sack_bytes_rexmit + maxseg; else limit = del_data + maxseg; snd_cnt = min((tp->snd_ssthresh - pipe), limit); From owner-dev-commits-src-branches@freebsd.org Fri Jan 29 11:01:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A140F4E732F; Fri, 29 Jan 2021 11:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DRvXz44pvz4jXP; Fri, 29 Jan 2021 11:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B055214D0; Fri, 29 Jan 2021 11:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10TB1dwl027475; Fri, 29 Jan 2021 11:01:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TB1djv027474; Fri, 29 Jan 2021 11:01:39 GMT (envelope-from git) Date: Fri, 29 Jan 2021 11:01:39 GMT Message-Id: <202101291101.10TB1djv027474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 76dd854f47f4 - stable/13 - TCP PRR: Patch div/0 in tcp_prr_partialack MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 76dd854f47f4aea703093647a158f280d383ea6d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2021 11:01:39 -0000 The branch stable/13 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=76dd854f47f4aea703093647a158f280d383ea6d commit 76dd854f47f4aea703093647a158f280d383ea6d Author: Richard Scheffenegger AuthorDate: 2021-01-26 15:06:32 +0000 Commit: Richard Scheffenegger CommitDate: 2021-01-29 10:57:21 +0000 TCP PRR: Patch div/0 in tcp_prr_partialack Adding a safety net prior to the division in tcp_prr_partialack function, which was missed in D28114. Reviewed-by: tuexen, mm, @transport MFC: 3 days Differential Revision: https://reviews.freebsd.org/D28326 (cherry picked from commit 6a376af0cd212be4e16d013d35a0e2eec1dbb8ae) --- sys/netinet/tcp_input.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 4b8f91ed9d0b..459b78cd444a 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -510,7 +510,6 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) } /* XXXLAS: EXIT_RECOVERY ? */ tp->t_bytes_acked = 0; - tp->sackhint.recover_fs = 0; } /* @@ -3948,10 +3947,13 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th) /* * Proportional Rate Reduction */ - if (pipe > tp->snd_ssthresh) + if (pipe > tp->snd_ssthresh) { + if (tp->sackhint.recover_fs == 0) + tp->sackhint.recover_fs = + max(1, tp->snd_nxt - tp->snd_una); snd_cnt = (tp->sackhint.prr_delivered * tp->snd_ssthresh / tp->sackhint.recover_fs) - tp->sackhint.sack_bytes_rexmit; - else { + } else { if (V_tcp_do_prr_conservative) limit = tp->sackhint.prr_delivered - tp->sackhint.sack_bytes_rexmit; From owner-dev-commits-src-branches@freebsd.org Fri Jan 29 23:28:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26B544FC334; Fri, 29 Jan 2021 23:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSD7C0TG8z4Yn3; Fri, 29 Jan 2021 23:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 030CB2F6F; Fri, 29 Jan 2021 23:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10TNSsUU095890; Fri, 29 Jan 2021 23:28:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10TNSs4Q095889; Fri, 29 Jan 2021 23:28:54 GMT (envelope-from git) Date: Fri, 29 Jan 2021 23:28:54 GMT Message-Id: <202101292328.10TNSs4Q095889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 010196adcfaf - stable/13 - Fix clang assertion when compiling the devel/onetbb port MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 010196adcfaf2bb610725394d40691874b4ff2af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2021 23:28:55 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=010196adcfaf2bb610725394d40691874b4ff2af commit 010196adcfaf2bb610725394d40691874b4ff2af Author: Dimitry Andric AuthorDate: 2021-01-26 13:07:47 +0000 Commit: Dimitry Andric CommitDate: 2021-01-29 23:25:53 +0000 Fix clang assertion when compiling the devel/onetbb port Merge commit 740a164de from llvm git (by Richard Smith): PR46377: Fix dependence calculation for function types and typedef types. We previously did not treat a function type as dependent if it had a parameter pack with a non-dependent type -- such a function type depends on the arity of the pack so is dependent even though none of the parameter types is dependent. In order to properly handle this, we now treat pack expansion types as always being dependent types (depending on at least the pack arity), and always canonically being pack expansion types, even in the unusual case when the pattern is not a dependent type. This does mean that we can have canonical types that are pack expansions that contain no unexpanded packs, which is unfortunate but not inaccurate. We also previously did not treat a typedef type as instantiation-dependent if its canonical type was not instantiation-dependent. That's wrong because instantiation-dependence is a property of the type sugar, not of the type; an instantiation-dependent type can have a non-instantiation-dependent canonical type. Merge commit 9cf98d26e from llvm git (by Richard Smith): PR46637: Fix handling of placeholder types in trailing-return-types. Only permit a placeholder type in a trailing-return-type if it would also have been permitted in the decl-specifier sequence of a corresponding declaration with no trailing-return-type. The standard doesn't actually say this, but this is the only thing that makes sense. Also fix handling of an 'auto' in a trailing-return-type in a parameter of a generic lambda. We used to crash if we saw such a thing. Merge commit 234f51a65 from llvm git (by Richard Smith): Don't crash if we deserialize a pack expansion type whose pattern contains no packs. Fixes a regression from 740a164dec483225cbd02ab6c82199e2747ffacb. PR: 252892 Reported by: thierry (cherry picked from commit e63539f3059728ff58328ac0ecb2a7bf4e2f08e8) Bump __FreeBSD_version after e63539f3059728ff58328ac0ecb2a7bf4e2f08e8 This is to allow ports to detect the clang fix applied in the above commit. PR: 252892 (cherry picked from commit 2cf84258922f306a3f84866685d2f5346f67db58) --- .../clang/include/clang/AST/ASTContext.h | 10 +- .../llvm-project/clang/include/clang/AST/Type.h | 13 +-- .../clang/include/clang/AST/TypeProperties.td | 3 +- .../clang/include/clang/Basic/TypeNodes.td | 2 +- .../clang/include/clang/Sema/DeclSpec.h | 9 ++ .../llvm-project/clang/include/clang/Sema/Sema.h | 2 + contrib/llvm-project/clang/lib/AST/ASTContext.cpp | 34 +++--- contrib/llvm-project/clang/lib/AST/ASTImporter.cpp | 3 +- contrib/llvm-project/clang/lib/AST/Type.cpp | 9 +- .../llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp | 1 - .../clang/lib/CodeGen/CodeGenFunction.cpp | 1 - contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp | 1 - contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp | 3 +- .../clang/lib/Sema/SemaTemplateDeduction.cpp | 7 ++ .../clang/lib/Sema/SemaTemplateVariadic.cpp | 3 +- contrib/llvm-project/clang/lib/Sema/SemaType.cpp | 119 +++++++++++---------- sys/sys/param.h | 2 +- 17 files changed, 122 insertions(+), 100 deletions(-) diff --git a/contrib/llvm-project/clang/include/clang/AST/ASTContext.h b/contrib/llvm-project/clang/include/clang/AST/ASTContext.h index 9020e6629d08..3700d0101daf 100644 --- a/contrib/llvm-project/clang/include/clang/AST/ASTContext.h +++ b/contrib/llvm-project/clang/include/clang/AST/ASTContext.h @@ -1475,8 +1475,16 @@ public: void getInjectedTemplateArgs(const TemplateParameterList *Params, SmallVectorImpl &Args); + /// Form a pack expansion type with the given pattern. + /// \param NumExpansions The number of expansions for the pack, if known. + /// \param ExpectPackInType If \c false, we should not expect \p Pattern to + /// contain an unexpanded pack. This only makes sense if the pack + /// expansion is used in a context where the arity is inferred from + /// elsewhere, such as if the pattern contains a placeholder type or + /// if this is the canonical type of another pack expansion type. QualType getPackExpansionType(QualType Pattern, - Optional NumExpansions); + Optional NumExpansions, + bool ExpectPackInType = true); QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl = nullptr) const; diff --git a/contrib/llvm-project/clang/include/clang/AST/Type.h b/contrib/llvm-project/clang/include/clang/AST/Type.h index 736f08651c84..74e4a578cb55 100644 --- a/contrib/llvm-project/clang/include/clang/AST/Type.h +++ b/contrib/llvm-project/clang/include/clang/AST/Type.h @@ -4375,11 +4375,7 @@ class TypedefType : public Type { protected: friend class ASTContext; // ASTContext creates these. - TypedefType(TypeClass tc, const TypedefNameDecl *D, QualType can) - : Type(tc, can, can->getDependence() & ~TypeDependence::UnexpandedPack), - Decl(const_cast(D)) { - assert(!isa(can) && "Invalid canonical type"); - } + TypedefType(TypeClass tc, const TypedefNameDecl *D, QualType can); public: TypedefNameDecl *getDecl() const { return Decl; } @@ -5616,7 +5612,8 @@ class PackExpansionType : public Type, public llvm::FoldingSetNode { PackExpansionType(QualType Pattern, QualType Canon, Optional NumExpansions) : Type(PackExpansion, Canon, - (Pattern->getDependence() | TypeDependence::Instantiation) & + (Pattern->getDependence() | TypeDependence::Dependent | + TypeDependence::Instantiation) & ~TypeDependence::UnexpandedPack), Pattern(Pattern) { PackExpansionTypeBits.NumExpansions = @@ -5637,8 +5634,8 @@ public: return None; } - bool isSugared() const { return !Pattern->isDependentType(); } - QualType desugar() const { return isSugared() ? Pattern : QualType(this, 0); } + bool isSugared() const { return false; } + QualType desugar() const { return QualType(this, 0); } void Profile(llvm::FoldingSetNodeID &ID) { Profile(ID, getPattern(), getNumExpansions()); diff --git a/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td b/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td index 4540ea0e1952..ed91670829b8 100644 --- a/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td +++ b/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td @@ -722,7 +722,8 @@ let Class = PackExpansionType in { } def : Creator<[{ - return ctx.getPackExpansionType(pattern, numExpansions); + return ctx.getPackExpansionType(pattern, numExpansions, + /*ExpectPackInType*/false); }]>; } diff --git a/contrib/llvm-project/clang/include/clang/Basic/TypeNodes.td b/contrib/llvm-project/clang/include/clang/Basic/TypeNodes.td index a4e3002b9075..011394c3ef45 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/TypeNodes.td +++ b/contrib/llvm-project/clang/include/clang/Basic/TypeNodes.td @@ -100,7 +100,7 @@ def DeducedTemplateSpecializationType : TypeNode; def InjectedClassNameType : TypeNode, AlwaysDependent, LeafType; def DependentNameType : TypeNode, AlwaysDependent; def DependentTemplateSpecializationType : TypeNode, AlwaysDependent; -def PackExpansionType : TypeNode, NeverCanonicalUnlessDependent; +def PackExpansionType : TypeNode, AlwaysDependent; def ObjCTypeParamType : TypeNode, NeverCanonical; def ObjCObjectType : TypeNode; def ObjCInterfaceType : TypeNode, LeafType; diff --git a/contrib/llvm-project/clang/include/clang/Sema/DeclSpec.h b/contrib/llvm-project/clang/include/clang/Sema/DeclSpec.h index 8db03babfb1e..0a22b5af7c64 100644 --- a/contrib/llvm-project/clang/include/clang/Sema/DeclSpec.h +++ b/contrib/llvm-project/clang/include/clang/Sema/DeclSpec.h @@ -2435,6 +2435,15 @@ public: return true; return false; } + /// Get the trailing return type appearing (at any level) within this + /// declarator. + ParsedType getTrailingReturnType() const { + for (const auto &Chunk : type_objects()) + if (Chunk.Kind == DeclaratorChunk::Function && + Chunk.Fun.hasTrailingReturnType()) + return Chunk.Fun.getTrailingReturnType(); + return ParsedType(); + } /// \brief Sets a trailing requires clause for this declarator. void setTrailingRequiresClause(Expr *TRC) { diff --git a/contrib/llvm-project/clang/include/clang/Sema/Sema.h b/contrib/llvm-project/clang/include/clang/Sema/Sema.h index 16a7084f6b08..1b5e389501c3 100644 --- a/contrib/llvm-project/clang/include/clang/Sema/Sema.h +++ b/contrib/llvm-project/clang/include/clang/Sema/Sema.h @@ -8172,6 +8172,8 @@ public: /// Completely replace the \c auto in \p TypeWithAuto by /// \p Replacement. This does not retain any \c auto type sugar. QualType ReplaceAutoType(QualType TypeWithAuto, QualType Replacement); + TypeSourceInfo *ReplaceAutoTypeSourceInfo(TypeSourceInfo *TypeWithAuto, + QualType Replacement); /// Result type of DeduceAutoType. enum DeduceAutoResult { diff --git a/contrib/llvm-project/clang/lib/AST/ASTContext.cpp b/contrib/llvm-project/clang/lib/AST/ASTContext.cpp index bf51d35d9693..1497cccff175 100644 --- a/contrib/llvm-project/clang/lib/AST/ASTContext.cpp +++ b/contrib/llvm-project/clang/lib/AST/ASTContext.cpp @@ -4868,37 +4868,27 @@ ASTContext::getInjectedTemplateArgs(const TemplateParameterList *Params, } QualType ASTContext::getPackExpansionType(QualType Pattern, - Optional NumExpansions) { + Optional NumExpansions, + bool ExpectPackInType) { + assert((!ExpectPackInType || Pattern->containsUnexpandedParameterPack()) && + "Pack expansions must expand one or more parameter packs"); + llvm::FoldingSetNodeID ID; PackExpansionType::Profile(ID, Pattern, NumExpansions); - // A deduced type can deduce to a pack, eg - // auto ...x = some_pack; - // That declaration isn't (yet) valid, but is created as part of building an - // init-capture pack: - // [...x = some_pack] {} - assert((Pattern->containsUnexpandedParameterPack() || - Pattern->getContainedDeducedType()) && - "Pack expansions must expand one or more parameter packs"); void *InsertPos = nullptr; - PackExpansionType *T - = PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos); + PackExpansionType *T = PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos); if (T) return QualType(T, 0); QualType Canon; if (!Pattern.isCanonical()) { - Canon = getCanonicalType(Pattern); - // The canonical type might not contain an unexpanded parameter pack, if it - // contains an alias template specialization which ignores one of its - // parameters. - if (Canon->containsUnexpandedParameterPack()) { - Canon = getPackExpansionType(Canon, NumExpansions); - - // Find the insert position again, in case we inserted an element into - // PackExpansionTypes and invalidated our insert position. - PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos); - } + Canon = getPackExpansionType(getCanonicalType(Pattern), NumExpansions, + /*ExpectPackInType=*/false); + + // Find the insert position again, in case we inserted an element into + // PackExpansionTypes and invalidated our insert position. + PackExpansionTypes.FindNodeOrInsertPos(ID, InsertPos); } T = new (*this, TypeAlignment) diff --git a/contrib/llvm-project/clang/lib/AST/ASTImporter.cpp b/contrib/llvm-project/clang/lib/AST/ASTImporter.cpp index 3779e0cb872b..e0a186307e93 100644 --- a/contrib/llvm-project/clang/lib/AST/ASTImporter.cpp +++ b/contrib/llvm-project/clang/lib/AST/ASTImporter.cpp @@ -1498,7 +1498,8 @@ ASTNodeImporter::VisitPackExpansionType(const PackExpansionType *T) { return ToPatternOrErr.takeError(); return Importer.getToContext().getPackExpansionType(*ToPatternOrErr, - T->getNumExpansions()); + T->getNumExpansions(), + /*ExpactPack=*/false); } ExpectedType ASTNodeImporter::VisitDependentTemplateSpecializationType( diff --git a/contrib/llvm-project/clang/lib/AST/Type.cpp b/contrib/llvm-project/clang/lib/AST/Type.cpp index 10a6a2610130..ce011eddbd2e 100644 --- a/contrib/llvm-project/clang/lib/AST/Type.cpp +++ b/contrib/llvm-project/clang/lib/AST/Type.cpp @@ -1187,9 +1187,6 @@ public: T->getTypeConstraintArguments()); } - // FIXME: Non-trivial to implement, but important for C++ - SUGARED_TYPE_CLASS(PackExpansion) - QualType VisitObjCObjectType(const ObjCObjectType *T) { QualType baseType = recurse(T->getBaseType()); if (baseType.isNull()) @@ -3317,6 +3314,12 @@ void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, getExtProtoInfo(), Ctx, isCanonicalUnqualified()); } +TypedefType::TypedefType(TypeClass tc, const TypedefNameDecl *D, QualType can) + : Type(tc, can, D->getUnderlyingType()->getDependence()), + Decl(const_cast(D)) { + assert(!isa(can) && "Invalid canonical type"); +} + QualType TypedefType::desugar() const { return getDecl()->getUnderlyingType(); } diff --git a/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp b/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp index 703f5087370a..143408401245 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp @@ -3268,7 +3268,6 @@ llvm::DIType *CGDebugInfo::CreateTypeNode(QualType Ty, llvm::DIFile *Unit) { case Type::TypeOf: case Type::Decltype: case Type::UnaryTransform: - case Type::PackExpansion: break; } diff --git a/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp b/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp index 8ce488f35dd3..8f79cc77f0e6 100644 --- a/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/contrib/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp @@ -2075,7 +2075,6 @@ void CodeGenFunction::EmitVariablyModifiedType(QualType type) { case Type::UnaryTransform: case Type::Attributed: case Type::SubstTemplateTypeParm: - case Type::PackExpansion: case Type::MacroQualified: // Keep walking after single level desugaring. type = type.getSingleStepDesugaredType(getContext()); diff --git a/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp b/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp index d301e6c732ab..610a77c0e6f2 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp @@ -4345,7 +4345,6 @@ static void captureVariablyModifiedType(ASTContext &Context, QualType T, case Type::UnaryTransform: case Type::Attributed: case Type::SubstTemplateTypeParm: - case Type::PackExpansion: case Type::MacroQualified: // Keep walking after single level desugaring. T = T.getSingleStepDesugaredType(Context); diff --git a/contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp b/contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp index 657ed13f207a..dc74f6e2f7dc 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp @@ -803,7 +803,8 @@ QualType Sema::buildLambdaInitCaptureInitialization( Diag(EllipsisLoc, getLangOpts().CPlusPlus20 ? diag::warn_cxx17_compat_init_capture_pack : diag::ext_init_capture_pack); - DeductType = Context.getPackExpansionType(DeductType, NumExpansions); + DeductType = Context.getPackExpansionType(DeductType, NumExpansions, + /*ExpectPackInType=*/false); TLB.push(DeductType).setEllipsisLoc(EllipsisLoc); } else { // Just ignore the ellipsis for now and form a non-pack variable. We'll diff --git a/contrib/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp b/contrib/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp index 5392be57a3aa..eb8677d0e481 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -4894,6 +4894,13 @@ QualType Sema::ReplaceAutoType(QualType TypeWithAuto, .TransformType(TypeWithAuto); } +TypeSourceInfo *Sema::ReplaceAutoTypeSourceInfo(TypeSourceInfo *TypeWithAuto, + QualType TypeToReplaceAuto) { + return SubstituteDeducedTypeTransform(*this, TypeToReplaceAuto, + /*UseTypeSugar*/ false) + .TransformType(TypeWithAuto); +} + void Sema::DiagnoseAutoDeductionFailure(VarDecl *VDecl, Expr *Init) { if (isa(Init)) Diag(VDecl->getLocation(), diff --git a/contrib/llvm-project/clang/lib/Sema/SemaTemplateVariadic.cpp b/contrib/llvm-project/clang/lib/Sema/SemaTemplateVariadic.cpp index 7b77d1cb482a..259cc5165776 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaTemplateVariadic.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaTemplateVariadic.cpp @@ -614,7 +614,8 @@ QualType Sema::CheckPackExpansion(QualType Pattern, SourceRange PatternRange, return QualType(); } - return Context.getPackExpansionType(Pattern, NumExpansions); + return Context.getPackExpansionType(Pattern, NumExpansions, + /*ExpectPackInType=*/false); } ExprResult Sema::ActOnPackExpansion(Expr *Pattern, SourceLocation EllipsisLoc) { diff --git a/contrib/llvm-project/clang/lib/Sema/SemaType.cpp b/contrib/llvm-project/clang/lib/Sema/SemaType.cpp index cc151a048b98..f2c3c6373948 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaType.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaType.cpp @@ -3101,24 +3101,10 @@ static void diagnoseRedundantReturnTypeQualifiers(Sema &S, QualType RetTy, D.getDeclSpec().getUnalignedSpecLoc()); } -static void CopyTypeConstraintFromAutoType(Sema &SemaRef, const AutoType *Auto, - AutoTypeLoc AutoLoc, - TemplateTypeParmDecl *TP, - SourceLocation EllipsisLoc) { - - TemplateArgumentListInfo TAL(AutoLoc.getLAngleLoc(), AutoLoc.getRAngleLoc()); - for (unsigned Idx = 0; Idx < AutoLoc.getNumArgs(); ++Idx) - TAL.addArgument(AutoLoc.getArgLoc(Idx)); - - SemaRef.AttachTypeConstraint( - AutoLoc.getNestedNameSpecifierLoc(), AutoLoc.getConceptNameInfo(), - AutoLoc.getNamedConcept(), - AutoLoc.hasExplicitTemplateArgs() ? &TAL : nullptr, TP, EllipsisLoc); -} - -static QualType InventTemplateParameter( - TypeProcessingState &state, QualType T, TypeSourceInfo *TSI, AutoType *Auto, - InventedTemplateParameterInfo &Info) { +static std::pair +InventTemplateParameter(TypeProcessingState &state, QualType T, + TypeSourceInfo *TrailingTSI, AutoType *Auto, + InventedTemplateParameterInfo &Info) { Sema &S = state.getSema(); Declarator &D = state.getDeclarator(); @@ -3143,13 +3129,25 @@ static QualType InventTemplateParameter( IsParameterPack, /*HasTypeConstraint=*/Auto->isConstrained()); InventedTemplateParam->setImplicit(); Info.TemplateParams.push_back(InventedTemplateParam); - // Attach type constraints + + // Attach type constraints to the new parameter. if (Auto->isConstrained()) { - if (TSI) { - CopyTypeConstraintFromAutoType( - S, Auto, TSI->getTypeLoc().getContainedAutoTypeLoc(), - InventedTemplateParam, D.getEllipsisLoc()); + if (TrailingTSI) { + // The 'auto' appears in a trailing return type we've already built; + // extract its type constraints to attach to the template parameter. + AutoTypeLoc AutoLoc = TrailingTSI->getTypeLoc().getContainedAutoTypeLoc(); + TemplateArgumentListInfo TAL(AutoLoc.getLAngleLoc(), AutoLoc.getRAngleLoc()); + for (unsigned Idx = 0; Idx < AutoLoc.getNumArgs(); ++Idx) + TAL.addArgument(AutoLoc.getArgLoc(Idx)); + + S.AttachTypeConstraint(AutoLoc.getNestedNameSpecifierLoc(), + AutoLoc.getConceptNameInfo(), + AutoLoc.getNamedConcept(), + AutoLoc.hasExplicitTemplateArgs() ? &TAL : nullptr, + InventedTemplateParam, D.getEllipsisLoc()); } else { + // The 'auto' appears in the decl-specifiers; we've not finished forming + // TypeSourceInfo for it yet. TemplateIdAnnotation *TemplateId = D.getDeclSpec().getRepAsTemplateId(); TemplateArgumentListInfo TemplateArgsInfo; if (TemplateId->LAngleLoc.isValid()) { @@ -3167,15 +3165,16 @@ static QualType InventTemplateParameter( } } - // If TSI is nullptr, this is a constrained declspec auto and the type - // constraint will be attached later in TypeSpecLocFiller - // Replace the 'auto' in the function parameter with this invented // template type parameter. // FIXME: Retain some type sugar to indicate that this was written // as 'auto'? - return state.ReplaceAutoType( - T, QualType(InventedTemplateParam->getTypeForDecl(), 0)); + QualType Replacement(InventedTemplateParam->getTypeForDecl(), 0); + QualType NewT = state.ReplaceAutoType(T, Replacement); + TypeSourceInfo *NewTSI = + TrailingTSI ? S.ReplaceAutoTypeSourceInfo(TrailingTSI, Replacement) + : nullptr; + return {NewT, NewTSI}; } static TypeSourceInfo * @@ -3234,8 +3233,19 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, if (!D.getAttributes().empty()) distributeTypeAttrsFromDeclarator(state, T); + // Find the deduced type in this type. Look in the trailing return type if we + // have one, otherwise in the DeclSpec type. + // FIXME: The standard wording doesn't currently describe this. + DeducedType *Deduced = T->getContainedDeducedType(); + bool DeducedIsTrailingReturnType = false; + if (Deduced && isa(Deduced) && D.hasTrailingReturnType()) { + QualType T = SemaRef.GetTypeFromParser(D.getTrailingReturnType()); + Deduced = T.isNull() ? nullptr : T->getContainedDeducedType(); + DeducedIsTrailingReturnType = true; + } + // C++11 [dcl.spec.auto]p5: reject 'auto' if it is not in an allowed context. - if (DeducedType *Deduced = T->getContainedDeducedType()) { + if (Deduced) { AutoType *Auto = dyn_cast(Deduced); int Error = -1; @@ -3269,10 +3279,6 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, } else if (!SemaRef.getCurScope()->isFunctionDeclarationScope()) { Error = 21; break; - } else if (D.hasTrailingReturnType()) { - // This might be OK, but we'll need to convert the trailing return - // type later. - break; } Info = &SemaRef.InventedParameterInfos.back(); @@ -3286,7 +3292,12 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, Info = SemaRef.getCurLambda(); assert(Info && "No LambdaScopeInfo on the stack!"); } - T = InventTemplateParameter(state, T, nullptr, Auto, *Info); + + // We'll deal with inventing template parameters for 'auto' in trailing + // return types when we pick up the trailing return type when processing + // the function chunk. + if (!DeducedIsTrailingReturnType) + T = InventTemplateParameter(state, T, nullptr, Auto, *Info).first; break; } case DeclaratorContext::MemberContext: { @@ -3384,20 +3395,6 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, (!SemaRef.getLangOpts().CPlusPlus11 || !IsCXXAutoType)) Error = 13; - bool HaveTrailing = false; - - // C++11 [dcl.spec.auto]p2: 'auto' is always fine if the declarator - // contains a trailing return type. That is only legal at the outermost - // level. Check all declarator chunks (outermost first) anyway, to give - // better diagnostics. - // We don't support '__auto_type' with trailing return types. - // FIXME: Should we only do this for 'auto' and not 'decltype(auto)'? - if (SemaRef.getLangOpts().CPlusPlus11 && IsCXXAutoType && - D.hasTrailingReturnType()) { - HaveTrailing = true; - Error = -1; - } - SourceRange AutoRange = D.getDeclSpec().getTypeSpecTypeLoc(); if (D.getName().getKind() == UnqualifiedIdKind::IK_ConversionFunctionId) AutoRange = D.getName().getSourceRange(); @@ -3427,8 +3424,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state, T = SemaRef.Context.IntTy; D.setInvalidType(true); - } else if (Auto && !HaveTrailing && - D.getContext() != DeclaratorContext::LambdaExprContext) { + } else if (Auto && D.getContext() != DeclaratorContext::LambdaExprContext) { // If there was a trailing return type, we already got // warn_cxx98_compat_trailing_return_type in the parser. SemaRef.Diag(AutoRange.getBegin(), @@ -4881,12 +4877,21 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, // An error occurred parsing the trailing return type. T = Context.IntTy; D.setInvalidType(true); - } else if (S.getLangOpts().CPlusPlus20) - // Handle cases like: `auto f() -> auto` or `auto f() -> C auto`. - if (AutoType *Auto = T->getContainedAutoType()) - if (S.getCurScope()->isFunctionDeclarationScope()) - T = InventTemplateParameter(state, T, TInfo, Auto, - S.InventedParameterInfos.back()); + } else if (AutoType *Auto = T->getContainedAutoType()) { + // If the trailing return type contains an `auto`, we may need to + // invent a template parameter for it, for cases like + // `auto f() -> C auto` or `[](auto (*p) -> auto) {}`. + InventedTemplateParameterInfo *InventedParamInfo = nullptr; + if (D.getContext() == DeclaratorContext::PrototypeContext) + InventedParamInfo = &S.InventedParameterInfos.back(); + else if (D.getContext() == + DeclaratorContext::LambdaExprParameterContext) + InventedParamInfo = S.getCurLambda(); + if (InventedParamInfo) { + std::tie(T, TInfo) = InventTemplateParameter( + state, T, TInfo, Auto, *InventedParamInfo); + } + } } else { // This function type is not the type of the entity being declared, // so checking the 'auto' is not the responsibility of this chunk. @@ -5518,7 +5523,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, << T << D.getSourceRange(); D.setEllipsisLoc(SourceLocation()); } else { - T = Context.getPackExpansionType(T, None); + T = Context.getPackExpansionType(T, None, /*ExpectPackInType=*/false); } break; case DeclaratorContext::TemplateParamContext: diff --git a/sys/sys/param.h b/sys/sys/param.h index e6765e62a75b..97ec07ed3a4d 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300136 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300137 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 00:39:41 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BB184FEA94; Sat, 30 Jan 2021 00:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSFhs1B5Hz4fNv; Sat, 30 Jan 2021 00:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B4A13E51; Sat, 30 Jan 2021 00:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10U0dfC7088422; Sat, 30 Jan 2021 00:39:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U0dfcI088421; Sat, 30 Jan 2021 00:39:41 GMT (envelope-from git) Date: Sat, 30 Jan 2021 00:39:41 GMT Message-Id: <202101300039.10U0dfcI088421@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 19d2d50e4318 - stable/13 - Revert "Define PNP info after defining driver modules" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 19d2d50e431895dc8a476a1b29ea92c033c87b2d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 00:39:41 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=19d2d50e431895dc8a476a1b29ea92c033c87b2d commit 19d2d50e431895dc8a476a1b29ea92c033c87b2d Author: Mark Johnston AuthorDate: 2021-01-23 15:55:09 +0000 Commit: Mark Johnston CommitDate: 2021-01-30 00:39:14 +0000 Revert "Define PNP info after defining driver modules" This reverts commit aa37baf3d7cf51da92fd367476182802e71838ae. The reverted commit was motivated by a problem observed on stable/12, but it turns out that a better solution was committed in r348309 but not MFCed. So, revert this change since it is unnecessary and not really correct: it assumes that the order in which module metadata records is defined determines their order in the output linker set. While this seems to hold in my testing, it is not guaranteed. Reported by: cem Discussed with: imp (cherry picked from commit 519b64e27fddf10c0b7f6a615edbad730b8c6c45) --- sys/arm/ti/am335x/am335x_dmtpps.c | 2 +- sys/arm/ti/am335x/am335x_ehrpwm.c | 2 +- sys/dev/gpio/gpioiic.c | 8 ++------ sys/dev/gpio/gpiopps.c | 2 +- sys/dev/gpio/gpioths.c | 6 ++---- sys/dev/iicbus/ads111x.c | 4 +--- sys/dev/iicbus/mux/iic_gpiomux.c | 8 ++------ sys/dev/iicbus/mux/ltc430x.c | 4 +++- sys/dev/iicbus/mux/pca9547.c | 2 +- sys/dev/ow/owc_gpiobus.c | 6 ++---- sys/dev/pwm/pwmc.c | 6 +++--- 11 files changed, 19 insertions(+), 31 deletions(-) diff --git a/sys/arm/ti/am335x/am335x_dmtpps.c b/sys/arm/ti/am335x/am335x_dmtpps.c index 414800fd011e..24d83f248eef 100644 --- a/sys/arm/ti/am335x/am335x_dmtpps.c +++ b/sys/arm/ti/am335x/am335x_dmtpps.c @@ -96,6 +96,7 @@ static struct ofw_compat_data compat_data[] = { {"ti,am335x-timer-1ms", 1}, {NULL, 0}, }; +SIMPLEBUS_PNP_INFO(compat_data); /* * A table relating pad names to the hardware timer number they can be mux'd to. @@ -617,5 +618,4 @@ static driver_t dmtpps_driver = { static devclass_t dmtpps_devclass; DRIVER_MODULE(am335x_dmtpps, simplebus, dmtpps_driver, dmtpps_devclass, 0, 0); -SIMPLEBUS_PNP_INFO(compat_data); MODULE_DEPEND(am335x_dmtpps, ti_sysc, 1, 1, 1); diff --git a/sys/arm/ti/am335x/am335x_ehrpwm.c b/sys/arm/ti/am335x/am335x_ehrpwm.c index 6fd709d120e6..619fdae2bcdb 100644 --- a/sys/arm/ti/am335x/am335x_ehrpwm.c +++ b/sys/arm/ti/am335x/am335x_ehrpwm.c @@ -199,6 +199,7 @@ static struct ofw_compat_data compat_data[] = { {"ti,am33xx-ehrpwm", true}, {NULL, false}, }; +SIMPLEBUS_PNP_INFO(compat_data); static void am335x_ehrpwm_cfg_duty(struct am335x_ehrpwm_softc *sc, u_int chan, u_int duty) @@ -712,7 +713,6 @@ static driver_t am335x_ehrpwm_driver = { static devclass_t am335x_ehrpwm_devclass; DRIVER_MODULE(am335x_ehrpwm, am335x_pwmss, am335x_ehrpwm_driver, am335x_ehrpwm_devclass, 0, 0); -SIMPLEBUS_PNP_INFO(compat_data); MODULE_VERSION(am335x_ehrpwm, 1); MODULE_DEPEND(am335x_ehrpwm, am335x_pwmss, 1, 1, 1); MODULE_DEPEND(am335x_ehrpwm, pwmbus, 1, 1, 1); diff --git a/sys/dev/gpio/gpioiic.c b/sys/dev/gpio/gpioiic.c index f387252098e2..6d62a6d04d95 100644 --- a/sys/dev/gpio/gpioiic.c +++ b/sys/dev/gpio/gpioiic.c @@ -65,6 +65,8 @@ static struct ofw_compat_data compat_data[] = { {"gpioiic", true}, /* Deprecated old freebsd compat string */ {NULL, false} }; +OFWBUS_PNP_INFO(compat_data); +SIMPLEBUS_PNP_INFO(compat_data); static phandle_t gpioiic_get_node(device_t bus, device_t dev) @@ -368,13 +370,7 @@ static driver_t gpioiic_driver = { }; DRIVER_MODULE(gpioiic, gpiobus, gpioiic_driver, gpioiic_devclass, 0, 0); -#ifdef FDT -OFWBUS_PNP_INFO(compat_data); -#endif DRIVER_MODULE(gpioiic, simplebus, gpioiic_driver, gpioiic_devclass, 0, 0); -#ifdef FDT -SIMPLEBUS_PNP_INFO(compat_data); -#endif DRIVER_MODULE(iicbb, gpioiic, iicbb_driver, iicbb_devclass, 0, 0); MODULE_DEPEND(gpioiic, iicbb, IICBB_MINVER, IICBB_PREFVER, IICBB_MAXVER); MODULE_DEPEND(gpioiic, gpiobus, 1, 1, 1); diff --git a/sys/dev/gpio/gpiopps.c b/sys/dev/gpio/gpiopps.c index ea2644088c5d..8a6f1a6a3f6b 100644 --- a/sys/dev/gpio/gpiopps.c +++ b/sys/dev/gpio/gpiopps.c @@ -47,6 +47,7 @@ static struct ofw_compat_data compat_data[] = { {"pps-gpio", 1}, {NULL, 0} }; +SIMPLEBUS_PNP_INFO(compat_data); #endif /* FDT */ static devclass_t pps_devclass; @@ -290,6 +291,5 @@ static driver_t pps_fdt_driver = { }; DRIVER_MODULE(gpiopps, simplebus, pps_fdt_driver, pps_devclass, 0, 0); -SIMPLEBUS_PNP_INFO(compat_data); #endif /* FDT */ diff --git a/sys/dev/gpio/gpioths.c b/sys/dev/gpio/gpioths.c index 97831db881ae..c08d772ddb9b 100644 --- a/sys/dev/gpio/gpioths.c +++ b/sys/dev/gpio/gpioths.c @@ -72,6 +72,8 @@ static struct ofw_compat_data compat_data[] = { {"dht11", true}, {NULL, false} }; +OFWBUS_PNP_INFO(compat_data); +SIMPLEBUS_PNP_INFO(compat_data); #endif /* FDT */ #define PIN_IDX 0 /* Use the first/only configured pin. */ @@ -409,11 +411,7 @@ DEFINE_CLASS_0(gpioths, gpioths_driver, gpioths_methods, sizeof(struct gpioths_s #ifdef FDT DRIVER_MODULE(gpioths, simplebus, gpioths_driver, gpioths_devclass, 0, 0); -SIMPLEBUS_PNP_INFO(compat_data); #endif DRIVER_MODULE(gpioths, gpiobus, gpioths_driver, gpioths_devclass, 0, 0); -#ifdef FDT -OFWBUS_PNP_INFO(compat_data); -#endif MODULE_DEPEND(gpioths, gpiobus, 1, 1, 1); diff --git a/sys/dev/iicbus/ads111x.c b/sys/dev/iicbus/ads111x.c index 0464de1800c0..5d7057d99b91 100644 --- a/sys/dev/iicbus/ads111x.c +++ b/sys/dev/iicbus/ads111x.c @@ -152,6 +152,7 @@ static struct ofw_compat_data compat_data[] = { {"ti,ads1115", (uintptr_t)&ads111x_chip_infos[5]}, {NULL, (uintptr_t)NULL}, }; +IICBUS_FDT_PNP_INFO(compat_data); #endif struct ads111x_softc { @@ -608,8 +609,5 @@ static driver_t ads111x_driver = { static devclass_t ads111x_devclass; DRIVER_MODULE(ads111x, iicbus, ads111x_driver, ads111x_devclass, NULL, NULL); -#ifdef FDT -IICBUS_FDT_PNP_INFO(compat_data); -#endif MODULE_VERSION(ads111x, 1); MODULE_DEPEND(ads111x, iicbus, 1, 1, 1); diff --git a/sys/dev/iicbus/mux/iic_gpiomux.c b/sys/dev/iicbus/mux/iic_gpiomux.c index 9d34d21c6572..8e064d84619d 100644 --- a/sys/dev/iicbus/mux/iic_gpiomux.c +++ b/sys/dev/iicbus/mux/iic_gpiomux.c @@ -58,6 +58,8 @@ static struct ofw_compat_data compat_data[] = { {"i2c-mux-gpio", true}, {NULL, false} }; +OFWBUS_PNP_INFO(compat_data); +SIMPLEBUS_PNP_INFO(compat_data); #endif /* FDT */ #include @@ -253,13 +255,7 @@ static devclass_t gpiomux_devclass; DEFINE_CLASS_1(iic_gpiomux, iic_gpiomux_driver, gpiomux_methods, sizeof(struct gpiomux_softc), iicmux_driver); DRIVER_MODULE(iic_gpiomux, simplebus, iic_gpiomux_driver, gpiomux_devclass, 0, 0); -#ifdef FDT -SIMPLEBUS_PNP_INFO(compat_data); -#endif DRIVER_MODULE(iic_gpiomux, ofw_simplebus, iic_gpiomux_driver, gpiomux_devclass, 0, 0); -#ifdef FDT -OFWBUS_PNP_INFO(compat_data); -#endif #ifdef FDT DRIVER_MODULE(ofw_iicbus, iic_gpiomux, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); diff --git a/sys/dev/iicbus/mux/ltc430x.c b/sys/dev/iicbus/mux/ltc430x.c index 77f1fafe6fe1..fab791ed3174 100644 --- a/sys/dev/iicbus/mux/ltc430x.c +++ b/sys/dev/iicbus/mux/ltc430x.c @@ -63,6 +63,7 @@ static struct ofw_compat_data compat_data[] = { {"lltc,ltc4306", CHIP_LTC4306}, {NULL, CHIP_NONE} }; +IICBUS_FDT_PNP_INFO(compat_data); #endif #include @@ -245,8 +246,8 @@ static devclass_t ltc430x_devclass; DEFINE_CLASS_1(ltc430x, ltc430x_driver, ltc430x_methods, sizeof(struct ltc430x_softc), iicmux_driver); DRIVER_MODULE(ltc430x, iicbus, ltc430x_driver, ltc430x_devclass, 0, 0); + #ifdef FDT -IICBUS_FDT_PNP_INFO(compat_data); DRIVER_MODULE(ofw_iicbus, ltc430x, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); #else DRIVER_MODULE(iicbus, ltc430x, iicbus_driver, iicbus_devclass, 0, 0); @@ -254,3 +255,4 @@ DRIVER_MODULE(iicbus, ltc430x, iicbus_driver, iicbus_devclass, 0, 0); MODULE_DEPEND(ltc430x, iicmux, 1, 1, 1); MODULE_DEPEND(ltc430x, iicbus, 1, 1, 1); + diff --git a/sys/dev/iicbus/mux/pca9547.c b/sys/dev/iicbus/mux/pca9547.c index 2bdc6cb2e867..ac57f26dbb04 100644 --- a/sys/dev/iicbus/mux/pca9547.c +++ b/sys/dev/iicbus/mux/pca9547.c @@ -50,6 +50,7 @@ static struct ofw_compat_data compat_data[] = { {"nxp,pca9547", 1}, {NULL, 0} }; +IICBUS_FDT_PNP_INFO(compat_data); #include @@ -154,7 +155,6 @@ static devclass_t pca9547_devclass; DEFINE_CLASS_1(iicmux, pca9547_driver, pca9547_methods, sizeof(struct pca9547_softc), iicmux_driver); DRIVER_MODULE(pca_iicmux, iicbus, pca9547_driver, pca9547_devclass, 0, 0); -IICBUS_FDT_PNP_INFO(compat_data); DRIVER_MODULE(iicbus, iicmux, iicbus_driver, iicbus_devclass, 0, 0); DRIVER_MODULE(ofw_iicbus, iicmux, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); diff --git a/sys/dev/ow/owc_gpiobus.c b/sys/dev/ow/owc_gpiobus.c index 8ed73e10862b..4b8b2ab6f99e 100644 --- a/sys/dev/ow/owc_gpiobus.c +++ b/sys/dev/ow/owc_gpiobus.c @@ -49,6 +49,8 @@ static struct ofw_compat_data compat_data[] = { {"w1-gpio", true}, {NULL, false} }; +OFWBUS_PNP_INFO(compat_data); +SIMPLEBUS_PNP_INFO(compat_data); #endif /* FDT */ #define OW_PIN 0 @@ -392,13 +394,9 @@ static driver_t owc_gpiobus_driver = { #ifdef FDT DRIVER_MODULE(owc_gpiobus, simplebus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); -SIMPLEBUS_PNP_INFO(compat_data); #endif DRIVER_MODULE(owc_gpiobus, gpiobus, owc_gpiobus_driver, owc_gpiobus_devclass, 0, 0); -#ifdef FDT -OFWBUS_PNP_INFO(compat_data); -#endif MODULE_DEPEND(owc_gpiobus, ow, 1, 1, 1); MODULE_DEPEND(owc_gpiobus, gpiobus, 1, 1, 1); MODULE_VERSION(owc_gpiobus, 1); diff --git a/sys/dev/pwm/pwmc.c b/sys/dev/pwm/pwmc.c index b39460edc9c9..c49d1e894488 100644 --- a/sys/dev/pwm/pwmc.c +++ b/sys/dev/pwm/pwmc.c @@ -52,6 +52,9 @@ static struct ofw_compat_data compat_data[] = { {"freebsd,pwmc", true}, {NULL, false}, }; + +PWMBUS_FDT_PNP_INFO(compat_data); + #endif struct pwmc_softc { @@ -203,8 +206,5 @@ static driver_t pwmc_driver = { static devclass_t pwmc_devclass; DRIVER_MODULE(pwmc, pwmbus, pwmc_driver, pwmc_devclass, 0, 0); -#ifdef FDT -PWMBUS_FDT_PNP_INFO(compat_data); -#endif MODULE_DEPEND(pwmc, pwmbus, 1, 1, 1); MODULE_VERSION(pwmc, 1); From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 00:39:43 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C82F4FE6E5; Sat, 30 Jan 2021 00:39:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSFhv3Lfxz4fR2; Sat, 30 Jan 2021 00:39:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CFD842A6; Sat, 30 Jan 2021 00:39:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10U0dhVt088467; Sat, 30 Jan 2021 00:39:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U0dhi5088466; Sat, 30 Jan 2021 00:39:43 GMT (envelope-from git) Date: Sat, 30 Jan 2021 00:39:43 GMT Message-Id: <202101300039.10U0dhi5088466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a455b23cf348 - stable/13 - qat.4: Minor tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a455b23cf348885491f83c6a4734bb6fddf0d481 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 00:39:43 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a455b23cf348885491f83c6a4734bb6fddf0d481 commit a455b23cf348885491f83c6a4734bb6fddf0d481 Author: Mark Johnston AuthorDate: 2021-01-27 20:31:10 +0000 Commit: Mark Johnston CommitDate: 2021-01-30 00:39:15 +0000 qat.4: Minor tweaks - Document a constraint on the AAD size for AES-GCM. - Note that the list of supported platforms and add-on devices is not complete and indicate that QAT devices will show up in pciconf output. [1] PR: 252984 [1] Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit e1b50e8184fca00520774d43bd7bdd0ccbe9a1d2) --- share/man/man4/qat.4 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/share/man/man4/qat.4 b/share/man/man4/qat.4 index 9e9491f22aea..92ee85ac64eb 100644 --- a/share/man/man4/qat.4 +++ b/share/man/man4/qat.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2020 +.Dd January 27, 2021 .Dt QAT 4 .Os .Sh NAME @@ -57,17 +57,29 @@ The driver implements .Xr crypto 4 support for some of the cryptographic acceleration functions of the Intel -QuickAssist device. +QuickAssist (QAT) device. The .Nm driver supports the QAT devices integrated with Atom C2000 and C3000 and Xeon -C620 and D-1500 chipsets, and the Intel QAT Adapter 8950. -It can accelerate AES in CBC, CTR, XTS (except for the C2000) and GCM modes, +C620 and D-1500 platforms, and the Intel QAT Adapter 8950. +Other platforms and adapters not listed here may also be supported. +QAT devices are enumerated through PCIe and are thus visible in +.Xr pciconf 8 +output. +.Pp +The +.Nm +driver can accelerate AES in CBC, CTR, XTS (except for the C2000) and GCM modes, and can perform authenticated encryption combining the CBC, CTR and XTS modes with SHA1-HMAC and SHA2-HMAC. The .Nm driver can also compute SHA1 and SHA2 digests. +The implementation of AES-GCM has a firmware-imposed constraint that the length +of any additional authenticated data (AAD) must not exceed 240 bytes. +The driver thus rejects +.Xr crypto 9 +requests that do not satisfy this constraint. .Sh SEE ALSO .Xr crypto 4 , .Xr ipsec 4 , From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 00:39:42 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59C1C4FE6E0; Sat, 30 Jan 2021 00:39:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSFht26t6z4fNw; Sat, 30 Jan 2021 00:39:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BDB044A4; Sat, 30 Jan 2021 00:39:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10U0dg3m088445; Sat, 30 Jan 2021 00:39:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U0dgHU088444; Sat, 30 Jan 2021 00:39:42 GMT (envelope-from git) Date: Sat, 30 Jan 2021 00:39:42 GMT Message-Id: <202101300039.10U0dgHU088444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ef6fb23322a6 - stable/13 - safexcel: Disallow unsupported buffer layouts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ef6fb23322a62abae67af779d93535ff2051e17e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 00:39:42 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ef6fb23322a62abae67af779d93535ff2051e17e commit ef6fb23322a62abae67af779d93535ff2051e17e Author: Mark Johnston AuthorDate: 2021-01-27 20:31:10 +0000 Commit: Mark Johnston CommitDate: 2021-01-30 00:39:15 +0000 safexcel: Disallow unsupported buffer layouts Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 2fccd4f9b6b96d75de87df4922eb2bf04fb0a67d) --- sys/dev/safexcel/safexcel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index 3083f5f794fe..71300dcb0393 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -2272,6 +2272,9 @@ safexcel_probe_cipher(const struct crypto_session_params *csp) static int safexcel_probesession(device_t dev, const struct crypto_session_params *csp) { + if (csp->csp_flags != 0) + return (EINVAL); + switch (csp->csp_mode) { case CSP_MODE_CIPHER: if (!safexcel_probe_cipher(csp)) From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 05:46:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3493C5260A9; Sat, 30 Jan 2021 05:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSNVq66Nhz3CPt; Sat, 30 Jan 2021 05:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4C0010730; Sat, 30 Jan 2021 05:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10U5kRia092566; Sat, 30 Jan 2021 05:46:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U5kRL9092565; Sat, 30 Jan 2021 05:46:27 GMT (envelope-from git) Date: Sat, 30 Jan 2021 05:46:27 GMT Message-Id: <202101300546.10U5kRL9092565@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 81f3a59c4601 - stable/13 - stand: ensure that the efi directory's dependencies are correct MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 81f3a59c4601883f2b7339fd402fa2f7e8b804b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 05:46:28 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=81f3a59c4601883f2b7339fd402fa2f7e8b804b3 commit 81f3a59c4601883f2b7339fd402fa2f7e8b804b3 Author: Kyle Evans AuthorDate: 2021-01-27 18:54:07 +0000 Commit: Kyle Evans CommitDate: 2021-01-30 05:46:17 +0000 stand: ensure that the efi directory's dependencies are correct efi, like the various ${MACHINE} directories, should have a dependency on the enabled interpreters. The general rule here is that any top-level directory that has a program at any depth within that includes loader.mk should add ${INTERP_DEPENDS} added to its dependencies so that the appropriate ficl/lua bits are ready before they begin. Note that the only directories in-tree that require it but will not get it in a more appropriate manner are i386 (on amd64), efi, and userboot. i386 and userboot are handled explicitly in Makefile.amd64 where they are added to S.yes. Reported-by: bcran (cherry picked from commit 7012461c9bf6375cd0b14de16b3b4a753c5c1c7a) --- stand/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/stand/Makefile b/stand/Makefile index f11a77c9a499..c5918a6539eb 100644 --- a/stand/Makefile +++ b/stand/Makefile @@ -76,6 +76,7 @@ SUBDIR_DEPEND_${_x}32+= libsa32 SUBDIR_DEPEND_forth+= ficl SUBDIR_DEPEND_lua+= liblua +SUBDIR_DEPEND_efi+= ${INTERP_DEPENDS} .if ${MK_FDT} != "no" SUBDIR_DEPEND_efi+= fdt .endif From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 08:14:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 440594E1828; Sat, 30 Jan 2021 08:14:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSRnP1LRqz3LMW; Sat, 30 Jan 2021 08:14:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20BA1126A2; Sat, 30 Jan 2021 08:14:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10U8EHX0087519; Sat, 30 Jan 2021 08:14:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U8EHB6087518; Sat, 30 Jan 2021 08:14:17 GMT (envelope-from git) Date: Sat, 30 Jan 2021 08:14:17 GMT Message-Id: <202101300814.10U8EHB6087518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 1aa1ede1fd44 - stable/13 - MFC: a63eae6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1aa1ede1fd447a1807f0cdd9ee7227b5741fecea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 08:14:17 -0000 The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=1aa1ede1fd447a1807f0cdd9ee7227b5741fecea commit 1aa1ede1fd447a1807f0cdd9ee7227b5741fecea Author: Kirk McKusick AuthorDate: 2021-01-30 08:03:37 +0000 Commit: Kirk McKusick CommitDate: 2021-01-30 08:15:41 +0000 MFC: a63eae6 Revert 2d4422e7991a, Eliminate lock order reversal in UFS ffs_unmount(). After discussion with Chuck Silvers (chs@) we have decided that there is a better way to resolve this lock order reversal which will be committed separately. Sponsored by: Netflix (cherry picked from commit a63eae65ff8789994c40573a0aa65128022c8bf2) --- sys/ufs/ffs/ffs_vfsops.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 415bb4614c1a..60d4dad57d03 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1547,14 +1547,7 @@ ffs_unmount(mp, mntflags) BO_UNLOCK(&ump->um_odevvp->v_bufobj); atomic_store_rel_ptr((uintptr_t *)&ump->um_dev->si_mountpt, 0); mntfs_freevp(ump->um_devvp); - /* Avoid LOR in vrele by passing in locked vnode and using vput */ - if (vn_lock(ump->um_odevvp, LK_EXCLUSIVE | LK_NOWAIT) == 0) { - vput(ump->um_odevvp); - } else { - /* This should never happen, see commit message for details */ - printf("ffs_unmount: Unexpected LK_NOWAIT failure\n"); - vrele(ump->um_odevvp); - } + vrele(ump->um_odevvp); dev_rel(ump->um_dev); mtx_destroy(UFS_MTX(ump)); if (mp->mnt_gjprovider != NULL) { From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 08:20:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAC094E15CE; Sat, 30 Jan 2021 08:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSRx44WKTz3LXs; Sat, 30 Jan 2021 08:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CC6812795; Sat, 30 Jan 2021 08:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10U8Ku2r098301; Sat, 30 Jan 2021 08:20:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10U8KuC6098300; Sat, 30 Jan 2021 08:20:56 GMT (envelope-from git) Date: Sat, 30 Jan 2021 08:20:56 GMT Message-Id: <202101300820.10U8KuC6098300@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 1f9ee757d96d - stable/13 - MFC: 8c22cf9b MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1f9ee757d96dfc35e0a2d89ef5fd80f26138a693 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 08:20:56 -0000 The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=1f9ee757d96dfc35e0a2d89ef5fd80f26138a693 commit 1f9ee757d96dfc35e0a2d89ef5fd80f26138a693 Author: Kirk McKusick AuthorDate: 2021-01-26 19:46:38 +0000 Commit: Kirk McKusick CommitDate: 2021-01-30 08:23:43 +0000 MFC: 8c22cf9b Fix fsck_ffs incorrectly reporting "CANNOT READ BLK: NNNN" errors. A long-standing bug in Pass 1 of fsck_ffs in which it is reading in blocks of inodes to check their block pointers. It failed to round up the size of the read to a disk block size. When disks would accept 512-byte aligned reads, the bug rarely manifested itself. But many recent disks will no longer accept 512-byte aligned reads but require 4096-byte aligned reads, so the failure to properly round-up read sizes to multiples of 4096 bytes makes the error much more likely to occur. Reported by: Peter Holm and others Tested by: Peter Holm and Rozhuk Ivan MFC after: 3 days Sponsored by: Netflix (cherry picked from commit 8c22cf9b0997566ff6f576cfc9296b29bb055f65) --- sbin/fsck_ffs/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index 18a015f8187e..60019425c825 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -611,8 +611,9 @@ setinodebuf(int cg, ino_t inosused) sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode)); readpercg = inosused / fullcnt; partialcnt = inosused % fullcnt; - partialsize = partialcnt * ((sblock.fs_magic == FS_UFS1_MAGIC) ? - sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode)); + partialsize = fragroundup(&sblock, + partialcnt * ((sblock.fs_magic == FS_UFS1_MAGIC) ? + sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode))); if (partialcnt != 0) { readpercg++; } else { From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 10:14:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF6004E4A26; Sat, 30 Jan 2021 10:14:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSVRX4qkgz3hBx; Sat, 30 Jan 2021 10:14:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 979F113754; Sat, 30 Jan 2021 10:14:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10UAE0i1044538; Sat, 30 Jan 2021 10:14:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UAE06n044537; Sat, 30 Jan 2021 10:14:00 GMT (envelope-from git) Date: Sat, 30 Jan 2021 10:14:00 GMT Message-Id: <202101301014.10UAE06n044537@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 6a3ad2d0a7b6 - stable/12 - kevent(2): Bugfix for wrong EVFILT_TIMER timeouts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6a3ad2d0a7b633bad2bb33f9c4c426dffcc91633 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 10:14:00 -0000 The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6a3ad2d0a7b633bad2bb33f9c4c426dffcc91633 commit 6a3ad2d0a7b633bad2bb33f9c4c426dffcc91633 Author: Jan Kokemüller AuthorDate: 2021-01-09 19:00:25 +0000 Commit: Gordon Bergling CommitDate: 2021-01-30 10:11:55 +0000 kevent(2): Bugfix for wrong EVFILT_TIMER timeouts When using NOTE_NSECONDS in the kevent(2) API, US_TO_SBT should be used instead of NS_TO_SBT, otherwise the timeout results are misleading. PR: 252539 Reviewed by: kevans, kib Approved by: kevans Differential Revision: https://reviews.freebsd.org/D28067 (cherry picked from commit 4d0c33be634a929f323117f04e6b1670776f9e37) --- sys/kern/kern_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 2a0852eae0ce..af611281ee68 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -665,7 +665,7 @@ timer2sbintime(int64_t data, int flags) if (secs > (SBT_MAX / SBT_1S)) return (SBT_MAX); #endif - return (secs << 32 | US_TO_SBT(data % 1000000000)); + return (secs << 32 | NS_TO_SBT(data % 1000000000)); } return (NS_TO_SBT(data)); default: From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 14:24:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10A794EE5A9; Sat, 30 Jan 2021 14:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSc0b72HWz4cMN; Sat, 30 Jan 2021 14:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4C4A16F4C; Sat, 30 Jan 2021 14:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10UEOVJh070667; Sat, 30 Jan 2021 14:24:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UEOVCp070666; Sat, 30 Jan 2021 14:24:31 GMT (envelope-from git) Date: Sat, 30 Jan 2021 14:24:31 GMT Message-Id: <202101301424.10UEOVCp070666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: bb8fa72dae42 - stable/13 - libllvmminimal: Add missing Support/ABIBreak.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bb8fa72dae42c213d3f822865c0121577243ca18 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 14:24:32 -0000 The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=bb8fa72dae42c213d3f822865c0121577243ca18 commit bb8fa72dae42c213d3f822865c0121577243ca18 Author: Jessica Clarke AuthorDate: 2021-01-27 19:19:00 +0000 Commit: Jessica Clarke CommitDate: 2021-01-30 14:23:47 +0000 libllvmminimal: Add missing Support/ABIBreak.cpp When building natively on RISC-V, linking the bootstrap clang-tblgen fails with: ld: error: undefined symbol: llvm::EnableABIBreakingChecks >>> referenced by PrettyStackTrace.cpp >>> PrettyStackTrace.o:(.sdata+0x0) in archive /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a >>> referenced by Signals.cpp >>> Signals.o:(.sdata+0x8) in archive /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a >>> referenced by Timer.cpp >>> Timer.o:(.sdata+0x28) in archive /usr/obj/usr/src/freebsd-src/riscv.riscv64/tmp/obj-tools/lib/clang/libllvmminimal/libllvmminimal.a This is likely due to Error.h's inclusion of abi-breaking.h. It's unclear why this only affects RISC-V, but perhaps relates to its more eager use of .sdata due to the ABI's support for linker relaxations. Regardless, this is theoretically an issue for all architectures. Reported by: Dennis Clarke (cherry picked from commit 48397f6c7d2d693602105d8ec24c5741202e264d) --- lib/clang/libllvmminimal/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/clang/libllvmminimal/Makefile b/lib/clang/libllvmminimal/Makefile index 0b5a204583fb..76826547ddbf 100644 --- a/lib/clang/libllvmminimal/Makefile +++ b/lib/clang/libllvmminimal/Makefile @@ -7,6 +7,7 @@ INTERNALLIB= SRCDIR= llvm/lib SRCS+= Demangle/ItaniumDemangle.cpp +SRCS+= Support/ABIBreak.cpp SRCS+= Support/APFloat.cpp SRCS+= Support/APInt.cpp SRCS+= Support/ARMTargetParser.cpp From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 15:11:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D5154EFD32; Sat, 30 Jan 2021 15:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSd343fXxz4fFx; Sat, 30 Jan 2021 15:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7034317BDD; Sat, 30 Jan 2021 15:11:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10UFBi65032997; Sat, 30 Jan 2021 15:11:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UFBiXl032996; Sat, 30 Jan 2021 15:11:44 GMT (envelope-from git) Date: Sat, 30 Jan 2021 15:11:44 GMT Message-Id: <202101301511.10UFBiXl032996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jilles Tjoelker Subject: git: 9b38ede3a347 - stable/12 - sh: Test that executing various binary files is rejected MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jilles X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9b38ede3a347f9ae48d4b80878134f07ccc6845c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 15:11:44 -0000 The branch stable/12 has been updated by jilles: URL: https://cgit.FreeBSD.org/src/commit/?id=9b38ede3a347f9ae48d4b80878134f07ccc6845c commit 9b38ede3a347f9ae48d4b80878134f07ccc6845c Author: Jilles Tjoelker AuthorDate: 2019-12-30 21:32:55 +0000 Commit: Jilles Tjoelker CommitDate: 2021-01-30 15:10:26 +0000 sh: Test that executing various binary files is rejected If executing a file fails with an [ENOEXEC] error, the shell executes the file as a shell script, except that this execution may instead result in an error message if the file is binary. Per a recent Austin Group interpretation, we will need to change this to allow a concatenation of a shell script and a binary payload. See Austin Group bugs #1226 and #1250. MFC after: 1 week (cherry picked from commit 2a55bade0ed3e08a8c4f922df0ecf67d1ee32f53) --- bin/sh/tests/execution/Makefile | 4 ++++ bin/sh/tests/execution/shellproc2.0 | 18 ++++++++++++++++++ bin/sh/tests/execution/shellproc3.0 | 14 ++++++++++++++ bin/sh/tests/execution/shellproc4.0 | 14 ++++++++++++++ bin/sh/tests/execution/shellproc5.0 | 14 ++++++++++++++ 5 files changed, 64 insertions(+) diff --git a/bin/sh/tests/execution/Makefile b/bin/sh/tests/execution/Makefile index 064afdbf736c..bd6b2e06d55e 100644 --- a/bin/sh/tests/execution/Makefile +++ b/bin/sh/tests/execution/Makefile @@ -56,6 +56,10 @@ ${PACKAGE}FILES+= set-x2.0 ${PACKAGE}FILES+= set-x3.0 ${PACKAGE}FILES+= set-x4.0 ${PACKAGE}FILES+= shellproc1.0 +${PACKAGE}FILES+= shellproc2.0 +${PACKAGE}FILES+= shellproc3.0 +${PACKAGE}FILES+= shellproc4.0 +${PACKAGE}FILES+= shellproc5.0 ${PACKAGE}FILES+= subshell1.0 subshell1.0.stdout ${PACKAGE}FILES+= subshell2.0 ${PACKAGE}FILES+= subshell3.0 diff --git a/bin/sh/tests/execution/shellproc2.0 b/bin/sh/tests/execution/shellproc2.0 new file mode 100644 index 000000000000..85e768070022 --- /dev/null +++ b/bin/sh/tests/execution/shellproc2.0 @@ -0,0 +1,18 @@ +# $FreeBSD$ +# This tests a quality of implementation issue. +# Shells are not required to reject executing binary files as shell scripts +# but executing, for example, ELF files for a different architecture as +# shell scripts may have annoying side effects. + +T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit +trap 'rm -rf "${T}"' 0 +printf '\0' >"$T/testshellproc" +chmod 755 "$T/testshellproc" +if [ ! -s "$T/testshellproc" ]; then + printf "printf did not write a NUL character\n" >&2 + exit 2 +fi +PATH=$T:$PATH +errout=`testshellproc 3>&2 2>&1 >&3 3>&-` +r=$? +[ "$r" = 126 ] && [ -n "$errout" ] diff --git a/bin/sh/tests/execution/shellproc3.0 b/bin/sh/tests/execution/shellproc3.0 new file mode 100644 index 000000000000..6ad455f2cd77 --- /dev/null +++ b/bin/sh/tests/execution/shellproc3.0 @@ -0,0 +1,14 @@ +# $FreeBSD$ +# This tests a quality of implementation issue. +# Shells are not required to reject executing binary files as shell scripts +# but executing, for example, ELF files for a different architecture as +# shell scripts may have annoying side effects. + +T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit +trap 'rm -rf "${T}"' 0 +printf '\177ELF\001!!\011\0\0\0\0\0\0\0\0' >"$T/testshellproc" +chmod 755 "$T/testshellproc" +PATH=$T:$PATH +errout=`testshellproc 3>&2 2>&1 >&3 3>&-` +r=$? +[ "$r" = 126 ] && [ -n "$errout" ] diff --git a/bin/sh/tests/execution/shellproc4.0 b/bin/sh/tests/execution/shellproc4.0 new file mode 100644 index 000000000000..fcc72eef073c --- /dev/null +++ b/bin/sh/tests/execution/shellproc4.0 @@ -0,0 +1,14 @@ +# $FreeBSD$ +# This tests a quality of implementation issue. +# Shells are not required to reject executing binary files as shell scripts +# but executing, for example, ELF files for a different architecture as +# shell scripts may have annoying side effects. + +T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit +trap 'rm -rf "${T}"' 0 +printf '\211PNG\015\012\032\012\0\0\0\015IHDR' >"$T/testshellproc" +chmod 755 "$T/testshellproc" +PATH=$T:$PATH +errout=`testshellproc 3>&2 2>&1 >&3 3>&-` +r=$? +[ "$r" = 126 ] && [ -n "$errout" ] diff --git a/bin/sh/tests/execution/shellproc5.0 b/bin/sh/tests/execution/shellproc5.0 new file mode 100644 index 000000000000..c25ffe3e4693 --- /dev/null +++ b/bin/sh/tests/execution/shellproc5.0 @@ -0,0 +1,14 @@ +# $FreeBSD$ +# This tests a quality of implementation issue. +# Shells are not required to reject executing binary files as shell scripts +# but executing, for example, ELF files for a different architecture as +# shell scripts may have annoying side effects. + +T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit +trap 'rm -rf "${T}"' 0 +printf '\177ELF\001!!\012\0\0\0\0\0\0\0\0' >"$T/testshellproc" +chmod 755 "$T/testshellproc" +PATH=$T:$PATH +errout=`testshellproc 3>&2 2>&1 >&3 3>&-` +r=$? +[ "$r" = 126 ] && [ -n "$errout" ] From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 15:11:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B25E4EFC6E; Sat, 30 Jan 2021 15:11:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSd366XGCz4fgM; Sat, 30 Jan 2021 15:11:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0EB317BDE; Sat, 30 Jan 2021 15:11:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10UFBkal033038; Sat, 30 Jan 2021 15:11:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UFBk6F033037; Sat, 30 Jan 2021 15:11:46 GMT (envelope-from git) Date: Sat, 30 Jan 2021 15:11:46 GMT Message-Id: <202101301511.10UFBk6F033037@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jilles Tjoelker Subject: git: c48240fa6f8e - stable/12 - sh/tests: Add a second kind of binary scripts without #! MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jilles X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c48240fa6f8e168325a278f8b8cc075779615ddf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 15:11:48 -0000 The branch stable/12 has been updated by jilles: URL: https://cgit.FreeBSD.org/src/commit/?id=c48240fa6f8e168325a278f8b8cc075779615ddf commit c48240fa6f8e168325a278f8b8cc075779615ddf Author: Jilles Tjoelker AuthorDate: 2021-01-03 20:27:50 +0000 Commit: Jilles Tjoelker CommitDate: 2021-01-30 15:10:26 +0000 sh/tests: Add a second kind of binary scripts without #! One of the reasons for git commit e0f5c1387df23c8c4811f5b24a7ef6ecac51a71a was to make "actually portable executables" work. Add a test that is more like those. MFC after: 1 week (cherry picked from commit 52981a1694be7a70013e5149c020706c9b6411f9) --- bin/sh/tests/execution/Makefile | 1 + bin/sh/tests/execution/shellproc7.0 | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/bin/sh/tests/execution/Makefile b/bin/sh/tests/execution/Makefile index c7f68a7404aa..ddf2ff7f53b6 100644 --- a/bin/sh/tests/execution/Makefile +++ b/bin/sh/tests/execution/Makefile @@ -61,6 +61,7 @@ ${PACKAGE}FILES+= shellproc3.0 ${PACKAGE}FILES+= shellproc4.0 ${PACKAGE}FILES+= shellproc5.0 ${PACKAGE}FILES+= shellproc6.0 +${PACKAGE}FILES+= shellproc7.0 ${PACKAGE}FILES+= subshell1.0 subshell1.0.stdout ${PACKAGE}FILES+= subshell2.0 ${PACKAGE}FILES+= subshell3.0 diff --git a/bin/sh/tests/execution/shellproc7.0 b/bin/sh/tests/execution/shellproc7.0 new file mode 100644 index 000000000000..2a99ae74c151 --- /dev/null +++ b/bin/sh/tests/execution/shellproc7.0 @@ -0,0 +1,10 @@ +# $FreeBSD$ +# Non-POSIX trickery that is widely supported, +# used by https://justine.lol/ape.html + +T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit +trap 'rm -rf "${T}"' 0 +printf "MZqFpD='\n\0'\n#'\"\necho this is a test\n" >"$T/testshellproc" +chmod 755 "$T/testshellproc" +PATH=$T:$PATH +[ "`testshellproc`" = "this is a test" ] From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 15:11:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABF9A4EFB3A; Sat, 30 Jan 2021 15:11:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSd354Zpkz4fPZ; Sat, 30 Jan 2021 15:11:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90C4C17A2D; Sat, 30 Jan 2021 15:11:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10UFBjsp033019; Sat, 30 Jan 2021 15:11:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UFBjcd033018; Sat, 30 Jan 2021 15:11:45 GMT (envelope-from git) Date: Sat, 30 Jan 2021 15:11:45 GMT Message-Id: <202101301511.10UFBjcd033018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jilles Tjoelker Subject: git: 3708b615c354 - stable/12 - sh: Allow more scripts without #! MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jilles X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 3708b615c354df013037c065d5a714207c041ea8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 15:11:45 -0000 The branch stable/12 has been updated by jilles: URL: https://cgit.FreeBSD.org/src/commit/?id=3708b615c354df013037c065d5a714207c041ea8 commit 3708b615c354df013037c065d5a714207c041ea8 Author: Jilles Tjoelker AuthorDate: 2020-05-30 16:00:49 +0000 Commit: Jilles Tjoelker CommitDate: 2021-01-30 15:10:26 +0000 sh: Allow more scripts without #! Austin Group bugs #1226 and #1250 changed the requirements for shell scripts without #! (POSIX does not specify #!; this is about the shell execution when execve(2) returns an [ENOEXEC] error). POSIX says we shall allow execution if the initial part intended to be parsed by the shell consists of characters and does not contain the NUL character. This allows concatenating a shell script (ending with exec or exit) and a binary payload. In order to reject common binary files such as PNG images, check that there is a lowercase letter or expansion before the last newline before the NUL character, in addition to the check for the newline character suggested by POSIX. (cherry picked from commit e0f5c1387df23c8c4811f5b24a7ef6ecac51a71a) --- bin/sh/exec.c | 34 +++++++++++++++++++++++++++++++++- bin/sh/tests/execution/Makefile | 1 + bin/sh/tests/execution/shellproc6.0 | 8 ++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/bin/sh/exec.c b/bin/sh/exec.c index 95bf22a4a9f9..2bbef6ca0d27 100644 --- a/bin/sh/exec.c +++ b/bin/sh/exec.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* @@ -144,6 +145,37 @@ shellexec(char **argv, char **envp, const char *path, int idx) } +static bool +isbinary(const char *data, size_t len) +{ + const char *nul, *p; + bool hasletter; + + nul = memchr(data, '\0', len); + if (nul == NULL) + return false; + /* + * POSIX says we shall allow execution if the initial part intended + * to be parsed by the shell consists of characters and does not + * contain the NUL character. This allows concatenating a shell + * script (ending with exec or exit) and a binary payload. + * + * In order to reject common binary files such as PNG images, check + * that there is a lowercase letter or expansion before the last + * newline before the NUL character, in addition to the check for + * the newline character suggested by POSIX. + */ + hasletter = false; + for (p = data; *p != '\0'; p++) { + if ((*p >= 'a' && *p <= 'z') || *p == '$' || *p == '`') + hasletter = true; + if (hasletter && *p == '\n') + return false; + } + return true; +} + + static void tryexec(char *cmd, char **argv, char **envp) { @@ -159,7 +191,7 @@ tryexec(char *cmd, char **argv, char **envp) if (in != -1) { n = pread(in, buf, sizeof buf, 0); close(in); - if (n > 0 && memchr(buf, '\0', n) != NULL) { + if (n > 0 && isbinary(buf, n)) { errno = ENOEXEC; return; } diff --git a/bin/sh/tests/execution/Makefile b/bin/sh/tests/execution/Makefile index bd6b2e06d55e..c7f68a7404aa 100644 --- a/bin/sh/tests/execution/Makefile +++ b/bin/sh/tests/execution/Makefile @@ -60,6 +60,7 @@ ${PACKAGE}FILES+= shellproc2.0 ${PACKAGE}FILES+= shellproc3.0 ${PACKAGE}FILES+= shellproc4.0 ${PACKAGE}FILES+= shellproc5.0 +${PACKAGE}FILES+= shellproc6.0 ${PACKAGE}FILES+= subshell1.0 subshell1.0.stdout ${PACKAGE}FILES+= subshell2.0 ${PACKAGE}FILES+= subshell3.0 diff --git a/bin/sh/tests/execution/shellproc6.0 b/bin/sh/tests/execution/shellproc6.0 new file mode 100644 index 000000000000..1c06bc3b05a9 --- /dev/null +++ b/bin/sh/tests/execution/shellproc6.0 @@ -0,0 +1,8 @@ +# $FreeBSD$ + +T=`mktemp -d "${TMPDIR:-/tmp}/sh-test.XXXXXXXX"` || exit +trap 'rm -rf "${T}"' 0 +printf 'printf "this "\necho is a test\nexit\n\0' >"$T/testshellproc" +chmod 755 "$T/testshellproc" +PATH=$T:$PATH +[ "`testshellproc`" = "this is a test" ] From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 16:10:33 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C39C4F18A1; Sat, 30 Jan 2021 16:10:33 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSfLx1lW0z4kG3; Sat, 30 Jan 2021 16:10:32 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 10UGAKF3073524 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 30 Jan 2021 16:10:23 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: jilles@FreeBSD.org Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 10UGAEWX090926 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Sat, 30 Jan 2021 23:10:14 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: git: 3708b615c354 - stable/12 - sh: Allow more scripts without #! To: Jilles Tjoelker , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202101301511.10UFBjcd033018@gitrepo.freebsd.org> From: Eugene Grosbein Message-ID: <5cee1fe4-8aa8-0ad7-55ab-125bfbcb7c7f@grosbein.net> Date: Sat, 30 Jan 2021 23:10:09 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <202101301511.10UFBjcd033018@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, NICE_REPLY_A,SPF_HELO_NONE,T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) * 2.6 LOCAL_FROM From my domains * -0.0 NICE_REPLY_A Looks like a legit reply (A) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4DSfLx1lW0z4kG3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 16:10:33 -0000 30.01.2021 22:11, Jilles Tjoelker wrote: [skip] > +static bool > +isbinary(const char *data, size_t len) > +{ > + const char *nul, *p; > + bool hasletter; > + > + nul = memchr(data, '\0', len); > + if (nul == NULL) > + return false; > + /* > + * POSIX says we shall allow execution if the initial part intended > + * to be parsed by the shell consists of characters and does not > + * contain the NUL character. This allows concatenating a shell > + * script (ending with exec or exit) and a binary payload. > + * > + * In order to reject common binary files such as PNG images, check > + * that there is a lowercase letter or expansion before the last > + * newline before the NUL character, in addition to the check for > + * the newline character suggested by POSIX. > + */ > + hasletter = false; > + for (p = data; *p != '\0'; p++) { > + if ((*p >= 'a' && *p <= 'z') || *p == '$' || *p == '`') > + hasletter = true; > + if (hasletter && *p == '\n') > + return false; > + } > + return true; > +} Before last newline or before first newline? From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 22:26:26 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A0274FB20A; Sat, 30 Jan 2021 22:26:26 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mail02.stack.nl (scw01.stack.nl [51.15.111.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.stack.nl", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSphf1mgdz3N5X; Sat, 30 Jan 2021 22:26:25 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail02.stack.nl (Postfix) with ESMTP id 31EFF1E00A3; Sat, 30 Jan 2021 22:26:18 +0000 (UTC) Received: from mail02.stack.nl ([127.0.0.1]) by localhost (mail02.stack.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AD1OxuHvbFJ0; Sat, 30 Jan 2021 22:26:16 +0000 (UTC) Received: from blade.stack.nl (blade.stack.nl [192.168.121.130]) by mail02.stack.nl (Postfix) with ESMTP id 5AFCC1E0093; Sat, 30 Jan 2021 22:26:16 +0000 (UTC) Received: by blade.stack.nl (Postfix, from userid 1677) id 43D642422A8; Sat, 30 Jan 2021 23:26:16 +0100 (CET) Date: Sat, 30 Jan 2021 23:26:16 +0100 From: Jilles Tjoelker To: Eugene Grosbein Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: 3708b615c354 - stable/12 - sh: Allow more scripts without #! Message-ID: <20210130222616.GA4539@stack.nl> References: <202101301511.10UFBjcd033018@gitrepo.freebsd.org> <5cee1fe4-8aa8-0ad7-55ab-125bfbcb7c7f@grosbein.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5cee1fe4-8aa8-0ad7-55ab-125bfbcb7c7f@grosbein.net> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4DSphf1mgdz3N5X X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 22:26:26 -0000 On Sat, Jan 30, 2021 at 11:10:09PM +0700, Eugene Grosbein wrote: > 30.01.2021 22:11, Jilles Tjoelker wrote: > [skip] > > +static bool > > +isbinary(const char *data, size_t len) > > +{ > > + const char *nul, *p; > > + bool hasletter; > > + > > + nul = memchr(data, '\0', len); > > + if (nul == NULL) > > + return false; > > + /* > > + * POSIX says we shall allow execution if the initial part intended > > + * to be parsed by the shell consists of characters and does not > > + * contain the NUL character. This allows concatenating a shell > > + * script (ending with exec or exit) and a binary payload. > > + * > > + * In order to reject common binary files such as PNG images, check > > + * that there is a lowercase letter or expansion before the last > > + * newline before the NUL character, in addition to the check for > > + * the newline character suggested by POSIX. > > + */ > > + hasletter = false; > > + for (p = data; *p != '\0'; p++) { > > + if ((*p >= 'a' && *p <= 'z') || *p == '$' || *p == '`') > > + hasletter = true; > > + if (hasletter && *p == '\n') > > + return false; > > + } > > + return true; > > +} > Before last newline or before first newline? Before the last newline, according to both comment and code. It is acceptable to have an empty line, a line containing only '{', etc. before the line containing the lowercase letter or expansion. I could add another test case for this, if that would clarify things (just like I did for the "actually portable executable" hacks). -- Jilles Tjoelker From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 22:59:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D69824FB9F5; Sat, 30 Jan 2021 22:59:08 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSqQN4Qw0z3PWr; Sat, 30 Jan 2021 22:59:08 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 10UMwruC077371 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 30 Jan 2021 22:58:55 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: jilles@stack.nl Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 10UMwjdm097125 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Sun, 31 Jan 2021 05:58:45 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: git: 3708b615c354 - stable/12 - sh: Allow more scripts without #! To: Jilles Tjoelker References: <202101301511.10UFBjcd033018@gitrepo.freebsd.org> <5cee1fe4-8aa8-0ad7-55ab-125bfbcb7c7f@grosbein.net> <20210130222616.GA4539@stack.nl> Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Message-ID: Date: Sun, 31 Jan 2021 05:58:39 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20210130222616.GA4539@stack.nl> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, NICE_REPLY_A,SPF_HELO_NONE,T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) * 2.6 LOCAL_FROM From my domains * -0.0 NICE_REPLY_A Looks like a legit reply (A) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4DSqQN4Qw0z3PWr X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 22:59:08 -0000 31.01.2021 5:26, Jilles Tjoelker wrote: >>> +static bool >>> +isbinary(const char *data, size_t len) >>> +{ >>> + const char *nul, *p; >>> + bool hasletter; >>> + >>> + nul = memchr(data, '\0', len); >>> + if (nul == NULL) >>> + return false; >>> + /* >>> + * POSIX says we shall allow execution if the initial part intended >>> + * to be parsed by the shell consists of characters and does not >>> + * contain the NUL character. This allows concatenating a shell >>> + * script (ending with exec or exit) and a binary payload. >>> + * >>> + * In order to reject common binary files such as PNG images, check >>> + * that there is a lowercase letter or expansion before the last >>> + * newline before the NUL character, in addition to the check for >>> + * the newline character suggested by POSIX. >>> + */ >>> + hasletter = false; >>> + for (p = data; *p != '\0'; p++) { >>> + if ((*p >= 'a' && *p <= 'z') || *p == '$' || *p == '`') >>> + hasletter = true; >>> + if (hasletter && *p == '\n') >>> + return false; >>> + } >>> + return true; >>> +} > >> Before last newline or before first newline? > > Before the last newline, according to both comment and code. Sorry, I don't get it. The "for" loop starts from the beginning, and returns false (NOT binary, text file) after lowercase letter and first newline, not last. From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 23:09:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 716BE4FBF7D; Sat, 30 Jan 2021 23:09:15 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mail02.stack.nl (scw01.stack.nl [51.15.111.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits)) (Client CN "*.stack.nl", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSqf327p6z3QF1; Sat, 30 Jan 2021 23:09:14 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail02.stack.nl (Postfix) with ESMTP id C5B711E00A3; Sat, 30 Jan 2021 23:09:13 +0000 (UTC) Received: from mail02.stack.nl ([127.0.0.1]) by localhost (mail02.stack.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 90owZBQq1YyZ; Sat, 30 Jan 2021 23:09:11 +0000 (UTC) Received: from blade.stack.nl (blade.stack.nl [192.168.121.130]) by mail02.stack.nl (Postfix) with ESMTP id DB8A71E0093; Sat, 30 Jan 2021 23:09:11 +0000 (UTC) Received: by blade.stack.nl (Postfix, from userid 1677) id BFF892422A8; Sun, 31 Jan 2021 00:09:11 +0100 (CET) Date: Sun, 31 Jan 2021 00:09:11 +0100 From: Jilles Tjoelker To: Eugene Grosbein Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: Re: git: 3708b615c354 - stable/12 - sh: Allow more scripts without #! Message-ID: <20210130230911.GA17817@stack.nl> References: <202101301511.10UFBjcd033018@gitrepo.freebsd.org> <5cee1fe4-8aa8-0ad7-55ab-125bfbcb7c7f@grosbein.net> <20210130222616.GA4539@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4DSqf327p6z3QF1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 23:09:15 -0000 On Sun, Jan 31, 2021 at 05:58:39AM +0700, Eugene Grosbein wrote: > 31.01.2021 5:26, Jilles Tjoelker wrote: > >>> +static bool > >>> +isbinary(const char *data, size_t len) > >>> +{ > >>> + const char *nul, *p; > >>> + bool hasletter; > >>> + > >>> + nul = memchr(data, '\0', len); > >>> + if (nul == NULL) > >>> + return false; > >>> + /* > >>> + * POSIX says we shall allow execution if the initial part intended > >>> + * to be parsed by the shell consists of characters and does not > >>> + * contain the NUL character. This allows concatenating a shell > >>> + * script (ending with exec or exit) and a binary payload. > >>> + * > >>> + * In order to reject common binary files such as PNG images, check > >>> + * that there is a lowercase letter or expansion before the last > >>> + * newline before the NUL character, in addition to the check for > >>> + * the newline character suggested by POSIX. > >>> + */ > >>> + hasletter = false; > >>> + for (p = data; *p != '\0'; p++) { > >>> + if ((*p >= 'a' && *p <= 'z') || *p == '$' || *p == '`') > >>> + hasletter = true; > >>> + if (hasletter && *p == '\n') > >>> + return false; > >>> + } > >>> + return true; > >>> +} > >> Before last newline or before first newline? > > Before the last newline, according to both comment and code. > Sorry, I don't get it. The "for" loop starts from the beginning, and > returns false (NOT binary, text file) after lowercase letter and first > newline, not last. The loop continues until the first NUL byte and will return false (not binary) when it encounters any newline after an ASCII lowercase letter, '$' or '`'. -- Jilles Tjoelker From owner-dev-commits-src-branches@freebsd.org Sat Jan 30 23:41:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 925164FCCAD; Sat, 30 Jan 2021 23:41:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSrLl3pfkz3htv; Sat, 30 Jan 2021 23:41:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75AA41E4A0; Sat, 30 Jan 2021 23:41:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10UNf3Hr095726; Sat, 30 Jan 2021 23:41:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10UNf3ur095725; Sat, 30 Jan 2021 23:41:03 GMT (envelope-from git) Date: Sat, 30 Jan 2021 23:41:03 GMT Message-Id: <202101302341.10UNf3ur095725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 8ce9180c09d9 - stable/11 - kevent(2): Bugfix for wrong EVFILT_TIMER timeouts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 8ce9180c09d93b4ef11859be604ef41173d6dbd1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2021 23:41:03 -0000 The branch stable/11 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8ce9180c09d93b4ef11859be604ef41173d6dbd1 commit 8ce9180c09d93b4ef11859be604ef41173d6dbd1 Author: Jan Kokemüller AuthorDate: 2021-01-09 19:00:25 +0000 Commit: Gordon Bergling CommitDate: 2021-01-30 23:39:58 +0000 kevent(2): Bugfix for wrong EVFILT_TIMER timeouts When using NOTE_NSECONDS in the kevent(2) API, US_TO_SBT should be used instead of NS_TO_SBT, otherwise the timeout results are misleading. PR: 252539 Reviewed by: kevans, kib Approved by: kevans Differential Revision: https://reviews.freebsd.org/D28067 (cherry picked from commit 4d0c33be634a929f323117f04e6b1670776f9e37) (cherry picked from commit 6a3ad2d0a7b633bad2bb33f9c4c426dffcc91633) --- sys/kern/kern_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 16f24e59b73e..004e3e1e436e 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -629,7 +629,7 @@ timer2sbintime(intptr_t data, int flags) if (secs > (SBT_MAX / SBT_1S)) return (SBT_MAX); #endif - return (secs << 32 | US_TO_SBT(data % 1000000000)); + return (secs << 32 | NS_TO_SBT(data % 1000000000)); } return (NS_TO_SBT(data)); default: From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 01:08:50 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B72EA4FEEF5 for ; Sun, 31 Jan 2021 01:08:50 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-21.consmr.mail.gq1.yahoo.com (sonic313-21.consmr.mail.gq1.yahoo.com [98.137.65.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DStJ14WMdz3mWr for ; Sun, 31 Jan 2021 01:08:49 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1612055327; bh=jISdPzuD7szaq8qjc29C+AIaHFiNzvsdFo2HxlWsWmY=; h=From:Subject:Date:To:From:Subject:Reply-To; b=jNCkcZ2ljWBUiMbO5NwMFTnxXTw6WZZuZG6LTrGmefo850cLpmDUvW8TWC+8JFE6v3Tg63Qzg2R+ojmBxHlnNvMhAIwQQHzQ5Oagwz60CAkoYSD7/JHcgBz8ECoC5/IHTMnPsUi/xFHIeVPsCRS04Z2skSVLCdbLlmUkII+UzxA7bs+eJaiJSyR6DlobXkw4bQQOiT6F14EZpNjX9BkNTjee0SMrrvW24MKnCqKy/eWkDyqikr7fHNekE33uEo9f+A4KEz9tpg3yrAcRftHO7OgavzQit7ajRt6wGbq60XeR1On0Q3tPNi1pe5GTTQol+VLMytzngfd167TMtWj7tg== X-YMail-OSG: EKzb0AEVM1nRhnBiQad62QXT2ieZZuLFhvNansnYO04.AKUmdTpxWQL5KR1pg6C liAjM.HU2f2__Kaxnj8iuPEgnaA8BSYR_XzA1VyhBK7Fo6lV2Wt8UUQE5olEUWwBPharpWxSO.VA N8ApEIHXSqbsUp8LsCAs0b2881si6d20MftUm14xVlXSy4s6dqvwvIw5FH42B9ZgU55acCbuAsco J7golt_2GnY9bZYfN.mlJf2t1T9JfdKyv9CprLJ6CFXgF987wOcXTV2BntV5HYmsnS4RXHy05xrG CNi2fdlQmuvoNFNCZDLIcOdDYXppqSkrsLH1E8fB5VfdvD1f0txXyXcq.xyhXnyXEEdar0iK8e2D Iz_y3Lr7kdwcGbFsFeloNkDW5vZ2qoQzZh4EG1wsW1CMIcYOVItsn81U14C.AP039P02yTfp2MQK CxBKMoVBMx415yX11Qc.MMr.YG.ftb6qoztB2ikwaH_PHmvha4tptCBVQIqoQDpbbY_MoQBa0EKR lBC5WkcFVUKOJm4SSH0xf_EIyHAk86QXPMzgmLKJq_38sI6LwsZFZNRX8BZ4l5X_GVwVGW3YLzsx DKPxUIUbQkF_a_HtWXI1yidQQAk12f7qqVcT2ueASQrDB.Ot5UU0Kl3pnQCNrMPKk8VyGsFvD8KJ n5oPhUDbJ4E8.PC9ozXMeKwOZ8nP9mhH_.2A8npWH.FqXT8A5YKN44NYryet7liqaXlKsi0IDo8v jWhajzLXhQOxpt7fWf1sVQQsAucpeSeo55jZWiDVPs8xePUqVZ5ij62S3rCHk9Nc48mBucty8_G9 jQtPyiUmJpOwTfBR4qtSgb2qgzWmgOrzExV0x4QRgFeJ7BtkGgZjbdC4UfYFbrs3ihDqDbqIE99e cy3FSEVSToaxAk4_dCKn3RkcbdnofAMMXTz818fYnCPccPUrPnTFZeYIhXXwl9XN6T_TlfcqZp5Y bSeqUc40HySA1bt7L.CsCOfA9I7EggQ0czg6ZqdWPy5ljyWC40nq6z9.QCjIyvSsxrI8K0eFWKKa fuhug.4dw_RS.nIsK5YH3Y1gOjRxVomgSeG6GiLK4eFTZIEEyc6Aelqu2DkxB3b9Ha8dcv.bKsql ZAdHZdfwlPoFVdEhf7ZpoO7Y.uRxxMLn379gN5w69WMT7tf6qOKfhe5LLd3IBR4SM30_SMMD.JG4 D4.Ol53pD3oSwbGEtif2See5bjF1LClKznJ5l.x4ojdtG9Do3Fm.qAqEwjXYlumQ2anf1kIjTXse 5fv3XcN2MtkYFsNVc3WBw3sXZ.8dWsy.blvPjQedmZog5TVrjDypRj5qxxUHMR4q.T49avgEzMfX M8WUpDBmEgeycMDTXvavPNwfL0J4PeyWL8pqUQFMVygW_BPEXg18rCbvAfPI4JX.42GdDehrbp7z 1MuMHdKHa_IezvsJKEaPMokccpcyl_6BgFvYgeiAgmlxCRrgEK0y7oMMkkdaKKgSwDaHeMzo2ZEh 7_.SOjKsKiSww8UZSZhl1Af1GSOrzYtEbH1Y_PEP91ojxL2H0xROCwoTbZCqh5LdP2cDw1Hr3JM9 wWxkQ2MbpMAmkix6GgHtsvdyp9kmBq_wSqxEl4qxoBeAq9lltHo.iTiV01aa9vzNlP2XzM_.5B8e WcALvMovHoNXDTBmTOYuaPqFuFnX5jQTuXMUBJnFz6.6Ez8lLKYn1YNiGg60f7nMHaK0WKhWZtIA wrfjSzY4H1dkXzpNC2DX0NY1ZQAldITZo.SA1ZIzLHZKv__lffVnZwCXiXkIdEvSEdZv6l1znHhp w14.twKkn2Y_yEH7R9jbYMp5ufRUsjXDIOp_W51rm2FX7IYCjr9N5UjEgLtR9yZG0yHOqZEEzQoY KpJ4s7SS2.Rr2CsaUIECpj_C1fW8YK34gtFzaNHJGZhmrhQuhdZb1U.JleG7b6VNPmxOOW6XPfge vPPeGOWvipzNikWItmy659FCF2PRAI_jGdg0OaQi3wuG6XvCyaMQbS6UpAdNG6wrLmEHpknn0oHJ 3wiajQ7cMloHVJpNVsUOkK3V.Gtytu3nvHwOM1JzLKnnkh6AF4pgRXbvCFQKLmG6YT8BTorvxGn7 8h4Hy86rxrY_1xcCiNFG1GOy6kyBKvUuK1jE0jmwBQXoPY0FJivNOBi5SbfeRTEgmxuRatkoG25G fstHKInrOc.i9QYpC2PsHpvYS7Hbdh7MmfQdL7YMCFEEHilHf2wq0xFMSY0kuRv7xxgKtWL3UkKy IMZOoe7tn.qizpL.aFcN8Qp9YM.T9CkPXWUh8CwyTTW5l5.uwDm4djjRZx9yA0FBwZjCYvTKvyKx uXAgDDlTCa0KgErMC9lUV.i4Oy19WJRVGqlPNiL.1VKaGWnsihfAUOitKMlEimsLspnlkyw4AvQ5 bfPaL2iRVi8NLWqOKxxGAPDyWT7hORIB42WaJpIQPTdjMyYHoahp_wGY9Do4rAqd7e.Yor2Jugh8 iH8dHmt4LalYo2Ut7g5WJONbUeRS3ODHoQW1IQgT.DKvU.chZFHa0o8h_c.gws0lU8Hazt4kGGR2 5NOrUM4wYHyRxWg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Sun, 31 Jan 2021 01:08:47 +0000 Received: by smtp407.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID d99e560f086903acbb5b393b32d5afca; Sun, 31 Jan 2021 01:08:43 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.40.0.2.32\)) Subject: Re: git: 3708b615c354 - stable/12 - sh: Allow more scripts without #! Message-Id: <140C16CB-E1E5-49E9-979D-0C707E678CE2@yahoo.com> Date: Sat, 30 Jan 2021 17:08:40 -0800 To: jilles@stack.nl, dev-commits-src-branches@freebsd.org X-Mailer: Apple Mail (2.3654.40.0.2.32) References: <140C16CB-E1E5-49E9-979D-0C707E678CE2.ref@yahoo.com> X-Rspamd-Queue-Id: 4DStJ14WMdz3mWr X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.00)[-1.000]; SUBJECT_ENDS_EXCLAIM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RBL_DBL_DONT_QUERY_IPS(0.00)[98.137.65.84:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[98.137.65.84:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.84:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.84:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-branches] X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 01:08:50 -0000 Jilles Tjoelker jilles at stack.nl wrote on Sat Jan 30 23:09:15 UTC 2021 : . . . > > >>> + * In order to reject common binary files such as PNG images, check > > >>> + * that there is a lowercase letter or expansion before the last > > >>> + * newline before the NUL character, in addition to the check for > > >>> + * the newline character suggested by POSIX. > . . . vs. an alternate description: > The loop continues until the first NUL byte and will return false (not > binary) when it encounters any newline after an ASCII lowercase letter, > '$' or '`'. I find the comment in the code much harder to derive the intent from. ALTERNATE (partial?) WORDING FOR CODE COMMENT? : In order to reject common binary files such as PNG images, reject (return false) when there is a lowercase letter or expansion anywhere before any newline that is before the first NUL character. END ALTERNATE WORDING === Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 01:15:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B51254FF90E; Sun, 31 Jan 2021 01:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DStRK4q6bz3nNC; Sun, 31 Jan 2021 01:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 982F61F98C; Sun, 31 Jan 2021 01:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V1F9QZ017094; Sun, 31 Jan 2021 01:15:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V1F9aB017093; Sun, 31 Jan 2021 01:15:09 GMT (envelope-from git) Date: Sun, 31 Jan 2021 01:15:09 GMT Message-Id: <202101310115.10V1F9aB017093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: d9cd8a3d3fd5 - stable/12 - stand: ensure that the efi directory's dependencies are correct MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d9cd8a3d3fd57109978afa157e749048d3b22ea7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 01:15:09 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=d9cd8a3d3fd57109978afa157e749048d3b22ea7 commit d9cd8a3d3fd57109978afa157e749048d3b22ea7 Author: Kyle Evans AuthorDate: 2021-01-27 18:54:07 +0000 Commit: Kyle Evans CommitDate: 2021-01-31 01:15:00 +0000 stand: ensure that the efi directory's dependencies are correct efi, like the various ${MACHINE} directories, should have a dependency on the enabled interpreters. The general rule here is that any top-level directory that has a program at any depth within that includes loader.mk should add ${INTERP_DEPENDS} added to its dependencies so that the appropriate ficl/lua bits are ready before they begin. Note that the only directories in-tree that require it but will not get it in a more appropriate manner are i386 (on amd64), efi, and userboot. i386 and userboot are handled explicitly in Makefile.amd64 where they are added to S.yes. Reported-by: bcran (cherry picked from commit 7012461c9bf6375cd0b14de16b3b4a753c5c1c7a) --- stand/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/stand/Makefile b/stand/Makefile index f0a3d65e1fb8..f00d072f73ae 100644 --- a/stand/Makefile +++ b/stand/Makefile @@ -74,6 +74,7 @@ SUBDIR_DEPEND_${_x}32+= libsa32 SUBDIR_DEPEND_forth+= ficl SUBDIR_DEPEND_lua+= liblua +SUBDIR_DEPEND_efi+= ${INTERP_DEPENDS} .if ${MK_FDT} != "no" SUBDIR_DEPEND_efi+= fdt .endif From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 01:16:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D39804FF763; Sun, 31 Jan 2021 01:16:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DStSn5hyJz3nK8; Sun, 31 Jan 2021 01:16:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B69581F94D; Sun, 31 Jan 2021 01:16:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V1GPlc017386; Sun, 31 Jan 2021 01:16:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V1GPmw017385; Sun, 31 Jan 2021 01:16:25 GMT (envelope-from git) Date: Sun, 31 Jan 2021 01:16:25 GMT Message-Id: <202101310116.10V1GPmw017385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: e8a03eb0c4e1 - stable/12 - lualoader: improve loader.conf var processing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e8a03eb0c4e1fcb94d58d833ab060bef34646470 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 01:16:25 -0000 The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e8a03eb0c4e1fcb94d58d833ab060bef34646470 commit e8a03eb0c4e1fcb94d58d833ab060bef34646470 Author: Kyle Evans AuthorDate: 2021-01-24 19:25:34 +0000 Commit: Kyle Evans CommitDate: 2021-01-31 01:16:12 +0000 lualoader: improve loader.conf var processing lualoader was previously not processing \ as escapes; this commit fixes that and does better error checking on the value as well. Additionally, loader.conf had some odd restrictions on values that make little sense. Previously, lines like: kernel=foo Would simply be discarded with a malformed line complaint you might not see unless you disable beastie. lualoader tries to process these as well as it can and manipulates the environment, while forthloader did minimal processing and constructed a `set` command to do the heavy lifting instead. The lua approach was re-envisioned from building a `set` command so that we can appropriately reset the environment when, for example, boot environments change. Lift the previous restrictions to allow unquoted values on the right hand side of an expression. Note that an unquoted value is effectively: [A-Za-z0-9-][A-Za-z0-9-_.]* This commit also stops trying to weirdly limit what it can handle in a quoted value. Previously it only allowed spaces, alphanumeric, and punctuation, which is kind of weird. Change it here to grab as much as it can between two sets of quotes, then let processEnvVar() do the needful and complain if it finds something malformed looking. My extremely sophisticated test suite is as follows: < Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD0974E0B63; Sun, 31 Jan 2021 04:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSynX5TwCz4VL0; Sun, 31 Jan 2021 04:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF35721EFA; Sun, 31 Jan 2021 04:31:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V4VCvH076322; Sun, 31 Jan 2021 04:31:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V4VCWQ076321; Sun, 31 Jan 2021 04:31:12 GMT (envelope-from git) Date: Sun, 31 Jan 2021 04:31:12 GMT Message-Id: <202101310431.10V4VCWQ076321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 58e43f89f17c - stable/11 - MFC: 83edbc3cb54fba6b37a68270c232df7b785bd222 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 58e43f89f17cf807b77270e15b91c46bfdfd1e77 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 04:31:12 -0000 The branch stable/11 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=58e43f89f17cf807b77270e15b91c46bfdfd1e77 commit 58e43f89f17cf807b77270e15b91c46bfdfd1e77 Author: Cy Schubert AuthorDate: 2021-01-15 04:32:16 +0000 Commit: Cy Schubert CommitDate: 2021-01-31 04:29:30 +0000 MFC: 83edbc3cb54fba6b37a68270c232df7b785bd222 ipfilter: Retire pre-standard C support. All C compilers in 2021 support standard C and architectures that did not were retired long ago. Simplify by removing now redundant pre-standard C code. MFC after: 1 week (cherry picked from commit 83edbc3cb54fba6b37a68270c232df7b785bd222) --- contrib/ipfilter/bpf-ipf.h | 12 --------- contrib/ipfilter/ipf.h | 8 ------ contrib/ipfilter/iplang/iplang_l.l | 4 --- contrib/ipfilter/ipsend/ipsend.h | 4 --- contrib/ipfilter/ipsend/ipsopt.c | 4 --- contrib/ipfilter/kmem.h | 4 --- contrib/ipfilter/lib/debug.c | 23 +++------------- contrib/ipfilter/lib/facpri.h | 4 --- contrib/ipfilter/lib/inet_addr.c | 4 --- contrib/ipfilter/lib/kmem.c | 4 --- contrib/ipfilter/lib/kmem.h | 4 --- contrib/ipfilter/lib/verbose.c | 16 ----------- contrib/ipfilter/md5.c | 4 --- contrib/ipfilter/md5.h | 8 ------ contrib/ipfilter/opts.h | 4 --- sys/contrib/ipfilter/netinet/ip_compat.h | 12 --------- sys/contrib/ipfilter/netinet/ip_fil.h | 46 -------------------------------- sys/contrib/ipfilter/netinet/ip_lookup.h | 12 --------- sys/contrib/ipfilter/netinet/ip_nat.h | 8 ------ sys/contrib/ipfilter/netinet/ip_proxy.h | 4 --- sys/contrib/ipfilter/netinet/ip_scan.h | 6 ----- sys/contrib/ipfilter/netinet/ip_state.h | 4 --- 22 files changed, 4 insertions(+), 195 deletions(-) diff --git a/contrib/ipfilter/bpf-ipf.h b/contrib/ipfilter/bpf-ipf.h index dc2b660e2eee..a114949de6e0 100644 --- a/contrib/ipfilter/bpf-ipf.h +++ b/contrib/ipfilter/bpf-ipf.h @@ -420,25 +420,13 @@ struct bpf_insn { * Systems based on non-BSD kernels don't have ifnet's (or they don't mean * anything if it is in ) and won't work like this. */ -# if __STDC__ extern void bpf_tap(struct ifnet *, u_char *, u_int); extern void bpf_mtap(struct ifnet *, struct mbuf *); extern void bpfattach(struct ifnet *, u_int, u_int); extern void bpfilterattach(int); -# else -extern void bpf_tap(); -extern void bpf_mtap(); -extern void bpfattach(); -extern void bpfilterattach(); -# endif /* __STDC__ */ #endif /* BSD && (_KERNEL || KERNEL) */ -#if __STDC__ || defined(__cplusplus) extern int bpf_validate(struct bpf_insn *, int); extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); -#else -extern int bpf_validate(); -extern u_int bpf_filter(); -#endif /* * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h index 05dcfa4afd64..834ba83f51f0 100644 --- a/contrib/ipfilter/ipf.h +++ b/contrib/ipfilter/ipf.h @@ -73,15 +73,7 @@ #include "opts.h" #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif #ifndef U_32_T diff --git a/contrib/ipfilter/iplang/iplang_l.l b/contrib/ipfilter/iplang/iplang_l.l index 0002db151c81..e66867e2a455 100644 --- a/contrib/ipfilter/iplang/iplang_l.l +++ b/contrib/ipfilter/iplang/iplang_l.l @@ -21,11 +21,7 @@ #include "ipf.h" #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int opts; diff --git a/contrib/ipfilter/ipsend/ipsend.h b/contrib/ipfilter/ipsend/ipsend.h index f409e89c656e..22f85ff07f14 100644 --- a/contrib/ipfilter/ipsend/ipsend.h +++ b/contrib/ipfilter/ipsend/ipsend.h @@ -16,11 +16,7 @@ * */ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif #include diff --git a/contrib/ipfilter/ipsend/ipsopt.c b/contrib/ipfilter/ipsend/ipsopt.c index 7f9ab5e32d79..ce6616525ca1 100644 --- a/contrib/ipfilter/ipsend/ipsopt.c +++ b/contrib/ipfilter/ipsend/ipsopt.c @@ -27,11 +27,7 @@ static const char rcsid[] = "@(#)$Id$"; #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif diff --git a/contrib/ipfilter/kmem.h b/contrib/ipfilter/kmem.h index ce6ad56f52d9..ea21c052599f 100644 --- a/contrib/ipfilter/kmem.h +++ b/contrib/ipfilter/kmem.h @@ -11,11 +11,7 @@ #define __KMEM_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int openkmem __P((char *, char *)); extern int kmemcpy __P((char *, long, int)); diff --git a/contrib/ipfilter/lib/debug.c b/contrib/ipfilter/lib/debug.c index 02e5f5b48775..0e3276e21705 100644 --- a/contrib/ipfilter/lib/debug.c +++ b/contrib/ipfilter/lib/debug.c @@ -8,11 +8,7 @@ * $Id$ */ -#if defined(__STDC__) # include -#else -# include -#endif #include #include "ipf.h" @@ -21,14 +17,8 @@ int debuglevel = 0; -#ifdef __STDC__ -void debug(int level, char *fmt, ...) -#else -void debug(level, fmt, va_alist) - int level; - char *fmt; - va_dcl -#endif +void +debug(int level, char *fmt, ...) { va_list pvar; @@ -40,13 +30,8 @@ void debug(level, fmt, va_alist) } -#ifdef __STDC__ -void ipfkdebug(char *fmt, ...) -#else -void ipfkdebug(fmt, va_alist) - char *fmt; - va_dcl -#endif +void +ipfkdebug(char *fmt, ...) { va_list pvar; diff --git a/contrib/ipfilter/lib/facpri.h b/contrib/ipfilter/lib/facpri.h index 54ecabd6ce49..d3634e99d795 100644 --- a/contrib/ipfilter/lib/facpri.h +++ b/contrib/ipfilter/lib/facpri.h @@ -13,11 +13,7 @@ #ifndef __P # define P_DEF -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern char *fac_toname __P((int)); diff --git a/contrib/ipfilter/lib/inet_addr.c b/contrib/ipfilter/lib/inet_addr.c index 8667c2b33038..fcaefe0fc23e 100644 --- a/contrib/ipfilter/lib/inet_addr.c +++ b/contrib/ipfilter/lib/inet_addr.c @@ -66,11 +66,7 @@ static const char rcsid[] = "@(#)$Id: inet_addr.c,v 1.8.2.3 2004/12/09 19:41:20 #include #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif int inet_aton __P((const char *, struct in_addr *)); diff --git a/contrib/ipfilter/lib/kmem.c b/contrib/ipfilter/lib/kmem.c index de97512cf5d3..26252a02f0bf 100644 --- a/contrib/ipfilter/lib/kmem.c +++ b/contrib/ipfilter/lib/kmem.c @@ -30,10 +30,6 @@ #include "kmem.h" -#ifndef __STDC__ -# define const -#endif - #if !defined(lint) static const char sccsid[] = "@(#)kmem.c 1.4 1/12/96 (C) 1992 Darren Reed"; static const char rcsid[] = "@(#)$Id$"; diff --git a/contrib/ipfilter/lib/kmem.h b/contrib/ipfilter/lib/kmem.h index 1abe31a3b7fb..31cd9725cc62 100644 --- a/contrib/ipfilter/lib/kmem.h +++ b/contrib/ipfilter/lib/kmem.h @@ -11,11 +11,7 @@ #define __KMEM_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int openkmem __P((char *, char *)); extern int kmemcpy __P((char *, long, int)); diff --git a/contrib/ipfilter/lib/verbose.c b/contrib/ipfilter/lib/verbose.c index 710daab443e3..47988c084516 100644 --- a/contrib/ipfilter/lib/verbose.c +++ b/contrib/ipfilter/lib/verbose.c @@ -8,24 +8,14 @@ * $Id$ */ -#if defined(__STDC__) # include -#else -# include -#endif #include #include "ipf.h" #include "opts.h" -#if defined(__STDC__) void verbose(int level, char *fmt, ...) -#else -void verbose(level, fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list pvar; @@ -37,13 +27,7 @@ void verbose(level, fmt, va_alist) } -#if defined(__STDC__) void ipfkverbose(char *fmt, ...) -#else -void ipfkverbose(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list pvar; diff --git a/contrib/ipfilter/md5.c b/contrib/ipfilter/md5.c index 6ac639935902..d2ed954576d3 100644 --- a/contrib/ipfilter/md5.c +++ b/contrib/ipfilter/md5.c @@ -100,11 +100,7 @@ static unsigned char PADDING[64] = { (a) += (b); \ } -#ifdef __STDC__ #define UL(x) x##U -#else -#define UL(x) x -#endif /* The routine MD5Init initializes the message-digest context mdContext. All fields are set to zero. diff --git a/contrib/ipfilter/md5.h b/contrib/ipfilter/md5.h index 914df74355a0..cc09b48e8547 100644 --- a/contrib/ipfilter/md5.h +++ b/contrib/ipfilter/md5.h @@ -42,15 +42,7 @@ #if !defined(__MD5_INCLUDE__) && !defined(_SYS_MD5_H) #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif /* typedef a 32-bit type */ diff --git a/contrib/ipfilter/opts.h b/contrib/ipfilter/opts.h index 6e973186756e..17844e89ecfc 100644 --- a/contrib/ipfilter/opts.h +++ b/contrib/ipfilter/opts.h @@ -54,11 +54,7 @@ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif #if defined(sun) && !SOLARIS diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 0f54c151543a..30172f3681f0 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -12,15 +12,7 @@ #define __IP_COMPAT_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif #if defined(_KERNEL) || defined(KERNEL) || defined(__KERNEL__) @@ -63,11 +55,7 @@ #endif -# ifdef __STDC__ # define IPL_EXTERN(ep) ipl##ep -# else -# define IPL_EXTERN(ep) ipl/**/ep -# endif /* * This is a workaround for troubles on FreeBSD and OpenBSD. diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 7d70f5135da8..0c7448492464 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -31,14 +31,9 @@ #endif #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif -#if defined(__STDC__) || defined(__GNUC__) # define SIOCADAFR _IOW('r', 60, struct ipfobj) # define SIOCRMAFR _IOW('r', 61, struct ipfobj) # define SIOCSETFF _IOW('r', 62, u_int) @@ -78,47 +73,6 @@ # define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) # define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) # define SIOCIPFINTERROR _IOR('r', 98, int) -#else -# define SIOCADAFR _IOW(r, 60, struct ipfobj) -# define SIOCRMAFR _IOW(r, 61, struct ipfobj) -# define SIOCSETFF _IOW(r, 62, u_int) -# define SIOCGETFF _IOR(r, 63, u_int) -# define SIOCGETFS _IOWR(r, 64, struct ipfobj) -# define SIOCIPFFL _IOWR(r, 65, int) -# define SIOCIPFFB _IOR(r, 66, int) -# define SIOCADIFR _IOW(r, 67, struct ipfobj) -# define SIOCRMIFR _IOW(r, 68, struct ipfobj) -# define SIOCSWAPA _IOR(r, 69, u_int) -# define SIOCINAFR _IOW(r, 70, struct ipfobj) -# define SIOCINIFR _IOW(r, 71, struct ipfobj) -# define SIOCFRENB _IOW(r, 72, u_int) -# define SIOCFRSYN _IOW(r, 73, u_int) -# define SIOCFRZST _IOWR(r, 74, struct ipfobj) -# define SIOCZRLST _IOWR(r, 75, struct ipfobj) -# define SIOCAUTHW _IOWR(r, 76, struct ipfobj) -# define SIOCAUTHR _IOWR(r, 77, struct ipfobj) -# define SIOCSTAT1 _IOWR(r, 78, struct ipfobj) -# define SIOCSTLCK _IOWR(r, 79, u_int) -# define SIOCSTPUT _IOWR(r, 80, struct ipfobj) -# define SIOCSTGET _IOWR(r, 81, struct ipfobj) -# define SIOCSTGSZ _IOWR(r, 82, struct ipfobj) -# define SIOCSTAT2 _IOWR(r, 83, struct ipfobj) -# define SIOCSETLG _IOWR(r, 84, int) -# define SIOCGETLG _IOWR(r, 85, int) -# define SIOCFUNCL _IOWR(r, 86, struct ipfunc_resolve) -# define SIOCIPFGETNEXT _IOWR(r, 87, struct ipfobj) -# define SIOCIPFGET _IOWR(r, 88, struct ipfobj) -# define SIOCIPFSET _IOWR(r, 89, struct ipfobj) -# define SIOCIPFL6 _IOWR(r, 90, int) -# define SIOCIPFITER _IOWR(r, 91, struct ipfobj) -# define SIOCGENITER _IOWR(r, 92, struct ipfobj) -# define SIOCGTABL _IOWR(r, 93, struct ipfobj) -# define SIOCIPFDELTOK _IOWR(r, 94, int) -# define SIOCLOOKUPITER _IOWR(r, 95, struct ipfobj) -# define SIOCGTQTAB _IOWR(r, 96, struct ipfobj) -# define SIOCMATCHFLUSH _IOWR(r, 97, struct ipfobj) -# define SIOCIPFINTERROR _IOR(r, 98, int) -#endif #define SIOCADDFR SIOCADAFR #define SIOCDELFR SIOCRMAFR #define SIOCINSFR SIOCINAFR diff --git a/sys/contrib/ipfilter/netinet/ip_lookup.h b/sys/contrib/ipfilter/netinet/ip_lookup.h index 181e1bc5d176..6b1642a91ec0 100644 --- a/sys/contrib/ipfilter/netinet/ip_lookup.h +++ b/sys/contrib/ipfilter/netinet/ip_lookup.h @@ -8,7 +8,6 @@ #ifndef __IP_LOOKUP_H__ #define __IP_LOOKUP_H__ -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCLOOKUPADDTABLE _IOWR('r', 60, struct iplookupop) # define SIOCLOOKUPDELTABLE _IOWR('r', 61, struct iplookupop) # define SIOCLOOKUPSTAT _IOWR('r', 64, struct iplookupop) @@ -18,17 +17,6 @@ # define SIOCLOOKUPADDNODEW _IOW('r', 67, struct iplookupop) # define SIOCLOOKUPDELNODE _IOWR('r', 68, struct iplookupop) # define SIOCLOOKUPDELNODEW _IOW('r', 68, struct iplookupop) -#else -# define SIOCLOOKUPADDTABLE _IOWR(r, 60, struct iplookupop) -# define SIOCLOOKUPDELTABLE _IOWR(r, 61, struct iplookupop) -# define SIOCLOOKUPSTAT _IOWR(r, 64, struct iplookupop) -# define SIOCLOOKUPSTATW _IOW(r, 64, struct iplookupop) -# define SIOCLOOKUPFLUSH _IOWR(r, 65, struct iplookupflush) -# define SIOCLOOKUPADDNODE _IOWR(r, 67, struct iplookupop) -# define SIOCLOOKUPADDNODEW _IOW(r, 67, struct iplookupop) -# define SIOCLOOKUPDELNODE _IOWR(r, 68, struct iplookupop) -# define SIOCLOOKUPDELNODEW _IOW(r, 68, struct iplookupop) -#endif #define LOOKUP_POOL_MAX (IPL_LOGSIZE) #define LOOKUP_POOL_SZ (IPL_LOGSIZE + 1) diff --git a/sys/contrib/ipfilter/netinet/ip_nat.h b/sys/contrib/ipfilter/netinet/ip_nat.h index e65b1681a5f5..e726bc926937 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.h +++ b/sys/contrib/ipfilter/netinet/ip_nat.h @@ -21,19 +21,11 @@ # endif #endif -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) #define SIOCADNAT _IOW('r', 60, struct ipfobj) #define SIOCRMNAT _IOW('r', 61, struct ipfobj) #define SIOCGNATS _IOWR('r', 62, struct ipfobj) #define SIOCGNATL _IOWR('r', 63, struct ipfobj) #define SIOCPURGENAT _IOWR('r', 100, struct ipfobj) -#else -#define SIOCADNAT _IOW(r, 60, struct ipfobj) -#define SIOCRMNAT _IOW(r, 61, struct ipfobj) -#define SIOCGNATS _IOWR(r, 62, struct ipfobj) -#define SIOCGNATL _IOWR(r, 63, struct ipfobj) -#define SIOCPURGENAT _IOWR(r, 100, struct ipfobj) -#endif #undef LARGE_NAT /* define this if you're setting up a system to NAT * LARGE numbers of networks/hosts - i.e. in the diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.h b/sys/contrib/ipfilter/netinet/ip_proxy.h index c6a77ba4ebee..3f4fc2a8af6f 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.h +++ b/sys/contrib/ipfilter/netinet/ip_proxy.h @@ -20,11 +20,7 @@ # endif #endif -#if defined(__STDC__) || defined(__GNUC__) #define SIOCPROXY _IOWR('r', 64, struct ap_control) -#else -#define SIOCPROXY _IOWR(r, 64, struct ap_control) -#endif #ifndef APR_LABELLEN #define APR_LABELLEN 16 diff --git a/sys/contrib/ipfilter/netinet/ip_scan.h b/sys/contrib/ipfilter/netinet/ip_scan.h index 99032095ba05..f15aeb844ac2 100644 --- a/sys/contrib/ipfilter/netinet/ip_scan.h +++ b/sys/contrib/ipfilter/netinet/ip_scan.h @@ -25,15 +25,9 @@ struct ip; struct ipstate; -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCADSCA _IOWR('r', 60, struct ipscan *) # define SIOCRMSCA _IOWR('r', 61, struct ipscan *) # define SIOCGSCST _IOWR('r', 62, struct ipscan *) -#else -# define SIOCADSCA _IOWR(r, 60, struct ipscan *) -# define SIOCRMSCA _IOWR(r, 61, struct ipscan *) -# define SIOCGSCST _IOWR(r, 62, struct ipscan *) -#endif struct action { int act_val; /* what to do */ diff --git a/sys/contrib/ipfilter/netinet/ip_state.h b/sys/contrib/ipfilter/netinet/ip_state.h index e765ac771538..e541cff52183 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.h +++ b/sys/contrib/ipfilter/netinet/ip_state.h @@ -12,11 +12,7 @@ #ifndef __IP_STATE_H__ #define __IP_STATE_H__ -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCDELST _IOW('r', 61, struct ipfobj) -#else -# define SIOCDELST _IOW(r, 61, struct ipfobj) -#endif struct ipscan; From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 04:31:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36D684E06E2; Sun, 31 Jan 2021 04:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSynb0nj3z4VQZ; Sun, 31 Jan 2021 04:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2A0A22294; Sun, 31 Jan 2021 04:31:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V4VE0s076377; Sun, 31 Jan 2021 04:31:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V4VExV076374; Sun, 31 Jan 2021 04:31:14 GMT (envelope-from git) Date: Sun, 31 Jan 2021 04:31:14 GMT Message-Id: <202101310431.10V4VExV076374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 35e09fbfc492 - stable/12 - MFC: 83edbc3cb54fba6b37a68270c232df7b785bd222 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 35e09fbfc492e8fac3dd7ebdb21a52942ecd5384 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 04:31:15 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=35e09fbfc492e8fac3dd7ebdb21a52942ecd5384 commit 35e09fbfc492e8fac3dd7ebdb21a52942ecd5384 Author: Cy Schubert AuthorDate: 2021-01-15 04:32:16 +0000 Commit: Cy Schubert CommitDate: 2021-01-31 04:26:58 +0000 MFC: 83edbc3cb54fba6b37a68270c232df7b785bd222 ipfilter: Retire pre-standard C support. All C compilers in 2021 support standard C and architectures that did not were retired long ago. Simplify by removing now redundant pre-standard C code. MFC after: 1 week (cherry picked from commit 83edbc3cb54fba6b37a68270c232df7b785bd222) --- contrib/ipfilter/bpf-ipf.h | 12 --------- contrib/ipfilter/ipf.h | 8 ------ contrib/ipfilter/iplang/iplang_l.l | 4 --- contrib/ipfilter/ipsend/ipsend.h | 4 --- contrib/ipfilter/ipsend/ipsopt.c | 4 --- contrib/ipfilter/kmem.h | 4 --- contrib/ipfilter/lib/debug.c | 23 +++------------- contrib/ipfilter/lib/facpri.h | 4 --- contrib/ipfilter/lib/inet_addr.c | 4 --- contrib/ipfilter/lib/kmem.c | 4 --- contrib/ipfilter/lib/kmem.h | 4 --- contrib/ipfilter/lib/verbose.c | 16 ----------- contrib/ipfilter/md5.c | 4 --- contrib/ipfilter/md5.h | 8 ------ contrib/ipfilter/opts.h | 4 --- sys/contrib/ipfilter/netinet/ip_compat.h | 12 --------- sys/contrib/ipfilter/netinet/ip_fil.h | 46 -------------------------------- sys/contrib/ipfilter/netinet/ip_lookup.h | 12 --------- sys/contrib/ipfilter/netinet/ip_nat.h | 8 ------ sys/contrib/ipfilter/netinet/ip_proxy.h | 4 --- sys/contrib/ipfilter/netinet/ip_scan.h | 6 ----- sys/contrib/ipfilter/netinet/ip_state.h | 4 --- 22 files changed, 4 insertions(+), 195 deletions(-) diff --git a/contrib/ipfilter/bpf-ipf.h b/contrib/ipfilter/bpf-ipf.h index dc2b660e2eee..a114949de6e0 100644 --- a/contrib/ipfilter/bpf-ipf.h +++ b/contrib/ipfilter/bpf-ipf.h @@ -420,25 +420,13 @@ struct bpf_insn { * Systems based on non-BSD kernels don't have ifnet's (or they don't mean * anything if it is in ) and won't work like this. */ -# if __STDC__ extern void bpf_tap(struct ifnet *, u_char *, u_int); extern void bpf_mtap(struct ifnet *, struct mbuf *); extern void bpfattach(struct ifnet *, u_int, u_int); extern void bpfilterattach(int); -# else -extern void bpf_tap(); -extern void bpf_mtap(); -extern void bpfattach(); -extern void bpfilterattach(); -# endif /* __STDC__ */ #endif /* BSD && (_KERNEL || KERNEL) */ -#if __STDC__ || defined(__cplusplus) extern int bpf_validate(struct bpf_insn *, int); extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); -#else -extern int bpf_validate(); -extern u_int bpf_filter(); -#endif /* * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h index 05dcfa4afd64..834ba83f51f0 100644 --- a/contrib/ipfilter/ipf.h +++ b/contrib/ipfilter/ipf.h @@ -73,15 +73,7 @@ #include "opts.h" #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif #ifndef U_32_T diff --git a/contrib/ipfilter/iplang/iplang_l.l b/contrib/ipfilter/iplang/iplang_l.l index 0002db151c81..e66867e2a455 100644 --- a/contrib/ipfilter/iplang/iplang_l.l +++ b/contrib/ipfilter/iplang/iplang_l.l @@ -21,11 +21,7 @@ #include "ipf.h" #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int opts; diff --git a/contrib/ipfilter/ipsend/ipsend.h b/contrib/ipfilter/ipsend/ipsend.h index f409e89c656e..22f85ff07f14 100644 --- a/contrib/ipfilter/ipsend/ipsend.h +++ b/contrib/ipfilter/ipsend/ipsend.h @@ -16,11 +16,7 @@ * */ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif #include diff --git a/contrib/ipfilter/ipsend/ipsopt.c b/contrib/ipfilter/ipsend/ipsopt.c index 7f9ab5e32d79..ce6616525ca1 100644 --- a/contrib/ipfilter/ipsend/ipsopt.c +++ b/contrib/ipfilter/ipsend/ipsopt.c @@ -27,11 +27,7 @@ static const char rcsid[] = "@(#)$Id$"; #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif diff --git a/contrib/ipfilter/kmem.h b/contrib/ipfilter/kmem.h index ce6ad56f52d9..ea21c052599f 100644 --- a/contrib/ipfilter/kmem.h +++ b/contrib/ipfilter/kmem.h @@ -11,11 +11,7 @@ #define __KMEM_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int openkmem __P((char *, char *)); extern int kmemcpy __P((char *, long, int)); diff --git a/contrib/ipfilter/lib/debug.c b/contrib/ipfilter/lib/debug.c index 02e5f5b48775..0e3276e21705 100644 --- a/contrib/ipfilter/lib/debug.c +++ b/contrib/ipfilter/lib/debug.c @@ -8,11 +8,7 @@ * $Id$ */ -#if defined(__STDC__) # include -#else -# include -#endif #include #include "ipf.h" @@ -21,14 +17,8 @@ int debuglevel = 0; -#ifdef __STDC__ -void debug(int level, char *fmt, ...) -#else -void debug(level, fmt, va_alist) - int level; - char *fmt; - va_dcl -#endif +void +debug(int level, char *fmt, ...) { va_list pvar; @@ -40,13 +30,8 @@ void debug(level, fmt, va_alist) } -#ifdef __STDC__ -void ipfkdebug(char *fmt, ...) -#else -void ipfkdebug(fmt, va_alist) - char *fmt; - va_dcl -#endif +void +ipfkdebug(char *fmt, ...) { va_list pvar; diff --git a/contrib/ipfilter/lib/facpri.h b/contrib/ipfilter/lib/facpri.h index 54ecabd6ce49..d3634e99d795 100644 --- a/contrib/ipfilter/lib/facpri.h +++ b/contrib/ipfilter/lib/facpri.h @@ -13,11 +13,7 @@ #ifndef __P # define P_DEF -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern char *fac_toname __P((int)); diff --git a/contrib/ipfilter/lib/inet_addr.c b/contrib/ipfilter/lib/inet_addr.c index 8667c2b33038..fcaefe0fc23e 100644 --- a/contrib/ipfilter/lib/inet_addr.c +++ b/contrib/ipfilter/lib/inet_addr.c @@ -66,11 +66,7 @@ static const char rcsid[] = "@(#)$Id: inet_addr.c,v 1.8.2.3 2004/12/09 19:41:20 #include #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif int inet_aton __P((const char *, struct in_addr *)); diff --git a/contrib/ipfilter/lib/kmem.c b/contrib/ipfilter/lib/kmem.c index de97512cf5d3..26252a02f0bf 100644 --- a/contrib/ipfilter/lib/kmem.c +++ b/contrib/ipfilter/lib/kmem.c @@ -30,10 +30,6 @@ #include "kmem.h" -#ifndef __STDC__ -# define const -#endif - #if !defined(lint) static const char sccsid[] = "@(#)kmem.c 1.4 1/12/96 (C) 1992 Darren Reed"; static const char rcsid[] = "@(#)$Id$"; diff --git a/contrib/ipfilter/lib/kmem.h b/contrib/ipfilter/lib/kmem.h index 1abe31a3b7fb..31cd9725cc62 100644 --- a/contrib/ipfilter/lib/kmem.h +++ b/contrib/ipfilter/lib/kmem.h @@ -11,11 +11,7 @@ #define __KMEM_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int openkmem __P((char *, char *)); extern int kmemcpy __P((char *, long, int)); diff --git a/contrib/ipfilter/lib/verbose.c b/contrib/ipfilter/lib/verbose.c index 710daab443e3..47988c084516 100644 --- a/contrib/ipfilter/lib/verbose.c +++ b/contrib/ipfilter/lib/verbose.c @@ -8,24 +8,14 @@ * $Id$ */ -#if defined(__STDC__) # include -#else -# include -#endif #include #include "ipf.h" #include "opts.h" -#if defined(__STDC__) void verbose(int level, char *fmt, ...) -#else -void verbose(level, fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list pvar; @@ -37,13 +27,7 @@ void verbose(level, fmt, va_alist) } -#if defined(__STDC__) void ipfkverbose(char *fmt, ...) -#else -void ipfkverbose(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list pvar; diff --git a/contrib/ipfilter/md5.c b/contrib/ipfilter/md5.c index 6ac639935902..d2ed954576d3 100644 --- a/contrib/ipfilter/md5.c +++ b/contrib/ipfilter/md5.c @@ -100,11 +100,7 @@ static unsigned char PADDING[64] = { (a) += (b); \ } -#ifdef __STDC__ #define UL(x) x##U -#else -#define UL(x) x -#endif /* The routine MD5Init initializes the message-digest context mdContext. All fields are set to zero. diff --git a/contrib/ipfilter/md5.h b/contrib/ipfilter/md5.h index 914df74355a0..cc09b48e8547 100644 --- a/contrib/ipfilter/md5.h +++ b/contrib/ipfilter/md5.h @@ -42,15 +42,7 @@ #if !defined(__MD5_INCLUDE__) && !defined(_SYS_MD5_H) #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif /* typedef a 32-bit type */ diff --git a/contrib/ipfilter/opts.h b/contrib/ipfilter/opts.h index 6e973186756e..17844e89ecfc 100644 --- a/contrib/ipfilter/opts.h +++ b/contrib/ipfilter/opts.h @@ -54,11 +54,7 @@ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif #if defined(sun) && !SOLARIS diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 29590298d79f..ac20b527ab34 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -12,15 +12,7 @@ #define __IP_COMPAT_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif #if defined(_KERNEL) || defined(KERNEL) || defined(__KERNEL__) @@ -63,11 +55,7 @@ #endif -# ifdef __STDC__ # define IPL_EXTERN(ep) ipl##ep -# else -# define IPL_EXTERN(ep) ipl/**/ep -# endif /* * This is a workaround for troubles on FreeBSD and OpenBSD. diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 7d70f5135da8..0c7448492464 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -31,14 +31,9 @@ #endif #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif -#if defined(__STDC__) || defined(__GNUC__) # define SIOCADAFR _IOW('r', 60, struct ipfobj) # define SIOCRMAFR _IOW('r', 61, struct ipfobj) # define SIOCSETFF _IOW('r', 62, u_int) @@ -78,47 +73,6 @@ # define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) # define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) # define SIOCIPFINTERROR _IOR('r', 98, int) -#else -# define SIOCADAFR _IOW(r, 60, struct ipfobj) -# define SIOCRMAFR _IOW(r, 61, struct ipfobj) -# define SIOCSETFF _IOW(r, 62, u_int) -# define SIOCGETFF _IOR(r, 63, u_int) -# define SIOCGETFS _IOWR(r, 64, struct ipfobj) -# define SIOCIPFFL _IOWR(r, 65, int) -# define SIOCIPFFB _IOR(r, 66, int) -# define SIOCADIFR _IOW(r, 67, struct ipfobj) -# define SIOCRMIFR _IOW(r, 68, struct ipfobj) -# define SIOCSWAPA _IOR(r, 69, u_int) -# define SIOCINAFR _IOW(r, 70, struct ipfobj) -# define SIOCINIFR _IOW(r, 71, struct ipfobj) -# define SIOCFRENB _IOW(r, 72, u_int) -# define SIOCFRSYN _IOW(r, 73, u_int) -# define SIOCFRZST _IOWR(r, 74, struct ipfobj) -# define SIOCZRLST _IOWR(r, 75, struct ipfobj) -# define SIOCAUTHW _IOWR(r, 76, struct ipfobj) -# define SIOCAUTHR _IOWR(r, 77, struct ipfobj) -# define SIOCSTAT1 _IOWR(r, 78, struct ipfobj) -# define SIOCSTLCK _IOWR(r, 79, u_int) -# define SIOCSTPUT _IOWR(r, 80, struct ipfobj) -# define SIOCSTGET _IOWR(r, 81, struct ipfobj) -# define SIOCSTGSZ _IOWR(r, 82, struct ipfobj) -# define SIOCSTAT2 _IOWR(r, 83, struct ipfobj) -# define SIOCSETLG _IOWR(r, 84, int) -# define SIOCGETLG _IOWR(r, 85, int) -# define SIOCFUNCL _IOWR(r, 86, struct ipfunc_resolve) -# define SIOCIPFGETNEXT _IOWR(r, 87, struct ipfobj) -# define SIOCIPFGET _IOWR(r, 88, struct ipfobj) -# define SIOCIPFSET _IOWR(r, 89, struct ipfobj) -# define SIOCIPFL6 _IOWR(r, 90, int) -# define SIOCIPFITER _IOWR(r, 91, struct ipfobj) -# define SIOCGENITER _IOWR(r, 92, struct ipfobj) -# define SIOCGTABL _IOWR(r, 93, struct ipfobj) -# define SIOCIPFDELTOK _IOWR(r, 94, int) -# define SIOCLOOKUPITER _IOWR(r, 95, struct ipfobj) -# define SIOCGTQTAB _IOWR(r, 96, struct ipfobj) -# define SIOCMATCHFLUSH _IOWR(r, 97, struct ipfobj) -# define SIOCIPFINTERROR _IOR(r, 98, int) -#endif #define SIOCADDFR SIOCADAFR #define SIOCDELFR SIOCRMAFR #define SIOCINSFR SIOCINAFR diff --git a/sys/contrib/ipfilter/netinet/ip_lookup.h b/sys/contrib/ipfilter/netinet/ip_lookup.h index 181e1bc5d176..6b1642a91ec0 100644 --- a/sys/contrib/ipfilter/netinet/ip_lookup.h +++ b/sys/contrib/ipfilter/netinet/ip_lookup.h @@ -8,7 +8,6 @@ #ifndef __IP_LOOKUP_H__ #define __IP_LOOKUP_H__ -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCLOOKUPADDTABLE _IOWR('r', 60, struct iplookupop) # define SIOCLOOKUPDELTABLE _IOWR('r', 61, struct iplookupop) # define SIOCLOOKUPSTAT _IOWR('r', 64, struct iplookupop) @@ -18,17 +17,6 @@ # define SIOCLOOKUPADDNODEW _IOW('r', 67, struct iplookupop) # define SIOCLOOKUPDELNODE _IOWR('r', 68, struct iplookupop) # define SIOCLOOKUPDELNODEW _IOW('r', 68, struct iplookupop) -#else -# define SIOCLOOKUPADDTABLE _IOWR(r, 60, struct iplookupop) -# define SIOCLOOKUPDELTABLE _IOWR(r, 61, struct iplookupop) -# define SIOCLOOKUPSTAT _IOWR(r, 64, struct iplookupop) -# define SIOCLOOKUPSTATW _IOW(r, 64, struct iplookupop) -# define SIOCLOOKUPFLUSH _IOWR(r, 65, struct iplookupflush) -# define SIOCLOOKUPADDNODE _IOWR(r, 67, struct iplookupop) -# define SIOCLOOKUPADDNODEW _IOW(r, 67, struct iplookupop) -# define SIOCLOOKUPDELNODE _IOWR(r, 68, struct iplookupop) -# define SIOCLOOKUPDELNODEW _IOW(r, 68, struct iplookupop) -#endif #define LOOKUP_POOL_MAX (IPL_LOGSIZE) #define LOOKUP_POOL_SZ (IPL_LOGSIZE + 1) diff --git a/sys/contrib/ipfilter/netinet/ip_nat.h b/sys/contrib/ipfilter/netinet/ip_nat.h index e65b1681a5f5..e726bc926937 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.h +++ b/sys/contrib/ipfilter/netinet/ip_nat.h @@ -21,19 +21,11 @@ # endif #endif -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) #define SIOCADNAT _IOW('r', 60, struct ipfobj) #define SIOCRMNAT _IOW('r', 61, struct ipfobj) #define SIOCGNATS _IOWR('r', 62, struct ipfobj) #define SIOCGNATL _IOWR('r', 63, struct ipfobj) #define SIOCPURGENAT _IOWR('r', 100, struct ipfobj) -#else -#define SIOCADNAT _IOW(r, 60, struct ipfobj) -#define SIOCRMNAT _IOW(r, 61, struct ipfobj) -#define SIOCGNATS _IOWR(r, 62, struct ipfobj) -#define SIOCGNATL _IOWR(r, 63, struct ipfobj) -#define SIOCPURGENAT _IOWR(r, 100, struct ipfobj) -#endif #undef LARGE_NAT /* define this if you're setting up a system to NAT * LARGE numbers of networks/hosts - i.e. in the diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.h b/sys/contrib/ipfilter/netinet/ip_proxy.h index c6a77ba4ebee..3f4fc2a8af6f 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.h +++ b/sys/contrib/ipfilter/netinet/ip_proxy.h @@ -20,11 +20,7 @@ # endif #endif -#if defined(__STDC__) || defined(__GNUC__) #define SIOCPROXY _IOWR('r', 64, struct ap_control) -#else -#define SIOCPROXY _IOWR(r, 64, struct ap_control) -#endif #ifndef APR_LABELLEN #define APR_LABELLEN 16 diff --git a/sys/contrib/ipfilter/netinet/ip_scan.h b/sys/contrib/ipfilter/netinet/ip_scan.h index 99032095ba05..f15aeb844ac2 100644 --- a/sys/contrib/ipfilter/netinet/ip_scan.h +++ b/sys/contrib/ipfilter/netinet/ip_scan.h @@ -25,15 +25,9 @@ struct ip; struct ipstate; -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCADSCA _IOWR('r', 60, struct ipscan *) # define SIOCRMSCA _IOWR('r', 61, struct ipscan *) # define SIOCGSCST _IOWR('r', 62, struct ipscan *) -#else -# define SIOCADSCA _IOWR(r, 60, struct ipscan *) -# define SIOCRMSCA _IOWR(r, 61, struct ipscan *) -# define SIOCGSCST _IOWR(r, 62, struct ipscan *) -#endif struct action { int act_val; /* what to do */ diff --git a/sys/contrib/ipfilter/netinet/ip_state.h b/sys/contrib/ipfilter/netinet/ip_state.h index e765ac771538..e541cff52183 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.h +++ b/sys/contrib/ipfilter/netinet/ip_state.h @@ -12,11 +12,7 @@ #ifndef __IP_STATE_H__ #define __IP_STATE_H__ -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCDELST _IOW('r', 61, struct ipfobj) -#else -# define SIOCDELST _IOW(r, 61, struct ipfobj) -#endif struct ipscan; From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 04:31:14 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DB474E0AE0; Sun, 31 Jan 2021 04:31:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSynY6NjXz4VNT; Sun, 31 Jan 2021 04:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE9CB22213; Sun, 31 Jan 2021 04:31:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V4VDKF076345; Sun, 31 Jan 2021 04:31:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V4VDuj076344; Sun, 31 Jan 2021 04:31:13 GMT (envelope-from git) Date: Sun, 31 Jan 2021 04:31:13 GMT Message-Id: <202101310431.10V4VDuj076344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 5ab5d8fc2cdf - stable/11 - MFC 0e01ea872ee475d7aef11d21588504e2ef4eb32c: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 5ab5d8fc2cdf65376cbc00fad69313a60e23bf68 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 04:31:14 -0000 The branch stable/11 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5ab5d8fc2cdf65376cbc00fad69313a60e23bf68 commit 5ab5d8fc2cdf65376cbc00fad69313a60e23bf68 Author: Cy Schubert AuthorDate: 2021-01-28 05:52:08 +0000 Commit: Cy Schubert CommitDate: 2021-01-31 04:29:46 +0000 MFC 0e01ea872ee475d7aef11d21588504e2ef4eb32c: Fix a typo. (cherry picked from commit 0e01ea872ee475d7aef11d21588504e2ef4eb32c) --- sys/i386/conf/GENERIC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 5193c4e8866f..2705ff2ee0af 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -360,7 +360,7 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device -# HyperV drivers and enchancement support +# HyperV drivers and enhancement support device hyperv # HyperV drivers # Xen HVM Guest Optimizations From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 04:31:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE24B4E0AE3; Sun, 31 Jan 2021 04:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSynd36PBz4VLH; Sun, 31 Jan 2021 04:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D27122295; Sun, 31 Jan 2021 04:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V4VHTg076431; Sun, 31 Jan 2021 04:31:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V4VHsf076430; Sun, 31 Jan 2021 04:31:17 GMT (envelope-from git) Date: Sun, 31 Jan 2021 04:31:17 GMT Message-Id: <202101310431.10V4VHsf076430@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 514caf57cda8 - stable/13 - MFC: 83edbc3cb54fba6b37a68270c232df7b785bd222 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 514caf57cda8f2b95a7f32575519fdd18f0cae0a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 04:31:19 -0000 The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=514caf57cda8f2b95a7f32575519fdd18f0cae0a commit 514caf57cda8f2b95a7f32575519fdd18f0cae0a Author: Cy Schubert AuthorDate: 2021-01-15 04:32:16 +0000 Commit: Cy Schubert CommitDate: 2021-01-31 04:28:06 +0000 MFC: 83edbc3cb54fba6b37a68270c232df7b785bd222 ipfilter: Retire pre-standard C support. All C compilers in 2021 support standard C and architectures that did not were retired long ago. Simplify by removing now redundant pre-standard C code. (cherry picked from commit 83edbc3cb54fba6b37a68270c232df7b785bd222) --- contrib/ipfilter/bpf-ipf.h | 12 --------- contrib/ipfilter/ipf.h | 8 ------ contrib/ipfilter/iplang/iplang_l.l | 4 --- contrib/ipfilter/ipsend/ipsend.h | 4 --- contrib/ipfilter/ipsend/ipsopt.c | 4 --- contrib/ipfilter/kmem.h | 4 --- contrib/ipfilter/lib/debug.c | 23 +++------------- contrib/ipfilter/lib/facpri.h | 4 --- contrib/ipfilter/lib/inet_addr.c | 4 --- contrib/ipfilter/lib/kmem.c | 4 --- contrib/ipfilter/lib/kmem.h | 4 --- contrib/ipfilter/lib/verbose.c | 16 ----------- contrib/ipfilter/md5.c | 4 --- contrib/ipfilter/md5.h | 8 ------ contrib/ipfilter/opts.h | 4 --- sys/contrib/ipfilter/netinet/ip_compat.h | 12 --------- sys/contrib/ipfilter/netinet/ip_fil.h | 46 -------------------------------- sys/contrib/ipfilter/netinet/ip_lookup.h | 12 --------- sys/contrib/ipfilter/netinet/ip_nat.h | 8 ------ sys/contrib/ipfilter/netinet/ip_proxy.h | 4 --- sys/contrib/ipfilter/netinet/ip_scan.h | 6 ----- sys/contrib/ipfilter/netinet/ip_state.h | 4 --- 22 files changed, 4 insertions(+), 195 deletions(-) diff --git a/contrib/ipfilter/bpf-ipf.h b/contrib/ipfilter/bpf-ipf.h index dc2b660e2eee..a114949de6e0 100644 --- a/contrib/ipfilter/bpf-ipf.h +++ b/contrib/ipfilter/bpf-ipf.h @@ -420,25 +420,13 @@ struct bpf_insn { * Systems based on non-BSD kernels don't have ifnet's (or they don't mean * anything if it is in ) and won't work like this. */ -# if __STDC__ extern void bpf_tap(struct ifnet *, u_char *, u_int); extern void bpf_mtap(struct ifnet *, struct mbuf *); extern void bpfattach(struct ifnet *, u_int, u_int); extern void bpfilterattach(int); -# else -extern void bpf_tap(); -extern void bpf_mtap(); -extern void bpfattach(); -extern void bpfilterattach(); -# endif /* __STDC__ */ #endif /* BSD && (_KERNEL || KERNEL) */ -#if __STDC__ || defined(__cplusplus) extern int bpf_validate(struct bpf_insn *, int); extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int); -#else -extern int bpf_validate(); -extern u_int bpf_filter(); -#endif /* * Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST). diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h index 05dcfa4afd64..834ba83f51f0 100644 --- a/contrib/ipfilter/ipf.h +++ b/contrib/ipfilter/ipf.h @@ -73,15 +73,7 @@ #include "opts.h" #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif #ifndef U_32_T diff --git a/contrib/ipfilter/iplang/iplang_l.l b/contrib/ipfilter/iplang/iplang_l.l index 0002db151c81..e66867e2a455 100644 --- a/contrib/ipfilter/iplang/iplang_l.l +++ b/contrib/ipfilter/iplang/iplang_l.l @@ -21,11 +21,7 @@ #include "ipf.h" #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int opts; diff --git a/contrib/ipfilter/ipsend/ipsend.h b/contrib/ipfilter/ipsend/ipsend.h index f409e89c656e..22f85ff07f14 100644 --- a/contrib/ipfilter/ipsend/ipsend.h +++ b/contrib/ipfilter/ipsend/ipsend.h @@ -16,11 +16,7 @@ * */ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif #include diff --git a/contrib/ipfilter/ipsend/ipsopt.c b/contrib/ipfilter/ipsend/ipsopt.c index 7f9ab5e32d79..ce6616525ca1 100644 --- a/contrib/ipfilter/ipsend/ipsopt.c +++ b/contrib/ipfilter/ipsend/ipsopt.c @@ -27,11 +27,7 @@ static const char rcsid[] = "@(#)$Id$"; #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif diff --git a/contrib/ipfilter/kmem.h b/contrib/ipfilter/kmem.h index ce6ad56f52d9..ea21c052599f 100644 --- a/contrib/ipfilter/kmem.h +++ b/contrib/ipfilter/kmem.h @@ -11,11 +11,7 @@ #define __KMEM_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int openkmem __P((char *, char *)); extern int kmemcpy __P((char *, long, int)); diff --git a/contrib/ipfilter/lib/debug.c b/contrib/ipfilter/lib/debug.c index 02e5f5b48775..0e3276e21705 100644 --- a/contrib/ipfilter/lib/debug.c +++ b/contrib/ipfilter/lib/debug.c @@ -8,11 +8,7 @@ * $Id$ */ -#if defined(__STDC__) # include -#else -# include -#endif #include #include "ipf.h" @@ -21,14 +17,8 @@ int debuglevel = 0; -#ifdef __STDC__ -void debug(int level, char *fmt, ...) -#else -void debug(level, fmt, va_alist) - int level; - char *fmt; - va_dcl -#endif +void +debug(int level, char *fmt, ...) { va_list pvar; @@ -40,13 +30,8 @@ void debug(level, fmt, va_alist) } -#ifdef __STDC__ -void ipfkdebug(char *fmt, ...) -#else -void ipfkdebug(fmt, va_alist) - char *fmt; - va_dcl -#endif +void +ipfkdebug(char *fmt, ...) { va_list pvar; diff --git a/contrib/ipfilter/lib/facpri.h b/contrib/ipfilter/lib/facpri.h index 54ecabd6ce49..d3634e99d795 100644 --- a/contrib/ipfilter/lib/facpri.h +++ b/contrib/ipfilter/lib/facpri.h @@ -13,11 +13,7 @@ #ifndef __P # define P_DEF -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern char *fac_toname __P((int)); diff --git a/contrib/ipfilter/lib/inet_addr.c b/contrib/ipfilter/lib/inet_addr.c index 8667c2b33038..fcaefe0fc23e 100644 --- a/contrib/ipfilter/lib/inet_addr.c +++ b/contrib/ipfilter/lib/inet_addr.c @@ -66,11 +66,7 @@ static const char rcsid[] = "@(#)$Id: inet_addr.c,v 1.8.2.3 2004/12/09 19:41:20 #include #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif int inet_aton __P((const char *, struct in_addr *)); diff --git a/contrib/ipfilter/lib/kmem.c b/contrib/ipfilter/lib/kmem.c index de97512cf5d3..26252a02f0bf 100644 --- a/contrib/ipfilter/lib/kmem.c +++ b/contrib/ipfilter/lib/kmem.c @@ -30,10 +30,6 @@ #include "kmem.h" -#ifndef __STDC__ -# define const -#endif - #if !defined(lint) static const char sccsid[] = "@(#)kmem.c 1.4 1/12/96 (C) 1992 Darren Reed"; static const char rcsid[] = "@(#)$Id$"; diff --git a/contrib/ipfilter/lib/kmem.h b/contrib/ipfilter/lib/kmem.h index 1abe31a3b7fb..31cd9725cc62 100644 --- a/contrib/ipfilter/lib/kmem.h +++ b/contrib/ipfilter/lib/kmem.h @@ -11,11 +11,7 @@ #define __KMEM_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif extern int openkmem __P((char *, char *)); extern int kmemcpy __P((char *, long, int)); diff --git a/contrib/ipfilter/lib/verbose.c b/contrib/ipfilter/lib/verbose.c index 710daab443e3..47988c084516 100644 --- a/contrib/ipfilter/lib/verbose.c +++ b/contrib/ipfilter/lib/verbose.c @@ -8,24 +8,14 @@ * $Id$ */ -#if defined(__STDC__) # include -#else -# include -#endif #include #include "ipf.h" #include "opts.h" -#if defined(__STDC__) void verbose(int level, char *fmt, ...) -#else -void verbose(level, fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list pvar; @@ -37,13 +27,7 @@ void verbose(level, fmt, va_alist) } -#if defined(__STDC__) void ipfkverbose(char *fmt, ...) -#else -void ipfkverbose(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list pvar; diff --git a/contrib/ipfilter/md5.c b/contrib/ipfilter/md5.c index 6ac639935902..d2ed954576d3 100644 --- a/contrib/ipfilter/md5.c +++ b/contrib/ipfilter/md5.c @@ -100,11 +100,7 @@ static unsigned char PADDING[64] = { (a) += (b); \ } -#ifdef __STDC__ #define UL(x) x##U -#else -#define UL(x) x -#endif /* The routine MD5Init initializes the message-digest context mdContext. All fields are set to zero. diff --git a/contrib/ipfilter/md5.h b/contrib/ipfilter/md5.h index 914df74355a0..cc09b48e8547 100644 --- a/contrib/ipfilter/md5.h +++ b/contrib/ipfilter/md5.h @@ -42,15 +42,7 @@ #if !defined(__MD5_INCLUDE__) && !defined(_SYS_MD5_H) #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif /* typedef a 32-bit type */ diff --git a/contrib/ipfilter/opts.h b/contrib/ipfilter/opts.h index 6e973186756e..17844e89ecfc 100644 --- a/contrib/ipfilter/opts.h +++ b/contrib/ipfilter/opts.h @@ -54,11 +54,7 @@ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif #if defined(sun) && !SOLARIS diff --git a/sys/contrib/ipfilter/netinet/ip_compat.h b/sys/contrib/ipfilter/netinet/ip_compat.h index 29590298d79f..ac20b527ab34 100644 --- a/sys/contrib/ipfilter/netinet/ip_compat.h +++ b/sys/contrib/ipfilter/netinet/ip_compat.h @@ -12,15 +12,7 @@ #define __IP_COMPAT_H__ #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif -#endif -#ifndef __STDC__ -# undef const -# define const #endif #if defined(_KERNEL) || defined(KERNEL) || defined(__KERNEL__) @@ -63,11 +55,7 @@ #endif -# ifdef __STDC__ # define IPL_EXTERN(ep) ipl##ep -# else -# define IPL_EXTERN(ep) ipl/**/ep -# endif /* * This is a workaround for troubles on FreeBSD and OpenBSD. diff --git a/sys/contrib/ipfilter/netinet/ip_fil.h b/sys/contrib/ipfilter/netinet/ip_fil.h index 7d70f5135da8..0c7448492464 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.h +++ b/sys/contrib/ipfilter/netinet/ip_fil.h @@ -31,14 +31,9 @@ #endif #ifndef __P -# ifdef __STDC__ # define __P(x) x -# else -# define __P(x) () -# endif #endif -#if defined(__STDC__) || defined(__GNUC__) # define SIOCADAFR _IOW('r', 60, struct ipfobj) # define SIOCRMAFR _IOW('r', 61, struct ipfobj) # define SIOCSETFF _IOW('r', 62, u_int) @@ -78,47 +73,6 @@ # define SIOCGTQTAB _IOWR('r', 96, struct ipfobj) # define SIOCMATCHFLUSH _IOWR('r', 97, struct ipfobj) # define SIOCIPFINTERROR _IOR('r', 98, int) -#else -# define SIOCADAFR _IOW(r, 60, struct ipfobj) -# define SIOCRMAFR _IOW(r, 61, struct ipfobj) -# define SIOCSETFF _IOW(r, 62, u_int) -# define SIOCGETFF _IOR(r, 63, u_int) -# define SIOCGETFS _IOWR(r, 64, struct ipfobj) -# define SIOCIPFFL _IOWR(r, 65, int) -# define SIOCIPFFB _IOR(r, 66, int) -# define SIOCADIFR _IOW(r, 67, struct ipfobj) -# define SIOCRMIFR _IOW(r, 68, struct ipfobj) -# define SIOCSWAPA _IOR(r, 69, u_int) -# define SIOCINAFR _IOW(r, 70, struct ipfobj) -# define SIOCINIFR _IOW(r, 71, struct ipfobj) -# define SIOCFRENB _IOW(r, 72, u_int) -# define SIOCFRSYN _IOW(r, 73, u_int) -# define SIOCFRZST _IOWR(r, 74, struct ipfobj) -# define SIOCZRLST _IOWR(r, 75, struct ipfobj) -# define SIOCAUTHW _IOWR(r, 76, struct ipfobj) -# define SIOCAUTHR _IOWR(r, 77, struct ipfobj) -# define SIOCSTAT1 _IOWR(r, 78, struct ipfobj) -# define SIOCSTLCK _IOWR(r, 79, u_int) -# define SIOCSTPUT _IOWR(r, 80, struct ipfobj) -# define SIOCSTGET _IOWR(r, 81, struct ipfobj) -# define SIOCSTGSZ _IOWR(r, 82, struct ipfobj) -# define SIOCSTAT2 _IOWR(r, 83, struct ipfobj) -# define SIOCSETLG _IOWR(r, 84, int) -# define SIOCGETLG _IOWR(r, 85, int) -# define SIOCFUNCL _IOWR(r, 86, struct ipfunc_resolve) -# define SIOCIPFGETNEXT _IOWR(r, 87, struct ipfobj) -# define SIOCIPFGET _IOWR(r, 88, struct ipfobj) -# define SIOCIPFSET _IOWR(r, 89, struct ipfobj) -# define SIOCIPFL6 _IOWR(r, 90, int) -# define SIOCIPFITER _IOWR(r, 91, struct ipfobj) -# define SIOCGENITER _IOWR(r, 92, struct ipfobj) -# define SIOCGTABL _IOWR(r, 93, struct ipfobj) -# define SIOCIPFDELTOK _IOWR(r, 94, int) -# define SIOCLOOKUPITER _IOWR(r, 95, struct ipfobj) -# define SIOCGTQTAB _IOWR(r, 96, struct ipfobj) -# define SIOCMATCHFLUSH _IOWR(r, 97, struct ipfobj) -# define SIOCIPFINTERROR _IOR(r, 98, int) -#endif #define SIOCADDFR SIOCADAFR #define SIOCDELFR SIOCRMAFR #define SIOCINSFR SIOCINAFR diff --git a/sys/contrib/ipfilter/netinet/ip_lookup.h b/sys/contrib/ipfilter/netinet/ip_lookup.h index 181e1bc5d176..6b1642a91ec0 100644 --- a/sys/contrib/ipfilter/netinet/ip_lookup.h +++ b/sys/contrib/ipfilter/netinet/ip_lookup.h @@ -8,7 +8,6 @@ #ifndef __IP_LOOKUP_H__ #define __IP_LOOKUP_H__ -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCLOOKUPADDTABLE _IOWR('r', 60, struct iplookupop) # define SIOCLOOKUPDELTABLE _IOWR('r', 61, struct iplookupop) # define SIOCLOOKUPSTAT _IOWR('r', 64, struct iplookupop) @@ -18,17 +17,6 @@ # define SIOCLOOKUPADDNODEW _IOW('r', 67, struct iplookupop) # define SIOCLOOKUPDELNODE _IOWR('r', 68, struct iplookupop) # define SIOCLOOKUPDELNODEW _IOW('r', 68, struct iplookupop) -#else -# define SIOCLOOKUPADDTABLE _IOWR(r, 60, struct iplookupop) -# define SIOCLOOKUPDELTABLE _IOWR(r, 61, struct iplookupop) -# define SIOCLOOKUPSTAT _IOWR(r, 64, struct iplookupop) -# define SIOCLOOKUPSTATW _IOW(r, 64, struct iplookupop) -# define SIOCLOOKUPFLUSH _IOWR(r, 65, struct iplookupflush) -# define SIOCLOOKUPADDNODE _IOWR(r, 67, struct iplookupop) -# define SIOCLOOKUPADDNODEW _IOW(r, 67, struct iplookupop) -# define SIOCLOOKUPDELNODE _IOWR(r, 68, struct iplookupop) -# define SIOCLOOKUPDELNODEW _IOW(r, 68, struct iplookupop) -#endif #define LOOKUP_POOL_MAX (IPL_LOGSIZE) #define LOOKUP_POOL_SZ (IPL_LOGSIZE + 1) diff --git a/sys/contrib/ipfilter/netinet/ip_nat.h b/sys/contrib/ipfilter/netinet/ip_nat.h index e65b1681a5f5..e726bc926937 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.h +++ b/sys/contrib/ipfilter/netinet/ip_nat.h @@ -21,19 +21,11 @@ # endif #endif -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) #define SIOCADNAT _IOW('r', 60, struct ipfobj) #define SIOCRMNAT _IOW('r', 61, struct ipfobj) #define SIOCGNATS _IOWR('r', 62, struct ipfobj) #define SIOCGNATL _IOWR('r', 63, struct ipfobj) #define SIOCPURGENAT _IOWR('r', 100, struct ipfobj) -#else -#define SIOCADNAT _IOW(r, 60, struct ipfobj) -#define SIOCRMNAT _IOW(r, 61, struct ipfobj) -#define SIOCGNATS _IOWR(r, 62, struct ipfobj) -#define SIOCGNATL _IOWR(r, 63, struct ipfobj) -#define SIOCPURGENAT _IOWR(r, 100, struct ipfobj) -#endif #undef LARGE_NAT /* define this if you're setting up a system to NAT * LARGE numbers of networks/hosts - i.e. in the diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.h b/sys/contrib/ipfilter/netinet/ip_proxy.h index c6a77ba4ebee..3f4fc2a8af6f 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.h +++ b/sys/contrib/ipfilter/netinet/ip_proxy.h @@ -20,11 +20,7 @@ # endif #endif -#if defined(__STDC__) || defined(__GNUC__) #define SIOCPROXY _IOWR('r', 64, struct ap_control) -#else -#define SIOCPROXY _IOWR(r, 64, struct ap_control) -#endif #ifndef APR_LABELLEN #define APR_LABELLEN 16 diff --git a/sys/contrib/ipfilter/netinet/ip_scan.h b/sys/contrib/ipfilter/netinet/ip_scan.h index 99032095ba05..f15aeb844ac2 100644 --- a/sys/contrib/ipfilter/netinet/ip_scan.h +++ b/sys/contrib/ipfilter/netinet/ip_scan.h @@ -25,15 +25,9 @@ struct ip; struct ipstate; -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCADSCA _IOWR('r', 60, struct ipscan *) # define SIOCRMSCA _IOWR('r', 61, struct ipscan *) # define SIOCGSCST _IOWR('r', 62, struct ipscan *) -#else -# define SIOCADSCA _IOWR(r, 60, struct ipscan *) -# define SIOCRMSCA _IOWR(r, 61, struct ipscan *) -# define SIOCGSCST _IOWR(r, 62, struct ipscan *) -#endif struct action { int act_val; /* what to do */ diff --git a/sys/contrib/ipfilter/netinet/ip_state.h b/sys/contrib/ipfilter/netinet/ip_state.h index e765ac771538..e541cff52183 100644 --- a/sys/contrib/ipfilter/netinet/ip_state.h +++ b/sys/contrib/ipfilter/netinet/ip_state.h @@ -12,11 +12,7 @@ #ifndef __IP_STATE_H__ #define __IP_STATE_H__ -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) # define SIOCDELST _IOW('r', 61, struct ipfobj) -#else -# define SIOCDELST _IOW(r, 61, struct ipfobj) -#endif struct ipscan; From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 04:31:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80EE54E0B67; Sun, 31 Jan 2021 04:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSynf5BQtz4VXW; Sun, 31 Jan 2021 04:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55FA52233B; Sun, 31 Jan 2021 04:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V4VIuA076449; Sun, 31 Jan 2021 04:31:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V4VIkm076448; Sun, 31 Jan 2021 04:31:18 GMT (envelope-from git) Date: Sun, 31 Jan 2021 04:31:18 GMT Message-Id: <202101310431.10V4VIkm076448@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 2ef3f7f5c356 - stable/13 - MFC 0e01ea872ee475d7aef11d21588504e2ef4eb32c: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2ef3f7f5c356496bbfbb71b26d4a9d9415f3b8c5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 04:31:19 -0000 The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2ef3f7f5c356496bbfbb71b26d4a9d9415f3b8c5 commit 2ef3f7f5c356496bbfbb71b26d4a9d9415f3b8c5 Author: Cy Schubert AuthorDate: 2021-01-28 05:52:08 +0000 Commit: Cy Schubert CommitDate: 2021-01-31 04:28:06 +0000 MFC 0e01ea872ee475d7aef11d21588504e2ef4eb32c: Fix a typo. (cherry picked from commit 0e01ea872ee475d7aef11d21588504e2ef4eb32c) --- sys/i386/conf/GENERIC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index f54902250152..702f6d64223c 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -327,7 +327,7 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device -# HyperV drivers and enchancement support +# HyperV drivers and enhancement support device hyperv # HyperV drivers # Xen HVM Guest Optimizations From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 04:31:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C4094E06E3; Sun, 31 Jan 2021 04:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DSync3Gzqz4V82; Sun, 31 Jan 2021 04:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33B0022125; Sun, 31 Jan 2021 04:31:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V4VG0O076397; Sun, 31 Jan 2021 04:31:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V4VGhG076396; Sun, 31 Jan 2021 04:31:16 GMT (envelope-from git) Date: Sun, 31 Jan 2021 04:31:16 GMT Message-Id: <202101310431.10V4VGhG076396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 2df415116eee - stable/12 - MFC 0e01ea872ee475d7aef11d21588504e2ef4eb32c: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2df415116eee92232f775cd29ff2c30ff555c201 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 04:31:17 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2df415116eee92232f775cd29ff2c30ff555c201 commit 2df415116eee92232f775cd29ff2c30ff555c201 Author: Cy Schubert AuthorDate: 2021-01-28 05:52:08 +0000 Commit: Cy Schubert CommitDate: 2021-01-31 04:27:06 +0000 MFC 0e01ea872ee475d7aef11d21588504e2ef4eb32c: Fix a typo. (cherry picked from commit 0e01ea872ee475d7aef11d21588504e2ef4eb32c) --- sys/i386/conf/GENERIC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 5de8653c6191..dc7c284bd1ae 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -352,7 +352,7 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device -# HyperV drivers and enchancement support +# HyperV drivers and enhancement support device hyperv # HyperV drivers # Xen HVM Guest Optimizations From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 08:47:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4AF74E7DEE; Sun, 31 Jan 2021 08:47:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DT4Tc4Kn9z4kyB; Sun, 31 Jan 2021 08:47:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 877762537B; Sun, 31 Jan 2021 08:47:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V8lm02004714; Sun, 31 Jan 2021 08:47:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V8lmfW004713; Sun, 31 Jan 2021 08:47:48 GMT (envelope-from git) Date: Sun, 31 Jan 2021 08:47:48 GMT Message-Id: <202101310847.10V8lmfW004713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 7754ef5a3724 - stable/13 - axgbe: fix some link related issues MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7754ef5a37245271c2a6832ad0a1289e25abff09 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 08:47:48 -0000 The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=7754ef5a37245271c2a6832ad0a1289e25abff09 commit 7754ef5a37245271c2a6832ad0a1289e25abff09 Author: Vincenzo Maffione AuthorDate: 2021-01-23 13:44:24 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-31 08:47:36 +0000 axgbe: fix some link related issues By default, axgbe driver does a receiver reset after predefined number of retries for the link to come up. However, this receiver reset doesn't always suffice, due to an hardware issue. In that case, as a workaround, a complete phy reset is necessary. This patch introduces a sysctl that can be set to 1 to let the driver reset the phy completely, rather than just doing receiver reset. The workaround will be removed once the issue is fixed by means of firmware update. This patch also fixes the handling of the direct attach cables properly. Submitted by: rajesh1.kumar_amd.com Differential Revision: https://reviews.freebsd.org/D28266 (cherry picked from commit bfd75d45571958398a043517060d8c3d352e7dbd) --- sys/dev/axgbe/xgbe-phy-v2.c | 26 ++++++++++++++++++++------ sys/dev/axgbe/xgbe-sysctl.c | 4 ++++ sys/dev/axgbe/xgbe.h | 1 + 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/sys/dev/axgbe/xgbe-phy-v2.c b/sys/dev/axgbe/xgbe-phy-v2.c index 5fb6e960eab5..df8a75a145b9 100644 --- a/sys/dev/axgbe/xgbe-phy-v2.c +++ b/sys/dev/axgbe/xgbe-phy-v2.c @@ -213,6 +213,9 @@ enum xgbe_sfp_speed { #define XGBE_SFP_BASE_EXT_ID 1 #define XGBE_SFP_EXT_ID_SFP 0x04 +#define XGBE_SFP_BASE_CV 2 +#define XGBE_SFP_BASE_CV_CP 0x21 + #define XGBE_SFP_BASE_10GBE_CC 3 #define XGBE_SFP_BASE_10GBE_CC_SR BIT(4) #define XGBE_SFP_BASE_10GBE_CC_LR BIT(5) @@ -380,6 +383,7 @@ struct xgbe_phy_data { }; static enum xgbe_an_mode xgbe_phy_an_mode(struct xgbe_prv_data *pdata); +static int xgbe_phy_reset(struct xgbe_prv_data *pdata); static int xgbe_phy_i2c_xfer(struct xgbe_prv_data *pdata, struct xgbe_i2c_op *i2c_op) @@ -1209,8 +1213,16 @@ xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata) } else phy_data->sfp_cable = XGBE_SFP_CABLE_ACTIVE; - /* Determine the type of SFP */ - if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR) + /* + * Determine the type of SFP. Certain 10G SFP+ modules read as + * 1000BASE-CX. To prevent 10G DAC cables to be recognized as + * 1G, we first check if it is a DAC and the bitrate is 10G. + */ + if (((sfp_base[XGBE_SFP_BASE_CV] & XGBE_SFP_BASE_CV_CP) || + (phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE)) && + xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000)) + phy_data->sfp_base = XGBE_SFP_BASE_10000_CR; + else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR) phy_data->sfp_base = XGBE_SFP_BASE_10000_SR; else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_LR) phy_data->sfp_base = XGBE_SFP_BASE_10000_LR; @@ -1226,9 +1238,6 @@ xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata) phy_data->sfp_base = XGBE_SFP_BASE_1000_CX; else if (sfp_base[XGBE_SFP_BASE_1GBE_CC] & XGBE_SFP_BASE_1GBE_CC_T) phy_data->sfp_base = XGBE_SFP_BASE_1000_T; - else if ((phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE) && - xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000)) - phy_data->sfp_base = XGBE_SFP_BASE_10000_CR; switch (phy_data->sfp_base) { case XGBE_SFP_BASE_1000_T: @@ -2879,7 +2888,12 @@ xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart) axgbe_printf(1, "ENTERED RRC: rrc_count: %d\n", phy_data->rrc_count); phy_data->rrc_count = 0; - xgbe_phy_rrc(pdata); + if (pdata->link_workaround) { + ret = xgbe_phy_reset(pdata); + if (ret) + axgbe_error("Error resetting phy\n"); + } else + xgbe_phy_rrc(pdata); } return (0); diff --git a/sys/dev/axgbe/xgbe-sysctl.c b/sys/dev/axgbe/xgbe-sysctl.c index a3e777e0ca26..f7998b943b16 100644 --- a/sys/dev/axgbe/xgbe-sysctl.c +++ b/sys/dev/axgbe/xgbe-sysctl.c @@ -1618,6 +1618,10 @@ axgbe_sysctl_init(struct xgbe_prv_data *pdata) CTLFLAG_RDTUN, &pdata->sph_enable, 1, "shows the split header feature state (1 - enable, 0 - disable"); + SYSCTL_ADD_UINT(clist, top, OID_AUTO, "link_workaround", + CTLFLAG_RWTUN, &pdata->link_workaround, 0, + "enable the workaround for link issue in coming up"); + SYSCTL_ADD_PROC(clist, top, OID_AUTO, "xgmac_register", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, pdata, 0, sysctl_xgmac_reg_addr_handler, "IU", diff --git a/sys/dev/axgbe/xgbe.h b/sys/dev/axgbe/xgbe.h index 766c0c6f551a..85b4c0c5c5d0 100644 --- a/sys/dev/axgbe/xgbe.h +++ b/sys/dev/axgbe/xgbe.h @@ -1302,6 +1302,7 @@ struct xgbe_prv_data { * This requires a complete restart. */ unsigned int sph_enable; + unsigned int link_workaround; }; struct axgbe_if_softc { From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 08:51:42 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E544D4E7FD2; Sun, 31 Jan 2021 08:51:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DT4Z66Csfz4l5B; Sun, 31 Jan 2021 08:51:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7F042571B; Sun, 31 Jan 2021 08:51:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V8pgH1016556; Sun, 31 Jan 2021 08:51:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V8pgI1016555; Sun, 31 Jan 2021 08:51:42 GMT (envelope-from git) Date: Sun, 31 Jan 2021 08:51:42 GMT Message-Id: <202101310851.10V8pgI1016555@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 9c5418f00836 - stable/12 - iflib: netmap: add support for NS_MOREFRAG MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9c5418f00836b997561e3956fc18b7ecc7eccdc1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 08:51:43 -0000 The branch stable/12 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=9c5418f00836b997561e3956fc18b7ecc7eccdc1 commit 9c5418f00836b997561e3956fc18b7ecc7eccdc1 Author: Vincenzo Maffione AuthorDate: 2021-01-24 21:12:41 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-31 08:51:36 +0000 iflib: netmap: add support for NS_MOREFRAG The NS_MOREFRAG flag can be set in a netmap slot to represent a multi-fragment packet. Only the last fragment of a packet does not have the flag set. On TX rings, the flag may be set by the userspace application. The kernel will look at the flag and use it to properly set up the NIC TX descriptors. On RX rings, the kernel may set the flag if the packet received was split across multiple netmap buffers. The userspace application should look at the flag to know when the packet is complete. Submitted by: rajesh1.kumar_amd.com Reviewed by: vmaffione MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27799 (cherry picked from commit aceaccab659c9eb846fb21ff99be34434a9616c7) --- sys/net/iflib.c | 82 ++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 24 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 6f7911a12b09..80aeda5847cb 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -1011,6 +1011,8 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags) nm_i = kring->nr_hwcur; if (nm_i != head) { /* we have new packets to send */ + uint32_t pkt_len = 0, seg_idx = 0; + int nic_i_start = -1, flags = 0; pkt_info_zero(&pi); pi.ipi_segs = txq->ift_segs; pi.ipi_qsidx = kring->ring_id; @@ -1025,22 +1027,40 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags) u_int len = slot->len; uint64_t paddr; void *addr = PNMB(na, slot, &paddr); - int flags = (slot->flags & NS_REPORT || + + flags |= (slot->flags & NS_REPORT || nic_i == 0 || nic_i == report_frequency) ? IPI_TX_INTR : 0; - /* device-specific */ - pi.ipi_len = len; - pi.ipi_segs[0].ds_addr = paddr; - pi.ipi_segs[0].ds_len = len; - pi.ipi_nsegs = 1; - pi.ipi_ndescs = 0; - pi.ipi_pidx = nic_i; - pi.ipi_flags = flags; + /* + * If this is the first packet fragment, save the + * index of the first NIC slot for later. + */ + if (nic_i_start < 0) + nic_i_start = nic_i; + + pi.ipi_segs[seg_idx].ds_addr = paddr; + pi.ipi_segs[seg_idx].ds_len = len; + if (len) { + pkt_len += len; + seg_idx++; + } - /* Fill the slot in the NIC ring. */ - ctx->isc_txd_encap(ctx->ifc_softc, &pi); - DBG_COUNTER_INC(tx_encap); + if (!(slot->flags & NS_MOREFRAG)) { + pi.ipi_len = pkt_len; + pi.ipi_nsegs = seg_idx; + pi.ipi_pidx = nic_i_start; + pi.ipi_ndescs = 0; + pi.ipi_flags = flags; + + /* Prepare the NIC TX ring. */ + ctx->isc_txd_encap(ctx->ifc_softc, &pi); + DBG_COUNTER_INC(tx_encap); + + /* Reinit per-packet info for the next one. */ + flags = seg_idx = pkt_len = 0; + nic_i_start = -1; + } /* prefetch for next round */ __builtin_prefetch(&ring->slot[nm_i + 1]); @@ -1059,7 +1079,7 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags) txq->ift_sds.ifsd_map[nic_i], BUS_DMASYNC_PREWRITE); - slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED | NS_MOREFRAG); nm_i = nm_next(nm_i, lim); nic_i = nm_next(nic_i, lim); } @@ -1122,6 +1142,7 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int flags) u_int n; u_int const lim = kring->nkr_num_slots - 1; int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; + int i = 0; if_ctx_t ctx = ifp->if_softc; if_shared_ctx_t sctx = ctx->ifc_sctx; @@ -1183,17 +1204,30 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int flags) ri.iri_cidx = *cidxp; error = ctx->isc_rxd_pkt_get(ctx->ifc_softc, &ri); - ring->slot[nm_i].len = error ? 0 : ri.iri_len - crclen; - ring->slot[nm_i].flags = 0; - if (have_rxcq) { - *cidxp = ri.iri_cidx; - while (*cidxp >= scctx->isc_nrxd[0]) - *cidxp -= scctx->isc_nrxd[0]; + for (i = 0; i < ri.iri_nfrags; i++) { + if (error) { + ring->slot[nm_i].len = 0; + ring->slot[nm_i].flags = 0; + } else { + ring->slot[nm_i].len = ri.iri_frags[i].irf_len; + if (i == (ri.iri_nfrags - 1)) { + ring->slot[nm_i].len -= crclen; + ring->slot[nm_i].flags = 0; + } else + ring->slot[nm_i].flags = NS_MOREFRAG; + } + + if (have_rxcq) { + *cidxp = ri.iri_cidx; + while (*cidxp >= scctx->isc_nrxd[0]) + *cidxp -= scctx->isc_nrxd[0]; + } + + bus_dmamap_sync(fl->ifl_buf_tag, + fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); + nm_i = nm_next(nm_i, lim); + fl->ifl_cidx = nic_i = nm_next(nic_i, lim); } - bus_dmamap_sync(fl->ifl_buf_tag, - fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); - nm_i = nm_next(nm_i, lim); - fl->ifl_cidx = nic_i = nm_next(nic_i, lim); } if (n) { /* update the state variables */ if (netmap_no_pendintr && !force_update) { @@ -1241,7 +1275,7 @@ iflib_netmap_attach(if_ctx_t ctx) bzero(&na, sizeof(na)); na.ifp = ctx->ifc_ifp; - na.na_flags = NAF_BDG_MAYSLEEP; + na.na_flags = NAF_BDG_MAYSLEEP | NAF_MOREFRAG; MPASS(ctx->ifc_softc_ctx.isc_ntxqsets); MPASS(ctx->ifc_softc_ctx.isc_nrxqsets); From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 08:51:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 413994E8042; Sun, 31 Jan 2021 08:51:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DT4ZR1R7Pz4lSv; Sun, 31 Jan 2021 08:51:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 242F42590C; Sun, 31 Jan 2021 08:51:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V8pxkI017397; Sun, 31 Jan 2021 08:51:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V8px1A017396; Sun, 31 Jan 2021 08:51:59 GMT (envelope-from git) Date: Sun, 31 Jan 2021 08:51:59 GMT Message-Id: <202101310851.10V8px1A017396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 31c2349742a9 - stable/12 - iflib: netmap: move per-packet operation out of fragments loop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 31c2349742a9391899180e46336cb227828bf732 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 08:51:59 -0000 The branch stable/12 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=31c2349742a9391899180e46336cb227828bf732 commit 31c2349742a9391899180e46336cb227828bf732 Author: Vincenzo Maffione AuthorDate: 2021-01-24 21:38:59 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-31 08:51:56 +0000 iflib: netmap: move per-packet operation out of fragments loop MFC after: 1 week (cherry picked from commit f80efe5016ba01b2948ca1f0eb8fe34adab5b864) --- sys/net/iflib.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 80aeda5847cb..ae203d871a5c 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -1217,17 +1217,18 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int flags) ring->slot[nm_i].flags = NS_MOREFRAG; } - if (have_rxcq) { - *cidxp = ri.iri_cidx; - while (*cidxp >= scctx->isc_nrxd[0]) - *cidxp -= scctx->isc_nrxd[0]; - } - bus_dmamap_sync(fl->ifl_buf_tag, fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); nm_i = nm_next(nm_i, lim); fl->ifl_cidx = nic_i = nm_next(nic_i, lim); } + + if (have_rxcq) { + *cidxp = ri.iri_cidx; + while (*cidxp >= scctx->isc_nrxd[0]) + *cidxp -= scctx->isc_nrxd[0]; + } + } if (n) { /* update the state variables */ if (netmap_no_pendintr && !force_update) { From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 08:52:23 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F6074E7FEB; Sun, 31 Jan 2021 08:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DT4Zv1sXhz4lkQ; Sun, 31 Jan 2021 08:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3349125819; Sun, 31 Jan 2021 08:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V8qN7X017561; Sun, 31 Jan 2021 08:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V8qN4D017560; Sun, 31 Jan 2021 08:52:23 GMT (envelope-from git) Date: Sun, 31 Jan 2021 08:52:23 GMT Message-Id: <202101310852.10V8qN4D017560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: e817c8f77fe8 - stable/12 - netmap: simplify parameter passing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e817c8f77fe8196fcfdcc823b3a2c04b761e68c6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 08:52:23 -0000 The branch stable/12 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=e817c8f77fe8196fcfdcc823b3a2c04b761e68c6 commit e817c8f77fe8196fcfdcc823b3a2c04b761e68c6 Author: Vincenzo Maffione AuthorDate: 2021-01-24 21:59:02 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-31 08:52:11 +0000 netmap: simplify parameter passing Changes imported from the netmap github. (cherry picked from commit ee0005f11f2b38a714bc66b7d79832108f6fee77) --- sys/dev/netmap/netmap.c | 78 ++++++++++++++++++++++------------------- sys/dev/netmap/netmap_bdg.c | 3 +- sys/dev/netmap/netmap_kern.h | 5 ++- sys/dev/netmap/netmap_monitor.c | 3 +- 4 files changed, 45 insertions(+), 44 deletions(-) diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c index f75567565bf1..ca5af6ab5217 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -1833,13 +1833,15 @@ netmap_ring_reinit(struct netmap_kring *kring) * */ int -netmap_interp_ringid(struct netmap_priv_d *priv, uint32_t nr_mode, - uint16_t nr_ringid, uint64_t nr_flags) +netmap_interp_ringid(struct netmap_priv_d *priv, struct nmreq_header *hdr) { struct netmap_adapter *na = priv->np_na; + struct nmreq_register *reg = (struct nmreq_register *)hdr->nr_body; int excluded_direction[] = { NR_TX_RINGS_ONLY, NR_RX_RINGS_ONLY }; enum txrx t; u_int j; + u_int nr_flags = reg->nr_flags, nr_mode = reg->nr_mode, + nr_ringid = reg->nr_ringid; for_rx_tx(t) { if (nr_flags & excluded_direction[t]) { @@ -1933,19 +1935,19 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint32_t nr_mode, * for all rings is the same as a single ring. */ static int -netmap_set_ringid(struct netmap_priv_d *priv, uint32_t nr_mode, - uint16_t nr_ringid, uint64_t nr_flags) +netmap_set_ringid(struct netmap_priv_d *priv, struct nmreq_header *hdr) { struct netmap_adapter *na = priv->np_na; + struct nmreq_register *reg = (struct nmreq_register *)hdr->nr_body; int error; enum txrx t; - error = netmap_interp_ringid(priv, nr_mode, nr_ringid, nr_flags); + error = netmap_interp_ringid(priv, hdr); if (error) { return error; } - priv->np_txpoll = (nr_flags & NR_NO_TX_POLL) ? 0 : 1; + priv->np_txpoll = (reg->nr_flags & NR_NO_TX_POLL) ? 0 : 1; /* optimization: count the users registered for more than * one ring, which are the ones sleeping on the global queue. @@ -1975,6 +1977,19 @@ netmap_unset_ringid(struct netmap_priv_d *priv) priv->np_kloop_state = 0; } +#define within_sel(p_, t_, i_) \ + ((i_) < (p_)->np_qlast[(t_)]) +#define nonempty_sel(p_, t_) \ + (within_sel((p_), (t_), (p_)->np_qfirst[(t_)])) +#define foreach_selected_ring(p_, t_, i_, kring_) \ + for ((t_) = nonempty_sel((p_), NR_RX) ? NR_RX : NR_TX, \ + (i_) = (p_)->np_qfirst[(t_)]; \ + (t_ == NR_RX || \ + (t == NR_TX && within_sel((p_), (t_), (i_)))) && \ + ((kring_) = NMR((p_)->np_na, (t_))[(i_)]); \ + (i_) = within_sel((p_), (t_), (i_) + 1) ? (i_) + 1 : \ + (++(t_) < NR_TXRX ? (p_)->np_qfirst[(t_)] : (i_))) + /* Set the nr_pending_mode for the requested rings. * If requested, also try to get exclusive access to the rings, provided @@ -2001,29 +2016,23 @@ netmap_krings_get(struct netmap_priv_d *priv) * are neither alread exclusively owned, nor we * want exclusive ownership when they are already in use */ - for_rx_tx(t) { - for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { - kring = NMR(na, t)[i]; - if ((kring->nr_kflags & NKR_EXCLUSIVE) || - (kring->users && excl)) - { - nm_prdis("ring %s busy", kring->name); - return EBUSY; - } + foreach_selected_ring(priv, t, i, kring) { + if ((kring->nr_kflags & NKR_EXCLUSIVE) || + (kring->users && excl)) + { + nm_prdis("ring %s busy", kring->name); + return EBUSY; } } /* second round: increment usage count (possibly marking them * as exclusive) and set the nr_pending_mode */ - for_rx_tx(t) { - for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { - kring = NMR(na, t)[i]; - kring->users++; - if (excl) - kring->nr_kflags |= NKR_EXCLUSIVE; - kring->nr_pending_mode = NKR_NETMAP_ON; - } + foreach_selected_ring(priv, t, i, kring) { + kring->users++; + if (excl) + kring->nr_kflags |= NKR_EXCLUSIVE; + kring->nr_pending_mode = NKR_NETMAP_ON; } return 0; @@ -2036,7 +2045,6 @@ netmap_krings_get(struct netmap_priv_d *priv) static void netmap_krings_put(struct netmap_priv_d *priv) { - struct netmap_adapter *na = priv->np_na; u_int i; struct netmap_kring *kring; int excl = (priv->np_flags & NR_EXCLUSIVE); @@ -2049,15 +2057,12 @@ netmap_krings_put(struct netmap_priv_d *priv) priv->np_qfirst[NR_RX], priv->np_qlast[MR_RX]); - for_rx_tx(t) { - for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { - kring = NMR(na, t)[i]; - if (excl) - kring->nr_kflags &= ~NKR_EXCLUSIVE; - kring->users--; - if (kring->users == 0) - kring->nr_pending_mode = NKR_NETMAP_OFF; - } + foreach_selected_ring(priv, t, i, kring) { + if (excl) + kring->nr_kflags &= ~NKR_EXCLUSIVE; + kring->users--; + if (kring->users == 0) + kring->nr_pending_mode = NKR_NETMAP_OFF; } } @@ -2290,7 +2295,7 @@ netmap_buf_size_validate(const struct netmap_adapter *na, unsigned mtu) { */ int netmap_do_regif(struct netmap_priv_d *priv, struct netmap_adapter *na, - uint32_t nr_mode, uint16_t nr_ringid, uint64_t nr_flags) + struct nmreq_header *hdr) { struct netmap_if *nifp = NULL; int error; @@ -2315,7 +2320,7 @@ netmap_do_regif(struct netmap_priv_d *priv, struct netmap_adapter *na, } /* compute the range of tx and rx rings to monitor */ - error = netmap_set_ringid(priv, nr_mode, nr_ringid, nr_flags); + error = netmap_set_ringid(priv, hdr); if (error) goto err_put_lut; @@ -2556,8 +2561,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, caddr_t data, break; } - error = netmap_do_regif(priv, na, req->nr_mode, - req->nr_ringid, req->nr_flags); + error = netmap_do_regif(priv, na, hdr); if (error) { /* reg. failed, release priv and ref */ break; } diff --git a/sys/dev/netmap/netmap_bdg.c b/sys/dev/netmap/netmap_bdg.c index 96d6deedb768..4d18859e2091 100644 --- a/sys/dev/netmap/netmap_bdg.c +++ b/sys/dev/netmap/netmap_bdg.c @@ -1477,8 +1477,7 @@ netmap_bwrap_bdg_ctl(struct nmreq_header *hdr, struct netmap_adapter *na) if (npriv == NULL) return ENOMEM; npriv->np_ifp = na->ifp; /* let the priv destructor release the ref */ - error = netmap_do_regif(npriv, na, req->reg.nr_mode, - req->reg.nr_ringid, req->reg.nr_flags); + error = netmap_do_regif(npriv, na, hdr); if (error) { netmap_priv_delete(npriv); return error; diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index 3786826d8e38..fd9db5842df3 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -1449,8 +1449,7 @@ int netmap_attach_common(struct netmap_adapter *); /* fill priv->np_[tr]xq{first,last} using the ringid and flags information * coming from a struct nmreq_register */ -int netmap_interp_ringid(struct netmap_priv_d *priv, uint32_t nr_mode, - uint16_t nr_ringid, uint64_t nr_flags); +int netmap_interp_ringid(struct netmap_priv_d *priv, struct nmreq_header *hdr); /* update the ring parameters (number and size of tx and rx rings). * It calls the nm_config callback, if available. */ @@ -1485,7 +1484,7 @@ void netmap_enable_all_rings(struct ifnet *); int netmap_buf_size_validate(const struct netmap_adapter *na, unsigned mtu); int netmap_do_regif(struct netmap_priv_d *priv, struct netmap_adapter *na, - uint32_t nr_mode, uint16_t nr_ringid, uint64_t nr_flags); + struct nmreq_header *); void netmap_do_unregif(struct netmap_priv_d *priv); u_int nm_bound_var(u_int *v, u_int dflt, u_int lo, u_int hi, const char *msg); diff --git a/sys/dev/netmap/netmap_monitor.c b/sys/dev/netmap/netmap_monitor.c index f30abcc4b39a..1f5ff65b3b81 100644 --- a/sys/dev/netmap/netmap_monitor.c +++ b/sys/dev/netmap/netmap_monitor.c @@ -950,8 +950,7 @@ netmap_get_monitor_na(struct nmreq_header *hdr, struct netmap_adapter **na, mna->priv.np_na = pna; /* grab all the rings we need in the parent */ - error = netmap_interp_ringid(&mna->priv, req->nr_mode, req->nr_ringid, - req->nr_flags); + error = netmap_interp_ringid(&mna->priv, hdr); if (error) { nm_prerr("ringid error"); goto free_out; From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 08:52:48 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DEA684E84AB; Sun, 31 Jan 2021 08:52:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DT4bN610Lz4ltF; Sun, 31 Jan 2021 08:52:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C156F2581C; Sun, 31 Jan 2021 08:52:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V8qmx3017725; Sun, 31 Jan 2021 08:52:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V8qmNw017724; Sun, 31 Jan 2021 08:52:48 GMT (envelope-from git) Date: Sun, 31 Jan 2021 08:52:48 GMT Message-Id: <202101310852.10V8qmNw017724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: e0e00874a3c3 - stable/13 - iflib: netmap: add support for NS_MOREFRAG MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e0e00874a3c30a8d418417d5901c065f15b5896e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 08:52:49 -0000 The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=e0e00874a3c30a8d418417d5901c065f15b5896e commit e0e00874a3c30a8d418417d5901c065f15b5896e Author: Vincenzo Maffione AuthorDate: 2021-01-24 21:12:41 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-31 08:52:45 +0000 iflib: netmap: add support for NS_MOREFRAG The NS_MOREFRAG flag can be set in a netmap slot to represent a multi-fragment packet. Only the last fragment of a packet does not have the flag set. On TX rings, the flag may be set by the userspace application. The kernel will look at the flag and use it to properly set up the NIC TX descriptors. On RX rings, the kernel may set the flag if the packet received was split across multiple netmap buffers. The userspace application should look at the flag to know when the packet is complete. Submitted by: rajesh1.kumar_amd.com Reviewed by: vmaffione MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27799 (cherry picked from commit aceaccab659c9eb846fb21ff99be34434a9616c7) --- sys/net/iflib.c | 82 ++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 24 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index ea2c5789a7b5..0d4124599419 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -1005,6 +1005,8 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags) nm_i = kring->nr_hwcur; if (nm_i != head) { /* we have new packets to send */ + uint32_t pkt_len = 0, seg_idx = 0; + int nic_i_start = -1, flags = 0; pkt_info_zero(&pi); pi.ipi_segs = txq->ift_segs; pi.ipi_qsidx = kring->ring_id; @@ -1019,22 +1021,40 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags) u_int len = slot->len; uint64_t paddr; void *addr = PNMB(na, slot, &paddr); - int flags = (slot->flags & NS_REPORT || + + flags |= (slot->flags & NS_REPORT || nic_i == 0 || nic_i == report_frequency) ? IPI_TX_INTR : 0; - /* device-specific */ - pi.ipi_len = len; - pi.ipi_segs[0].ds_addr = paddr; - pi.ipi_segs[0].ds_len = len; - pi.ipi_nsegs = 1; - pi.ipi_ndescs = 0; - pi.ipi_pidx = nic_i; - pi.ipi_flags = flags; + /* + * If this is the first packet fragment, save the + * index of the first NIC slot for later. + */ + if (nic_i_start < 0) + nic_i_start = nic_i; + + pi.ipi_segs[seg_idx].ds_addr = paddr; + pi.ipi_segs[seg_idx].ds_len = len; + if (len) { + pkt_len += len; + seg_idx++; + } - /* Fill the slot in the NIC ring. */ - ctx->isc_txd_encap(ctx->ifc_softc, &pi); - DBG_COUNTER_INC(tx_encap); + if (!(slot->flags & NS_MOREFRAG)) { + pi.ipi_len = pkt_len; + pi.ipi_nsegs = seg_idx; + pi.ipi_pidx = nic_i_start; + pi.ipi_ndescs = 0; + pi.ipi_flags = flags; + + /* Prepare the NIC TX ring. */ + ctx->isc_txd_encap(ctx->ifc_softc, &pi); + DBG_COUNTER_INC(tx_encap); + + /* Reinit per-packet info for the next one. */ + flags = seg_idx = pkt_len = 0; + nic_i_start = -1; + } /* prefetch for next round */ __builtin_prefetch(&ring->slot[nm_i + 1]); @@ -1053,7 +1073,7 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags) txq->ift_sds.ifsd_map[nic_i], BUS_DMASYNC_PREWRITE); - slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED | NS_MOREFRAG); nm_i = nm_next(nm_i, lim); nic_i = nm_next(nic_i, lim); } @@ -1116,6 +1136,7 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int flags) u_int n; u_int const lim = kring->nkr_num_slots - 1; int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; + int i = 0; if_ctx_t ctx = ifp->if_softc; if_shared_ctx_t sctx = ctx->ifc_sctx; @@ -1177,17 +1198,30 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int flags) ri.iri_cidx = *cidxp; error = ctx->isc_rxd_pkt_get(ctx->ifc_softc, &ri); - ring->slot[nm_i].len = error ? 0 : ri.iri_len - crclen; - ring->slot[nm_i].flags = 0; - if (have_rxcq) { - *cidxp = ri.iri_cidx; - while (*cidxp >= scctx->isc_nrxd[0]) - *cidxp -= scctx->isc_nrxd[0]; + for (i = 0; i < ri.iri_nfrags; i++) { + if (error) { + ring->slot[nm_i].len = 0; + ring->slot[nm_i].flags = 0; + } else { + ring->slot[nm_i].len = ri.iri_frags[i].irf_len; + if (i == (ri.iri_nfrags - 1)) { + ring->slot[nm_i].len -= crclen; + ring->slot[nm_i].flags = 0; + } else + ring->slot[nm_i].flags = NS_MOREFRAG; + } + + if (have_rxcq) { + *cidxp = ri.iri_cidx; + while (*cidxp >= scctx->isc_nrxd[0]) + *cidxp -= scctx->isc_nrxd[0]; + } + + bus_dmamap_sync(fl->ifl_buf_tag, + fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); + nm_i = nm_next(nm_i, lim); + fl->ifl_cidx = nic_i = nm_next(nic_i, lim); } - bus_dmamap_sync(fl->ifl_buf_tag, - fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); - nm_i = nm_next(nm_i, lim); - fl->ifl_cidx = nic_i = nm_next(nic_i, lim); } if (n) { /* update the state variables */ if (netmap_no_pendintr && !force_update) { @@ -1234,7 +1268,7 @@ iflib_netmap_attach(if_ctx_t ctx) bzero(&na, sizeof(na)); na.ifp = ctx->ifc_ifp; - na.na_flags = NAF_BDG_MAYSLEEP; + na.na_flags = NAF_BDG_MAYSLEEP | NAF_MOREFRAG; MPASS(ctx->ifc_softc_ctx.isc_ntxqsets); MPASS(ctx->ifc_softc_ctx.isc_nrxqsets); From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 08:53:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A43A4E831E; Sun, 31 Jan 2021 08:53:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DT4bc0Wnmz4lvD; Sun, 31 Jan 2021 08:53:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D35542516F; Sun, 31 Jan 2021 08:52:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V8qx2V017857; Sun, 31 Jan 2021 08:52:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V8qxpH017856; Sun, 31 Jan 2021 08:52:59 GMT (envelope-from git) Date: Sun, 31 Jan 2021 08:52:59 GMT Message-Id: <202101310852.10V8qxpH017856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: a8ca736bb4ed - stable/13 - iflib: netmap: move per-packet operation out of fragments loop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a8ca736bb4edb18848b6a828d946d1ddee419b56 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 08:53:00 -0000 The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=a8ca736bb4edb18848b6a828d946d1ddee419b56 commit a8ca736bb4edb18848b6a828d946d1ddee419b56 Author: Vincenzo Maffione AuthorDate: 2021-01-24 21:38:59 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-31 08:52:57 +0000 iflib: netmap: move per-packet operation out of fragments loop MFC after: 1 week (cherry picked from commit f80efe5016ba01b2948ca1f0eb8fe34adab5b864) --- sys/net/iflib.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 0d4124599419..d10c11f865fe 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -1211,17 +1211,18 @@ iflib_netmap_rxsync(struct netmap_kring *kring, int flags) ring->slot[nm_i].flags = NS_MOREFRAG; } - if (have_rxcq) { - *cidxp = ri.iri_cidx; - while (*cidxp >= scctx->isc_nrxd[0]) - *cidxp -= scctx->isc_nrxd[0]; - } - bus_dmamap_sync(fl->ifl_buf_tag, fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD); nm_i = nm_next(nm_i, lim); fl->ifl_cidx = nic_i = nm_next(nic_i, lim); } + + if (have_rxcq) { + *cidxp = ri.iri_cidx; + while (*cidxp >= scctx->isc_nrxd[0]) + *cidxp -= scctx->isc_nrxd[0]; + } + } if (n) { /* update the state variables */ if (netmap_no_pendintr && !force_update) { From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 08:53:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24B8E4E8027; Sun, 31 Jan 2021 08:53:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DT4bp5rvxz4m2g; Sun, 31 Jan 2021 08:53:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89D682591A; Sun, 31 Jan 2021 08:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10V8r9Cs017985; Sun, 31 Jan 2021 08:53:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10V8r9h5017984; Sun, 31 Jan 2021 08:53:09 GMT (envelope-from git) Date: Sun, 31 Jan 2021 08:53:09 GMT Message-Id: <202101310853.10V8r9h5017984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: e4c81e46acc0 - stable/13 - netmap: simplify parameter passing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e4c81e46acc0dc34fa6a680ad06f9b003675f86d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 08:53:12 -0000 The branch stable/13 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=e4c81e46acc0dc34fa6a680ad06f9b003675f86d commit e4c81e46acc0dc34fa6a680ad06f9b003675f86d Author: Vincenzo Maffione AuthorDate: 2021-01-24 21:59:02 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-31 08:53:06 +0000 netmap: simplify parameter passing Changes imported from the netmap github. (cherry picked from commit ee0005f11f2b38a714bc66b7d79832108f6fee77) --- sys/dev/netmap/netmap.c | 78 ++++++++++++++++++++++------------------- sys/dev/netmap/netmap_bdg.c | 3 +- sys/dev/netmap/netmap_kern.h | 5 ++- sys/dev/netmap/netmap_monitor.c | 3 +- 4 files changed, 45 insertions(+), 44 deletions(-) diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c index 62d00f0bffc7..b711e0d2497e 100644 --- a/sys/dev/netmap/netmap.c +++ b/sys/dev/netmap/netmap.c @@ -1843,13 +1843,15 @@ netmap_ring_reinit(struct netmap_kring *kring) * */ int -netmap_interp_ringid(struct netmap_priv_d *priv, uint32_t nr_mode, - uint16_t nr_ringid, uint64_t nr_flags) +netmap_interp_ringid(struct netmap_priv_d *priv, struct nmreq_header *hdr) { struct netmap_adapter *na = priv->np_na; + struct nmreq_register *reg = (struct nmreq_register *)hdr->nr_body; int excluded_direction[] = { NR_TX_RINGS_ONLY, NR_RX_RINGS_ONLY }; enum txrx t; u_int j; + u_int nr_flags = reg->nr_flags, nr_mode = reg->nr_mode, + nr_ringid = reg->nr_ringid; for_rx_tx(t) { if (nr_flags & excluded_direction[t]) { @@ -1943,19 +1945,19 @@ netmap_interp_ringid(struct netmap_priv_d *priv, uint32_t nr_mode, * for all rings is the same as a single ring. */ static int -netmap_set_ringid(struct netmap_priv_d *priv, uint32_t nr_mode, - uint16_t nr_ringid, uint64_t nr_flags) +netmap_set_ringid(struct netmap_priv_d *priv, struct nmreq_header *hdr) { struct netmap_adapter *na = priv->np_na; + struct nmreq_register *reg = (struct nmreq_register *)hdr->nr_body; int error; enum txrx t; - error = netmap_interp_ringid(priv, nr_mode, nr_ringid, nr_flags); + error = netmap_interp_ringid(priv, hdr); if (error) { return error; } - priv->np_txpoll = (nr_flags & NR_NO_TX_POLL) ? 0 : 1; + priv->np_txpoll = (reg->nr_flags & NR_NO_TX_POLL) ? 0 : 1; /* optimization: count the users registered for more than * one ring, which are the ones sleeping on the global queue. @@ -1985,6 +1987,19 @@ netmap_unset_ringid(struct netmap_priv_d *priv) priv->np_kloop_state = 0; } +#define within_sel(p_, t_, i_) \ + ((i_) < (p_)->np_qlast[(t_)]) +#define nonempty_sel(p_, t_) \ + (within_sel((p_), (t_), (p_)->np_qfirst[(t_)])) +#define foreach_selected_ring(p_, t_, i_, kring_) \ + for ((t_) = nonempty_sel((p_), NR_RX) ? NR_RX : NR_TX, \ + (i_) = (p_)->np_qfirst[(t_)]; \ + (t_ == NR_RX || \ + (t == NR_TX && within_sel((p_), (t_), (i_)))) && \ + ((kring_) = NMR((p_)->np_na, (t_))[(i_)]); \ + (i_) = within_sel((p_), (t_), (i_) + 1) ? (i_) + 1 : \ + (++(t_) < NR_TXRX ? (p_)->np_qfirst[(t_)] : (i_))) + /* Set the nr_pending_mode for the requested rings. * If requested, also try to get exclusive access to the rings, provided @@ -2011,29 +2026,23 @@ netmap_krings_get(struct netmap_priv_d *priv) * are neither alread exclusively owned, nor we * want exclusive ownership when they are already in use */ - for_rx_tx(t) { - for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { - kring = NMR(na, t)[i]; - if ((kring->nr_kflags & NKR_EXCLUSIVE) || - (kring->users && excl)) - { - nm_prdis("ring %s busy", kring->name); - return EBUSY; - } + foreach_selected_ring(priv, t, i, kring) { + if ((kring->nr_kflags & NKR_EXCLUSIVE) || + (kring->users && excl)) + { + nm_prdis("ring %s busy", kring->name); + return EBUSY; } } /* second round: increment usage count (possibly marking them * as exclusive) and set the nr_pending_mode */ - for_rx_tx(t) { - for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { - kring = NMR(na, t)[i]; - kring->users++; - if (excl) - kring->nr_kflags |= NKR_EXCLUSIVE; - kring->nr_pending_mode = NKR_NETMAP_ON; - } + foreach_selected_ring(priv, t, i, kring) { + kring->users++; + if (excl) + kring->nr_kflags |= NKR_EXCLUSIVE; + kring->nr_pending_mode = NKR_NETMAP_ON; } return 0; @@ -2046,7 +2055,6 @@ netmap_krings_get(struct netmap_priv_d *priv) static void netmap_krings_put(struct netmap_priv_d *priv) { - struct netmap_adapter *na = priv->np_na; u_int i; struct netmap_kring *kring; int excl = (priv->np_flags & NR_EXCLUSIVE); @@ -2059,15 +2067,12 @@ netmap_krings_put(struct netmap_priv_d *priv) priv->np_qfirst[NR_RX], priv->np_qlast[MR_RX]); - for_rx_tx(t) { - for (i = priv->np_qfirst[t]; i < priv->np_qlast[t]; i++) { - kring = NMR(na, t)[i]; - if (excl) - kring->nr_kflags &= ~NKR_EXCLUSIVE; - kring->users--; - if (kring->users == 0) - kring->nr_pending_mode = NKR_NETMAP_OFF; - } + foreach_selected_ring(priv, t, i, kring) { + if (excl) + kring->nr_kflags &= ~NKR_EXCLUSIVE; + kring->users--; + if (kring->users == 0) + kring->nr_pending_mode = NKR_NETMAP_OFF; } } @@ -2300,7 +2305,7 @@ netmap_buf_size_validate(const struct netmap_adapter *na, unsigned mtu) { */ int netmap_do_regif(struct netmap_priv_d *priv, struct netmap_adapter *na, - uint32_t nr_mode, uint16_t nr_ringid, uint64_t nr_flags) + struct nmreq_header *hdr) { struct netmap_if *nifp = NULL; int error; @@ -2325,7 +2330,7 @@ netmap_do_regif(struct netmap_priv_d *priv, struct netmap_adapter *na, } /* compute the range of tx and rx rings to monitor */ - error = netmap_set_ringid(priv, nr_mode, nr_ringid, nr_flags); + error = netmap_set_ringid(priv, hdr); if (error) goto err_put_lut; @@ -2566,8 +2571,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, caddr_t data, break; } - error = netmap_do_regif(priv, na, req->nr_mode, - req->nr_ringid, req->nr_flags); + error = netmap_do_regif(priv, na, hdr); if (error) { /* reg. failed, release priv and ref */ break; } diff --git a/sys/dev/netmap/netmap_bdg.c b/sys/dev/netmap/netmap_bdg.c index 96d6deedb768..4d18859e2091 100644 --- a/sys/dev/netmap/netmap_bdg.c +++ b/sys/dev/netmap/netmap_bdg.c @@ -1477,8 +1477,7 @@ netmap_bwrap_bdg_ctl(struct nmreq_header *hdr, struct netmap_adapter *na) if (npriv == NULL) return ENOMEM; npriv->np_ifp = na->ifp; /* let the priv destructor release the ref */ - error = netmap_do_regif(npriv, na, req->reg.nr_mode, - req->reg.nr_ringid, req->reg.nr_flags); + error = netmap_do_regif(npriv, na, hdr); if (error) { netmap_priv_delete(npriv); return error; diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index 3786826d8e38..fd9db5842df3 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -1449,8 +1449,7 @@ int netmap_attach_common(struct netmap_adapter *); /* fill priv->np_[tr]xq{first,last} using the ringid and flags information * coming from a struct nmreq_register */ -int netmap_interp_ringid(struct netmap_priv_d *priv, uint32_t nr_mode, - uint16_t nr_ringid, uint64_t nr_flags); +int netmap_interp_ringid(struct netmap_priv_d *priv, struct nmreq_header *hdr); /* update the ring parameters (number and size of tx and rx rings). * It calls the nm_config callback, if available. */ @@ -1485,7 +1484,7 @@ void netmap_enable_all_rings(struct ifnet *); int netmap_buf_size_validate(const struct netmap_adapter *na, unsigned mtu); int netmap_do_regif(struct netmap_priv_d *priv, struct netmap_adapter *na, - uint32_t nr_mode, uint16_t nr_ringid, uint64_t nr_flags); + struct nmreq_header *); void netmap_do_unregif(struct netmap_priv_d *priv); u_int nm_bound_var(u_int *v, u_int dflt, u_int lo, u_int hi, const char *msg); diff --git a/sys/dev/netmap/netmap_monitor.c b/sys/dev/netmap/netmap_monitor.c index f30abcc4b39a..1f5ff65b3b81 100644 --- a/sys/dev/netmap/netmap_monitor.c +++ b/sys/dev/netmap/netmap_monitor.c @@ -950,8 +950,7 @@ netmap_get_monitor_na(struct nmreq_header *hdr, struct netmap_adapter **na, mna->priv.np_na = pna; /* grab all the rings we need in the parent */ - error = netmap_interp_ringid(&mna->priv, req->nr_mode, req->nr_ringid, - req->nr_flags); + error = netmap_interp_ringid(&mna->priv, hdr); if (error) { nm_prerr("ringid error"); goto free_out; From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 13:58:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 670124F74B4; Sun, 31 Jan 2021 13:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTCMm2Pj0z3NNY; Sun, 31 Jan 2021 13:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 411F012C1; Sun, 31 Jan 2021 13:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10VDwCNJ012161; Sun, 31 Jan 2021 13:58:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VDwCqc012160; Sun, 31 Jan 2021 13:58:12 GMT (envelope-from git) Date: Sun, 31 Jan 2021 13:58:12 GMT Message-Id: <202101311358.10VDwCqc012160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 7ba4d0f82955 - stable/13 - release: ROCKPRO64: Remove the quirk that disable the big cores MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ba4d0f82955d5c229bf339a53f07c191b1b675b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 13:58:12 -0000 The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=7ba4d0f82955d5c229bf339a53f07c191b1b675b commit 7ba4d0f82955d5c229bf339a53f07c191b1b675b Author: Emmanuel Vadot AuthorDate: 2021-01-27 22:31:18 +0000 Commit: Emmanuel Vadot CommitDate: 2021-01-31 13:57:59 +0000 release: ROCKPRO64: Remove the quirk that disable the big cores It's not needed anymore. (cherry picked from commit 183d6cc0e0db8bd4653245abc1ca30b34ed09d9f) --- release/arm64/ROCKPRO64.conf | 7 ------- 1 file changed, 7 deletions(-) diff --git a/release/arm64/ROCKPRO64.conf b/release/arm64/ROCKPRO64.conf index 29d19bd8a46f..fc454e30ec72 100644 --- a/release/arm64/ROCKPRO64.conf +++ b/release/arm64/ROCKPRO64.conf @@ -26,10 +26,3 @@ arm_install_uboot() { of=/dev/${mddev} bs=512 seek=16384 conv=sync return 0 } - -arm_do_quirk() { - echo '# Known issue with big.LITTLE' \ - >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf - echo 'hw.ncpu=4' \ - >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf -} From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 17:06:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDEAC4FC72C; Sun, 31 Jan 2021 17:06:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTHXT51m3z3ps8; Sun, 31 Jan 2021 17:06:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FABC3DBE; Sun, 31 Jan 2021 17:06:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10VH61EP059034; Sun, 31 Jan 2021 17:06:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VH61qs059033; Sun, 31 Jan 2021 17:06:01 GMT (envelope-from git) Date: Sun, 31 Jan 2021 17:06:01 GMT Message-Id: <202101311706.10VH61qs059033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 38da7d23b6c3 - stable/13 - Make software iSCSI more configurable. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 38da7d23b6c3f2c1261e33645128f64855a469ef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 17:06:01 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=38da7d23b6c3f2c1261e33645128f64855a469ef commit 38da7d23b6c3f2c1261e33645128f64855a469ef Author: Alexander Motin AuthorDate: 2021-01-28 20:53:49 +0000 Commit: Alexander Motin CommitDate: 2021-01-31 17:05:12 +0000 Make software iSCSI more configurable. Move software iSCSI tunables/sysctls into kern.icl.soft subtree. Replace several hardcoded length constants there with variables. While there, stretch the limits to better match Linux' open-iscsi and our own initiator with new MAXPHYS of 1MB. Our CTL target is also optimized for up to 1MB I/Os, so there is also a match now. For Windows 10 and VMware 6.7 initiators at default settings it should make no change, since previous limits were sufficient there. Tests of QD1 1MB writes from FreeBSD over 10GigE link show throughput increase by 29% on idle connection and 132% with concurrent QD8 reads. Sponsored by: iXsystems, Inc. (cherry picked from commit b75168ed24ca74f65929e5c57d4fed5f0ab08f2a) --- sys/dev/iscsi/icl.h | 2 -- sys/dev/iscsi/icl_soft.c | 45 +++++++++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/sys/dev/iscsi/icl.h b/sys/dev/iscsi/icl.h index 06108802766d..0b897a50302a 100644 --- a/sys/dev/iscsi/icl.h +++ b/sys/dev/iscsi/icl.h @@ -89,8 +89,6 @@ struct icl_pdu { #define ICL_CONN_STATE_DATA 4 #define ICL_CONN_STATE_DATA_DIGEST 5 -#define ICL_MAX_DATA_SEGMENT_LENGTH (128 * 1024) - #define ICL_NOCOPY (1 << 30) struct icl_conn { diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index 41d20b4abf69..a8986b3d4253 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -72,18 +72,29 @@ struct icl_soft_pdu { int error; }; +SYSCTL_NODE(_kern_icl, OID_AUTO, soft, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "Software iSCSI"); static int coalesce = 1; -SYSCTL_INT(_kern_icl, OID_AUTO, coalesce, CTLFLAG_RWTUN, +SYSCTL_INT(_kern_icl_soft, OID_AUTO, coalesce, CTLFLAG_RWTUN, &coalesce, 0, "Try to coalesce PDUs before sending"); -static int partial_receive_len = 128 * 1024; -SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, +static int partial_receive_len = 256 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, partial_receive_len, CTLFLAG_RWTUN, &partial_receive_len, 0, "Minimum read size for partially received " "data segment"); -static int sendspace = 1048576; -SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RWTUN, +static int max_data_segment_length = 256 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, max_data_segment_length, CTLFLAG_RWTUN, + &max_data_segment_length, 0, "Maximum data segment length"); +static int first_burst_length = 1024 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, first_burst_length, CTLFLAG_RWTUN, + &first_burst_length, 0, "First burst length"); +static int max_burst_length = 1024 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, max_burst_length, CTLFLAG_RWTUN, + &max_burst_length, 0, "Maximum burst length"); +static int sendspace = 1536 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, sendspace, CTLFLAG_RWTUN, &sendspace, 0, "Default send socket buffer size"); -static int recvspace = 1048576; -SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RWTUN, +static int recvspace = 1536 * 1024; +SYSCTL_INT(_kern_icl_soft, OID_AUTO, recvspace, CTLFLAG_RWTUN, &recvspace, 0, "Default receive socket buffer size"); static MALLOC_DEFINE(M_ICL_SOFT, "icl_soft", "iSCSI software backend"); @@ -663,10 +674,8 @@ icl_conn_receive_pdu(struct icl_conn *ic, size_t *availablep) len = icl_pdu_data_segment_length(request); if (len > ic->ic_max_data_segment_length) { ICL_WARN("received data segment " - "length %zd is larger than negotiated " - "MaxDataSegmentLength %zd; " - "dropping connection", - len, ic->ic_max_data_segment_length); + "length %zd is larger than negotiated; " + "dropping connection", len); error = EINVAL; break; } @@ -1230,7 +1239,7 @@ icl_soft_new_conn(const char *name, struct mtx *lock) #ifdef DIAGNOSTIC refcount_init(&ic->ic_outstanding_pdus, 0); #endif - ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH; + ic->ic_max_data_segment_length = max_data_segment_length; ic->ic_name = name; ic->ic_offload = "None"; ic->ic_unmapped = false; @@ -1280,10 +1289,6 @@ icl_conn_start(struct icl_conn *ic) * For sendspace, this is required because the current code cannot * send a PDU in pieces; thus, the minimum buffer size is equal * to the maximum PDU size. "+4" is to account for possible padding. - * - * What we should actually do here is to use autoscaling, but set - * some minimal buffer size to "minspace". I don't know a way to do - * that, though. */ minspace = sizeof(struct iscsi_bhs) + ic->ic_max_data_segment_length + ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE + 4; @@ -1520,10 +1525,10 @@ static int icl_soft_limits(struct icl_drv_limits *idl) { - idl->idl_max_recv_data_segment_length = 128 * 1024; - idl->idl_max_send_data_segment_length = 128 * 1024; - idl->idl_max_burst_length = 262144; - idl->idl_first_burst_length = idl->idl_max_burst_length; + idl->idl_max_recv_data_segment_length = max_data_segment_length; + idl->idl_max_send_data_segment_length = max_data_segment_length; + idl->idl_max_burst_length = max_burst_length; + idl->idl_first_burst_length = first_burst_length; return (0); } From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 17:06:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 679EA4FCEA9; Sun, 31 Jan 2021 17:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTHY42VhDz3qRF; Sun, 31 Jan 2021 17:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48BE03DBF; Sun, 31 Jan 2021 17:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10VH6WpG059213; Sun, 31 Jan 2021 17:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VH6WCV059212; Sun, 31 Jan 2021 17:06:32 GMT (envelope-from git) Date: Sun, 31 Jan 2021 17:06:32 GMT Message-Id: <202101311706.10VH6WCV059212@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: c060c19240ea - stable/13 - Add missing newlines. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c060c19240ea257fb2560833c5bd86e43830f255 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 17:06:32 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=c060c19240ea257fb2560833c5bd86e43830f255 commit c060c19240ea257fb2560833c5bd86e43830f255 Author: Alexander Motin AuthorDate: 2021-01-28 23:18:53 +0000 Commit: Alexander Motin CommitDate: 2021-01-31 17:06:22 +0000 Add missing newlines. (cherry picked from commit 8fee65d0c70c99999b2fe5b49b267547b7ed2a49) --- sys/dev/acpica/acpi_apei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi_apei.c b/sys/dev/acpica/acpi_apei.c index 2ba5f864e7a1..bc1f38f2fc8f 100644 --- a/sys/dev/acpica/acpi_apei.c +++ b/sys/dev/acpica/acpi_apei.c @@ -333,10 +333,10 @@ apei_ged_handler(ACPI_HEST_GENERIC_DATA *ged) t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15]); } if (ged->ValidationBits & ACPI_HEST_GEN_VALID_FRU_STRING) - printf(" FRU Text: %.20s", ged->FruText); + printf(" FRU Text: %.20s\n", ged->FruText); if (ged->Revision == 0x300 && ged->ValidationBits & ACPI_HEST_GEN_VALID_TIMESTAMP) - printf(" Timestamp: %016jx", ged3->TimeStamp); + printf(" Timestamp: %016jx\n", ged3->TimeStamp); } static int From owner-dev-commits-src-branches@freebsd.org Sun Jan 31 17:07:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23D894FCE64; Sun, 31 Jan 2021 17:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTHYq0MT3z3qVG; Sun, 31 Jan 2021 17:07:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F385639E6; Sun, 31 Jan 2021 17:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10VH7ADO059410; Sun, 31 Jan 2021 17:07:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10VH7AGd059409; Sun, 31 Jan 2021 17:07:10 GMT (envelope-from git) Date: Sun, 31 Jan 2021 17:07:10 GMT Message-Id: <202101311707.10VH7AGd059409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: c8845dd67e44 - stable/12 - Add missing newlines. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c8845dd67e44515ab51259fbec4f6cac315a2306 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Jan 2021 17:07:11 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=c8845dd67e44515ab51259fbec4f6cac315a2306 commit c8845dd67e44515ab51259fbec4f6cac315a2306 Author: Alexander Motin AuthorDate: 2021-01-28 23:18:53 +0000 Commit: Alexander Motin CommitDate: 2021-01-31 17:07:03 +0000 Add missing newlines. (cherry picked from commit 8fee65d0c70c99999b2fe5b49b267547b7ed2a49) --- sys/dev/acpica/acpi_apei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi_apei.c b/sys/dev/acpica/acpi_apei.c index 5d1f1d4c8b16..0e3d5f6ae3da 100644 --- a/sys/dev/acpica/acpi_apei.c +++ b/sys/dev/acpica/acpi_apei.c @@ -333,10 +333,10 @@ apei_ged_handler(ACPI_HEST_GENERIC_DATA *ged) t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15]); } if (ged->ValidationBits & ACPI_HEST_GEN_VALID_FRU_STRING) - printf(" FRU Text: %.20s", ged->FruText); + printf(" FRU Text: %.20s\n", ged->FruText); if (ged->Revision == 0x300 && ged->ValidationBits & ACPI_HEST_GEN_VALID_TIMESTAMP) - printf(" Timestamp: %016jx", ged3->TimeStamp); + printf(" Timestamp: %016jx\n", ged3->TimeStamp); } static int