From owner-svn-src-head@freebsd.org Sun Oct 15 02:40:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EC01E3663C; Sun, 15 Oct 2017 02:40:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D168C6682E; Sun, 15 Oct 2017 02:40:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9F2eDkR051460; Sun, 15 Oct 2017 02:40:13 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9F2eDSH051459; Sun, 15 Oct 2017 02:40:13 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710150240.v9F2eDSH051459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 15 Oct 2017 02:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324622 - head/include X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 324622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 02:40:15 -0000 Author: cy Date: Sun Oct 15 02:40:13 2017 New Revision: 324622 URL: https://svnweb.freebsd.org/changeset/base/324622 Log: Sync (make same) the offsetof macro definition in include/ with the definition of the same in sys/sys/. The problem was discovered while working on implementing a new C11 gets_s() for libc. (The new gets_s() requires rsize_t found in include/stddef.h.) The solution to sync the two definitions was suggested by ed@ while discussing D12667. Suggested by: ed MFC after: 2 weeks Modified: head/include/stddef.h Modified: head/include/stddef.h ============================================================================== --- head/include/stddef.h Sat Oct 14 23:25:44 2017 (r324621) +++ head/include/stddef.h Sun Oct 15 02:40:13 2017 (r324622) @@ -70,7 +70,7 @@ typedef __max_align_t max_align_t; #endif #endif -#define offsetof(type, member) __offsetof(type, member) +#define offsetof(type, field) __offsetof(type, field) #if __EXT1_VISIBLE /* ISO/IEC 9899:2011 K.3.3.2 */ From owner-svn-src-head@freebsd.org Sun Oct 15 03:54:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03AD3E39299; Sun, 15 Oct 2017 03:54:17 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5FC869848; Sun, 15 Oct 2017 03:54:16 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: by mail-pf0-f196.google.com with SMTP id d28so13326340pfe.2; Sat, 14 Oct 2017 20:54:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=swni7owpqxRJyyWx+nUxqfyM0Pzi6pJxCYSPr6MFTSY=; b=RjyrfLso4Da+KYEaT8TyLZ8qUOiy64cnFpRwa5Auc728luypnfItyvFRXcn79r5FgG YkpkOyerxCxlPf+dgd0Lu2kg8RmCKSjuuLtUkqlDkq9h2yMyj/vD50XK0HRSCLcB6z/X dDgHND2SJI5JQ7ar6RzmvP4Utpi3eoZxpnY7NCCEQkb7Oji2u1MxnOcCrb3EF00A5SWj /xZjqZB77cBe0u3Y5p+AsRxwi8sEL0nTpvwSgdisxOX5cozIq4Dl/ZVFbLO6SrPzSJot XlNwO9qDsQs+UYUOOMtQxkazq82wotzmM1imRnwkJzOw9YZcPS14Ck9Jub1iQLONcw5d m69A== X-Gm-Message-State: AMCzsaVfknpNNcJB5MJgYHBKyeKJD6VWoAsnXBUkoyvIsrVMTbpDQbpI b1slWJnjdKk8qkFJS+8hT0FUQXRy X-Google-Smtp-Source: AOwi7QBmWwv2BwOwu2V/XNtbL+aXXYJJvQQG4rakjjHIqV39QUJKNYKozbNiumU+kkw7CTw3O0n4Zw== X-Received: by 10.159.197.75 with SMTP id d11mr5030357plo.213.1508025140736; Sat, 14 Oct 2017 16:52:20 -0700 (PDT) Received: from [192.168.2.122] (174-24-242-218.tukw.qwest.net. [174.24.242.218]) by smtp.gmail.com with ESMTPSA id j12sm8709752pfe.160.2017.10.14.16.52.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Oct 2017 16:52:19 -0700 (PDT) Subject: Re: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys To: Mark Johnston Cc: "Ngie Cooper (yaneurabeya)" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710112153.v9BLroeR007323@repo.freebsd.org> <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com> <20171014180305.GA75158@raichu> From: Matt Joras Message-ID: <7fa71bd4-5222-deb3-63f5-828046a4219c@FreeBSD.org> Date: Sat, 14 Oct 2017 16:52:18 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171014180305.GA75158@raichu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 03:54:17 -0000 On 10/14/2017 11:03, Mark Johnston wrote: > TAILQ_FOREACH_SAFE just fetches the next element at the beginning of > each loop iteration rather than at the end, same as the current > implementation of clear_unrhdr() does. There's no change to the code > generated by clang when I replace your loop with: > > TAILQ_FOREACH_SAFE(up, &uh->head, list, uq) { > if (up->ptr != uh) { > Free(up->ptr); > } > Free(up); > } Ah, that's a fair point... I was assuming Ngie was suggesting doing a TAILQ_REMOVE during each iteration, since that's probably the typical reason to do TAILQ_FOREACH_SAFE. That loop looks better. It would probably be good to change the queue(3) manpage to suggest that for deletion. Matt From owner-svn-src-head@freebsd.org Sun Oct 15 08:03:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14C90E3D314; Sun, 15 Oct 2017 08:03:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D624F6E93B; Sun, 15 Oct 2017 08:03:15 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9F83FpA090722; Sun, 15 Oct 2017 08:03:15 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9F83FNO090721; Sun, 15 Oct 2017 08:03:15 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201710150803.v9F83FNO090721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 15 Oct 2017 08:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324623 - head/usr.sbin/ctld X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.sbin/ctld X-SVN-Commit-Revision: 324623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 08:03:16 -0000 Author: bapt Date: Sun Oct 15 08:03:14 2017 New Revision: 324623 URL: https://svnweb.freebsd.org/changeset/base/324623 Log: Fix ctld segfaulting when using ucl conf file format and having duplicated lun or target Submitted by: Nikita Kozlov MFC after: 3 days Sponsored by: blade Differential Revision: https://reviews.freebsd.org/D12646 Modified: head/usr.sbin/ctld/uclparse.c Modified: head/usr.sbin/ctld/uclparse.c ============================================================================== --- head/usr.sbin/ctld/uclparse.c Sun Oct 15 02:40:13 2017 (r324622) +++ head/usr.sbin/ctld/uclparse.c Sun Oct 15 08:03:14 2017 (r324623) @@ -619,6 +619,8 @@ uclparse_target(const char *name, const ucl_object_t * const char *key; target = target_new(conf, name); + if (target == NULL) + return (1); while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); @@ -807,6 +809,8 @@ uclparse_lun(const char *name, const ucl_object_t *top const char *key; lun = lun_new(conf, name); + if (lun == NULL) + return (1); while ((obj = ucl_iterate_object(top, &it, true))) { key = ucl_object_key(obj); From owner-svn-src-head@freebsd.org Sun Oct 15 11:28:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C31C4E40B86; Sun, 15 Oct 2017 11:28:42 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90866739F6; Sun, 15 Oct 2017 11:28:42 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FBSfKO074242; Sun, 15 Oct 2017 11:28:41 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FBSfiZ074241; Sun, 15 Oct 2017 11:28:41 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201710151128.v9FBSfiZ074241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 15 Oct 2017 11:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324625 - head/etc X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 324625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 11:28:42 -0000 Author: jilles Date: Sun Oct 15 11:28:41 2017 New Revision: 324625 URL: https://svnweb.freebsd.org/changeset/base/324625 Log: rc.subr: Remove test that is always true. The code above always sets _pidcmd to a non-empty value. Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Oct 15 10:59:31 2017 (r324624) +++ head/etc/rc.subr Sun Oct 15 11:28:41 2017 (r324625) @@ -930,9 +930,7 @@ run_rc_command() else _pidcmd='rc_pid=$(check_process '"$_procname $command_interpreter"')' fi - if [ -n "$_pidcmd" ]; then - _keywords="${_keywords} status poll" - fi + _keywords="${_keywords} status poll" fi if [ -z "$rc_arg" ]; then From owner-svn-src-head@freebsd.org Sun Oct 15 11:46:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0BD3E4114C; Sun, 15 Oct 2017 11:46:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 807EC742F1; Sun, 15 Oct 2017 11:46:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FBkCs6082390; Sun, 15 Oct 2017 11:46:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FBkBNE082383; Sun, 15 Oct 2017 11:46:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710151146.v9FBkBNE082383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 15 Oct 2017 11:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324626 - head/sys/dev/usb/template X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/usb/template X-SVN-Commit-Revision: 324626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 11:46:13 -0000 Author: trasz Date: Sun Oct 15 11:46:11 2017 New Revision: 324626 URL: https://svnweb.freebsd.org/changeset/base/324626 Log: Replace some magic numbers in usb_template(4) code with #defines. There should be no functional changes. Reviewed by: hselasky MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12670 Modified: head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_midi.c head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_mouse.c head/sys/dev/usb/template/usb_template_phone.c head/sys/dev/usb/template/usb_template_serialnet.c Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Sun Oct 15 11:28:41 2017 (r324625) +++ head/sys/dev/usb/template/usb_template_audio.c Sun Oct 15 11:46:11 2017 (r324626) @@ -199,8 +199,8 @@ static const void *audio_raw_iface_0_desc[] = { static const struct usb_temp_interface_desc audio_iface_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = audio_raw_iface_0_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 1, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOCONTROL, .bInterfaceProtocol = 0, .iInterface = INDEX_AUDIO_MIXER, }; @@ -257,8 +257,8 @@ static const struct usb_temp_endpoint_desc *audio_ifac static const struct usb_temp_interface_desc audio_iface_1_alt_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = NULL, /* no raw descriptors */ - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_AUDIO_PLAYBACK, }; @@ -266,8 +266,8 @@ static const struct usb_temp_interface_desc audio_ifac static const struct usb_temp_interface_desc audio_iface_1_alt_1 = { .ppEndpoints = audio_iface_1_ep, .ppRawDesc = audio_raw_iface_1_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_AUDIO_PLAYBACK, .isAltInterface = 1, /* this is an alternate setting */ @@ -315,8 +315,8 @@ static const struct usb_temp_endpoint_desc *audio_ifac static const struct usb_temp_interface_desc audio_iface_2_alt_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = NULL, /* no raw descriptors */ - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_AUDIO_RECORD, }; @@ -324,8 +324,8 @@ static const struct usb_temp_interface_desc audio_ifac static const struct usb_temp_interface_desc audio_iface_2_alt_1 = { .ppEndpoints = audio_iface_2_ep, .ppRawDesc = audio_raw_iface_2_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_AUDIO_RECORD, .isAltInterface = 1, /* this is an alternate setting */ Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Sun Oct 15 11:28:41 2017 (r324625) +++ head/sys/dev/usb/template/usb_template_kbd.c Sun Oct 15 11:46:11 2017 (r324626) @@ -130,9 +130,9 @@ static const void *keyboard_iface_0_desc[] = { static const struct usb_temp_interface_desc keyboard_iface_0 = { .ppRawDesc = keyboard_iface_0_desc, .ppEndpoints = keyboard_endpoints, - .bInterfaceClass = 3, - .bInterfaceSubClass = 1, - .bInterfaceProtocol = 1, + .bInterfaceClass = UICLASS_HID, + .bInterfaceSubClass = UISUBCLASS_BOOT, + .bInterfaceProtocol = UIPROTO_BOOT_KEYBOARD, .iInterface = INDEX_KEYBOARD, }; Modified: head/sys/dev/usb/template/usb_template_midi.c ============================================================================== --- head/sys/dev/usb/template/usb_template_midi.c Sun Oct 15 11:28:41 2017 (r324625) +++ head/sys/dev/usb/template/usb_template_midi.c Sun Oct 15 11:46:11 2017 (r324626) @@ -89,8 +89,8 @@ static const void *midi_descs_0[] = { static const struct usb_temp_interface_desc midi_iface_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = midi_descs_0, - .bInterfaceClass = 1, - .bInterfaceSubClass = 1, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOCONTROL, .bInterfaceProtocol = 0, .iInterface = INDEX_MIDI_IF, }; @@ -171,8 +171,8 @@ static const void *midi_descs_1[] = { static const struct usb_temp_interface_desc midi_iface_1 = { .ppRawDesc = midi_descs_1, .ppEndpoints = midi_iface_1_ep, - .bInterfaceClass = 0x01, /* MIDI */ - .bInterfaceSubClass = 3, /* MIDI streaming */ + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_MIDISTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_MIDI_IF, }; Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Sun Oct 15 11:28:41 2017 (r324625) +++ head/sys/dev/usb/template/usb_template_modem.c Sun Oct 15 11:46:11 2017 (r324626) @@ -156,17 +156,17 @@ static const void *modem_iface_0_desc[] = { static const struct usb_temp_interface_desc modem_iface_0 = { .ppRawDesc = modem_iface_0_desc, .ppEndpoints = modem_iface_0_ep, - .bInterfaceClass = 2, - .bInterfaceSubClass = 2, - .bInterfaceProtocol = 1, + .bInterfaceClass = UICLASS_CDC, + .bInterfaceSubClass = UISUBCLASS_ABSTRACT_CONTROL_MODEL, + .bInterfaceProtocol = UIPROTO_CDC_AT, .iInterface = INDEX_MODEM, }; static const struct usb_temp_interface_desc modem_iface_1 = { .ppEndpoints = modem_iface_1_ep, - .bInterfaceClass = 10, - .bInterfaceSubClass = 0, - .bInterfaceProtocol = 0, + .bInterfaceClass = UICLASS_CDC_DATA, + .bInterfaceSubClass = UISUBCLASS_DATA, + .bInterfaceProtocol = UIPROTO_CDC_NONE, .iInterface = INDEX_MODEM, }; Modified: head/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mouse.c Sun Oct 15 11:28:41 2017 (r324625) +++ head/sys/dev/usb/template/usb_template_mouse.c Sun Oct 15 11:46:11 2017 (r324626) @@ -128,9 +128,9 @@ static const void *mouse_iface_0_desc[] = { static const struct usb_temp_interface_desc mouse_iface_0 = { .ppRawDesc = mouse_iface_0_desc, .ppEndpoints = mouse_endpoints, - .bInterfaceClass = 3, - .bInterfaceSubClass = 1, - .bInterfaceProtocol = 2, + .bInterfaceClass = UICLASS_HID, + .bInterfaceSubClass = UISUBCLASS_BOOT, + .bInterfaceProtocol = UIPROTO_MOUSE, .iInterface = INDEX_MOUSE, }; Modified: head/sys/dev/usb/template/usb_template_phone.c ============================================================================== --- head/sys/dev/usb/template/usb_template_phone.c Sun Oct 15 11:28:41 2017 (r324625) +++ head/sys/dev/usb/template/usb_template_phone.c Sun Oct 15 11:46:11 2017 (r324626) @@ -156,8 +156,8 @@ static const void *phone_raw_iface_0_desc[] = { static const struct usb_temp_interface_desc phone_iface_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = phone_raw_iface_0_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 1, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOCONTROL, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_MIXER, }; @@ -213,8 +213,8 @@ static const struct usb_temp_endpoint_desc *phone_ifac static const struct usb_temp_interface_desc phone_iface_1_alt_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = NULL, /* no raw descriptors */ - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_PLAYBACK, }; @@ -222,8 +222,8 @@ static const struct usb_temp_interface_desc phone_ifac static const struct usb_temp_interface_desc phone_iface_1_alt_1 = { .ppEndpoints = phone_iface_1_ep, .ppRawDesc = phone_raw_iface_1_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_PLAYBACK, .isAltInterface = 1, /* this is an alternate setting */ @@ -270,8 +270,8 @@ static const struct usb_temp_endpoint_desc *phone_ifac static const struct usb_temp_interface_desc phone_iface_2_alt_0 = { .ppEndpoints = NULL, /* no endpoints */ .ppRawDesc = NULL, /* no raw descriptors */ - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_RECORD, }; @@ -279,8 +279,8 @@ static const struct usb_temp_interface_desc phone_ifac static const struct usb_temp_interface_desc phone_iface_2_alt_1 = { .ppEndpoints = phone_iface_2_ep, .ppRawDesc = phone_raw_iface_2_desc, - .bInterfaceClass = 1, - .bInterfaceSubClass = 2, + .bInterfaceClass = UICLASS_AUDIO, + .bInterfaceSubClass = UISUBCLASS_AUDIOSTREAM, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_RECORD, .isAltInterface = 1, /* this is an alternate setting */ @@ -321,7 +321,7 @@ static const struct usb_temp_endpoint_desc *phone_ifac static const struct usb_temp_interface_desc phone_iface_3 = { .ppEndpoints = phone_iface_3_ep, .ppRawDesc = phone_hid_desc_0, - .bInterfaceClass = 3, + .bInterfaceClass = UICLASS_HID, .bInterfaceSubClass = 0, .bInterfaceProtocol = 0, .iInterface = INDEX_PHONE_HID, Modified: head/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- head/sys/dev/usb/template/usb_template_serialnet.c Sun Oct 15 11:28:41 2017 (r324625) +++ head/sys/dev/usb/template/usb_template_serialnet.c Sun Oct 15 11:46:11 2017 (r324626) @@ -202,7 +202,7 @@ static const struct usb_temp_interface_desc eth_contro .ppRawDesc = eth_control_if_desc, .bInterfaceClass = UICLASS_CDC, .bInterfaceSubClass = UISUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL, - .bInterfaceProtocol = 0, + .bInterfaceProtocol = UIPROTO_CDC_NONE, .iInterface = STRING_ETH_CONTROL_INDEX, }; @@ -215,7 +215,7 @@ static const struct usb_temp_endpoint_desc *eth_data_e static const struct usb_temp_interface_desc eth_data_null_interface = { .ppEndpoints = NULL, /* no endpoints */ .bInterfaceClass = UICLASS_CDC_DATA, - .bInterfaceSubClass = 0, + .bInterfaceSubClass = UISUBCLASS_DATA, .bInterfaceProtocol = 0, .iInterface = STRING_ETH_DATA_INDEX, }; @@ -304,16 +304,16 @@ static const void *modem_iface_0_desc[] = { static const struct usb_temp_interface_desc modem_iface_0 = { .ppRawDesc = modem_iface_0_desc, .ppEndpoints = modem_iface_0_ep, - .bInterfaceClass = 2, - .bInterfaceSubClass = 2, - .bInterfaceProtocol = 1, + .bInterfaceClass = UICLASS_CDC, + .bInterfaceSubClass = UISUBCLASS_ABSTRACT_CONTROL_MODEL, + .bInterfaceProtocol = UIPROTO_CDC_AT, .iInterface = STRING_MODEM_INDEX, }; static const struct usb_temp_interface_desc modem_iface_1 = { .ppEndpoints = modem_iface_1_ep, - .bInterfaceClass = 10, - .bInterfaceSubClass = 0, + .bInterfaceClass = UICLASS_CDC_DATA, + .bInterfaceSubClass = UISUBCLASS_DATA, .bInterfaceProtocol = 0, .iInterface = STRING_MODEM_INDEX, }; From owner-svn-src-head@freebsd.org Sun Oct 15 16:03:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCBFDE45E6F; Sun, 15 Oct 2017 16:03:46 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AA2E7E8AA; Sun, 15 Oct 2017 16:03:46 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FG3jJ0090992; Sun, 15 Oct 2017 16:03:45 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FG3jUH090991; Sun, 15 Oct 2017 16:03:45 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201710151603.v9FG3jUH090991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 15 Oct 2017 16:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324628 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 324628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 16:03:46 -0000 Author: tijl Date: Sun Oct 15 16:03:45 2017 New Revision: 324628 URL: https://svnweb.freebsd.org/changeset/base/324628 Log: Use sizeof instead of strlen on string constants. The compiler doesn't optimise the strlen calls away with -ffreestanding. Modified: head/sys/compat/linux/linux_util.c Modified: head/sys/compat/linux/linux_util.c ============================================================================== --- head/sys/compat/linux/linux_util.c Sun Oct 15 14:03:53 2017 (r324627) +++ head/sys/compat/linux/linux_util.c Sun Oct 15 16:03:45 2017 (r324628) @@ -128,32 +128,31 @@ linux_driver_get_major_minor(const char *node, int *ma { struct device_element *de; unsigned long devno; + size_t sz; if (node == NULL || major == NULL || minor == NULL) return 1; - if (strlen(node) > strlen("pts/") && - strncmp(node, "pts/", strlen("pts/")) == 0) { + sz = sizeof("pts/") - 1; + if (strncmp(node, "pts/", sz) == 0 && node[sz] != '\0') { /* * Linux checks major and minors of the slave device * to make sure it's a pty device, so let's make him * believe it is. */ - devno = strtoul(node + strlen("pts/"), NULL, 10); + devno = strtoul(node + sz, NULL, 10); *major = 136 + (devno / 256); *minor = devno % 256; - return (0); } - if ((strlen(node) > strlen("drm/") && - strncmp(node, "drm/", strlen("drm/")) == 0) ) { - devno = strtoul(node + strlen("drm/"), NULL, 10); + sz = sizeof("drm/") - 1; + if (strncmp(node, "drm/", sz) == 0 && node[sz] != '\0') { + devno = strtoul(node + sz, NULL, 10); *major = 226 + (devno / 256); *minor = devno % 256; return (0); } - TAILQ_FOREACH(de, &devices, list) { if (strcmp(node, de->entry.bsd_device_name) == 0) { From owner-svn-src-head@freebsd.org Sun Oct 15 16:08:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1034AE45F12; Sun, 15 Oct 2017 16:08:24 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D21347EA19; Sun, 15 Oct 2017 16:08:23 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FG8NGj091348; Sun, 15 Oct 2017 16:08:23 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FG8NPc091347; Sun, 15 Oct 2017 16:08:23 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201710151608.v9FG8NPc091347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 15 Oct 2017 16:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324629 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 324629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 16:08:24 -0000 Author: tijl Date: Sun Oct 15 16:08:22 2017 New Revision: 324629 URL: https://svnweb.freebsd.org/changeset/base/324629 Log: Add special handling for current in-tree drm devices, like r323692 added for drm-next. Modified: head/sys/compat/linux/linux_util.c Modified: head/sys/compat/linux/linux_util.c ============================================================================== --- head/sys/compat/linux/linux_util.c Sun Oct 15 16:03:45 2017 (r324628) +++ head/sys/compat/linux/linux_util.c Sun Oct 15 16:08:22 2017 (r324629) @@ -146,6 +146,27 @@ linux_driver_get_major_minor(const char *node, int *ma return (0); } + sz = sizeof("dri/card") - 1; + if (strncmp(node, "dri/card", sz) == 0 && node[sz] != '\0') { + devno = strtoul(node + sz, NULL, 10); + *major = 226 + (devno / 256); + *minor = devno % 256; + return (0); + } + sz = sizeof("dri/controlD") - 1; + if (strncmp(node, "dri/controlD", sz) == 0 && node[sz] != '\0') { + devno = strtoul(node + sz, NULL, 10); + *major = 226 + (devno / 256); + *minor = devno % 256; + return (0); + } + sz = sizeof("dri/renderD") - 1; + if (strncmp(node, "dri/renderD", sz) == 0 && node[sz] != '\0') { + devno = strtoul(node + sz, NULL, 10); + *major = 226 + (devno / 256); + *minor = devno % 256; + return (0); + } sz = sizeof("drm/") - 1; if (strncmp(node, "drm/", sz) == 0 && node[sz] != '\0') { devno = strtoul(node + sz, NULL, 10); From owner-svn-src-head@freebsd.org Sun Oct 15 16:17:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9156CE46127; Sun, 15 Oct 2017 16:17:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 613907EE43; Sun, 15 Oct 2017 16:17:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FGHt0h095813; Sun, 15 Oct 2017 16:17:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FGHtfE095811; Sun, 15 Oct 2017 16:17:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710151617.v9FGHtfE095811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 15 Oct 2017 16:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324630 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 324630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 16:17:56 -0000 Author: imp Date: Sun Oct 15 16:17:55 2017 New Revision: 324630 URL: https://svnweb.freebsd.org/changeset/base/324630 Log: Update comment to reflect actual default timeout. Sponsored by: Netflix Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Sun Oct 15 16:08:22 2017 (r324629) +++ head/sys/cam/nvme/nvme_da.c Sun Oct 15 16:17:55 2017 (r324630) @@ -189,7 +189,7 @@ nda_nvme_flush(struct nda_softc *softc, struct ccb_nvm CAM_DIR_NONE, /* flags */ NULL, /* data_ptr */ 0, /* dxfer_len */ - nda_default_timeout * 1000); /* timeout 5s */ + nda_default_timeout * 1000); /* timeout 30s */ nvme_ns_flush_cmd(&nvmeio->cmd, softc->nsid); } @@ -203,7 +203,7 @@ nda_nvme_trim(struct nda_softc *softc, struct ccb_nvme CAM_DIR_OUT, /* flags */ payload, /* data_ptr */ num_ranges * sizeof(struct nvme_dsm_range), /* dxfer_len */ - nda_default_timeout * 1000); /* timeout 5s */ + nda_default_timeout * 1000); /* timeout 30s */ nvme_ns_trim_cmd(&nvmeio->cmd, softc->nsid, num_ranges); } @@ -217,7 +217,7 @@ nda_nvme_write(struct nda_softc *softc, struct ccb_nvm CAM_DIR_OUT, /* flags */ payload, /* data_ptr */ len, /* dxfer_len */ - nda_default_timeout * 1000); /* timeout 5s */ + nda_default_timeout * 1000); /* timeout 30s */ nvme_ns_write_cmd(&nvmeio->cmd, softc->nsid, lba, count); } @@ -246,7 +246,7 @@ nda_nvme_rw_bio(struct nda_softc *softc, struct ccb_nv flags, /* flags */ payload, /* data_ptr */ bp->bio_bcount, /* dxfer_len */ - nda_default_timeout * 1000); /* timeout 5s */ + nda_default_timeout * 1000); /* timeout 30s */ nvme_ns_rw_cmd(&nvmeio->cmd, rwcmd, softc->nsid, lba, count); } From owner-svn-src-head@freebsd.org Sun Oct 15 16:18:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CABA5E4614E; Sun, 15 Oct 2017 16:18:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BF527EE56; Sun, 15 Oct 2017 16:18:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FGHxP3095916; Sun, 15 Oct 2017 16:17:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FGHxA2095914; Sun, 15 Oct 2017 16:17:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710151617.v9FGHxA2095914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 15 Oct 2017 16:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324631 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 324631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 16:18:01 -0000 Author: imp Date: Sun Oct 15 16:17:59 2017 New Revision: 324631 URL: https://svnweb.freebsd.org/changeset/base/324631 Log: Explicitly set reserved fields and 'fuse' to 0. This prevents us from acidentally sending bogus values in these fields, which some drives may reject with an error or worse (undefined behavior). This is especially needed for the ndadump routine which allocates the cmd from stack garbage.... Sponsored by: Netflix Modified: head/sys/dev/nvme/nvme.h Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Sun Oct 15 16:17:55 2017 (r324630) +++ head/sys/dev/nvme/nvme.h Sun Oct 15 16:17:59 2017 (r324631) @@ -1082,7 +1082,11 @@ void nvme_ns_rw_cmd(struct nvme_command *cmd, uint32_t uint64_t lba, uint32_t count) { cmd->opc = rwcmd; + cmd->fuse = 0; + cmd->rsvd1 = 0; cmd->nsid = nsid; + cmd->rsvd2 = 0; + cmd->rsvd3 = 0; cmd->cdw10 = lba & 0xffffffffu; cmd->cdw11 = lba >> 32; cmd->cdw12 = count-1; From owner-svn-src-head@freebsd.org Sun Oct 15 16:18:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3690E46182; Sun, 15 Oct 2017 16:18:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE3837EEB8; Sun, 15 Oct 2017 16:18:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FGI349095973; Sun, 15 Oct 2017 16:18:03 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FGI3IV095972; Sun, 15 Oct 2017 16:18:03 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710151618.v9FGI3IV095972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 15 Oct 2017 16:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324632 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 324632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 16:18:05 -0000 Author: imp Date: Sun Oct 15 16:18:03 2017 New Revision: 324632 URL: https://svnweb.freebsd.org/changeset/base/324632 Log: Be nicer on the dump stack by allocating only a ccb_nvmeio rather than a full ccb. This saves a few hundre bytes, which might be important during a crash dump... Sponsored by: Netflix Suggested by: scottl@ Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Sun Oct 15 16:17:59 2017 (r324631) +++ head/sys/cam/nvme/nvme_da.c Sun Oct 15 16:18:03 2017 (r324632) @@ -379,7 +379,7 @@ ndadump(void *arg, void *virtual, vm_offset_t physical struct cam_periph *periph; struct nda_softc *softc; u_int secsize; - union ccb ccb; + struct ccb_nvmeio nvmeio; struct disk *dp; uint64_t lba; uint32_t count; @@ -399,15 +399,15 @@ ndadump(void *arg, void *virtual, vm_offset_t physical } if (length > 0) { - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - ccb.ccb_h.ccb_state = NDA_CCB_DUMP; - nda_nvme_write(softc, &ccb.nvmeio, virtual, lba, length, count); - xpt_polled_action(&ccb); + xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP; + nda_nvme_write(softc, &nvmeio, virtual, lba, length, count); + xpt_polled_action((union ccb *)&nvmeio); - error = cam_periph_error(&ccb, + error = cam_periph_error((union ccb *)&nvmeio, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + if ((nvmeio.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(nvmeio.ccb_h.path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, /*getcount_only*/0); if (error != 0) printf("Aborting dump due to I/O error.\n"); @@ -417,16 +417,16 @@ ndadump(void *arg, void *virtual, vm_offset_t physical } /* Flush */ - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - ccb.ccb_h.ccb_state = NDA_CCB_DUMP; - nda_nvme_flush(softc, &ccb.nvmeio); - xpt_polled_action(&ccb); + nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP; + nda_nvme_flush(softc, &nvmeio); + xpt_polled_action((union ccb *)&nvmeio); - error = cam_periph_error(&ccb, + error = cam_periph_error((union ccb *)&nvmeio, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + if ((nvmeio.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(nvmeio.ccb_h.path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, /*getcount_only*/0); if (error != 0) xpt_print(periph->path, "flush cmd failed\n"); From owner-svn-src-head@freebsd.org Sun Oct 15 16:18:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0DEAE461BF; Sun, 15 Oct 2017 16:18:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 696187EF3F; Sun, 15 Oct 2017 16:18:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FGI8S3096030; Sun, 15 Oct 2017 16:18:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FGI8mA096028; Sun, 15 Oct 2017 16:18:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710151618.v9FGI8mA096028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 15 Oct 2017 16:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324633 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 324633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 16:18:09 -0000 Author: imp Date: Sun Oct 15 16:18:08 2017 New Revision: 324633 URL: https://svnweb.freebsd.org/changeset/base/324633 Log: Create general polling function for the nvme controller. Use it when we're doing the various pin-based interrupt modes. Adjust nvme_ctrlr_intx_handler to use nvme_ctrlr_poll. Sponsored by: Netflix Suggested by: scottl@ Modified: head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Sun Oct 15 16:18:03 2017 (r324632) +++ head/sys/dev/nvme/nvme_ctrlr.c Sun Oct 15 16:18:08 2017 (r324633) @@ -815,18 +815,33 @@ nvme_ctrlr_reset_task(void *arg, int pending) atomic_cmpset_32(&ctrlr->is_resetting, 1, 0); } +/* + * Poll all the queues enabled on the device for completion. + */ void -nvme_ctrlr_intx_handler(void *arg) +nvme_ctrlr_poll(struct nvme_controller *ctrlr) { - struct nvme_controller *ctrlr = arg; + int i; - nvme_mmio_write_4(ctrlr, intms, 1); - nvme_qpair_process_completions(&ctrlr->adminq); - if (ctrlr->ioq && ctrlr->ioq[0].cpl) - nvme_qpair_process_completions(&ctrlr->ioq[0]); + for (i = 0; i < ctrlr->num_io_queues; i++) + if (ctrlr->ioq && ctrlr->ioq[i].cpl) + nvme_qpair_process_completions(&ctrlr->ioq[i]); +} +/* + * Poll the single-vector intertrupt case: num_io_queues will be 1 and + * there's only a single vector. While we're polling, we mask further + * interrupts in the controller. + */ +void +nvme_ctrlr_intx_handler(void *arg) +{ + struct nvme_controller *ctrlr = arg; + + nvme_mmio_write_4(ctrlr, intms, 1); + nvme_ctrlr_poll(ctrlr); nvme_mmio_write_4(ctrlr, intmc, 1); } Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Sun Oct 15 16:18:03 2017 (r324632) +++ head/sys/dev/nvme/nvme_private.h Sun Oct 15 16:18:08 2017 (r324633) @@ -542,5 +542,6 @@ void nvme_notify_fail_consumers(struct nvme_controller void nvme_notify_new_controller(struct nvme_controller *ctrlr); void nvme_ctrlr_intx_handler(void *arg); +void nvme_ctrlr_poll(struct nvme_controller *ctrlr); #endif /* __NVME_PRIVATE_H__ */ From owner-svn-src-head@freebsd.org Sun Oct 15 16:19:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEB0DE462F9; Sun, 15 Oct 2017 16:19:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CE937F3D6; Sun, 15 Oct 2017 16:19:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FGJ9Dn096165; Sun, 15 Oct 2017 16:19:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FGJ9pG096164; Sun, 15 Oct 2017 16:19:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710151619.v9FGJ9pG096164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 15 Oct 2017 16:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324634 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 324634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 16:19:10 -0000 Author: imp Date: Sun Oct 15 16:19:09 2017 New Revision: 324634 URL: https://svnweb.freebsd.org/changeset/base/324634 Log: Use nvme_ctrlr_poll instead of nvme_ctrlr_intx_handler since it is more general and doesn't try to access registers that may be undefined when the card is in MSIX mode. This change, along with r324630, r324631, r324632, makes nda crash dumps work again. Previously, they only worked on CPU 0 when the stack garbage was just so. Sponsored by: Netflix Suggested by: scottl@ (who provided earlier version of the patch) Modified: head/sys/dev/nvme/nvme_sim.c Modified: head/sys/dev/nvme/nvme_sim.c ============================================================================== --- head/sys/dev/nvme/nvme_sim.c Sun Oct 15 16:18:08 2017 (r324633) +++ head/sys/dev/nvme/nvme_sim.c Sun Oct 15 16:19:09 2017 (r324634) @@ -246,7 +246,7 @@ static void nvme_sim_poll(struct cam_sim *sim) { - nvme_ctrlr_intx_handler(sim2ctrlr(sim)); + nvme_ctrlr_poll(sim2ctrlr(sim)); } static void * From owner-svn-src-head@freebsd.org Sun Oct 15 18:53:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA438E48C32; Sun, 15 Oct 2017 18:53:22 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79D6282E5E; Sun, 15 Oct 2017 18:53:22 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FIrLeW064064; Sun, 15 Oct 2017 18:53:21 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FIrLqR064063; Sun, 15 Oct 2017 18:53:21 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201710151853.v9FIrLqR064063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 15 Oct 2017 18:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324635 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 18:53:22 -0000 Author: tijl Date: Sun Oct 15 18:53:21 2017 New Revision: 324635 URL: https://svnweb.freebsd.org/changeset/base/324635 Log: When a Linux program tries to access a /path the kernel tries /compat/linux/path before /path. Stop following symbolic links when looking up /compat/linux/path so dead symbolic links aren't ignored. This allows syscalls like readlink(2) and lstat(2) to work on such links. And open(2) will return an error now instead of trying /path. Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sun Oct 15 16:19:09 2017 (r324634) +++ head/sys/kern/vfs_lookup.c Sun Oct 15 18:53:21 2017 (r324635) @@ -1390,13 +1390,13 @@ kern_alternate_path(struct thread *td, const char *pre for (cp = &ptr[len] - 1; *cp != '/'; cp--); *cp = '\0'; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, buf, td); error = namei(&nd); *cp = '/'; if (error != 0) goto keeporig; } else { - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, buf, td); error = namei(&nd); if (error != 0) From owner-svn-src-head@freebsd.org Sun Oct 15 19:21:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8754DE49310; Sun, 15 Oct 2017 19:21:16 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 555DD83A9E; Sun, 15 Oct 2017 19:21:16 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FJLF34073653; Sun, 15 Oct 2017 19:21:15 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FJLFJL073652; Sun, 15 Oct 2017 19:21:15 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201710151921.v9FJLFJL073652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 15 Oct 2017 19:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324636 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 324636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 19:21:16 -0000 Author: tijl Date: Sun Oct 15 19:21:15 2017 New Revision: 324636 URL: https://svnweb.freebsd.org/changeset/base/324636 Log: Set DEVNAME to dri/card%d. This works with both in-tree drm and drm-next and is also the value used on Linux. Tested by: Greg V Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Sun Oct 15 18:53:21 2017 (r324635) +++ head/sys/compat/linsysfs/linsysfs.c Sun Oct 15 19:21:15 2017 (r324636) @@ -205,8 +205,8 @@ linsysfs_fill_uevent_drm(PFS_FILL_ARGS) dev = (device_t)pn->pn_data; unit = device_get_unit(dev); sbuf_printf(sb, - "MAJOR=226\nMINOR=%d\nDEVNAME=drm/%d\nDEVTYPE=dri_minor\n", unit, - unit); + "MAJOR=226\nMINOR=%d\nDEVNAME=dri/card%d\nDEVTYPE=dri_minor\n", + unit, unit); return (0); } From owner-svn-src-head@freebsd.org Sun Oct 15 19:28:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7625E49564; Sun, 15 Oct 2017 19:28:15 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 935BB83DA8; Sun, 15 Oct 2017 19:28:15 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FJSEYb077002; Sun, 15 Oct 2017 19:28:14 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FJSEXu077001; Sun, 15 Oct 2017 19:28:14 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201710151928.v9FJSEXu077001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 15 Oct 2017 19:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324637 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 324637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 19:28:15 -0000 Author: tijl Date: Sun Oct 15 19:28:14 2017 New Revision: 324637 URL: https://svnweb.freebsd.org/changeset/base/324637 Log: Add information needed by Linux libdrm 2.4.74 (shipped with CentOS 7.4). Create a config file for PCI devices that exposes their configuration space. Only fields needed by libdrm are filled in (vendor, device, revision, subvendor and subdevice). Link /sys/class/drm/card%d/device to the PCI device directory. Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Sun Oct 15 19:21:15 2017 (r324636) +++ head/sys/compat/linsysfs/linsysfs.c Sun Oct 15 19:28:14 2017 (r324637) @@ -175,6 +175,33 @@ linsysfs_fill_revid(PFS_FILL_ARGS) return (0); } +static int +linsysfs_fill_config(PFS_FILL_ARGS) +{ + uint8_t config[48]; + device_t dev; + uint32_t reg; + + dev = (device_t)pn->pn_data; + bzero(config, sizeof(config)); + reg = pci_get_vendor(dev); + config[0] = reg; + config[1] = reg >> 8; + reg = pci_get_device(dev); + config[2] = reg; + config[3] = reg >> 8; + reg = pci_get_revid(dev); + config[8] = reg; + reg = pci_get_subvendor(dev); + config[44] = reg; + config[45] = reg >> 8; + reg = pci_get_subdevice(dev); + config[46] = reg; + config[47] = reg >> 8; + sbuf_bcat(sb, config, sizeof(config)); + return (0); +} + /* * Filler function for PCI uevent file */ @@ -247,20 +274,20 @@ linsysfs_fill_vgapci(PFS_FILL_ARGS) #define PCI_DEV "pci" #define DRMN_DEV "drmn" static int -linsysfs_run_bus(device_t dev, struct pfs_node *dir, struct pfs_node *scsi, struct pfs_node *chardev, - char *path, char *prefix) +linsysfs_run_bus(device_t dev, struct pfs_node *dir, struct pfs_node *scsi, + struct pfs_node *chardev, struct pfs_node *drm, char *path, char *prefix) { struct scsi_host_queue *scsi_host; - struct pfs_node *sub_dir, *cur_file, *cur_chardev; + struct pfs_node *sub_dir, *cur_file; int i, nchildren, error; device_t *children, parent; devclass_t devclass; const char *name = NULL; struct pci_devinfo *dinfo; - char *device, *host, *new_path, *chardevname; + char *device, *host, *new_path, *devname; new_path = path; - chardevname = malloc(16, M_TEMP, M_WAITOK); + devname = malloc(16, M_TEMP, M_WAITOK); parent = device_get_parent(dev); if (parent) { @@ -308,6 +335,10 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s &linsysfs_fill_revid, NULL, NULL, NULL, PFS_RD); cur_file->pn_data = (void*)dev; + cur_file = pfs_create_file(dir, "config", + &linsysfs_fill_config, NULL, NULL, NULL, + PFS_RD); + cur_file->pn_data = (void*)dev; cur_file = pfs_create_file(dir, "uevent", &linsysfs_fill_uevent_pci, NULL, NULL, NULL, PFS_RD); @@ -362,18 +393,26 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s device_get_unit(dev) >= 0) { dinfo = device_get_ivars(parent); if (dinfo != NULL && dinfo->cfg.baseclass == PCIC_DISPLAY) { - sprintf(chardevname, "226:%d", + sprintf(devname, "226:%d", device_get_unit(dev)); - cur_chardev = pfs_create_dir(chardev, - chardevname, NULL, NULL, NULL, 0); - cur_file = pfs_create_link(cur_chardev, + sub_dir = pfs_create_dir(chardev, + devname, NULL, NULL, NULL, 0); + cur_file = pfs_create_link(sub_dir, "device", &linsysfs_fill_vgapci, NULL, NULL, NULL, PFS_RD); cur_file->pn_data = (void*)dir; - cur_file = pfs_create_file(cur_chardev, + cur_file = pfs_create_file(sub_dir, "uevent", &linsysfs_fill_uevent_drm, NULL, NULL, NULL, PFS_RD); cur_file->pn_data = (void*)dev; + sprintf(devname, "card%d", + device_get_unit(dev)); + sub_dir = pfs_create_dir(drm, + devname, NULL, NULL, NULL, 0); + cur_file = pfs_create_link(sub_dir, + "device", &linsysfs_fill_vgapci, NULL, + NULL, NULL, PFS_RD); + cur_file->pn_data = (void*)dir; } } } @@ -383,12 +422,12 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s for (i = 0; i < nchildren; i++) if (children[i]) linsysfs_run_bus(children[i], dir, scsi, - chardev, new_path, prefix); + chardev, drm, new_path, prefix); free(children, M_TEMP); } if (new_path != path) free(new_path, M_TEMP); - free(chardevname, M_TEMP); + free(devname, M_TEMP); return (1); } @@ -449,7 +488,9 @@ static int linsysfs_init(PFS_INIT_ARGS) { struct pfs_node *root; + struct pfs_node *class; struct pfs_node *dir, *sys, *cpu; + struct pfs_node *drm; struct pfs_node *pci; struct pfs_node *scsi; struct pfs_node *devdir, *chardev; @@ -461,26 +502,25 @@ linsysfs_init(PFS_INIT_ARGS) root = pi->pi_root; /* /sys/class/... */ - scsi = pfs_create_dir(root, "class", NULL, NULL, NULL, 0); - scsi = pfs_create_dir(scsi, "scsi_host", NULL, NULL, NULL, 0); + class = pfs_create_dir(root, "class", NULL, NULL, NULL, 0); + scsi = pfs_create_dir(class, "scsi_host", NULL, NULL, NULL, 0); + drm = pfs_create_dir(class, "drm", NULL, NULL, NULL, 0); - /* /sys/devices */ - dir = pfs_create_dir(root, "devices", NULL, NULL, NULL, 0); - - /* /sys/devices/pci0000:00 */ - pci = pfs_create_dir(dir, "pci0000:00", NULL, NULL, NULL, 0); - - /* /sys/dev/char */ + /* /sys/dev/... */ devdir = pfs_create_dir(root, "dev", NULL, NULL, NULL, 0); chardev = pfs_create_dir(devdir, "char", NULL, NULL, NULL, 0); + /* /sys/devices/... */ + dir = pfs_create_dir(root, "devices", NULL, NULL, NULL, 0); + pci = pfs_create_dir(dir, "pci0000:00", NULL, NULL, NULL, 0); + devclass = devclass_find("root"); if (devclass == NULL) { return (0); } dev = devclass_get_device(devclass, 0); - linsysfs_run_bus(dev, pci, scsi, chardev, "/pci0000:00", "0000"); + linsysfs_run_bus(dev, pci, scsi, chardev, drm, "/pci0000:00", "0000"); /* /sys/devices/system */ sys = pfs_create_dir(dir, "system", NULL, NULL, NULL, 0); From owner-svn-src-head@freebsd.org Sun Oct 15 19:33:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E19BE49719; Sun, 15 Oct 2017 19:33:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D408484164; Sun, 15 Oct 2017 19:33:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FJXVs9080843; Sun, 15 Oct 2017 19:33:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FJXVcA080842; Sun, 15 Oct 2017 19:33:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201710151933.v9FJXVcA080842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 15 Oct 2017 19:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324638 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 19:33:32 -0000 Author: tuexen Date: Sun Oct 15 19:33:30 2017 New Revision: 324638 URL: https://svnweb.freebsd.org/changeset/base/324638 Log: Fix the handling of parital and too short chunks. Ensure that the current behaviour is consistent: stop processing of the chunk, but finish the processing of the previous chunks. This behaviour might be changed in a later commit to ABORT the assoication due to a protocol violation, but changing this is a separate issue. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Oct 15 19:28:14 2017 (r324637) +++ head/sys/netinet/sctp_input.c Sun Oct 15 19:33:30 2017 (r324638) @@ -4518,7 +4518,6 @@ sctp_process_control(struct mbuf *m, int iphlen, int * * until we get into jumbo grams and such.. */ uint8_t chunk_buf[SCTP_CHUNK_BUFFER_SIZE]; - struct sctp_tcb *locked_tcb = stcb; int got_auth = 0; uint32_t auth_offset = 0, auth_len = 0; int auth_skipped = 0; @@ -4530,31 +4529,28 @@ sctp_process_control(struct mbuf *m, int iphlen, int * SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_control: iphlen=%u, offset=%u, length=%u stcb:%p\n", iphlen, *offset, length, (void *)stcb); + if (stcb) { + SCTP_TCB_LOCK_ASSERT(stcb); + } /* validate chunk header length... */ if (ntohs(ch->chunk_length) < sizeof(*ch)) { SCTPDBG(SCTP_DEBUG_INPUT1, "Invalid header length %d\n", ntohs(ch->chunk_length)); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } /* * validate the verification tag */ vtag_in = ntohl(sh->v_tag); - if (locked_tcb) { - SCTP_TCB_LOCK_ASSERT(locked_tcb); - } if (ch->chunk_type == SCTP_INITIATION) { SCTPDBG(SCTP_DEBUG_INPUT1, "Its an INIT of len:%d vtag:%x\n", ntohs(ch->chunk_length), vtag_in); if (vtag_in != 0) { /* protocol error- silently discard... */ SCTP_STAT_INCR(sctps_badvtag); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4577,9 +4573,6 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (*offset >= length) { /* no more data left in the mbuf chain */ *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, @@ -4588,10 +4581,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (ch == NULL) { /* Help */ *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } if (ch->chunk_type == SCTP_COOKIE_ECHO) { goto process_control_chunks; @@ -4628,10 +4618,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * * sctp_findassociation_ep_asconf(). */ SCTP_INP_DECR_REF(inp); - } else { - locked_tcb = stcb; } - /* now go back and verify any auth chunk to be sure */ if (auth_skipped && (stcb != NULL)) { struct sctp_auth_chunk *auth; @@ -4645,10 +4632,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * auth_offset)) { /* auth HMAC failed so dump it */ *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } else { /* remaining chunks are HMAC checked */ stcb->asoc.authenticated = 1; @@ -4664,9 +4648,6 @@ sctp_process_control(struct mbuf *m, int iphlen, int * mflowtype, mflowid, inp->fibnum, vrf_id, port); *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } return (NULL); } asoc = &stcb->asoc; @@ -4684,8 +4665,8 @@ sctp_process_control(struct mbuf *m, int iphlen, int * } else { /* drop this packet... */ SCTP_STAT_INCR(sctps_badvtag); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4698,8 +4679,8 @@ sctp_process_control(struct mbuf *m, int iphlen, int * * but it won't complete until the shutdown * is completed */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } snprintf(msg, sizeof(msg), "OOTB, %s:%d at %s", __FILE__, __LINE__, __func__); op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), @@ -4718,8 +4699,8 @@ sctp_process_control(struct mbuf *m, int iphlen, int * "invalid vtag: %xh, expect %xh\n", vtag_in, asoc->my_vtag); SCTP_STAT_INCR(sctps_badvtag); - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } *offset = length; return (NULL); @@ -4755,10 +4736,7 @@ process_control_chunks: if (chk_length < sizeof(*ch) || (*offset + (int)chk_length) > length) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } SCTP_STAT_INCR_COUNTER64(sctps_incontrolchunks); /* @@ -4773,8 +4751,8 @@ process_control_chunks: sizeof(struct sctp_init_ack_chunk), chunk_buf); if (ch == NULL) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4796,8 +4774,8 @@ process_control_chunks: chunk_buf); if (ch == NULL) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4808,8 +4786,8 @@ process_control_chunks: if (ch == NULL) { SCTP_PRINTF("sctp_process_control: Can't get the all data....\n"); *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4849,8 +4827,8 @@ process_control_chunks: (length - *offset > (int)SCTP_SIZE32(chk_length))) { /* RFC 4960 requires that no ABORT is sent */ *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); } @@ -4870,8 +4848,8 @@ process_control_chunks: mflowtype, mflowid, vrf_id, port); *offset = length; - if ((!abort_no_unlock) && (locked_tcb)) { - SCTP_TCB_UNLOCK(locked_tcb); + if ((!abort_no_unlock) && (stcb != NULL)) { + SCTP_TCB_UNLOCK(stcb); } return (NULL); break; @@ -4881,15 +4859,14 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_INIT-ACK\n"); if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ - if ((stcb) && (stcb->asoc.total_output_queue_size)) { + if ((stcb != NULL) && (stcb->asoc.total_output_queue_size)) { ; } else { - if ((locked_tcb != NULL) && (locked_tcb != stcb)) { - /* Very unlikely */ - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } *offset = length; - if (stcb) { + if (stcb != NULL) { #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); @@ -4911,10 +4888,7 @@ process_control_chunks: if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } if ((netp) && (*netp)) { ret = sctp_handle_init_ack(m, iphlen, *offset, @@ -4938,10 +4912,7 @@ process_control_chunks: if ((stcb != NULL) && (ret == 0)) { sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); } - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); break; case SCTP_SELECTIVE_ACK: { @@ -5133,10 +5104,7 @@ process_control_chunks: if ((stcb == NULL) || (chk_length != sizeof(struct sctp_heartbeat_chunk))) { /* Its not ours */ *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } /* He's alive so give him credit */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) { @@ -5166,10 +5134,7 @@ process_control_chunks: (void *)stcb); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_shutdown_chunk))) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } if (netp && *netp) { int abort_flag = 0; @@ -5206,7 +5171,7 @@ process_control_chunks: if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ abend: - if (stcb) { + if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } *offset = length; @@ -5263,6 +5228,9 @@ process_control_chunks: } } if (netp) { + struct sctp_tcb *locked_stcb; + + locked_stcb = stcb; ret_buf = sctp_handle_cookie_echo(m, iphlen, *offset, @@ -5273,11 +5241,17 @@ process_control_chunks: auth_skipped, auth_offset, auth_len, - &locked_tcb, + &locked_stcb, mflowtype, mflowid, vrf_id, port); + if ((locked_stcb != NULL) && (locked_stcb != stcb)) { + SCTP_TCB_UNLOCK(locked_stcb); + } + if (stcb != NULL) { + SCTP_TCB_LOCK_ASSERT(stcb); + } } else { ret_buf = NULL; } @@ -5285,8 +5259,8 @@ process_control_chunks: SCTP_ASOC_CREATE_UNLOCK(linp); } if (ret_buf == NULL) { - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); } SCTPDBG(SCTP_DEBUG_INPUT3, "GAK, null buffer\n"); @@ -5313,10 +5287,7 @@ process_control_chunks: case SCTP_COOKIE_ACK: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE-ACK, stcb %p\n", (void *)stcb); if ((stcb == NULL) || chk_length != sizeof(struct sctp_cookie_ack_chunk)) { - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ @@ -5358,11 +5329,8 @@ process_control_chunks: /* He's alive so give him credit */ if ((stcb == NULL) || (chk_length != sizeof(struct sctp_ecne_chunk))) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if (stcb) { if (stcb->asoc.ecn_supported == 0) { @@ -5385,12 +5353,8 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ECN-CWR\n"); /* He's alive so give him credit */ if ((stcb == NULL) || (chk_length != sizeof(struct sctp_cwr_chunk))) { - /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if (stcb) { if (stcb->asoc.ecn_supported == 0) { @@ -5413,10 +5377,7 @@ process_control_chunks: if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { *offset = length; - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } - return (NULL); + return (stcb); } if ((stcb) && netp && *netp) { sctp_handle_shutdown_complete((struct sctp_shutdown_complete_chunk *)ch, @@ -5449,11 +5410,8 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ASCONF-ACK\n"); if (chk_length < sizeof(struct sctp_asconf_ack_chunk)) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if ((stcb) && netp && *netp) { if (stcb->asoc.asconf_supported == 0) { @@ -5479,11 +5437,8 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_FWD-TSN\n"); if (chk_length < sizeof(struct sctp_forward_tsn_chunk)) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } /* He's alive so give him credit */ if (stcb) { @@ -5546,11 +5501,8 @@ process_control_chunks: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_STREAM_RESET\n"); if (((stcb == NULL) || (ch == NULL) || (chk_length < sizeof(struct sctp_stream_reset_tsn_req)))) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if (stcb->asoc.reconfig_supported == 0) { goto unknown_chunk; @@ -5566,11 +5518,8 @@ process_control_chunks: /* re-get it all please */ if (chk_length < sizeof(struct sctp_pktdrop_chunk)) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if (ch && (stcb) && netp && (*netp)) { if (stcb->asoc.pktdrop_supported == 0) { @@ -5579,7 +5528,6 @@ process_control_chunks: sctp_handle_packet_dropped((struct sctp_pktdrop_chunk *)ch, stcb, *netp, min(chk_length, (sizeof(chunk_buf) - 4))); - } break; case SCTP_AUTHENTICATION: @@ -5601,11 +5549,8 @@ process_control_chunks: (chk_length > (sizeof(struct sctp_auth_chunk) + SCTP_AUTH_DIGEST_LEN_MAX))) { /* Its not ours */ - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } if (got_auth == 1) { /* skip this chunk... it's already auth'd */ @@ -5670,11 +5615,8 @@ next_chunk: ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, sizeof(struct sctp_chunkhdr), chunk_buf); if (ch == NULL) { - if (locked_tcb) { - SCTP_TCB_UNLOCK(locked_tcb); - } *offset = length; - return (NULL); + return (stcb); } } /* while */ From owner-svn-src-head@freebsd.org Sun Oct 15 22:22:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 355E8E4C452; Sun, 15 Oct 2017 22:22:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 121233DF0; Sun, 15 Oct 2017 22:22:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FMMSTT051487; Sun, 15 Oct 2017 22:22:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FMMSNp051485; Sun, 15 Oct 2017 22:22:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201710152222.v9FMMSNp051485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 15 Oct 2017 22:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324639 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 324639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 22:22:29 -0000 Author: rmacklem Date: Sun Oct 15 22:22:27 2017 New Revision: 324639 URL: https://svnweb.freebsd.org/changeset/base/324639 Log: Fix the client IP address reported by nfsdumpstate for 64bit arch and NFSv4.1. The client IP address was not being reported for some NFSv4 mounts by nfsdumpstate. Upon investigation, two problems were found for mounts using IPv4. One was that the code (originally written and tested on i386) assumed that a "u_long" was a "uint32_t" and would exactly store an IPv4 host address. Not correct for 64bit arches. Also, for NFSv4.1 mounts, the field was not being filled in. This was basically correct, because NFSv4.1 does not use a callback address. However, it meant that nfsdumpstate could not report the client IP addr. This patch should fix both of these issues. For IPv6, the address will still not be reported. The original NFSv4 RFC only specified IPv4 callback addresses. I think this has changed and, if so, a future commit to fix reporting of IPv6 addresses will be needed. Reported by: manu PR: 223036 MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Sun Oct 15 19:33:30 2017 (r324638) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Sun Oct 15 22:22:27 2017 (r324639) @@ -3729,6 +3729,7 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused uint32_t sp4type, v41flags; uint64_t owner_minor; struct timespec verstime; + struct sockaddr_in *sad, *rad; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { nd->nd_repstat = NFSERR_WRONGSEC; @@ -3752,6 +3753,13 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused NFSINITSOCKMUTEX(&clp->lc_req.nr_mtx); NFSSOCKADDRALLOC(clp->lc_req.nr_nam); NFSSOCKADDRSIZE(clp->lc_req.nr_nam, sizeof (struct sockaddr_in)); + sad = NFSSOCKADDR(nd->nd_nam, struct sockaddr_in *); + rad = NFSSOCKADDR(clp->lc_req.nr_nam, struct sockaddr_in *); + rad->sin_family = AF_INET; + rad->sin_addr.s_addr = 0; + rad->sin_port = 0; + if (sad->sin_family == AF_INET) + rad->sin_addr.s_addr = sad->sin_addr.s_addr; clp->lc_req.nr_cred = NULL; NFSBCOPY(verf, clp->lc_verf, NFSX_VERF); clp->lc_idlen = idlen; Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Oct 15 19:33:30 2017 (r324638) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Oct 15 22:22:27 2017 (r324639) @@ -3891,11 +3891,11 @@ nfsrv_getclientipaddr(struct nfsrv_descript *nd, struc u_char protocol[5], addr[24]; int error = 0, cantparse = 0; union { - u_long ival; + in_addr_t ival; u_char cval[4]; } ip; union { - u_short sval; + in_port_t sval; u_char cval[2]; } port; @@ -3989,8 +3989,10 @@ nfsrv_getclientipaddr(struct nfsrv_descript *nd, struc } if (cantparse) { sad = NFSSOCKADDR(nd->nd_nam, struct sockaddr_in *); - rad->sin_addr.s_addr = sad->sin_addr.s_addr; - rad->sin_port = 0x0; + if (sad->sin_family == AF_INET) { + rad->sin_addr.s_addr = sad->sin_addr.s_addr; + rad->sin_port = 0x0; + } clp->lc_program = 0; } nfsmout: From owner-svn-src-head@freebsd.org Sun Oct 15 23:53:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 400AFE27ECF; Sun, 15 Oct 2017 23:53:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F71A65498; Sun, 15 Oct 2017 23:53:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FNru27088171; Sun, 15 Oct 2017 23:53:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FNruu1088169; Sun, 15 Oct 2017 23:53:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710152353.v9FNruu1088169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 15 Oct 2017 23:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324644 - in head/sys: cam/nvme dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: cam/nvme dev/nvme X-SVN-Commit-Revision: 324644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 23:53:57 -0000 Author: imp Date: Sun Oct 15 23:53:55 2017 New Revision: 324644 URL: https://svnweb.freebsd.org/changeset/base/324644 Log: Closer examination shows that nvme and CAM both normally zero-fill allocations (for req and ccb, which ultimately contain the nvme_cmd). As such, we can micro-optimize these routines. Add a comment to this effect, and bzero the ccb used to make the requests for the nda dump rotuine so it more closely matches a ccb allocated with xpt_get_ccb(). Sponsored by: Netflix Modified: head/sys/cam/nvme/nvme_da.c head/sys/dev/nvme/nvme.h Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Sun Oct 15 22:45:25 2017 (r324643) +++ head/sys/cam/nvme/nvme_da.c Sun Oct 15 23:53:55 2017 (r324644) @@ -398,6 +398,8 @@ ndadump(void *arg, void *virtual, vm_offset_t physical return (ENXIO); } + /* xpt_get_ccb returns a zero'd allocation for the ccb, mimic that here */ + memset(&nvmeio, 0, sizeof(nvmeio)); if (length > 0) { xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP; Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Sun Oct 15 22:45:25 2017 (r324643) +++ head/sys/dev/nvme/nvme.h Sun Oct 15 23:53:55 2017 (r324644) @@ -1068,7 +1068,12 @@ uint32_t nvme_ns_get_stripesize(struct nvme_namespace int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, nvme_cb_fn_t cb_fn); -/* Command building helper functions -- shared with CAM */ +/* + * Command building helper functions -- shared with CAM + * These functions assume allocator zeros out cmd structure + * CAM's xpt_get_ccb and the request allocator for nvme both + * do zero'd allocations. + */ static inline void nvme_ns_flush_cmd(struct nvme_command *cmd, uint32_t nsid) { @@ -1082,17 +1087,10 @@ void nvme_ns_rw_cmd(struct nvme_command *cmd, uint32_t uint64_t lba, uint32_t count) { cmd->opc = rwcmd; - cmd->fuse = 0; - cmd->rsvd1 = 0; cmd->nsid = nsid; - cmd->rsvd2 = 0; - cmd->rsvd3 = 0; cmd->cdw10 = lba & 0xffffffffu; cmd->cdw11 = lba >> 32; cmd->cdw12 = count-1; - cmd->cdw13 = 0; - cmd->cdw14 = 0; - cmd->cdw15 = 0; } static inline From owner-svn-src-head@freebsd.org Sun Oct 15 23:54:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38CC3E27EFD; Sun, 15 Oct 2017 23:54:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 064DB654E5; Sun, 15 Oct 2017 23:54:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9FNs4Hw088231; Sun, 15 Oct 2017 23:54:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9FNs4vm088229; Sun, 15 Oct 2017 23:54:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710152354.v9FNs4vm088229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 15 Oct 2017 23:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324645 - in head/sys/cam: ata scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/cam: ata scsi X-SVN-Commit-Revision: 324645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 23:54:06 -0000 Author: imp Date: Sun Oct 15 23:54:04 2017 New Revision: 324645 URL: https://svnweb.freebsd.org/changeset/base/324645 Log: Zero out the ccb's alloated on the stack for the dump routines to more closely match a ccb returned from xpt_get_ccb(). Sponsored by: Netflix Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Oct 15 23:53:55 2017 (r324644) +++ head/sys/cam/ata/ata_da.c Sun Oct 15 23:54:04 2017 (r324645) @@ -1057,6 +1057,7 @@ adadump(void *arg, void *virtual, vm_offset_t physical return (ENXIO); } + memset(&ccb, 0, sizeof(ccb)); if (length > 0) { xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); ccb.ccb_h.ccb_state = ADA_CCB_DUMP; Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sun Oct 15 23:53:55 2017 (r324644) +++ head/sys/cam/scsi/scsi_da.c Sun Oct 15 23:54:04 2017 (r324645) @@ -1646,6 +1646,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, return (ENXIO); } + memset(&csio, 0, sizeof(csio)); if (length > 0) { xpt_setup_ccb(&csio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); csio.ccb_h.ccb_state = DA_CCB_DUMP; From owner-svn-src-head@freebsd.org Mon Oct 16 03:59:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56E6AE2CCBD; Mon, 16 Oct 2017 03:59:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D50B6AA6A; Mon, 16 Oct 2017 03:59:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G3xCdF087578; Mon, 16 Oct 2017 03:59:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G3xCCi087576; Mon, 16 Oct 2017 03:59:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710160359.v9G3xCCi087576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Oct 2017 03:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324646 - in head/sys/boot/efi: boot1 libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: boot1 libefi loader X-SVN-Commit-Revision: 324646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 03:59:13 -0000 Author: imp Date: Mon Oct 16 03:59:11 2017 New Revision: 324646 URL: https://svnweb.freebsd.org/changeset/base/324646 Log: Unify boot1 with loader Refactor boot1 to use the same I/O code as /boot/loader uses. Refactor to use the common efi_main.c. Submitted by: Eric McCorkle Differential Revision: https://reviews.freebsd.org/D10447 Added: head/sys/boot/efi/libefi/efi_main.c (contents, props changed) - copied, changed from r324645, head/sys/boot/efi/loader/efi_main.c Deleted: head/sys/boot/efi/boot1/boot_module.h head/sys/boot/efi/boot1/ufs_module.c head/sys/boot/efi/boot1/zfs_module.c head/sys/boot/efi/loader/efi_main.c Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Sun Oct 15 23:54:04 2017 (r324645) +++ head/sys/boot/efi/boot1/Makefile Mon Oct 16 03:59:11 2017 (r324646) @@ -8,8 +8,11 @@ MK_SSP= no PROG= boot1.sym INTERNALPROG= -WARNS?= 6 +WARNS?= 3 +# Include bcache code. +HAVE_BCACHE= yes + # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead @@ -18,13 +21,15 @@ WARNS?= 6 CWARNFLAGS.boot1.c+= -Wno-format # Disable warnings that are currently incompatible with the zfs boot code -CWARNFLAGS.zfs_module.c += -Wno-array-bounds -CWARNFLAGS.zfs_module.c += -Wno-cast-align -CWARNFLAGS.zfs_module.c += -Wno-cast-qual -CWARNFLAGS.zfs_module.c += -Wno-missing-prototypes -CWARNFLAGS.zfs_module.c += -Wno-sign-compare -CWARNFLAGS.zfs_module.c += -Wno-unused-parameter -CWARNFLAGS.zfs_module.c += -Wno-unused-function +CWARNFLAGS.zfs.c += -Wno-incompatible-pointer-types-discards-qualifiers +CWARNFLAGS.zfs.c += -Wno-missing-variable-declarations +CWARNFLAGS.zfs.c += -Wno-array-bounds +CWARNFLAGS.zfs.c += -Wno-cast-align +CWARNFLAGS.zfs.c += -Wno-cast-qual +CWARNFLAGS.zfs.c += -Wno-missing-prototypes +CWARNFLAGS.zfs.c += -Wno-sign-compare +CWARNFLAGS.zfs.c += -Wno-unused-parameter +CWARNFLAGS.zfs.c += -Wno-unused-function CWARNFLAGS.skein.c += -Wno-cast-align .if ${COMPILER_TYPE} == "clang" CWARNFLAGS.skein.c += -Wno-missing-variable-declarations @@ -33,19 +38,27 @@ CWARNFLAGS.skein.c += -Wno-missing-declarations .endif # architecture-specific loader code -SRCS= boot1.c self_reloc.c start.S ufs_module.c +SRCS= boot1.c self_reloc.c start.S .if ${MK_ZFS} != "no" -SRCS+= zfs_module.c +.PATH: ${.CURDIR}/../../../crypto/skein SRCS+= skein.c skein_block.c # Do not unroll skein loops, reduce code size CFLAGS+= -DSKEIN_LOOP=111 -.PATH: ${.CURDIR}/../../../crypto/skein +.PATH: ${.CURDIR}/../../zfs +SRCS+= zfs.c .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif +# Always add MI sources +.PATH: ${.CURDIR}/../../common +.include "${.CURDIR}/../../common/Makefile.inc" +CFLAGS+= -I${.CURDIR}/../../common + +.PATH: ${.CURDIR}/arch/${MACHINE} + CFLAGS+= -I. CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} @@ -117,7 +130,7 @@ boot1.efi: ${PROG} SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ - -j .rela.dyn -j .reloc -j .eh_frame \ + -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} boot1.o: ${SASRC}/ufsread.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Sun Oct 15 23:54:04 2017 (r324645) +++ head/sys/boot/efi/boot1/boot1.c Mon Oct 16 03:59:11 2017 (r324646) @@ -23,61 +23,179 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include +#include #include +#include +#include #include +#ifdef EFI_ZFS_BOOT +#include +#endif typedef CHAR16 efi_char; #include -#include "boot_module.h" +#include + +#include "efi_drivers.h" +#include "efizfs.h" #include "paths.h" static void efi_panic(EFI_STATUS s, const char *fmt, ...) __dead2 __printflike(2, 3); +#ifdef EFI_DEBUG +#define DPRINTF(fmt, args...) printf(fmt, ##args) +#define DSTALL(d) BS->Stall(d) +#else +#define DPRINTF(fmt, ...) {} +#define DSTALL(d) {} +#endif -static const boot_module_t *boot_modules[] = -{ +struct arch_switch archsw; /* MI/MD interface boundary */ + +static const efi_driver_t *efi_drivers[] = { + NULL +}; + +extern struct console efi_console; +#if defined(__amd64__) || defined(__i386__) +extern struct console comconsole; +extern struct console nullconsole; +#endif + #ifdef EFI_ZFS_BOOT - &zfs_module, +uint64_t pool_guid; #endif + +struct fs_ops *file_system[] = { +#ifdef EFI_ZFS_BOOT + &zfs_fsops, +#endif + &dosfs_fsops, #ifdef EFI_UFS_BOOT - &ufs_module + &ufs_fsops, #endif + &cd9660_fsops, + &nfs_fsops, + &gzipfs_fsops, + &bzipfs_fsops, + NULL }; -#define NUM_BOOT_MODULES nitems(boot_modules) +struct devsw *devsw[] = { + &efipart_hddev, + &efipart_fddev, + &efipart_cddev, +#ifdef EFI_ZFS_BOOT + &zfs_dev, +#endif + NULL +}; + +struct console *consoles[] = { + &efi_console, + NULL +}; + +static EFI_LOADED_IMAGE *boot_image; +static EFI_DEVICE_PATH *imgpath; +static EFI_DEVICE_PATH *imgprefix; + +/* Definitions we don't actually need for boot, but we need to define + * to make the linker happy. + */ +struct file_format *file_formats[] = { NULL }; + +struct netif_driver *netif_drivers[] = { NULL }; + +static int +efi_autoload(void) +{ + printf("******** Boot block should not call autoload\n"); + return (-1); +} + +static ssize_t +efi_copyin(const void *src __unused, vm_offset_t dest __unused, + const size_t len __unused) +{ + printf("******** Boot block should not call copyin\n"); + return (-1); +} + +static ssize_t +efi_copyout(vm_offset_t src __unused, void *dest __unused, + const size_t len __unused) +{ + printf("******** Boot block should not call copyout\n"); + return (-1); +} + +static ssize_t +efi_readin(int fd __unused, vm_offset_t dest __unused, + const size_t len __unused) +{ + printf("******** Boot block should not call readin\n"); + return (-1); +} + /* The initial number of handles used to query EFI for partitions. */ #define NUM_HANDLES_INIT 24 -static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; -static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; -/* - * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures - * memory is correctly aligned avoiding EFI_INVALID_PARAMETER returns from - * EFI methods. - */ -void * -Malloc(size_t len, const char *file __unused, int line __unused) +static EFI_STATUS +do_load(const char *filepath, void **bufp, size_t *bufsize) { - void *out; + struct stat st; + void *buf = NULL; + int fd, err; + size_t fsize, remaining; + ssize_t readsize; - if (BS->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) - return (out); + if ((fd = open(filepath, O_RDONLY)) < 0) { + return (ENOTSUP); + } - return (NULL); -} + if ((err = fstat(fd, &st)) != 0) { + goto close_file; + } -void -Free(void *buf, const char *file __unused, int line __unused) -{ - if (buf != NULL) - (void)BS->FreePool(buf); + fsize = st.st_size; + + if ((buf = malloc(fsize)) == NULL) { + err = ENOMEM; + goto close_file; + } + + remaining = fsize; + + do { + if ((readsize = read(fd, buf, fsize)) < 0) { + err = (-readsize); + goto free_buf; + } + + remaining -= readsize; + } while(remaining != 0); + + close(fd); + *bufsize = st.st_size; + *bufp = buf; + + close_file: + close(fd); + + return errno_to_efi_status(err); + + free_buf: + free(buf); + goto close_file; } static EFI_STATUS @@ -97,98 +215,275 @@ efi_setenv_freebsd_wcs(const char *varname, CHAR16 *va return (rv); } -/* - * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match, - * FALSE otherwise. - */ -static BOOLEAN -nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) +static int +probe_fs(const char *filepath) { - size_t len; + int fd; - if (imgpath == NULL || imgpath->Type != devpath->Type || - imgpath->SubType != devpath->SubType) - return (FALSE); + if ((fd = open(filepath, O_RDONLY)) < 0) { + return (ENOTSUP); + } - len = DevicePathNodeLength(imgpath); - if (len != DevicePathNodeLength(devpath)) - return (FALSE); + close(fd); - return (memcmp(imgpath, devpath, (size_t)len) == 0); + return (0); } -/* - * device_paths_match returns TRUE if the imgpath isn't NULL and all nodes - * in imgpath and devpath match up to their respective occurrences of a - * media node, FALSE otherwise. - */ -static BOOLEAN -device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) +static int +probe_dev(struct devsw *dev, int unit, const char *filepath) { + struct devdesc currdev; + char *devname; + int err; - if (imgpath == NULL) - return (FALSE); + currdev.d_dev = dev; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = unit; + currdev.d_opendata = NULL; + devname = efi_fmtdev(&currdev); - while (!IsDevicePathEnd(imgpath) && !IsDevicePathEnd(devpath)) { - if (IsDevicePathType(imgpath, MEDIA_DEVICE_PATH) && - IsDevicePathType(devpath, MEDIA_DEVICE_PATH)) - return (TRUE); + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, + env_nounset); - if (!nodes_match(imgpath, devpath)) - return (FALSE); + err = probe_fs(filepath); - imgpath = NextDevicePathNode(imgpath); - devpath = NextDevicePathNode(devpath); - } + return (err); +} - return (FALSE); +static bool +check_preferred(EFI_HANDLE *h) +{ + EFI_DEVICE_PATH *path = efi_lookup_devpath(h); + bool out; + + if ((path = efi_lookup_devpath(h)) == NULL) + return (false); + + out = efi_devpath_is_prefix(imgpath, path) || + efi_devpath_is_prefix(imgprefix, path); + + return (out); } -/* - * devpath_last returns the last non-path end node in devpath. - */ -static EFI_DEVICE_PATH * -devpath_last(EFI_DEVICE_PATH *devpath) +bool +efi_zfs_is_preferred(EFI_HANDLE *h) { + return (check_preferred(h)); +} - while (!IsDevicePathEnd(NextDevicePathNode(devpath))) - devpath = NextDevicePathNode(devpath); +static int +load_preferred(EFI_LOADED_IMAGE *img, const char *filepath, void **bufp, + size_t *bufsize, EFI_HANDLE *handlep) +{ + pdinfo_list_t *pdi_list; + pdinfo_t *dp, *pp; + char *devname; - return (devpath); +#ifdef EFI_ZFS_BOOT + /* Did efi_zfs_probe() detect the boot pool? */ + if (pool_guid != 0) { + struct zfs_devdesc currdev; + + currdev.d_dev = &zfs_dev; + currdev.d_unit = 0; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_opendata = NULL; + currdev.pool_guid = pool_guid; + currdev.root_guid = 0; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, + env_nounset); + + if (probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = efizfs_get_handle_by_guid(pool_guid); + return (0); + } + } +#endif /* EFI_ZFS_BOOT */ + + /* We have device lists for hd, cd, fd, walk them all. */ + pdi_list = efiblk_get_pdinfo_list(&efipart_hddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + struct disk_devdesc currdev; + + currdev.d_dev = &efipart_hddev; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = dp->pd_unit; + currdev.d_opendata = NULL; + currdev.d_slice = -1; + currdev.d_partition = -1; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, + env_nounset); + + if (check_preferred(dp->pd_handle) && + probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + return (0); + } + + /* Assuming GPT partitioning. */ + STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { + if (check_preferred(pp->pd_handle)) { + currdev.d_slice = pp->pd_unit; + currdev.d_partition = 255; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, + efi_setcurrdev, env_nounset); + + if (probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == + EFI_SUCCESS) { + *handlep = pp->pd_handle; + return (0); + } + } + } + } + + pdi_list = efiblk_get_pdinfo_list(&efipart_cddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + if ((dp->pd_handle == img->DeviceHandle || + dp->pd_alias == img->DeviceHandle || + check_preferred(dp->pd_handle)) && + probe_dev(&efipart_cddev, dp->pd_unit, filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + return (0); + } + } + + pdi_list = efiblk_get_pdinfo_list(&efipart_fddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + if ((dp->pd_handle == img->DeviceHandle || + check_preferred(dp->pd_handle)) && + probe_dev(&efipart_cddev, dp->pd_unit, filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + return (0); + } + } + + return (ENOENT); } -/* - * load_loader attempts to load the loader image data. - * - * It tries each module and its respective devices, identified by mod->probe, - * in order until a successful load occurs at which point it returns EFI_SUCCESS - * and EFI_NOT_FOUND otherwise. - * - * Only devices which have preferred matching the preferred parameter are tried. - */ -static EFI_STATUS -load_loader(const boot_module_t **modp, dev_info_t **devinfop, void **bufp, - size_t *bufsize, BOOLEAN preferred) +static int +load_all(const char *filepath, void **bufp, size_t *bufsize, + EFI_HANDLE *handlep) { - UINTN i; - dev_info_t *dev; - const boot_module_t *mod; + pdinfo_list_t *pdi_list; + pdinfo_t *dp, *pp; + zfsinfo_list_t *zfsi_list; + zfsinfo_t *zi; + char *devname; - for (i = 0; i < NUM_BOOT_MODULES; i++) { - mod = boot_modules[i]; - for (dev = mod->devices(); dev != NULL; dev = dev->next) { - if (dev->preferred != preferred) - continue; +#ifdef EFI_ZFS_BOOT + zfsi_list = efizfs_get_zfsinfo_list(); + STAILQ_FOREACH(zi, zfsi_list, zi_link) { + struct zfs_devdesc currdev; - if (mod->load(PATH_LOADER_EFI, dev, bufp, bufsize) == - EFI_SUCCESS) { - *devinfop = dev; - *modp = mod; - return (EFI_SUCCESS); + currdev.d_dev = &zfs_dev; + currdev.d_unit = 0; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_opendata = NULL; + currdev.pool_guid = zi->zi_pool_guid; + currdev.root_guid = 0; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, + env_nounset); + + if (probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = zi->zi_handle; + + return (0); + } + } +#endif /* EFI_ZFS_BOOT */ + + /* We have device lists for hd, cd, fd, walk them all. */ + pdi_list = efiblk_get_pdinfo_list(&efipart_hddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + struct disk_devdesc currdev; + + currdev.d_dev = &efipart_hddev; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = dp->pd_unit; + currdev.d_opendata = NULL; + currdev.d_slice = -1; + currdev.d_partition = -1; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, + env_nounset); + + if (probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + + return (0); + } + + /* Assuming GPT partitioning. */ + STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { + currdev.d_slice = pp->pd_unit; + currdev.d_partition = 255; + devname = efi_fmtdev(&currdev); + + env_setenv("currdev", EV_VOLATILE, devname, + efi_setcurrdev, env_nounset); + + if (probe_fs(filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = pp->pd_handle; + + return (0); } } } + pdi_list = efiblk_get_pdinfo_list(&efipart_cddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + if (probe_dev(&efipart_cddev, dp->pd_unit, filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + + return (0); + } + } + + pdi_list = efiblk_get_pdinfo_list(&efipart_fddev); + STAILQ_FOREACH(dp, pdi_list, pd_link) { + if (probe_dev(&efipart_fddev, dp->pd_unit, filepath) == 0 && + do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { + *handlep = dp->pd_handle; + + return (0); + } + } + + return (ENOENT); +} + +static EFI_STATUS +load_loader(EFI_HANDLE *handlep, void **bufp, size_t *bufsize) +{ + /* Try the preferred handles first, then all the handles */ + if (load_preferred(boot_image, PATH_LOADER_EFI, bufp, bufsize, + handlep) == 0) { + return (0); + } + + if (load_all(PATH_LOADER_EFI, bufp, bufsize, handlep) == 0) { + return (0); + } + return (EFI_NOT_FOUND); } @@ -202,20 +497,27 @@ try_boot(void) size_t bufsize, loadersize, cmdsize; void *buf, *loaderbuf; char *cmd; - dev_info_t *dev; - const boot_module_t *mod; + EFI_HANDLE fshandle; EFI_HANDLE loaderhandle; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; + EFI_DEVICE_PATH *fspath; - status = load_loader(&mod, &dev, &loaderbuf, &loadersize, TRUE); - if (status != EFI_SUCCESS) { - status = load_loader(&mod, &dev, &loaderbuf, &loadersize, - FALSE); + status = load_loader(&fshandle, &loaderbuf, &loadersize); + + if (status != EFI_SUCCESS) { + return (status); + } + + fspath = NULL; + if (status == EFI_SUCCESS) { + status = BS->OpenProtocol(fshandle, &DevicePathGUID, + (void **)&fspath, IH, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (status != EFI_SUCCESS) { - printf("Failed to load '%s'\n", PATH_LOADER_EFI); - return (status); - } + DPRINTF("Failed to get image DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + } + DPRINTF("filesystem device path: %s\n", devpath_str(fspath)); } /* @@ -230,9 +532,9 @@ try_boot(void) */ cmd = NULL; cmdsize = 0; - status = mod->load(PATH_DOTCONFIG, dev, &buf, &bufsize); + status = do_load(PATH_DOTCONFIG, &buf, &bufsize); if (status == EFI_NOT_FOUND) - status = mod->load(PATH_CONFIG, dev, &buf, &bufsize); + status = do_load(PATH_CONFIG, &buf, &bufsize); if (status == EFI_SUCCESS) { cmdsize = bufsize + 1; cmd = malloc(cmdsize); @@ -244,24 +546,25 @@ try_boot(void) buf = NULL; } - if ((status = BS->LoadImage(TRUE, IH, devpath_last(dev->devpath), + if ((status = BS->LoadImage(TRUE, IH, efi_devpath_last_node(fspath), loaderbuf, loadersize, &loaderhandle)) != EFI_SUCCESS) { - printf("Failed to load image provided by %s, size: %zu, (%lu)\n", - mod->name, loadersize, EFI_ERROR_CODE(status)); + printf("Failed to load image, size: %zu, (%lu)\n", + loadersize, EFI_ERROR_CODE(status)); goto errout; } - if ((status = BS->HandleProtocol(loaderhandle, &LoadedImageGUID, - (VOID**)&loaded_image)) != EFI_SUCCESS) { - printf("Failed to query LoadedImage provided by %s (%lu)\n", - mod->name, EFI_ERROR_CODE(status)); + if ((status = BS->OpenProtocol(loaderhandle, &LoadedImageGUID, + (VOID**)&loaded_image, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL)) != EFI_SUCCESS) { + printf("Failed to query LoadedImage (%lu)\n", + EFI_ERROR_CODE(status)); goto errout; } if (cmd != NULL) printf(" command args: %s\n", cmd); - loaded_image->DeviceHandle = dev->devhandle; + loaded_image->DeviceHandle = fshandle; loaded_image->LoadOptionsSize = cmdsize; loaded_image->LoadOptions = cmd; @@ -279,8 +582,8 @@ try_boot(void) if ((status = BS->StartImage(loaderhandle, NULL, NULL)) != EFI_SUCCESS) { - printf("Failed to start image provided by %s (%lu)\n", - mod->name, EFI_ERROR_CODE(status)); + printf("Failed to start image (%lu)\n", + EFI_ERROR_CODE(status)); loaded_image->LoadOptionsSize = 0; loaded_image->LoadOptions = NULL; } @@ -296,142 +599,37 @@ errout: return (status); } -/* - * probe_handle determines if the passed handle represents a logical partition - * if it does it uses each module in order to probe it and if successful it - * returns EFI_SUCCESS. - */ -static EFI_STATUS -probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, BOOLEAN *preferred) +EFI_STATUS +main(int argc __unused, CHAR16 *argv[] __unused) { - dev_info_t *devinfo; - EFI_BLOCK_IO *blkio; - EFI_DEVICE_PATH *devpath; - EFI_STATUS status; - UINTN i; + EFI_STATUS status; - /* Figure out if we're dealing with an actual partition. */ - status = BS->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); - if (status == EFI_UNSUPPORTED) - return (status); + SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; + UINTN i, max_dim, best_mode, cols, rows; + CHAR16 *text; - if (status != EFI_SUCCESS) { - DPRINTF("\nFailed to query DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); - } -#ifdef EFI_DEBUG - { - CHAR16 *text = efi_devpath_name(devpath); - DPRINTF("probing: %S\n", text); - efi_free_devpath_name(text); - } + archsw.arch_autoload = efi_autoload; + archsw.arch_getdev = efi_getdev; + archsw.arch_copyin = efi_copyin; + archsw.arch_copyout = efi_copyout; + archsw.arch_readin = efi_readin; +#ifdef EFI_ZFS_BOOT + /* Note this needs to be set before ZFS init. */ + archsw.arch_zfs_probe = efi_zfs_probe; #endif - status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); - if (status == EFI_UNSUPPORTED) - return (status); - if (status != EFI_SUCCESS) { - DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", - EFI_ERROR_CODE(status)); - return (status); - } + /* Init the time source */ + efi_time_init(); + cons_probe(); - if (!blkio->Media->LogicalPartition) - return (EFI_UNSUPPORTED); - - *preferred = device_paths_match(imgpath, devpath); - - /* Run through each module, see if it can load this partition */ - for (i = 0; i < NUM_BOOT_MODULES; i++) { - devinfo = malloc(sizeof(*devinfo)); - if (devinfo == NULL) { - DPRINTF("\nFailed to allocate devinfo\n"); - continue; - } - devinfo->dev = blkio; - devinfo->devpath = devpath; - devinfo->devhandle = h; - devinfo->devdata = NULL; - devinfo->preferred = *preferred; - devinfo->next = NULL; - - status = boot_modules[i]->probe(devinfo); - if (status == EFI_SUCCESS) - return (EFI_SUCCESS); - free(devinfo); - } - - return (EFI_UNSUPPORTED); -} - -/* - * probe_handle_status calls probe_handle and outputs the returned status - * of the call. - */ -static void -probe_handle_status(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) -{ - EFI_STATUS status; - BOOLEAN preferred; - - preferred = FALSE; - status = probe_handle(h, imgpath, &preferred); - - DPRINTF("probe: "); - switch (status) { - case EFI_UNSUPPORTED: - printf("."); - DPRINTF(" not supported\n"); - break; - case EFI_SUCCESS: - if (preferred) { - printf("%c", '*'); - DPRINTF(" supported (preferred)\n"); - } else { - printf("%c", '+'); - DPRINTF(" supported\n"); - } - break; - default: - printf("x"); - DPRINTF(" error (%lu)\n", EFI_ERROR_CODE(status)); - break; - } - DSTALL(500000); -} - -EFI_STATUS -efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) -{ - EFI_HANDLE *handles; - EFI_LOADED_IMAGE *img; - EFI_DEVICE_PATH *imgpath; - EFI_STATUS status; - EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; - SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; - UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; - CHAR16 *text; - - /* Basic initialization*/ - ST = Xsystab; - IH = Ximage; - BS = ST->BootServices; - RS = ST->RuntimeServices; - - /* Set up the console, so printf works. */ - status = BS->LocateProtocol(&ConsoleControlGUID, NULL, - (VOID **)&ConsoleControl); - if (status == EFI_SUCCESS) - (void)ConsoleControl->SetMode(ConsoleControl, - EfiConsoleControlScreenText); /* * Reset the console and find the best text mode. */ conout = ST->ConOut; conout->Reset(conout, TRUE); max_dim = best_mode = 0; - for (i = 0; ; i++) { + + for (i = 0; ; i++) { status = conout->QueryMode(conout, i, &cols, &rows); if (EFI_ERROR(status)) break; @@ -440,31 +638,37 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) best_mode = i; } } - if (max_dim > 0) + + if (max_dim > 0) conout->SetMode(conout, best_mode); + conout->EnableCursor(conout, TRUE); conout->ClearScreen(conout); + /* Print this here, so people know it's at least starting. */ printf("\n>> FreeBSD EFI boot block\n"); printf(" Loader path: %s\n\n", PATH_LOADER_EFI); - printf(" Initializing modules:"); - for (i = 0; i < NUM_BOOT_MODULES; i++) { - printf(" %s", boot_modules[i]->name); - if (boot_modules[i]->init != NULL) - boot_modules[i]->init(); + + /* Get the image path and trim it to get the disk on which we + * found this loader. + */ + if ((status = BS->OpenProtocol(IH, &LoadedImageGUID, + (VOID**)&boot_image, IH, NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL)) != EFI_SUCCESS) { + panic("Failed to query LoadedImage (%lu)\n", + EFI_ERROR_CODE(status)); } - putchar('\n'); /* Determine the devpath of our image so we can prefer it. */ - status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); + status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&boot_image); imgpath = NULL; if (status == EFI_SUCCESS) { - text = efi_devpath_name(img->FilePath); + text = efi_devpath_name(boot_image->FilePath); printf(" Load Path: %S\n", text); efi_setenv_freebsd_wcs("Boot1Path", text); efi_free_devpath_name(text); - status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, + status = BS->HandleProtocol(boot_image->DeviceHandle, &DevicePathGUID, (void **)&imgpath); if (status != EFI_SUCCESS) { DPRINTF("Failed to get image DevicePath (%lu)\n", @@ -478,49 +682,36 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) } - /* Get all the device handles */ - hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); - handles = malloc(hsize); - if (handles == NULL) { - printf("Failed to allocate %d handles\n", NUM_HANDLES_INIT); - } + /* The loaded image device path ends with a partition, then a + * file path. Trim them both to get the actual disk. + */ + if ((imgprefix = efi_devpath_trim(imgpath)) == NULL || + (imgprefix = efi_devpath_trim(imgprefix)) == NULL) { + panic("Couldn't trim device path"); + } - status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, - &hsize, handles); - switch (status) { - case EFI_SUCCESS: - break; - case EFI_BUFFER_TOO_SMALL: - free(handles); - handles = malloc(hsize); - if (handles == NULL) - efi_panic(EFI_OUT_OF_RESOURCES, "Failed to allocate %d handles\n", - NUM_HANDLES_INIT); - status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, - NULL, &hsize, handles); - if (status != EFI_SUCCESS) - efi_panic(status, "Failed to get device handles\n"); - break; - default: - efi_panic(status, "Failed to get device handles\n"); - break; - } + /* + * Initialize the block cache. Set the upper limit. + */ + bcache_init(32768, 512); - /* Scan all partitions, probing with all modules. */ - nhandles = hsize / sizeof(*handles); - printf(" Probing %zu block devices...", nhandles); - DPRINTF("\n"); + printf("\n Initializing modules:"); - for (i = 0; i < nhandles; i++) - probe_handle_status(handles[i], imgpath); - printf(" done\n"); - - /* Status summary. */ - for (i = 0; i < NUM_BOOT_MODULES; i++) { - printf(" "); - boot_modules[i]->status(); + for (i = 0; efi_drivers[i] != NULL; i++) { + printf(" %s", efi_drivers[i]->name); + if (efi_drivers[i]->init != NULL) + efi_drivers[i]->init(); } + for (i = 0; devsw[i] != NULL; i++) { + if (devsw[i]->dv_init != NULL) { + printf(" %s", devsw[i]->dv_name); + (devsw[i]->dv_init)(); + } + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Oct 16 03:59:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6116E2CCE8; Mon, 16 Oct 2017 03:59:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A34266AA7D; Mon, 16 Oct 2017 03:59:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G3xHIA087633; Mon, 16 Oct 2017 03:59:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G3xHox087629; Mon, 16 Oct 2017 03:59:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710160359.v9G3xHox087629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Oct 2017 03:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324647 - in head/sys/boot: . common man X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . common man X-SVN-Commit-Revision: 324647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 03:59:19 -0000 Author: imp Date: Mon Oct 16 03:59:17 2017 New Revision: 324647 URL: https://svnweb.freebsd.org/changeset/base/324647 Log: Move orphaned man pages into new man directory from common. This helps keep cleaer that common is just for the MI files for /boot/loader programs. Sponsored by: Netflix Added: head/sys/boot/man/ head/sys/boot/man/Makefile (contents, props changed) - copied, changed from r324646, head/sys/boot/common/Makefile head/sys/boot/man/loader.8 (contents, props changed) - copied, changed from r324646, head/sys/boot/common/loader.8 head/sys/boot/man/zfsloader.8 (contents, props changed) - copied, changed from r324646, head/sys/boot/common/zfsloader.8 Deleted: head/sys/boot/common/Makefile head/sys/boot/common/loader.8 head/sys/boot/common/zfsloader.8 Modified: head/sys/boot/Makefile Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Mon Oct 16 03:59:11 2017 (r324646) +++ head/sys/boot/Makefile Mon Oct 16 03:59:17 2017 (r324647) @@ -9,7 +9,7 @@ SUBDIR+= ficl SUBDIR+= forth .endif -SUBDIR+= common +SUBDIR+= man .include Copied and modified: head/sys/boot/man/Makefile (from r324646, head/sys/boot/common/Makefile) ============================================================================== Copied and modified: head/sys/boot/man/loader.8 (from r324646, head/sys/boot/common/loader.8) ============================================================================== Copied and modified: head/sys/boot/man/zfsloader.8 (from r324646, head/sys/boot/common/zfsloader.8) ============================================================================== From owner-svn-src-head@freebsd.org Mon Oct 16 03:59:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE15EE2CD11; Mon, 16 Oct 2017 03:59:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BEDC6AAFB; Mon, 16 Oct 2017 03:59:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G3xMCm087689; Mon, 16 Oct 2017 03:59:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G3xMUe087685; Mon, 16 Oct 2017 03:59:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710160359.v9G3xMUe087685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Oct 2017 03:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324648 - in head/sys/boot: . common efi/libefi ficl X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . common efi/libefi ficl X-SVN-Commit-Revision: 324648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 03:59:24 -0000 Author: imp Date: Mon Oct 16 03:59:22 2017 New Revision: 324648 URL: https://svnweb.freebsd.org/changeset/base/324648 Log: Rename top level Makefile.ficl to ficl.mk. Added: head/sys/boot/ficl.mk (contents, props changed) - copied, changed from r324647, head/sys/boot/Makefile.ficl Deleted: head/sys/boot/Makefile.ficl Modified: head/sys/boot/common/Makefile.inc head/sys/boot/efi/libefi/Makefile head/sys/boot/ficl/Makefile Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Mon Oct 16 03:59:17 2017 (r324647) +++ head/sys/boot/common/Makefile.inc Mon Oct 16 03:59:22 2017 (r324648) @@ -62,7 +62,7 @@ SRCS+= pnp.c # Forth interpreter .if defined(BOOT_FORTH) SRCS+= interp_forth.c -.include "${SRCTOP}/sys/boot/Makefile.ficl" +.include "../ficl.mk" .endif .if defined(BOOT_PROMPT_123) Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:17 2017 (r324647) +++ head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:22 2017 (r324648) @@ -4,7 +4,7 @@ .if ${MK_FORTH} != "no" CFLAGS+= -DBOOT_FORTH -.include "${.CURDIR}/../../Makefile.ficl" +.include "../../ficl.mk" .endif LIB= efi Copied and modified: head/sys/boot/ficl.mk (from r324647, head/sys/boot/Makefile.ficl) ============================================================================== Modified: head/sys/boot/ficl/Makefile ============================================================================== --- head/sys/boot/ficl/Makefile Mon Oct 16 03:59:17 2017 (r324647) +++ head/sys/boot/ficl/Makefile Mon Oct 16 03:59:22 2017 (r324648) @@ -1,7 +1,7 @@ # $FreeBSD$ # -.include "${.CURDIR}/../Makefile.ficl" +.include "../ficl.mk" BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ prefix.c search.c stack.c tools.c vm.c words.c From owner-svn-src-head@freebsd.org Mon Oct 16 03:59:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A136E2CD70; Mon, 16 Oct 2017 03:59:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC24E6ABBC; Mon, 16 Oct 2017 03:59:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G3xTOW087755; Mon, 16 Oct 2017 03:59:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G3xSlM087740; Mon, 16 Oct 2017 03:59:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710160359.v9G3xSlM087740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Oct 2017 03:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324649 - in head/sys/boot: . arm/uboot common efi/boot1 efi/loader i386/loader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userboot/u... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot common efi/boot1 efi/loader i386/loader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userboot/userboot X-SVN-Commit-Revision: 324649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 03:59:31 -0000 Author: imp Date: Mon Oct 16 03:59:28 2017 New Revision: 324649 URL: https://svnweb.freebsd.org/changeset/base/324649 Log: Move common/Makefile.inc to sys/boot/loader.mk. Makefile.inc has a specific meaning in the tree, and common/Makefile.inc doesn't quite fit into that. Rename it to loader.mk and it will be a place to collect common things to all /boot/loader programs there. Sponsored by: Netflix Added: head/sys/boot/loader.mk (contents, props changed) - copied, changed from r324648, head/sys/boot/common/Makefile.inc Deleted: head/sys/boot/common/Makefile.inc Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -90,9 +90,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif # Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common +.include "../../loader.mk" CFLAGS+= -I. CLEANFILES+= loader.help @@ -124,7 +122,7 @@ OBJS+= ${SRCS:N*.h:R:S/$/.o/g} loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ - awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + awk -f ${LDR_MI}/merge_help.awk > ${.TARGET} ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/efi/boot1/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -53,9 +53,7 @@ CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitializ .endif # Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common +.include "../../loader.mk" .PATH: ${.CURDIR}/arch/${MACHINE} Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -103,9 +103,7 @@ CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif # Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common +.include "../../loader.mk" FILES+= loader.efi FILESMODE_loader.efi= ${BINMODE} Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -72,9 +72,7 @@ CFLAGS+= -I${.CURDIR}/../../.. -D_STAND .endif # Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common +.include "../../loader.mk" CFLAGS+= -I. CLEANFILES= ${LOADER} ${LOADER}.bin loader.help @@ -104,7 +102,7 @@ ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} loader.help: help.common help.i386 - cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + cat ${.ALLSRC} | awk -f ${LDR_MI}/merge_help.awk > ${.TARGET} FILES= ${LOADER} # XXX INSTALLFLAGS_loader= -b Copied and modified: head/sys/boot/loader.mk (from r324648, head/sys/boot/common/Makefile.inc) ============================================================================== --- head/sys/boot/common/Makefile.inc Mon Oct 16 03:59:22 2017 (r324648, copy source) +++ head/sys/boot/loader.mk Mon Oct 16 03:59:28 2017 (r324649) @@ -1,7 +1,12 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/sys/boot/common ${SRCTOP}/sys/boot/libsa +BOOTDIR=${SRCTOP}/sys/boot +LDR_MI=${BOOTDIR}/common +.PATH: ${LDR_MI} ${BOOTDIR}/libsa + +CFLAGS+=-I${LDR_MI} + SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c SRCS+= module.c @@ -62,7 +67,7 @@ SRCS+= pnp.c # Forth interpreter .if defined(BOOT_FORTH) SRCS+= interp_forth.c -.include "../ficl.mk" +.include "${BOOTDIR}/ficl.mk" .endif .if defined(BOOT_PROMPT_123) @@ -78,6 +83,6 @@ VERSION_FILE?= ${.CURDIR}/version .if ${MK_REPRODUCIBLE_BUILD} != no REPRO_FLAG= -r .endif -vers.c: ${SRCTOP}/sys/boot/common/newvers.sh ${VERSION_FILE} - sh ${SRCTOP}/sys/boot/common/newvers.sh ${REPRO_FLAG} ${VERSION_FILE} \ +vers.c: ${LDR_MI}/newvers.sh ${VERSION_FILE} + sh ${LDR_MI}/newvers.sh ${REPRO_FLAG} ${VERSION_FILE} \ ${NEWVERSWHAT} Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -76,14 +76,8 @@ CFLAGS+= -I${.CURDIR}/../../../ficl/mips64 LIBFICL= ${.OBJDIR}/../../../ficl/libficl.a .endif -# Common code across BERI boot loader parts -.PATH: ${.CURDIR}/../common -CFLAGS+= -I${.CURDIR}/../common - # Always add MI sources -.PATH: ${.CURDIR}/../../../common -.include "${.CURDIR}/../../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../../common +.include "../../../loader.mk" # BERI files common to boot2 and loader .PATH: ${.CURDIR}/../common @@ -112,7 +106,7 @@ LDADD= ${LIBFICL} ${LIBSA} loader.help: help.common help.mips cat ${.ALLSRC} | \ - awk -f ${.CURDIR}/../../../common/merge_help.awk > ${.TARGET} + awk -f ${LDR_MI}/merge_help.awk > ${.TARGET} .PATH: ${.CURDIR}/../../../forth .include "${.CURDIR}/../../../forth/Makefile.inc" Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -94,9 +94,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif # Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common +.include "../../loader.mk" CFLAGS+= -I. CLEANFILES+= loader.help @@ -126,7 +124,7 @@ OBJS+= ${SRCS:N*.h:R:S/$/.o/g} loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ - awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + awk -f ${LDR_MI}/merge_help.awk > ${.TARGET} ldscript.abs: echo "UBLDR_LOADADDR = ${UBLDR_LOADADDR};" >${.TARGET} Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -72,9 +72,9 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -mcpu=powerpc64 # Always add MI sources -.PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. +.include "../../loader.mk" +.PATH: ${.CURDIR}/../../../libkern +CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I. CLEANFILES+= loader.help @@ -98,7 +98,7 @@ LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} loader.help: help.common help.kboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ - awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + awk -f ${LDR_MI}/merge_help.awk > ${.TARGET} .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -69,9 +69,9 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif # Always add MI sources -.PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. +.include "../../loader.mk" +.PATH: ${.CURDIR}/../../../libkern +CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I. CLEANFILES+= loader.help @@ -96,7 +96,7 @@ LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} loader.help: help.common help.ofw ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ - awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + awk -f ${LDR_MI}/merge_help.awk > ${.TARGET} .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -72,9 +72,9 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -mcpu=powerpc64 # Always add MI sources -.PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. +.include "../../loader.mk" +.PATH: ${.CURDIR}/../../../libkern +CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I. CLEANFILES+= loader.help @@ -100,7 +100,7 @@ font.h: loader.help: help.common help.ps3 ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ - awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + awk -f ${LDR_MI}/merge_help.awk > ${.TARGET} .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -75,9 +75,9 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif # Always add MI sources -.PATH: ${.CURDIR}/../../common ${.CURDIR}/../../../libkern -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. +.include "../../loader.mk" +.PATH: ${.CURDIR}/../../../libkern +CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I. CLEANFILES+= ${PROG}.help @@ -101,7 +101,7 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FD loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ - awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + awk -f ${LDR_MI}/merge_help.awk > ${.TARGET} .PATH: ${.CURDIR}/../../forth FILES= loader.help Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -66,9 +66,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif # Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common +.include "../../loader.mk" CFLAGS+= -I. CLEANFILES+= loader.help @@ -87,7 +85,7 @@ LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ - awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + awk -f ${LDR_MI}/merge_help.awk > ${.TARGET} .PATH: ${.CURDIR}/../../forth .include "${.CURDIR}/../../forth/Makefile.inc" Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:22 2017 (r324648) +++ head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:28 2017 (r324649) @@ -30,7 +30,6 @@ SRCS+= vers.c CFLAGS+= -Wall CFLAGS+= -I${.CURDIR}/.. -CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -ffreestanding -I. @@ -54,9 +53,7 @@ LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a .endif # Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common +.include "../../loader.mk" CFLAGS+= -I. DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} From owner-svn-src-head@freebsd.org Mon Oct 16 03:59:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42451E2CDD3; Mon, 16 Oct 2017 03:59:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 090D66AC2F; Mon, 16 Oct 2017 03:59:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G3xYKH087806; Mon, 16 Oct 2017 03:59:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G3xYJ1087805; Mon, 16 Oct 2017 03:59:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710160359.v9G3xYJ1087805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Oct 2017 03:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324650 - head/sys/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot X-SVN-Commit-Revision: 324650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 03:59:35 -0000 Author: imp Date: Mon Oct 16 03:59:33 2017 New Revision: 324650 URL: https://svnweb.freebsd.org/changeset/base/324650 Log: tweak style Modified: head/sys/boot/ficl.mk Modified: head/sys/boot/ficl.mk ============================================================================== --- head/sys/boot/ficl.mk Mon Oct 16 03:59:28 2017 (r324649) +++ head/sys/boot/ficl.mk Mon Oct 16 03:59:33 2017 (r324650) @@ -26,8 +26,7 @@ CFLAGS+= -fPIC CFLAGS+= -m32 -mcpu=powerpc -I. .endif -CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ - -I${FICLDIR}/../common +CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} -I${SRCTOP}/sys/boot/common .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) .if !exists(machine) From owner-svn-src-head@freebsd.org Mon Oct 16 03:59:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A390E2CE22; Mon, 16 Oct 2017 03:59:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDF846ACD3; Mon, 16 Oct 2017 03:59:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G3xcGc087865; Mon, 16 Oct 2017 03:59:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G3xcfi087861; Mon, 16 Oct 2017 03:59:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710160359.v9G3xcfi087861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Oct 2017 03:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324651 - head/sys/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot X-SVN-Commit-Revision: 324651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 03:59:40 -0000 Author: imp Date: Mon Oct 16 03:59:38 2017 New Revision: 324651 URL: https://svnweb.freebsd.org/changeset/base/324651 Log: create defs.mk for common definitions Added: head/sys/boot/defs.mk (contents, props changed) Modified: head/sys/boot/Makefile.inc head/sys/boot/ficl.mk head/sys/boot/loader.mk Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Mon Oct 16 03:59:33 2017 (r324650) +++ head/sys/boot/Makefile.inc Mon Oct 16 03:59:38 2017 (r324651) @@ -2,14 +2,10 @@ .include +.include "defs.mk" + .if !defined(__BOOT_MAKEFILE_INC__) __BOOT_MAKEFILE_INC__=${MFILE} - -SASRC=${SRCTOP}/sys/boot/libsa -# Normal Standalone library -LIBSA=${OBJTOP}/sys/boot/libsa/libsa.a -# Standalone library compiled for 32-bit version of the processor -LIBSA32=${OBJTOP}/sys/boot/libsa32/libsa32.a CFLAGS+=-I${SASRC} Added: head/sys/boot/defs.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/defs.mk Mon Oct 16 03:59:38 2017 (r324651) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +.if !defined(__BOOT_DEFS_MK__) +__BOOT_DEFS_MK__=${MFILE} + +BOOTDIR= ${SRCTOP}/sys/boot +FICLDIR= ${SRCTOP}/sys/boot/ficl +LDR_MI= ${BOOTDIR}/common +SASRC= ${SRCTOP}/sys/boot/libsa +SYSDIR= ${SRCTOP}/sys + +# Normal Standalone library +LIBSA= ${OBJTOP}/sys/boot/libsa/libsa.a +# Standalone library compiled for 32-bit version of the processor +LIBSA32= ${OBJTOP}/sys/boot/libsa32/libsa32.a + +.endif # __BOOT_DEFS_MK__ Modified: head/sys/boot/ficl.mk ============================================================================== --- head/sys/boot/ficl.mk Mon Oct 16 03:59:33 2017 (r324650) +++ head/sys/boot/ficl.mk Mon Oct 16 03:59:38 2017 (r324651) @@ -2,7 +2,7 @@ # Common flags to build FICL related files -FICLDIR?= ${SRCTOP}/sys/boot/ficl +.include "defs.mk" .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) FICL_CPUARCH= i386 @@ -26,7 +26,7 @@ CFLAGS+= -fPIC CFLAGS+= -m32 -mcpu=powerpc -I. .endif -CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} -I${SRCTOP}/sys/boot/common +CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} -I${LDR_MI} .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) .if !exists(machine) Modified: head/sys/boot/loader.mk ============================================================================== --- head/sys/boot/loader.mk Mon Oct 16 03:59:33 2017 (r324650) +++ head/sys/boot/loader.mk Mon Oct 16 03:59:38 2017 (r324651) @@ -1,7 +1,6 @@ # $FreeBSD$ -BOOTDIR=${SRCTOP}/sys/boot -LDR_MI=${BOOTDIR}/common +.include "defs.mk" .PATH: ${LDR_MI} ${BOOTDIR}/libsa From owner-svn-src-head@freebsd.org Mon Oct 16 03:59:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F50E2CEB7; Mon, 16 Oct 2017 03:59:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C1076ADC3; Mon, 16 Oct 2017 03:59:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G3xk6R087934; Mon, 16 Oct 2017 03:59:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G3xiD1087916; Mon, 16 Oct 2017 03:59:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710160359.v9G3xiD1087916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Oct 2017 03:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324652 - in head/sys/boot: . arm/uboot efi/boot1 efi/libefi efi/loader i386/loader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userbo... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot efi/boot1 efi/libefi efi/loader i386/loader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userboot/userboot X-SVN-Commit-Revision: 324652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 03:59:47 -0000 Author: imp Date: Mon Oct 16 03:59:44 2017 New Revision: 324652 URL: https://svnweb.freebsd.org/changeset/base/324652 Log: Move all the ficl common code into ficl.mk There's a number of copies of basically identical code to enable building forth in /boot/loader. Move it all into ficl.mk. Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/defs.mk head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/ficl.mk head/sys/boot/i386/loader/Makefile head/sys/boot/loader.mk head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -81,14 +81,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt. LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/arm -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - # Always add MI sources .include "../../loader.mk" CFLAGS+= -I. Modified: head/sys/boot/defs.mk ============================================================================== --- head/sys/boot/defs.mk Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/defs.mk Mon Oct 16 03:59:44 2017 (r324652) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .if !defined(__BOOT_DEFS_MK__) __BOOT_DEFS_MK__=${MFILE} @@ -9,9 +11,12 @@ LDR_MI= ${BOOTDIR}/common SASRC= ${SRCTOP}/sys/boot/libsa SYSDIR= ${SRCTOP}/sys -# Normal Standalone library +# NB: The makefiles depend on these being empty when we don't build forth. +.if ${MK_FORTH} != "no" +LIBFICL= ${OBJTOP}/sys/boot/ficl/libficl.a +LIBFICL32= ${OBJTOP}/sys/boot/ficl32/libficl.a +.endif LIBSA= ${OBJTOP}/sys/boot/libsa/libsa.a -# Standalone library compiled for 32-bit version of the processor LIBSA32= ${OBJTOP}/sys/boot/libsa32/libsa32.a .endif # __BOOT_DEFS_MK__ Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/efi/boot1/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -5,6 +5,7 @@ MAN= .include "../Makefile.inc" MK_SSP= no +MK_FORTH= no PROG= boot1.sym INTERNALPROG= Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -3,7 +3,6 @@ .include .if ${MK_FORTH} != "no" -CFLAGS+= -DBOOT_FORTH .include "../../ficl.mk" .endif Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -78,14 +78,6 @@ CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID .endif .endif -.if ${MK_FORTH} != "no" -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -CFLAGS+= -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH} -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - LOADER_FDT_SUPPORT?= no .if ${MK_FDT} != "no" && ${LOADER_FDT_SUPPORT} != "no" CFLAGS+= -I${.CURDIR}/../../fdt Modified: head/sys/boot/ficl.mk ============================================================================== --- head/sys/boot/ficl.mk Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/ficl.mk Mon Oct 16 03:59:44 2017 (r324652) @@ -27,6 +27,8 @@ CFLAGS+= -m32 -mcpu=powerpc -I. .endif CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} -I${LDR_MI} +CFLAGS+= -DBOOT_FORTH +CFLAGS+= -DBF_DICTSIZE=15000 .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) .if !exists(machine) Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -42,17 +42,6 @@ HAVE_BCACHE= yes HAVE_PNP= yes HAVE_ISABUS= yes -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 -.if ${MACHINE_CPUARCH} == "amd64" -LIBFICL= ${.OBJDIR}/../../ficl32/libficl.a -.else -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif -.endif - .if defined(LOADER_BZIP2_SUPPORT) CFLAGS+= -DLOADER_BZIP2_SUPPORT .endif @@ -119,8 +108,15 @@ FILES+= loader.rc menu.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} -LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +# XXX not happy with this construct, revisit +.if ${MACHINE_CPUARCH} == "amd64" +FICL= ${LIBFICL32} +.else +FICL= ${LIBFICL} +.endif + +DPADD= ${FICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +LDADD= ${FICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} .include Modified: head/sys/boot/loader.mk ============================================================================== --- head/sys/boot/loader.mk Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/loader.mk Mon Oct 16 03:59:44 2017 (r324652) @@ -64,7 +64,7 @@ SRCS+= pnp.c .endif # Forth interpreter -.if defined(BOOT_FORTH) +.if ${MK_FORTH} != "no" SRCS+= interp_forth.c .include "${BOOTDIR}/ficl.mk" .endif Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -68,14 +68,6 @@ CFLAGS+= -DLOADER_BZIP2_SUPPORT #CFLAGS+= -DLOADER_NFS_SUPPORT #CFLAGS+= -DLOADER_TFTP_SUPPORT -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../../ficl -CFLAGS+= -I${.CURDIR}/../../../ficl/mips64 -LIBFICL= ${.OBJDIR}/../../../ficl/libficl.a -.endif - # Always add MI sources .include "../../../loader.mk" Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -81,18 +81,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt. LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -.if ${MACHINE_ARCH:Mmips64*} != "" -CFLAGS+= -I${.CURDIR}/../../ficl/mips64 -.else -CFLAGS+= -I${.CURDIR}/../../ficl/mips -.endif -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - # Always add MI sources .include "../../loader.mk" CFLAGS+= -I. Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -60,15 +60,6 @@ CFLAGS+= -DLOADER_FDT_SUPPORT LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif - -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/powerpc -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - CFLAGS+= -mcpu=powerpc64 # Always add MI sources Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -60,16 +60,9 @@ CFLAGS+= -DLOADER_FDT_SUPPORT LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/powerpc -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - # Always add MI sources .include "../../loader.mk" + .PATH: ${.CURDIR}/../../../libkern CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I. Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -61,14 +61,6 @@ LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/powerpc -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - CFLAGS+= -mcpu=powerpc64 # Always add MI sources Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -66,14 +66,6 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt/libuboot_fdt. LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/powerpc -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - # Always add MI sources .include "../../loader.mk" .PATH: ${.CURDIR}/../../../libkern Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -57,14 +57,6 @@ CFLAGS+= -DLOADER_NFS_SUPPORT CFLAGS+= -DLOADER_TFTP_SUPPORT .endif -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/sparc64 -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - # Always add MI sources .include "../../loader.mk" CFLAGS+= -I. Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:38 2017 (r324651) +++ head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) @@ -39,14 +39,6 @@ LDFLAGS+= -nostdlib -Wl,-Bsymbolic NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} -.if ${MK_FORTH} != "no" -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -CFLAGS+= -I${.CURDIR}/../../ficl/i386 -CFLAGS+= -DBF_DICTSIZE=15000 -LIBFICL= ${.OBJDIR}/../ficl/libficl.a -.endif - .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a From owner-svn-src-head@freebsd.org Mon Oct 16 03:59:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95259E2CF2D; Mon, 16 Oct 2017 03:59:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DCC86AEB4; Mon, 16 Oct 2017 03:59:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G3xspp088004; Mon, 16 Oct 2017 03:59:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G3xq1f087985; Mon, 16 Oct 2017 03:59:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710160359.v9G3xq1f087985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Oct 2017 03:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324653 - in head/sys/boot: . arm/uboot efi/libefi efi/loader i386/libi386 i386/loader i386/zfsboot mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot efi/libefi efi/loader i386/libi386 i386/loader i386/zfsboot mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader uboot/lib userb... X-SVN-Commit-Revision: 324653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 03:59:55 -0000 Author: imp Date: Mon Oct 16 03:59:52 2017 New Revision: 324653 URL: https://svnweb.freebsd.org/changeset/base/324653 Log: LOADER_foo_SUPPORTED Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/defs.mk head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/loader.mk head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/uboot/lib/Makefile head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -19,60 +19,17 @@ SRCS= start.S conf.c self_reloc.c vers.c CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif -.if !defined(LOADER_NO_DISK_SUPPORT) -LOADER_DISK_SUPPORT?= yes -.else -LOADER_DISK_SUPPORT= no -.endif LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no -.if ${MK_NAND} != "no" -LOADER_NANDFS_SUPPORT?= yes -.else -LOADER_NANDFS_SUPPORT?= no -.endif LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -.if ${MK_FDT} != "no" -LOADER_FDT_SUPPORT= yes -.else -LOADER_FDT_SUPPORT= no -.endif +LOADER_FDT_SUPPORT= ${MK_FDT} -.if ${LOADER_DISK_SUPPORT} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif -.if ${LOADER_UFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_UFS_SUPPORT -.endif -.if ${LOADER_CD9660_SUPPORT} == "yes" -CFLAGS+= -DLOADER_CD9660_SUPPORT -.endif -.if ${LOADER_EXT2FS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_EXT2FS_SUPPORT -.endif -.if ${LOADER_NANDFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NANDFS_SUPPORT -.endif -.if ${LOADER_GZIP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if ${LOADER_BZIP2_SUPPORT} == "yes" -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if ${LOADER_NET_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NET_SUPPORT -.endif -.if ${LOADER_NFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif -.if ${LOADER_TFTP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif .if ${LOADER_FDT_SUPPORT} == "yes" CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.OBJDIR}/../../fdt Modified: head/sys/boot/defs.mk ============================================================================== --- head/sys/boot/defs.mk Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/defs.mk Mon Oct 16 03:59:52 2017 (r324653) @@ -19,4 +19,56 @@ LIBFICL32= ${OBJTOP}/sys/boot/ficl32/libficl.a LIBSA= ${OBJTOP}/sys/boot/libsa/libsa.a LIBSA32= ${OBJTOP}/sys/boot/libsa32/libsa32.a +# Standard options: + +# Filesystem support +.if ${LOADER_CD9660_SUPPORT:Uno} == "yes" +CFLAGS+= -DLOADER_CD9660_SUPPORT +.endif +.if ${LOADER_EXT2FS_SUPPORT:Uno} == "yes" +CFLAGS+= -DLOADER_EXT2FS_SUPPORT +.endif +.if ${LOADER_MSDOS_SUPPORT:Uno} == "yes" +CFLAGS+= -DLOADER_MSDOS_SUPPORT +.endif +.if ${LOADER_NANDFS_SUPPORT:U${MK_NAND}} == "yes" +CFLAGS+= -DLOADER_NANDFS_SUPPORT +.endif +.if ${LOADER_UFS_SUPPORT:Uyes} == "yes" +CFLAGS+= -DLOADER_UFS_SUPPORT +.endif + +# Compression +.if ${LOADER_GZIP_SUPPORT:Uno} == "yes" +CFLAGS+= -DLOADER_GZIP_SUPPORT +.endif +.if ${LOADER_BZIP2_SUPPORT:Uno} == "yes" +CFLAGS+= -DLOADER_BZIP2_SUPPORT +.endif + +# Network related things +.if ${LOADER_NET_SUPPORT:Uno} == "yes" +CFLAGS+= -DLOADER_NET_SUPPORT +.endif +.if ${LOADER_NFS_SUPPORT:Uno} == "yes" +CFLAGS+= -DLOADER_NFS_SUPPORT +.endif +.if ${LOADER_TFTP_SUPPORT:Uno} == "yes" +CFLAGS+= -DLOADER_TFTP_SUPPORT +.endif + +# Disk and partition support +.if ${LOADER_DISK_SUPPORT:Uyes} == "yes" +CFLAGS+= -DLOADER_DISK_SUPPORT +.if ${LOADER_GPT_SUPPORT:Uyes} == "yes" +CFLAGS+= -DLOADER_GPT_SUPPORT +.endif +.if ${LOADER_MBR_SUPPORT:Uyes} == "yes" +CFLAGS+= -DLOADER_MBR_SUPPORT +.endif +.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" +CFLAGS+= -DLOADER_GELI_SUPPORT +.endif +.endif + .endif # __BOOT_DEFS_MK__ Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -35,6 +35,7 @@ CFLAGS+= -mgeneral-regs-only .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -fPIC -mno-red-zone .endif +CFLAGS+= -I${SYSDIR} CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} .if ${MK_ZFS} != "no" Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -11,6 +11,11 @@ INTERNALPROG= WARNS?= 3 LOADER_NET_SUPPORT?= yes +LOADER_MSDOS_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no + # architecture-specific loader code SRCS= autoload.c \ bootinfo.c \ Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/i386/libi386/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -1,5 +1,7 @@ # $FreeBSD$ # +.include "../../defs.mk" + LIB= i386 INTERNALLIB= @@ -11,13 +13,6 @@ SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c .PATH: ${.CURDIR}/../../zfs SRCS+= devicename_stubs.c - -.if defined(LOADER_TFTP_SUPPORT) -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif -.if defined(LOADER_NFS_SUPPORT) -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif BOOT_COMCONSOLE_PORT?= 0x3f8 CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT} Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -13,6 +13,11 @@ LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no +LOADER_UFS_SUPPORT?= yes + # architecture-specific loader code SRCS= main.c conf.c vers.c chain.c @@ -28,13 +33,6 @@ CFLAGS+= -DLOADER_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a .endif -.if defined(LOADER_TFTP_SUPPORT) -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif -.if defined(LOADER_NFS_SUPPORT) -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif - # Include bcache code. HAVE_BCACHE= yes @@ -42,16 +40,7 @@ HAVE_BCACHE= yes HAVE_PNP= yes HAVE_ISABUS= yes -.if defined(LOADER_BZIP2_SUPPORT) -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if !defined(LOADER_NO_GZIP_SUPPORT) -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if defined(LOADER_NANDFS_SUPPORT) -CFLAGS+= -DLOADER_NANDFS_SUPPORT -.endif -.if !defined(LOADER_NO_GELI_SUPPORT) +.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -I${.CURDIR}/../../geli LIBGELIBOOT= ${.OBJDIR}/../../geli/libgeliboot.a Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/i386/zfsboot/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -1,5 +1,7 @@ # $FreeBSD$ +LOADER_GELI_SUPPORT=no + .include "../Makefile.inc" .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common \ Modified: head/sys/boot/loader.mk ============================================================================== --- head/sys/boot/loader.mk Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/loader.mk Mon Oct 16 03:59:52 2017 (r324653) @@ -28,22 +28,12 @@ SRCS+= load_elf64.c reloc_elf64.c SRCS+= load_elf32.c reloc_elf32.c .endif -.if defined(LOADER_NET_SUPPORT) -SRCS+= dev_net.c -.endif - -.if !defined(LOADER_NO_DISK_SUPPORT) +.if ${LOADER_DISK_SUPPORT:Uyes} == "yes" SRCS+= disk.c part.c -CFLAGS+= -DLOADER_DISK_SUPPORT -.if !defined(LOADER_NO_GPT_SUPPORT) -CFLAGS+= -DLOADER_GPT_SUPPORT .endif -.if !defined(LOADER_NO_MBR_SUPPORT) -CFLAGS+= -DLOADER_MBR_SUPPORT -.endif -.endif -.if !defined(LOADER_NO_GELI_SUPPORT) -CFLAGS+= -DLOADER_GELI_SUPPORT + +.if ${LOADER_NET_SUPPORT:Uno} == "yes" +SRCS+= dev_net.c .endif .if defined(HAVE_BCACHE) Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -59,14 +59,12 @@ SRCS+= altera_jtag_uart.c \ # Since we don't have a backward compatibility issue, default to this on BERI. CFLAGS+= -DBOOT_PROMPT_123 -CFLAGS+= -DLOADER_DISK_SUPPORT -CFLAGS+= -DLOADER_UFS_SUPPORT -CFLAGS+= -DLOADER_GZIP_SUPPORT -CFLAGS+= -DLOADER_BZIP2_SUPPORT - -#CFLAGS+= -DLOADER_NET_SUPPORT -#CFLAGS+= -DLOADER_NFS_SUPPORT -#CFLAGS+= -DLOADER_TFTP_SUPPORT +LOADER_MSDOS_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no +LOADER_GZIP_SUPPORT?= yes +LOADER_BZIP2_SUPPORT?= yes # Always add MI sources .include "../../../loader.mk" Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -15,64 +15,17 @@ UBLDR_LOADADDR?= 0xffffffff80800000 # Architecture-specific loader code SRCS= start.S conf.c vers.c -.if !defined(LOADER_NO_DISK_SUPPORT) -LOADER_DISK_SUPPORT?= yes -.else -LOADER_DISK_SUPPORT= no -.endif -LOADER_MSDOS_SUPPORT?= yes -LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no -.if ${MK_NAND} != "no" -LOADER_NANDFS_SUPPORT?= yes -.else -LOADER_NANDFS_SUPPORT?= no -.endif +LOADER_MSDOS_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -.if ${MK_FDT} != "no" -LOADER_FDT_SUPPORT= yes -.else -LOADER_FDT_SUPPORT= no -.endif +LOADER_FDT_SUPPORT= ${MK_FDT} -.if ${LOADER_DISK_SUPPORT} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif -.if ${LOADER_MSDOS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_MSDOS_SUPPORT -.endif -.if ${LOADER_UFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_UFS_SUPPORT -.endif -.if ${LOADER_CD9660_SUPPORT} == "yes" -CFLAGS+= -DLOADER_CD9660_SUPPORT -.endif -.if ${LOADER_EXT2FS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_EXT2FS_SUPPORT -.endif -.if ${LOADER_NANDFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NANDFS_SUPPORT -.endif -.if ${LOADER_GZIP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if ${LOADER_BZIP2_SUPPORT} == "yes" -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if ${LOADER_NET_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NET_SUPPORT -.endif -.if ${LOADER_NFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif -.if ${LOADER_TFTP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif .if ${LOADER_FDT_SUPPORT} == "yes" CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.OBJDIR}/../../fdt Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -14,10 +14,10 @@ SRCS= conf.c metadata.c vers.c main.c ppc64_elf_freeb SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S kbootfdt.c SRCS+= ucmpdi2.c -LOADER_DISK_SUPPORT?= yes -LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes +LOADER_MSDOS_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no @@ -25,33 +25,6 @@ LOADER_GZIP_SUPPORT?= yes LOADER_FDT_SUPPORT= yes LOADER_BZIP2_SUPPORT?= no -.if ${LOADER_DISK_SUPPORT} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif -.if ${LOADER_UFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_UFS_SUPPORT -.endif -.if ${LOADER_CD9660_SUPPORT} == "yes" -CFLAGS+= -DLOADER_CD9660_SUPPORT -.endif -.if ${LOADER_EXT2FS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_EXT2FS_SUPPORT -.endif -.if ${LOADER_GZIP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if ${LOADER_BZIP2_SUPPORT} == "yes" -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if ${LOADER_NET_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NET_SUPPORT -.endif -.if ${LOADER_NFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif -.if ${LOADER_TFTP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif .if ${LOADER_FDT_SUPPORT} == "yes" CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.OBJDIR}/../../fdt Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -13,10 +13,10 @@ INSTALLFLAGS= -b SRCS= conf.c metadata.c vers.c start.c SRCS+= ucmpdi2.c -LOADER_DISK_SUPPORT?= yes -LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no +LOADER_UFS_SUPPORT?= yes LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no @@ -24,33 +24,6 @@ LOADER_GZIP_SUPPORT?= yes LOADER_BZIP2_SUPPORT?= no LOADER_FDT_SUPPORT?= yes -.if ${LOADER_DISK_SUPPORT} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif -.if ${LOADER_UFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_UFS_SUPPORT -.endif -.if ${LOADER_CD9660_SUPPORT} == "yes" -CFLAGS+= -DLOADER_CD9660_SUPPORT -.endif -.if ${LOADER_EXT2FS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_EXT2FS_SUPPORT -.endif -.if ${LOADER_GZIP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if ${LOADER_BZIP2_SUPPORT} == "yes" -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if ${LOADER_NET_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NET_SUPPORT -.endif -.if ${LOADER_NFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif -.if ${LOADER_TFTP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif .if ${LOADER_FDT_SUPPORT} == "yes" SRCS+= ofwfdt.c CFLAGS+= -I${.CURDIR}/../../fdt Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -15,7 +15,6 @@ SRCS+= lv1call.S ps3cons.c font.h ps3mmu.c ps3net.c p ps3stor.c ps3disk.c ps3cdrom.c SRCS+= ucmpdi2.c -LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes LOADER_EXT2FS_SUPPORT?= yes @@ -26,40 +25,12 @@ LOADER_GZIP_SUPPORT?= yes LOADER_FDT_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -.if ${LOADER_DISK_SUPPORT} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif -.if ${LOADER_UFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_UFS_SUPPORT -.endif -.if ${LOADER_CD9660_SUPPORT} == "yes" -CFLAGS+= -DLOADER_CD9660_SUPPORT -.endif -.if ${LOADER_EXT2FS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_EXT2FS_SUPPORT -.endif -.if ${LOADER_GZIP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if ${LOADER_BZIP2_SUPPORT} == "yes" -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if ${LOADER_NET_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NET_SUPPORT -.endif -.if ${LOADER_NFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif -.if ${LOADER_TFTP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif .if ${LOADER_FDT_SUPPORT} == "yes" CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.OBJDIR}/../../fdt CFLAGS+= -DLOADER_FDT_SUPPORT LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a .endif - CFLAGS+= -mcpu=powerpc64 Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -12,11 +12,6 @@ MAN= SRCS= start.S conf.c vers.c SRCS+= ucmpdi2.c -.if !defined(LOADER_NO_DISK_SUPPORT) -LOADER_DISK_SUPPORT?= yes -.else -LOADER_DISK_SUPPORT= no -.endif LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no @@ -25,39 +20,8 @@ LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= no LOADER_GZIP_SUPPORT?= no LOADER_BZIP2_SUPPORT?= no -.if ${MK_FDT} != "no" -LOADER_FDT_SUPPORT= yes -.else -LOADER_FDT_SUPPORT= no -.endif +LOADER_FDT_SUPPORT= ${MK_FDT} -.if ${LOADER_DISK_SUPPORT} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif -.if ${LOADER_UFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_UFS_SUPPORT -.endif -.if ${LOADER_CD9660_SUPPORT} == "yes" -CFLAGS+= -DLOADER_CD9660_SUPPORT -.endif -.if ${LOADER_EXT2FS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_EXT2FS_SUPPORT -.endif -.if ${LOADER_GZIP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if ${LOADER_BZIP2_SUPPORT} == "yes" -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if ${LOADER_NET_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NET_SUPPORT -.endif -.if ${LOADER_NFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif -.if ${LOADER_TFTP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_TFTP_SUPPORT -.endif .if ${LOADER_FDT_SUPPORT} == "yes" CFLAGS+= -I${.CURDIR}/../../fdt CFLAGS+= -I${.OBJDIR}/../../fdt Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -15,6 +15,8 @@ SRCS= locore.S main.c metadata.c vers.c LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes +LOADER_EXT2FS_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no LOADER_ZFS_SUPPORT?= no LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes @@ -26,35 +28,11 @@ LOADER_DEBUG?= no .if ${LOADER_DEBUG} == "yes" CFLAGS+= -DLOADER_DEBUG .endif -.if ${LOADER_DISK_SUPPORT} == "yes" -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif -.if ${LOADER_UFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_UFS_SUPPORT -.endif -.if ${LOADER_CD9660_SUPPORT} == "yes" -CFLAGS+= -DLOADER_CD9660_SUPPORT -.endif .if ${LOADER_ZFS_SUPPORT} == "yes" CFLAGS+= -DLOADER_ZFS_SUPPORT CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a -.endif -.if ${LOADER_GZIP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif -.if ${LOADER_BZIP2_SUPPORT} == "yes" -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if ${LOADER_NET_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NET_SUPPORT -.endif -.if ${LOADER_NFS_SUPPORT} == "yes" -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif -.if ${LOADER_TFTP_SUPPORT} == "yes" -CFLAGS+= -DLOADER_TFTP_SUPPORT .endif # Always add MI sources Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/uboot/lib/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -13,11 +13,6 @@ SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float -.if !defined(LOADER_NO_DISK_SUPPORT) -SRCS+= disk.c -CFLAGS+= -DLOADER_DISK_SUPPORT -.endif - .if ${MK_FDT} != "no" LOADER_FDT_SUPPORT= yes .else Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:44 2017 (r324652) +++ head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:52 2017 (r324653) @@ -5,6 +5,11 @@ MAN= .include MK_SSP= no +LOADER_MSDOS_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes +LOADER_CD9660_SUPPORT?= no +LOADER_EXT2FS_SUPPORT?= no + SHLIB_NAME= userboot.so MK_CTF= no STRIP= From owner-svn-src-head@freebsd.org Mon Oct 16 04:00:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 002A8E2CFA8; Mon, 16 Oct 2017 03:59:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB8C16AF2C; Mon, 16 Oct 2017 03:59:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G3xweJ088056; Mon, 16 Oct 2017 03:59:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G3xwmi088055; Mon, 16 Oct 2017 03:59:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710160359.v9G3xwmi088055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Oct 2017 03:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324654 - head/sys/boot/libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/libsa X-SVN-Commit-Revision: 324654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 04:00:00 -0000 Author: imp Date: Mon Oct 16 03:59:58 2017 New Revision: 324654 URL: https://svnweb.freebsd.org/changeset/base/324654 Log: Explicitly inlcude SYSDIR in the include path -- need machine path too? Modified: head/sys/boot/libsa/Makefile Modified: head/sys/boot/libsa/Makefile ============================================================================== --- head/sys/boot/libsa/Makefile Mon Oct 16 03:59:52 2017 (r324653) +++ head/sys/boot/libsa/Makefile Mon Oct 16 03:59:58 2017 (r324654) @@ -21,7 +21,7 @@ LIB?= sa NO_PIC= WARNS?= 0 -CFLAGS+= -I${SASRC} +CFLAGS+= -I${SASRC} -I${SYSDIR} # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ From owner-svn-src-head@freebsd.org Mon Oct 16 04:04:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F72BE2D2D4 for ; Mon, 16 Oct 2017 04:04:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3E8F6B8D2 for ; Mon, 16 Oct 2017 04:04:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id n195so16570945itg.2 for ; Sun, 15 Oct 2017 21:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CwVzf916yABM2FklIBt1MVfaq7V5Xu3CtMQfwa4wWp4=; b=tg0j6FLLa77GudetEr6X3f60Vsas1Fy61nQ8qxjecdIkQkrJhnpWcDS/P5tcAUhS/h TOd3v773NPy90oV58e0wqOpAOV2gGjNqeQLS9yITpoCIJfkER/hDurI3nPdqSVVFygCx iNe+CNfLXTdjfe7+nST10Dfx8CfTTf3X5a9Gg6kvekAbRCTsEwszpQMm3d1X2biLnv1A 6EkJHT1nSArzSmFSuRWBWSxqRc8a8lARWml49CreL0QexSxY/i1oMI18PL5eSnBiw1IH fAKVYHBLqTqHOoFQC0331PZjrPAVV/JRX83owMA4fi/o+Ew7of97Y0puvw7AWKDdkFbG bXiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=CwVzf916yABM2FklIBt1MVfaq7V5Xu3CtMQfwa4wWp4=; b=gASEw4Anz0Ok/u4Ea4OZVVkBMb4kKmLNx/rkU7Opdb2yCszssNg+/XfU/Q8rkp5Ymy JQEaJAbpS1zfnEFeK3dFS+Z02Gj9GpeqTouz0ROZu9y9eJjx04K5Q3b31U72nuYjd7gy tZCPWzkR2JUdmpf7DWOZLbHtFo0+MzrJCempcWFOXvCd7ZPeRdw+wN7mWTQYtf2v723o ROM9lRZ+9XKxJ92O0Re4VS/x/gnw2y+2hVMYr9VLPD5C18iZURpxE07XlWp32SmzuKgE SnDdl036JdJEEX6tJ61cjb2lFBQE6XMSEhuQI3MIbdLIamFEvCkPiTJHZz7HQNesk+3V U6fg== X-Gm-Message-State: AMCzsaU8lGxbWreZDol+7Un6G4mL2YFxdomBmVx/8CZBvvJ4fhYttm72 75WcP/74CqSZ2fOwrM2mlGaqw/4cXY0NQ6W2vWseTQ== X-Google-Smtp-Source: AOwi7QCAKQ1jn3cV1fghPtGU7RfsmjQEenp++z8+PxLi9hTxIwphIlb6BoBOufswUEBiv+1crCbTR9LkPdFYlM9+g8o= X-Received: by 10.36.118.81 with SMTP id z78mr10311103itb.97.1508126654647; Sun, 15 Oct 2017 21:04:14 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Sun, 15 Oct 2017 21:04:14 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <201710160359.v9G3xq1f087985@repo.freebsd.org> References: <201710160359.v9G3xq1f087985@repo.freebsd.org> From: Warner Losh Date: Sun, 15 Oct 2017 22:04:14 -0600 X-Google-Sender-Auth: 1VpQY25DHAzL9mJYbEmdwvz9l08 Message-ID: Subject: Re: svn commit: r324653 - in head/sys/boot: . arm/uboot efi/libefi efi/loader i386/libi386 i386/loader i386/zfsboot mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc... To: Warner Losh Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 04:04:16 -0000 On Sun, Oct 15, 2017 at 9:59 PM, Warner Losh wrote: > Author: imp > Date: Mon Oct 16 03:59:52 2017 > New Revision: 324653 > URL: https://svnweb.freebsd.org/changeset/base/324653 > > Log: > LOADER_foo_SUPPORTED > Urrrgggg.. I forgot to change this to the real commit message.... Should I revert and recommit? " Move the LOADER_foo_SUPPORTED into a common location. Sponsored by: Netflix " seems to be only marginally better and not worth the hassle. But I'm open to differing views. Warner > Modified: > head/sys/boot/arm/uboot/Makefile > head/sys/boot/defs.mk > head/sys/boot/efi/libefi/Makefile > head/sys/boot/efi/loader/Makefile > head/sys/boot/i386/libi386/Makefile > head/sys/boot/i386/loader/Makefile > head/sys/boot/i386/zfsboot/Makefile > head/sys/boot/loader.mk > head/sys/boot/mips/beri/loader/Makefile > head/sys/boot/mips/uboot/Makefile > head/sys/boot/powerpc/kboot/Makefile > head/sys/boot/powerpc/ofw/Makefile > head/sys/boot/powerpc/ps3/Makefile > head/sys/boot/powerpc/uboot/Makefile > head/sys/boot/sparc64/loader/Makefile > head/sys/boot/uboot/lib/Makefile > head/sys/boot/userboot/userboot/Makefile > > Modified: head/sys/boot/arm/uboot/Makefile > ============================================================ > ================== > --- head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/arm/uboot/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -19,60 +19,17 @@ SRCS= start.S conf.c self_reloc.c vers.c > CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized > .endif > > -.if !defined(LOADER_NO_DISK_SUPPORT) > -LOADER_DISK_SUPPORT?= yes > -.else > -LOADER_DISK_SUPPORT= no > -.endif > LOADER_UFS_SUPPORT?= yes > LOADER_CD9660_SUPPORT?= no > +LOADER_MSDOS_SUPPORT?= no > LOADER_EXT2FS_SUPPORT?= no > -.if ${MK_NAND} != "no" > -LOADER_NANDFS_SUPPORT?= yes > -.else > -LOADER_NANDFS_SUPPORT?= no > -.endif > LOADER_NET_SUPPORT?= yes > LOADER_NFS_SUPPORT?= yes > LOADER_TFTP_SUPPORT?= no > LOADER_GZIP_SUPPORT?= no > LOADER_BZIP2_SUPPORT?= no > -.if ${MK_FDT} != "no" > -LOADER_FDT_SUPPORT= yes > -.else > -LOADER_FDT_SUPPORT= no > -.endif > +LOADER_FDT_SUPPORT= ${MK_FDT} > > -.if ${LOADER_DISK_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_DISK_SUPPORT > -.endif > -.if ${LOADER_UFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_UFS_SUPPORT > -.endif > -.if ${LOADER_CD9660_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_CD9660_SUPPORT > -.endif > -.if ${LOADER_EXT2FS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_EXT2FS_SUPPORT > -.endif > -.if ${LOADER_NANDFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NANDFS_SUPPORT > -.endif > -.if ${LOADER_GZIP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_GZIP_SUPPORT > -.endif > -.if ${LOADER_BZIP2_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_BZIP2_SUPPORT > -.endif > -.if ${LOADER_NET_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NET_SUPPORT > -.endif > -.if ${LOADER_NFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NFS_SUPPORT > -.endif > -.if ${LOADER_TFTP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_TFTP_SUPPORT > -.endif > .if ${LOADER_FDT_SUPPORT} == "yes" > CFLAGS+= -I${.CURDIR}/../../fdt > CFLAGS+= -I${.OBJDIR}/../../fdt > > Modified: head/sys/boot/defs.mk > ============================================================ > ================== > --- head/sys/boot/defs.mk Mon Oct 16 03:59:44 2017 (r324652) > +++ head/sys/boot/defs.mk Mon Oct 16 03:59:52 2017 (r324653) > @@ -19,4 +19,56 @@ LIBFICL32= ${OBJTOP}/sys/boot/ficl32/libficl.a > LIBSA= ${OBJTOP}/sys/boot/libsa/libsa.a > LIBSA32= ${OBJTOP}/sys/boot/libsa32/libsa32.a > > +# Standard options: > + > +# Filesystem support > +.if ${LOADER_CD9660_SUPPORT:Uno} == "yes" > +CFLAGS+= -DLOADER_CD9660_SUPPORT > +.endif > +.if ${LOADER_EXT2FS_SUPPORT:Uno} == "yes" > +CFLAGS+= -DLOADER_EXT2FS_SUPPORT > +.endif > +.if ${LOADER_MSDOS_SUPPORT:Uno} == "yes" > +CFLAGS+= -DLOADER_MSDOS_SUPPORT > +.endif > +.if ${LOADER_NANDFS_SUPPORT:U${MK_NAND}} == "yes" > +CFLAGS+= -DLOADER_NANDFS_SUPPORT > +.endif > +.if ${LOADER_UFS_SUPPORT:Uyes} == "yes" > +CFLAGS+= -DLOADER_UFS_SUPPORT > +.endif > + > +# Compression > +.if ${LOADER_GZIP_SUPPORT:Uno} == "yes" > +CFLAGS+= -DLOADER_GZIP_SUPPORT > +.endif > +.if ${LOADER_BZIP2_SUPPORT:Uno} == "yes" > +CFLAGS+= -DLOADER_BZIP2_SUPPORT > +.endif > + > +# Network related things > +.if ${LOADER_NET_SUPPORT:Uno} == "yes" > +CFLAGS+= -DLOADER_NET_SUPPORT > +.endif > +.if ${LOADER_NFS_SUPPORT:Uno} == "yes" > +CFLAGS+= -DLOADER_NFS_SUPPORT > +.endif > +.if ${LOADER_TFTP_SUPPORT:Uno} == "yes" > +CFLAGS+= -DLOADER_TFTP_SUPPORT > +.endif > + > +# Disk and partition support > +.if ${LOADER_DISK_SUPPORT:Uyes} == "yes" > +CFLAGS+= -DLOADER_DISK_SUPPORT > +.if ${LOADER_GPT_SUPPORT:Uyes} == "yes" > +CFLAGS+= -DLOADER_GPT_SUPPORT > +.endif > +.if ${LOADER_MBR_SUPPORT:Uyes} == "yes" > +CFLAGS+= -DLOADER_MBR_SUPPORT > +.endif > +.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" > +CFLAGS+= -DLOADER_GELI_SUPPORT > +.endif > +.endif > + > .endif # __BOOT_DEFS_MK__ > > Modified: head/sys/boot/efi/libefi/Makefile > ============================================================ > ================== > --- head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/efi/libefi/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -35,6 +35,7 @@ CFLAGS+= -mgeneral-regs-only > .if ${MACHINE_ARCH} == "amd64" > CFLAGS+= -fPIC -mno-red-zone > .endif > +CFLAGS+= -I${SYSDIR} > CFLAGS+= -I${.CURDIR}/../include > CFLAGS+= -I${.CURDIR}/../include/${MACHINE} > .if ${MK_ZFS} != "no" > > Modified: head/sys/boot/efi/loader/Makefile > ============================================================ > ================== > --- head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/efi/loader/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -11,6 +11,11 @@ INTERNALPROG= > WARNS?= 3 > LOADER_NET_SUPPORT?= yes > > +LOADER_MSDOS_SUPPORT?= yes > +LOADER_UFS_SUPPORT?= yes > +LOADER_CD9660_SUPPORT?= no > +LOADER_EXT2FS_SUPPORT?= no > + > # architecture-specific loader code > SRCS= autoload.c \ > bootinfo.c \ > > Modified: head/sys/boot/i386/libi386/Makefile > ============================================================ > ================== > --- head/sys/boot/i386/libi386/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/i386/libi386/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -1,5 +1,7 @@ > # $FreeBSD$ > # > +.include "../../defs.mk" > + > LIB= i386 > INTERNALLIB= > > @@ -11,13 +13,6 @@ SRCS= biosacpi.c bioscd.c biosdisk.c biosmem.c > biospnp > smbios.c time.c vidconsole.c amd64_tramp.S spinconsole.c > .PATH: ${.CURDIR}/../../zfs > SRCS+= devicename_stubs.c > - > -.if defined(LOADER_TFTP_SUPPORT) > -CFLAGS+= -DLOADER_TFTP_SUPPORT > -.endif > -.if defined(LOADER_NFS_SUPPORT) > -CFLAGS+= -DLOADER_NFS_SUPPORT > -.endif > > BOOT_COMCONSOLE_PORT?= 0x3f8 > CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT} > > Modified: head/sys/boot/i386/loader/Makefile > ============================================================ > ================== > --- head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/i386/loader/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -13,6 +13,11 @@ LOADER_NET_SUPPORT?= yes > LOADER_NFS_SUPPORT?= yes > LOADER_TFTP_SUPPORT?= yes > > +LOADER_CD9660_SUPPORT?= no > +LOADER_EXT2FS_SUPPORT?= no > +LOADER_MSDOS_SUPPORT?= no > +LOADER_UFS_SUPPORT?= yes > + > # architecture-specific loader code > SRCS= main.c conf.c vers.c chain.c > > @@ -28,13 +33,6 @@ CFLAGS+= -DLOADER_ZFS_SUPPORT > LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a > .endif > > -.if defined(LOADER_TFTP_SUPPORT) > -CFLAGS+= -DLOADER_TFTP_SUPPORT > -.endif > -.if defined(LOADER_NFS_SUPPORT) > -CFLAGS+= -DLOADER_NFS_SUPPORT > -.endif > - > # Include bcache code. > HAVE_BCACHE= yes > > @@ -42,16 +40,7 @@ HAVE_BCACHE= yes > HAVE_PNP= yes > HAVE_ISABUS= yes > > -.if defined(LOADER_BZIP2_SUPPORT) > -CFLAGS+= -DLOADER_BZIP2_SUPPORT > -.endif > -.if !defined(LOADER_NO_GZIP_SUPPORT) > -CFLAGS+= -DLOADER_GZIP_SUPPORT > -.endif > -.if defined(LOADER_NANDFS_SUPPORT) > -CFLAGS+= -DLOADER_NANDFS_SUPPORT > -.endif > -.if !defined(LOADER_NO_GELI_SUPPORT) > +.if ${LOADER_GELI_SUPPORT:Uyes} == "yes" > CFLAGS+= -DLOADER_GELI_SUPPORT > CFLAGS+= -I${.CURDIR}/../../geli > LIBGELIBOOT= ${.OBJDIR}/../../geli/libgeliboot.a > > Modified: head/sys/boot/i386/zfsboot/Makefile > ============================================================ > ================== > --- head/sys/boot/i386/zfsboot/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/i386/zfsboot/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -1,5 +1,7 @@ > # $FreeBSD$ > > +LOADER_GELI_SUPPORT=no > + > .include "../Makefile.inc" > > .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common \ > > Modified: head/sys/boot/loader.mk > ============================================================ > ================== > --- head/sys/boot/loader.mk Mon Oct 16 03:59:44 2017 (r324652) > +++ head/sys/boot/loader.mk Mon Oct 16 03:59:52 2017 (r324653) > @@ -28,22 +28,12 @@ SRCS+= load_elf64.c reloc_elf64.c > SRCS+= load_elf32.c reloc_elf32.c > .endif > > -.if defined(LOADER_NET_SUPPORT) > -SRCS+= dev_net.c > -.endif > - > -.if !defined(LOADER_NO_DISK_SUPPORT) > +.if ${LOADER_DISK_SUPPORT:Uyes} == "yes" > SRCS+= disk.c part.c > -CFLAGS+= -DLOADER_DISK_SUPPORT > -.if !defined(LOADER_NO_GPT_SUPPORT) > -CFLAGS+= -DLOADER_GPT_SUPPORT > .endif > -.if !defined(LOADER_NO_MBR_SUPPORT) > -CFLAGS+= -DLOADER_MBR_SUPPORT > -.endif > -.endif > -.if !defined(LOADER_NO_GELI_SUPPORT) > -CFLAGS+= -DLOADER_GELI_SUPPORT > + > +.if ${LOADER_NET_SUPPORT:Uno} == "yes" > +SRCS+= dev_net.c > .endif > > .if defined(HAVE_BCACHE) > > Modified: head/sys/boot/mips/beri/loader/Makefile > ============================================================ > ================== > --- head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/mips/beri/loader/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -59,14 +59,12 @@ SRCS+= altera_jtag_uart.c > \ > # Since we don't have a backward compatibility issue, default to this on > BERI. > CFLAGS+= -DBOOT_PROMPT_123 > > -CFLAGS+= -DLOADER_DISK_SUPPORT > -CFLAGS+= -DLOADER_UFS_SUPPORT > -CFLAGS+= -DLOADER_GZIP_SUPPORT > -CFLAGS+= -DLOADER_BZIP2_SUPPORT > - > -#CFLAGS+= -DLOADER_NET_SUPPORT > -#CFLAGS+= -DLOADER_NFS_SUPPORT > -#CFLAGS+= -DLOADER_TFTP_SUPPORT > +LOADER_MSDOS_SUPPORT?= yes > +LOADER_UFS_SUPPORT?= yes > +LOADER_CD9660_SUPPORT?= no > +LOADER_EXT2FS_SUPPORT?= no > +LOADER_GZIP_SUPPORT?= yes > +LOADER_BZIP2_SUPPORT?= yes > > # Always add MI sources > .include "../../../loader.mk" > > Modified: head/sys/boot/mips/uboot/Makefile > ============================================================ > ================== > --- head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/mips/uboot/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -15,64 +15,17 @@ UBLDR_LOADADDR?= 0xffffffff80800000 > # Architecture-specific loader code > SRCS= start.S conf.c vers.c > > -.if !defined(LOADER_NO_DISK_SUPPORT) > -LOADER_DISK_SUPPORT?= yes > -.else > -LOADER_DISK_SUPPORT= no > -.endif > -LOADER_MSDOS_SUPPORT?= yes > -LOADER_UFS_SUPPORT?= yes > LOADER_CD9660_SUPPORT?= no > LOADER_EXT2FS_SUPPORT?= no > -.if ${MK_NAND} != "no" > -LOADER_NANDFS_SUPPORT?= yes > -.else > -LOADER_NANDFS_SUPPORT?= no > -.endif > +LOADER_MSDOS_SUPPORT?= yes > +LOADER_UFS_SUPPORT?= yes > LOADER_NET_SUPPORT?= yes > LOADER_NFS_SUPPORT?= yes > LOADER_TFTP_SUPPORT?= no > LOADER_GZIP_SUPPORT?= no > LOADER_BZIP2_SUPPORT?= no > -.if ${MK_FDT} != "no" > -LOADER_FDT_SUPPORT= yes > -.else > -LOADER_FDT_SUPPORT= no > -.endif > +LOADER_FDT_SUPPORT= ${MK_FDT} > > -.if ${LOADER_DISK_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_DISK_SUPPORT > -.endif > -.if ${LOADER_MSDOS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_MSDOS_SUPPORT > -.endif > -.if ${LOADER_UFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_UFS_SUPPORT > -.endif > -.if ${LOADER_CD9660_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_CD9660_SUPPORT > -.endif > -.if ${LOADER_EXT2FS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_EXT2FS_SUPPORT > -.endif > -.if ${LOADER_NANDFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NANDFS_SUPPORT > -.endif > -.if ${LOADER_GZIP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_GZIP_SUPPORT > -.endif > -.if ${LOADER_BZIP2_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_BZIP2_SUPPORT > -.endif > -.if ${LOADER_NET_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NET_SUPPORT > -.endif > -.if ${LOADER_NFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NFS_SUPPORT > -.endif > -.if ${LOADER_TFTP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_TFTP_SUPPORT > -.endif > .if ${LOADER_FDT_SUPPORT} == "yes" > CFLAGS+= -I${.CURDIR}/../../fdt > CFLAGS+= -I${.OBJDIR}/../../fdt > > Modified: head/sys/boot/powerpc/kboot/Makefile > ============================================================ > ================== > --- head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/powerpc/kboot/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -14,10 +14,10 @@ SRCS= conf.c metadata.c vers.c main.c > ppc64_elf_freeb > SRCS+= host_syscall.S hostcons.c hostdisk.c kerneltramp.S > kbootfdt.c > SRCS+= ucmpdi2.c > > -LOADER_DISK_SUPPORT?= yes > -LOADER_UFS_SUPPORT?= yes > LOADER_CD9660_SUPPORT?= yes > +LOADER_MSDOS_SUPPORT?= no > LOADER_EXT2FS_SUPPORT?= yes > +LOADER_UFS_SUPPORT?= yes > LOADER_NET_SUPPORT?= yes > LOADER_NFS_SUPPORT?= yes > LOADER_TFTP_SUPPORT?= no > @@ -25,33 +25,6 @@ LOADER_GZIP_SUPPORT?= yes > LOADER_FDT_SUPPORT= yes > LOADER_BZIP2_SUPPORT?= no > > -.if ${LOADER_DISK_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_DISK_SUPPORT > -.endif > -.if ${LOADER_UFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_UFS_SUPPORT > -.endif > -.if ${LOADER_CD9660_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_CD9660_SUPPORT > -.endif > -.if ${LOADER_EXT2FS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_EXT2FS_SUPPORT > -.endif > -.if ${LOADER_GZIP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_GZIP_SUPPORT > -.endif > -.if ${LOADER_BZIP2_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_BZIP2_SUPPORT > -.endif > -.if ${LOADER_NET_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NET_SUPPORT > -.endif > -.if ${LOADER_NFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NFS_SUPPORT > -.endif > -.if ${LOADER_TFTP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_TFTP_SUPPORT > -.endif > .if ${LOADER_FDT_SUPPORT} == "yes" > CFLAGS+= -I${.CURDIR}/../../fdt > CFLAGS+= -I${.OBJDIR}/../../fdt > > Modified: head/sys/boot/powerpc/ofw/Makefile > ============================================================ > ================== > --- head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/powerpc/ofw/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -13,10 +13,10 @@ INSTALLFLAGS= -b > SRCS= conf.c metadata.c vers.c start.c > SRCS+= ucmpdi2.c > > -LOADER_DISK_SUPPORT?= yes > -LOADER_UFS_SUPPORT?= yes > LOADER_CD9660_SUPPORT?= yes > LOADER_EXT2FS_SUPPORT?= no > +LOADER_MSDOS_SUPPORT?= no > +LOADER_UFS_SUPPORT?= yes > LOADER_NET_SUPPORT?= yes > LOADER_NFS_SUPPORT?= yes > LOADER_TFTP_SUPPORT?= no > @@ -24,33 +24,6 @@ LOADER_GZIP_SUPPORT?= yes > LOADER_BZIP2_SUPPORT?= no > LOADER_FDT_SUPPORT?= yes > > -.if ${LOADER_DISK_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_DISK_SUPPORT > -.endif > -.if ${LOADER_UFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_UFS_SUPPORT > -.endif > -.if ${LOADER_CD9660_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_CD9660_SUPPORT > -.endif > -.if ${LOADER_EXT2FS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_EXT2FS_SUPPORT > -.endif > -.if ${LOADER_GZIP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_GZIP_SUPPORT > -.endif > -.if ${LOADER_BZIP2_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_BZIP2_SUPPORT > -.endif > -.if ${LOADER_NET_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NET_SUPPORT > -.endif > -.if ${LOADER_NFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NFS_SUPPORT > -.endif > -.if ${LOADER_TFTP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_TFTP_SUPPORT > -.endif > .if ${LOADER_FDT_SUPPORT} == "yes" > SRCS+= ofwfdt.c > CFLAGS+= -I${.CURDIR}/../../fdt > > Modified: head/sys/boot/powerpc/ps3/Makefile > ============================================================ > ================== > --- head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/powerpc/ps3/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -15,7 +15,6 @@ SRCS+= lv1call.S ps3cons.c font.h > ps3mmu.c ps3net.c p > ps3stor.c ps3disk.c ps3cdrom.c > SRCS+= ucmpdi2.c > > -LOADER_DISK_SUPPORT?= yes > LOADER_UFS_SUPPORT?= yes > LOADER_CD9660_SUPPORT?= yes > LOADER_EXT2FS_SUPPORT?= yes > @@ -26,40 +25,12 @@ LOADER_GZIP_SUPPORT?= yes > LOADER_FDT_SUPPORT?= no > LOADER_BZIP2_SUPPORT?= no > > -.if ${LOADER_DISK_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_DISK_SUPPORT > -.endif > -.if ${LOADER_UFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_UFS_SUPPORT > -.endif > -.if ${LOADER_CD9660_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_CD9660_SUPPORT > -.endif > -.if ${LOADER_EXT2FS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_EXT2FS_SUPPORT > -.endif > -.if ${LOADER_GZIP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_GZIP_SUPPORT > -.endif > -.if ${LOADER_BZIP2_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_BZIP2_SUPPORT > -.endif > -.if ${LOADER_NET_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NET_SUPPORT > -.endif > -.if ${LOADER_NFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NFS_SUPPORT > -.endif > -.if ${LOADER_TFTP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_TFTP_SUPPORT > -.endif > .if ${LOADER_FDT_SUPPORT} == "yes" > CFLAGS+= -I${.CURDIR}/../../fdt > CFLAGS+= -I${.OBJDIR}/../../fdt > CFLAGS+= -DLOADER_FDT_SUPPORT > LIBFDT= ${.OBJDIR}/../../fdt/libfdt.a > .endif > - > > CFLAGS+= -mcpu=powerpc64 > > > Modified: head/sys/boot/powerpc/uboot/Makefile > ============================================================ > ================== > --- head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/powerpc/uboot/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -12,11 +12,6 @@ MAN= > SRCS= start.S conf.c vers.c > SRCS+= ucmpdi2.c > > -.if !defined(LOADER_NO_DISK_SUPPORT) > -LOADER_DISK_SUPPORT?= yes > -.else > -LOADER_DISK_SUPPORT= no > -.endif > LOADER_UFS_SUPPORT?= yes > LOADER_CD9660_SUPPORT?= no > LOADER_EXT2FS_SUPPORT?= no > @@ -25,39 +20,8 @@ LOADER_NFS_SUPPORT?= yes > LOADER_TFTP_SUPPORT?= no > LOADER_GZIP_SUPPORT?= no > LOADER_BZIP2_SUPPORT?= no > -.if ${MK_FDT} != "no" > -LOADER_FDT_SUPPORT= yes > -.else > -LOADER_FDT_SUPPORT= no > -.endif > +LOADER_FDT_SUPPORT= ${MK_FDT} > > -.if ${LOADER_DISK_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_DISK_SUPPORT > -.endif > -.if ${LOADER_UFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_UFS_SUPPORT > -.endif > -.if ${LOADER_CD9660_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_CD9660_SUPPORT > -.endif > -.if ${LOADER_EXT2FS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_EXT2FS_SUPPORT > -.endif > -.if ${LOADER_GZIP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_GZIP_SUPPORT > -.endif > -.if ${LOADER_BZIP2_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_BZIP2_SUPPORT > -.endif > -.if ${LOADER_NET_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NET_SUPPORT > -.endif > -.if ${LOADER_NFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NFS_SUPPORT > -.endif > -.if ${LOADER_TFTP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_TFTP_SUPPORT > -.endif > .if ${LOADER_FDT_SUPPORT} == "yes" > CFLAGS+= -I${.CURDIR}/../../fdt > CFLAGS+= -I${.OBJDIR}/../../fdt > > Modified: head/sys/boot/sparc64/loader/Makefile > ============================================================ > ================== > --- head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -15,6 +15,8 @@ SRCS= locore.S main.c metadata.c vers.c > LOADER_DISK_SUPPORT?= yes > LOADER_UFS_SUPPORT?= yes > LOADER_CD9660_SUPPORT?= yes > +LOADER_EXT2FS_SUPPORT?= no > +LOADER_MSDOS_SUPPORT?= no > LOADER_ZFS_SUPPORT?= no > LOADER_NET_SUPPORT?= yes > LOADER_NFS_SUPPORT?= yes > @@ -26,35 +28,11 @@ LOADER_DEBUG?= no > .if ${LOADER_DEBUG} == "yes" > CFLAGS+= -DLOADER_DEBUG > .endif > -.if ${LOADER_DISK_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_DISK_SUPPORT > -.endif > -.if ${LOADER_UFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_UFS_SUPPORT > -.endif > -.if ${LOADER_CD9660_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_CD9660_SUPPORT > -.endif > .if ${LOADER_ZFS_SUPPORT} == "yes" > CFLAGS+= -DLOADER_ZFS_SUPPORT > CFLAGS+= -I${.CURDIR}/../../zfs > CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs > LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a > -.endif > -.if ${LOADER_GZIP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_GZIP_SUPPORT > -.endif > -.if ${LOADER_BZIP2_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_BZIP2_SUPPORT > -.endif > -.if ${LOADER_NET_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NET_SUPPORT > -.endif > -.if ${LOADER_NFS_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_NFS_SUPPORT > -.endif > -.if ${LOADER_TFTP_SUPPORT} == "yes" > -CFLAGS+= -DLOADER_TFTP_SUPPORT > .endif > > # Always add MI sources > > Modified: head/sys/boot/uboot/lib/Makefile > ============================================================ > ================== > --- head/sys/boot/uboot/lib/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/uboot/lib/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -13,11 +13,6 @@ SRCS+= module.c net.c reboot.c time.c > > CFLAGS+= -ffreestanding -msoft-float > > -.if !defined(LOADER_NO_DISK_SUPPORT) > -SRCS+= disk.c > -CFLAGS+= -DLOADER_DISK_SUPPORT > -.endif > - > .if ${MK_FDT} != "no" > LOADER_FDT_SUPPORT= yes > .else > > Modified: head/sys/boot/userboot/userboot/Makefile > ============================================================ > ================== > --- head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:44 2017 > (r324652) > +++ head/sys/boot/userboot/userboot/Makefile Mon Oct 16 03:59:52 2017 > (r324653) > @@ -5,6 +5,11 @@ MAN= > .include > MK_SSP= no > > +LOADER_MSDOS_SUPPORT?= yes > +LOADER_UFS_SUPPORT?= yes > +LOADER_CD9660_SUPPORT?= no > +LOADER_EXT2FS_SUPPORT?= no > + > SHLIB_NAME= userboot.so > MK_CTF= no > STRIP= > > From owner-svn-src-head@freebsd.org Mon Oct 16 04:46:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48E46E2DEA9; Mon, 16 Oct 2017 04:46:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA3576C6AF; Mon, 16 Oct 2017 04:46:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G4kTV8008467; Mon, 16 Oct 2017 04:46:29 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G4kTig008466; Mon, 16 Oct 2017 04:46:29 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201710160446.v9G4kTig008466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 16 Oct 2017 04:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324655 - head/lib/libstand X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/lib/libstand X-SVN-Commit-Revision: 324655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 04:46:30 -0000 Author: delphij Date: Mon Oct 16 04:46:28 2017 New Revision: 324655 URL: https://svnweb.freebsd.org/changeset/base/324655 Log: Remove the libstand directory which is now empty. Deleted: head/lib/libstand/ From owner-svn-src-head@freebsd.org Mon Oct 16 04:53:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B6AE2E0DB for ; Mon, 16 Oct 2017 04:53:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A21596CA72 for ; Mon, 16 Oct 2017 04:53:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id o135so16671088itb.0 for ; Sun, 15 Oct 2017 21:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=5GmEfhSMsUcp8T7ru9hoHSMMyb/HRQjyT27ct9xN3LQ=; b=1oO5sfMOq5mYpVrlbm3qSdcKB1gZNCycKt6I3xQs01Li4B+CfRiuOoOC8LnGSf1tNg LXOSuhD/Cjojtopw0CSR9ICD/VSlPhtdx0JSQUDgXgs6rEHPiKE5yXyKdwCFAesiULTk WxK/8DSWoApxLc3QbfjDy/1kW1llUAsRtUx0FhVnrL/WH5vJJriV6PwSqRKokdH3Qs7b tMF6xu9f+TdCsY5Ocg6EmG8DE5TLPBI7YtbIvWfPzwSK2SRR4AAqncjFFVKs03FkWK8s nBLjBdAzJNvk5qgjnqMq93ttCP0Hav2yecVQEosEZCrLzmRYasqbMzBkBpxV7+MZWXDt dFFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=5GmEfhSMsUcp8T7ru9hoHSMMyb/HRQjyT27ct9xN3LQ=; b=erniBbz3bXaHFv2+PmSyreyxx8mZTnpsHvSSCMAphaItfhFAFmrxbgH2o8zOE2E1Nb 687qfEnNitFY2Okg2dd6imEKtPNz6v0xrwFWALYQxHLMsdQCOc9+oAwJhB5jeeVaJBRX ZsO8/lQ4AJaUFoe4x6oO1QzyTeck6F0YWpCE0Bg8loPBiczh/clNb9lFYP0n97t/2rZj U947Stc8kG1zxzL0xsMUVm4EStGUMzec+K6sKwXsQPcdCR+dXHFPvfI8BYOyEURm1OCn jGuTKbXaLainvLeS3kuZcl6Zgu5BujlgV+hOJEfgRja8TpMxIZ8JSzeIhg2yFUaZRlV6 U2kg== X-Gm-Message-State: AMCzsaXVjFvgDnVHZig23FbGvWr9wsRX1u7HG99SkS6XuDXT5JbpndDu WwwhCO+lMNaMwbIQvkr3I5VJkbsWlCyI6uiJI+iW+A== X-Google-Smtp-Source: AOwi7QAh2ymeGngtARd7jX0PlbSJ4wZTh7UbHPbJRabPJOBWpX9CxfnUjTQHbqGyFcGJrE95DKntkbu3KjyX8S2XBZU= X-Received: by 10.36.118.81 with SMTP id z78mr10413800itb.97.1508129588993; Sun, 15 Oct 2017 21:53:08 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Sun, 15 Oct 2017 21:53:08 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:a0b5:c8ee:5cc8:3aa5] In-Reply-To: <201710160446.v9G4kTig008466@repo.freebsd.org> References: <201710160446.v9G4kTig008466@repo.freebsd.org> From: Warner Losh Date: Sun, 15 Oct 2017 22:53:08 -0600 X-Google-Sender-Auth: 7U7oRM5_4R0SQjZxQeX-wCItRM4 Message-ID: Subject: Re: svn commit: r324655 - head/lib/libstand To: Xin LI Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 04:53:10 -0000 On Sun, Oct 15, 2017 at 10:46 PM, Xin LI wrote: > Author: delphij > Date: Mon Oct 16 04:46:28 2017 > New Revision: 324655 > URL: https://svnweb.freebsd.org/changeset/base/324655 > > Log: > Remove the libstand directory which is now empty. > git svn will do this automatically, but only if you tell it to do so... which I forgot. Thanks for the cleanup. I'd missed it. Warner From owner-svn-src-head@freebsd.org Mon Oct 16 06:54:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D92BEE314D6; Mon, 16 Oct 2017 06:54:27 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3A6F6FB44; Mon, 16 Oct 2017 06:54:27 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G6sQ2l062313; Mon, 16 Oct 2017 06:54:26 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G6sQmA062311; Mon, 16 Oct 2017 06:54:26 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201710160654.v9G6sQmA062311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 16 Oct 2017 06:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324656 - head/lib/libifconfig X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/lib/libifconfig X-SVN-Commit-Revision: 324656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 06:54:28 -0000 Author: avos Date: Mon Oct 16 06:54:26 2017 New Revision: 324656 URL: https://svnweb.freebsd.org/changeset/base/324656 Log: libifconfig: allow to get original interface name via ifconfig_get_orig_name() Uses the same method as in tools/tools/ifinfo/ifinfo.c (via net.link.generic sysctl). Tested with modified wlandebug(8). Differential Revision: https://reviews.freebsd.org/D12554 Modified: head/lib/libifconfig/libifconfig.c head/lib/libifconfig/libifconfig.h Modified: head/lib/libifconfig/libifconfig.c ============================================================================== --- head/lib/libifconfig/libifconfig.c Mon Oct 16 04:46:28 2017 (r324655) +++ head/lib/libifconfig/libifconfig.c Mon Oct 16 06:54:26 2017 (r324656) @@ -61,9 +61,43 @@ * $FreeBSD$ */ + /* + * Copyright 1996 Massachusetts Institute of Technology + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby + * granted, provided that both the above copyright notice and this + * permission notice appear in all copies, that both the above + * copyright notice and this permission notice appear in all + * supporting documentation, and that the name of M.I.T. not be used + * in advertising or publicity pertaining to distribution of the + * software without specific, written prior permission. M.I.T. makes + * no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS + * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT + * SHALL M.I.T. 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. + * + * $FreeBSD$ + */ + +#include #include +#include #include +#include #include #include @@ -245,6 +279,67 @@ ifconfig_set_name(ifconfig_handle_t *h, const char *na free(tmpname); return (0); +} + +int +ifconfig_get_orig_name(ifconfig_handle_t *h, const char *ifname, + char **orig_name) +{ + struct ifmibdata ifmd; + size_t len; + int name[6]; + int i, maxifno; + + name[0] = CTL_NET; + name[1] = PF_LINK; + name[2] = NETLINK_GENERIC; + name[3] = IFMIB_SYSTEM; + name[4] = IFMIB_IFCOUNT; + + len = sizeof maxifno; + if (sysctl(name, 5, &maxifno, &len, 0, 0) < 0) { + h->error.errtype = OTHER; + h->error.errcode = errno; + return (-1); + } + + name[3] = IFMIB_IFDATA; + name[5] = IFDATA_GENERAL; + for (i = 1; i <= maxifno; i++) { + len = sizeof ifmd; + name[4] = i; + if (sysctl(name, 6, &ifmd, &len, 0, 0) < 0) { + if (errno == ENOENT) + continue; + + goto fail; + } + + if (strncmp(ifmd.ifmd_name, ifname, IFNAMSIZ) != 0) + continue; + + len = 0; + name[5] = IFDATA_DRIVERNAME; + if (sysctl(name, 6, NULL, &len, 0, 0) < 0) + goto fail; + + *orig_name = malloc(len); + if (*orig_name == NULL) + goto fail; + + if (sysctl(name, 6, *orig_name, &len, 0, 0) < 0) { + free(*orig_name); + *orig_name = NULL; + goto fail; + } + + return (0); + } + +fail: + h->error.errtype = OTHER; + h->error.errcode = (i <= maxifno) ? errno : ENOENT; + return (-1); } int Modified: head/lib/libifconfig/libifconfig.h ============================================================================== --- head/lib/libifconfig/libifconfig.h Mon Oct 16 04:46:28 2017 (r324655) +++ head/lib/libifconfig/libifconfig.h Mon Oct 16 06:54:26 2017 (r324656) @@ -82,6 +82,8 @@ int ifconfig_set_description(ifconfig_handle_t *h, con int ifconfig_unset_description(ifconfig_handle_t *h, const char *name); int ifconfig_set_name(ifconfig_handle_t *h, const char *name, const char *newname); +int ifconfig_get_orig_name(ifconfig_handle_t *h, const char *ifname, + char **orig_name); int ifconfig_set_mtu(ifconfig_handle_t *h, const char *name, const int mtu); int ifconfig_get_mtu(ifconfig_handle_t *h, const char *name, int *mtu); int ifconfig_set_metric(ifconfig_handle_t *h, const char *name, From owner-svn-src-head@freebsd.org Mon Oct 16 07:01:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6671E316F1; Mon, 16 Oct 2017 07:01:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3DE36FDD0; Mon, 16 Oct 2017 07:01:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G71R08065543; Mon, 16 Oct 2017 07:01:27 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G71RHX065541; Mon, 16 Oct 2017 07:01:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201710160701.v9G71RHX065541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 16 Oct 2017 07:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324657 - head/usr.sbin/wlandebug X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/usr.sbin/wlandebug X-SVN-Commit-Revision: 324657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 07:01:29 -0000 Author: avos Date: Mon Oct 16 07:01:27 2017 New Revision: 324657 URL: https://svnweb.freebsd.org/changeset/base/324657 Log: wlandebug(8): obtain original interface name via ifconfig_get_orig_name() Modified: head/usr.sbin/wlandebug/Makefile head/usr.sbin/wlandebug/wlandebug.c Modified: head/usr.sbin/wlandebug/Makefile ============================================================================== --- head/usr.sbin/wlandebug/Makefile Mon Oct 16 06:54:26 2017 (r324656) +++ head/usr.sbin/wlandebug/Makefile Mon Oct 16 07:01:27 2017 (r324657) @@ -3,6 +3,8 @@ PROG= wlandebug MAN= wlandebug.8 +LIBADD+= ifconfig + WARNS?= 2 .include Modified: head/usr.sbin/wlandebug/wlandebug.c ============================================================================== --- head/usr.sbin/wlandebug/wlandebug.c Mon Oct 16 06:54:26 2017 (r324656) +++ head/usr.sbin/wlandebug/wlandebug.c Mon Oct 16 07:01:27 2017 (r324657) @@ -43,6 +43,8 @@ #include #include +#include + #define N(a) (sizeof(a)/sizeof(a[0])) const char *progname; @@ -160,6 +162,21 @@ setoid(char oid[], size_t oidlen, const char *wlan) #endif } +static void +get_orig_iface_name(char *oid, size_t oid_size, char *name) +{ + struct ifconfig_handle *h; + char *orig_name; + + h = ifconfig_open(); + if (ifconfig_get_orig_name(h, name, &orig_name) < 0) + errc(1, ifconfig_err_errno(h), "cannot get interface name"); + + ifconfig_close(h); + setoid(oid, oid_size, orig_name); + free(orig_name); +} + int main(int argc, char *argv[]) { @@ -179,9 +196,7 @@ main(int argc, char *argv[]) } else if (strcmp(argv[1], "-i") == 0) { if (argc <= 2) errx(1, "missing interface name for -i option"); - if (strncmp(argv[2], "wlan", 4) != 0) - errx(1, "expecting a wlan interface name"); - setoid(oid, sizeof(oid), argv[2]); + get_orig_iface_name(oid, sizeof(oid), argv[2]); argc -= 2, argv += 2; } else if (strcmp(argv[1], "-?") == 0) usage(); From owner-svn-src-head@freebsd.org Mon Oct 16 07:15:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FA95E3196D; Mon, 16 Oct 2017 07:15:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF74E70428; Mon, 16 Oct 2017 07:15:51 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9G7Fojl070359; Mon, 16 Oct 2017 07:15:50 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9G7Fo14070358; Mon, 16 Oct 2017 07:15:50 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201710160715.v9G7Fo14070358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 16 Oct 2017 07:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324658 - head/usr.sbin/wlandebug X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/usr.sbin/wlandebug X-SVN-Commit-Revision: 324658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 07:15:52 -0000 Author: avos Date: Mon Oct 16 07:15:50 2017 New Revision: 324658 URL: https://svnweb.freebsd.org/changeset/base/324658 Log: wlandebug(8): add a sanity check. Modified: head/usr.sbin/wlandebug/wlandebug.c Modified: head/usr.sbin/wlandebug/wlandebug.c ============================================================================== --- head/usr.sbin/wlandebug/wlandebug.c Mon Oct 16 07:01:27 2017 (r324657) +++ head/usr.sbin/wlandebug/wlandebug.c Mon Oct 16 07:15:50 2017 (r324658) @@ -172,6 +172,9 @@ get_orig_iface_name(char *oid, size_t oid_size, char * if (ifconfig_get_orig_name(h, name, &orig_name) < 0) errc(1, ifconfig_err_errno(h), "cannot get interface name"); + if (strlen(orig_name) < strlen("wlan") + 1) + errx(1, "expecting a wlan interface name"); + ifconfig_close(h); setoid(oid, oid_size, orig_name); free(orig_name); From owner-svn-src-head@freebsd.org Mon Oct 16 08:29:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E96CE3327B; Mon, 16 Oct 2017 08:29:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7003872799; Mon, 16 Oct 2017 08:29:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by freefall.freebsd.org (Postfix, from userid 1235) id A0E9014021; Mon, 16 Oct 2017 08:29:19 +0000 (UTC) Date: Mon, 16 Oct 2017 10:29:19 +0200 From: Baptiste Daroussin To: Andriy Voskoboinyk Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324656 - head/lib/libifconfig Message-ID: <20171016082919.fyp2uiui7hzarrs2@ivaldir.net> References: <201710160654.v9G6sQmA062311@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sj5mqpawt2e3amsq" Content-Disposition: inline In-Reply-To: <201710160654.v9G6sQmA062311@repo.freebsd.org> User-Agent: NeoMutt/20170912 (1.9.0) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 08:29:20 -0000 --sj5mqpawt2e3amsq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 16, 2017 at 06:54:26AM +0000, Andriy Voskoboinyk wrote: > Author: avos > Date: Mon Oct 16 06:54:26 2017 > New Revision: 324656 > URL: https://svnweb.freebsd.org/changeset/base/324656 >=20 > Log: > libifconfig: allow to get original interface name via ifconfig_get_orig= _name() > =20 > Uses the same method as in tools/tools/ifinfo/ifinfo.c > (via net.link.generic sysctl). > =20 > Tested with modified wlandebug(8). > =20 > Differential Revision: https://reviews.freebsd.org/D12554 >=20 > Modified: > head/lib/libifconfig/libifconfig.c > head/lib/libifconfig/libifconfig.h >=20 > Modified: head/lib/libifconfig/libifconfig.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libifconfig/libifconfig.c Mon Oct 16 04:46:28 2017 (r324655) > +++ head/lib/libifconfig/libifconfig.c Mon Oct 16 06:54:26 2017 (r324656) > @@ -61,9 +61,43 @@ > * $FreeBSD$ > */ > =20 > + /* > + * Copyright 1996 Massachusetts Institute of Technology > + * 1996? This file was already under a BSD license, why adding an extra MIT license = to it? It would be better to keep it under BSD license imho Best regards, Bapt --sj5mqpawt2e3amsq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlnkbd0ACgkQY4mL3PG3 Plo/ihAA1Fb8oNp1826661lvEcYiOULI2psmA7nKjspuRjcUTGp6DaIwxrO+hogy 9FDOQRIEbJCSKEcUcBlnaNZTFSqBPpm75rp+jEBBdzL0BdP7s2GQ9gyZzaYYh0d+ PiUSme0zHoikGC8xBaSDgU1DWhLOZS+bAUtQRzaYQ99EeTxgpc35LoFejCtDUToI u36vfhfQc8N3D3i+jSOKcZBi3ibceaKf8vxzzxNHj9buf32hajMKy9zRA4n3Q7PJ 4gTJyz/caIfnA0DA23iZ9WQ2d9WrNTA6pv2AX947dyK5mabO7lXNzbCQZnWoTOUR BeRWh4lGT4bcJWWq1kxR7odOyRbsjxLU5OR3oKTr9Tqf8HG3jLb8Z+jfkHxe2ujZ F1F942VRsplQfewiAZ990Om9D0XqkS2AJeL9tan9E5lgym7Fzo+l0VIxDc0T/G0B qZRrRejmNRyfvX8ozwMW5qV+SP/7NSiLKEwPaLcXNedgAntxJsSTC956Y4Dcukzw BpTw828aOsg+tsB7D8W61DNtJyT7s8aaUBNp4y5BqF0UbpHw5cubBUdczQ9wtbNy uzRPciOc6FGbm3O00H5updODVQtP4sgZMyFVTj3+HzsYC8fZG1eOTLyod0Lu5vR4 wNC/ziUEWWoERqrQC3yz57QhhLbjfayzsVc4YdJrJ/b2okKWgyg= =W9xK -----END PGP SIGNATURE----- --sj5mqpawt2e3amsq-- From owner-svn-src-head@freebsd.org Mon Oct 16 09:26:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64F79E3466E; Mon, 16 Oct 2017 09:26:06 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 19BF774411; Mon, 16 Oct 2017 09:26:05 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2a02:c7f:1e13:cf00:496b:675f:1417:d64b] (unknown [IPv6:2a02:c7f:1e13:cf00:496b:675f:1417:d64b]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id D71A34ECB2; Mon, 16 Oct 2017 09:19:32 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r324646 - in head/sys/boot/efi: boot1 libefi loader From: Andrew Turner In-Reply-To: <201710160359.v9G3xCCi087576@repo.freebsd.org> Date: Mon, 16 Oct 2017 10:19:30 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201710160359.v9G3xCCi087576@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 09:26:06 -0000 > On 16 Oct 2017, at 04:59, Warner Losh wrote: >=20 > Author: imp > Date: Mon Oct 16 03:59:11 2017 > New Revision: 324646 > URL: https://svnweb.freebsd.org/changeset/base/324646 >=20 > Log: > Unify boot1 with loader >=20 > Refactor boot1 to use the same I/O code as /boot/loader uses. = Refactor > to use the common efi_main.c. >=20 > Submitted by: Eric McCorkle > Differential Revision: https://reviews.freebsd.org/D10447 >=20 > Added: > head/sys/boot/efi/libefi/efi_main.c (contents, props changed) > - copied, changed from r324645, = head/sys/boot/efi/loader/efi_main.c > Deleted: > head/sys/boot/efi/boot1/boot_module.h > head/sys/boot/efi/boot1/ufs_module.c > head/sys/boot/efi/boot1/zfs_module.c > head/sys/boot/efi/loader/efi_main.c > Modified: > head/sys/boot/efi/boot1/Makefile > head/sys/boot/efi/boot1/boot1.c > head/sys/boot/efi/libefi/Makefile > head/sys/boot/efi/loader/Makefile Hello Warner, After this change I=E2=80=99m getting the following panic on various = test VMs. Andrew >> FreeBSD EFI boot block Loader path: /boot/loader.efi Load Path: \EFI\BOOT\BOOTAA64.EFI Load Device: = VenHw(837DCA9E-E874-4D82-B29A-23FE0E23D1E2,003C000A00000000)/HD(1,GPT,DD40= E9C6-B247-11E7-AA0A-15EFE1BBB7CF,0x3,0x640) panic: Couldn't trim device path --> Press a key on the console to reboot <-- From owner-svn-src-head@freebsd.org Mon Oct 16 12:19:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D805DE3925D for ; Mon, 16 Oct 2017 12:19:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A5C57E46F for ; Mon, 16 Oct 2017 12:19:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id n137so15872397iod.6 for ; Mon, 16 Oct 2017 05:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=8+8bLkronD++WYZmaLO+Qv2Ui8hI19lBPMlTT2eZVoY=; b=Z0jcseaUlUAoRVcnZYPwOmqD2KOcu8bstVTONocsNRT0rT/Dj2EbaQPmXfujIOq5dv nJkv8ngjn0SDBDdgxDcXEJNkUAZJVFmg2HYTRmaLNNwZQsyE53a8exZ14u0Jrtisrd2B r5Q/P3zR1WF5Rn1fhCc6hqiMOnwpxAmoQiQ22hNLUMK7AfBVuFQVnDWKXT9j0SRaeto/ e9rsKrDqlP+a0t1kfBl6lVi9ljykXbDi3OdhzGFOJdRcgTv7ijFOoZ2YCYiJtFlAdH3F WBwqsLEkQrJCYNEZmEwvbUOKSD8vk73VEAFQiOyCsLuv4CIt5/wWdwnRBWemdACGz8P8 KXYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=8+8bLkronD++WYZmaLO+Qv2Ui8hI19lBPMlTT2eZVoY=; b=dmqFou639RHGXeT7+5lKA0eTIKVU80pgOes7dUjZwdGRFKAz178Ip7DLC1mtlEWuqX C9UhX+CFdgaEwgH8ix3rAfnQfU0Uh6txPY4TuL8AS5j9xVmbUuGyKaFnwE5znIBrtKIO /Z5eQTAXsIMOa7ZAzHbXLOh4OcV32jQcwLbRVuArAW226JLSK4YwXRVGWhjnC6/Zh8t+ QA4q58NIQ48lOuA18k7imq3xuMgHcSLxFIgCB5EmpePF0Du1wBLDXfA4xerYAqIWVx1j IQL9lDvF0lHNDbRf+YvTJ6EgnYcyrUkn2IDNKIXkGD+FAh67ZMWpd8SBgd7s4bqN2ux4 ZB+A== X-Gm-Message-State: AMCzsaUnCT7t7ZKE42XFT0g0BUmX4kqgReRfo61I2pW2Nrr+QnNyXL44 xXrxkfXColBu07BgU8mJO+M59ltIHLGLxee669UcjQ== X-Google-Smtp-Source: ABhQp+QTBExTLmk9+mpRGT9Zsb5w6+rPkZvCbL8mb/cNjM9EqDB8CBLbe8/cplp96RKO3BYCh/jE4DSXHUJdLUxksIM= X-Received: by 10.107.187.2 with SMTP id l2mr10914353iof.136.1508156370790; Mon, 16 Oct 2017 05:19:30 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Mon, 16 Oct 2017 05:19:29 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:5085:1a2f:dcb:9d2d] Received: by 10.79.94.130 with HTTP; Mon, 16 Oct 2017 05:19:29 -0700 (PDT) In-Reply-To: References: <201710160359.v9G3xCCi087576@repo.freebsd.org> From: Warner Losh Date: Mon, 16 Oct 2017 06:19:29 -0600 X-Google-Sender-Auth: -X_rQYPrgeyRAPJxMwREyDFV1s8 Message-ID: Subject: Re: svn commit: r324646 - in head/sys/boot/efi: boot1 libefi loader To: Andrew Turner , eric@meatspace.com Cc: src-committers , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Warner Losh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 12:19:32 -0000 I'll take a look, but I've also ccd Eric so he can figure out what went wrong with is code in your environment. What env is That? Warnee On Oct 16, 2017 3:26 AM, "Andrew Turner" wrote: > > > On 16 Oct 2017, at 04:59, Warner Losh wrote: > > > > Author: imp > > Date: Mon Oct 16 03:59:11 2017 > > New Revision: 324646 > > URL: https://svnweb.freebsd.org/changeset/base/324646 > > > > Log: > > Unify boot1 with loader > > > > Refactor boot1 to use the same I/O code as /boot/loader uses. Refactor > > to use the common efi_main.c. > > > > Submitted by: Eric McCorkle > > Differential Revision: https://reviews.freebsd.org/D10447 > > > > Added: > > head/sys/boot/efi/libefi/efi_main.c (contents, props changed) > > - copied, changed from r324645, head/sys/boot/efi/loader/efi_main.c > > Deleted: > > head/sys/boot/efi/boot1/boot_module.h > > head/sys/boot/efi/boot1/ufs_module.c > > head/sys/boot/efi/boot1/zfs_module.c > > head/sys/boot/efi/loader/efi_main.c > > Modified: > > head/sys/boot/efi/boot1/Makefile > > head/sys/boot/efi/boot1/boot1.c > > head/sys/boot/efi/libefi/Makefile > > head/sys/boot/efi/loader/Makefile > > Hello Warner, > > After this change I=E2=80=99m getting the following panic on various test= VMs. > > Andrew > > >> FreeBSD EFI boot block > > Loader path: /boot/loader.efi > > Load Path: \EFI\BOOT\BOOTAA64.EFI > Load Device: VenHw(837DCA9E-E874-4D82-B29A- > 23FE0E23D1E2,003C000A00000000)/HD(1,GPT,DD40E9C6-B247-11E7- > AA0A-15EFE1BBB7CF,0x3,0x640) > panic: Couldn't trim device path > --> Press a key on the console to reboot <-- > > From owner-svn-src-head@freebsd.org Mon Oct 16 12:32:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D30ABE398D4; Mon, 16 Oct 2017 12:32:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CCF37ED8C; Mon, 16 Oct 2017 12:32:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GCWv07003139; Mon, 16 Oct 2017 12:32:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GCWvcL003138; Mon, 16 Oct 2017 12:32:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201710161232.v9GCWvcL003138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 16 Oct 2017 12:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324659 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 324659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 12:32:59 -0000 Author: mav Date: Mon Oct 16 12:32:57 2017 New Revision: 324659 URL: https://svnweb.freebsd.org/changeset/base/324659 Log: Update details of interface capabilities changed by bridge(4). PR: 221122 MFC after: 1 week Modified: head/share/man/man4/bridge.4 Modified: head/share/man/man4/bridge.4 ============================================================================== --- head/share/man/man4/bridge.4 Mon Oct 16 07:15:50 2017 (r324658) +++ head/share/man/man4/bridge.4 Mon Oct 16 12:32:57 2017 (r324659) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 27, 2013 +.Dd October 16, 2017 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -129,8 +129,11 @@ in The MTU of the first member interface to be added is used as the bridge MTU. All additional members are required to have exactly the same value. .Pp -The TXCSUM capability is disabled for any interface added to the bridge, and it -is restored when the interface is removed again. +The TOE, TSO, TXCSUM and TXCSUM6 capabilities on all interfaces added to the +bridge are disabled if any of the interfaces doesn't support/enable them. +The LRO capability is always disabled. +All the capabilities are restored when the interface is removed from bridge. +Changing capabilities in run time may cause NIC reinit and the link flap. .Pp The bridge supports .Dq monitor mode , From owner-svn-src-head@freebsd.org Mon Oct 16 12:53:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18B36E3A1FC; Mon, 16 Oct 2017 12:53:56 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5BF87FA7D; Mon, 16 Oct 2017 12:53:55 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GCrsg1011431; Mon, 16 Oct 2017 12:53:54 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GCrsRI011425; Mon, 16 Oct 2017 12:53:54 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201710161253.v9GCrsRI011425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 16 Oct 2017 12:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324660 - in head: lib/libc/arm/gen sys/arm/arm sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head: lib/libc/arm/gen sys/arm/arm sys/arm/include X-SVN-Commit-Revision: 324660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 12:53:56 -0000 Author: mmel Date: Mon Oct 16 12:53:54 2017 New Revision: 324660 URL: https://svnweb.freebsd.org/changeset/base/324660 Log: Save VFP state in getcontext(3) on ARM. This is a last followup of r315974, which fixes userland part of VFP save/restore problems described in PR 217611. PR: 217611 MFC after: 2 weeks Added: head/lib/libc/arm/gen/getcontextx.c (contents, props changed) Modified: head/lib/libc/arm/gen/Makefile.inc head/sys/arm/arm/machdep.c head/sys/arm/arm/sys_machdep.c head/sys/arm/include/machdep.h head/sys/arm/include/sysarch.h Modified: head/lib/libc/arm/gen/Makefile.inc ============================================================================== --- head/lib/libc/arm/gen/Makefile.inc Mon Oct 16 12:32:57 2017 (r324659) +++ head/lib/libc/arm/gen/Makefile.inc Mon Oct 16 12:53:54 2017 (r324660) @@ -5,7 +5,7 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs. infinity.c ldexp.c makecontext.c \ __aeabi_read_tp.S setjmp.S signalcontext.c sigsetjmp.S flt_rounds.c \ arm_initfini.c \ - trivial-getcontextx.c + getcontextx.c .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") SRCS+= fpgetmask_vfp.c fpgetround_vfp.c fpgetsticky_vfp.c fpsetmask_vfp.c \ Added: head/lib/libc/arm/gen/getcontextx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/getcontextx.c Mon Oct 16 12:53:54 2017 (r324660) @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2017 Michal Meloun + * All rights reserved. + * + * 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 ``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 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +struct ucontextx { + ucontext_t ucontext; + mcontext_vfp_t mcontext_vfp; +}; + +int +__getcontextx_size(void) +{ + + return (sizeof(struct ucontextx)); +} + +int +__fillcontextx2(char *ctx) +{ + struct ucontextx *ucxp; + ucontext_t *ucp; + mcontext_vfp_t *mvp; + struct arm_get_vfpstate_args vfp_arg; + + ucxp = (struct ucontextx *)ctx; + ucp = &ucxp->ucontext; + mvp = &ucxp->mcontext_vfp; + + vfp_arg.mc_vfp_size = sizeof(mcontext_vfp_t); + vfp_arg.mc_vfp = mvp; + if (sysarch(ARM_GET_VFPSTATE, &vfp_arg) == -1) + return (-1); + ucp->uc_mcontext.mc_vfp_size = sizeof(mcontext_vfp_t); + ucp->uc_mcontext.mc_vfp_ptr = mvp; + return (0); +} + +int +__fillcontextx(char *ctx) +{ + struct ucontextx *ucxp; + + ucxp = (struct ucontextx *)ctx; + if (getcontext(&ucxp->ucontext) == -1) + return (-1); + __fillcontextx2(ctx); + return (0); +} + +__weak_reference(__getcontextx, getcontextx); + +ucontext_t * +__getcontextx(void) +{ + char *ctx; + int error; + + ctx = malloc(__getcontextx_size()); + if (ctx == NULL) + return (NULL); + if (__fillcontextx(ctx) == -1) { + error = errno; + free(ctx); + errno = error; + return (NULL); + } + return ((ucontext_t *)ctx); +} Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon Oct 16 12:32:57 2017 (r324659) +++ head/sys/arm/arm/machdep.c Mon Oct 16 12:53:54 2017 (r324660) @@ -443,6 +443,30 @@ set_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) } #endif +int +arm_get_vfpstate(struct thread *td, void *args) +{ + int rv; + struct arm_get_vfpstate_args ua; + mcontext_vfp_t mcontext_vfp; + + rv = copyin(args, &ua, sizeof(ua)); + if (rv != 0) + return (rv); + if (ua.mc_vfp_size != sizeof(mcontext_vfp_t)) + return (EINVAL); +#ifdef VFP + get_vfpcontext(td, &mcontext_vfp); +#else + bzero(&mcontext_vfp, sizeof(mcontext_vfp)); +#endif + + rv = copyout(&mcontext_vfp, ua.mc_vfp, sizeof(mcontext_vfp)); + if (rv != 0) + return (rv); + return (0); +} + /* * Get machine context. */ Modified: head/sys/arm/arm/sys_machdep.c ============================================================================== --- head/sys/arm/arm/sys_machdep.c Mon Oct 16 12:32:57 2017 (r324659) +++ head/sys/arm/arm/sys_machdep.c Mon Oct 16 12:53:54 2017 (r324660) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #ifndef _SYS_SYSPROTO_H_ @@ -204,6 +205,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) case ARM_DRAIN_WRITEBUF: case ARM_SET_TP: case ARM_GET_TP: + case ARM_GET_VFPSTATE: break; default: @@ -228,6 +230,9 @@ sysarch(struct thread *td, struct sysarch_args *uap) break; case ARM_GET_TP: error = arm32_get_tp(td, uap->parms); + break; + case ARM_GET_VFPSTATE: + error = arm_get_vfpstate(td, uap->parms); break; default: error = EINVAL; Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Mon Oct 16 12:32:57 2017 (r324659) +++ head/sys/arm/include/machdep.h Mon Oct 16 12:53:54 2017 (r324660) @@ -40,6 +40,7 @@ void arm_parse_fdt_bootargs(void); void arm_print_kenv(void); void arm_generic_initclocks(void); +int arm_get_vfpstate(struct thread *td, void *args); /* Board-specific attributes */ void board_set_serial(uint64_t); Modified: head/sys/arm/include/sysarch.h ============================================================================== --- head/sys/arm/include/sysarch.h Mon Oct 16 12:32:57 2017 (r324659) +++ head/sys/arm/include/sysarch.h Mon Oct 16 12:53:54 2017 (r324660) @@ -78,10 +78,16 @@ #define ARM_DRAIN_WRITEBUF 1 #define ARM_SET_TP 2 #define ARM_GET_TP 3 +#define ARM_GET_VFPSTATE 4 struct arm_sync_icache_args { uintptr_t addr; /* Virtual start address */ size_t len; /* Region size */ +}; + +struct arm_get_vfpstate_args { + size_t mc_vfp_size; + void *mc_vfp; }; #ifndef _KERNEL From owner-svn-src-head@freebsd.org Mon Oct 16 12:54:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEE19E3A2BA; Mon, 16 Oct 2017 12:54:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB6BD7FC77; Mon, 16 Oct 2017 12:54:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GCsrmC011807; Mon, 16 Oct 2017 12:54:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GCsr15011805; Mon, 16 Oct 2017 12:54:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201710161254.v9GCsr15011805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 16 Oct 2017 12:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324661 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 324661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 12:54:55 -0000 Author: mav Date: Mon Oct 16 12:54:53 2017 New Revision: 324661 URL: https://svnweb.freebsd.org/changeset/base/324661 Log: Add Creative vendor ID. MFC after: 1 week Modified: head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Oct 16 12:53:54 2017 (r324660) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Oct 16 12:54:53 2017 (r324661) @@ -175,6 +175,7 @@ static const struct { { HDA_NVIDIA_ALL, "NVIDIA", 0, 0 }, { HDA_ATI_ALL, "ATI", 0, 0 }, { HDA_AMD_ALL, "AMD", 0, 0 }, + { HDA_CREATIVE_ALL, "Creative", 0, 0 }, { HDA_VIA_ALL, "VIA", 0, 0 }, { HDA_SIS_ALL, "SiS", 0, 0 }, { HDA_ULI_ALL, "ULI", 0, 0 }, Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Mon Oct 16 12:53:54 2017 (r324660) +++ head/sys/dev/sound/pci/hda/hdac.h Mon Oct 16 12:54:53 2017 (r324661) @@ -150,6 +150,10 @@ #define RDC_VENDORID 0x17f3 #define HDA_RDC_M3010 HDA_MODEL_CONSTRUCT(RDC, 0x3010) +/* Creative */ +#define CREATIVE_VENDORID 0x1102 +#define HDA_CREATIVE_ALL HDA_MODEL_CONSTRUCT(CREATIVE, 0xffff) + /* VIA */ #define VIA_VENDORID 0x1106 #define HDA_VIA_VT82XX HDA_MODEL_CONSTRUCT(VIA, 0x3288) From owner-svn-src-head@freebsd.org Mon Oct 16 15:01:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50329E3C97C; Mon, 16 Oct 2017 15:01:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E3C683A1B; Mon, 16 Oct 2017 15:01:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GF1obH065616; Mon, 16 Oct 2017 15:01:50 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GF1oYg065613; Mon, 16 Oct 2017 15:01:50 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201710161501.v9GF1oYg065613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 16 Oct 2017 15:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324662 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 324662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 15:01:51 -0000 Author: kp Date: Mon Oct 16 15:01:49 2017 New Revision: 324662 URL: https://svnweb.freebsd.org/changeset/base/324662 Log: pf: test set-tos Introduce tests for the set-tos feature of pf. Teach pft_ping.py to send and verify ToS flags. Added: head/tests/sys/netpfil/pf/set_tos.sh (contents, props changed) Modified: head/tests/sys/netpfil/pf/Makefile head/tests/sys/netpfil/pf/pft_ping.py Modified: head/tests/sys/netpfil/pf/Makefile ============================================================================== --- head/tests/sys/netpfil/pf/Makefile Mon Oct 16 12:54:53 2017 (r324661) +++ head/tests/sys/netpfil/pf/Makefile Mon Oct 16 15:01:49 2017 (r324662) @@ -5,7 +5,8 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/netpfil/pf ATF_TESTS_SH+= pass_block \ - forward + forward \ + set_tos ${PACKAGE}FILES+= utils.subr \ pft_ping.py Modified: head/tests/sys/netpfil/pf/pft_ping.py ============================================================================== --- head/tests/sys/netpfil/pf/pft_ping.py Mon Oct 16 12:54:53 2017 (r324661) +++ head/tests/sys/netpfil/pf/pft_ping.py Mon Oct 16 15:01:49 2017 (r324662) @@ -18,7 +18,7 @@ class Sniffer(threading.Thread): def run(self): self.packets = sp.sniff(iface=self._recvif, timeout=3) -def check_ping_request(packet, dst_ip): +def check_ping_request(packet, dst_ip, args): """ Verify that the packet matches what we'd have sent """ @@ -40,13 +40,27 @@ def check_ping_request(packet, dst_ip): if raw.load != str(PAYLOAD_MAGIC): return False + # Wait to check expectations until we've established this is the packet we + # sent. + if args.expect_tos: + if ip.tos != int(args.expect_tos[0]): + print "Unexpected ToS value %d, expected %s" \ + % (ip.tos, args.expect_tos[0]) + return False + + return True -def ping(send_if, dst_ip): - req = sp.Ether() \ - / sp.IP(dst=dst_ip) \ - / sp.ICMP(type='echo-request') \ - / sp.Raw(PAYLOAD_MAGIC) +def ping(send_if, dst_ip, args): + ether = sp.Ether() + ip = sp.IP(dst=dst_ip) + icmp = sp.ICMP(type='echo-request') + raw = sp.Raw(PAYLOAD_MAGIC) + + if args.send_tos: + ip.tos = int(args.send_tos[0]) + + req = ether / ip / icmp / raw sp.sendp(req, iface=send_if, verbose=False) def main(): @@ -61,19 +75,27 @@ def main(): required=True, help='The destination IP address for the ICMP echo request') + # Packet settings + parser.add_argument('--send-tos', nargs=1, + help='Set the ToS value for the transmitted packet') + + # Expectations + parser.add_argument('--expect-tos', nargs=1, + help='The expected ToS value in the received packet') + args = parser.parse_args() sniffer = None if not args.recvif is None: sniffer = Sniffer(args.recvif[0]) - ping(args.sendif[0], args.to[0]) + ping(args.sendif[0], args.to[0], args) if sniffer: sniffer.join() for packet in sniffer.packets: - if check_ping_request(packet, args.to[0]): + if check_ping_request(packet, args.to[0], args): sys.exit(0) # We did not get the packet we expected Added: head/tests/sys/netpfil/pf/set_tos.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/set_tos.sh Mon Oct 16 15:01:49 2017 (r324662) @@ -0,0 +1,92 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "v4" "cleanup" +v4_head() +{ + atf_set descr 'set-tos test' + atf_set require.user root + + # We need scapy to be installed for out test scripts to work + atf_set require.progs scapy +} + +v4_body() +{ + pft_init + + epair_send=$(pft_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + + epair_recv=$(pft_mkepair) + ifconfig ${epair_recv}a up + + pft_mkjail alcatraz ${epair_send}b ${epair_recv}b + jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair_recv}b 198.51.100.2/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + jexec alcatraz arp -s 198.51.100.3 00:01:02:03:04:05 + route add -net 198.51.100.0/24 192.0.2.2 + + # No change is done if not requested + printf "scrub out proto icmp\n" | jexec alcatraz pfctl -ef - + atf_check -s exit:1 -o ignore $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a \ + --expect-tos 42 + + # The requested ToS is set + printf "scrub out proto icmp set-tos 42\n" | jexec alcatraz pfctl -f - + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a \ + --expect-tos 42 + + # ToS is not changed if the scrub rule does not match + printf "scrub out proto tcp set-tos 42\n" | jexec alcatraz pfctl -f - + atf_check -s exit:1 -o ignore $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a \ + --expect-tos 42 + + # Multiple scrub rules match as expected + printf "scrub out proto tcp set-tos 13\nscrub out proto icmp set-tos 14\n" \ + | jexec alcatraz pfctl -f - + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a \ + --expect-tos 14 + + # And this works even if the packet already has ToS values set + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a \ + --send-tos 42 \ + --expect-tos 14 + + # ToS values are unmolested if the packets do not match a scrub rule + printf "scrub out proto tcp set-tos 13\n" \ + | jexec alcatraz pfctl -f - + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a \ + --send-tos 42 \ + --expect-tos 42 +} + +v4_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "v4" +} From owner-svn-src-head@freebsd.org Mon Oct 16 15:03:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67A4FE3CB08; Mon, 16 Oct 2017 15:03:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4404983D92; Mon, 16 Oct 2017 15:03:46 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GF3jVI065748; Mon, 16 Oct 2017 15:03:45 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GF3jE5065745; Mon, 16 Oct 2017 15:03:45 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201710161503.v9GF3jE5065745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 16 Oct 2017 15:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324663 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 324663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 15:03:46 -0000 Author: kp Date: Mon Oct 16 15:03:45 2017 New Revision: 324663 URL: https://svnweb.freebsd.org/changeset/base/324663 Log: pf tests: Basic IPv6 forwarding tests Pass/block packets in the forwarding path with pf. Introduce the pft_set_rules() helper function, because we need to remember to flush states between individual tests. If not we can get packets passing despite rules blocking them because they match states created in a previous test. Extend pft_ping.py to be able to send IPv6 echo requests. Modified: head/tests/sys/netpfil/pf/forward.sh head/tests/sys/netpfil/pf/pft_ping.py head/tests/sys/netpfil/pf/utils.subr Modified: head/tests/sys/netpfil/pf/forward.sh ============================================================================== --- head/tests/sys/netpfil/pf/forward.sh Mon Oct 16 15:01:49 2017 (r324662) +++ head/tests/sys/netpfil/pf/forward.sh Mon Oct 16 15:03:45 2017 (r324663) @@ -61,7 +61,87 @@ v4_cleanup() pft_cleanup } +atf_test_case "v6" "cleanup" +v6_head() +{ + atf_set descr 'Basic IPv6 forwarding test' + atf_set require.user root + atf_set require.progs scapy +} + +v6_body() +{ + pft_init + + epair_send=$(pft_mkepair) + epair_recv=$(pft_mkepair) + + ifconfig ${epair_send}a inet6 2001:db8:42::1/64 up no_dad -ifdisabled + ifconfig ${epair_recv}a up + + pft_mkjail alcatraz ${epair_send}b ${epair_recv}b + + jexec alcatraz ifconfig ${epair_send}b inet6 2001:db8:42::2/64 up no_dad + jexec alcatraz ifconfig ${epair_recv}b inet6 2001:db8:43::2/64 up no_dad + jexec alcatraz sysctl net.inet6.ip6.forwarding=1 + jexec alcatraz ndp -s 2001:db8:43::3 00:01:02:03:04:05 + route add -6 2001:db8:43::/64 2001:db8:42::2 + + # Sanity check, can we forward ICMP echo requests without pf? + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --ip6 \ + --sendif ${epair_send}a \ + --to 2001:db8:43::3 \ + --recvif ${epair_recv}a + + jexec alcatraz pfctl -e + + # Block incoming echo request packets + pft_set_rules alcatraz \ + "block in inet6 proto icmp6 icmp6-type echoreq" + atf_check -s exit:1 $(atf_get_srcdir)/pft_ping.py \ + --ip6 \ + --sendif ${epair_send}a \ + --to 2001:db8:43::3 \ + --recvif ${epair_recv}a + + # Block outgoing echo request packets + pft_set_rules alcatraz \ + "block out inet6 proto icmp6 icmp6-type echoreq" + atf_check -s exit:1 -e ignore $(atf_get_srcdir)/pft_ping.py \ + --ip6 \ + --sendif ${epair_send}a \ + --to 2001:db8:43::3 \ + --recvif ${epair_recv}a + + # Allow ICMPv6 but nothing else + pft_set_rules alcatraz \ + "block out" \ + "pass out inet6 proto icmp6" + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --ip6 \ + --sendif ${epair_send}a \ + --to 2001:db8:43::3 \ + --recvif ${epair_recv}a + + # Allowing ICMPv4 does not allow ICMPv6 + pft_set_rules alcatraz \ + "block out inet6 proto icmp6 icmp6-type echoreq" \ + "pass in proto icmp" + atf_check -s exit:1 $(atf_get_srcdir)/pft_ping.py \ + --ip6 \ + --sendif ${epair_send}a \ + --to 2001:db8:43::3 \ + --recvif ${epair_recv}a +} + +v6_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" + atf_add_test_case "v6" } Modified: head/tests/sys/netpfil/pf/pft_ping.py ============================================================================== --- head/tests/sys/netpfil/pf/pft_ping.py Mon Oct 16 15:01:49 2017 (r324662) +++ head/tests/sys/netpfil/pf/pft_ping.py Mon Oct 16 15:03:45 2017 (r324663) @@ -19,6 +19,12 @@ class Sniffer(threading.Thread): self.packets = sp.sniff(iface=self._recvif, timeout=3) def check_ping_request(packet, dst_ip, args): + if args.ip6: + return check_ping6_request(packet, dst_ip, args) + else: + return check_ping4_request(packet, dst_ip, args) + +def check_ping4_request(packet, dst_ip, args): """ Verify that the packet matches what we'd have sent """ @@ -51,6 +57,24 @@ def check_ping_request(packet, dst_ip, args): return True +def check_ping6_request(packet, dst_ip, args): + """ + Verify that the packet matches what we'd have sent + """ + ip = packet.getlayer(sp.IPv6) + if not ip: + return False + if ip.dst != dst_ip: + return False + + icmp = packet.getlayer(sp.ICMPv6EchoRequest) + if not icmp: + return False + if icmp.data != str(PAYLOAD_MAGIC): + return False + + return True + def ping(send_if, dst_ip, args): ether = sp.Ether() ip = sp.IP(dst=dst_ip) @@ -63,6 +87,14 @@ def ping(send_if, dst_ip, args): req = ether / ip / icmp / raw sp.sendp(req, iface=send_if, verbose=False) +def ping6(send_if, dst_ip, args): + ether = sp.Ether() + ip6 = sp.IPv6(dst=dst_ip) + icmp = sp.ICMPv6EchoRequest(data=PAYLOAD_MAGIC) + + req = ether / ip6 / icmp + sp.sendp(req, iface=send_if, verbose=False) + def main(): parser = argparse.ArgumentParser("pft_ping.py", description="Ping test tool") @@ -71,6 +103,8 @@ def main(): help='The interface through which the packet(s) will be sent') parser.add_argument('--recvif', nargs=1, help='The interface on which to expect the ICMP echo response') + parser.add_argument('--ip6', action='store_true', + help='Use IPv6') parser.add_argument('--to', nargs=1, required=True, help='The destination IP address for the ICMP echo request') @@ -85,11 +119,17 @@ def main(): args = parser.parse_args() + # We may not have a default route. Tell scapy where to start looking for routes + sp.conf.iface6 = args.sendif[0] + sniffer = None if not args.recvif is None: sniffer = Sniffer(args.recvif[0]) - ping(args.sendif[0], args.to[0], args) + if args.ip6: + ping6(args.sendif[0], args.to[0], args) + else: + ping(args.sendif[0], args.to[0], args) if sniffer: sniffer.join() Modified: head/tests/sys/netpfil/pf/utils.subr ============================================================================== --- head/tests/sys/netpfil/pf/utils.subr Mon Oct 16 15:01:49 2017 (r324662) +++ head/tests/sys/netpfil/pf/utils.subr Mon Oct 16 15:03:45 2017 (r324663) @@ -35,6 +35,20 @@ pft_mkjail() echo $jailname >> created_jails.lst } +pft_set_rules() +{ + jname=$1 + shift + + # Flush all states, rules, fragments, ... + jexec ${jname} pfctl -F all + + while [ $# -gt 0 ]; do + printf "$1\n" + shift + done | jexec ${jname} pfctl -f - +} + pft_cleanup() { if [ -f created_interfaces.lst ]; then From owner-svn-src-head@freebsd.org Mon Oct 16 15:05:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1494DE3CC30; Mon, 16 Oct 2017 15:05:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E186D83F56; Mon, 16 Oct 2017 15:05:33 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GF5X4P065878; Mon, 16 Oct 2017 15:05:33 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GF5WRM065874; Mon, 16 Oct 2017 15:05:32 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201710161505.v9GF5WRM065874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 16 Oct 2017 15:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324664 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 324664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 15:05:34 -0000 Author: kp Date: Mon Oct 16 15:05:32 2017 New Revision: 324664 URL: https://svnweb.freebsd.org/changeset/base/324664 Log: pf tests: Use pft_set_rules everywhere We now have a utility function to set pf rules in the jail. Use it whenever we need to set the pf rules in the test jail. Modified: head/tests/sys/netpfil/pf/forward.sh head/tests/sys/netpfil/pf/pass_block.sh head/tests/sys/netpfil/pf/set_tos.sh Modified: head/tests/sys/netpfil/pf/forward.sh ============================================================================== --- head/tests/sys/netpfil/pf/forward.sh Mon Oct 16 15:03:45 2017 (r324663) +++ head/tests/sys/netpfil/pf/forward.sh Mon Oct 16 15:05:32 2017 (r324664) @@ -35,21 +35,23 @@ v4_body() --to 198.51.100.3 \ --recvif ${epair_recv}a + jexec alcatraz pfctl -e + # Forward with pf enabled - printf "block in\n" | jexec alcatraz pfctl -ef - + pft_set_rules alcatraz "block in" atf_check -s exit:1 $(atf_get_srcdir)/pft_ping.py \ --sendif ${epair_send}a \ --to 198.51.100.3 \ --recvif ${epair_recv}a - printf "block out\n" | jexec alcatraz pfctl -f - + pft_set_rules alcatraz "block out" atf_check -s exit:1 $(atf_get_srcdir)/pft_ping.py \ --sendif ${epair_send}a \ --to 198.51.100.3 \ --recv ${epair_recv}a # Allow ICMP - printf "block in\npass in proto icmp\n" | jexec alcatraz pfctl -f - + pft_set_rules alcatraz "block in" "pass in proto icmp" atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ --sendif ${epair_send}a \ --to 198.51.100.3 \ Modified: head/tests/sys/netpfil/pf/pass_block.sh ============================================================================== --- head/tests/sys/netpfil/pf/pass_block.sh Mon Oct 16 15:03:45 2017 (r324663) +++ head/tests/sys/netpfil/pf/pass_block.sh Mon Oct 16 15:05:32 2017 (r324664) @@ -28,11 +28,11 @@ v4_body() atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2 # Block everything - printf "block in\n" | jexec alcatraz pfctl -f - + pft_set_rules alcatraz "block in" atf_check -s exit:2 -o ignore ping -c 1 -t 1 192.0.2.2 # Block everything but ICMP - printf "block in\npass in proto icmp\n" | jexec alcatraz pfctl -f - + pft_set_rules alcatraz "block in" "pass in proto icmp" atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2 } @@ -67,15 +67,15 @@ v6_body() atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 # Block everything - printf "block in\n" | jexec alcatraz pfctl -f - + pft_set_rules alcatraz "block in" atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 # Block everything but ICMP - printf "block in\npass in proto icmp6\n" | jexec alcatraz pfctl -f - + pft_set_rules alcatraz "block in" "pass in proto icmp6" atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 # Allowing ICMPv4 does not allow ICMPv6 - printf "block in\npass in proto icmp\n" | jexec alcatraz pfctl -f - + pft_set_rules alcatraz "block in" "pass in proto icmp" atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 2001:db8:42::2 } Modified: head/tests/sys/netpfil/pf/set_tos.sh ============================================================================== --- head/tests/sys/netpfil/pf/set_tos.sh Mon Oct 16 15:03:45 2017 (r324663) +++ head/tests/sys/netpfil/pf/set_tos.sh Mon Oct 16 15:05:32 2017 (r324664) @@ -29,8 +29,10 @@ v4_body() jexec alcatraz arp -s 198.51.100.3 00:01:02:03:04:05 route add -net 198.51.100.0/24 192.0.2.2 + jexec alcatraz pfctl -e + # No change is done if not requested - printf "scrub out proto icmp\n" | jexec alcatraz pfctl -ef - + pft_set_rules alcatraz "scrub out proto icmp" atf_check -s exit:1 -o ignore $(atf_get_srcdir)/pft_ping.py \ --sendif ${epair_send}a \ --to 198.51.100.3 \ @@ -38,7 +40,7 @@ v4_body() --expect-tos 42 # The requested ToS is set - printf "scrub out proto icmp set-tos 42\n" | jexec alcatraz pfctl -f - + pft_set_rules alcatraz "scrub out proto icmp set-tos 42" atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ --sendif ${epair_send}a \ --to 198.51.100.3 \ @@ -46,7 +48,7 @@ v4_body() --expect-tos 42 # ToS is not changed if the scrub rule does not match - printf "scrub out proto tcp set-tos 42\n" | jexec alcatraz pfctl -f - + pft_set_rules alcatraz "scrub out proto tcp set-tos 42" atf_check -s exit:1 -o ignore $(atf_get_srcdir)/pft_ping.py \ --sendif ${epair_send}a \ --to 198.51.100.3 \ @@ -54,8 +56,8 @@ v4_body() --expect-tos 42 # Multiple scrub rules match as expected - printf "scrub out proto tcp set-tos 13\nscrub out proto icmp set-tos 14\n" \ - | jexec alcatraz pfctl -f - + pft_set_rules alcatraz "scrub out proto tcp set-tos 13" \ + "scrub out proto icmp set-tos 14" atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ --sendif ${epair_send}a \ --to 198.51.100.3 \ @@ -71,8 +73,7 @@ v4_body() --expect-tos 14 # ToS values are unmolested if the packets do not match a scrub rule - printf "scrub out proto tcp set-tos 13\n" \ - | jexec alcatraz pfctl -f - + pft_set_rules alcatraz "scrub out proto tcp set-tos 13" atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ --sendif ${epair_send}a \ --to 198.51.100.3 \ From owner-svn-src-head@freebsd.org Mon Oct 16 15:16:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE2C8E3CF6D; Mon, 16 Oct 2017 15:16:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F5C4844EA; Mon, 16 Oct 2017 15:16:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GFGO5a069897; Mon, 16 Oct 2017 15:16:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GFGO9Z069895; Mon, 16 Oct 2017 15:16:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710161516.v9GFGO9Z069895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Oct 2017 15:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324665 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 324665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 15:16:25 -0000 Author: kib Date: Mon Oct 16 15:16:24 2017 New Revision: 324665 URL: https://svnweb.freebsd.org/changeset/base/324665 Log: Fix the pv_chunks pc_lru tailq handling in reclaim_pv_chunk(). For processing, reclaim_pv_chunk() removes the pv_chunk from the lru list, which makes pc_lru linkage invalid. Then the pmap lock is released, which allows for other thread to free the last pv entry allocated from the chunk and call free_pv_chunk(), which tries to modify the invalid linkage. Similarly, the chunk is inserted into the private tailq new_tail temporary. Again, free_pv_chunk() might be run and corrupt the linkage for the new_tail after the pmap lock is dropped. This is a consequence of r299788 elimination of pvh_global_lock, which allowed for reclaim to run in parallel with other pmap calls which free pv chunks. As a fix, do not remove the chunk from pc_lru queue, use a marker to remember the position in the queue iteration. We can safely operate on the chunks after the chunk's pmap is locked, we fetched the chunk after the marker, and we checked that chunk pmap is same as we have locked, because chunk removal from pc_lru requires both pv_chunk_mutex and the pmap mutex owned. Note that the fix lost an optimization which was present in the previous algorithm. Namely, new_tail requeueing rotated the pv chunks list so that reclaim didn't scan the same pv chunks that couldn't be freed (because they contained a wired and/or superpage mapping) on every invocation. An additional change is planned which would improve this. Reported and tested by: pho Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Oct 16 15:05:32 2017 (r324664) +++ head/sys/amd64/amd64/pmap.c Mon Oct 16 15:16:24 2017 (r324665) @@ -2888,11 +2888,11 @@ reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp) { - struct pch new_tail; - struct pv_chunk *pc; + struct pv_chunk *pc, *pc_marker; + struct pv_chunk_header pc_marker_b; struct md_page *pvh; pd_entry_t *pde; - pmap_t pmap; + pmap_t next_pmap, pmap; pt_entry_t *pte, tpte; pt_entry_t PG_G, PG_A, PG_M, PG_RW; pv_entry_t pv; @@ -2909,7 +2909,8 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l m_pc = NULL; PG_G = PG_A = PG_M = PG_RW = 0; SLIST_INIT(&free); - TAILQ_INIT(&new_tail); + bzero(&pc_marker_b, sizeof(pc_marker_b)); + pc_marker = (struct pv_chunk *)&pc_marker_b; /* * A delayed invalidation block should already be active if @@ -2919,30 +2920,52 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l start_di = pmap_not_in_di(); mtx_lock(&pv_chunks_mutex); - while ((pc = TAILQ_FIRST(&pv_chunks)) != NULL && SLIST_EMPTY(&free)) { - TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + TAILQ_INSERT_HEAD(&pv_chunks, pc_marker, pc_lru); + while ((pc = TAILQ_NEXT(pc_marker, pc_lru)) != NULL && + SLIST_EMPTY(&free)) { + next_pmap = pc->pc_pmap; + if (next_pmap == NULL) /* marker */ + goto next_chunk; mtx_unlock(&pv_chunks_mutex); - if (pmap != pc->pc_pmap) { + + /* + * A pv_chunk can only be removed from the pc_lru list + * when both pc_chunks_mutex is owned and the + * corresponding pmap is locked. + */ + if (pmap != next_pmap) { reclaim_pv_chunk_leave_pmap(pmap, locked_pmap, start_di); - pmap = pc->pc_pmap; + pmap = next_pmap; /* Avoid deadlock and lock recursion. */ if (pmap > locked_pmap) { RELEASE_PV_LIST_LOCK(lockp); PMAP_LOCK(pmap); - } else if (pmap != locked_pmap && - !PMAP_TRYLOCK(pmap)) { - pmap = NULL; - TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); + if (start_di) + pmap_delayed_invl_started(); mtx_lock(&pv_chunks_mutex); continue; - } + } else if (pmap != locked_pmap) { + if (PMAP_TRYLOCK(pmap)) { + if (start_di) + pmap_delayed_invl_started(); + mtx_lock(&pv_chunks_mutex); + continue; + } else { + pmap = NULL; /* pmap is not locked */ + mtx_lock(&pv_chunks_mutex); + pc = TAILQ_NEXT(pc_marker, pc_lru); + if (pc == NULL || + pc->pc_pmap != next_pmap) + continue; + goto next_chunk; + } + } else if (start_di) + pmap_delayed_invl_started(); PG_G = pmap_global_bit(pmap); PG_A = pmap_accessed_bit(pmap); PG_M = pmap_modified_bit(pmap); PG_RW = pmap_rw_bit(pmap); - if (start_di) - pmap_delayed_invl_started(); } /* @@ -2987,9 +3010,8 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l } } if (freed == 0) { - TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); mtx_lock(&pv_chunks_mutex); - continue; + goto next_chunk; } /* Every freed mapping is for a 4 KB page. */ pmap_resident_count_dec(pmap, freed); @@ -3006,16 +3028,19 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l m_pc = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m_pc->phys_addr); mtx_lock(&pv_chunks_mutex); + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); break; } TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); - TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); mtx_lock(&pv_chunks_mutex); /* One freed pv entry in locked_pmap is sufficient. */ if (pmap == locked_pmap) break; +next_chunk: + TAILQ_REMOVE(&pv_chunks, pc_marker, pc_lru); + TAILQ_INSERT_AFTER(&pv_chunks, pc, pc_marker, pc_lru); } - TAILQ_CONCAT(&pv_chunks, &new_tail, pc_lru); + TAILQ_REMOVE(&pv_chunks, pc_marker, pc_lru); mtx_unlock(&pv_chunks_mutex); reclaim_pv_chunk_leave_pmap(pmap, locked_pmap, start_di); if (m_pc == NULL && !SLIST_EMPTY(&free)) { Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Mon Oct 16 15:05:32 2017 (r324664) +++ head/sys/amd64/include/pmap.h Mon Oct 16 15:16:24 2017 (r324665) @@ -366,11 +366,18 @@ typedef struct pv_entry { */ #define _NPCM 3 #define _NPCPV 168 -struct pv_chunk { - pmap_t pc_pmap; - TAILQ_ENTRY(pv_chunk) pc_list; - uint64_t pc_map[_NPCM]; /* bitmap; 1 = free */ +#define PV_CHUNK_HEADER \ + pmap_t pc_pmap; \ + TAILQ_ENTRY(pv_chunk) pc_list; \ + uint64_t pc_map[_NPCM]; /* bitmap; 1 = free */ \ TAILQ_ENTRY(pv_chunk) pc_lru; + +struct pv_chunk_header { + PV_CHUNK_HEADER +}; + +struct pv_chunk { + PV_CHUNK_HEADER struct pv_entry pc_pventry[_NPCPV]; }; From owner-svn-src-head@freebsd.org Mon Oct 16 15:39:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02A8EE3D64C; Mon, 16 Oct 2017 15:39:10 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id C0B1D101; Mon, 16 Oct 2017 15:39:09 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from dhcp-10-248-99-227.eduroam.wireless.private.cam.ac.uk (global-5-141.nat-2.net.cam.ac.uk [131.111.5.141]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 451414ECB2; Mon, 16 Oct 2017 15:38:38 +0000 (UTC) From: Andrew Turner Message-Id: Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r324646 - in head/sys/boot/efi: boot1 libefi loader Date: Mon, 16 Oct 2017 16:38:37 +0100 In-Reply-To: Cc: eric@meatspace.com, src-committers , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Warner Losh To: Warner Losh References: <201710160359.v9G3xCCi087576@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 15:39:10 -0000 I have a local Jenkins setup that builds images & tries to run under = various simulators. The final image is built with mkimg. I=E2=80=99m = running it under qemu. Andrew > On 16 Oct 2017, at 13:19, Warner Losh wrote: >=20 > I'll take a look, but I've also ccd Eric so he can figure out what = went wrong with is code in your environment. What env is That? >=20 > Warnee >=20 > On Oct 16, 2017 3:26 AM, "Andrew Turner" > wrote: >=20 > > On 16 Oct 2017, at 04:59, Warner Losh wrote: > > > > Author: imp > > Date: Mon Oct 16 03:59:11 2017 > > New Revision: 324646 > > URL: https://svnweb.freebsd.org/changeset/base/324646 = > > > > Log: > > Unify boot1 with loader > > > > Refactor boot1 to use the same I/O code as /boot/loader uses. = Refactor > > to use the common efi_main.c. > > > > Submitted by: Eric McCorkle > > Differential Revision: https://reviews.freebsd.org/D10447 = > > > > Added: > > head/sys/boot/efi/libefi/efi_main.c (contents, props changed) > > - copied, changed from r324645, = head/sys/boot/efi/loader/efi_main.c > > Deleted: > > head/sys/boot/efi/boot1/boot_module.h > > head/sys/boot/efi/boot1/ufs_module.c > > head/sys/boot/efi/boot1/zfs_module.c > > head/sys/boot/efi/loader/efi_main.c > > Modified: > > head/sys/boot/efi/boot1/Makefile > > head/sys/boot/efi/boot1/boot1.c > > head/sys/boot/efi/libefi/Makefile > > head/sys/boot/efi/loader/Makefile >=20 > Hello Warner, >=20 > After this change I=E2=80=99m getting the following panic on various = test VMs. >=20 > Andrew >=20 > >> FreeBSD EFI boot block >=20 > Loader path: /boot/loader.efi >=20 > Load Path: \EFI\BOOT\BOOTAA64.EFI > Load Device: = VenHw(837DCA9E-E874-4D82-B29A-23FE0E23D1E2,003C000A00000000)/HD(1,GPT,DD40= E9C6-B247-11E7-AA0A-15EFE1BBB7CF,0x3,0x640) > panic: Couldn't trim device path > --> Press a key on the console to reboot <-- >=20 From owner-svn-src-head@freebsd.org Mon Oct 16 15:56:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAA0CE3DDCA for ; Mon, 16 Oct 2017 15:56:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9454F66 for ; Mon, 16 Oct 2017 15:56:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id p138so1820927itp.2 for ; Mon, 16 Oct 2017 08:56:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=fYDjhcKUnHc0eEOHovu2GvPSXGfsfXxsgR11OK/mFdg=; b=NvlHQk7Cw9uTUgJ+kTVfaAB+pw7rnyAJBvc8Shmci2G+2sIMB7bGpdmdR2t4/GMkYB 6eaoq9yPWS2h8PywqguZAJy26Z3GEvdrDJyN+Gbx+fq/vH99fYBDA52vfDL1lDyBq3eD znypPQKKa2Ww2k36SU9f+ymj9kciZSwboTaPSV3z5W5wrEdBY58kKUk56dULyxpjQfbJ nmChLVqHOZYFBy5AXtpsa/URZogEZmxo66YpqvKPXCmxnl6s5FC3KRTna/p/VmXJdaFW kiy/5XyWlwH0YUGuL8/I5SOvKBZrEraXnHnuea4XXf0Jp9y5pdYzb00j/p6s8uLGRK6y lYQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=fYDjhcKUnHc0eEOHovu2GvPSXGfsfXxsgR11OK/mFdg=; b=si8Y8m1tv8bWjI+mc4ZpxoITGl3g1DlOGKtDDQMnpoZSiCrwrWdMblcAKBlsmTxDb+ ud2fJME6ZtPLz4lDUHdZgSN2a98V66X4S00qSsiy8OIL1/nwUeF3VYIVknmHSxmgjUQB V9BO8PvuQj/6p+nTYxofcPZPM77WMI5qp6GB/10ZVpXO6bB1kdiuXtWuu/DN4cSed0r4 hajqW05XF/ZtECmEU2hlxiJI/a7pqeByXgccOXVZ4OWtNnyCXjob33CsIxsAgINzvUnD OeOnnCqvl5GxSLBx0FqDG3rVtI6QgKSrjMDj+dkoomcYYGlCR6OHC5u8NmBPX+6ybEI4 0l0A== X-Gm-Message-State: AMCzsaV62mHZpJVsYOM/MxUOBcnSnREvkzdqsQxcQ9InugfuGOjZi7d7 Da1hrluZRyO9kmCOdo/NCKELTiDhttB6FGap13eX5YtL X-Google-Smtp-Source: ABhQp+QaC9vll1bENoDPZkkTstrdYVjJPnwgIIZ/uYR5TE2mHpsmpVn6q1TyVrAGpFD3ZtSU9arHWUy9ReJ2lhMMinQ= X-Received: by 10.36.94.129 with SMTP id h123mr1563486itb.64.1508169405833; Mon, 16 Oct 2017 08:56:45 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Mon, 16 Oct 2017 08:56:45 -0700 (PDT) X-Originating-IP: [50.253.109.65] In-Reply-To: References: <201710160359.v9G3xCCi087576@repo.freebsd.org> From: Warner Losh Date: Mon, 16 Oct 2017 09:56:45 -0600 X-Google-Sender-Auth: tGUgq87TvuoF-9I0ZPcgVuf6OT0 Message-ID: Subject: Re: svn commit: r324646 - in head/sys/boot/efi: boot1 libefi loader To: Andrew Turner Cc: eric@meatspace.com, src-committers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Warner Losh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 15:56:47 -0000 So this is on aarch64? Is this running a standardish qemu setup as documented on https://wiki.freebsd.org/arm64/QEMU ? Or are there tricks that we need to cope with... If we can't get good resoltuion on this today, I plan on backing out the entire change. Warner On Mon, Oct 16, 2017 at 9:38 AM, Andrew Turner wrote= : > I have a local Jenkins setup that builds images & tries to run under > various simulators. The final image is built with mkimg. I=E2=80=99m runn= ing it > under qemu. > > Andrew > > On 16 Oct 2017, at 13:19, Warner Losh wrote: > > I'll take a look, but I've also ccd Eric so he can figure out what went > wrong with is code in your environment. What env is That? > > Warnee > > On Oct 16, 2017 3:26 AM, "Andrew Turner" wrote: > >> >> > On 16 Oct 2017, at 04:59, Warner Losh wrote: >> > >> > Author: imp >> > Date: Mon Oct 16 03:59:11 2017 >> > New Revision: 324646 >> > URL: https://svnweb.freebsd.org/changeset/base/324646 >> > >> > Log: >> > Unify boot1 with loader >> > >> > Refactor boot1 to use the same I/O code as /boot/loader uses. Refacto= r >> > to use the common efi_main.c. >> > >> > Submitted by: Eric McCorkle >> > Differential Revision: https://reviews.freebsd.org/D10447 >> > >> > Added: >> > head/sys/boot/efi/libefi/efi_main.c (contents, props changed) >> > - copied, changed from r324645, head/sys/boot/efi/loader/efi_main.= c >> > Deleted: >> > head/sys/boot/efi/boot1/boot_module.h >> > head/sys/boot/efi/boot1/ufs_module.c >> > head/sys/boot/efi/boot1/zfs_module.c >> > head/sys/boot/efi/loader/efi_main.c >> > Modified: >> > head/sys/boot/efi/boot1/Makefile >> > head/sys/boot/efi/boot1/boot1.c >> > head/sys/boot/efi/libefi/Makefile >> > head/sys/boot/efi/loader/Makefile >> >> Hello Warner, >> >> After this change I=E2=80=99m getting the following panic on various tes= t VMs. >> >> Andrew >> >> >> FreeBSD EFI boot block >> >> Loader path: /boot/loader.efi >> >> Load Path: \EFI\BOOT\BOOTAA64.EFI >> Load Device: VenHw(837DCA9E-E874-4D82-B29A- >> 23FE0E23D1E2,003C000A00000000)/HD(1,GPT,DD40E9C6-B247-11E7-A >> A0A-15EFE1BBB7CF,0x3,0x640) >> panic: Couldn't trim device path >> --> Press a key on the console to reboot <-- >> >> > From owner-svn-src-head@freebsd.org Mon Oct 16 16:06:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C20EE3E11A; Mon, 16 Oct 2017 16:06:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com [IPv6:2a00:1450:4010:c07::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4DFC164F; Mon, 16 Oct 2017 16:06:58 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x231.google.com with SMTP id a16so17614357lfk.0; Mon, 16 Oct 2017 09:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=p6EpZtH+qhNpmZibVjZnKD3WAwW4rwk8s0r2aXTbQeQ=; b=IuOfgRyNkEajifWxe+V4t3J5DwkgOWKmCZVutaivC8PaCtwvasEKPKWTx3kfVLfriW bXMJ36aP8XjTgL+FE5auoCTWACiOcJU0XHvln8zs7lnXmCL+HauPY3SQUojJ43OKhubV gPprAZ+F9V3Jq3jxov/CrlAOGHH/L8IU+b/qFZxj9fhqGTDZKieYIRR2nLPPT8h889e0 lalcHZldaem30TAXHI3j+Ubfsk22QfgX+7gG/V5ZvUYiotGoUIQqLcdLLd3rAS+oxQXX wmyUcqTpapdA1xTogOQbAJONrXBEiH9kVu5LkwVMEj7KQyC/8IzRtAOmddNXjPsDBSw5 70FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=p6EpZtH+qhNpmZibVjZnKD3WAwW4rwk8s0r2aXTbQeQ=; b=IuAK7FtuSqV+i9dZnhKMCe47Vi1Q2FyY0I97xo1pOzP085Z/m3pjVbP8Vz6rwEy5xt t+3YzV0YTVtVhfhgIdsEV+RGiqTBmibf6icaKHjqmg4UmfBN4vFG9FG2ju1DKNVl3/IR 8zhosqkGl7+wk0thYGwa/+bumPmZm7en25vukhl0xs/Dud9p3JWA92ascgGto/E3VFqi SvVKGHN5/jEWlnS+z1FdSlbTYmoRkDwuSMeQHElUJ3uJPbvm1s5rVtGbds/rdOmMBtU5 YasfI1jxR4ASqz8udg2v98AaU81wko24vMiFW4ENlBnZTlfY41MKTNNOHx/anFyJWJ0L a/9w== X-Gm-Message-State: AMCzsaWlrhn9EJkRiVOBHsuvfcnyfVp34mm5NFP1/M7sed1NFJNv/9Ws 2LX+I/R3t5G62eMrPfPQmPO4SAUJytd11/HUJ0ZCyg== X-Google-Smtp-Source: ABhQp+RorfVzsLGUxcltZGpsg4r5OIBOlRWOlSmH8hfv54PpYRxjzYW3F3+Wh5ITp4b30dBzIklABq9iwju+G01dUQU= X-Received: by 10.46.88.9 with SMTP id m9mr4134433ljb.15.1508170015801; Mon, 16 Oct 2017 09:06:55 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.7.153 with HTTP; Mon, 16 Oct 2017 09:06:55 -0700 (PDT) In-Reply-To: <201710160654.v9G6sQmA062311@repo.freebsd.org> References: <201710160654.v9G6sQmA062311@repo.freebsd.org> From: Alan Somers Date: Mon, 16 Oct 2017 10:06:55 -0600 X-Google-Sender-Auth: 75WMH5HGFQTxI3OZA52l-cPqZxk Message-ID: Subject: Re: svn commit: r324656 - head/lib/libifconfig To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 16:06:59 -0000 On Mon, Oct 16, 2017 at 12:54 AM, Andriy Voskoboinyk wrote: > Author: avos > Date: Mon Oct 16 06:54:26 2017 > New Revision: 324656 > URL: https://svnweb.freebsd.org/changeset/base/324656 > > Log: > libifconfig: allow to get original interface name via ifconfig_get_orig_name() > > Uses the same method as in tools/tools/ifinfo/ifinfo.c > (via net.link.generic sysctl). > > Tested with modified wlandebug(8). > > Differential Revision: https://reviews.freebsd.org/D12554 > > Modified: > head/lib/libifconfig/libifconfig.c > head/lib/libifconfig/libifconfig.h The original author of libifconfig keeps her work at Github. To reduce divergence, we should submit changes there first, or else convince her to start using our SVN repository. Did you at least ask her for review? https://github.com/savagedlight/libifconfig -Alan From owner-svn-src-head@freebsd.org Mon Oct 16 16:07:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9907CE3E1D4; Mon, 16 Oct 2017 16:07:36 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 5F63C186F; Mon, 16 Oct 2017 16:07:35 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from dhcp-10-248-99-227.eduroam.wireless.private.cam.ac.uk (global-5-141.nat-2.net.cam.ac.uk [131.111.5.141]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 884314ECA3; Mon, 16 Oct 2017 16:07:04 +0000 (UTC) From: Andrew Turner Message-Id: <3BED6A0F-689C-4B89-A2AA-6990FB473539@fubar.geek.nz> Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r324646 - in head/sys/boot/efi: boot1 libefi loader Date: Mon, 16 Oct 2017 17:07:03 +0100 In-Reply-To: Cc: eric@meatspace.com, src-committers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Warner Losh To: Warner Losh References: <201710160359.v9G3xCCi087576@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 16:07:36 -0000 Correct, it is aarch64. It runs a similar qemu command, however I also = see it under the ARM Foundation model so it seems to not be simulator = specific. Andrew > On 16 Oct 2017, at 16:56, Warner Losh wrote: >=20 > So this is on aarch64? Is this running a standardish qemu setup as = documented on https://wiki.freebsd.org/arm64/QEMU = ? Or are there tricks that we need = to cope with... >=20 > If we can't get good resoltuion on this today, I plan on backing out = the entire change. >=20 > Warner >=20 > On Mon, Oct 16, 2017 at 9:38 AM, Andrew Turner > wrote: > I have a local Jenkins setup that builds images & tries to run under = various simulators. The final image is built with mkimg. I=E2=80=99m = running it under qemu. >=20 > Andrew >=20 >> On 16 Oct 2017, at 13:19, Warner Losh > wrote: >>=20 >> I'll take a look, but I've also ccd Eric so he can figure out what = went wrong with is code in your environment. What env is That? >>=20 >> Warnee >>=20 >> On Oct 16, 2017 3:26 AM, "Andrew Turner" > wrote: >>=20 >> > On 16 Oct 2017, at 04:59, Warner Losh > wrote: >> > >> > Author: imp >> > Date: Mon Oct 16 03:59:11 2017 >> > New Revision: 324646 >> > URL: https://svnweb.freebsd.org/changeset/base/324646 = >> > >> > Log: >> > Unify boot1 with loader >> > >> > Refactor boot1 to use the same I/O code as /boot/loader uses. = Refactor >> > to use the common efi_main.c. >> > >> > Submitted by: Eric McCorkle >> > Differential Revision: https://reviews.freebsd.org/D10447 = >> > >> > Added: >> > head/sys/boot/efi/libefi/efi_main.c (contents, props changed) >> > - copied, changed from r324645, = head/sys/boot/efi/loader/efi_main.c >> > Deleted: >> > head/sys/boot/efi/boot1/boot_module.h >> > head/sys/boot/efi/boot1/ufs_module.c >> > head/sys/boot/efi/boot1/zfs_module.c >> > head/sys/boot/efi/loader/efi_main.c >> > Modified: >> > head/sys/boot/efi/boot1/Makefile >> > head/sys/boot/efi/boot1/boot1.c >> > head/sys/boot/efi/libefi/Makefile >> > head/sys/boot/efi/loader/Makefile >>=20 >> Hello Warner, >>=20 >> After this change I=E2=80=99m getting the following panic on various = test VMs. >>=20 >> Andrew >>=20 >> >> FreeBSD EFI boot block >>=20 >> Loader path: /boot/loader.efi >>=20 >> Load Path: \EFI\BOOT\BOOTAA64.EFI >> Load Device: = VenHw(837DCA9E-E874-4D82-B29A-23FE0E23D1E2,003C000A00000000)/HD(1,GPT,DD40= E9C6-B247-11E7-AA0A-15EFE1BBB7CF,0x3,0x640) >> panic: Couldn't trim device path >> --> Press a key on the console to reboot <-- >>=20 >=20 >=20 From owner-svn-src-head@freebsd.org Mon Oct 16 16:14:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71153E3E4A1; Mon, 16 Oct 2017 16:14:52 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2A8C1D6C; Mon, 16 Oct 2017 16:14:51 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GGEoux094645; Mon, 16 Oct 2017 16:14:50 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GGEoUN094644; Mon, 16 Oct 2017 16:14:50 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201710161614.v9GGEoUN094644@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Mon, 16 Oct 2017 16:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324666 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 16:14:52 -0000 Author: mjoras Date: Mon Oct 16 16:14:50 2017 New Revision: 324666 URL: https://svnweb.freebsd.org/changeset/base/324666 Log: Properly reset the fields in clean_unrhdr. In r324542 I neglected to reset the first and last fields of struct unrhdr. This causes a tmpfs to fail the unr(9) consistency checks with DIAGNOSTIC on. Fix this by resetting the fields by calling init_unrhdr. While here, change a loop to use TAILQ_FOREACH_SAFE since it is more readable and equally fast. Reported by: David Wolfskill Approved by: rstone (mentor) Sponsored by: Dell EMC Isilon Modified: head/sys/kern/subr_unit.c Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Mon Oct 16 15:16:24 2017 (r324665) +++ head/sys/kern/subr_unit.c Mon Oct 16 16:14:50 2017 (r324666) @@ -373,18 +373,17 @@ clear_unrhdr(struct unrhdr *uh) KASSERT(TAILQ_EMPTY(&uh->ppfree), ("unrhdr has postponed item for free")); - up = TAILQ_FIRST(&uh->head); - while (up != NULL) { - uq = TAILQ_NEXT(up, list); + TAILQ_FOREACH_SAFE(up, &uh->head, list, uq) { if (up->ptr != uh) { Free(up->ptr); } Free(up); - up = uq; } - TAILQ_INIT(&uh->head); uh->busy = 0; uh->alloc = 0; + init_unrhdr(uh, uh->low, uh->high, uh->mtx); + + check_unrhdr(uh, __LINE__); } static __inline int From owner-svn-src-head@freebsd.org Mon Oct 16 16:22:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AFAEE3E778; Mon, 16 Oct 2017 16:22:46 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: from mail-qt0-f179.google.com (mail-qt0-f179.google.com [209.85.216.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAB17224E; Mon, 16 Oct 2017 16:22:45 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: by mail-qt0-f179.google.com with SMTP id z19so32819091qtg.11; Mon, 16 Oct 2017 09:22:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=gNL5OvhChmGOQt9+wjFkUD0JXpMq4ovjpRjqM/y6r0M=; b=SkafeKrGhY2Xo1IUNS9knayS3PT+eU6vOy+CAuth2AyR8shxC+GgWTThurHzD1WKhQ tdr4v2YFS4BOGX4Bozz7YMWA7dw1/ME8d23dVwP5q7hmOKzbk62CLGCMz3eAzuAxdqhS 3cuVLyODbS8ECcJgXSFbJrJrUj1Uxjn37EPV+I0dzJfuD6BR4M+4wn67P7LA1jEOPp6e 0Smv8RivyQwA2vrtFGIKQ+1HSHx729kxfg+JQ2s7pI8SklDf8nDCpNHmhHyz/KcRQau+ yI1i1Wc2sc8dIV8PMw0Adp0mPxp5MQqZwZ7bcL7qh3U/09ie1lIdfzMezmsaXrOLz7Uq Vuyg== X-Gm-Message-State: AMCzsaV9VtalfaZ7tsYfSK8+MX0hA451Y8P+EqaTjZcPTAgF987kc5+h lWLy3qxUIVbWpvSUwjDfg6mXE0ad X-Google-Smtp-Source: AOwi7QAY17xCGJxSMejSH2dvMsNcvOjz5tcLovsOBjZ/Nc6KcsWN7qOuKJxjewJUULlBiMedwniIww== X-Received: by 10.200.50.113 with SMTP id y46mr15995281qta.315.1508170958425; Mon, 16 Oct 2017 09:22:38 -0700 (PDT) Received: from [192.168.2.122] (174-24-242-218.tukw.qwest.net. [174.24.242.218]) by smtp.gmail.com with ESMTPSA id g47sm5033110qtk.37.2017.10.16.09.22.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 09:22:37 -0700 (PDT) Subject: Re: svn commit: r324666 - head/sys/kern From: Matt Joras To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710161614.v9GGEoUN094644@repo.freebsd.org> Message-ID: Date: Mon, 16 Oct 2017 09:22:35 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201710161614.v9GGEoUN094644@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 16:22:46 -0000 On 10/16/2017 09:14, Matt Joras wrote: > Author: mjoras > Date: Mon Oct 16 16:14:50 2017 > New Revision: 324666 > URL: https://svnweb.freebsd.org/changeset/base/324666 > > Log: > Properly reset the fields in clean_unrhdr. > > In r324542 I neglected to reset the first and last fields of struct > unrhdr. This causes a tmpfs to fail the unr(9) consistency checks with > DIAGNOSTIC on. Fix this by resetting the fields by calling init_unrhdr. > While here, change a loop to use TAILQ_FOREACH_SAFE since it is more > readable and equally fast. > > Reported by: David Wolfskill > Approved by: rstone (mentor) > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D12662 From owner-svn-src-head@freebsd.org Mon Oct 16 17:04:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C3E1E3F5C7; Mon, 16 Oct 2017 17:04:25 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 002AA3E10; Mon, 16 Oct 2017 17:04:24 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wm0-x235.google.com with SMTP id q124so5408266wmb.0; Mon, 16 Oct 2017 10:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GzRE2BMNbpl7b+bMmXWFi7HHRgJs0NSB4PCz/+NeMX0=; b=YzoIFanyU6xxtNJ6926zVaYv3IddT4vOcjnGYSZrouEBObK8ouQHIxc1zrzomIEZzh y3iz0/CY05PcPyiyyXT4hCQDRgfoNO0YbaoKT/ZuAr4FFAnxwdIRxbfHVr0zbuJM1K1x cL7IWRJ8Xm5jUcf5UmgzQAUIPbc8Rjcxz+mOFLHlH7wv6vh+w6YfKlHJ9+dtzKLn0Gu8 8HC0mWg6R6h+PKG7mT41A9ygG+YeiNqxZINg2mF0vIdlSHwmTABPI7iT+qS1nQg837Dl kKEoAaKMEdgHDlaAWMcEi2DiB8FUh//01xq2Umwvkx6eD2chcnuVw0EVVpWYh4pHrhRE 3T8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GzRE2BMNbpl7b+bMmXWFi7HHRgJs0NSB4PCz/+NeMX0=; b=bddbtyPYVw6TvA/bu4gmHRzqm32sUnYNKr92ysV3SdHsM5Rgu9X1Y+4In6U0t0uHQU n5O9AAoI965MLy/cnpR6H1nG3yNLqrwY0GOPY+gZynh2MLBjSjkS5oGEFn3y9sjVsGOp MBRTVjRSQk0nnbUz+sVx2Cb/ga7H3/hKuszL0cE2/FL+cyNHGpAsh1ohoN3nLW9CPzuw v7MsXUm0L48oGOA+BcoCw4h5+rJYj1iyLfuReNlk67Q1VjLq3EVzgDTbtl6SxDzamCCy sT6pWYd8c9tODhZ5+KR5bmRndiEEGgv7iobqkSF8sUkyBWXW7j3ZFKvLnOGPtj6YzQnD aIYA== X-Gm-Message-State: AMCzsaXfobduIqkQi6v6gc3UFtoaGPVG1R68hzNt7ZfEtORTSwGO2kwb 3VnyphqVUHp1Bh7FJM/03AzDV7VKQvys7AVly0SOkg== X-Google-Smtp-Source: ABhQp+TaEmBq+GR8c3+nLIZ9DpSUCNk6fWKfEXodqtz9dnnYCxtLY7BYzhnOQ4KZUi4R3SIcWqZgGi1TTUx9024gAGg= X-Received: by 10.28.174.67 with SMTP id x64mr1577141wme.82.1508173463150; Mon, 16 Oct 2017 10:04:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.150.149 with HTTP; Mon, 16 Oct 2017 10:04:22 -0700 (PDT) In-Reply-To: <201710012120.v91LKSH1050145@repo.freebsd.org> References: <201710012120.v91LKSH1050145@repo.freebsd.org> From: Jonathan Looney Date: Mon, 16 Oct 2017 13:04:22 -0400 Message-ID: Subject: Re: svn commit: r324179 - head/sys/netinet To: Julien Charbon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 17:04:25 -0000 Hi Julien, I apologize for just getting to this, but your code just made it into my local tree. The non-INVARIANTS case looks incorrect. Because tw stays on the list, it can end up stuck at the front of the queue and block everything behind it. Personally, I would be more comfortable just panic'ing here. This indicates a problem. And, depending on the way things got corrupted, you could end up with other hard-to-debug problems if you continue with a corrupted state. Jonathan On Sun, Oct 1, 2017 at 5:20 PM, Julien Charbon wrote: > Author: jch > Date: Sun Oct 1 21:20:28 2017 > New Revision: 324179 > URL: https://svnweb.freebsd.org/changeset/base/324179 > > Log: > Fix an infinite loop in tcp_tw_2msl_scan() when an INP_TIMEWAIT inp has > been destroyed before its tcptw with INVARIANTS undefined. > > This is a symmetric change of r307551: > > A INP_TIMEWAIT inp should not be destroyed before its tcptw, and > INVARIANTS > will catch this case. If INVARIANTS is undefined it will emit a > log(LOG_ERR) > and avoid a hard to debug infinite loop in tcp_tw_2msl_scan(). > > Reported by: Ben Rubson, hselasky > Submitted by: hselasky > Tested by: Ben Rubson, jch > MFC after: 1 week > Sponsored by: Verisign, inc > Differential Revision: https://reviews.freebsd.org/D12267 > > Modified: > head/sys/netinet/tcp_timewait.c > > Modified: head/sys/netinet/tcp_timewait.c > ============================================================ > ================== > --- head/sys/netinet/tcp_timewait.c Sun Oct 1 20:12:30 2017 > (r324178) > +++ head/sys/netinet/tcp_timewait.c Sun Oct 1 21:20:28 2017 > (r324179) > @@ -709,10 +709,29 @@ tcp_tw_2msl_scan(int reuse) > INP_WLOCK(inp); > tw = intotw(inp); > if (in_pcbrele_wlocked(inp)) { > - KASSERT(tw == NULL, ("%s: held last inp " > - "reference but tw not NULL", > __func__)); > - INP_INFO_RUNLOCK(&V_tcbinfo); > - continue; > + if (__predict_true(tw == NULL)) { > + INP_INFO_RUNLOCK(&V_tcbinfo); > + continue; > + } else { > + /* This should not happen as in > TIMEWAIT > + * state the inp should not be > destroyed > + * before its tcptw. If INVARIANTS > is > + * defined panic. > + */ > +#ifdef INVARIANTS > + panic("%s: Panic before an > infinite " > + "loop: INP_TIMEWAIT && > (INP_FREED " > + "|| inp last reference) && tw > != " > + "NULL", __func__); > +#else > + log(LOG_ERR, "%s: Avoid an > infinite " > + "loop: INP_TIMEWAIT && > (INP_FREED " > + "|| inp last reference) && tw > != " > + "NULL", __func__); > +#endif > + INP_INFO_RUNLOCK(&V_tcbinfo); > + break; > + } > } > > if (tw == NULL) { > > From owner-svn-src-head@freebsd.org Mon Oct 16 17:21:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24D70E3FCC8; Mon, 16 Oct 2017 17:21:54 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00E4963925; Mon, 16 Oct 2017 17:21:53 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GHLrwa024799; Mon, 16 Oct 2017 17:21:53 GMT (envelope-from romain@FreeBSD.org) Received: (from romain@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GHLrQ3024797; Mon, 16 Oct 2017 17:21:53 GMT (envelope-from romain@FreeBSD.org) Message-Id: <201710161721.v9GHLrQ3024797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: romain set sender to romain@FreeBSD.org using -f From: =?UTF-8?Q?Romain_Tarti=c3=a8re?= Date: Mon, 16 Oct 2017 17:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324667 - head/lib/libgeom X-SVN-Group: head X-SVN-Commit-Author: romain X-SVN-Commit-Paths: head/lib/libgeom X-SVN-Commit-Revision: 324667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 17:21:54 -0000 Author: romain (ports committer) Date: Mon Oct 16 17:21:52 2017 New Revision: 324667 URL: https://svnweb.freebsd.org/changeset/base/324667 Log: Add a quick description of the geom_getxml(3), geom_xml2tree(3), geom_gettree(3) and geom_deletetree(3) functions provided by libgeom and are not documented in libgeom(3). Reviewed by: mav, bjk, allanjude Approved by: allanjude Differential Revision: https://reviews.freebsd.org/D12679 Modified: head/lib/libgeom/Makefile head/lib/libgeom/libgeom.3 Modified: head/lib/libgeom/Makefile ============================================================================== --- head/lib/libgeom/Makefile Mon Oct 16 16:14:50 2017 (r324666) +++ head/lib/libgeom/Makefile Mon Oct 16 17:21:52 2017 (r324667) @@ -33,6 +33,10 @@ MLINKS+= \ libgeom.3 gctl_issue.3 \ libgeom.3 gctl_free.3 \ libgeom.3 gctl_dump.3 \ + libgeom.3 geom_getxml.3 \ + libgeom.3 geom_xml2tree.3 \ + libgeom.3 geom_gettree.3 \ + libgeom.3 geom_deletetree.3 \ libgeom.3 g_close.3 \ libgeom.3 g_delete.3 \ libgeom.3 g_device_path.3 \ Modified: head/lib/libgeom/libgeom.3 ============================================================================== --- head/lib/libgeom/libgeom.3 Mon Oct 16 16:14:50 2017 (r324666) +++ head/lib/libgeom/libgeom.3 Mon Oct 16 17:21:52 2017 (r324667) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 22, 2017 +.Dd October 16, 2017 .Dt LIBGEOM 3 .Os .Sh NAME @@ -46,6 +46,10 @@ .Nm gctl_issue , .Nm gctl_free , .Nm gctl_dump , +.Nm geom_getxml , +.Nm geom_xml2tree , +.Nm geom_gettree , +.Nm geom_deletetree , .Nm g_open , .Nm g_close , .Nm g_mediasize , @@ -99,7 +103,15 @@ .Ft void .Fn gctl_dump "struct gctl_req *req" "FILE *f" .Ss "Utility Functions" +.Ft "char *" +.Fn geom_getxml void .Ft int +.Fn geom_xml2tree "struct gmesh *gmp" "char *p" +.Ft int +.Fn geom_gettree "struct gmesh *gmp" +.Ft void +.Fn geom_deletetree "struct gmesh *gmp" +.Ft int .Fn g_open "const char *name" "int dowrite" .Ft int .Fn g_close "int fd" @@ -278,6 +290,46 @@ which returns on success, or an error message corresponding to the first error which happened. .Ss "Utility Functions" +The +.Fn geom_getxml +function is a wrapper around +.Xr sysctl 3 +that fetches the +.Ar kern.geom.confxml +OID, and returns it's value. +The allocated memory should be released with +.Xr free 2 +after use. +.Pp +The +.Fn geom_xml2tree +function parses the XML representation of a GEOM topology passed as +.Ar p , +allocates the needed data structures to access this information and fills in +the passed +.Ar gmp +data structure. +Memory allocated during this transformation should be released +using +.Fn geom_deletetree +after use. +.Pp +The +.Fn geom_gettree +function is a wrapper around the +.Fn geom_getxml +and +.Fn geom_xml2tree +functions. +Memory allocated during this operation should be released using +.Fn geom_deletetree +after use. +.Pp +The +.Fn geom_deletetree +function releases memory allocated for storing the data-structures referenced by +.Ar gmp . +.Pp The .Fn g_* functions are used to communicate with GEOM providers. From owner-svn-src-head@freebsd.org Mon Oct 16 17:46:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11CD6E404D7; Mon, 16 Oct 2017 17:46:59 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (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 CF7C364AE5; Mon, 16 Oct 2017 17:46:58 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0OXX00F00DXT3T00@st13p35im-asmtp001.me.com>; Mon, 16 Oct 2017 17:08:24 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1508173704; bh=qT99Ni+pjsSO/HzaVIvG/OxG35Isjf29RZJx7r9Uuls=; h=From:Message-id:Content-type:MIME-version:Subject:Date:To; b=8EfiDrPJDAoW+/tzY4Dk/FKAwxEtlkBgi35OSsWsBId87aTAPqeZAaXhqFuwP2pK4 CAQ/PjnmiDJEfW8HY5Z74Y0EeO33uIj1GiaJrkMN+Xgw7nWaC/wM5JlTZffavTnlwx sQr6xhBbjj81WEYFlpeOYVuThNn+ZRoa4mrepNZ//uKTG5f8/+c1gfVkBKLMcxaRNb D8GFmxJZwAv3R3XUkmalGTdKD/r5YUbVmqfyTRckvorKD9JehemysVc4yr4DGG33ut mtiGxUGc0qy4djPAy9knO33QoO2IYDh0r5AovXYc/Prqi1WqiFOthvbbYuQWkCeFHh jckC0eNxqBoJQ== Received: from icloud.com ([127.0.0.1]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0OXX0056NE9W8J50@st13p35im-asmtp001.me.com>; Mon, 16 Oct 2017 17:08:23 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-16_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710160239 From: Toomas Soome Message-id: MIME-version: 1.0 (Mac OS X Mail 11.0 \(3445.1.7\)) Subject: Re: svn commit: r324646 - in head/sys/boot/efi: boot1 libefi loader Date: Mon, 16 Oct 2017 20:08:19 +0300 In-reply-to: <3BED6A0F-689C-4B89-A2AA-6990FB473539@fubar.geek.nz> Cc: Warner Losh , eric@meatspace.com, src-committers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Warner Losh To: Andrew Turner References: <201710160359.v9G3xCCi087576@repo.freebsd.org> <3BED6A0F-689C-4B89-A2AA-6990FB473539@fubar.geek.nz> X-Mailer: Apple Mail (2.3445.1.7) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 17:46:59 -0000 The arm (uboot) has a bit different approach on block device(s), see = efipart_hdinfo_add_filepath() in efipart.c; the code needs to check for = MEDIA_FILEPATH_DP, I think. rgds, toomas > On 16 Oct 2017, at 19:07, Andrew Turner wrote: >=20 > Correct, it is aarch64. It runs a similar qemu command, however I also = see it under the ARM Foundation model so it seems to not be simulator = specific. >=20 > Andrew >=20 >> On 16 Oct 2017, at 16:56, Warner Losh > wrote: >>=20 >> So this is on aarch64? Is this running a standardish qemu setup as = documented on https://wiki.freebsd.org/arm64/QEMU = ? Or are there tricks that we need = to cope with... >>=20 >> If we can't get good resoltuion on this today, I plan on backing out = the entire change. >>=20 >> Warner >>=20 >> On Mon, Oct 16, 2017 at 9:38 AM, Andrew Turner > wrote: >> I have a local Jenkins setup that builds images & tries to run under = various simulators. The final image is built with mkimg. I=E2=80=99m = running it under qemu. >>=20 >> Andrew >>=20 >>> On 16 Oct 2017, at 13:19, Warner Losh > wrote: >>>=20 >>> I'll take a look, but I've also ccd Eric so he can figure out what = went wrong with is code in your environment. What env is That? >>>=20 >>> Warnee >>>=20 >>> On Oct 16, 2017 3:26 AM, "Andrew Turner" > wrote: >>>=20 >>> > On 16 Oct 2017, at 04:59, Warner Losh > wrote: >>> > >>> > Author: imp >>> > Date: Mon Oct 16 03:59:11 2017 >>> > New Revision: 324646 >>> > URL: https://svnweb.freebsd.org/changeset/base/324646 = >>> > >>> > Log: >>> > Unify boot1 with loader >>> > >>> > Refactor boot1 to use the same I/O code as /boot/loader uses. = Refactor >>> > to use the common efi_main.c. >>> > >>> > Submitted by: Eric McCorkle >>> > Differential Revision: https://reviews.freebsd.org/D10447 = >>> > >>> > Added: >>> > head/sys/boot/efi/libefi/efi_main.c (contents, props changed) >>> > - copied, changed from r324645, = head/sys/boot/efi/loader/efi_main.c >>> > Deleted: >>> > head/sys/boot/efi/boot1/boot_module.h >>> > head/sys/boot/efi/boot1/ufs_module.c >>> > head/sys/boot/efi/boot1/zfs_module.c >>> > head/sys/boot/efi/loader/efi_main.c >>> > Modified: >>> > head/sys/boot/efi/boot1/Makefile >>> > head/sys/boot/efi/boot1/boot1.c >>> > head/sys/boot/efi/libefi/Makefile >>> > head/sys/boot/efi/loader/Makefile >>>=20 >>> Hello Warner, >>>=20 >>> After this change I=E2=80=99m getting the following panic on various = test VMs. >>>=20 >>> Andrew >>>=20 >>> >> FreeBSD EFI boot block >>>=20 >>> Loader path: /boot/loader.efi >>>=20 >>> Load Path: \EFI\BOOT\BOOTAA64.EFI >>> Load Device: = VenHw(837DCA9E-E874-4D82-B29A-23FE0E23D1E2,003C000A00000000)/HD(1,GPT,DD40= E9C6-B247-11E7-AA0A-15EFE1BBB7CF,0x3,0x640) >>> panic: Couldn't trim device path >>> --> Press a key on the console to reboot <-- >>>=20 >>=20 >>=20 >=20 From owner-svn-src-head@freebsd.org Mon Oct 16 18:53:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1289AE42002; Mon, 16 Oct 2017 18:53:01 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D1E3682FA; Mon, 16 Oct 2017 18:52:59 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 9f344e4b; Mon, 16 Oct 2017 20:46:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=ldh/AplNGB70R3BLfyv7gRVRBGM=; b=P0srOSChbySnspLg5fkBfbnSmmYy aF0HamLfr1kZ7tcCY9O5YFHqITYdnlNO43Y2t8Tjrut/DHKvs7TUE6Ks6etuI8Rj d0xDJ/nOXcgY/wQIlR7KugX4dIQBDGd/wXDI3Nw0ZpFGDmu0N7eIvhGF+A6AN32U DHxJMtePkS5oAy0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=qJNf2gZXxU7tLG0OynrF3YWYjSZqtsFZXHv5gV/tksiVoExMv6+qtxs6 K0k+DYUuWyfBRGnrR4dKb7G0cFrxsGzrm9mb01zA3bmiY0uG059gt21WPvvFZ1Gk zZeqW4R+dfAKQOvnmlZGUI5Y4KdQ1CPTpVZckEBfkEfQzJDPn04= Received: from knuckles.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 7b4768dc TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Mon, 16 Oct 2017 20:46:16 +0200 (CEST) Date: Mon, 16 Oct 2017 20:46:13 +0200 From: Emmanuel Vadot To: Toomas Soome Cc: Andrew Turner , Warner Losh , eric@meatspace.com, src-committers , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Warner Losh Subject: Re: svn commit: r324646 - in head/sys/boot/efi: boot1 libefi loader Message-Id: <20171016204613.3c9ea3e30cdb8dadf0b6fe9d@bidouilliste.com> In-Reply-To: References: <201710160359.v9G3xCCi087576@repo.freebsd.org> <3BED6A0F-689C-4B89-A2AA-6990FB473539@fubar.geek.nz> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 18:53:01 -0000 On Mon, 16 Oct 2017 20:08:19 +0300 Toomas Soome wrote: >=20 > The arm (uboot) has a bit different approach on block device(s), see efip= art_hdinfo_add_filepath() in efipart.c; the code needs to check for MEDIA_F= ILEPATH_DP, I think. >=20 > rgds, > toomas I'm pretty sure that qemu doesn't use u-boot but EDK2 directly. >=20 > > On 16 Oct 2017, at 19:07, Andrew Turner wrote: > >=20 > > Correct, it is aarch64. It runs a similar qemu command, however I also = see it under the ARM Foundation model so it seems to not be simulator speci= fic. > >=20 > > Andrew > >=20 > >> On 16 Oct 2017, at 16:56, Warner Losh > wrote: > >>=20 > >> So this is on aarch64? Is this running a standardish qemu setup as doc= umented on https://wiki.freebsd.org/arm64/QEMU ? Or are there tricks that we need to cope with... > >>=20 > >> If we can't get good resoltuion on this today, I plan on backing out t= he entire change. > >>=20 > >> Warner > >>=20 > >> On Mon, Oct 16, 2017 at 9:38 AM, Andrew Turner > wrote: > >> I have a local Jenkins setup that builds images & tries to run under v= arious simulators. The final image is built with mkimg. I?m running it unde= r qemu. > >>=20 > >> Andrew > >>=20 > >>> On 16 Oct 2017, at 13:19, Warner Losh > wrote: > >>>=20 > >>> I'll take a look, but I've also ccd Eric so he can figure out what we= nt wrong with is code in your environment. What env is That? > >>>=20 > >>> Warnee > >>>=20 > >>> On Oct 16, 2017 3:26 AM, "Andrew Turner" > wrote: > >>>=20 > >>> > On 16 Oct 2017, at 04:59, Warner Losh > wrote: > >>> > > >>> > Author: imp > >>> > Date: Mon Oct 16 03:59:11 2017 > >>> > New Revision: 324646 > >>> > URL: https://svnweb.freebsd.org/changeset/base/324646 > >>> > > >>> > Log: > >>> > Unify boot1 with loader > >>> > > >>> > Refactor boot1 to use the same I/O code as /boot/loader uses. Refa= ctor > >>> > to use the common efi_main.c. > >>> > > >>> > Submitted by: Eric McCorkle > >>> > Differential Revision: https://reviews.freebsd.org/D10447 > >>> > > >>> > Added: > >>> > head/sys/boot/efi/libefi/efi_main.c (contents, props changed) > >>> > - copied, changed from r324645, head/sys/boot/efi/loader/efi_ma= in.c > >>> > Deleted: > >>> > head/sys/boot/efi/boot1/boot_module.h > >>> > head/sys/boot/efi/boot1/ufs_module.c > >>> > head/sys/boot/efi/boot1/zfs_module.c > >>> > head/sys/boot/efi/loader/efi_main.c > >>> > Modified: > >>> > head/sys/boot/efi/boot1/Makefile > >>> > head/sys/boot/efi/boot1/boot1.c > >>> > head/sys/boot/efi/libefi/Makefile > >>> > head/sys/boot/efi/loader/Makefile > >>>=20 > >>> Hello Warner, > >>>=20 > >>> After this change I?m getting the following panic on various test VMs. > >>>=20 > >>> Andrew > >>>=20 > >>> >> FreeBSD EFI boot block > >>>=20 > >>> Loader path: /boot/loader.efi > >>>=20 > >>> Load Path: \EFI\BOOT\BOOTAA64.EFI > >>> Load Device: VenHw(837DCA9E-E874-4D82-B29A-23FE0E23D1E2,003C000A00= 000000)/HD(1,GPT,DD40E9C6-B247-11E7-AA0A-15EFE1BBB7CF,0x3,0x640) > >>> panic: Couldn't trim device path > >>> --> Press a key on the console to reboot <-- > >>>=20 > >>=20 > >>=20 > >=20 >=20 --=20 Emmanuel Vadot From owner-svn-src-head@freebsd.org Mon Oct 16 20:06:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDBB9E43CCC; Mon, 16 Oct 2017 20:06:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CD9A6AF34; Mon, 16 Oct 2017 20:06:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GK6OOj095262; Mon, 16 Oct 2017 20:06:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GK6OYb095261; Mon, 16 Oct 2017 20:06:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201710162006.v9GK6OYb095261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 16 Oct 2017 20:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324668 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 324668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 20:06:25 -0000 Author: bdrewery Date: Mon Oct 16 20:06:24 2017 New Revision: 324668 URL: https://svnweb.freebsd.org/changeset/base/324668 Log: This child is expected to exit on SIGTRAP, don't leave a core behind. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Mon Oct 16 17:21:52 2017 (r324667) +++ head/tests/sys/kern/ptrace_test.c Mon Oct 16 20:06:24 2017 (r324668) @@ -2467,12 +2467,16 @@ ATF_TC_WITHOUT_HEAD(ptrace__PT_CONTINUE_with_sigtrap_s ATF_TC_BODY(ptrace__PT_CONTINUE_with_sigtrap_system_call_entry, tc) { struct ptrace_lwpinfo pl; + struct rlimit rl; pid_t fpid, wpid; int status; ATF_REQUIRE((fpid = fork()) != -1); if (fpid == 0) { trace_me(); + /* SIGTRAP expected to cause exit on syscall entry. */ + rl.rlim_cur = rl.rlim_max = 0; + ATF_REQUIRE(setrlimit(RLIMIT_CORE, &rl) == 0); getpid(); exit(1); } From owner-svn-src-head@freebsd.org Mon Oct 16 20:11:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FD45E43F5E; Mon, 16 Oct 2017 20:11:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0B8A6B556; Mon, 16 Oct 2017 20:11:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GKBUwk097282; Mon, 16 Oct 2017 20:11:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GKBURo097281; Mon, 16 Oct 2017 20:11:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710162011.v9GKBURo097281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Oct 2017 20:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324669 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 20:11:31 -0000 Author: kib Date: Mon Oct 16 20:11:29 2017 New Revision: 324669 URL: https://svnweb.freebsd.org/changeset/base/324669 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Mon Oct 16 20:06:24 2017 (r324668) +++ head/sys/kern/kern_sig.c Mon Oct 16 20:11:29 2017 (r324669) @@ -2786,15 +2786,15 @@ issignal(struct thread *td) struct sigacts *ps; struct sigqueue *queue; sigset_t sigpending; - int sig, prop; ksiginfo_t ksi; + int prop, sig, traced; p = td->td_proc; ps = p->p_sigacts; mtx_assert(&ps->ps_mtx, MA_OWNED); PROC_LOCK_ASSERT(p, MA_OWNED); for (;;) { - int traced = (p->p_flag & P_TRACED) || (p->p_stops & S_SIG); + traced = (p->p_flag & P_TRACED) || (p->p_stops & S_SIG); sigpending = td->td_sigqueue.sq_signals; SIGSETOR(sigpending, p->p_sigqueue.sq_signals); @@ -2982,11 +2982,10 @@ thread_stopped(struct proc *p) * from the current set of pending signals. */ int -postsig(sig) - int sig; +postsig(int sig) { - struct thread *td = curthread; - struct proc *p = td->td_proc; + struct thread *td; + struct proc *p; struct sigacts *ps; sig_t action; ksiginfo_t ksi; @@ -2994,6 +2993,8 @@ postsig(sig) KASSERT(sig != 0, ("postsig")); + td = curthread; + p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); ps = p->p_sigacts; mtx_assert(&ps->ps_mtx, MA_OWNED); @@ -3010,7 +3011,7 @@ postsig(sig) ktrpsig(sig, action, td->td_pflags & TDP_OLDMASK ? &td->td_oldsigmask : &td->td_sigmask, ksi.ksi_code); #endif - if (p->p_stops & S_SIG) { + if ((p->p_stops & S_SIG) != 0) { mtx_unlock(&ps->ps_mtx); stopevent(p, S_SIG, sig); mtx_lock(&ps->ps_mtx); From owner-svn-src-head@freebsd.org Mon Oct 16 20:15:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA65CE4413E; Mon, 16 Oct 2017 20:15:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 769BB6B7B3; Mon, 16 Oct 2017 20:15:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GKFJ9Y099618; Mon, 16 Oct 2017 20:15:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GKFJ14099617; Mon, 16 Oct 2017 20:15:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710162015.v9GKFJ14099617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Oct 2017 20:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324670 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 20:15:20 -0000 Author: kib Date: Mon Oct 16 20:15:19 2017 New Revision: 324670 URL: https://svnweb.freebsd.org/changeset/base/324670 Log: Improve assertion that an ignored or blocked signal is not delivered. Split two conditions into separate asserts. Print additional details, like the signal number and action value. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Mon Oct 16 20:11:29 2017 (r324669) +++ head/sys/kern/kern_sig.c Mon Oct 16 20:15:19 2017 (r324670) @@ -3030,8 +3030,10 @@ postsig(int sig) /* * If we get here, the signal must be caught. */ - KASSERT(action != SIG_IGN && !SIGISMEMBER(td->td_sigmask, sig), - ("postsig action")); + KASSERT(action != SIG_IGN, ("postsig action %p", action)); + KASSERT(!SIGISMEMBER(td->td_sigmask, sig), + ("postsig action: blocked sig %d", sig)); + /* * Set the new mask value and also defer further * occurrences of this signal. From owner-svn-src-head@freebsd.org Mon Oct 16 20:21:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9999FE44454; Mon, 16 Oct 2017 20:21:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 697836BCA1; Mon, 16 Oct 2017 20:21:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GKLpuF003709; Mon, 16 Oct 2017 20:21:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GKLplm003708; Mon, 16 Oct 2017 20:21:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710162021.v9GKLplm003708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Oct 2017 20:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324671 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 20:21:52 -0000 Author: kib Date: Mon Oct 16 20:21:51 2017 New Revision: 324671 URL: https://svnweb.freebsd.org/changeset/base/324671 Log: Re-evaluate thread' signal mask after ptracestop(). The stop drops process lock, which allows the signal mask to be changed and our selected signal might become blocked, i.e. should be returned to the process queue instead of delivery. Also, for the existing check of the process no longer having an attached debugger, we should not loose the signal, but requeue it. Reported and tested by: bdrewery Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Mon Oct 16 20:15:19 2017 (r324670) +++ head/sys/kern/kern_sig.c Mon Oct 16 20:21:51 2017 (r324671) @@ -2855,15 +2855,32 @@ issignal(struct thread *td) mtx_lock(&ps->ps_mtx); /* - * Keep looking if the debugger discarded the signal - * or replaced it with a masked signal. - * - * If the traced bit got turned off, go back up - * to the top to rescan signals. This ensures - * that p_sig* and p_sigact are consistent. + * Keep looking if the debugger discarded or + * replaced the signal. */ - if (sig == 0 || (p->p_flag & P_TRACED) == 0) + if (sig == 0) continue; + + /* + * If the signal became masked, re-queue it. + */ + if (SIGISMEMBER(td->td_sigmask, sig)) { + ksi.ksi_flags |= KSI_HEAD; + sigqueue_add(&p->p_sigqueue, sig, &ksi); + continue; + } + + /* + * If the traced bit got turned off, requeue + * the signal and go back up to the top to + * rescan signals. This ensures that p_sig* + * and p_sigact are consistent. + */ + if ((p->p_flag & P_TRACED) == 0) { + ksi.ksi_flags |= KSI_HEAD; + sigqueue_add(queue, sig, &ksi); + continue; + } } prop = sigprop(sig); From owner-svn-src-head@freebsd.org Mon Oct 16 21:04:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 897BEE451B5; Mon, 16 Oct 2017 21:04:56 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C8D56D20B; Mon, 16 Oct 2017 21:04:55 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf0-f46.google.com with SMTP id n69so18488218lfn.2; Mon, 16 Oct 2017 14:04:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=mCFp4bxaEVLul/PWDQhgFaX6hTPguol4a7rYuGQdEwc=; b=FpuOwCC4jylwH20K13+AqVdUPfjjA4qGna19F332P4/cyv6dO0OoiFh7fO90MZ5CFx Mo3oz+BMYbnzLs8fdegGviwhzJe+XY11kKaLAGkPwpBMHOCy/E9xRhe6JOXIxTJ45BRw c1HzuBhRQBxfqVANHATx5indHRntkWsLm+40CTWnKOFhIv3Gn2dascflEGgjN+/Fvz5Z 9zOzF9hUvafdYckMRUgbGsQ+7tKbQgsijvcZBv9F2ldBR7a5TZWmbtMtBQJaHnACZwTo ZtDnqTDSIQZVT6D2ZwlajbJ/inLi4EvgRTyTh5lRhaKtZ0TUPX9AWWnscILhgd/yf1Xs SJHA== X-Gm-Message-State: AMCzsaW20eKILWsnoVnI9Qp5j47kFK9DCPPYnZG9jBh7onmVnoyA6WnS QrR47d712Ms5+D4vsqNEIxRAWw== X-Google-Smtp-Source: ABhQp+Sh3m4B4RZyKIDOJESjSZYv3mC3L4cHFWwKtmVHkGvFeDOvCWOxNWpBTpcDzBpgRLn4Q0h68Q== X-Received: by 10.25.32.210 with SMTP id g201mr3588894lfg.2.1508187519299; Mon, 16 Oct 2017 13:58:39 -0700 (PDT) Received: from localhost (46-133-70-134.dialup.umc.net.ua. [46.133.70.134]) by smtp.gmail.com with ESMTPSA id l18sm51518ljb.41.2017.10.16.13.58.32 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 13:58:38 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Alan Somers" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r324656 - head/lib/libifconfig References: <201710160654.v9G6sQmA062311@repo.freebsd.org> Date: Mon, 16 Oct 2017 23:55:51 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.15 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 21:04:56 -0000 Mon, 16 Oct 2017 19:06:55 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Alan Somers = : > On Mon, Oct 16, 2017 at 12:54 AM, Andriy Voskoboinyk = > wrote: >> Author: avos >> Date: Mon Oct 16 06:54:26 2017 >> New Revision: 324656 >> URL: https://svnweb.freebsd.org/changeset/base/324656 >> >> Log: >> libifconfig: allow to get original interface name via = >> ifconfig_get_orig_name() >> >> Uses the same method as in tools/tools/ifinfo/ifinfo.c >> (via net.link.generic sysctl). >> >> Tested with modified wlandebug(8). >> >> Differential Revision: https://reviews.freebsd.org/D12554 >> >> Modified: >> head/lib/libifconfig/libifconfig.c >> head/lib/libifconfig/libifconfig.h > > The original author of libifconfig keeps her work at Github. To > reduce divergence, we should submit changes there first, or else > convince her to start using our SVN repository. Did you at least ask > her for review? > https://github.com/savagedlight/libifconfig It was placed at https://github.com/Savagedlight/libifconfig/pull/52; should I back this change out until it will be reviewed? > > -Alan From owner-svn-src-head@freebsd.org Mon Oct 16 21:21:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75266E4581E; Mon, 16 Oct 2017 21:21:32 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42EB16D9BD; Mon, 16 Oct 2017 21:21:32 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GLLVxq027654; Mon, 16 Oct 2017 21:21:31 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GLLVcb027653; Mon, 16 Oct 2017 21:21:31 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201710162121.v9GLLVcb027653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 16 Oct 2017 21:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324672 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 324672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 21:21:32 -0000 Author: avos Date: Mon Oct 16 21:21:31 2017 New Revision: 324672 URL: https://svnweb.freebsd.org/changeset/base/324672 Log: ifnet(9): split ifc_alloc_unit() (should simplify code flow) Allocate smallest unit number from pool via ifc_alloc_unit_next() and exact unit number (if available) via ifc_alloc_unit_specific(). While here, address possible deadlock (mentioned in PR). PR: 217401 MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D12551 Modified: head/sys/net/if_clone.c Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Mon Oct 16 20:21:51 2017 (r324671) +++ head/sys/net/if_clone.c Mon Oct 16 21:21:31 2017 (r324672) @@ -595,44 +595,56 @@ ifc_name2unit(const char *name, int *unit) return (0); } -int -ifc_alloc_unit(struct if_clone *ifc, int *unit) +static int +ifc_alloc_unit_specific(struct if_clone *ifc, int *unit) { char name[IFNAMSIZ]; - int wildcard; - wildcard = (*unit < 0); -retry: if (*unit > ifc->ifc_maxunit) return (ENOSPC); - if (*unit < 0) { - *unit = alloc_unr(ifc->ifc_unrhdr); - if (*unit == -1) - return (ENOSPC); - } else { - *unit = alloc_unr_specific(ifc->ifc_unrhdr, *unit); - if (*unit == -1) { - if (wildcard) { - (*unit)++; - goto retry; - } else - return (EEXIST); - } - } + if (alloc_unr_specific(ifc->ifc_unrhdr, *unit) == -1) + return (EEXIST); + snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, *unit); if (ifunit(name) != NULL) { free_unr(ifc->ifc_unrhdr, *unit); - if (wildcard) { - (*unit)++; - goto retry; - } else - return (EEXIST); + return (EEXIST); } IF_CLONE_ADDREF(ifc); return (0); +} + +static int +ifc_alloc_unit_next(struct if_clone *ifc, int *unit) +{ + int error; + + *unit = alloc_unr(ifc->ifc_unrhdr); + if (*unit == -1) + return (ENOSPC); + + free_unr(ifc->ifc_unrhdr, *unit); + for (;;) { + error = ifc_alloc_unit_specific(ifc, unit); + if (error != EEXIST) + break; + + (*unit)++; + } + + return (error); +} + +int +ifc_alloc_unit(struct if_clone *ifc, int *unit) +{ + if (*unit < 0) + return (ifc_alloc_unit_next(ifc, unit)); + else + return (ifc_alloc_unit_specific(ifc, unit)); } void From owner-svn-src-head@freebsd.org Mon Oct 16 21:32:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2055E45B47; Mon, 16 Oct 2017 21:32:16 +0000 (UTC) (envelope-from julien.charbon@gmail.com) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 507FF6E131; Mon, 16 Oct 2017 21:32:15 +0000 (UTC) (envelope-from julien.charbon@gmail.com) Received: by mail-wm0-f67.google.com with SMTP id b189so40342wmd.4; Mon, 16 Oct 2017 14:32:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KuAjdq1ZIBVBcOSrnZlhSYZM7qg7a8ISv1qIITMZkqQ=; b=jbTqLHtLLn8bkvfKFYEUZOl9ha5tGFH54myQM2DoU+KYVF9QJDmxdHb9/+LVD9JQQ5 Ut0pA5wKWMWlzOQvOjrZI6n3LD0lzOjfsUtDDclNnnF1bOUT4xHFHugBxLX68Bueyiox lQAAh/6JgPWCXUXdcAbv0nnRpOzCMhckodEMCFZKuh9uMejkcicuCjH0Ygyu+jNtxfI2 Txd+PjcgklbAvo7I5BoivggifUMTsZrEmfKNEk2/C5Q/ZW4OSOzgMnSsxOO+tYTDW1fc kbtJ97IUIibqnDqlZPRE/tNJNUumWA1gptHDaM9NErVsqwBiGaOjmYWN3idD4s/+OkVc rp4w== X-Gm-Message-State: AMCzsaV7txp0iANO3BSPkUcC5Tfu9iloZIV/93HxoXBEst1GJpDqK/9P KdidgQNjLtHOODOEPTecJdbHTo7H X-Google-Smtp-Source: ABhQp+Rl7D91Sa0UrtsmsqYkoDJXKUISwwqE4g+AsBeUR48/6Ahn++BnGFN4fHT6YYrTlN323zpt/A== X-Received: by 10.28.135.209 with SMTP id j200mr1794910wmd.40.1508189527490; Mon, 16 Oct 2017 14:32:07 -0700 (PDT) Received: from ?IPv6:2a00:b420:1:9700:9160:e6b4:e62a:107f? ([2a00:b420:1:9700:9160:e6b4:e62a:107f]) by smtp.gmail.com with ESMTPSA id o24sm11152290wmi.39.2017.10.16.14.32.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 14:32:07 -0700 (PDT) Subject: Re: svn commit: r324179 - head/sys/netinet To: Jonathan Looney Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710012120.v91LKSH1050145@repo.freebsd.org> From: Julien Charbon Message-ID: <7dfb2ff7-7038-bae7-3505-bc1de21464fa@freebsd.org> Date: Mon, 16 Oct 2017 23:32:05 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 21:32:16 -0000 Hi Jonathan, On 10/16/17 7:04 PM, Jonathan Looney wrote: > I apologize for just getting to this, but your code just made it into my > local tree. > > The non-INVARIANTS case looks incorrect. Because tw stays on the list, > it can end up stuck at the front of the queue and block everything > behind it. > > Personally, I would be more comfortable just panic'ing here. This > indicates a problem. And, depending on the way things got corrupted, you > could end up with other hard-to-debug problems if you continue with a > corrupted state. Good remark, actually, this logic: #ifdef INVARIANTS -> panic() #else INVARIANTS -> log(LOG_ERR) was introduced with the main fix: https://reviews.freebsd.org/rS307551 Why not panic()-ing in both cases INVARIANTS and !INVARIANTS already? The rational is that r307551 fixes an issue introduced with r185775, pushed 8 years before: https://reviews.freebsd.org/rS185775 Obviously, this double free is either rarely reproduced and/or has only minor effects for most of people (like a connection closes sooner than expected), only few people got annoying kernel panic/infinite loop. Thus before introducing a panic() that could potentially impact a fair amount of people, better introducing a log(LOG_ERR) first. Now, when replace these log(LOG_ERR) calls by a proper panic()? I would say when 11.0 (which is the last supported release without the r307551 fix) reaches the EoL state: End of October 2017 I believe. And so far, so good, no log(LOG_ERR)/panic()/similar issues have been witness with r307551 fix. Of course, if you think it is too cautious, you can create a review with the panic() calls change to get wider point of views. My 2 cents. -- Julien From owner-svn-src-head@freebsd.org Mon Oct 16 21:46:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BCB3E4612A; Mon, 16 Oct 2017 21:46:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66C796E6F5; Mon, 16 Oct 2017 21:46:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GLkBO1036843; Mon, 16 Oct 2017 21:46:11 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GLkB6t036842; Mon, 16 Oct 2017 21:46:11 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201710162146.v9GLkB6t036842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 16 Oct 2017 21:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324673 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 21:46:12 -0000 Author: avos Date: Mon Oct 16 21:46:11 2017 New Revision: 324673 URL: https://svnweb.freebsd.org/changeset/base/324673 Log: mbuf(9): unbreak m_fragment() - Fix it by replacing m_cat() with m_prev->m_next = m_new (m_cat() will try to append data - as a result, there will be no fragmentation). - Move some constants out of the loop. Was previously tested with D4077. Differential Revision: https://reviews.freebsd.org/D4090 Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Mon Oct 16 21:21:31 2017 (r324672) +++ head/sys/kern/uipc_mbuf.c Mon Oct 16 21:46:11 2017 (r324673) @@ -1449,62 +1449,59 @@ bad: struct mbuf * m_fragment(struct mbuf *m0, int how, int length) { - struct mbuf *m_new = NULL, *m_final = NULL; - int progress = 0; + struct mbuf *m_first, *m_last; + int divisor = 255, progress = 0, fraglen; if (!(m0->m_flags & M_PKTHDR)) return (m0); - if ((length == 0) || (length < -2)) + if (length == 0 || length < -2) return (m0); + if (length > MCLBYTES) + length = MCLBYTES; + if (length < 0 && divisor > MCLBYTES) + divisor = MCLBYTES; + if (length == -1) + length = 1 + (arc4random() % divisor); + if (length > 0) + fraglen = length; m_fixhdr(m0); /* Needed sanity check */ - m_final = m_getcl(how, MT_DATA, M_PKTHDR); - - if (m_final == NULL) + m_first = m_getcl(how, MT_DATA, M_PKTHDR); + if (m_first == NULL) goto nospace; - if (m_dup_pkthdr(m_final, m0, how) == 0) + if (m_dup_pkthdr(m_first, m0, how) == 0) goto nospace; - m_new = m_final; + m_last = m_first; - if (length == -1) - length = 1 + (arc4random() & 255); - while (progress < m0->m_pkthdr.len) { - int fraglen; - - if (length > 0) - fraglen = length; - else - fraglen = 1 + (arc4random() & 255); + if (length == -2) + fraglen = 1 + (arc4random() % divisor); if (fraglen > m0->m_pkthdr.len - progress) fraglen = m0->m_pkthdr.len - progress; - if (fraglen > MCLBYTES) - fraglen = MCLBYTES; - - if (m_new == NULL) { - m_new = m_getcl(how, MT_DATA, 0); + if (progress != 0) { + struct mbuf *m_new = m_getcl(how, MT_DATA, 0); if (m_new == NULL) goto nospace; + + m_last->m_next = m_new; + m_last = m_new; } - m_copydata(m0, progress, fraglen, mtod(m_new, caddr_t)); + m_copydata(m0, progress, fraglen, mtod(m_last, caddr_t)); progress += fraglen; - m_new->m_len = fraglen; - if (m_new != m_final) - m_cat(m_final, m_new); - m_new = NULL; + m_last->m_len = fraglen; } m_freem(m0); - m0 = m_final; + m0 = m_first; return (m0); nospace: - if (m_final) - m_freem(m_final); + if (m_first) + m_freem(m_first); /* Return the original chain on failure */ return (m0); } From owner-svn-src-head@freebsd.org Mon Oct 16 21:53:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C654E4649F; Mon, 16 Oct 2017 21:53:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED6E6EE13; Mon, 16 Oct 2017 21:53:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 544B1E54; Mon, 16 Oct 2017 21:53:49 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 32A2289CC; Mon, 16 Oct 2017 21:53:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id KGBjAai7R1Of; Mon, 16 Oct 2017 21:53:45 +0000 (UTC) Subject: Re: svn commit: r324673 - head/sys/kern DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 20A9389C3 To: Andriy Voskoboinyk , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710162146.v9GLkB6t036842@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5305175e-e8d2-453d-9ba6-0281af1582a9@FreeBSD.org> Date: Mon, 16 Oct 2017 14:53:28 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201710162146.v9GLkB6t036842@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VUo1cunuSRpJUAGF66BF60qvsSsGI8b95" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 21:53:50 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VUo1cunuSRpJUAGF66BF60qvsSsGI8b95 Content-Type: multipart/mixed; boundary="sMEa77LEgCLXcFP0I1tjJlwow7qVVujD6"; protected-headers="v1" From: Bryan Drewery To: Andriy Voskoboinyk , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <5305175e-e8d2-453d-9ba6-0281af1582a9@FreeBSD.org> Subject: Re: svn commit: r324673 - head/sys/kern References: <201710162146.v9GLkB6t036842@repo.freebsd.org> In-Reply-To: <201710162146.v9GLkB6t036842@repo.freebsd.org> --sMEa77LEgCLXcFP0I1tjJlwow7qVVujD6 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 10/16/2017 2:46 PM, Andriy Voskoboinyk wrote: > Author: avos > Date: Mon Oct 16 21:46:11 2017 > New Revision: 324673 > URL: https://svnweb.freebsd.org/changeset/base/324673 >=20 > Log: > mbuf(9): unbreak m_fragment() How was it broken and since when? > =20 > - Fix it by replacing m_cat() with m_prev->m_next =3D m_new > (m_cat() will try to append data - as a result, there will be no > fragmentation). > - Move some constants out of the loop. > =20 > Was previously tested with D4077. > =20 > Differential Revision: https://reviews.freebsd.org/D4090 --=20 Regards, Bryan Drewery --sMEa77LEgCLXcFP0I1tjJlwow7qVVujD6-- --VUo1cunuSRpJUAGF66BF60qvsSsGI8b95 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZ5SpYAAoJEDXXcbtuRpfP4YoH/1A3k4yLYHODhjQYrx2a/Xs1 EVcfrcSSrAGeXC5Pcr1oKzA1hhCbbTI/xQQCPZLBbcjcUeCCK+Z5OJky2W/Cne+2 Q50FbLML6BZVy2wnkBU9dfAdFeWcOvQZERgVMy7NspS6PYCmFhLcjBXOTOYuT836 ZJ/Np4C9w5s0m+UZmmX1Izr+w2bTwXSICR/EoFG6/v4f0i+zi7KCyLtApuGVNzmi 07yfJixJ7PBUIS8jIvVcriYnwdIXXRgnL3jZCPYsk3F+X8SaFwLwrIbponP/V3wP 5uaO0Y0G0V/tSZ7dj5zuwGYeZIDC8g0bsFJlIZ6Q0Ccc7Xcst1a5mEtNJBnKJso= =YE1T -----END PGP SIGNATURE----- --VUo1cunuSRpJUAGF66BF60qvsSsGI8b95-- From owner-svn-src-head@freebsd.org Mon Oct 16 22:07:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25B58E4691B; Mon, 16 Oct 2017 22:07:51 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CC6B6F707; Mon, 16 Oct 2017 22:07:50 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf0-f54.google.com with SMTP id d10so18634133lfg.11; Mon, 16 Oct 2017 15:07:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=TWca2By9aFYCJ+qWeGY1yK3IKRhPjrZAuCKf6a/WVqo=; b=ZV+Smzef3SF0Qc2bTTmwF2HKt3oDA1EIX5/y2qLriGNSQZj2kPvzbj7UN+KkwdXIp/ LfTpyigwsfccEjQirDoRVAsHA4aoMFdO3sEK9eHoFlWAAEi1Hi64mFC/guSLu/ec4bJG WqG/s7+0ns2qDFoaFOZYHWRqsPwHTtPpE+7XxkaXL5rCKY2IOLVVgXtzDvBpZgCbqZtv ywRuQqBc3qw1ifvbpj7NbXDWlvIq3wkH4ZDI8I5WiFBzT7McCaShs7Q3jEHPgepGz6ff 1FDhdoE80ehbip/1djvTpuZUO7NBrD/uikOybJfLvQ+Z4YY+nlf7Q76JarzNtxTRxHwn zxPw== X-Gm-Message-State: AMCzsaU67xVcQsE2xm431w+m2L6d2AZtmXHMQFUu1vBhWCDmVIjsbDAq 0c4oz5R8IuvxK79WbYBtyYyr9g== X-Google-Smtp-Source: ABhQp+QxC/kiAhmijiUf+jiJRshIFZmfkaxzDCpLKLo0/4ISrjKzmKrMEm3m4WR50K0phqBMpG/gHw== X-Received: by 10.25.195.6 with SMTP id t6mr3700159lff.106.1508184096513; Mon, 16 Oct 2017 13:01:36 -0700 (PDT) Received: from localhost (46-133-70-134.dialup.umc.net.ua. [46.133.70.134]) by smtp.gmail.com with ESMTPSA id k86sm2107580ljb.97.2017.10.16.13.01.33 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 13:01:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Baptiste Daroussin" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324656 - head/lib/libifconfig References: <201710160654.v9G6sQmA062311@repo.freebsd.org> <20171016082919.fyp2uiui7hzarrs2@ivaldir.net> Date: Mon, 16 Oct 2017 22:58:55 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <20171016082919.fyp2uiui7hzarrs2@ivaldir.net> User-Agent: Opera Mail/12.15 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 22:07:51 -0000 > On Mon, Oct 16, 2017 at 06:54:26AM +0000, Andriy Voskoboinyk wrote: >> Author: avos >> Date: Mon Oct 16 06:54:26 2017 >> New Revision: 324656 >> URL: https://svnweb.freebsd.org/changeset/base/324656 >> >> Log: >> libifconfig: allow to get original interface name via >> ifconfig_get_orig_name() >> >> Uses the same method as in tools/tools/ifinfo/ifinfo.c >> (via net.link.generic sysctl). >> >> Tested with modified wlandebug(8). >> >> Differential Revision: https://reviews.freebsd.org/D12554 >> >> Modified: >> head/lib/libifconfig/libifconfig.c >> head/lib/libifconfig/libifconfig.h >> >> Modified: head/lib/libifconfig/libifconfig.c >> ============================================================================== >> --- head/lib/libifconfig/libifconfig.c Mon Oct 16 04:46:28 >> 2017 (r324655) >> +++ head/lib/libifconfig/libifconfig.c Mon Oct 16 06:54:26 >> 2017 (r324656) >> @@ -61,9 +61,43 @@ >> * $FreeBSD$ >> */ >> >> + /* >> + * Copyright 1996 Massachusetts Institute of Technology >> + * > 1996? > > This file was already under a BSD license, why adding an extra MIT > license to > it? It would be better to keep it under BSD license imho This one came unchanged from tools/tools/ifinfo/ifinfo.c (with modified code from it); I'm not sure if it can be just omitted. > > Best regards, > Bapt From owner-svn-src-head@freebsd.org Mon Oct 16 22:53:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF860E47CF5; Mon, 16 Oct 2017 22:53:36 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 706137116E; Mon, 16 Oct 2017 22:53:36 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf0-f54.google.com with SMTP id b190so18728084lfg.9; Mon, 16 Oct 2017 15:53:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:references:date:cc:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=wXcDISDg2Zryl11xPnqo6LjIVghYKKsHQq9G0YgkfeA=; b=SKjDQvJNbc0qKdyOiG8a8deY6UMyH92FmWTPAAyypDMRak1snVO7JAD9tNJMsbul1a AzaFrp5hJrbY+qOBHrGhvutm0nP8hav2qO8E+mLkAIoksvOwTLGR+OVFiEKKGCSAA7EO CZALNaNykLiAIL9iVNCCxmm0FBrhgHT77aEjrQVEdxTHbMOHqThNosQn36t2ghGxnB3A m6TFJYWIMg+PE1OppFuGtbJxpmTIqZe6iyH5hJBTqK0GayzSOplUYcXhgTI92rUtVqKB gNzWQrFZ6VLhTYUlzvdKvuL0U+KDUPb13+39o96RIcudd16ecv7gd3SWhVhukI7pOT+G ONyg== X-Gm-Message-State: AMCzsaUY+8BdG30l0eJFlqwevxvNWxyMROcOfQjEzdXcL2u6zuAuBxDj PtNApWyLN76RWgEsYRSTY5ZHQA== X-Google-Smtp-Source: ABhQp+TA2naevyrOOs/Q5qLoRb4CuvjN0m8HSOPgy9PG4UhxDgJnzMS4lLFmoK6Jqv3dEIuSuFwNRg== X-Received: by 10.25.78.141 with SMTP id u13mr3107166lfk.156.1508194413864; Mon, 16 Oct 2017 15:53:33 -0700 (PDT) Received: from localhost (46-133-216-195.dialup.umc.net.ua. [46.133.216.195]) by smtp.gmail.com with ESMTPSA id d204sm1701937lfe.73.2017.10.16.15.53.31 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 15:53:33 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Bryan Drewery" Subject: Re: svn commit: r324673 - head/sys/kern References: <201710162146.v9GLkB6t036842@repo.freebsd.org> <5305175e-e8d2-453d-9ba6-0281af1582a9@FreeBSD.org> Date: Tue, 17 Oct 2017 01:50:54 +0300 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <5305175e-e8d2-453d-9ba6-0281af1582a9@FreeBSD.org> User-Agent: Opera Mail/12.15 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 22:53:37 -0000 Tue, 17 Oct 2017 00:53:28 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Bryan Drewery = : > On 10/16/2017 2:46 PM, Andriy Voskoboinyk wrote: >> Author: avos >> Date: Mon Oct 16 21:46:11 2017 >> New Revision: 324673 >> URL: https://svnweb.freebsd.org/changeset/base/324673 >> >> Log: >> mbuf(9): unbreak m_fragment() > > How was it broken Due to m_cat() usage reason (as described below); this part was not changed since function creation in r119644. > and since when? No idea here - probably, it was partially working until m_cat() improvement in r242256. P.S. Just checked with m_fragment(m, M_NOWAIT, -2) placed right before ieee80211_mbuf_defrag() (from D4077) and various m_len printf's before and after - it defragments frames before this change and works as intended after it. > >> >> - Fix it by replacing m_cat() with m_prev->m_next =3D m_new >> (m_cat() will try to append data - as a result, there will be no >> fragmentation). >> - Move some constants out of the loop. >> >> Was previously tested with D4077. >> >> Differential Revision: https://reviews.freebsd.org/D4090 > From owner-svn-src-head@freebsd.org Mon Oct 16 23:28:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9288E48606; Mon, 16 Oct 2017 23:28:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7707772017; Mon, 16 Oct 2017 23:28:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9GNSCiq001098; Mon, 16 Oct 2017 23:28:12 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9GNSCdf001096; Mon, 16 Oct 2017 23:28:12 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201710162328.v9GNSCdf001096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 16 Oct 2017 23:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324676 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 324676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 23:28:13 -0000 Author: rmacklem Date: Mon Oct 16 23:28:12 2017 New Revision: 324676 URL: https://svnweb.freebsd.org/changeset/base/324676 Log: Use taskqueue(9) to do writes/commits to mirrored DSs concurrently. When the NFSv4.1 pNFS client is using a Flexible File Layout specifying mirrored Data Servers, it must do the writes and commits to all mirrors. This patch modifies the client to use a taskqueue to perform these writes and commits concurrently. The number of threads can't be changed for taskqueue(9), so it is set to 4 * mp_ncpus by default, but this can be overridden by setting the sysctl vfs.nfs.pnfsiothreads. Differential Revision: https://reviews.freebsd.org/D12632 Modified: head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Mon Oct 16 21:55:31 2017 (r324675) +++ head/sys/fs/nfs/nfs_commonport.c Mon Oct 16 23:28:12 2017 (r324676) @@ -40,7 +40,9 @@ __FBSDID("$FreeBSD$"); * to this BSD variant. */ #include +#include #include +#include #include #include #include @@ -68,6 +70,8 @@ int nfsrv_lughashsize = 100; void (*nfsd_call_servertimer)(void) = NULL; void (*ncl_call_invalcaches)(struct vnode *) = NULL; +int nfs_pnfsio(task_fn_t *, void *); + static int nfs_realign_test; static int nfs_realign_count; static struct ext_nfsstats oldnfsstats; @@ -84,6 +88,9 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, debuglevel, CTLFLAG_RW, 0, "Debug level for NFS client"); SYSCTL_INT(_vfs_nfs, OID_AUTO, userhashsize, CTLFLAG_RDTUN, &nfsrv_lughashsize, 0, "Size of hash tables for uid/name mapping"); +int nfs_pnfsiothreads = 0; +SYSCTL_INT(_vfs_nfs, OID_AUTO, pnfsiothreads, CTLFLAG_RW, &nfs_pnfsiothreads, + 0, "Number of pNFS mirror I/O threads"); /* * Defines for malloc @@ -689,6 +696,50 @@ nfs_supportsnfsv4acls(struct vnode *vp) if (error == 0 && retval != 0) return (1); return (0); +} + +/* + * These are the first fields of all the context structures passed into + * nfs_pnfsio(). + */ +struct pnfsio { + int done; + int inprog; + struct task tsk; +}; + +/* + * Do a mirror I/O on a pNFS thread. + */ +int +nfs_pnfsio(task_fn_t *func, void *context) +{ + struct pnfsio *pio; + int ret; + static struct taskqueue *pnfsioq = NULL; + + pio = (struct pnfsio *)context; + if (pnfsioq == NULL) { + if (nfs_pnfsiothreads == 0) + nfs_pnfsiothreads = mp_ncpus * 4; + pnfsioq = taskqueue_create("pnfsioq", M_WAITOK, + taskqueue_thread_enqueue, &pnfsioq); + if (pnfsioq == NULL) + return (ENOMEM); + ret = taskqueue_start_threads(&pnfsioq, nfs_pnfsiothreads, + 0, "pnfsiot"); + if (ret != 0) { + taskqueue_free(pnfsioq); + pnfsioq = NULL; + return (ret); + } + } + pio->inprog = 1; + TASK_INIT(&pio->tsk, 0, func, context); + ret = taskqueue_enqueue(pnfsioq, &pio->tsk); + if (ret != 0) + pio->inprog = 0; + return (ret); } extern int (*nfsd_call_nfscommon)(struct thread *, struct nfssvc_args *); Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Mon Oct 16 21:55:31 2017 (r324675) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Mon Oct 16 23:28:12 2017 (r324676) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include SYSCTL_DECL(_vfs_nfs); @@ -64,6 +65,7 @@ extern nfstype nfsv34_type[9]; extern int nfsrv_useacl; extern char nfsv4_callbackaddr[INET6_ADDRSTRLEN]; extern int nfscl_debuglevel; +extern int nfs_pnfsiothreads; NFSCLSTATEMUTEX; int nfstest_outofseq = 0; int nfscl_assumeposixlocks = 1; @@ -87,6 +89,30 @@ enum nfsclds_state { NFSDSP_NOTFOUND = 2, }; +/* + * Do a write RPC on a DS data file, using this structure for the arguments, + * so that this function can be executed by a separate kernel process. + */ +struct nfsclwritedsdorpc { + int done; + int inprog; + struct task tsk; + struct vnode *vp; + int iomode; + int must_commit; + nfsv4stateid_t *stateidp; + struct nfsclds *dsp; + uint64_t off; + int len; + struct nfsfh *fhp; + struct mbuf *m; + int vers; + int minorvers; + struct ucred *cred; + NFSPROC_T *p; + int err; +}; + static int nfsrpc_setattrrpc(vnode_t , struct vattr *, nfsv4stateid_t *, struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *); static int nfsrpc_readrpc(vnode_t , struct uio *, struct ucred *, @@ -119,7 +145,7 @@ static int nfscl_doflayoutio(vnode_t, struct uio *, in static int nfscl_dofflayoutio(vnode_t, struct uio *, int *, int *, int *, nfsv4stateid_t *, int, struct nfscldevinfo *, struct nfscllayout *, struct nfsclflayout *, uint64_t, uint64_t, int, int, struct mbuf *, - struct ucred *, NFSPROC_T *); + struct nfsclwritedsdorpc *, struct ucred *, NFSPROC_T *); static struct mbuf *nfsm_copym(struct mbuf *, int, int); static int nfsrpc_readds(vnode_t, struct uio *, nfsv4stateid_t *, int *, struct nfsclds *, uint64_t, int, struct nfsfh *, int, int, int, @@ -127,11 +153,17 @@ static int nfsrpc_readds(vnode_t, struct uio *, nfsv4s static int nfsrpc_writeds(vnode_t, struct uio *, int *, int *, nfsv4stateid_t *, struct nfsclds *, uint64_t, int, struct nfsfh *, int, int, int, int, struct ucred *, NFSPROC_T *); +static int nfsio_writedsmir(vnode_t, int *, int *, nfsv4stateid_t *, + struct nfsclds *, uint64_t, int, struct nfsfh *, struct mbuf *, int, int, + struct nfsclwritedsdorpc *, struct ucred *, NFSPROC_T *); static int nfsrpc_writedsmir(vnode_t, int *, int *, nfsv4stateid_t *, struct nfsclds *, uint64_t, int, struct nfsfh *, struct mbuf *, int, int, struct ucred *, NFSPROC_T *); static enum nfsclds_state nfscl_getsameserver(struct nfsmount *, struct nfsclds *, struct nfsclds **); +static int nfsio_commitds(vnode_t, uint64_t, int, struct nfsclds *, + struct nfsfh *, int, int, struct nfsclwritedsdorpc *, struct ucred *, + NFSPROC_T *); static int nfsrpc_commitds(vnode_t, uint64_t, int, struct nfsclds *, struct nfsfh *, int, int, struct ucred *, NFSPROC_T *); static void nfsrv_setuplayoutget(struct nfsrv_descript *, int, uint64_t, @@ -163,6 +195,8 @@ static int nfsrpc_layoutgetres(struct nfsmount *, vnod int, nfsv4stateid_t *, int, uint32_t *, struct nfscllayout **, struct nfsclflayouthead *, int, int, int *, struct ucred *, NFSPROC_T *); +int nfs_pnfsio(task_fn_t *, void *); + /* * nfs null call from vfs. */ @@ -5544,10 +5578,11 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode struct nfscldevinfo *dip; struct nfsclflayout *rflp; struct mbuf *m; + struct nfsclwritedsdorpc *drpc, *tdrpc; nfsv4stateid_t stateid; struct ucred *newcred; uint64_t lastbyte, len, off, oresid, xfer; - int eof, error, firstmirror, i, iolaymode, mirrorcnt, recalled; + int eof, error, firstmirror, i, iolaymode, mirrorcnt, recalled, timo; void *lckp; uint8_t *dev; void *iovbase; @@ -5627,6 +5662,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode * do all mirrors. */ m = NULL; + drpc = NULL; firstmirror = 0; mirrorcnt = 1; if ((layp->nfsly_flags & NFSLY_FLEXFILE) != 0 && @@ -5634,17 +5670,24 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode if (rwaccess == NFSV4OPEN_ACCESSREAD) { firstmirror = arc4random() % mirrorcnt; mirrorcnt = firstmirror + 1; - } else if (docommit == 0) { - /* - * Save values, so uiop can be rolled - * back upon a write error. - */ - offs = uiop->uio_offset; - resid = uiop->uio_resid; - iovbase = uiop->uio_iov->iov_base; - iovlen = uiop->uio_iov->iov_len; - m = nfsm_uiombuflist(uiop, len, NULL, - NULL); + } else { + if (docommit == 0) { + /* + * Save values, so uiop can be + * rolled back upon a write + * error. + */ + offs = uiop->uio_offset; + resid = uiop->uio_resid; + iovbase = + uiop->uio_iov->iov_base; + iovlen = uiop->uio_iov->iov_len; + m = nfsm_uiombuflist(uiop, len, + NULL, NULL); + } + tdrpc = drpc = malloc(sizeof(*drpc) * + (mirrorcnt - 1), M_TEMP, M_WAITOK | + M_ZERO); } } for (i = firstmirror; i < mirrorcnt && error == 0; i++){ @@ -5661,8 +5704,8 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode uiop, iomode, must_commit, &eof, &stateid, rwaccess, dip, layp, rflp, off, xfer, - i, docommit, m, newcred, - p); + i, docommit, m, tdrpc, + newcred, p); else error = nfscl_doflayoutio(vp, uiop, iomode, must_commit, @@ -5672,9 +5715,27 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode nfscl_reldevinfo(dip); } else error = EIO; + tdrpc++; } if (m != NULL) m_freem(m); + tdrpc = drpc; + timo = hz / 50; /* Wait for 20msec. */ + if (timo < 1) + timo = 1; + for (i = firstmirror; i < mirrorcnt - 1 && + tdrpc != NULL; i++, tdrpc++) { + /* + * For the unused drpc entries, both inprog and + * err == 0, so this loop won't break. + */ + while (tdrpc->inprog != 0 && tdrpc->done == 0) + tsleep(&tdrpc->tsk, PVFS, "clrpcio", + timo); + if (error == 0 && tdrpc->err != 0) + error = tdrpc->err; + } + free(drpc, M_TEMP); if (error == 0) { if (mirrorcnt > 1 && rwaccess == NFSV4OPEN_ACCESSWRITE && docommit == 0) { @@ -5898,8 +5959,8 @@ static int nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, int *eofp, nfsv4stateid_t *stateidp, int rwflag, struct nfscldevinfo *dp, struct nfscllayout *lyp, struct nfsclflayout *flp, uint64_t off, - uint64_t len, int mirror, int docommit, struct mbuf *mp, struct ucred *cred, - NFSPROC_T *p) + uint64_t len, int mirror, int docommit, struct mbuf *mp, + struct nfsclwritedsdorpc *drpc, struct ucred *cred, NFSPROC_T *p) { uint64_t transfer, xfer; int error, rel_off; @@ -5940,13 +6001,23 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * else xfer = len; if (docommit != 0) { - if (error == 0) - error = nfsrpc_commitds(vp, off, xfer, *dspp, - fhp, dp->nfsdi_vers, dp->nfsdi_minorvers, - tcred, p); - NFSCL_DEBUG(4, "aft nfsrpc_commitds=%d\n", error); if (error == 0) { /* + * Do last mirrored DS commit with this thread. + */ + if (mirror < flp->nfsfl_mirrorcnt - 1) + error = nfsio_commitds(vp, off, xfer, + *dspp, fhp, dp->nfsdi_vers, + dp->nfsdi_minorvers, drpc, tcred, + p); + else + error = nfsrpc_commitds(vp, off, xfer, + *dspp, fhp, dp->nfsdi_vers, + dp->nfsdi_minorvers, tcred, p); + } + NFSCL_DEBUG(4, "aft nfsio_commitds=%d\n", error); + if (error == 0) { + /* * Set both eof and uio_resid = 0 to end any * loops. */ @@ -5976,11 +6047,22 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * m = nfsm_copym(mp, rel_off, xfer); NFSCL_DEBUG(4, "mcopy reloff=%d xfer=%jd\n", rel_off, (uintmax_t)xfer); - error = nfsrpc_writedsmir(vp, iomode, - must_commit, stateidp, *dspp, off, xfer, - fhp, m, dp->nfsdi_vers, dp->nfsdi_minorvers, - tcred, p); - NFSCL_DEBUG(4, "nfsrpc_writedsmir=%d\n", error); + /* + * Do last write to a mirrored DS with this + * thread. + */ + if (mirror < flp->nfsfl_mirrorcnt - 1) + error = nfsio_writedsmir(vp, iomode, + must_commit, stateidp, *dspp, off, + xfer, fhp, m, dp->nfsdi_vers, + dp->nfsdi_minorvers, drpc, tcred, + p); + else + error = nfsrpc_writedsmir(vp, iomode, + must_commit, stateidp, *dspp, off, + xfer, fhp, m, dp->nfsdi_vers, + dp->nfsdi_minorvers, tcred, p); + NFSCL_DEBUG(4, "nfsio_writedsmir=%d\n", error); } } NFSCL_DEBUG(4, "aft read/writeds=%d\n", error); @@ -6307,6 +6389,62 @@ nfsmout: } /* + * Start up the thread that will execute nfsrpc_writedsmir(). + */ +static void +start_writedsmir(void *arg, int pending) +{ + struct nfsclwritedsdorpc *drpc; + + drpc = (struct nfsclwritedsdorpc *)arg; + drpc->err = nfsrpc_writedsmir(drpc->vp, &drpc->iomode, + &drpc->must_commit, drpc->stateidp, drpc->dsp, drpc->off, drpc->len, + drpc->fhp, drpc->m, drpc->vers, drpc->minorvers, drpc->cred, + drpc->p); + drpc->done = 1; + NFSCL_DEBUG(4, "start_writedsmir: err=%d\n", drpc->err); +} + +/* + * Set up the write DS mirror call for the pNFS I/O thread. + */ +static int +nfsio_writedsmir(vnode_t vp, int *iomode, int *must_commit, + nfsv4stateid_t *stateidp, struct nfsclds *dsp, uint64_t off, int len, + struct nfsfh *fhp, struct mbuf *m, int vers, int minorvers, + struct nfsclwritedsdorpc *drpc, struct ucred *cred, NFSPROC_T *p) +{ + int error, ret; + + error = 0; + drpc->done = 0; + drpc->vp = vp; + drpc->iomode = *iomode; + drpc->must_commit = *must_commit; + drpc->stateidp = stateidp; + drpc->dsp = dsp; + drpc->off = off; + drpc->len = len; + drpc->fhp = fhp; + drpc->m = m; + drpc->vers = vers; + drpc->minorvers = minorvers; + drpc->cred = cred; + drpc->p = p; + drpc->inprog = 0; + ret = EIO; + if (nfs_pnfsiothreads > 0) { + ret = nfs_pnfsio(start_writedsmir, drpc); + NFSCL_DEBUG(4, "nfsio_writedsmir: nfs_pnfsio=%d\n", ret); + } + if (ret != 0) + error = nfsrpc_writedsmir(vp, iomode, must_commit, stateidp, + dsp, off, len, fhp, m, vers, minorvers, cred, p); + NFSCL_DEBUG(4, "nfsio_writedsmir: error=%d\n", error); + return (error); +} + +/* * Free up the nfsclds structure. */ void @@ -6432,6 +6570,56 @@ nfsmout: if (error == 0 && nd->nd_repstat != 0) error = nd->nd_repstat; mbuf_freem(nd->nd_mrep); + return (error); +} + +/* + * Start up the thread that will execute nfsrpc_commitds(). + */ +static void +start_commitds(void *arg, int pending) +{ + struct nfsclwritedsdorpc *drpc; + + drpc = (struct nfsclwritedsdorpc *)arg; + drpc->err = nfsrpc_commitds(drpc->vp, drpc->off, drpc->len, + drpc->dsp, drpc->fhp, drpc->vers, drpc->minorvers, drpc->cred, + drpc->p); + drpc->done = 1; + NFSCL_DEBUG(4, "start_commitds: err=%d\n", drpc->err); +} + +/* + * Set up the commit DS mirror call for the pNFS I/O thread. + */ +static int +nfsio_commitds(vnode_t vp, uint64_t offset, int cnt, struct nfsclds *dsp, + struct nfsfh *fhp, int vers, int minorvers, + struct nfsclwritedsdorpc *drpc, struct ucred *cred, NFSPROC_T *p) +{ + int error, ret; + + error = 0; + drpc->done = 0; + drpc->vp = vp; + drpc->off = offset; + drpc->len = cnt; + drpc->dsp = dsp; + drpc->fhp = fhp; + drpc->vers = vers; + drpc->minorvers = minorvers; + drpc->cred = cred; + drpc->p = p; + drpc->inprog = 0; + ret = EIO; + if (nfs_pnfsiothreads > 0) { + ret = nfs_pnfsio(start_commitds, drpc); + NFSCL_DEBUG(4, "nfsio_commitds: nfs_pnfsio=%d\n", ret); + } + if (ret != 0) + error = nfsrpc_commitds(vp, offset, cnt, dsp, fhp, vers, + minorvers, cred, p); + NFSCL_DEBUG(4, "nfsio_commitds: error=%d\n", error); return (error); } From owner-svn-src-head@freebsd.org Tue Oct 17 01:12:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19677E4A32A; Tue, 17 Oct 2017 01:12:19 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7D2474E2F; Tue, 17 Oct 2017 01:12:18 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9H1CHZM046519; Tue, 17 Oct 2017 01:12:17 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9H1CHSX046518; Tue, 17 Oct 2017 01:12:17 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201710170112.v9H1CHSX046518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 17 Oct 2017 01:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324680 - head/sys/gdb X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/gdb X-SVN-Commit-Revision: 324680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 01:12:19 -0000 Author: rlibby Date: Tue Oct 17 01:12:17 2017 New Revision: 324680 URL: https://svnweb.freebsd.org/changeset/base/324680 Log: gdb kernel server: fixup Search:memory style This is a NFC patch to move around the Search:memory implementation so that it doesn't exceed the standard column width and doesn't take so much vertical space in gdb_trap. Submitted by: Daniel O'Connor Reviewed by: cem, jhb Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12684 Modified: head/sys/gdb/gdb_main.c Modified: head/sys/gdb/gdb_main.c ============================================================================== --- head/sys/gdb/gdb_main.c Tue Oct 17 00:25:44 2017 (r324679) +++ head/sys/gdb/gdb_main.c Tue Oct 17 01:12:17 2017 (r324680) @@ -94,6 +94,33 @@ gdb_init(void) return (cur_pri); } +static void +gdb_do_mem_search(void) +{ + size_t patlen; + intmax_t addr, size; + const unsigned char *found; + + if (gdb_rx_varhex(&addr) || gdb_rx_char() != ';' || + gdb_rx_varhex(&size) || gdb_rx_char() != ';' || + gdb_rx_bindata(gdb_bindata, sizeof(gdb_bindata), &patlen)) { + gdb_tx_err(EINVAL); + return; + } + if (gdb_search_mem((char *)(uintptr_t)addr, size, gdb_bindata, + patlen, &found)) { + if (found == 0ULL) + gdb_tx_begin('0'); + else { + gdb_tx_begin('1'); + gdb_tx_char(','); + gdb_tx_hex((intmax_t)(uintptr_t)found, 8); + } + gdb_tx_end(); + } else + gdb_tx_err(EIO); +} + static int gdb_trap(int type, int code) { @@ -257,27 +284,7 @@ gdb_trap(int type, int code) gdb_tx_end(); } } else if (gdb_rx_equal("Search:memory:")) { - size_t patlen; - intmax_t addr, size; - const unsigned char *found; - if (gdb_rx_varhex(&addr) || gdb_rx_char() != ';' || - gdb_rx_varhex(&size) || gdb_rx_char() != ';' || - gdb_rx_bindata(gdb_bindata, sizeof(gdb_bindata), &patlen)) { - gdb_tx_err(EINVAL); - break; - } - if (gdb_search_mem((char *)(uintptr_t)addr, size, gdb_bindata, patlen, &found)) { - if (found == 0ULL) - gdb_tx_begin('0'); - else { - gdb_tx_begin('1'); - gdb_tx_char(','); - gdb_tx_hex((intmax_t)(uintptr_t)found, 8); - } - gdb_tx_end(); - } else - gdb_tx_err(EIO); - break; + gdb_do_mem_search(); } else if (!gdb_cpu_query()) gdb_tx_empty(); break; From owner-svn-src-head@freebsd.org Tue Oct 17 01:15:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC2A6E4A79E; Tue, 17 Oct 2017 01:15:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B99B375201; Tue, 17 Oct 2017 01:15:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9H1FDu6046663; Tue, 17 Oct 2017 01:15:13 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9H1FDbU046661; Tue, 17 Oct 2017 01:15:13 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710170115.v9H1FDbU046661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 17 Oct 2017 01:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324681 - in head/etc: defaults periodic/daily X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/etc: defaults periodic/daily X-SVN-Commit-Revision: 324681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 01:15:15 -0000 Author: cy Date: Tue Oct 17 01:15:13 2017 New Revision: 324681 URL: https://svnweb.freebsd.org/changeset/base/324681 Log: Provide an option to run the anticongestion ntpd leapfile fetch in the background. Original patch submitted by feld@. I added the "optional" bit. Submitted by: feld (original patch) MFC after: 2 weeks Modified: head/etc/defaults/periodic.conf head/etc/periodic/daily/480.leapfile-ntpd Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Tue Oct 17 01:12:17 2017 (r324680) +++ head/etc/defaults/periodic.conf Tue Oct 17 01:15:13 2017 (r324681) @@ -141,6 +141,8 @@ daily_status_mail_rejects_shorten="NO" # Shorten out # 480.leapfile-ntpd daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile +daily_ntpd_leapfile_background="NO" # Fetch NTP leapfile + # in the background # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status Modified: head/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- head/etc/periodic/daily/480.leapfile-ntpd Tue Oct 17 01:12:17 2017 (r324680) +++ head/etc/periodic/daily/480.leapfile-ntpd Tue Oct 17 01:15:13 2017 (r324681) @@ -13,8 +13,15 @@ fi case "$daily_ntpd_leapfile_enable" in [Yy][Ee][Ss]) - anticongestion - service ntpd onefetch + case "$daily_ntpd_leapfile_background" in + [Yy][Ee][Ss]) + (anticongestion && service ntpd onefetch) & + ;; + *) + anticongestion + service ntpd onefetch + ;; + esac ;; esac From owner-svn-src-head@freebsd.org Tue Oct 17 01:15:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 817C0E4A911; Tue, 17 Oct 2017 01:15:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C67675402; Tue, 17 Oct 2017 01:15:56 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9H1FtpT046724; Tue, 17 Oct 2017 01:15:55 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9H1FtBg046723; Tue, 17 Oct 2017 01:15:55 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710170115.v9H1FtBg046723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 17 Oct 2017 01:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324682 - head/etc/periodic/daily X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/etc/periodic/daily X-SVN-Commit-Revision: 324682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 01:15:56 -0000 Author: cy Date: Tue Oct 17 01:15:55 2017 New Revision: 324682 URL: https://svnweb.freebsd.org/changeset/base/324682 Log: Style. Replace 8 spaces with a tab. MFC after: 2 weeks (with prior commit to this file) Modified: head/etc/periodic/daily/480.leapfile-ntpd Modified: head/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- head/etc/periodic/daily/480.leapfile-ntpd Tue Oct 17 01:15:13 2017 (r324681) +++ head/etc/periodic/daily/480.leapfile-ntpd Tue Oct 17 01:15:55 2017 (r324682) @@ -22,7 +22,7 @@ case "$daily_ntpd_leapfile_enable" in service ntpd onefetch ;; esac - ;; + ;; esac exit $rc From owner-svn-src-head@freebsd.org Tue Oct 17 02:51:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F05A0E27F34; Tue, 17 Oct 2017 02:51:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDB047E0E6; Tue, 17 Oct 2017 02:51:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9H2pj7l086346; Tue, 17 Oct 2017 02:51:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9H2pjVP086345; Tue, 17 Oct 2017 02:51:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710170251.v9H2pjVP086345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 17 Oct 2017 02:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324683 - in head/lib: libc/sys libstand X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/lib: libc/sys libstand X-SVN-Commit-Revision: 324683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 02:51:47 -0000 Author: emaste Date: Tue Oct 17 02:51:45 2017 New Revision: 324683 URL: https://svnweb.freebsd.org/changeset/base/324683 Log: write.2: correct maximum nbytes size for EINVAL error In FreeBSD 11 and later debug.iosize_max_clamp defaults to 0, and the maximum nbytes count for write(2) is SSIZE_MAX. Update the man page to document this, and mention the sysctl that can be set to obtain the previous behaviour. PR: 196666 MFC after: 1 week Sponsored by: The FreeBSD Foundation Added: head/lib/libstand/ - copied from r324627, head/lib/libstand/ Modified: head/lib/libc/sys/write.2 Modified: head/lib/libc/sys/write.2 ============================================================================== --- head/lib/libc/sys/write.2 Tue Oct 17 01:15:55 2017 (r324682) +++ head/lib/libc/sys/write.2 Tue Oct 17 02:51:45 2017 (r324683) @@ -28,7 +28,7 @@ .\" @(#)write.2 8.5 (Berkeley) 4/2/94 .\" $FreeBSD$ .\" -.Dd December 15, 2015 +.Dd October 16, 2017 .Dt WRITE 2 .Os .Sh NAME @@ -199,7 +199,12 @@ to enable writing on the disk label area. The value .Fa nbytes is greater than -.Dv INT_MAX . +.Dv SSIZE_MAX +(or greater than +.Dv INT_MAX , +if the sysctl +.Va debug.iosize_max_clamp +is non-zero). .El .Pp In addition, From owner-svn-src-head@freebsd.org Tue Oct 17 02:53:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1385E280E8; Tue, 17 Oct 2017 02:53:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9701B7E34E; Tue, 17 Oct 2017 02:53:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9H2rgZP087992; Tue, 17 Oct 2017 02:53:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9H2rgfc087991; Tue, 17 Oct 2017 02:53:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710170253.v9H2rgfc087991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 17 Oct 2017 02:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324684 - head/lib/libstand X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libstand X-SVN-Commit-Revision: 324684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 02:53:44 -0000 Author: emaste Date: Tue Oct 17 02:53:42 2017 New Revision: 324684 URL: https://svnweb.freebsd.org/changeset/base/324684 Log: Remove lib/libstand again, accidentally readded in r324683 Deleted: head/lib/libstand/ From owner-svn-src-head@freebsd.org Tue Oct 17 07:41:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB8E7E317C6; Tue, 17 Oct 2017 07:41:55 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C6F63539; Tue, 17 Oct 2017 07:41:55 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1235) id 95CB991B5; Tue, 17 Oct 2017 07:41:54 +0000 (UTC) Date: Tue, 17 Oct 2017 09:41:54 +0200 From: Baptiste Daroussin To: Andriy Voskoboinyk Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324656 - head/lib/libifconfig Message-ID: <20171017074154.uddsdinnjp34fit7@ivaldir.net> References: <201710160654.v9G6sQmA062311@repo.freebsd.org> <20171016082919.fyp2uiui7hzarrs2@ivaldir.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ued5h55jtgazxyip" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170912 (1.9.0) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 07:41:55 -0000 --ued5h55jtgazxyip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 16, 2017 at 07:58:55PM +0000, Andriy Voskoboinyk wrote: > > On Mon, Oct 16, 2017 at 06:54:26AM +0000, Andriy Voskoboinyk wrote: > > > Author: avos > > > Date: Mon Oct 16 06:54:26 2017 > > > New Revision: 324656 > > > URL: https://svnweb.freebsd.org/changeset/base/324656 > > >=20 > > > Log: > > > libifconfig: allow to get original interface name via > > > ifconfig_get_orig_name() > > >=20 > > > Uses the same method as in tools/tools/ifinfo/ifinfo.c > > > (via net.link.generic sysctl). > > >=20 > > > Tested with modified wlandebug(8). > > >=20 > > > Differential Revision: https://reviews.freebsd.org/D12554 > > >=20 > > > Modified: > > > head/lib/libifconfig/libifconfig.c > > > head/lib/libifconfig/libifconfig.h > > >=20 > > > Modified: head/lib/libifconfig/libifconfig.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/lib/libifconfig/libifconfig.c Mon Oct 16 04:46:28 > > > 2017 (r324655) > > > +++ head/lib/libifconfig/libifconfig.c Mon Oct 16 06:54:26 > > > 2017 (r324656) > > > @@ -61,9 +61,43 @@ > > > * $FreeBSD$ > > > */ > > >=20 > > > + /* > > > + * Copyright 1996 Massachusetts Institute of Technology > > > + * > > 1996? > >=20 > > This file was already under a BSD license, why adding an extra MIT > > license to > > it? It would be better to keep it under BSD license imho >=20 > This one came unchanged from tools/tools/ifinfo/ifinfo.c (with > modified code from it); I'm not sure if it can be just omitted. Ah ok, it wan't clear for me :) Make sense in this case imho, sorry for the noise Bapt --ued5h55jtgazxyip Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlnltD8ACgkQY4mL3PG3 PlokSA/8C/Xm6PTRSf/lQUBCKWHNBBBsILKmyEHUfXKY/ZxSyFBo+R3CWFcOZORJ BQOu7YR9eYfAtVqolcUkIfaklwFPc3LXpaSD6VTtYouiEFHMQQEjhqtfYJH21Lpj 4Qt2KUZLvSLPrGXuDMmXYj39KwSA/e95xt8834LEQa+BaCTp9p/o033PaObw6Ab0 YUJmQhLUB8p0f86iz+3qKpXcyFSknKcqt3tQAwid/b88m9p0CMwZJSnHemw8ruvG XdVZEVddIxmxlDhPgBJ+pngSJg7AI22QzdEIr5H0p90FtQPVHjA9ievHi8ZAF0DC 4QqHYhbufGpjjq/lu31Sl4crr49d2MvRD6HKwQkB64j7ctIvAx3i92GLPkC3SYOW XPziR87sPk8BGqEgc7AJgo60wI7LenkaBAcO/0vPut6gctsISMvat7ma4nuEMx6g 7Pk593KS67lnCJk0efIHIeKet/AKqHSMPfnWF/twhnSMods29Hx0lMp1O96mBuH7 nd9wZPqFzDyNL/4LOv4XjKwEJUfMBPwH2a7O4lZFDPogRWR0vZ3Zq8jQPu80elIl IkLFrUVRMQ0wjn5eESme9CWc6gCoWqOMUGLfDHM9TlB6apNvdeJ6Xb7Ju9ZbsKGf bz+lVm8aD2X3dR/yqWtx7wP+D1BVCPAZk/qNjSa6VxoEGVHPj+w= =xivt -----END PGP SIGNATURE----- --ued5h55jtgazxyip-- From owner-svn-src-head@freebsd.org Tue Oct 17 14:37:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9B1FE3BC4B; Tue, 17 Oct 2017 14:37:13 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7B846F0E1; Tue, 17 Oct 2017 14:37:13 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HEbCqU076870; Tue, 17 Oct 2017 14:37:12 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HEbCix076869; Tue, 17 Oct 2017 14:37:12 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201710171437.v9HEbCix076869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Tue, 17 Oct 2017 14:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324688 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: maxim X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 14:37:14 -0000 Author: maxim Date: Tue Oct 17 14:37:12 2017 New Revision: 324688 URL: https://svnweb.freebsd.org/changeset/base/324688 Log: DragonFly 5.0.0 release added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Oct 17 12:45:51 2017 (r324687) +++ head/share/misc/bsd-family-tree Tue Oct 17 14:37:12 2017 (r324688) @@ -356,7 +356,7 @@ FreeBSD 5.2 | | | | FreeBSD | | | | | | 11.1 FreeBSD | | | | | | 10.4 | | OpenBSD 6.2 | - | v | | | | + | v | | | DragonFly 5.0.0 | | | | | FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -720,6 +720,7 @@ FreeBSD 11.1 2017-07-26 [FBD] macOS 10.13 2017-09-25 [APL] FreeBSD 10.4 2017-10-03 [FBD] OpenBSD 6.2 2017-10-09 [OBD] +DragonFly 5.0.0 2017-10-16 [DFB] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Tue Oct 17 14:48:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59107E3C2B6; Tue, 17 Oct 2017 14:48:09 +0000 (UTC) (envelope-from agh@fastmail.fm) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27F7B6F830; Tue, 17 Oct 2017 14:48:08 +0000 (UTC) (envelope-from agh@fastmail.fm) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B5D6320548; Tue, 17 Oct 2017 10:48:01 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Tue, 17 Oct 2017 10:48:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=IxB89hXuRY6CxYxuKzBo6QckRtGlTt76CRTZkJMPjTw=; b=wDVsFiIF hfFCpEJWGZR2J9hKdD/eBuyKJMPzazCHG+D1y4E6yXvqOkJWakuMv1gwGr4Gey2H GmGuKabt4n3liBVA0w9iXMr8wI4EKG96vE1znvAYTdAeh3oDGWJryDKcucbsfWUp mHIaNlbMvra2vbZz4mDVGmaTWqBbKra9OpzBIiShPfu0MZXZIXW4xTLkdHBacwXE rict1dh1NpsUALIW7X6IJGKKe3o8kx6a/3iTg3H9ZKJ+QvXDIvjYzWnQQSRfd7oj Z26n6pmgWy937oDHpZJawQV1Ls7DcwONBE6Y8qjh8M27KG814qRp05Jd+TOXqAeY j6g2aiZxnaqxVA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=IxB89hXuRY6CxYxuKzBo6QckRtGlT t76CRTZkJMPjTw=; b=BLFskJSoijeJNEW+hFRe+Zv7LrXoPZMXE0UD6Xn0XdVd6 AirOLP9U/wABLszZFyNQ4i9yvnB82uE5S8DyVfmIiicX2MN7huJ7KFDFn54qI+bE oIqJswhyjQARcozNpNxsTx7JV6r1T2mdyEkPSich7OQaYQ0gGvDqik3SJ7g6Xkzz e8mTCgVMSuwtBuWhDP0izwCcSgHrMxmEuA9ZDT1BcIjnuHsM+BYmaGnn5t8H23zJ M1usQS9tIBUJJCiLIjzfKSV9YlJCLrwQhgpALARVSmk6UqEwiwtpVSyjl7tjuetk k6OrE9CHaJVvEwadfVO3K8KmYdj8asJI5J/1NQv0g== X-ME-Sender: Received: from localhost (c-59-101-49-202.hay.connect.net.au [59.101.49.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 2DEEA24640; Tue, 17 Oct 2017 10:48:01 -0400 (EDT) From: Alastair Hogge To: svn-src-head@freebsd.org Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r324646 - in head/sys/boot/efi: boot1 libefi loader Date: Tue, 17 Oct 2017 22:47:38 +0800 Message-ID: <33612616.yJGDVEA9hj@direwolf.local.> User-Agent: KMail/4.14.10 (FreeBSD/12.0-CURRENT; KDE/4.14.30; amd64; ; ) In-Reply-To: <201710160359.v9G3xCCi087576@repo.freebsd.org> References: <201710160359.v9G3xCCi087576@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1857889.Am0gho80aa"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 14:48:09 -0000 --nextPart1857889.Am0gho80aa Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Mon, 16 Oct 2017-10-16 03:59:12 Warner Losh wrote: > Author: imp > Date: Mon Oct 16 03:59:11 2017 > New Revision: 324646 > URL: https://svnweb.freebsd.org/changeset/base/324646 >=20 > Log: > Unify boot1 with loader >=20 > Refactor boot1 to use the same I/O code as /boot/loader uses. Refac= tor > to use the common efi_main.c. >=20 > Submitted by: Eric McCorkle > Differential Revision: https://reviews.freebsd.org/D10447 >=20 Hi Warner & Eric, thanks for the top stuff, however, I think at least o= ne ZFS compile time option was missed: cc -target x86_64-unknown-freebsd12.0 --sysroot=3D/tmp/direwolf/usr/src= /tmp -B/tmp/direwolf/usr/src/tmp/usr/bin -O2 -pipe -ffreestanding -Wfo= rmat -mno-mmx -mno-sse -mno-avx -msoft-float -fshort-wchar -mno-red-zon= e -mno-aes -march=3Dbd ver2 -DLOADER_UFS_SUPPORT -DLOADER_DISK_SUPPORT -DLOADER_GPT_SUPPORT -= DLOADER_MBR_SUPPORT -DLOADER_GELI_SUPPORT -I/usr/src/sys/boot/libsa -I/= usr/src/sys/boot/common -I. -I/usr/src/sys/boot/efi/boot1/../include -I= /usr/src/sys/boot/ efi/boot1/../include/amd64 -I/usr/src/sys/boot/efi/boot1/../../../contr= ib/dev/acpica/include -I/usr/src/sys/boot/efi/boot1/../../.. -DEFI_UFS_= BOOT -I/usr/src/sys/boot/efi/boot1/../../common -fPIC -ffreestanding -W= format -mno-mmx -m no-sse -mno-avx -msoft-float -fshort-wchar -mno-red-zone -mno-aes -MD = =2DMF.depend.boot1.o -MTboot1.o -std=3Dgnu99 -Wsystem-headers -Werror -Wa= ll -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissi= ng-prototypes -Wpoin ter-arith -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-str= ing-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-= unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-c= onversion -Wno-unu sed-local-typedef -Wno-address-of-packed-member -Wno-format -Qunused-ar= guments -c /usr/src/sys/boot/efi/boot1/boot1.c -o boot1.o = = =20 /usr/src/sys/boot/efi/boot1/boot1.c:269:1: error: no previous prototype= for function 'efi_zfs_is_preferred' [-Werror,-Wmissing-prototypes] = = =20 efi_zfs_is_preferred(EFI_HANDLE *h) > Added: > head/sys/boot/efi/libefi/efi_main.c (contents, props changed) > - copied, changed from r324645, head/sys/boot/efi/loader/efi_mai= n.c > Deleted: > head/sys/boot/efi/boot1/boot_module.h > head/sys/boot/efi/boot1/ufs_module.c > head/sys/boot/efi/boot1/zfs_module.c > head/sys/boot/efi/loader/efi_main.c > Modified: > head/sys/boot/efi/boot1/Makefile > head/sys/boot/efi/boot1/boot1.c > head/sys/boot/efi/libefi/Makefile > head/sys/boot/efi/loader/Makefile [leading diff removed] > -/* > - * devpath_last returns the last non-path end node in devpath. > - */ > -static EFI_DEVICE_PATH * > -devpath_last(EFI_DEVICE_PATH *devpath) > +bool > +efi_zfs_is_preferred(EFI_HANDLE *h) > { > + return (check_preferred(h)); > +} Should this function be conditional on #ifdef EFI_ZFS_BOOT? There could= be others, however, my buildworld has stumbled here for the moment, and I am hitti= ng the horizontal now. To good health =2D-=20 Only fools are quoted. =09=09-- Anonymous --nextPart1857889.Am0gho80aa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEE863ZAMFLT4P9HbjBtzY+5ZChngEFAlnmGAsACgkQtzY+5ZCh ngGk/Qf/eFB+feK9NwQnwwB8yFH9hYsuM0ePdz0FThIgKZ4yRi7WLfJI0CcGhtj+ moxHwEXgCERTZBBmImTP61tGPH2B1Imc+pCthvr8WhHOkrC01wapm5VM/xQhRdlU UcvRUEA2eU0UHc2hDfMSEGoI9T3S8gDh2uqjH5rxlXJL6QiPEc61HjmYQ2g9OVYj 7SFU2q+E+gHEuDARlfUlVN9wCMUUsb3u/Pvo25KR2jukPrlO3ET69sTQ7MZfm7LE udN6pWAcDJNiOq46CKkXoQ1mpZZR4sPqt+v18REsuQnT/r9eKKgu5eLiSNJjTaef 9KPZDadlIEPjdyWK1lgQ6AlM90CJQQ== =X9Ju -----END PGP SIGNATURE----- --nextPart1857889.Am0gho80aa-- From owner-svn-src-head@freebsd.org Tue Oct 17 15:32:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3861AE3D152; Tue, 17 Oct 2017 15:32:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x234.google.com (mail-lf0-x234.google.com [IPv6:2a00:1450:4010:c07::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B04AC70DD2; Tue, 17 Oct 2017 15:32:37 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x234.google.com with SMTP id n69so2492343lfn.2; Tue, 17 Oct 2017 08:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=/FiyDSpd4oc74ZpeqkVSjXv50uIQHYS4OFidTh7H5VY=; b=gytqSsllE8JkRghE53XxMjodg6HaXtpGrkEAsR2jnjlOdLeFFyaUKbFST6av8cXhrV 4gTBv3W9mvR2LAXrFkH3/rY4bRgPbOYM/XlQVf82OrFuv6kk7Ltx7ymCsQCUkGCuoW4O JsuoIKSayjIGL+/3OE/2Q3KPZZtoiRFYhPIOqbX+jQi7x5vNdohX+FyTpQjXLi1hYzqv zWEP+XHfbVlTA3uL05dz262NJS3ywl1P7ylM5k/no4QZqUB80+fT/mLen0N+7r3j4Our /qhAH7eHYOi5tTLvwqbTV/JIOXH/MAIG3WkDFaokH5ke1DLcAyfhD0BtDGXJkYcvh757 0ZTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=/FiyDSpd4oc74ZpeqkVSjXv50uIQHYS4OFidTh7H5VY=; b=VxfFSL5qqedruNmJbr+cqqef+ZNrgNZfxv8Ic8TaJ0L7BmqyhcwUBa8Lt/GV7bn3p7 M2MgPLIuqvxOCJlzF0VF4RSQf1C42Kth2iKUZPDO6VIob6JmdFAtBJpV0z+uTCpiJ9t/ EQbyWTwoiNfzEDAGk+ABrUTE5NHH0IDajHgqEda40Pjf5Sxy4y/70/g+p4H2M0YcQUXr M2WFFi6/kWNBMfpEM/pf+mDkIN8L+YoNZtXqI8+Aq49WXw89ZVLktSao5Oahglb95h90 XtolU/rkF8FoiNfegQ4zqz4+XonZS0hv1d8z+otlb0TXcZ9F63FH9QYH5N4QljC5g47R BkfA== X-Gm-Message-State: AMCzsaX3wGDP7jdlpkWWo/VF3dAzIJc/kcnT+BecO23cZyjChCJEFrEe gnC420Ui+LJsI7d/X8ZF2AteEOLvIJ97zW2VEFo= X-Google-Smtp-Source: ABhQp+Q/ofkqBKTOq8e1G9KPA58U9VtHjGn6tgZvy7jQe83HmUouKMyLC2evYH2agcdwuZiTfLJEpL9lpXsjpgwwFOw= X-Received: by 10.25.87.143 with SMTP id l137mr2619062lfb.193.1508254354963; Tue, 17 Oct 2017 08:32:34 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.93.24 with HTTP; Tue, 17 Oct 2017 08:32:34 -0700 (PDT) In-Reply-To: <201710170115.v9H1FDbU046661@repo.freebsd.org> References: <201710170115.v9H1FDbU046661@repo.freebsd.org> From: Alan Somers Date: Tue, 17 Oct 2017 09:32:34 -0600 X-Google-Sender-Auth: wodR_bJF9S3jWelLnI52yQGLxFY Message-ID: Subject: Re: svn commit: r324681 - in head/etc: defaults periodic/daily To: Cy Schubert Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 15:32:38 -0000 This change defeats the anticongestion mechanism. If daily_ntpd_leapfile_background is set and 480.leapfile-ntpd runs before any other periodic script that uses anticongestion (like /usr/local/etc/periodic/security/410.pkg-audit), then the anticongestion mechanism will effectively be disabled for those later scripts. It's worth asking why you would want to do this in the background anyway. Does the submitter complain that it was too slow? The entire point of anticongestion is to slow it down. If the submitter didn't like that, he could've set anticongestion_sleeptime=0 to disable it entirely. Or was the problem that the "service ntpd onefetch" is too slow, even after the anticongestion timer ran? I doubt it, but if so then you should background just that part instead of backgrounding anticongestion too. -Alan On Mon, Oct 16, 2017 at 7:15 PM, Cy Schubert wrote: > Author: cy > Date: Tue Oct 17 01:15:13 2017 > New Revision: 324681 > URL: https://svnweb.freebsd.org/changeset/base/324681 > > Log: > Provide an option to run the anticongestion ntpd leapfile fetch in > the background. > > Original patch submitted by feld@. I added the "optional" bit. > > Submitted by: feld (original patch) > MFC after: 2 weeks > > Modified: > head/etc/defaults/periodic.conf > head/etc/periodic/daily/480.leapfile-ntpd > > Modified: head/etc/defaults/periodic.conf > ============================================================================== > --- head/etc/defaults/periodic.conf Tue Oct 17 01:12:17 2017 (r324680) > +++ head/etc/defaults/periodic.conf Tue Oct 17 01:15:13 2017 (r324681) > @@ -141,6 +141,8 @@ daily_status_mail_rejects_shorten="NO" # Shorten out > > # 480.leapfile-ntpd > daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile > +daily_ntpd_leapfile_background="NO" # Fetch NTP leapfile > + # in the background > > # 480.status-ntpd > daily_status_ntpd_enable="NO" # Check NTP status > > Modified: head/etc/periodic/daily/480.leapfile-ntpd > ============================================================================== > --- head/etc/periodic/daily/480.leapfile-ntpd Tue Oct 17 01:12:17 2017 (r324680) > +++ head/etc/periodic/daily/480.leapfile-ntpd Tue Oct 17 01:15:13 2017 (r324681) > @@ -13,8 +13,15 @@ fi > > case "$daily_ntpd_leapfile_enable" in > [Yy][Ee][Ss]) > - anticongestion > - service ntpd onefetch > + case "$daily_ntpd_leapfile_background" in > + [Yy][Ee][Ss]) > + (anticongestion && service ntpd onefetch) & > + ;; > + *) > + anticongestion > + service ntpd onefetch > + ;; > + esac > ;; > esac > > From owner-svn-src-head@freebsd.org Tue Oct 17 15:39:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF9EE3D2F4; Tue, 17 Oct 2017 15:39:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA49671100; Tue, 17 Oct 2017 15:39:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HFdc3J002357; Tue, 17 Oct 2017 15:39:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HFdctF002356; Tue, 17 Oct 2017 15:39:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710171539.v9HFdctF002356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 Oct 2017 15:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324689 - head/sys/dev/iscsi X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/iscsi X-SVN-Commit-Revision: 324689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 15:39:40 -0000 Author: avg Date: Tue Oct 17 15:39:38 2017 New Revision: 324689 URL: https://svnweb.freebsd.org/changeset/base/324689 Log: iscsi: do not hold the global lock while tearing down a session It should be sufficient to hold the lock just for removing the session from the session list. Everything else should be covered by the session specific lock. On top of that, at present we can get a deadlock caused by waiting on the CAM SIM reference count while holding the global lock. A specific scenario involving ZFS is this: - concurrent termination of two sessions, S1 and S2 - session S1 completed all I/Os and sleeps in CAM waiting for device close by ZFS; - session S2 is also dead now, but can not forcefully complete outstanding requests by calling iscsi_session_cleanup() from iscsi_maintenance_thread_terminate(), since it can't get the same global sc_lock; - as soon as there are unfinished requests, ZFS can not do spa_config_enter() as writer, and so can not close the device for session S1; - deadlock. Reported by: Ben RUBSON Tested by: Ben RUBSON Reviewed by: mav, trasz MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12652 Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue Oct 17 14:37:12 2017 (r324688) +++ head/sys/dev/iscsi/iscsi.c Tue Oct 17 15:39:38 2017 (r324689) @@ -434,6 +434,8 @@ iscsi_maintenance_thread_terminate(struct iscsi_sessio sc = is->is_softc; sx_xlock(&sc->sc_lock); + TAILQ_REMOVE(&sc->sc_sessions, is, is_next); + sx_xunlock(&sc->sc_lock); icl_conn_close(is->is_conn); callout_drain(&is->is_callout); @@ -465,8 +467,6 @@ iscsi_maintenance_thread_terminate(struct iscsi_sessio #ifdef ICL_KERNEL_PROXY cv_destroy(&is->is_login_cv); #endif - TAILQ_REMOVE(&sc->sc_sessions, is, is_next); - sx_xunlock(&sc->sc_lock); ISCSI_SESSION_DEBUG(is, "terminated"); free(is, M_ISCSI); From owner-svn-src-head@freebsd.org Tue Oct 17 15:40:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48EDBE3D4D1; Tue, 17 Oct 2017 15:40:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x22a.google.com (mail-pg0-x22a.google.com [IPv6:2607:f8b0:400e:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 136F17127B; Tue, 17 Oct 2017 15:40:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x22a.google.com with SMTP id k7so1720552pga.3; Tue, 17 Oct 2017 08:40:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=z/WhPBOA6nKWVsoHtqCLXp44rW3W7PMO1X3DPn52Zco=; b=SMXTgUwBuFVLbA14HpeSahPd1uU1IqTfcIu8wZHmU2tS1bRJA2qLwTrsVuGrPQanC+ OgOyV3v4ANtukPaxFAJFlH8OwU5N3zLJb5YW0mwzoMOnpo1o+MxvIOqBrzpLzPb5ZA4z z0hCfvRg/s3prprxVDUv4RLxHj1UrEPU0IyZaPeqT3GyhO8Wqz4PiRij8kIbrTbWG5j8 XwmzzaFttSNcHSLjBmEhRE5iKMGGQO1Z9kew2Exo7mbqOo1Oi+iiruayuz49F7JAYmYs HNdSpQNwpbmFGN6PoHrtxjWPUkjm7Upj1XP8RIt8+hHrBGuQ1IF/noITSMCQaurhvHgW ENbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=z/WhPBOA6nKWVsoHtqCLXp44rW3W7PMO1X3DPn52Zco=; b=LhRxF/hnLWzIZ7FoR4m1wJTbx+gn0r7/PvVKWZuo265IvJuKpCrP/tW3kUIsxPyCUu s24e8JzvXtj6hzM3x4ShEwlFtQkrcCWObvgMg5eG9YPIV4AErEuAv6yLuS6DExHxNQFf VVhtsY++venCmybqv0r4FM3ZUMDPcQzlj3w7yJ2rkhmYFl7lDQdxOXBQajPL/E/pUT7n TpDjNvz5h2Leji+/XP1yeXFx4jXwbyMEFmHlEX5IoVjpmw3IBTNyFTARCMpZBII3Jx5+ jV6RXelWcQm1XApt6nxsGyft70I+oRg8c8BQQTYN8XhKnNBSzJKcVswBJ/slrRjrUcJ6 I4GQ== X-Gm-Message-State: AMCzsaVTPZk5Y4g8RgOaCacR7FHGOHi5WLsbg3BqQzwZ22dTCHHkzwfB l5Gk+/kG4cQTZtcLLcanYKAtqs84 X-Google-Smtp-Source: AOwi7QC7hKgy5eT3dhiSa/kVZik38VbfKuurqUt0FrHNiAlbbLKCUxOh7OMzsyK8v13NASI4rOEM+Q== X-Received: by 10.99.125.23 with SMTP id y23mr11600290pgc.333.1508254837028; Tue, 17 Oct 2017 08:40:37 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id y84sm20103515pff.158.2017.10.17.08.40.35 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Oct 2017 08:40:36 -0700 (PDT) Subject: Re: svn commit: r324666 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_659A4B67-FD8F-4512-9DEF-3745D384D3A7"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201710161614.v9GGEoUN094644@repo.freebsd.org> Date: Tue, 17 Oct 2017 08:40:35 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <38B2C2B7-0829-444B-8E94-9BB34A88ED47@gmail.com> References: <201710161614.v9GGEoUN094644@repo.freebsd.org> To: Matt Joras X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 15:40:38 -0000 --Apple-Mail=_659A4B67-FD8F-4512-9DEF-3745D384D3A7 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Oct 16, 2017, at 09:14, Matt Joras wrote: > > Author: mjoras > Date: Mon Oct 16 16:14:50 2017 > New Revision: 324666 > URL: https://svnweb.freebsd.org/changeset/base/324666 > > Log: > Properly reset the fields in clean_unrhdr. > > In r324542 I neglected to reset the first and last fields of struct > unrhdr. This causes a tmpfs to fail the unr(9) consistency checks with > DIAGNOSTIC on. Fix this by resetting the fields by calling init_unrhdr. > While here, change a loop to use TAILQ_FOREACH_SAFE since it is more > readable and equally fast. Thanks! --Apple-Mail=_659A4B67-FD8F-4512-9DEF-3745D384D3A7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZ5iRzAAoJEPWDqSZpMIYVEToP/iC+zxlkvWucs1/shEDgwpSN KAU/dh8Ab9mLeW4xZEO7VfL83dz6TS6oywBFYrZebPXKZHKZw3Nc2li0/Nc/SgFO 3H7xj/oR2gL0GvTZp7Pnl3osk/FI85hhWsetm/l4zMv6FjhngRJ8xI50ig1bqwZN MuFviEwzM+UhNw3jzrhe5iNrOPP8J0gJVmsLKNNVTvUTsUXc+D474px+8LjmFY60 wtpsAQWIfrBzUq2ZFVFZFQRJDo5tCZHXF336e8kxsb+1O9UJ/4tnmWn6HftnbSNA xd/SgeAd+aUWOMWJTdoEKgt8NtN1vz7fJchTrp9ZbDwzsHXl5XnaTxJcjd5bHfeo PQT09gCMcOZzAw86HA1OH7o/UeLKNkAvk9Ur8quwew03DMqzxTdIBLQqSDmF0p3I cEKisc4+oqN4MdiId0bPfwxglh99vxUKup3D7R20fhKvPP1ucQkcs5tCd2DTE2eR Hg6do0yZEAE5u+Nj84cgwuxTNWpbiczUKWVEfspNS71aNm6uHJ3wJbgtUafQ1ogo 8ZbrVJOoJCdYy+D9oXTAVd8NqweZuak62vjlEDwncijy5CnuZ68T+xlSHcI4/c+d 0WrAwYnkmxxpv86JAHLObUluMxroX3tP1z6ErMVt7X4/2wwK9CjNL/QHppFhfFjT VrL2j8VtQgdmJRdzriNi =78F/ -----END PGP SIGNATURE----- --Apple-Mail=_659A4B67-FD8F-4512-9DEF-3745D384D3A7-- From owner-svn-src-head@freebsd.org Tue Oct 17 16:04:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34C3FE3EE4E; Tue, 17 Oct 2017 16:04:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EEE772D31; Tue, 17 Oct 2017 16:04:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HG402E014843; Tue, 17 Oct 2017 16:04:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HG40a5014842; Tue, 17 Oct 2017 16:04:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710171604.v9HG40a5014842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 17 Oct 2017 16:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324694 - head/sys/dev/iscsi X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/iscsi X-SVN-Commit-Revision: 324694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 16:04:01 -0000 Author: avg Date: Tue Oct 17 16:03:59 2017 New Revision: 324694 URL: https://svnweb.freebsd.org/changeset/base/324694 Log: never retry oustanding requests when terminating iscsi session CAM_REQ_ABORTED sounds natural for aborting outstanding requests when tearing down a session, but that status actually causes eligible requests to be tried again. That's completely useless, so let's use CAM_DEV_NOT_THERE instead. Perhaps there is a better status, but this should be good enough. The change should affect only the session termination. Tested by: Ben RUBSON Reviewed by: mav, trasz MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12653 Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue Oct 17 15:53:22 2017 (r324693) +++ head/sys/dev/iscsi/iscsi.c Tue Oct 17 16:03:59 2017 (r324694) @@ -291,17 +291,14 @@ iscsi_session_logout(struct iscsi_session *is) static void iscsi_session_terminate_task(struct iscsi_session *is, - struct iscsi_outstanding *io, bool requeue) + struct iscsi_outstanding *io, cam_status status) { ISCSI_SESSION_LOCK_ASSERT(is); if (io->io_ccb != NULL) { io->io_ccb->ccb_h.status &= ~(CAM_SIM_QUEUED | CAM_STATUS_MASK); - if (requeue) - io->io_ccb->ccb_h.status |= CAM_REQUEUE_REQ; - else - io->io_ccb->ccb_h.status |= CAM_REQ_ABORTED; + io->io_ccb->ccb_h.status |= status; if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { io->io_ccb->ccb_h.status |= CAM_DEV_QFRZN; xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); @@ -313,14 +310,14 @@ iscsi_session_terminate_task(struct iscsi_session *is, } static void -iscsi_session_terminate_tasks(struct iscsi_session *is, bool requeue) +iscsi_session_terminate_tasks(struct iscsi_session *is, cam_status status) { struct iscsi_outstanding *io, *tmp; ISCSI_SESSION_LOCK_ASSERT(is); TAILQ_FOREACH_SAFE(io, &is->is_outstanding, io_next, tmp) { - iscsi_session_terminate_task(is, io, requeue); + iscsi_session_terminate_task(is, io, status); } } @@ -354,11 +351,11 @@ iscsi_session_cleanup(struct iscsi_session *is, bool d /* * Terminate SCSI tasks, asking CAM to requeue them. */ - iscsi_session_terminate_tasks(is, true); + iscsi_session_terminate_tasks(is, CAM_REQUEUE_REQ); return; } - iscsi_session_terminate_tasks(is, false); + iscsi_session_terminate_tasks(is, CAM_DEV_NOT_THERE); if (is->is_sim == NULL) return; @@ -1021,7 +1018,7 @@ iscsi_pdu_handle_task_response(struct icl_pdu *respons } else { aio = iscsi_outstanding_find(is, io->io_datasn); if (aio != NULL && aio->io_ccb != NULL) - iscsi_session_terminate_task(is, aio, false); + iscsi_session_terminate_task(is, aio, CAM_REQ_ABORTED); } iscsi_outstanding_remove(is, io); From owner-svn-src-head@freebsd.org Tue Oct 17 16:17:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CC8BE3F1BE; Tue, 17 Oct 2017 16:17:53 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C36573737; Tue, 17 Oct 2017 16:17:53 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id ABF5BFDEC; Tue, 17 Oct 2017 16:17:52 +0000 (UTC) Date: Tue, 17 Oct 2017 16:17:52 +0000 From: Alexey Dokuchaev To: Alan Somers Cc: Cy Schubert , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r324681 - in head/etc: defaults periodic/daily Message-ID: <20171017161752.GA43702@FreeBSD.org> References: <201710170115.v9H1FDbU046661@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 16:17:53 -0000 On Tue, Oct 17, 2017 at 09:32:34AM -0600, Alan Somers wrote: > This change defeats the anticongestion mechanism. If > daily_ntpd_leapfile_background is set and 480.leapfile-ntpd runs > before any other periodic script that uses anticongestion (like > /usr/local/etc/periodic/security/410.pkg-audit), then the > anticongestion mechanism will effectively be disabled for those later > scripts. > > It's worth asking why you would want to do this in the background > anyway. Does the submitter complain that it was too slow? The entire > point of anticongestion is to slow it down. If the submitter didn't > like that, he could've set anticongestion_sleeptime=0 to disable it > entirely. Or was the problem that the "service ntpd onefetch" is too > slow, even after the anticongestion timer ran? I doubt it, but if so > then you should background just that part instead of backgrounding > anticongestion too. Good questions, thank you Alan. The commit message should have included answers to them, by the way (* insert usual rant about quality of commit logs here *). ./danfe From owner-svn-src-head@freebsd.org Tue Oct 17 16:29:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB752E3F89D; Tue, 17 Oct 2017 16:29:51 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B894D73F9F; Tue, 17 Oct 2017 16:29:51 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HGTomv023134; Tue, 17 Oct 2017 16:29:50 GMT (envelope-from jonathan@FreeBSD.org) Received: (from jonathan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HGTo4o023133; Tue, 17 Oct 2017 16:29:50 GMT (envelope-from jonathan@FreeBSD.org) Message-Id: <201710171629.v9HGTo4o023133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jonathan set sender to jonathan@FreeBSD.org using -f From: Jonathan Anderson Date: Tue, 17 Oct 2017 16:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324695 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jonathan X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 324695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 16:29:52 -0000 Author: jonathan Date: Tue Oct 17 16:29:50 2017 New Revision: 324695 URL: https://svnweb.freebsd.org/changeset/base/324695 Log: Add LLVM IR libraries to CLEANFILES. We previously taught the build system how to create files like libfoo.bc, but neglected to teach it about cleaning such files up. Rectify this now. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Oct 17 16:03:59 2017 (r324694) +++ head/share/mk/bsd.lib.mk Tue Oct 17 16:29:50 2017 (r324695) @@ -209,6 +209,8 @@ lib${LIB_PRIVATE}${LIB}.bc: ${BCOBJS} lib${LIB_PRIVATE}${LIB}.ll: ${LLOBJS} ${LLVM_LINK} -S -o ${.TARGET} ${LLOBJS} + +CLEANFILES+= lib${LIB_PRIVATE}${LIB}.bc lib${LIB_PRIVATE}${LIB}.ll .endif .if defined(SHLIB_NAME) || \ From owner-svn-src-head@freebsd.org Tue Oct 17 17:22:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25172E40CFE; Tue, 17 Oct 2017 17:22:39 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E567175F20; Tue, 17 Oct 2017 17:22:38 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HHMcTh047979; Tue, 17 Oct 2017 17:22:38 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HHMaQQ047966; Tue, 17 Oct 2017 17:22:36 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201710171722.v9HHMaQQ047966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 17 Oct 2017 17:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324696 - in head/contrib/wpa: src/ap src/common src/rsn_supp wpa_supplicant X-SVN-Group: head X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in head/contrib/wpa: src/ap src/common src/rsn_supp wpa_supplicant X-SVN-Commit-Revision: 324696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 17:22:39 -0000 Author: gordon Date: Tue Oct 17 17:22:36 2017 New Revision: 324696 URL: https://svnweb.freebsd.org/changeset/base/324696 Log: Update wpa_supplicant/hostapd for 2017-01 vulnerability release. hostapd: Avoid key reinstallation in FT handshake Prevent reinstallation of an already in-use group key Extend protection of GTK/IGTK reinstallation of WNM-Sleep Mode cases Fix TK configuration to the driver in EAPOL-Key 3/4 retry case Prevent installation of an all-zero TK Fix PTK rekeying to generate a new ANonce TDLS: Reject TPK-TK reconfiguration WNM: Ignore Key Data in WNM Sleep Mode Response frame if no PMF in use WNM: Ignore WNM-Sleep Mode Response if WNM-Sleep Mode has not been used WNM: Ignore WNM-Sleep Mode Response without pending request FT: Do not allow multiple Reassociation Response frames TDLS: Ignore incoming TDLS Setup Response retries Submitted by: jhb Obtained from: https://w1.fi/security/2017-01/ (against later version) Security: FreeBSD-SA-17:07 Security: CERT VU#228519 Security: CVE-2017-13077 Security: CVE-2017-13078 Security: CVE-2017-13079 Security: CVE-2017-13080 Security: CVE-2017-13081 Security: CVE-2017-13082 Security: CVE-2017-13086 Security: CVE-2017-13087 Security: CVE-2017-13088 Differential Revision: https://reviews.freebsd.org/D12693 Modified: head/contrib/wpa/src/ap/wpa_auth.c head/contrib/wpa/src/ap/wpa_auth.h head/contrib/wpa/src/ap/wpa_auth_ft.c head/contrib/wpa/src/ap/wpa_auth_i.h head/contrib/wpa/src/common/wpa_common.h head/contrib/wpa/src/rsn_supp/tdls.c head/contrib/wpa/src/rsn_supp/wpa.c head/contrib/wpa/src/rsn_supp/wpa_ft.c head/contrib/wpa/src/rsn_supp/wpa_i.h head/contrib/wpa/wpa_supplicant/ctrl_iface.c head/contrib/wpa/wpa_supplicant/events.c head/contrib/wpa/wpa_supplicant/wnm_sta.c head/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h Modified: head/contrib/wpa/src/ap/wpa_auth.c ============================================================================== --- head/contrib/wpa/src/ap/wpa_auth.c Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/ap/wpa_auth.c Tue Oct 17 17:22:36 2017 (r324696) @@ -1893,6 +1893,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2) } +static int wpa_auth_sm_ptk_update(struct wpa_state_machine *sm) +{ + if (random_get_bytes(sm->ANonce, WPA_NONCE_LEN)) { + wpa_printf(MSG_ERROR, + "WPA: Failed to get random data for ANonce"); + sm->Disconnect = TRUE; + return -1; + } + wpa_hexdump(MSG_DEBUG, "WPA: Assign new ANonce", sm->ANonce, + WPA_NONCE_LEN); + sm->TimeoutCtr = 0; + return 0; +} + + SM_STATE(WPA_PTK, INITPMK) { u8 msk[2 * PMK_LEN]; @@ -2414,9 +2429,12 @@ SM_STEP(WPA_PTK) SM_ENTER(WPA_PTK, AUTHENTICATION); else if (sm->ReAuthenticationRequest) SM_ENTER(WPA_PTK, AUTHENTICATION2); - else if (sm->PTKRequest) - SM_ENTER(WPA_PTK, PTKSTART); - else switch (sm->wpa_ptk_state) { + else if (sm->PTKRequest) { + if (wpa_auth_sm_ptk_update(sm) < 0) + SM_ENTER(WPA_PTK, DISCONNECTED); + else + SM_ENTER(WPA_PTK, PTKSTART); + } else switch (sm->wpa_ptk_state) { case WPA_PTK_INITIALIZE: break; case WPA_PTK_DISCONNECT: @@ -3206,6 +3224,14 @@ int wpa_auth_sta_wpa_version(struct wpa_state_machine if (sm == NULL) return 0; return sm->wpa; +} + + +int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm) +{ + if (!sm || !wpa_key_mgmt_ft(sm->wpa_key_mgmt)) + return 0; + return sm->tk_already_set; } Modified: head/contrib/wpa/src/ap/wpa_auth.h ============================================================================== --- head/contrib/wpa/src/ap/wpa_auth.h Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/ap/wpa_auth.h Tue Oct 17 17:22:36 2017 (r324696) @@ -271,6 +271,7 @@ int wpa_auth_pairwise_set(struct wpa_state_machine *sm int wpa_auth_get_pairwise(struct wpa_state_machine *sm); int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm); int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm); +int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm); int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, struct rsn_pmksa_cache_entry *entry); struct rsn_pmksa_cache_entry * Modified: head/contrib/wpa/src/ap/wpa_auth_ft.c ============================================================================== --- head/contrib/wpa/src/ap/wpa_auth_ft.c Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/ap/wpa_auth_ft.c Tue Oct 17 17:22:36 2017 (r324696) @@ -780,6 +780,14 @@ void wpa_ft_install_ptk(struct wpa_state_machine *sm) return; } + if (sm->tk_already_set) { + /* Must avoid TK reconfiguration to prevent clearing of TX/RX + * PN in the driver */ + wpa_printf(MSG_DEBUG, + "FT: Do not re-install same PTK to the driver"); + return; + } + /* FIX: add STA entry to kernel/driver here? The set_key will fail * most likely without this.. At the moment, STA entry is added only * after association has been completed. This function will be called @@ -792,6 +800,7 @@ void wpa_ft_install_ptk(struct wpa_state_machine *sm) /* FIX: MLME-SetProtection.Request(TA, Tx_Rx) */ sm->pairwise_set = TRUE; + sm->tk_already_set = TRUE; } @@ -898,6 +907,7 @@ static int wpa_ft_process_auth_req(struct wpa_state_ma sm->pairwise = pairwise; sm->PTK_valid = TRUE; + sm->tk_already_set = FALSE; wpa_ft_install_ptk(sm); buflen = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) + Modified: head/contrib/wpa/src/ap/wpa_auth_i.h ============================================================================== --- head/contrib/wpa/src/ap/wpa_auth_i.h Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/ap/wpa_auth_i.h Tue Oct 17 17:22:36 2017 (r324696) @@ -64,6 +64,7 @@ struct wpa_state_machine { struct wpa_ptk PTK; Boolean PTK_valid; Boolean pairwise_set; + Boolean tk_already_set; int keycount; Boolean Pair; struct wpa_key_replay_counter { Modified: head/contrib/wpa/src/common/wpa_common.h ============================================================================== --- head/contrib/wpa/src/common/wpa_common.h Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/common/wpa_common.h Tue Oct 17 17:22:36 2017 (r324696) @@ -213,8 +213,20 @@ struct wpa_ptk { size_t kck_len; size_t kek_len; size_t tk_len; + int installed; /* 1 if key has already been installed to driver */ }; +struct wpa_gtk { + u8 gtk[WPA_GTK_MAX_LEN]; + size_t gtk_len; +}; + +#ifdef CONFIG_IEEE80211W +struct wpa_igtk { + u8 igtk[WPA_IGTK_MAX_LEN]; + size_t igtk_len; +}; +#endif /* CONFIG_IEEE80211W */ /* WPA IE version 1 * 00-50-f2:1 (OUI:OUI type) Modified: head/contrib/wpa/src/rsn_supp/tdls.c ============================================================================== --- head/contrib/wpa/src/rsn_supp/tdls.c Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/rsn_supp/tdls.c Tue Oct 17 17:22:36 2017 (r324696) @@ -112,6 +112,7 @@ struct wpa_tdls_peer { u8 tk[16]; /* TPK-TK; assuming only CCMP will be used */ } tpk; int tpk_set; + int tk_set; /* TPK-TK configured to the driver */ int tpk_success; int tpk_in_progress; @@ -192,6 +193,20 @@ static int wpa_tdls_set_key(struct wpa_sm *sm, struct u8 rsc[6]; enum wpa_alg alg; + if (peer->tk_set) { + /* + * This same TPK-TK has already been configured to the driver + * and this new configuration attempt (likely due to an + * unexpected retransmitted frame) would result in clearing + * the TX/RX sequence number which can break security, so must + * not allow that to happen. + */ + wpa_printf(MSG_INFO, "TDLS: TPK-TK for the peer " MACSTR + " has already been configured to the driver - do not reconfigure", + MAC2STR(peer->addr)); + return -1; + } + os_memset(rsc, 0, 6); switch (peer->cipher) { @@ -209,12 +224,15 @@ static int wpa_tdls_set_key(struct wpa_sm *sm, struct return -1; } + wpa_printf(MSG_DEBUG, "TDLS: Configure pairwise key for peer " MACSTR, + MAC2STR(peer->addr)); if (wpa_sm_set_key(sm, alg, peer->addr, -1, 1, rsc, sizeof(rsc), peer->tpk.tk, key_len) < 0) { wpa_printf(MSG_WARNING, "TDLS: Failed to set TPK to the " "driver"); return -1; } + peer->tk_set = 1; return 0; } @@ -690,7 +708,7 @@ static void wpa_tdls_peer_clear(struct wpa_sm *sm, str peer->cipher = 0; peer->qos_info = 0; peer->wmm_capable = 0; - peer->tpk_set = peer->tpk_success = 0; + peer->tk_set = peer->tpk_set = peer->tpk_success = 0; peer->chan_switch_enabled = 0; os_memset(&peer->tpk, 0, sizeof(peer->tpk)); os_memset(peer->inonce, 0, WPA_NONCE_LEN); @@ -1153,6 +1171,7 @@ skip_rsnie: wpa_tdls_peer_free(sm, peer); return -1; } + peer->tk_set = 0; /* A new nonce results in a new TK */ wpa_hexdump(MSG_DEBUG, "TDLS: Initiator Nonce for TPK handshake", peer->inonce, WPA_NONCE_LEN); os_memcpy(ftie->Snonce, peer->inonce, WPA_NONCE_LEN); @@ -1745,6 +1764,19 @@ static int wpa_tdls_addset_peer(struct wpa_sm *sm, str } +static int tdls_nonce_set(const u8 *nonce) +{ + int i; + + for (i = 0; i < WPA_NONCE_LEN; i++) { + if (nonce[i]) + return 1; + } + + return 0; +} + + static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr, const u8 *buf, size_t len) { @@ -1998,7 +2030,8 @@ skip_rsn: peer->rsnie_i_len = kde.rsn_ie_len; peer->cipher = cipher; - if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0) { + if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0 || + !tdls_nonce_set(peer->inonce)) { /* * There is no point in updating the RNonce for every obtained * TPK M1 frame (e.g., retransmission due to timeout) with the @@ -2014,6 +2047,7 @@ skip_rsn: "TDLS: Failed to get random data for responder nonce"); goto error; } + peer->tk_set = 0; /* A new nonce results in a new TK */ } #if 0 @@ -2170,6 +2204,14 @@ static int wpa_tdls_process_tpk_m2(struct wpa_sm *sm, "ignore TPK M2 from " MACSTR, MAC2STR(src_addr)); return -1; } + + if (peer->tpk_success) { + wpa_printf(MSG_INFO, "TDLS: Ignore incoming TPK M2 retry, from " + MACSTR " as TPK M3 was already sent", + MAC2STR(src_addr)); + return 0; + } + wpa_tdls_tpk_retry_timeout_cancel(sm, peer, WLAN_TDLS_SETUP_REQUEST); if (len < 3 + 2 + 1) { Modified: head/contrib/wpa/src/rsn_supp/wpa.c ============================================================================== --- head/contrib/wpa/src/rsn_supp/wpa.c Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/rsn_supp/wpa.c Tue Oct 17 17:22:36 2017 (r324696) @@ -605,6 +605,12 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *s const u8 *key_rsc; u8 null_rsc[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + if (sm->ptk.installed) { + wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, + "WPA: Do not re-install same PTK to the driver"); + return 0; + } + wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Installing PTK to the driver"); @@ -643,6 +649,7 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *s /* TK is not needed anymore in supplicant */ os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); + sm->ptk.installed = 1; if (sm->wpa_ptk_rekey) { eloop_cancel_timeout(wpa_sm_rekey_ptk, sm, NULL); @@ -692,11 +699,23 @@ struct wpa_gtk_data { static int wpa_supplicant_install_gtk(struct wpa_sm *sm, const struct wpa_gtk_data *gd, - const u8 *key_rsc) + const u8 *key_rsc, int wnm_sleep) { const u8 *_gtk = gd->gtk; u8 gtk_buf[32]; + /* Detect possible key reinstallation */ + if ((sm->gtk.gtk_len == (size_t) gd->gtk_len && + os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) || + (sm->gtk_wnm_sleep.gtk_len == (size_t) gd->gtk_len && + os_memcmp(sm->gtk_wnm_sleep.gtk, gd->gtk, + sm->gtk_wnm_sleep.gtk_len) == 0)) { + wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, + "WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)", + gd->keyidx, gd->tx, gd->gtk_len); + return 0; + } + wpa_hexdump_key(MSG_DEBUG, "WPA: Group Key", gd->gtk, gd->gtk_len); wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Installing GTK to the driver (keyidx=%d tx=%d len=%d)", @@ -731,6 +750,15 @@ static int wpa_supplicant_install_gtk(struct wpa_sm *s } os_memset(gtk_buf, 0, sizeof(gtk_buf)); + if (wnm_sleep) { + sm->gtk_wnm_sleep.gtk_len = gd->gtk_len; + os_memcpy(sm->gtk_wnm_sleep.gtk, gd->gtk, + sm->gtk_wnm_sleep.gtk_len); + } else { + sm->gtk.gtk_len = gd->gtk_len; + os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len); + } + return 0; } @@ -788,7 +816,7 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm * (wpa_supplicant_check_group_cipher(sm, sm->group_cipher, gtk_len, gtk_len, &gd.key_rsc_len, &gd.alg) || - wpa_supplicant_install_gtk(sm, &gd, key->key_rsc))) { + wpa_supplicant_install_gtk(sm, &gd, key->key_rsc, 0))) { wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "RSN: Failed to install GTK"); os_memset(&gd, 0, sizeof(gd)); @@ -802,6 +830,58 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm * } +#ifdef CONFIG_IEEE80211W +static int wpa_supplicant_install_igtk(struct wpa_sm *sm, + const struct wpa_igtk_kde *igtk, + int wnm_sleep) +{ + size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher); + u16 keyidx = WPA_GET_LE16(igtk->keyid); + + /* Detect possible key reinstallation */ + if ((sm->igtk.igtk_len == len && + os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) || + (sm->igtk_wnm_sleep.igtk_len == len && + os_memcmp(sm->igtk_wnm_sleep.igtk, igtk->igtk, + sm->igtk_wnm_sleep.igtk_len) == 0)) { + wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, + "WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)", + keyidx); + return 0; + } + + wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, + "WPA: IGTK keyid %d pn %02x%02x%02x%02x%02x%02x", + keyidx, MAC2STR(igtk->pn)); + wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK", igtk->igtk, len); + if (keyidx > 4095) { + wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, + "WPA: Invalid IGTK KeyID %d", keyidx); + return -1; + } + if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher), + broadcast_ether_addr, + keyidx, 0, igtk->pn, sizeof(igtk->pn), + igtk->igtk, len) < 0) { + wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, + "WPA: Failed to configure IGTK to the driver"); + return -1; + } + + if (wnm_sleep) { + sm->igtk_wnm_sleep.igtk_len = len; + os_memcpy(sm->igtk_wnm_sleep.igtk, igtk->igtk, + sm->igtk_wnm_sleep.igtk_len); + } else { + sm->igtk.igtk_len = len; + os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len); + } + + return 0; +} +#endif /* CONFIG_IEEE80211W */ + + static int ieee80211w_set_keys(struct wpa_sm *sm, struct wpa_eapol_ie_parse *ie) { @@ -812,30 +892,14 @@ static int ieee80211w_set_keys(struct wpa_sm *sm, if (ie->igtk) { size_t len; const struct wpa_igtk_kde *igtk; - u16 keyidx; + len = wpa_cipher_key_len(sm->mgmt_group_cipher); if (ie->igtk_len != WPA_IGTK_KDE_PREFIX_LEN + len) return -1; + igtk = (const struct wpa_igtk_kde *) ie->igtk; - keyidx = WPA_GET_LE16(igtk->keyid); - wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: IGTK keyid %d " - "pn %02x%02x%02x%02x%02x%02x", - keyidx, MAC2STR(igtk->pn)); - wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK", - igtk->igtk, len); - if (keyidx > 4095) { - wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, - "WPA: Invalid IGTK KeyID %d", keyidx); + if (wpa_supplicant_install_igtk(sm, igtk, 0) < 0) return -1; - } - if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher), - broadcast_ether_addr, - keyidx, 0, igtk->pn, sizeof(igtk->pn), - igtk->igtk, len) < 0) { - wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, - "WPA: Failed to configure IGTK to the driver"); - return -1; - } } return 0; @@ -1483,7 +1547,7 @@ static void wpa_supplicant_process_1_of_2(struct wpa_s if (ret) goto failed; - if (wpa_supplicant_install_gtk(sm, &gd, key->key_rsc) || + if (wpa_supplicant_install_gtk(sm, &gd, key->key_rsc, 0) || wpa_supplicant_send_2_of_2(sm, key, ver, key_info)) goto failed; os_memset(&gd, 0, sizeof(gd)); @@ -2251,7 +2315,7 @@ void wpa_sm_deinit(struct wpa_sm *sm) */ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid) { - int clear_ptk = 1; + int clear_keys = 1; if (sm == NULL) return; @@ -2277,11 +2341,11 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 * /* Prepare for the next transition */ wpa_ft_prepare_auth_request(sm, NULL); - clear_ptk = 0; + clear_keys = 0; } #endif /* CONFIG_IEEE80211R */ - if (clear_ptk) { + if (clear_keys) { /* * IEEE 802.11, 8.4.10: Delete PTK SA on (re)association if * this is not part of a Fast BSS Transition. @@ -2291,6 +2355,12 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 * os_memset(&sm->ptk, 0, sizeof(sm->ptk)); sm->tptk_set = 0; os_memset(&sm->tptk, 0, sizeof(sm->tptk)); + os_memset(&sm->gtk, 0, sizeof(sm->gtk)); + os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep)); +#ifdef CONFIG_IEEE80211W + os_memset(&sm->igtk, 0, sizeof(sm->igtk)); + os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep)); +#endif /* CONFIG_IEEE80211W */ } #ifdef CONFIG_TDLS @@ -2322,6 +2392,9 @@ void wpa_sm_notify_disassoc(struct wpa_sm *sm) #ifdef CONFIG_TDLS wpa_tdls_disassoc(sm); #endif /* CONFIG_TDLS */ +#ifdef CONFIG_IEEE80211R + sm->ft_reassoc_completed = 0; +#endif /* CONFIG_IEEE80211R */ /* Keys are not needed in the WPA state machine anymore */ wpa_sm_drop_sa(sm); @@ -2807,6 +2880,12 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) os_memset(sm->pmk, 0, sizeof(sm->pmk)); os_memset(&sm->ptk, 0, sizeof(sm->ptk)); os_memset(&sm->tptk, 0, sizeof(sm->tptk)); + os_memset(&sm->gtk, 0, sizeof(sm->gtk)); + os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep)); +#ifdef CONFIG_IEEE80211W + os_memset(&sm->igtk, 0, sizeof(sm->igtk)); + os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep)); +#endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_IEEE80211R os_memset(sm->xxkey, 0, sizeof(sm->xxkey)); os_memset(sm->pmk_r0, 0, sizeof(sm->pmk_r0)); @@ -2870,7 +2949,7 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 sub wpa_hexdump_key(MSG_DEBUG, "Install GTK (WNM SLEEP)", gd.gtk, gd.gtk_len); - if (wpa_supplicant_install_gtk(sm, &gd, key_rsc)) { + if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 1)) { os_memset(&gd, 0, sizeof(gd)); wpa_printf(MSG_DEBUG, "Failed to install the GTK in " "WNM mode"); @@ -2879,29 +2958,11 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 sub os_memset(&gd, 0, sizeof(gd)); #ifdef CONFIG_IEEE80211W } else if (subelem_id == WNM_SLEEP_SUBELEM_IGTK) { - struct wpa_igtk_kde igd; - u16 keyidx; + const struct wpa_igtk_kde *igtk; - os_memset(&igd, 0, sizeof(igd)); - keylen = wpa_cipher_key_len(sm->mgmt_group_cipher); - os_memcpy(igd.keyid, buf + 2, 2); - os_memcpy(igd.pn, buf + 4, 6); - - keyidx = WPA_GET_LE16(igd.keyid); - os_memcpy(igd.igtk, buf + 10, keylen); - - wpa_hexdump_key(MSG_DEBUG, "Install IGTK (WNM SLEEP)", - igd.igtk, keylen); - if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher), - broadcast_ether_addr, - keyidx, 0, igd.pn, sizeof(igd.pn), - igd.igtk, keylen) < 0) { - wpa_printf(MSG_DEBUG, "Failed to install the IGTK in " - "WNM mode"); - os_memset(&igd, 0, sizeof(igd)); + igtk = (const struct wpa_igtk_kde *) (buf + 2); + if (wpa_supplicant_install_igtk(sm, igtk, 1) < 0) return -1; - } - os_memset(&igd, 0, sizeof(igd)); #endif /* CONFIG_IEEE80211W */ } else { wpa_printf(MSG_DEBUG, "Unknown element id"); Modified: head/contrib/wpa/src/rsn_supp/wpa_ft.c ============================================================================== --- head/contrib/wpa/src/rsn_supp/wpa_ft.c Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/rsn_supp/wpa_ft.c Tue Oct 17 17:22:36 2017 (r324696) @@ -153,6 +153,7 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size u16 capab; sm->ft_completed = 0; + sm->ft_reassoc_completed = 0; buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) + 2 + sm->r0kh_id_len + ric_ies_len + 100; @@ -681,6 +682,11 @@ int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, co return -1; } + if (sm->ft_reassoc_completed) { + wpa_printf(MSG_DEBUG, "FT: Reassociation has already been completed for this FT protocol instance - ignore unexpected retransmission"); + return 0; + } + if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) { wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs"); return -1; @@ -780,6 +786,8 @@ int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, co wpa_hexdump(MSG_MSGDUMP, "FT: Calculated MIC", mic, 16); return -1; } + + sm->ft_reassoc_completed = 1; if (wpa_ft_process_gtk_subelem(sm, parse.gtk, parse.gtk_len) < 0) return -1; Modified: head/contrib/wpa/src/rsn_supp/wpa_i.h ============================================================================== --- head/contrib/wpa/src/rsn_supp/wpa_i.h Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/rsn_supp/wpa_i.h Tue Oct 17 17:22:36 2017 (r324696) @@ -30,6 +30,12 @@ struct wpa_sm { u8 rx_replay_counter[WPA_REPLAY_COUNTER_LEN]; int rx_replay_counter_set; u8 request_counter[WPA_REPLAY_COUNTER_LEN]; + struct wpa_gtk gtk; + struct wpa_gtk gtk_wnm_sleep; +#ifdef CONFIG_IEEE80211W + struct wpa_igtk igtk; + struct wpa_igtk igtk_wnm_sleep; +#endif /* CONFIG_IEEE80211W */ struct eapol_sm *eapol; /* EAPOL state machine from upper level code */ @@ -121,6 +127,7 @@ struct wpa_sm { size_t r0kh_id_len; u8 r1kh_id[FT_R1KH_ID_LEN]; int ft_completed; + int ft_reassoc_completed; int over_the_ds_in_progress; u8 target_ap[ETH_ALEN]; /* over-the-DS target AP */ int set_ptk_after_assoc; Modified: head/contrib/wpa/wpa_supplicant/ctrl_iface.c ============================================================================== --- head/contrib/wpa/wpa_supplicant/ctrl_iface.c Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/wpa_supplicant/ctrl_iface.c Tue Oct 17 17:22:36 2017 (r324696) @@ -6891,6 +6891,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa } eloop_cancel_timeout(wpas_network_reenabled, wpa_s, NULL); + wpa_s->wnmsleep_used = 0; } Modified: head/contrib/wpa/wpa_supplicant/events.c ============================================================================== --- head/contrib/wpa/wpa_supplicant/events.c Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/wpa_supplicant/events.c Tue Oct 17 17:22:36 2017 (r324696) @@ -303,6 +303,7 @@ void wpa_supplicant_mark_disassoc(struct wpa_supplican wpa_s->key_mgmt = 0; wpas_rrm_reset(wpa_s); + wpa_s->wnmsleep_used = 0; } Modified: head/contrib/wpa/wpa_supplicant/wnm_sta.c ============================================================================== --- head/contrib/wpa/wpa_supplicant/wnm_sta.c Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/wpa_supplicant/wnm_sta.c Tue Oct 17 17:22:36 2017 (r324696) @@ -137,6 +137,8 @@ int ieee802_11_send_wnmsleep_req(struct wpa_supplicant if (res < 0) wpa_printf(MSG_DEBUG, "Failed to send WNM-Sleep Request " "(action=%d, intval=%d)", action, intval); + else + wpa_s->wnmsleep_used = 1; os_free(wnmsleep_ie); os_free(wnmtfs_ie); @@ -187,6 +189,12 @@ static void wnm_sleep_mode_exit_success(struct wpa_sup end = ptr + key_len_total; wpa_hexdump_key(MSG_DEBUG, "WNM: Key Data", ptr, key_len_total); + if (key_len_total && !wpa_sm_pmf_enabled(wpa_s->wpa)) { + wpa_msg(wpa_s, MSG_INFO, + "WNM: Ignore Key Data in WNM-Sleep Mode Response - PMF not enabled"); + return; + } + while (ptr + 1 < end) { if (ptr + 2 + ptr[1] > end) { wpa_printf(MSG_DEBUG, "WNM: Invalid Key Data element " @@ -247,6 +255,12 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_sup u8 *tfsresp_ie_end = NULL; size_t left; + if (!wpa_s->wnmsleep_used) { + wpa_printf(MSG_DEBUG, + "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode operation has not been requested"); + return; + } + if (len < 3) return; key_len_total = WPA_GET_LE16(frm + 1); @@ -281,6 +295,8 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_sup wpa_printf(MSG_DEBUG, "No WNM-Sleep IE found"); return; } + + wpa_s->wnmsleep_used = 0; if (wnmsleep_ie->status == WNM_STATUS_SLEEP_ACCEPT || wnmsleep_ie->status == WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) { Modified: head/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h ============================================================================== --- head/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h Tue Oct 17 17:22:36 2017 (r324696) @@ -658,6 +658,7 @@ struct wpa_supplicant { unsigned int reattach:1; /* reassociation to the same BSS requested */ unsigned int mac_addr_changed:1; unsigned int added_vif:1; + unsigned int wnmsleep_used:1; struct os_reltime last_mac_addr_change; int last_mac_addr_style; From owner-svn-src-head@freebsd.org Tue Oct 17 18:00:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 445CFE4218A; Tue, 17 Oct 2017 18:00:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 102CD77E2D; Tue, 17 Oct 2017 18:00:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HI02dH062442; Tue, 17 Oct 2017 18:00:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HI02Hg062441; Tue, 17 Oct 2017 18:00:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710171800.v9HI02Hg062441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 17 Oct 2017 18:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324700 - head/sys/boot/common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/boot/common X-SVN-Commit-Revision: 324700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 18:00:03 -0000 Author: emaste Date: Tue Oct 17 18:00:01 2017 New Revision: 324700 URL: https://svnweb.freebsd.org/changeset/base/324700 Log: loader: initialize dv_cleanup in md.c to eliminate clang warning Submitted by: Zakary Nafziger Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/common/md.c Modified: head/sys/boot/common/md.c ============================================================================== --- head/sys/boot/common/md.c Tue Oct 17 17:57:18 2017 (r324699) +++ head/sys/boot/common/md.c Tue Oct 17 18:00:01 2017 (r324700) @@ -73,7 +73,8 @@ struct devsw md_dev = { md_open, md_close, noioctl, - md_print + md_print, + NULL }; static int From owner-svn-src-head@freebsd.org Tue Oct 17 18:56:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5285E4455C for ; Tue, 17 Oct 2017 18:56:07 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-pg0-x229.google.com (mail-pg0-x229.google.com [IPv6:2607:f8b0:400e:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EC887E6F4 for ; Tue, 17 Oct 2017 18:56:07 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-pg0-x229.google.com with SMTP id m18so2133389pgd.13 for ; Tue, 17 Oct 2017 11:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3uLDbLrx6U84xTj1oAOouXcHCen4S9SRJyfrhXOS82E=; b=ppYiVJiOplYm3T7THOsqmLe3zpvnc76Z16gwes9Z3ovqBlTPRI5I8nVsn/JN2S8Nz0 xfW4HW41oUCXbagEf1ZDoosWV0A1JsyF5YZcaBFsqeZwduv8DbA4uY+0Nye/qjAIOyfY q9cMXpVs4xo7yGCgCCiHCl/2/Gyzq6XozELzSoXGjblROuDpwPjH2Mwzlu9Em0EpuqTP 5Q+0mOF+0ViqrrYAiMtrQurcZJznjH3z3huQVHJHguwXZHZ5v6NreMNAgF6yjZmvg4bW W8M/qKL/1/y/9lBuY5xKYwHcsNXRhr87hhBMgZc+U4t9oWD/vcAwM2BAhfc1YhUDhhIf ducw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3uLDbLrx6U84xTj1oAOouXcHCen4S9SRJyfrhXOS82E=; b=nQlPTrKg3Ew4/94PjC0bZOdiRVD3QDyZ87vFMQamjO3apAY5b1IwBW0AR+AMnxPRzC G5v5yAJaO95PBo4HpQazJGZIwguHVVP1Idy5IHKxe34TLowc+MXQ4qKihhewpDaYnP1H t86thJdBcuV+82JSPcS5CzgJPjRGIqowoChBKWZj8f9p8MfDUikDB2SfwCGSxs2A2AZJ 67Nb+a9+neMWn6BkLBQ7K2kPYajHZKpm/Fqgg35J8JOLQsy/s1r03gwxzDwMvA1XqtWP Pe6lWT5Mvc4j56FXZYfTvYJk2R/UEaYNb4kJTVayMe5k2C3KhylJBoT+UyzEzfbI97GT y6tA== X-Gm-Message-State: AMCzsaURvabHp8QwJQ4sszvkdLjEIGQA2MzJFKUdDS62zDqzsqJ8v6/a 8jYGQ0n/+uMDRPk0DeaKS0QMjw== X-Google-Smtp-Source: AOwi7QCGmAM2WDwdHrv8MTgO4WS9QDk/QCumnHEP1nQkkPaf4wxSSuTXLK8iyYbbiCjB6xOhBEEuXw== X-Received: by 10.159.197.11 with SMTP id bj11mr12990628plb.354.1508266566902; Tue, 17 Oct 2017 11:56:06 -0700 (PDT) Received: from mutt-hbsd ([62.102.148.67]) by smtp.gmail.com with ESMTPSA id a70sm4100952pfg.176.2017.10.17.11.56.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2017 11:56:05 -0700 (PDT) Date: Tue, 17 Oct 2017 14:55:48 -0400 From: Shawn Webb To: Mark Murray Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys Message-ID: <20171017185548.rmol2sjw4ic3jbyn@mutt-hbsd> References: <201704160911.v3G9B3df023095@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="t25tgrz2t4356tnl" Content-Disposition: inline In-Reply-To: <201704160911.v3G9B3df023095@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20170912 (1.9.0) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 18:56:07 -0000 --t25tgrz2t4356tnl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 16, 2017 at 09:11:03AM +0000, Mark Murray wrote: > Author: markm > Date: Sun Apr 16 09:11:02 2017 > New Revision: 317015 > URL: https://svnweb.freebsd.org/changeset/base/317015 >=20 > Log: > Replace the RC4 algorithm for generating in-kernel secure random > numbers with Chacha20. Keep the API, though, as that is what the > other *BSD's have done. > =20 > Use the boot-time entropy stash (if present) to bootstrap the > in-kernel entropy source. > =20 > Reviewed by: delphij,rwatson > Approved by: so(delphij) > MFC after: 2 months Hey Mark, Do you still plan to MFC this? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --t25tgrz2t4356tnl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlnmUjEACgkQaoRlj1JF bu4umg//Ydf+9mNK+K24V00EenlrOX3JaiFFvPBQCUYwGNtMu9TfCf5+5k3o0cqJ 96J0tQ3yxy1yYNp56NyQxKINK5y1z2YBjeL1EoVwlaHA3FEZiMHiiGwqgQ3cjkzY UICPdadwVk9aS0bPBr12gidoJea7B9O9jYa1pUodPZWatdlG/79Lm5FB0RL/wLj8 2F1X7nCPpX/QgAw4is85ONjbH0IH0zDLq1+FJspVcliMbRQlmT0MVfETSZFT3/C0 zFDC/CQRDd8i+RWDygvpD/uyz9GMtuEcVsq8yk3KvGoehCvx/UDbSDGpIXc3GhfQ wpAkIbmxgrSzus0hSPHSY0YZe2XyuX/3jvgxpuB+sQNXqpbosfCH75bq+6ijhfmD k97MWau44PzAEI3LWrzuzdvNMnuH3t49CtXJhmGKCVD+SheETg2WJYxZOjjEJpVD yIXOEGJdFKS9+AFaY+NE7zesZlTF89MLveUxOaKoYvYlUsr+mCFt8vxTV2+d7eUH GFWN+KE1JUdiEVl3lnz54Fhes8CU5EPG4bN6MNUBW1bSRfR+EJfDwS0eSSr1oc8s 9965npJOmrCdizEMe7VXVbE3Dcr0gYKK3zwdmimkdIto6oDDQzfWU6I7ZVUJKcFY RhEU26bqVoZLFSTSn2Cx7EmWD24ovzus2YpwGJVQA3xTr1qH9ZY= =9iEu -----END PGP SIGNATURE----- --t25tgrz2t4356tnl-- From owner-svn-src-head@freebsd.org Tue Oct 17 19:01:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5211BE446E0; Tue, 17 Oct 2017 19:01:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BA8A7E93E; Tue, 17 Oct 2017 19:01:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HJ122E088567; Tue, 17 Oct 2017 19:01:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HJ12OM088566; Tue, 17 Oct 2017 19:01:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201710171901.v9HJ12OM088566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 17 Oct 2017 19:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324701 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 324701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 19:01:03 -0000 Author: bdrewery Date: Tue Oct 17 19:01:01 2017 New Revision: 324701 URL: https://svnweb.freebsd.org/changeset/base/324701 Log: Add a test for r324671 along with some other masked tests. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Tue Oct 17 18:00:01 2017 (r324700) +++ head/tests/sys/kern/ptrace_test.c Tue Oct 17 19:01:01 2017 (r324701) @@ -2402,7 +2402,107 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_with_signal_full_sigqu ATF_REQUIRE(errno == ECHILD); } +static sem_t sigusr1_sem; +static int got_usr1; + +static void +sigusr1_sempost_handler(int sig __unused) +{ + + got_usr1++; + CHILD_REQUIRE(sem_post(&sigusr1_sem) == 0); +} + /* + * Verify that even if the signal queue is full for a child process, + * and the signal is masked, a PT_CONTINUE with a signal will not + * result in loss of that signal. + */ +ATF_TC_WITHOUT_HEAD(ptrace__PT_CONTINUE_with_signal_masked_full_sigqueue); +ATF_TC_BODY(ptrace__PT_CONTINUE_with_signal_masked_full_sigqueue, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int status, err; + int max_pending_per_proc; + size_t len; + int i; + sigset_t sigmask; + + ATF_REQUIRE(signal(SIGUSR2, handler) != SIG_ERR); + ATF_REQUIRE(sem_init(&sigusr1_sem, 0, 0) == 0); + ATF_REQUIRE(signal(SIGUSR1, sigusr1_sempost_handler) != SIG_ERR); + + got_usr1 = 0; + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + CHILD_REQUIRE(sigemptyset(&sigmask) == 0); + CHILD_REQUIRE(sigaddset(&sigmask, SIGUSR1) == 0); + CHILD_REQUIRE(sigprocmask(SIG_BLOCK, &sigmask, NULL) == 0); + + trace_me(); + CHILD_REQUIRE(got_usr1 == 0); + + /* Allow the pending SIGUSR1 in now. */ + CHILD_REQUIRE(sigprocmask(SIG_UNBLOCK, &sigmask, NULL) == 0); + /* Wait to receive the SIGUSR1. */ + do { + err = sem_wait(&sigusr1_sem); + CHILD_REQUIRE(err == 0 || errno == EINTR); + } while (err != 0 && errno == EINTR); + CHILD_REQUIRE(got_usr1 == 1); + exit(1); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + len = sizeof(max_pending_per_proc); + ATF_REQUIRE(sysctlbyname("kern.sigqueue.max_pending_per_proc", + &max_pending_per_proc, &len, NULL, 0) == 0); + + /* Fill the signal queue. */ + for (i = 0; i < max_pending_per_proc; ++i) + ATF_REQUIRE(kill(fpid, SIGUSR2) == 0); + + /* Continue with signal. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, SIGUSR1) == 0); + + /* Collect and ignore all of the SIGUSR2. */ + for (i = 0; i < max_pending_per_proc; ++i) { + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGUSR2); + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + } + + /* Now our PT_CONTINUE'd SIGUSR1 should cause a stop after unmask. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGUSR1); + ATF_REQUIRE(ptrace(PT_LWPINFO, fpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGUSR1); + + /* Continue the child, ignoring the SIGUSR1. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last wait() should report exit after receiving SIGUSR1. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + +/* * Verify that, after stopping due to a signal, that signal can be * replaced with another signal. */ @@ -2674,15 +2774,6 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_with_signal_kqueue, tc ATF_REQUIRE(errno == ECHILD); } -static sem_t sigusr1_sem; - -static void -sigusr1_sempost_handler(int sig __unused) -{ - - CHILD_REQUIRE(sem_post(&sigusr1_sem) == 0); -} - static void * signal_thread(void *arg) { @@ -2718,6 +2809,148 @@ signal_thread(void *arg) } /* + * Verify that a traced process with blocked signal received the + * signal from kill() once unmasked. + */ +ATF_TC_WITHOUT_HEAD(ptrace__killed_with_sigmask); +ATF_TC_BODY(ptrace__killed_with_sigmask, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int status, err; + sigset_t sigmask; + + ATF_REQUIRE(sem_init(&sigusr1_sem, 0, 0) == 0); + ATF_REQUIRE(signal(SIGUSR1, sigusr1_sempost_handler) != SIG_ERR); + got_usr1 = 0; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + CHILD_REQUIRE(sigemptyset(&sigmask) == 0); + CHILD_REQUIRE(sigaddset(&sigmask, SIGUSR1) == 0); + CHILD_REQUIRE(sigprocmask(SIG_BLOCK, &sigmask, NULL) == 0); + + trace_me(); + CHILD_REQUIRE(got_usr1 == 0); + + /* Allow the pending SIGUSR1 in now. */ + CHILD_REQUIRE(sigprocmask(SIG_UNBLOCK, &sigmask, NULL) == 0); + /* Wait to receive a SIGUSR1. */ + do { + err = sem_wait(&sigusr1_sem); + CHILD_REQUIRE(err == 0 || errno == EINTR); + } while (err != 0 && errno == EINTR); + CHILD_REQUIRE(got_usr1 == 1); + exit(1); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + ATF_REQUIRE(ptrace(PT_LWPINFO, fpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGSTOP); + + /* Send blocked SIGUSR1 which should cause a stop. */ + ATF_REQUIRE(kill(fpid, SIGUSR1) == 0); + + /* Continue the child ignoring the SIGSTOP. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The next wait() should report the kill(SIGUSR1) was received. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGUSR1); + ATF_REQUIRE(ptrace(PT_LWPINFO, fpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGUSR1); + + /* Continue the child, allowing in the SIGUSR1. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, SIGUSR1) == 0); + + /* The last wait() should report normal exit with code 1. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + +/* + * Verify that a traced process with blocked signal received the + * signal from PT_CONTINUE once unmasked. + */ +ATF_TC_WITHOUT_HEAD(ptrace__PT_CONTINUE_with_sigmask); +ATF_TC_BODY(ptrace__PT_CONTINUE_with_sigmask, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int status, err; + sigset_t sigmask; + + ATF_REQUIRE(sem_init(&sigusr1_sem, 0, 0) == 0); + ATF_REQUIRE(signal(SIGUSR1, sigusr1_sempost_handler) != SIG_ERR); + got_usr1 = 0; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + CHILD_REQUIRE(sigemptyset(&sigmask) == 0); + CHILD_REQUIRE(sigaddset(&sigmask, SIGUSR1) == 0); + CHILD_REQUIRE(sigprocmask(SIG_BLOCK, &sigmask, NULL) == 0); + + trace_me(); + CHILD_REQUIRE(got_usr1 == 0); + + /* Allow the pending SIGUSR1 in now. */ + CHILD_REQUIRE(sigprocmask(SIG_UNBLOCK, &sigmask, NULL) == 0); + /* Wait to receive a SIGUSR1. */ + do { + err = sem_wait(&sigusr1_sem); + CHILD_REQUIRE(err == 0 || errno == EINTR); + } while (err != 0 && errno == EINTR); + + CHILD_REQUIRE(got_usr1 == 1); + exit(1); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + ATF_REQUIRE(ptrace(PT_LWPINFO, fpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGSTOP); + + /* Continue the child replacing SIGSTOP with SIGUSR1. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, SIGUSR1) == 0); + + /* The next wait() should report the SIGUSR1 was received. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGUSR1); + ATF_REQUIRE(ptrace(PT_LWPINFO, fpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGUSR1); + + /* Continue the child, ignoring the SIGUSR1. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last wait() should report normal exit with code 1. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + +/* * Verify that if ptrace stops due to a signal but continues with * a different signal that the new signal is routed to a thread * that can accept it, and that that thread is awakened by the signal @@ -3183,10 +3416,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_with_signal_system_call_entry_and_exit); ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_with_signal_full_sigqueue); + ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_with_signal_masked_full_sigqueue); ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_change_sig); ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_with_sigtrap_system_call_entry); ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_with_signal_mix); ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_with_signal_kqueue); + ATF_TP_ADD_TC(tp, ptrace__killed_with_sigmask); + ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_with_sigmask); ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_with_signal_thread_sigmask); ATF_TP_ADD_TC(tp, ptrace__parent_terminate_with_pending_sigstop1); ATF_TP_ADD_TC(tp, ptrace__parent_terminate_with_pending_sigstop2); From owner-svn-src-head@freebsd.org Tue Oct 17 19:11:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D7C6E44B05; Tue, 17 Oct 2017 19:11:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0DDC7EF84; Tue, 17 Oct 2017 19:11:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HJBKQP092638; Tue, 17 Oct 2017 19:11:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HJBKdT092637; Tue, 17 Oct 2017 19:11:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710171911.v9HJBKdT092637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Oct 2017 19:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324702 - head/sys/boot/uboot/lib X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/uboot/lib X-SVN-Commit-Revision: 324702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 19:11:21 -0000 Author: imp Date: Tue Oct 17 19:11:19 2017 New Revision: 324702 URL: https://svnweb.freebsd.org/changeset/base/324702 Log: We need to include disk.o in libuboot.a when we're building with support for disk access. Sponsored by: Netflix Modified: head/sys/boot/uboot/lib/Makefile Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Tue Oct 17 19:01:01 2017 (r324701) +++ head/sys/boot/uboot/lib/Makefile Tue Oct 17 19:11:19 2017 (r324702) @@ -13,6 +13,10 @@ SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float +.if ${LOADER_DISK_SUPPORT:Uyes} == "yes" +SRCS+= disk.c +.endif + .if ${MK_FDT} != "no" LOADER_FDT_SUPPORT= yes .else From owner-svn-src-head@freebsd.org Tue Oct 17 19:11:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3B9BE44B55; Tue, 17 Oct 2017 19:11:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9074C7F037; Tue, 17 Oct 2017 19:11:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HJBTdI093442; Tue, 17 Oct 2017 19:11:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HJBTxV093441; Tue, 17 Oct 2017 19:11:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710171911.v9HJBTxV093441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 17 Oct 2017 19:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324703 - head/sys/boot X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/boot X-SVN-Commit-Revision: 324703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 19:11:30 -0000 Author: emaste Date: Tue Oct 17 19:11:29 2017 New Revision: 324703 URL: https://svnweb.freebsd.org/changeset/base/324703 Log: loader.mk: clean md.o even if MD_IMAGE_SIZE not defined We don't normally provide special handling for optionally-included src files, but md.o depends on both md.c and the value of ${MD_IMAGE_SIZE}. Previously if one built with MD_IMAGE_SIZE, executed "make clean", and then built with a different MD_IMAGE_SIZE md.o would not be rebuilt. Reported by: Zakary Nafziger Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/loader.mk Modified: head/sys/boot/loader.mk ============================================================================== --- head/sys/boot/loader.mk Tue Oct 17 19:11:19 2017 (r324702) +++ head/sys/boot/loader.mk Tue Oct 17 19:11:29 2017 (r324703) @@ -43,6 +43,8 @@ SRCS+= bcache.c .if defined(MD_IMAGE_SIZE) CFLAGS+= -DMD_IMAGE_SIZE=${MD_IMAGE_SIZE} SRCS+= md.c +.else +CLEANFILES+= md.o .endif # Machine-independant ISA PnP From owner-svn-src-head@freebsd.org Tue Oct 17 19:41:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A37B1E45AC3; Tue, 17 Oct 2017 19:41:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 678F6800BB; Tue, 17 Oct 2017 19:41:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HJfjIG004563; Tue, 17 Oct 2017 19:41:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HJfjrR004562; Tue, 17 Oct 2017 19:41:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201710171941.v9HJfjrR004562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 17 Oct 2017 19:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324704 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 19:41:46 -0000 Author: markj Date: Tue Oct 17 19:41:45 2017 New Revision: 324704 URL: https://svnweb.freebsd.org/changeset/base/324704 Log: Fix a racy VI_DOOMED check in MNT_VNODE_FOREACH_ALL(). MNT_VNODE_FOREACH_ALL() is supposed to avoid returning doomed vnodes, but the VI_DOOMED check it used was done without the vnode interlock held, so it could race with a concurrent vgone(). Submitted by: Don Morris Reviewed by: kib, mckusick MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12704 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Oct 17 19:11:29 2017 (r324703) +++ head/sys/kern/vfs_subr.c Tue Oct 17 19:41:45 2017 (r324704) @@ -5299,12 +5299,18 @@ __mnt_vnode_next_all(struct vnode **mvp, struct mount kern_yield(PRI_USER); MNT_ILOCK(mp); KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); - vp = TAILQ_NEXT(*mvp, v_nmntvnodes); - while (vp != NULL && (vp->v_type == VMARKER || - (vp->v_iflag & VI_DOOMED) != 0)) - vp = TAILQ_NEXT(vp, v_nmntvnodes); - - /* Check if we are done */ + for (vp = TAILQ_NEXT(*mvp, v_nmntvnodes); vp != NULL; + vp = TAILQ_NEXT(vp, v_nmntvnodes)) { + /* Allow a racy peek at VI_DOOMED to save a lock acquisition. */ + if (vp->v_type == VMARKER || (vp->v_iflag & VI_DOOMED) != 0) + continue; + VI_LOCK(vp); + if ((vp->v_iflag & VI_DOOMED) != 0) { + VI_UNLOCK(vp); + continue; + } + break; + } if (vp == NULL) { __mnt_vnode_markerfree_all(mvp, mp); /* MNT_IUNLOCK(mp); -- done in above function */ @@ -5313,7 +5319,6 @@ __mnt_vnode_next_all(struct vnode **mvp, struct mount } TAILQ_REMOVE(&mp->mnt_nvnodelist, *mvp, v_nmntvnodes); TAILQ_INSERT_AFTER(&mp->mnt_nvnodelist, vp, *mvp, v_nmntvnodes); - VI_LOCK(vp); MNT_IUNLOCK(mp); return (vp); } @@ -5326,14 +5331,20 @@ __mnt_vnode_first_all(struct vnode **mvp, struct mount *mvp = malloc(sizeof(struct vnode), M_VNODE_MARKER, M_WAITOK | M_ZERO); MNT_ILOCK(mp); MNT_REF(mp); + (*mvp)->v_mount = mp; (*mvp)->v_type = VMARKER; - vp = TAILQ_FIRST(&mp->mnt_nvnodelist); - while (vp != NULL && (vp->v_type == VMARKER || - (vp->v_iflag & VI_DOOMED) != 0)) - vp = TAILQ_NEXT(vp, v_nmntvnodes); - - /* Check if we are done */ + TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) { + /* Allow a racy peek at VI_DOOMED to save a lock acquisition. */ + if (vp->v_type == VMARKER || (vp->v_iflag & VI_DOOMED) != 0) + continue; + VI_LOCK(vp); + if ((vp->v_iflag & VI_DOOMED) != 0) { + VI_UNLOCK(vp); + continue; + } + break; + } if (vp == NULL) { MNT_REL(mp); MNT_IUNLOCK(mp); @@ -5341,13 +5352,10 @@ __mnt_vnode_first_all(struct vnode **mvp, struct mount *mvp = NULL; return (NULL); } - (*mvp)->v_mount = mp; TAILQ_INSERT_AFTER(&mp->mnt_nvnodelist, vp, *mvp, v_nmntvnodes); - VI_LOCK(vp); MNT_IUNLOCK(mp); return (vp); } - void __mnt_vnode_markerfree_all(struct vnode **mvp, struct mount *mp) From owner-svn-src-head@freebsd.org Tue Oct 17 20:37:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 956DBE4709A; Tue, 17 Oct 2017 20:37:32 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 643E482B21; Tue, 17 Oct 2017 20:37:32 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HKbVtq031370; Tue, 17 Oct 2017 20:37:31 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HKbVrv031368; Tue, 17 Oct 2017 20:37:31 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201710172037.v9HKbVrv031368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Tue, 17 Oct 2017 20:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324705 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 324705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 20:37:32 -0000 Author: rlibby Date: Tue Oct 17 20:37:31 2017 New Revision: 324705 URL: https://svnweb.freebsd.org/changeset/base/324705 Log: cxgbe: delete now-redundant vnet decls r324539 gathered some vnet decls into netinet/tcp_var.h, so that they are now redundant in dev/cxgbe/tom/{t4_cpl_io.c,t4_ddp.c}. This triggers gcc -Wredundant-decls. Reviewed by: np Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12674 Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Oct 17 19:41:45 2017 (r324704) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Tue Oct 17 20:37:31 2017 (r324705) @@ -71,19 +71,6 @@ __FBSDID("$FreeBSD$"); #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" -VNET_DECLARE(int, tcp_do_autosndbuf); -#define V_tcp_do_autosndbuf VNET(tcp_do_autosndbuf) -VNET_DECLARE(int, tcp_autosndbuf_inc); -#define V_tcp_autosndbuf_inc VNET(tcp_autosndbuf_inc) -VNET_DECLARE(int, tcp_autosndbuf_max); -#define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) -VNET_DECLARE(int, tcp_do_autorcvbuf); -#define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) -VNET_DECLARE(int, tcp_autorcvbuf_inc); -#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) -VNET_DECLARE(int, tcp_autorcvbuf_max); -#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) - #define IS_AIOTX_MBUF(m) \ ((m)->m_flags & M_EXT && (m)->m_ext.ext_flags & EXT_FLAG_AIOTX) Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Tue Oct 17 19:41:45 2017 (r324704) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Tue Oct 17 20:37:31 2017 (r324705) @@ -67,13 +67,6 @@ __FBSDID("$FreeBSD$"); #include "common/t4_tcb.h" #include "tom/t4_tom.h" -VNET_DECLARE(int, tcp_do_autorcvbuf); -#define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) -VNET_DECLARE(int, tcp_autorcvbuf_inc); -#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) -VNET_DECLARE(int, tcp_autorcvbuf_max); -#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) - /* * Use the 'backend3' field in AIO jobs to store the amount of data * received by the AIO job so far. From owner-svn-src-head@freebsd.org Tue Oct 17 20:45:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEC21E472FE; Tue, 17 Oct 2017 20:45:45 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADD3D82FD3; Tue, 17 Oct 2017 20:45:45 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HKjiPT035519; Tue, 17 Oct 2017 20:45:44 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HKjiHD035513; Tue, 17 Oct 2017 20:45:44 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201710172045.v9HKjiHD035513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Tue, 17 Oct 2017 20:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324706 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 324706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 20:45:46 -0000 Author: fsu Date: Tue Oct 17 20:45:44 2017 New Revision: 324706 URL: https://svnweb.freebsd.org/changeset/base/324706 Log: Add inital extents read-write support. Approved by: pfg (mentor) MFC after: 6 months RelNotes: Yes Differential Revision: https://reviews.freebsd.org/D12087 Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extattr.c head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_extents.h head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Tue Oct 17 20:37:31 2017 (r324705) +++ head/sys/fs/ext2fs/ext2_alloc.c Tue Oct 17 20:45:44 2017 (r324706) @@ -135,19 +135,20 @@ nospace: * Allocate EA's block for inode. */ daddr_t -ext2_allocfacl(struct inode *ip) +ext2_alloc_meta(struct inode *ip) { struct m_ext2fs *fs; - daddr_t facl; + daddr_t blk; fs = ip->i_e2fs; EXT2_LOCK(ip->i_ump); - facl = ext2_alloccg(ip, ino_to_cg(fs, ip->i_number), 0, fs->e2fs_bsize); - if (0 == facl) + blk = ext2_hashalloc(ip, ino_to_cg(fs, ip->i_number), 0, fs->e2fs_bsize, + ext2_alloccg); + if (0 == blk) EXT2_UNLOCK(ip->i_ump); - return (facl); + return (blk); } /* @@ -200,7 +201,7 @@ ext2_reallocblks(struct vop_reallocblks_args *ap) fs = ip->i_e2fs; ump = ip->i_ump; - if (fs->e2fs_contigsumsize <= 0) + if (fs->e2fs_contigsumsize <= 0 || ip->i_flag & IN_E4EXTENTS) return (ENOSPC); buflist = ap->a_buflist; @@ -375,7 +376,7 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred struct inode *ip; struct ext2mount *ump; ino_t ino, ipref; - int i, error, cg; + int error, cg; *vpp = NULL; pip = VTOI(pvp); @@ -421,11 +422,12 @@ ext2_valloc(struct vnode *pvp, int mode, struct ucred ip->i_blocks = 0; ip->i_mode = 0; ip->i_flags = 0; - /* now we want to make sure that the block pointers are zeroed out */ - for (i = 0; i < EXT2_NDADDR; i++) - ip->i_db[i] = 0; - for (i = 0; i < EXT2_NIADDR; i++) - ip->i_ib[i] = 0; + if (EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_EXTENTS) + && (S_ISREG(mode) || S_ISDIR(mode))) + ext4_ext_tree_init(ip); + else + memset(ip->i_data, 0, sizeof(ip->i_data)); + /* * Set up a new generation number for this inode. @@ -575,8 +577,11 @@ e4fs_daddr_t ext2_blkpref(struct inode *ip, e2fs_lbn_t lbn, int indx, e2fs_daddr_t *bap, e2fs_daddr_t blocknr) { + struct m_ext2fs *fs; int tmp; + fs = ip->i_e2fs; + mtx_assert(EXT2_MTX(ip->i_ump), MA_OWNED); /* @@ -599,10 +604,9 @@ ext2_blkpref(struct inode *ip, e2fs_lbn_t lbn, int ind * Else lets fall back to the blocknr or, if there is none, follow * the rule that a block should be allocated near its inode. */ - return blocknr ? blocknr : + return (blocknr ? blocknr : (e2fs_daddr_t)(ip->i_block_group * - EXT2_BLOCKS_PER_GROUP(ip->i_e2fs)) + - ip->i_e2fs->e2fs->e2fs_first_dblock; + EXT2_BLOCKS_PER_GROUP(fs)) + fs->e2fs->e2fs_first_dblock); } /* Modified: head/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_balloc.c Tue Oct 17 20:37:31 2017 (r324705) +++ head/sys/fs/ext2fs/ext2_balloc.c Tue Oct 17 20:45:44 2017 (r324706) @@ -51,6 +51,76 @@ #include #include +static int +ext2_ext_balloc(struct inode *ip, uint32_t lbn, int size, + struct ucred *cred, struct buf **bpp, int flags) +{ + struct m_ext2fs *fs; + struct buf *bp = NULL; + struct vnode *vp = ITOV(ip); + uint32_t nb; + int osize, nsize, blks, error, allocated; + + fs = ip->i_e2fs; + blks = howmany(size, fs->e2fs_bsize); + + error = ext4_ext_get_blocks(ip, lbn, blks, cred, NULL, &allocated, &nb); + if (error) + return (error); + + if (allocated) { + if (ip->i_size < (lbn + 1) * fs->e2fs_bsize) + nsize = fragroundup(fs, size); + else + nsize = fs->e2fs_bsize; + + bp = getblk(vp, lbn, nsize, 0, 0, 0); + if(!bp) + return (EIO); + + bp->b_blkno = fsbtodb(fs, nb); + if (flags & BA_CLRBUF) + vfs_bio_clrbuf(bp); + } else { + if (ip->i_size >= (lbn + 1) * fs->e2fs_bsize) { + + error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp); + if (error) { + brelse(bp); + return (error); + } + bp->b_blkno = fsbtodb(fs, nb); + *bpp = bp; + return (0); + } + + /* + * Consider need to reallocate a fragment. + */ + osize = fragroundup(fs, blkoff(fs, ip->i_size)); + nsize = fragroundup(fs, size); + if (nsize <= osize) { + error = bread(vp, lbn, osize, NOCRED, &bp); + if (error) { + brelse(bp); + return (error); + } + bp->b_blkno = fsbtodb(fs, nb); + } else { + error = bread(vp, lbn, fs->e2fs_bsize, NOCRED, &bp); + if (error) { + brelse(bp); + return (error); + } + bp->b_blkno = fsbtodb(fs, nb); + } + } + + *bpp = bp; + + return (error); +} + /* * Balloc defines the structure of filesystem storage * by allocating the physical blocks on a device given @@ -84,6 +154,10 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size ip->i_next_alloc_block++; ip->i_next_alloc_goal++; } + + if (ip->i_flag & IN_E4EXTENTS) + return (ext2_ext_balloc(ip, lbn, size, cred, bpp, flags)); + /* * The first EXT2_NDADDR blocks are direct blocks */ Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Tue Oct 17 20:37:31 2017 (r324705) +++ head/sys/fs/ext2fs/ext2_bmap.c Tue Oct 17 20:45:44 2017 (r324706) @@ -53,8 +53,6 @@ #include #include -static int ext4_bmapext(struct vnode *, int32_t, int64_t *, int *, int *); - /* * Bmap converts the logical block number of a file to its physical block * number on the disk. The conversion is done by using the logical block @@ -89,55 +87,52 @@ ext2_bmap(struct vop_bmap_args *ap) * Convert the logical block number of a file to its physical block number * on the disk within ext4 extents. */ -static int +int ext4_bmapext(struct vnode *vp, int32_t bn, int64_t *bnp, int *runp, int *runb) { struct inode *ip; struct m_ext2fs *fs; + struct ext4_extent_header *ehp; struct ext4_extent *ep; - struct ext4_extent_path path = {.ep_bp = NULL}; + struct ext4_extent_path *path = NULL; daddr_t lbn; - int error; + int error, depth; ip = VTOI(vp); fs = ip->i_e2fs; lbn = bn; + ehp = (struct ext4_extent_header *)ip->i_data; + depth = ehp->eh_depth; + *bnp = -1; if (runp != NULL) *runp = 0; if (runb != NULL) *runb = 0; - error = 0; - ext4_ext_find_extent(fs, ip, lbn, &path); - if (path.ep_is_sparse) { - *bnp = -1; - if (runp != NULL) - *runp = path.ep_sparse_ext.e_len - - (lbn - path.ep_sparse_ext.e_blk) - 1; - if (runb != NULL) - *runb = lbn - path.ep_sparse_ext.e_blk; - } else { - if (path.ep_ext == NULL) { - error = EIO; - goto out; - } - ep = path.ep_ext; - *bnp = fsbtodb(fs, lbn - ep->e_blk + - (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + error = ext4_ext_find_extent(ip, lbn, &path); + if (error) + return (error); - if (*bnp == 0) - *bnp = -1; - - if (runp != NULL) - *runp = ep->e_len - (lbn - ep->e_blk) - 1; - if (runb != NULL) - *runb = lbn - ep->e_blk; + ep = path[depth].ep_ext; + if(ep) { + if (lbn < ep->e_blk) { + if (runp != NULL) + *runp = ep->e_blk - lbn - 1; + } else if (ep->e_blk <= lbn && lbn < ep->e_blk + ep->e_len) { + *bnp = fsbtodb(fs, lbn - ep->e_blk + + (ep->e_start_lo | (daddr_t)ep->e_start_hi << 32)); + if (runp != NULL) + *runp = ep->e_len - (lbn - ep->e_blk) - 1; + if (runb != NULL) + *runb = lbn - ep->e_blk; + } else { + if (runb != NULL) + *runb = ep->e_blk + lbn - ep->e_len; + } } -out: - if (path.ep_bp != NULL) - brelse(path.ep_bp); + ext4_ext_path_free(path); return (error); } Modified: head/sys/fs/ext2fs/ext2_extattr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extattr.c Tue Oct 17 20:37:31 2017 (r324705) +++ head/sys/fs/ext2fs/ext2_extattr.c Tue Oct 17 20:45:44 2017 (r324706) @@ -612,7 +612,7 @@ ext2_extattr_block_clone(struct inode *ip, struct buf if (header->h_magic != EXTATTR_MAGIC || header->h_refcount == 1) return (EINVAL); - facl = ext2_allocfacl(ip); + facl = ext2_alloc_meta(ip); if (!facl) return (ENOSPC); @@ -1137,7 +1137,7 @@ ext2_extattr_block_set(struct inode *ip, int attrnames return (ENOSPC); /* Allocate block, fill EA header and insert entry */ - ip->i_facl = ext2_allocfacl(ip); + ip->i_facl = ext2_alloc_meta(ip); if (0 == ip->i_facl) return (ENOSPC); Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Tue Oct 17 20:37:31 2017 (r324705) +++ head/sys/fs/ext2fs/ext2_extents.c Tue Oct 17 20:45:44 2017 (r324706) @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -43,87 +44,163 @@ #include #include -static bool -ext4_ext_binsearch_index(struct inode *ip, struct ext4_extent_path *path, - daddr_t lbn, daddr_t *first_lbn, daddr_t *last_lbn){ - struct ext4_extent_header *ehp = path->ep_header; - struct ext4_extent_index *first, *last, *l, *r, *m; +static MALLOC_DEFINE(M_EXT2EXTENTS, "ext2_extents", "EXT2 extents"); - first = (struct ext4_extent_index *)(char *)(ehp + 1); - last = first + ehp->eh_ecount - 1; - l = first; - r = last; - while (l <= r) { - m = l + (r - l) / 2; - if (lbn < m->ei_blk) - r = m - 1; - else - l = m + 1; - } +#ifdef EXT2FS_DEBUG +static void +ext4_ext_print_extent(struct ext4_extent *ep) +{ - if (l == first) { - path->ep_sparse_ext.e_blk = *first_lbn; - path->ep_sparse_ext.e_len = first->ei_blk - *first_lbn; - path->ep_sparse_ext.e_start_hi = 0; - path->ep_sparse_ext.e_start_lo = 0; - path->ep_is_sparse = true; - return (true); - } - path->ep_index = l - 1; - *first_lbn = path->ep_index->ei_blk; - if (path->ep_index < last) - *last_lbn = l->ei_blk - 1; - return (false); + printf(" ext %p => (blk %u len %u start %lu)\n", + ep, ep->e_blk, ep->e_len, + (uint64_t)ep->e_start_hi << 32 | ep->e_start_lo); } +static void ext4_ext_print_header(struct inode *ip, struct ext4_extent_header *ehp); + static void -ext4_ext_binsearch(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn, - daddr_t first_lbn, daddr_t last_lbn) +ext4_ext_print_index(struct inode *ip, struct ext4_extent_index *ex, int do_walk) { - struct ext4_extent_header *ehp = path->ep_header; - struct ext4_extent *first, *l, *r, *m; + struct m_ext2fs *fs; + struct buf *bp; + int error; - if (ehp->eh_ecount == 0) - return; + fs = ip->i_e2fs; - first = (struct ext4_extent *)(char *)(ehp + 1); - l = first; - r = first + ehp->eh_ecount - 1; - while (l <= r) { - m = l + (r - l) / 2; - if (lbn < m->e_blk) - r = m - 1; - else - l = m + 1; - } + printf(" index %p => (blk %u pblk %lu)\n", + ex, ex->ei_blk, (uint64_t)ex->ei_leaf_hi << 32 | ex->ei_leaf_lo); - if (l == first) { - path->ep_sparse_ext.e_blk = first_lbn; - path->ep_sparse_ext.e_len = first->e_blk - first_lbn; - path->ep_sparse_ext.e_start_hi = 0; - path->ep_sparse_ext.e_start_lo = 0; - path->ep_is_sparse = true; + if(!do_walk) return; + + if ((error = bread(ip->i_devvp, + fsbtodb(fs, ((uint64_t)ex->ei_leaf_hi << 32 | ex->ei_leaf_lo)), + (int)fs->e2fs_bsize, NOCRED, &bp)) != 0) { + brelse(bp); + return; } - path->ep_ext = l - 1; - if (path->ep_ext->e_blk + path->ep_ext->e_len <= lbn) { - path->ep_sparse_ext.e_blk = path->ep_ext->e_blk + - path->ep_ext->e_len; - if (l <= (first + ehp->eh_ecount - 1)) - path->ep_sparse_ext.e_len = l->e_blk - - path->ep_sparse_ext.e_blk; + + ext4_ext_print_header(ip, (struct ext4_extent_header *)bp->b_data); + + brelse(bp); + +} + +static void +ext4_ext_print_header(struct inode *ip, struct ext4_extent_header *ehp) +{ + int i; + + printf("header %p => (magic 0x%x entries %d max %d depth %d gen %d)\n", + ehp, ehp->eh_magic, ehp->eh_ecount, ehp->eh_max, ehp->eh_depth, + ehp->eh_gen); + + for (i = 0; i < ehp->eh_ecount; i++) + if (ehp->eh_depth != 0) + ext4_ext_print_index(ip, + (struct ext4_extent_index *)(ehp + 1 + i), 1); else - path->ep_sparse_ext.e_len = last_lbn - - path->ep_sparse_ext.e_blk + 1; - path->ep_sparse_ext.e_start_hi = 0; - path->ep_sparse_ext.e_start_lo = 0; - path->ep_is_sparse = true; + ext4_ext_print_extent((struct ext4_extent *)(ehp + 1 + i)); +} + +static void +ext4_ext_print_path(struct inode *ip, struct ext4_extent_path *path) +{ + int k, l; + + l = path->ep_depth + + printf("ip=%d, Path:\n", ip->i_number); + for (k = 0; k <= l; k++, path++) { + if (path->ep_index) { + ext4_ext_print_index(ip, path->ep_index, 0); + } else if (path->ep_ext) { + ext4_ext_print_extent(path->ep_ext); + } } } -/* - * Find a block in ext4 extent cache. - */ +void +ext4_ext_print_extent_tree_status(struct inode * ip) +{ + struct m_ext2fs *fs; + struct ext4_extent_header *ehp; + + fs = ip->i_e2fs; + ehp = (struct ext4_extent_header *)(char *)ip->i_db; + + printf("Extent status:ip=%d\n", ip->i_number); + if (!(ip->i_flag & IN_E4EXTENTS)) + return; + + ext4_ext_print_header(ip, ehp); + + return; +} +#endif + +static inline struct ext4_extent_header * +ext4_ext_inode_header(struct inode *ip) +{ + + return ((struct ext4_extent_header *)ip->i_db); +} + +static inline struct ext4_extent_header * +ext4_ext_block_header(char *bdata) +{ + + return ((struct ext4_extent_header *)bdata); +} + +static inline unsigned short +ext4_ext_inode_depth(struct inode *ip) +{ + struct ext4_extent_header *ehp; + + ehp = (struct ext4_extent_header *)ip->i_data; + return (ehp->eh_depth); +} + +static inline e4fs_daddr_t +ext4_ext_index_pblock(struct ext4_extent_index *index) +{ + e4fs_daddr_t blk; + + blk = index->ei_leaf_lo; + blk |= (e4fs_daddr_t)index->ei_leaf_hi << 32; + + return (blk); +} + +static inline void +ext4_index_store_pblock(struct ext4_extent_index *index, e4fs_daddr_t pb) +{ + + index->ei_leaf_lo = pb & 0xffffffff; + index->ei_leaf_hi = (pb >> 32) & 0xffff; +} + + +static inline e4fs_daddr_t +ext4_ext_extent_pblock(struct ext4_extent *extent) +{ + e4fs_daddr_t blk; + + blk = extent->e_start_lo; + blk |= (e4fs_daddr_t)extent->e_start_hi << 32; + + return (blk); +} + +static inline void +ext4_ext_store_pblock(struct ext4_extent *ex, e4fs_daddr_t pb) +{ + + ex->e_start_lo = pb & 0xffffffff; + ex->e_start_hi = (pb >> 32) & 0xffff; +} + int ext4_ext_in_cache(struct inode *ip, daddr_t lbn, struct ext4_extent *ep) { @@ -131,8 +208,6 @@ ext4_ext_in_cache(struct inode *ip, daddr_t lbn, struc int ret = EXT4_EXT_CACHE_NO; ecp = &ip->i_ext_cache; - - /* cache is invalid */ if (ecp->ec_type == EXT4_EXT_CACHE_NO) return (ret); @@ -146,74 +221,1367 @@ ext4_ext_in_cache(struct inode *ip, daddr_t lbn, struc return (ret); } -/* - * Put an ext4_extent structure in ext4 cache. - */ +static int +ext4_ext_check_header(struct inode *ip, struct ext4_extent_header *eh) +{ + struct m_ext2fs *fs; + char *error_msg; + + fs = ip->i_e2fs; + + if (eh->eh_magic != EXT4_EXT_MAGIC) { + error_msg = "invalid magic"; + goto corrupted; + } + if (eh->eh_max == 0) { + error_msg = "invalid eh_max"; + goto corrupted; + } + if (eh->eh_ecount > eh->eh_max) { + error_msg = "invalid eh_entries"; + goto corrupted; + } + + return (0); + +corrupted: + ext2_fserr(fs, ip->i_uid, error_msg); + return (EIO); +} + +static void +ext4_ext_binsearch_index(struct ext4_extent_path *path, int blk) +{ + struct ext4_extent_header *eh; + struct ext4_extent_index *r, *l, *m; + + eh = path->ep_header; + + KASSERT(eh->eh_ecount <= eh->eh_max && eh->eh_ecount > 0, + ("ext4_ext_binsearch_index: bad args")); + + l = EXT_FIRST_INDEX(eh) + 1; + r = EXT_FIRST_INDEX(eh) + eh->eh_ecount - 1; + while (l <= r) { + m = l + (r - l) / 2; + if (blk < m->ei_blk) + r = m - 1; + else + l = m + 1; + } + + path->ep_index = l - 1; +} + +static void +ext4_ext_binsearch_ext(struct ext4_extent_path *path, int blk) +{ + struct ext4_extent_header *eh; + struct ext4_extent *r, *l, *m; + + eh = path->ep_header; + + KASSERT(eh->eh_ecount <= eh->eh_max, + ("ext4_ext_binsearch_ext: bad args")); + + if (eh->eh_ecount == 0) + return; + + l = EXT_FIRST_EXTENT(eh) + 1; + r = EXT_FIRST_EXTENT(eh) + eh->eh_ecount - 1; + + while (l <= r) { + m = l + (r - l) / 2; + if (blk < m->e_blk) + r = m - 1; + else + l = m + 1; + } + + path->ep_ext = l - 1; +} + +static int +ext4_ext_fill_path_bdata(struct ext4_extent_path *path, + struct buf *bp, uint64_t blk) +{ + + KASSERT(path->ep_data == NULL, + ("ext4_ext_fill_path_bdata: bad ep_data")); + + path->ep_data = malloc(bp->b_bufsize, M_EXT2EXTENTS, M_WAITOK); + if (!path->ep_data) + return (ENOMEM); + + memcpy(path->ep_data, bp->b_data, bp->b_bufsize); + path->ep_blk = blk; + + return (0); +} + +static void +ext4_ext_fill_path_buf(struct ext4_extent_path *path, struct buf *bp) +{ + + KASSERT(path->ep_data != NULL, + ("ext4_ext_fill_path_buf: bad ep_data")); + + memcpy(bp->b_data, path->ep_data, bp->b_bufsize); +} + +static void +ext4_ext_drop_refs(struct ext4_extent_path *path) +{ + int depth, i; + + if (!path) + return; + + depth = path->ep_depth; + for (i = 0; i <= depth; i++, path++) + if (path->ep_data) { + free(path->ep_data, M_EXT2EXTENTS); + path->ep_data = NULL; + } +} + void -ext4_ext_put_cache(struct inode *ip, struct ext4_extent *ep, int type) +ext4_ext_path_free(struct ext4_extent_path *path) { - struct ext4_extent_cache *ecp; - ecp = &ip->i_ext_cache; - ecp->ec_type = type; - ecp->ec_blk = ep->e_blk; - ecp->ec_len = ep->e_len; - ecp->ec_start = (daddr_t)ep->e_start_hi << 32 | ep->e_start_lo; + if (!path) + return; + + ext4_ext_drop_refs(path); + free(path, M_EXT2EXTENTS); } -/* - * Find an extent. - */ -struct ext4_extent_path * -ext4_ext_find_extent(struct m_ext2fs *fs, struct inode *ip, - daddr_t lbn, struct ext4_extent_path *path) +int +ext4_ext_find_extent(struct inode *ip, daddr_t block, + struct ext4_extent_path **ppath) { + struct m_ext2fs *fs; + struct ext4_extent_header *eh; + struct ext4_extent_path *path; + struct buf *bp; + uint64_t blk; + int error, depth, i, ppos, alloc; + + fs = ip->i_e2fs; + eh = ext4_ext_inode_header(ip); + depth = ext4_ext_inode_depth(ip); + ppos = 0; + alloc = 0; + + error = ext4_ext_check_header(ip, eh); + if (error) + return (error); + + if (!ppath) + return (EINVAL); + + path = *ppath; + if (!path) { + path = malloc(EXT4_EXT_DEPTH_MAX * + sizeof(struct ext4_extent_path), + M_EXT2EXTENTS, M_WAITOK | M_ZERO); + if (!path) + return (ENOMEM); + + *ppath = path; + alloc = 1; + } + + path[0].ep_header = eh; + path[0].ep_data = NULL; + + /* Walk through the tree. */ + i = depth; + while (i) { + ext4_ext_binsearch_index(&path[ppos], block); + blk = ext4_ext_index_pblock(path[ppos].ep_index); + path[ppos].ep_depth = i; + path[ppos].ep_ext = NULL; + + error = bread(ip->i_devvp, fsbtodb(ip->i_e2fs, blk), + ip->i_e2fs->e2fs_bsize, NOCRED, &bp); + if (error) { + brelse(bp); + goto error; + } + + ppos++; + if (ppos > depth) { + ext2_fserr(fs, ip->i_uid, + "ppos > depth => extent corrupted"); + error = EIO; + brelse(bp); + goto error; + } + + ext4_ext_fill_path_bdata(&path[ppos], bp, blk); + brelse(bp); + + eh = ext4_ext_block_header(path[ppos].ep_data); + error = ext4_ext_check_header(ip, eh); + if (error) + goto error; + + path[ppos].ep_header = eh; + + i--; + } + + error = ext4_ext_check_header(ip, eh); + if (error) + goto error; + + /* Find extent. */ + path[ppos].ep_depth = i; + path[ppos].ep_header = eh; + path[ppos].ep_ext = NULL; + path[ppos].ep_index = NULL; + ext4_ext_binsearch_ext(&path[ppos], block); + return (0); + +error: + ext4_ext_drop_refs(path); + if (alloc) + free(path, M_EXT2EXTENTS); + + *ppath = NULL; + + return (error); +} + +static inline int +ext4_ext_space_root(struct inode *ip) +{ + int size; + + size = sizeof(ip->i_data); + size -= sizeof(struct ext4_extent_header); + size /= sizeof(struct ext4_extent); + + return (size); +} + +static inline int +ext4_ext_space_block(struct inode *ip) +{ + struct m_ext2fs *fs; + int size; + + fs = ip->i_e2fs; + + size = (fs->e2fs_bsize - sizeof(struct ext4_extent_header)) / + sizeof(struct ext4_extent); + + return (size); +} + +static inline int +ext4_ext_space_block_index(struct inode *ip) +{ + struct m_ext2fs *fs; + int size; + + fs = ip->i_e2fs; + + size = (fs->e2fs_bsize - sizeof(struct ext4_extent_header)) / + sizeof(struct ext4_extent_index); + + return (size); +} + +void +ext4_ext_tree_init(struct inode *ip) +{ struct ext4_extent_header *ehp; - uint16_t i; - int error, size; - daddr_t nblk; - ehp = (struct ext4_extent_header *)(char *)ip->i_db; + ip->i_flag |= IN_E4EXTENTS; - if (ehp->eh_magic != EXT4_EXT_MAGIC) - return (NULL); + memset(ip->i_data, 0, EXT2_NDADDR + EXT2_NIADDR); + ehp = (struct ext4_extent_header *)ip->i_data; + ehp->eh_magic = EXT4_EXT_MAGIC; + ehp->eh_max = ext4_ext_space_root(ip); + ip->i_ext_cache.ec_type = EXT4_EXT_CACHE_NO; + ip->i_flag |= IN_CHANGE | IN_UPDATE; + ext2_update(ip->i_vnode, 1); +} - path->ep_header = ehp; +static inline void +ext4_ext_put_in_cache(struct inode *ip, uint32_t blk, + uint32_t len, uint32_t start, int type) +{ - daddr_t first_lbn = 0; - daddr_t last_lbn = lblkno(ip->i_e2fs, ip->i_size); + KASSERT(len != 0, ("ext4_ext_put_in_cache: bad input")); - for (i = ehp->eh_depth; i != 0; --i) { - path->ep_depth = i; - path->ep_ext = NULL; - if (ext4_ext_binsearch_index(ip, path, lbn, &first_lbn, - &last_lbn)) { - return (path); + ip->i_ext_cache.ec_type = type; + ip->i_ext_cache.ec_blk = blk; + ip->i_ext_cache.ec_len = len; + ip->i_ext_cache.ec_start = start; +} + +static e4fs_daddr_t +ext4_ext_blkpref(struct inode *ip, struct ext4_extent_path *path, + e4fs_daddr_t block) +{ + struct m_ext2fs *fs; + struct ext4_extent *ex; + e4fs_daddr_t bg_start; + int depth; + + fs = ip->i_e2fs; + + if (path) { + depth = path->ep_depth; + ex = path[depth].ep_ext; + if (ex) { + e4fs_daddr_t pblk = ext4_ext_extent_pblock(ex); + e2fs_daddr_t blk = ex->e_blk; + + if (block > blk) + return (pblk + (block - blk)); + else + return (pblk - (blk - block)); } - nblk = (daddr_t)path->ep_index->ei_leaf_hi << 32 | - path->ep_index->ei_leaf_lo; - size = blksize(fs, ip, nblk); - if (path->ep_bp != NULL) { - brelse(path->ep_bp); - path->ep_bp = NULL; + /* Try to get block from index itself. */ + if (path[depth].ep_data) + return (path[depth].ep_blk); + } + + /* Use inode's group. */ + bg_start = (ip->i_block_group * EXT2_BLOCKS_PER_GROUP(ip->i_e2fs)) + + fs->e2fs->e2fs_first_dblock; + + return (bg_start + block); +} + +static int inline +ext4_can_extents_be_merged(struct ext4_extent *ex1, + struct ext4_extent *ex2) +{ + + if (ex1->e_blk + ex1->e_len != ex2->e_blk) + return (0); + + if (ex1->e_len + ex2->e_len > EXT4_MAX_LEN) + return (0); + + if (ext4_ext_extent_pblock(ex1) + ex1->e_len == + ext4_ext_extent_pblock(ex2)) + return (1); + + return (0); +} + +static unsigned +ext4_ext_next_leaf_block(struct inode *ip, struct ext4_extent_path *path) +{ + int depth = path->ep_depth; + + /* Empty tree */ + if (depth == 0) + return (EXT4_MAX_BLOCKS); + + /* Go to indexes. */ + depth--; + + while (depth >= 0) { + if (path[depth].ep_index != + EXT_LAST_INDEX(path[depth].ep_header)) + return (path[depth].ep_index[1].ei_blk); + + depth--; + } + + return (EXT4_MAX_BLOCKS); +} + +static int +ext4_ext_dirty(struct inode *ip, struct ext4_extent_path *path) +{ + struct m_ext2fs *fs; + struct buf *bp; + uint64_t blk; + int error; + + fs = ip->i_e2fs; + + if (!path) + return (EINVAL); + + if (path->ep_data) { + blk = path->ep_blk; + bp = getblk(ip->i_devvp, fsbtodb(fs, blk), + fs->e2fs_bsize, 0, 0, 0); + if (!bp) + return (EIO); + ext4_ext_fill_path_buf(path, bp); + error = bwrite(bp); + } else { + ip->i_flag |= IN_CHANGE | IN_UPDATE; + error = ext2_update(ip->i_vnode, 1); + } + + return (error); +} + +static int +ext4_ext_insert_index(struct inode *ip, struct ext4_extent_path *path, + uint32_t lblk, e4fs_daddr_t blk) +{ + struct m_ext2fs *fs; + struct ext4_extent_index *idx; + int len; + + fs = ip->i_e2fs; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Oct 17 21:13:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C493E47A38; Tue, 17 Oct 2017 21:13:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDEB83C6D; Tue, 17 Oct 2017 21:13:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HLDQo7047791; Tue, 17 Oct 2017 21:13:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HLDQIg047790; Tue, 17 Oct 2017 21:13:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710172113.v9HLDQIg047790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 17 Oct 2017 21:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324707 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 324707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 21:13:27 -0000 Author: emaste Date: Tue Oct 17 21:13:26 2017 New Revision: 324707 URL: https://svnweb.freebsd.org/changeset/base/324707 Log: embed_mfs: add error handling, usage Ensure that we are called with two arguments, and that the output file is writable. Also, if we cannot find the mfs section report the output file name rather than "kernel", as this script may be used with other than kernels. Sponsored by: The FreeBSD Foundation Modified: head/sys/tools/embed_mfs.sh Modified: head/sys/tools/embed_mfs.sh ============================================================================== --- head/sys/tools/embed_mfs.sh Tue Oct 17 20:45:44 2017 (r324706) +++ head/sys/tools/embed_mfs.sh Tue Oct 17 21:13:26 2017 (r324707) @@ -32,13 +32,22 @@ # $2: MFS image filename # +if [ $# -ne 2 ]; then + echo "usage: $(basename $0) target mfs_image" + exit 0 +fi +if [ ! -w "$1" ]; then + echo $1 not writable + exit 1 +fi + mfs_size=`stat -f '%z' $2 2> /dev/null` # If we can't determine MFS image size - bail. [ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1 sec_info=`elfdump -c $1 2> /dev/null | grep -A 5 -E "sh_name: oldmfs$"` # If we can't find the mfs section within the given kernel - bail. -[ -z "${sec_info}" ] && echo "Can't locate mfs section within kernel" && exit 1 +[ -z "${sec_info}" ] && echo "Can't locate mfs section within $1" && exit 1 sec_size=`echo "${sec_info}" | awk '/sh_size/ {print $2}' 2> /dev/null` sec_start=`echo "${sec_info}" | awk '/sh_offset/ {print $2}' 2> /dev/null` From owner-svn-src-head@freebsd.org Tue Oct 17 23:38:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6148FE4A6D5; Tue, 17 Oct 2017 23:38:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2950A30E8; Tue, 17 Oct 2017 23:38:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9HNcR0r005807; Tue, 17 Oct 2017 23:38:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9HNcR6x005804; Tue, 17 Oct 2017 23:38:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710172338.v9HNcR6x005804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 17 Oct 2017 23:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324709 - in head/sys/boot/efi: boot1 libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: boot1 libefi loader X-SVN-Commit-Revision: 324709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 23:38:28 -0000 Author: imp Date: Tue Oct 17 23:38:27 2017 New Revision: 324709 URL: https://svnweb.freebsd.org/changeset/base/324709 Log: Revert "Unify boot1 with loader" change r324646 Back out the unification commit to boot1. There's some issues on the arm and arm64 platforms that need to be addressed with code changes. There's also a discussion on arch@ about the future of boot1.efi vs just using loader.efi that needs to play out. So take a pause on these changes until the arm issues can be fixed and it's clear boot1.efi will survive into FreeBSD 12. OK'd by: Eric@meatspace Added: head/sys/boot/efi/boot1/boot_module.h (contents, props changed) head/sys/boot/efi/boot1/ufs_module.c (contents, props changed) head/sys/boot/efi/boot1/zfs_module.c (contents, props changed) head/sys/boot/efi/loader/efi_main.c (contents, props changed) - copied, changed from r324707, head/sys/boot/efi/libefi/efi_main.c Deleted: head/sys/boot/efi/libefi/efi_main.c Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Tue Oct 17 21:20:07 2017 (r324708) +++ head/sys/boot/efi/boot1/Makefile Tue Oct 17 23:38:27 2017 (r324709) @@ -9,11 +9,8 @@ MK_FORTH= no PROG= boot1.sym INTERNALPROG= -WARNS?= 3 +WARNS?= 6 -# Include bcache code. -HAVE_BCACHE= yes - # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead @@ -22,15 +19,13 @@ HAVE_BCACHE= yes CWARNFLAGS.boot1.c+= -Wno-format # Disable warnings that are currently incompatible with the zfs boot code -CWARNFLAGS.zfs.c += -Wno-incompatible-pointer-types-discards-qualifiers -CWARNFLAGS.zfs.c += -Wno-missing-variable-declarations -CWARNFLAGS.zfs.c += -Wno-array-bounds -CWARNFLAGS.zfs.c += -Wno-cast-align -CWARNFLAGS.zfs.c += -Wno-cast-qual -CWARNFLAGS.zfs.c += -Wno-missing-prototypes -CWARNFLAGS.zfs.c += -Wno-sign-compare -CWARNFLAGS.zfs.c += -Wno-unused-parameter -CWARNFLAGS.zfs.c += -Wno-unused-function +CWARNFLAGS.zfs_module.c += -Wno-array-bounds +CWARNFLAGS.zfs_module.c += -Wno-cast-align +CWARNFLAGS.zfs_module.c += -Wno-cast-qual +CWARNFLAGS.zfs_module.c += -Wno-missing-prototypes +CWARNFLAGS.zfs_module.c += -Wno-sign-compare +CWARNFLAGS.zfs_module.c += -Wno-unused-parameter +CWARNFLAGS.zfs_module.c += -Wno-unused-function CWARNFLAGS.skein.c += -Wno-cast-align .if ${COMPILER_TYPE} == "clang" CWARNFLAGS.skein.c += -Wno-missing-variable-declarations @@ -39,25 +34,19 @@ CWARNFLAGS.skein.c += -Wno-missing-declarations .endif # architecture-specific loader code -SRCS= boot1.c self_reloc.c start.S +SRCS= boot1.c self_reloc.c start.S ufs_module.c .if ${MK_ZFS} != "no" -.PATH: ${.CURDIR}/../../../crypto/skein +SRCS+= zfs_module.c SRCS+= skein.c skein_block.c # Do not unroll skein loops, reduce code size CFLAGS+= -DSKEIN_LOOP=111 -.PATH: ${.CURDIR}/../../zfs -SRCS+= zfs.c +.PATH: ${.CURDIR}/../../../crypto/skein .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif -# Always add MI sources -.include "../../loader.mk" - -.PATH: ${.CURDIR}/arch/${MACHINE} - CFLAGS+= -I. CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} @@ -129,7 +118,7 @@ boot1.efi: ${PROG} SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ - -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ + -j .rela.dyn -j .reloc -j .eh_frame \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} boot1.o: ${SASRC}/ufsread.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Tue Oct 17 21:20:07 2017 (r324708) +++ head/sys/boot/efi/boot1/boot1.c Tue Oct 17 23:38:27 2017 (r324709) @@ -23,179 +23,61 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include -#include #include -#include -#include #include -#ifdef EFI_ZFS_BOOT -#include -#endif typedef CHAR16 efi_char; #include -#include - -#include "efi_drivers.h" -#include "efizfs.h" +#include "boot_module.h" #include "paths.h" static void efi_panic(EFI_STATUS s, const char *fmt, ...) __dead2 __printflike(2, 3); -#ifdef EFI_DEBUG -#define DPRINTF(fmt, args...) printf(fmt, ##args) -#define DSTALL(d) BS->Stall(d) -#else -#define DPRINTF(fmt, ...) {} -#define DSTALL(d) {} -#endif -struct arch_switch archsw; /* MI/MD interface boundary */ - -static const efi_driver_t *efi_drivers[] = { - NULL -}; - -extern struct console efi_console; -#if defined(__amd64__) || defined(__i386__) -extern struct console comconsole; -extern struct console nullconsole; -#endif - +static const boot_module_t *boot_modules[] = +{ #ifdef EFI_ZFS_BOOT -uint64_t pool_guid; + &zfs_module, #endif - -struct fs_ops *file_system[] = { -#ifdef EFI_ZFS_BOOT - &zfs_fsops, -#endif - &dosfs_fsops, #ifdef EFI_UFS_BOOT - &ufs_fsops, + &ufs_module #endif - &cd9660_fsops, - &nfs_fsops, - &gzipfs_fsops, - &bzipfs_fsops, - NULL }; -struct devsw *devsw[] = { - &efipart_hddev, - &efipart_fddev, - &efipart_cddev, -#ifdef EFI_ZFS_BOOT - &zfs_dev, -#endif - NULL -}; - -struct console *consoles[] = { - &efi_console, - NULL -}; - -static EFI_LOADED_IMAGE *boot_image; -static EFI_DEVICE_PATH *imgpath; -static EFI_DEVICE_PATH *imgprefix; - -/* Definitions we don't actually need for boot, but we need to define - * to make the linker happy. - */ -struct file_format *file_formats[] = { NULL }; - -struct netif_driver *netif_drivers[] = { NULL }; - -static int -efi_autoload(void) -{ - printf("******** Boot block should not call autoload\n"); - return (-1); -} - -static ssize_t -efi_copyin(const void *src __unused, vm_offset_t dest __unused, - const size_t len __unused) -{ - printf("******** Boot block should not call copyin\n"); - return (-1); -} - -static ssize_t -efi_copyout(vm_offset_t src __unused, void *dest __unused, - const size_t len __unused) -{ - printf("******** Boot block should not call copyout\n"); - return (-1); -} - -static ssize_t -efi_readin(int fd __unused, vm_offset_t dest __unused, - const size_t len __unused) -{ - printf("******** Boot block should not call readin\n"); - return (-1); -} - +#define NUM_BOOT_MODULES nitems(boot_modules) /* The initial number of handles used to query EFI for partitions. */ #define NUM_HANDLES_INIT 24 +static EFI_GUID BlockIoProtocolGUID = BLOCK_IO_PROTOCOL; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL; +static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; static EFI_GUID FreeBSDBootVarGUID = FREEBSD_BOOT_VAR_GUID; -static EFI_STATUS -do_load(const char *filepath, void **bufp, size_t *bufsize) +/* + * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures + * memory is correctly aligned avoiding EFI_INVALID_PARAMETER returns from + * EFI methods. + */ +void * +Malloc(size_t len, const char *file __unused, int line __unused) { - struct stat st; - void *buf = NULL; - int fd, err; - size_t fsize, remaining; - ssize_t readsize; + void *out; - if ((fd = open(filepath, O_RDONLY)) < 0) { - return (ENOTSUP); - } + if (BS->AllocatePool(EfiLoaderData, len, &out) == EFI_SUCCESS) + return (out); - if ((err = fstat(fd, &st)) != 0) { - goto close_file; - } + return (NULL); +} - fsize = st.st_size; - - if ((buf = malloc(fsize)) == NULL) { - err = ENOMEM; - goto close_file; - } - - remaining = fsize; - - do { - if ((readsize = read(fd, buf, fsize)) < 0) { - err = (-readsize); - goto free_buf; - } - - remaining -= readsize; - } while(remaining != 0); - - close(fd); - *bufsize = st.st_size; - *bufp = buf; - - close_file: - close(fd); - - return errno_to_efi_status(err); - - free_buf: - free(buf); - goto close_file; +void +Free(void *buf, const char *file __unused, int line __unused) +{ + if (buf != NULL) + (void)BS->FreePool(buf); } static EFI_STATUS @@ -215,275 +97,98 @@ efi_setenv_freebsd_wcs(const char *varname, CHAR16 *va return (rv); } -static int -probe_fs(const char *filepath) +/* + * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match, + * FALSE otherwise. + */ +static BOOLEAN +nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) { - int fd; + size_t len; - if ((fd = open(filepath, O_RDONLY)) < 0) { - return (ENOTSUP); - } + if (imgpath == NULL || imgpath->Type != devpath->Type || + imgpath->SubType != devpath->SubType) + return (FALSE); - close(fd); + len = DevicePathNodeLength(imgpath); + if (len != DevicePathNodeLength(devpath)) + return (FALSE); - return (0); + return (memcmp(imgpath, devpath, (size_t)len) == 0); } -static int -probe_dev(struct devsw *dev, int unit, const char *filepath) +/* + * device_paths_match returns TRUE if the imgpath isn't NULL and all nodes + * in imgpath and devpath match up to their respective occurrences of a + * media node, FALSE otherwise. + */ +static BOOLEAN +device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) { - struct devdesc currdev; - char *devname; - int err; - currdev.d_dev = dev; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = unit; - currdev.d_opendata = NULL; - devname = efi_fmtdev(&currdev); + if (imgpath == NULL) + return (FALSE); - env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, - env_nounset); + while (!IsDevicePathEnd(imgpath) && !IsDevicePathEnd(devpath)) { + if (IsDevicePathType(imgpath, MEDIA_DEVICE_PATH) && + IsDevicePathType(devpath, MEDIA_DEVICE_PATH)) + return (TRUE); - err = probe_fs(filepath); + if (!nodes_match(imgpath, devpath)) + return (FALSE); - return (err); -} + imgpath = NextDevicePathNode(imgpath); + devpath = NextDevicePathNode(devpath); + } -static bool -check_preferred(EFI_HANDLE *h) -{ - EFI_DEVICE_PATH *path = efi_lookup_devpath(h); - bool out; - - if ((path = efi_lookup_devpath(h)) == NULL) - return (false); - - out = efi_devpath_is_prefix(imgpath, path) || - efi_devpath_is_prefix(imgprefix, path); - - return (out); + return (FALSE); } -bool -efi_zfs_is_preferred(EFI_HANDLE *h) +/* + * devpath_last returns the last non-path end node in devpath. + */ +static EFI_DEVICE_PATH * +devpath_last(EFI_DEVICE_PATH *devpath) { - return (check_preferred(h)); -} -static int -load_preferred(EFI_LOADED_IMAGE *img, const char *filepath, void **bufp, - size_t *bufsize, EFI_HANDLE *handlep) -{ - pdinfo_list_t *pdi_list; - pdinfo_t *dp, *pp; - char *devname; + while (!IsDevicePathEnd(NextDevicePathNode(devpath))) + devpath = NextDevicePathNode(devpath); -#ifdef EFI_ZFS_BOOT - /* Did efi_zfs_probe() detect the boot pool? */ - if (pool_guid != 0) { - struct zfs_devdesc currdev; - - currdev.d_dev = &zfs_dev; - currdev.d_unit = 0; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_opendata = NULL; - currdev.pool_guid = pool_guid; - currdev.root_guid = 0; - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, - env_nounset); - - if (probe_fs(filepath) == 0 && - do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { - *handlep = efizfs_get_handle_by_guid(pool_guid); - return (0); - } - } -#endif /* EFI_ZFS_BOOT */ - - /* We have device lists for hd, cd, fd, walk them all. */ - pdi_list = efiblk_get_pdinfo_list(&efipart_hddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - struct disk_devdesc currdev; - - currdev.d_dev = &efipart_hddev; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = dp->pd_unit; - currdev.d_opendata = NULL; - currdev.d_slice = -1; - currdev.d_partition = -1; - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, - env_nounset); - - if (check_preferred(dp->pd_handle) && - probe_fs(filepath) == 0 && - do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { - *handlep = dp->pd_handle; - return (0); - } - - /* Assuming GPT partitioning. */ - STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { - if (check_preferred(pp->pd_handle)) { - currdev.d_slice = pp->pd_unit; - currdev.d_partition = 255; - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, - efi_setcurrdev, env_nounset); - - if (probe_fs(filepath) == 0 && - do_load(filepath, bufp, bufsize) == - EFI_SUCCESS) { - *handlep = pp->pd_handle; - return (0); - } - } - } - } - - pdi_list = efiblk_get_pdinfo_list(&efipart_cddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - if ((dp->pd_handle == img->DeviceHandle || - dp->pd_alias == img->DeviceHandle || - check_preferred(dp->pd_handle)) && - probe_dev(&efipart_cddev, dp->pd_unit, filepath) == 0 && - do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { - *handlep = dp->pd_handle; - return (0); - } - } - - pdi_list = efiblk_get_pdinfo_list(&efipart_fddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - if ((dp->pd_handle == img->DeviceHandle || - check_preferred(dp->pd_handle)) && - probe_dev(&efipart_cddev, dp->pd_unit, filepath) == 0 && - do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { - *handlep = dp->pd_handle; - return (0); - } - } - - return (ENOENT); + return (devpath); } -static int -load_all(const char *filepath, void **bufp, size_t *bufsize, - EFI_HANDLE *handlep) +/* + * load_loader attempts to load the loader image data. + * + * It tries each module and its respective devices, identified by mod->probe, + * in order until a successful load occurs at which point it returns EFI_SUCCESS + * and EFI_NOT_FOUND otherwise. + * + * Only devices which have preferred matching the preferred parameter are tried. + */ +static EFI_STATUS +load_loader(const boot_module_t **modp, dev_info_t **devinfop, void **bufp, + size_t *bufsize, BOOLEAN preferred) { - pdinfo_list_t *pdi_list; - pdinfo_t *dp, *pp; - zfsinfo_list_t *zfsi_list; - zfsinfo_t *zi; - char *devname; + UINTN i; + dev_info_t *dev; + const boot_module_t *mod; -#ifdef EFI_ZFS_BOOT - zfsi_list = efizfs_get_zfsinfo_list(); - STAILQ_FOREACH(zi, zfsi_list, zi_link) { - struct zfs_devdesc currdev; + for (i = 0; i < NUM_BOOT_MODULES; i++) { + mod = boot_modules[i]; + for (dev = mod->devices(); dev != NULL; dev = dev->next) { + if (dev->preferred != preferred) + continue; - currdev.d_dev = &zfs_dev; - currdev.d_unit = 0; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_opendata = NULL; - currdev.pool_guid = zi->zi_pool_guid; - currdev.root_guid = 0; - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, - env_nounset); - - if (probe_fs(filepath) == 0 && - do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { - *handlep = zi->zi_handle; - - return (0); - } - } -#endif /* EFI_ZFS_BOOT */ - - /* We have device lists for hd, cd, fd, walk them all. */ - pdi_list = efiblk_get_pdinfo_list(&efipart_hddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - struct disk_devdesc currdev; - - currdev.d_dev = &efipart_hddev; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = dp->pd_unit; - currdev.d_opendata = NULL; - currdev.d_slice = -1; - currdev.d_partition = -1; - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev, - env_nounset); - - if (probe_fs(filepath) == 0 && - do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { - *handlep = dp->pd_handle; - - return (0); - } - - /* Assuming GPT partitioning. */ - STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { - currdev.d_slice = pp->pd_unit; - currdev.d_partition = 255; - devname = efi_fmtdev(&currdev); - - env_setenv("currdev", EV_VOLATILE, devname, - efi_setcurrdev, env_nounset); - - if (probe_fs(filepath) == 0 && - do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { - *handlep = pp->pd_handle; - - return (0); + if (mod->load(PATH_LOADER_EFI, dev, bufp, bufsize) == + EFI_SUCCESS) { + *devinfop = dev; + *modp = mod; + return (EFI_SUCCESS); } } } - pdi_list = efiblk_get_pdinfo_list(&efipart_cddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - if (probe_dev(&efipart_cddev, dp->pd_unit, filepath) == 0 && - do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { - *handlep = dp->pd_handle; - - return (0); - } - } - - pdi_list = efiblk_get_pdinfo_list(&efipart_fddev); - STAILQ_FOREACH(dp, pdi_list, pd_link) { - if (probe_dev(&efipart_fddev, dp->pd_unit, filepath) == 0 && - do_load(filepath, bufp, bufsize) == EFI_SUCCESS) { - *handlep = dp->pd_handle; - - return (0); - } - } - - return (ENOENT); -} - -static EFI_STATUS -load_loader(EFI_HANDLE *handlep, void **bufp, size_t *bufsize) -{ - /* Try the preferred handles first, then all the handles */ - if (load_preferred(boot_image, PATH_LOADER_EFI, bufp, bufsize, - handlep) == 0) { - return (0); - } - - if (load_all(PATH_LOADER_EFI, bufp, bufsize, handlep) == 0) { - return (0); - } - return (EFI_NOT_FOUND); } @@ -497,27 +202,20 @@ try_boot(void) size_t bufsize, loadersize, cmdsize; void *buf, *loaderbuf; char *cmd; - EFI_HANDLE fshandle; + dev_info_t *dev; + const boot_module_t *mod; EFI_HANDLE loaderhandle; EFI_LOADED_IMAGE *loaded_image; EFI_STATUS status; - EFI_DEVICE_PATH *fspath; - status = load_loader(&fshandle, &loaderbuf, &loadersize); - - if (status != EFI_SUCCESS) { - return (status); - } - - fspath = NULL; - if (status == EFI_SUCCESS) { - status = BS->OpenProtocol(fshandle, &DevicePathGUID, - (void **)&fspath, IH, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL); + status = load_loader(&mod, &dev, &loaderbuf, &loadersize, TRUE); + if (status != EFI_SUCCESS) { + status = load_loader(&mod, &dev, &loaderbuf, &loadersize, + FALSE); if (status != EFI_SUCCESS) { - DPRINTF("Failed to get image DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); - } - DPRINTF("filesystem device path: %s\n", devpath_str(fspath)); + printf("Failed to load '%s'\n", PATH_LOADER_EFI); + return (status); + } } /* @@ -532,9 +230,9 @@ try_boot(void) */ cmd = NULL; cmdsize = 0; - status = do_load(PATH_DOTCONFIG, &buf, &bufsize); + status = mod->load(PATH_DOTCONFIG, dev, &buf, &bufsize); if (status == EFI_NOT_FOUND) - status = do_load(PATH_CONFIG, &buf, &bufsize); + status = mod->load(PATH_CONFIG, dev, &buf, &bufsize); if (status == EFI_SUCCESS) { cmdsize = bufsize + 1; cmd = malloc(cmdsize); @@ -546,25 +244,24 @@ try_boot(void) buf = NULL; } - if ((status = BS->LoadImage(TRUE, IH, efi_devpath_last_node(fspath), + if ((status = BS->LoadImage(TRUE, IH, devpath_last(dev->devpath), loaderbuf, loadersize, &loaderhandle)) != EFI_SUCCESS) { - printf("Failed to load image, size: %zu, (%lu)\n", - loadersize, EFI_ERROR_CODE(status)); + printf("Failed to load image provided by %s, size: %zu, (%lu)\n", + mod->name, loadersize, EFI_ERROR_CODE(status)); goto errout; } - if ((status = BS->OpenProtocol(loaderhandle, &LoadedImageGUID, - (VOID**)&loaded_image, IH, NULL, - EFI_OPEN_PROTOCOL_GET_PROTOCOL)) != EFI_SUCCESS) { - printf("Failed to query LoadedImage (%lu)\n", - EFI_ERROR_CODE(status)); + if ((status = BS->HandleProtocol(loaderhandle, &LoadedImageGUID, + (VOID**)&loaded_image)) != EFI_SUCCESS) { + printf("Failed to query LoadedImage provided by %s (%lu)\n", + mod->name, EFI_ERROR_CODE(status)); goto errout; } if (cmd != NULL) printf(" command args: %s\n", cmd); - loaded_image->DeviceHandle = fshandle; + loaded_image->DeviceHandle = dev->devhandle; loaded_image->LoadOptionsSize = cmdsize; loaded_image->LoadOptions = cmd; @@ -582,8 +279,8 @@ try_boot(void) if ((status = BS->StartImage(loaderhandle, NULL, NULL)) != EFI_SUCCESS) { - printf("Failed to start image (%lu)\n", - EFI_ERROR_CODE(status)); + printf("Failed to start image provided by %s (%lu)\n", + mod->name, EFI_ERROR_CODE(status)); loaded_image->LoadOptionsSize = 0; loaded_image->LoadOptions = NULL; } @@ -599,37 +296,142 @@ errout: return (status); } -EFI_STATUS -main(int argc __unused, CHAR16 *argv[] __unused) +/* + * probe_handle determines if the passed handle represents a logical partition + * if it does it uses each module in order to probe it and if successful it + * returns EFI_SUCCESS. + */ +static EFI_STATUS +probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, BOOLEAN *preferred) { - EFI_STATUS status; + dev_info_t *devinfo; + EFI_BLOCK_IO *blkio; + EFI_DEVICE_PATH *devpath; + EFI_STATUS status; + UINTN i; - SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; - UINTN i, max_dim, best_mode, cols, rows; - CHAR16 *text; + /* Figure out if we're dealing with an actual partition. */ + status = BS->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); + if (status == EFI_UNSUPPORTED) + return (status); - archsw.arch_autoload = efi_autoload; - archsw.arch_getdev = efi_getdev; - archsw.arch_copyin = efi_copyin; - archsw.arch_copyout = efi_copyout; - archsw.arch_readin = efi_readin; -#ifdef EFI_ZFS_BOOT - /* Note this needs to be set before ZFS init. */ - archsw.arch_zfs_probe = efi_zfs_probe; + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } +#ifdef EFI_DEBUG + { + CHAR16 *text = efi_devpath_name(devpath); + DPRINTF("probing: %S\n", text); + efi_free_devpath_name(text); + } #endif + status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); + if (status == EFI_UNSUPPORTED) + return (status); - /* Init the time source */ - efi_time_init(); - cons_probe(); + if (status != EFI_SUCCESS) { + DPRINTF("\nFailed to query BlockIoProtocol (%lu)\n", + EFI_ERROR_CODE(status)); + return (status); + } + if (!blkio->Media->LogicalPartition) + return (EFI_UNSUPPORTED); + + *preferred = device_paths_match(imgpath, devpath); + + /* Run through each module, see if it can load this partition */ + for (i = 0; i < NUM_BOOT_MODULES; i++) { + devinfo = malloc(sizeof(*devinfo)); + if (devinfo == NULL) { + DPRINTF("\nFailed to allocate devinfo\n"); + continue; + } + devinfo->dev = blkio; + devinfo->devpath = devpath; + devinfo->devhandle = h; + devinfo->devdata = NULL; + devinfo->preferred = *preferred; + devinfo->next = NULL; + + status = boot_modules[i]->probe(devinfo); + if (status == EFI_SUCCESS) + return (EFI_SUCCESS); + free(devinfo); + } + + return (EFI_UNSUPPORTED); +} + +/* + * probe_handle_status calls probe_handle and outputs the returned status + * of the call. + */ +static void +probe_handle_status(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) +{ + EFI_STATUS status; + BOOLEAN preferred; + + preferred = FALSE; + status = probe_handle(h, imgpath, &preferred); + + DPRINTF("probe: "); + switch (status) { + case EFI_UNSUPPORTED: + printf("."); + DPRINTF(" not supported\n"); + break; + case EFI_SUCCESS: + if (preferred) { + printf("%c", '*'); + DPRINTF(" supported (preferred)\n"); + } else { + printf("%c", '+'); + DPRINTF(" supported\n"); + } + break; + default: + printf("x"); + DPRINTF(" error (%lu)\n", EFI_ERROR_CODE(status)); + break; + } + DSTALL(500000); +} + +EFI_STATUS +efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) +{ + EFI_HANDLE *handles; + EFI_LOADED_IMAGE *img; + EFI_DEVICE_PATH *imgpath; + EFI_STATUS status; + EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; + SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; + UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; + CHAR16 *text; + + /* Basic initialization*/ + ST = Xsystab; + IH = Ximage; + BS = ST->BootServices; + RS = ST->RuntimeServices; + + /* Set up the console, so printf works. */ + status = BS->LocateProtocol(&ConsoleControlGUID, NULL, + (VOID **)&ConsoleControl); + if (status == EFI_SUCCESS) + (void)ConsoleControl->SetMode(ConsoleControl, + EfiConsoleControlScreenText); /* * Reset the console and find the best text mode. */ conout = ST->ConOut; conout->Reset(conout, TRUE); max_dim = best_mode = 0; - - for (i = 0; ; i++) { + for (i = 0; ; i++) { status = conout->QueryMode(conout, i, &cols, &rows); if (EFI_ERROR(status)) break; @@ -638,37 +440,31 @@ main(int argc __unused, CHAR16 *argv[] __unused) best_mode = i; } } - - if (max_dim > 0) + if (max_dim > 0) conout->SetMode(conout, best_mode); - conout->EnableCursor(conout, TRUE); conout->ClearScreen(conout); - /* Print this here, so people know it's at least starting. */ printf("\n>> FreeBSD EFI boot block\n"); printf(" Loader path: %s\n\n", PATH_LOADER_EFI); - - /* Get the image path and trim it to get the disk on which we - * found this loader. - */ - if ((status = BS->OpenProtocol(IH, &LoadedImageGUID, - (VOID**)&boot_image, IH, NULL, - EFI_OPEN_PROTOCOL_GET_PROTOCOL)) != EFI_SUCCESS) { - panic("Failed to query LoadedImage (%lu)\n", - EFI_ERROR_CODE(status)); + printf(" Initializing modules:"); + for (i = 0; i < NUM_BOOT_MODULES; i++) { + printf(" %s", boot_modules[i]->name); + if (boot_modules[i]->init != NULL) + boot_modules[i]->init(); } + putchar('\n'); /* Determine the devpath of our image so we can prefer it. */ - status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&boot_image); + status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); imgpath = NULL; if (status == EFI_SUCCESS) { - text = efi_devpath_name(boot_image->FilePath); + text = efi_devpath_name(img->FilePath); printf(" Load Path: %S\n", text); efi_setenv_freebsd_wcs("Boot1Path", text); efi_free_devpath_name(text); - status = BS->HandleProtocol(boot_image->DeviceHandle, &DevicePathGUID, + status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, (void **)&imgpath); if (status != EFI_SUCCESS) { DPRINTF("Failed to get image DevicePath (%lu)\n", @@ -682,36 +478,49 @@ main(int argc __unused, CHAR16 *argv[] __unused) } - /* The loaded image device path ends with a partition, then a - * file path. Trim them both to get the actual disk. - */ - if ((imgprefix = efi_devpath_trim(imgpath)) == NULL || - (imgprefix = efi_devpath_trim(imgprefix)) == NULL) { - panic("Couldn't trim device path"); - } + /* Get all the device handles */ + hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); + handles = malloc(hsize); + if (handles == NULL) { + printf("Failed to allocate %d handles\n", NUM_HANDLES_INIT); + } - /* - * Initialize the block cache. Set the upper limit. - */ - bcache_init(32768, 512); - - printf("\n Initializing modules:"); - - for (i = 0; efi_drivers[i] != NULL; i++) { - printf(" %s", efi_drivers[i]->name); - if (efi_drivers[i]->init != NULL) - efi_drivers[i]->init(); + status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, NULL, + &hsize, handles); + switch (status) { + case EFI_SUCCESS: + break; + case EFI_BUFFER_TOO_SMALL: + free(handles); + handles = malloc(hsize); + if (handles == NULL) + efi_panic(EFI_OUT_OF_RESOURCES, "Failed to allocate %d handles\n", + NUM_HANDLES_INIT); + status = BS->LocateHandle(ByProtocol, &BlockIoProtocolGUID, + NULL, &hsize, handles); + if (status != EFI_SUCCESS) + efi_panic(status, "Failed to get device handles\n"); + break; + default: + efi_panic(status, "Failed to get device handles\n"); + break; } - for (i = 0; devsw[i] != NULL; i++) { - if (devsw[i]->dv_init != NULL) { - printf(" %s", devsw[i]->dv_name); - (devsw[i]->dv_init)(); - } - } + /* Scan all partitions, probing with all modules. */ + nhandles = hsize / sizeof(*handles); + printf(" Probing %zu block devices...", nhandles); + DPRINTF("\n"); - putchar('\n'); + for (i = 0; i < nhandles; i++) + probe_handle_status(handles[i], imgpath); + printf(" done\n"); + /* Status summary. */ + for (i = 0; i < NUM_BOOT_MODULES; i++) { + printf(" "); + boot_modules[i]->status(); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Oct 18 00:18:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FA34E4B6D0; Wed, 18 Oct 2017 00:18:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A4FB63694; Wed, 18 Oct 2017 00:18:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9I0I4wg022096; Wed, 18 Oct 2017 00:18:04 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9I0I3ts022090; Wed, 18 Oct 2017 00:18:03 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201710180018.v9I0I3ts022090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 18 Oct 2017 00:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324710 - in head: . share/man/man9 sys/conf sys/kern sys/modules sys/modules/libmbpool sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man9 sys/conf sys/kern sys/modules sys/modules/libmbpool sys/sys X-SVN-Commit-Revision: 324710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 00:18:05 -0000 Author: brooks Date: Wed Oct 18 00:18:03 2017 New Revision: 324710 URL: https://svnweb.freebsd.org/changeset/base/324710 Log: Remove mbpool(9) now that it has no consumers. mbpool existed to support NICs with memory interfaces and all remaining comsumers were removed earlier this year with NATM. Reviewed by: jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10513 Deleted: head/share/man/man9/mbpool.9 head/sys/kern/subr_mbpool.c head/sys/modules/libmbpool/Makefile head/sys/sys/mbpool.h Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Oct 17 23:38:27 2017 (r324709) +++ head/ObsoleteFiles.inc Wed Oct 18 00:18:03 2017 (r324710) @@ -38,6 +38,19 @@ # xargs -n1 | sort | uniq -d; # done +# 20171017: Removal of mbpool(9) +OLD_FILES+=usr/include/sys/mbpool.h +OLD_FILES+=usr/share/man/man9/mbpool.9.gz +OLD_FILES+=usr/share/man/man9/mbp_destroy.9.gz +OLD_FILES+=usr/share/man/man9/mbp_alloc.9.gz +OLD_FILES+=usr/share/man/man9/mbp_ext_free.9.gz +OLD_FILES+=usr/share/man/man9/mbp_count.9.gz +OLD_FILES+=usr/share/man/man9/mbp_card_free.9.gz +OLD_FILES+=usr/share/man/man9/mbp_get_keep.9.gz +OLD_FILES+=usr/share/man/man9/mbp_free.9.gz +OLD_FILES+=usr/share/man/man9/mbp_get.9.gz +OLD_FILES+=usr/share/man/man9/mbp_create.9.gz +OLD_FILES+=usr/share/man/man9/mbp_sync.9.gz # 20171010: Remove libstand OLD_FILES+=usr/lib/libstand.a OLD_FILES+=usr/lib/libstand_p.a Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Oct 17 23:38:27 2017 (r324709) +++ head/share/man/man9/Makefile Wed Oct 18 00:18:03 2017 (r324710) @@ -184,7 +184,6 @@ MAN= accept_filter.9 \ make_dev.9 \ malloc.9 \ mbchain.9 \ - mbpool.9 \ mbuf.9 \ mbuf_tags.9 \ MD5.9 \ @@ -1162,16 +1161,6 @@ MLINKS+=mbchain.9 mb_detach.9 \ mbchain.9 mb_put_uint8.9 \ mbchain.9 mb_put_uio.9 \ mbchain.9 mb_reserve.9 -MLINKS+=mbpool.9 mbp_alloc.9 \ - mbpool.9 mbp_card_free.9 \ - mbpool.9 mbp_count.9 \ - mbpool.9 mbp_create.9 \ - mbpool.9 mbp_destroy.9 \ - mbpool.9 mbp_ext_free.9 \ - mbpool.9 mbp_free.9 \ - mbpool.9 mbp_get.9 \ - mbpool.9 mbp_get_keep.9 \ - mbpool.9 mbp_sync.9 MLINKS+=\ mbuf.9 m_adj.9 \ mbuf.9 m_align.9 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Oct 17 23:38:27 2017 (r324709) +++ head/sys/conf/NOTES Wed Oct 18 00:18:03 2017 (r324710) @@ -2210,8 +2210,6 @@ device rtwnfw options MCLSHIFT=12 # mbuf cluster shift in bits, 12 == 4KB options MSIZE=512 # mbuf size in bytes -options LIBMBPOOL - # # Sound drivers # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Oct 17 23:38:27 2017 (r324709) +++ head/sys/conf/files Wed Oct 18 00:18:03 2017 (r324710) @@ -3816,7 +3816,6 @@ kern/subr_kdb.c standard kern/subr_kobj.c standard kern/subr_lock.c standard kern/subr_log.c standard -kern/subr_mbpool.c optional libmbpool kern/subr_mchain.c optional libmchain kern/subr_module.c standard kern/subr_msgbuf.c standard Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Oct 17 23:38:27 2017 (r324709) +++ head/sys/conf/options Wed Oct 18 00:18:03 2017 (r324710) @@ -432,7 +432,6 @@ IPSEC_SUPPORT opt_ipsec.h IPSTEALTH KRPC LIBALIAS -LIBMBPOOL LIBMCHAIN MBUF_PROFILING MBUF_STRESS_TEST Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Oct 17 23:38:27 2017 (r324709) +++ head/sys/modules/Makefile Wed Oct 18 00:18:03 2017 (r324710) @@ -218,7 +218,6 @@ SUBDIR= \ lge \ libalias \ libiconv \ - libmbpool \ libmchain \ ${_linprocfs} \ ${_linsysfs} \ From owner-svn-src-head@freebsd.org Wed Oct 18 00:30:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED8F3E4B9F1; Wed, 18 Oct 2017 00:30:16 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB99663C1B; Wed, 18 Oct 2017 00:30:16 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9I0UFVj026165; Wed, 18 Oct 2017 00:30:15 GMT (envelope-from jonathan@FreeBSD.org) Received: (from jonathan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9I0UF5g026164; Wed, 18 Oct 2017 00:30:15 GMT (envelope-from jonathan@FreeBSD.org) Message-Id: <201710180030.v9I0UF5g026164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jonathan set sender to jonathan@FreeBSD.org using -f From: Jonathan Anderson Date: Wed, 18 Oct 2017 00:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324711 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jonathan X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 324711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 00:30:17 -0000 Author: jonathan Date: Wed Oct 18 00:30:15 2017 New Revision: 324711 URL: https://svnweb.freebsd.org/changeset/base/324711 Log: Improve logic of CLEANFILES+=${PROG_FULL}.{bc,ll}. The build rule describing how to create ${PROG_FULL}.{bc,ll} is only dependent on LLVM_LINK being defined, not on MK_DEBUG_FILES being "yes". Move the addition of ${PROG_FULL}.{bc,ll} out of the conditional block under `.if ${MK_DEBUG_FILES} != "no"` and up next to where the build rules for ${PROG_FULL}.{bc,ll} are defined. Reviewed by: emaste MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12703 Modified: head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Oct 18 00:18:03 2017 (r324710) +++ head/share/mk/bsd.prog.mk Wed Oct 18 00:30:15 2017 (r324711) @@ -158,6 +158,7 @@ ${PROG_FULL}.bc: ${BCOBJS} ${PROG_FULL}.ll: ${LLOBJS} ${LLVM_LINK} -S -o ${.TARGET} ${LLOBJS} +CLEANFILES+= ${PROG_FULL}.bc ${PROG_FULL}.ll .endif # defined(LLVM_LINK) .if ${MK_MAN} != "no" && !defined(MAN) && \ @@ -181,7 +182,7 @@ all: all-man .if defined(PROG) CLEANFILES+= ${PROG} ${PROG}.bc ${PROG}.ll .if ${MK_DEBUG_FILES} != "no" -CLEANFILES+= ${PROG_FULL} ${PROG_FULL}.bc ${PROGNAME}.debug ${PROG_FULL}.ll +CLEANFILES+= ${PROG_FULL} ${PROGNAME}.debug .endif .endif From owner-svn-src-head@freebsd.org Wed Oct 18 00:33:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28A7EE4BBC7; Wed, 18 Oct 2017 00:33:22 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03D3E6401D; Wed, 18 Oct 2017 00:33:21 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9I0XLEf030089; Wed, 18 Oct 2017 00:33:21 GMT (envelope-from jonathan@FreeBSD.org) Received: (from jonathan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9I0XLIw030087; Wed, 18 Oct 2017 00:33:21 GMT (envelope-from jonathan@FreeBSD.org) Message-Id: <201710180033.v9I0XLIw030087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jonathan set sender to jonathan@FreeBSD.org using -f From: Jonathan Anderson Date: Wed, 18 Oct 2017 00:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324712 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jonathan X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 324712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 00:33:22 -0000 Author: jonathan Date: Wed Oct 18 00:33:20 2017 New Revision: 324712 URL: https://svnweb.freebsd.org/changeset/base/324712 Log: Improve computation of {BC,LL}OBJS. Now that OBJS has grown an OBJS_SRCS_FILTER variable, use this variable in the computation of BCOBJS and LLOBJS too. Also move BCOBJS and LLOBJS computation to be next to the OBJS computation: this should both make the parallel structure clearer and serve to remind people changing OBJS that parallel changes are required in BCOBJS and LLOBJS. A side effect of this change is that BCOBJS and LLOBJS will be available even when LLVM_LINK has not been defined, but that seems like a positive change: there's no reason we can't ask "what bitcode files would you generate" just because we can't link those files together into a complete bitcode representation of a binary or library. Reviewed by: sjg Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12701 Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Wed Oct 18 00:30:15 2017 (r324711) +++ head/share/mk/bsd.lib.mk Wed Oct 18 00:33:20 2017 (r324712) @@ -169,7 +169,9 @@ LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME) OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/} -CLEANFILES+= ${OBJS} ${STATICOBJS} +BCOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g} +LLOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g} +CLEANFILES+= ${OBJS} ${BCOBJS} ${LLOBJS} ${STATICOBJS} .endif .if defined(LIB) && !empty(LIB) @@ -200,10 +202,6 @@ lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} .endif .if defined(LLVM_LINK) -BCOBJS= ${OBJS:.o=.bco} ${STATICOBJS:.o=.bco} -LLOBJS= ${OBJS:.o=.llo} ${STATICOBJS:.o=.llo} -CLEANFILES+= ${BCOBJS} ${LLOBJS} - lib${LIB_PRIVATE}${LIB}.bc: ${BCOBJS} ${LLVM_LINK} -o ${.TARGET} ${BCOBJS} Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Wed Oct 18 00:30:15 2017 (r324711) +++ head/share/mk/bsd.prog.mk Wed Oct 18 00:33:20 2017 (r324712) @@ -87,6 +87,10 @@ PROGNAME?= ${PROG} OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/g} +# LLVM bitcode / textual IR representations of the program +BCOBJS+=${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g} +LLOBJS+=${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g} + .if target(beforelinking) beforelinking: ${OBJS} ${PROG_FULL}: beforelinking @@ -117,7 +121,10 @@ SRCS= ${PROG}.c # - the name of the object gets put into the executable symbol table instead of # the name of a variable temporary object. # - it's useful to keep objects around for crunching. -OBJS+= ${PROG}.o +OBJS+= ${PROG}.o +BCOBJS+= ${PROG}.bc +LLOBJS+= ${PROG}.ll +CLEANFILES+= ${PROG}.o ${PROG}.bc ${PROG}.ll .if target(beforelinking) beforelinking: ${OBJS} @@ -148,10 +155,6 @@ ${PROGNAME}.debug: ${PROG_FULL} .endif .if defined(LLVM_LINK) -# LLVM bitcode / textual IR representations of the program -BCOBJS= ${OBJS:.o=.bco} -LLOBJS= ${OBJS:.o=.llo} - ${PROG_FULL}.bc: ${BCOBJS} ${LLVM_LINK} -o ${.TARGET} ${BCOBJS} From owner-svn-src-head@freebsd.org Wed Oct 18 00:41:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92B24E4BCC2; Wed, 18 Oct 2017 00:41:24 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60DB064375; Wed, 18 Oct 2017 00:41:24 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9I0fNLr031269; Wed, 18 Oct 2017 00:41:23 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9I0fNWH031268; Wed, 18 Oct 2017 00:41:23 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201710180041.v9I0fNWH031268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Wed, 18 Oct 2017 00:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324713 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 324713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 00:41:24 -0000 Author: rlibby Date: Wed Oct 18 00:41:23 2017 New Revision: 324713 URL: https://svnweb.freebsd.org/changeset/base/324713 Log: ext2: delete redundant decl of ext2_fserr Fix gcc build after r324706. Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D12709 Modified: head/sys/fs/ext2fs/ext2_extern.h Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Wed Oct 18 00:33:20 2017 (r324712) +++ head/sys/fs/ext2fs/ext2_extern.h Wed Oct 18 00:41:23 2017 (r324713) @@ -102,7 +102,6 @@ int ext2_search_dirblock(struct inode *, void *, int * int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot *); int ext2_gd_csum_verify(struct m_ext2fs *fs, struct cdev *dev); void ext2_gd_csum_set(struct m_ext2fs *fs); -void ext2_fserr(struct m_ext2fs *, uid_t, char *); /* Flags to low-level allocation routines. From owner-svn-src-head@freebsd.org Wed Oct 18 06:21:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABCDBE2C322; Wed, 18 Oct 2017 06:21:33 +0000 (UTC) (envelope-from thisisadrgreenthumb@gmail.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 411086C731; Wed, 18 Oct 2017 06:21:33 +0000 (UTC) (envelope-from thisisadrgreenthumb@gmail.com) Received: by mail-wm0-x234.google.com with SMTP id i124so7673978wmf.3; Tue, 17 Oct 2017 23:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=toqR5xeDjq4Z6cUH2q5Q7Fra+hchLG1KYXyBkVOO/WM=; b=V5q14ndSl5CZudUz/OE/acSWQPO/atB34Vhop5Hm8wGHGqGCBoAiLTgT8HJ/rw+USf ng9sLa8Xy5+zfHmyWn3HzzGojh88k8PgZDu6pYWdOHHWdiM41p02asR42lDtcuzIzgNo rMqDt0lbqomAP4cGX2s0LGajuyA2vdPI4/KwcvF9MZrkpdrU28FxZEYor8XXyX1So/MI pQFnfextP5Vx1MoeI4XsUfeFfJGg+DVZw/gJY1GE9JtQsPnsbKMAS97RtBUSAlESWnTe 44Pd68fKIp9LBUZPF4QZMVI0nLdmueccEyyzzp58dvMUxoVjRWxBI/IssAlp/c0P7uyT Thmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=toqR5xeDjq4Z6cUH2q5Q7Fra+hchLG1KYXyBkVOO/WM=; b=E5MMF08bnVYPMl5EHoSaQkhX9S8FzGBlNJnXiGZBP9R6HmopTMT3S1c+iP0COLGI4R 2ZMR3zbvzzx1uAqQ5sABCMx/b+iSJ04JJ41vJ8XHKpDTY0V1G1OBYpCcxigyDCCjLtzS bqdwz3fPcgvIUX3YHaQ6RrR/3DiQtVZgQj6KnLTAMFId3iyhfHtk8fFDOvLPG7FE4pw7 Uaq05/91z2pV1xCLq6/Jc1zLtR0SRnQOZhiGQd1n/kX8nd0EjjScEUTeBdxSYto9vg0Y lQmoPN9WGGPpHJ8iCWT5Wi4oz89j11PbrYDxNtIdZzngVjUDnRamoAVIDOrLra6XlaXi Tvtw== X-Gm-Message-State: AMCzsaXyDiGy86AmPZQ2yy9rXMN4zgzRm2IwUAIv8u/1HbIR+NOtyoWC VGkkVDEE5NdVkN8YoauGbApwc7gz9YKEEAZhKoHV2qH3Rt8= X-Google-Smtp-Source: AOwi7QAmHUPSD+ton0vpFzI6z5hS1Gljd/MZVA1nqwZc4YoiI8Xa4G7VIhmEXDc3tpnoBVeb9gdzqNPHFp8f3mAJa2g= X-Received: by 10.80.159.4 with SMTP id b4mr19187506edf.163.1508307691636; Tue, 17 Oct 2017 23:21:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.178.67 with HTTP; Tue, 17 Oct 2017 23:21:31 -0700 (PDT) In-Reply-To: <201710180041.v9I0fNWH031268@repo.freebsd.org> References: <201710180041.v9I0fNWH031268@repo.freebsd.org> From: Fedor Uporov Date: Wed, 18 Oct 2017 06:21:31 +0000 Message-ID: Subject: Re: svn commit: r324713 - head/sys/fs/ext2fs To: Ryan Libby Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 06:21:33 -0000 Ryan, Seems like, I lost the dual declaration when made the merging and then did not check the gcc build. Thanks for fix. On Wed, Oct 18, 2017 at 12:41 AM, Ryan Libby wrote: > Author: rlibby > Date: Wed Oct 18 00:41:23 2017 > New Revision: 324713 > URL: https://svnweb.freebsd.org/changeset/base/324713 > > Log: > ext2: delete redundant decl of ext2_fserr > > Fix gcc build after r324706. > > Reviewed by: pfg > Differential Revision: https://reviews.freebsd.org/D12709 > > Modified: > head/sys/fs/ext2fs/ext2_extern.h > > Modified: head/sys/fs/ext2fs/ext2_extern.h > ============================================================ > ================== > --- head/sys/fs/ext2fs/ext2_extern.h Wed Oct 18 00:33:20 2017 > (r324712) > +++ head/sys/fs/ext2fs/ext2_extern.h Wed Oct 18 00:41:23 2017 > (r324713) > @@ -102,7 +102,6 @@ int ext2_search_dirblock(struct inode *, void *, int * > int *, doff_t *, doff_t *, doff_t *, struct ext2fs_searchslot > *); > int ext2_gd_csum_verify(struct m_ext2fs *fs, struct cdev *dev); > void ext2_gd_csum_set(struct m_ext2fs *fs); > -void ext2_fserr(struct m_ext2fs *, uid_t, char *); > > > /* Flags to low-level allocation routines. > > From owner-svn-src-head@freebsd.org Wed Oct 18 07:27:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 029B2E2D82C; Wed, 18 Oct 2017 07:27:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B31C86E200; Wed, 18 Oct 2017 07:27:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9I7RhHU001969; Wed, 18 Oct 2017 07:27:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9I7RhFr001968; Wed, 18 Oct 2017 07:27:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710180727.v9I7RhFr001968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 18 Oct 2017 07:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324716 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 07:27:45 -0000 Author: kib Date: Wed Oct 18 07:27:43 2017 New Revision: 324716 URL: https://svnweb.freebsd.org/changeset/base/324716 Log: Do not report reduction of swap zone if it was not. After r324600 we see the actual reservation. Reported by: jkim Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Wed Oct 18 03:46:01 2017 (r324715) +++ head/sys/vm/swap_pager.c Wed Oct 18 07:27:43 2017 (r324716) @@ -549,7 +549,7 @@ swap_pager_swap_init(void) */ n = uma_zone_get_max(swblk_zone); - if (n2 != n) + if (n < n2) printf("Swap blk zone entries reduced from %lu to %lu.\n", n2, n); swap_maxpages = n * SWAP_META_PAGES; From owner-svn-src-head@freebsd.org Wed Oct 18 07:39:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6CA7E2DB71; Wed, 18 Oct 2017 07:39:22 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B27CC6E6A5; Wed, 18 Oct 2017 07:39:22 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9I7dL6w005983; Wed, 18 Oct 2017 07:39:21 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9I7dLJM005982; Wed, 18 Oct 2017 07:39:21 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201710180739.v9I7dLJM005982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 18 Oct 2017 07:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324717 - head/sys/boot/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/libsa X-SVN-Commit-Revision: 324717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 07:39:23 -0000 Author: tsoome Date: Wed Oct 18 07:39:21 2017 New Revision: 324717 URL: https://svnweb.freebsd.org/changeset/base/324717 Log: libsa/ip.c: misplaced comment, ip_v is half char, not ip_p The comment should be at previous line. Reported by: Dan McDonald Modified: head/sys/boot/libsa/ip.c Modified: head/sys/boot/libsa/ip.c ============================================================================== --- head/sys/boot/libsa/ip.c Wed Oct 18 07:27:43 2017 (r324716) +++ head/sys/boot/libsa/ip.c Wed Oct 18 07:39:21 2017 (r324717) @@ -229,8 +229,8 @@ readipv4(struct iodesc *d, void **pkt, void **payload, } /* Check ip header */ - if (ip->ip_v != IPVERSION || - ip->ip_p != proto) { /* half char */ + if (ip->ip_v != IPVERSION || /* half char */ + ip->ip_p != proto) { #ifdef NET_DEBUG if (debug) { printf("readip: IP version or proto. ip_v=%d ip_p=%d\n", From owner-svn-src-head@freebsd.org Wed Oct 18 07:59:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99A84E2F41F; Wed, 18 Oct 2017 07:59:01 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-pf0-f169.google.com (mail-pf0-f169.google.com [209.85.192.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 733426F270; Wed, 18 Oct 2017 07:59:01 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-pf0-f169.google.com with SMTP id z11so3370858pfk.4; Wed, 18 Oct 2017 00:59:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JreTbvB+pz2AMa3Gbe5m9qp5rxRhArHyPwh5vLW3O7Y=; b=SwEfz/Su+7Fh/YBcop4PLjepDbsqnen80Lwj718Iq+QfIGXyxGMxZDnXxaW2JcIbtK mBqNd3wbNQlCl1h6yesGRFElFvBLfxFm8dblQai/8OPTSidNpcPSX21IkChDG9CLgplw bCDiIzlxiIViFWiZLTloE67dwUaOqYZ43j9pyYPaDro1ejxDSI2ZYU/ItAOpg1rQkEYS 1mB3y/2Qsj7pfZo2Qodslmgu8PDcAAjjk4jltZACkNGr+f4cK+R1ysjQascA4QtFu5gA 1oIvro8cGi8ksPhCQ77MTtH6BaMoRm1rRwP4oh6vPjaq2LWQblrnXr9b9HrYbFpcBTUI LMPg== X-Gm-Message-State: AMCzsaWhN1/JGWa/NGObs7M6HUBluol6cNRGqPqsjzsg+mvzTzDvjYxH jpA4Jlch9WLXVBs0w4MorJaaDpCL X-Received: by 10.99.146.76 with SMTP id s12mr13374903pgn.354.1508311740155; Wed, 18 Oct 2017 00:29:00 -0700 (PDT) Received: from mail-pg0-f53.google.com (mail-pg0-f53.google.com. [74.125.83.53]) by smtp.gmail.com with ESMTPSA id 81sm23116105pfh.145.2017.10.18.00.28.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 00:28:59 -0700 (PDT) Received: by mail-pg0-f53.google.com with SMTP id k7so3576461pga.3; Wed, 18 Oct 2017 00:28:59 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDJMH0oeOjKU3RUwk5VzfgRUpiYdFZugN1biROeSek1PFfECbvOpyIhPz2rIxIcaY8kBunnsRmj4JmddWKZ++w= X-Received: by 10.99.52.194 with SMTP id b185mr12873350pga.170.1508311738835; Wed, 18 Oct 2017 00:28:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.180.131 with HTTP; Wed, 18 Oct 2017 00:28:58 -0700 (PDT) In-Reply-To: References: <201710180041.v9I0fNWH031268@repo.freebsd.org> From: Ryan Libby Date: Wed, 18 Oct 2017 00:28:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r324713 - head/sys/fs/ext2fs To: Fedor Uporov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 07:59:01 -0000 On Tue, Oct 17, 2017 at 11:21 PM, Fedor Uporov wrote: > Ryan, > > Seems like, I lost the dual declaration when made the merging and then did > not check the gcc build. > > Thanks for fix. > No problem. Welcome aboard. From owner-svn-src-head@freebsd.org Wed Oct 18 08:06:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94E9FE2FB21; Wed, 18 Oct 2017 08:06:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 613846F999; Wed, 18 Oct 2017 08:06:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9I865dO018396; Wed, 18 Oct 2017 08:06:05 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9I865fH018395; Wed, 18 Oct 2017 08:06:05 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201710180806.v9I865fH018395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 18 Oct 2017 08:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324719 - head/sys/boot/libsa X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/libsa X-SVN-Commit-Revision: 324719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 08:06:06 -0000 Author: tsoome Date: Wed Oct 18 08:06:05 2017 New Revision: 324719 URL: https://svnweb.freebsd.org/changeset/base/324719 Log: libsa/ip: stop read loop on bad fragments Lets try to clear out from case of overlapping etc fragments and stop read. Reported by: Dan McDonald Modified: head/sys/boot/libsa/ip.c Modified: head/sys/boot/libsa/ip.c ============================================================================== --- head/sys/boot/libsa/ip.c Wed Oct 18 08:05:46 2017 (r324718) +++ head/sys/boot/libsa/ip.c Wed Oct 18 08:06:05 2017 (r324719) @@ -350,7 +350,8 @@ readipv4(struct iodesc *d, void **pkt, void **payload, last = NULL; STAILQ_FOREACH(ipq, &ipr->ip_queue, ipq_next) { if ((ntohs(ipq->ipq_hdr->ip_off) & IP_OFFMASK) != n / 8) { - errno = EAGAIN; + STAILQ_REMOVE(&ire_list, ipr, ip_reasm, ip_next); + ip_reasm_free(ipr); return (-1); } From owner-svn-src-head@freebsd.org Wed Oct 18 13:10:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A54BE3881F; Wed, 18 Oct 2017 13:10:02 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F04667CBF2; Wed, 18 Oct 2017 13:10:01 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 2734B1E0A6; Wed, 18 Oct 2017 13:10:01 +0000 (UTC) Date: Wed, 18 Oct 2017 13:10:01 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324716 - head/sys/vm Message-ID: <20171018131001.GA22776@FreeBSD.org> References: <201710180727.v9I7RhFr001968@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710180727.v9I7RhFr001968@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 13:10:02 -0000 On Wed, Oct 18, 2017 at 07:27:43AM +0000, Konstantin Belousov wrote: > New Revision: 324716 > URL: https://svnweb.freebsd.org/changeset/base/324716 > > Log: > Do not report reduction of swap zone if it was not. > > After r324600 we see the actual reservation. > > [...] > --- head/sys/vm/swap_pager.c Wed Oct 18 03:46:01 2017 (r324715) > +++ head/sys/vm/swap_pager.c Wed Oct 18 07:27:43 2017 (r324716) > @@ -549,7 +549,7 @@ swap_pager_swap_init(void) > */ > n = uma_zone_get_max(swblk_zone); > > - if (n2 != n) > + if (n < n2) > printf("Swap blk zone entries reduced from %lu to %lu.\n", > n2, n); Nice, self-explanatory variable names, hmm... ./danfe From owner-svn-src-head@freebsd.org Wed Oct 18 13:25:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15877E38FC9; Wed, 18 Oct 2017 13:25:46 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF3107D567; Wed, 18 Oct 2017 13:25:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IDPj8L051249; Wed, 18 Oct 2017 13:25:45 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IDPi6u051247; Wed, 18 Oct 2017 13:25:44 GMT (envelope-from se@FreeBSD.org) Message-Id: <201710181325.v9IDPi6u051247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Wed, 18 Oct 2017 13:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324721 - in head/share/man: man5 man8 X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/share/man: man5 man8 X-SVN-Commit-Revision: 324721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 13:25:46 -0000 Author: se Date: Wed Oct 18 13:25:44 2017 New Revision: 324721 URL: https://svnweb.freebsd.org/changeset/base/324721 Log: Add references to sysrc(8). Reported by: Kurt Jaeger (lists at opsec.eu) Modified: head/share/man/man5/rc.conf.5 head/share/man/man8/rc.8 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Oct 18 08:18:01 2017 (r324720) +++ head/share/man/man5/rc.conf.5 Wed Oct 18 13:25:44 2017 (r324721) @@ -4537,6 +4537,7 @@ configuration file. .Xr swapon 8 , .Xr sysctl 8 , .Xr syslogd 8 , +.Xr sysrc 8 , .Xr timed 8 , .Xr unbound 8 , .Xr usbconfig 8 , Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Wed Oct 18 08:18:01 2017 (r324720) +++ head/share/man/man8/rc.8 Wed Oct 18 13:25:44 2017 (r324721) @@ -548,7 +548,8 @@ is unnecessary, but is often included. .Xr rc.subr 8 , .Xr rcorder 8 , .Xr reboot 8 , -.Xr savecore 8 +.Xr savecore 8 , +.Xr sysrc 8 .Sh HISTORY The .Nm From owner-svn-src-head@freebsd.org Wed Oct 18 15:38:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E4D9E3C7D5; Wed, 18 Oct 2017 15:38:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAC3182FC5; Wed, 18 Oct 2017 15:38:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IFc77T006865; Wed, 18 Oct 2017 15:38:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IFc6Ze006856; Wed, 18 Oct 2017 15:38:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201710181538.v9IFc6Ze006856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 18 Oct 2017 15:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324722 - in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/mips sparc64/sparc64 sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 kern mips/mips sparc64/sparc64 sys X-SVN-Commit-Revision: 324722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 15:38:08 -0000 Author: markj Date: Wed Oct 18 15:38:05 2017 New Revision: 324722 URL: https://svnweb.freebsd.org/changeset/base/324722 Log: Move kernel dump offset tracking into MI code. All of the kernel dump implementations keep track of the current offset ("dumplo") within the dump device. However, except for textdumps, they all write the dump sequentially, so we can reduce code duplication by having the MI code keep track of the current offset. The new dump_append() API can be used to write at the current offset. This is needed to implement support for kernel dump compression in the MI kernel dump code. Also simplify dump_encrypted_write() somewhat: use dump_write() instead of duplicating its bounds checks, and get rid of the redundant offset tracking. Reviewed by: cem Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D11722 Modified: head/sys/amd64/amd64/minidump_machdep.c head/sys/arm/arm/minidump_machdep.c head/sys/arm64/arm64/minidump_machdep.c head/sys/i386/i386/minidump_machdep.c head/sys/kern/kern_dump.c head/sys/kern/kern_shutdown.c head/sys/mips/mips/minidump_machdep.c head/sys/sparc64/sparc64/dump_machdep.c head/sys/sys/conf.h Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Wed Oct 18 13:25:44 2017 (r324721) +++ head/sys/amd64/amd64/minidump_machdep.c Wed Oct 18 15:38:05 2017 (r324722) @@ -56,7 +56,6 @@ uint64_t *vm_page_dump; int vm_page_dump_size; static struct kerneldumpheader kdh; -static off_t dumplo; /* Handle chunked writes. */ static size_t fragsz; @@ -93,8 +92,7 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_write(di, dump_va, 0, dumplo, fragsz); - dumplo += fragsz; + error = dump_append(di, dump_va, 0, fragsz); fragsz = 0; return (error); } @@ -177,10 +175,9 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t wdog_kern_pat(WD_LASTVAL); if (ptr) { - error = dump_write(di, ptr, 0, dumplo, len); + error = dump_append(di, ptr, 0, len); if (error) return (error); - dumplo += len; ptr += len; sz -= len; } else { @@ -333,7 +330,7 @@ minidumpsys(struct dumperinfo *di) printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, ptoa((uintmax_t)physmem) / 1048576); - error = dump_start(di, &kdh, &dumplo); + error = dump_start(di, &kdh); if (error != 0) goto fail; @@ -419,7 +416,7 @@ minidumpsys(struct dumperinfo *di) if (error) goto fail; - error = dump_finish(di, &kdh, dumplo); + error = dump_finish(di, &kdh); if (error != 0) goto fail; Modified: head/sys/arm/arm/minidump_machdep.c ============================================================================== --- head/sys/arm/arm/minidump_machdep.c Wed Oct 18 13:25:44 2017 (r324721) +++ head/sys/arm/arm/minidump_machdep.c Wed Oct 18 15:38:05 2017 (r324722) @@ -58,8 +58,6 @@ int vm_page_dump_size; static struct kerneldumpheader kdh; -static off_t dumplo; - /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; @@ -89,8 +87,7 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_write(di, dump_va, 0, dumplo, fragsz); - dumplo += fragsz; + error = dump_append(di, dump_va, 0, fragsz); fragsz = 0; return (error); } @@ -141,10 +138,9 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t wdog_kern_pat(WD_LASTVAL); #endif if (ptr) { - error = dump_write(di, ptr, 0, dumplo, len); + error = dump_append(di, ptr, 0, len); if (error) return (error); - dumplo += len; ptr += len; sz -= len; } else { @@ -251,7 +247,7 @@ minidumpsys(struct dumperinfo *di) printf("Physical memory: %u MB\n", ptoa((uintmax_t)physmem) / 1048576); printf("Dumping %llu MB:", (long long)dumpsize >> 20); - error = dump_start(di, &kdh, &dumplo); + error = dump_start(di, &kdh); if (error != 0) goto fail; @@ -329,7 +325,7 @@ minidumpsys(struct dumperinfo *di) if (error) goto fail; - error = dump_finish(di, &kdh, dumplo); + error = dump_finish(di, &kdh); if (error != 0) goto fail; Modified: head/sys/arm64/arm64/minidump_machdep.c ============================================================================== --- head/sys/arm64/arm64/minidump_machdep.c Wed Oct 18 13:25:44 2017 (r324721) +++ head/sys/arm64/arm64/minidump_machdep.c Wed Oct 18 15:38:05 2017 (r324722) @@ -62,7 +62,6 @@ uint64_t *vm_page_dump; int vm_page_dump_size; static struct kerneldumpheader kdh; -static off_t dumplo; /* Handle chunked writes. */ static size_t fragsz; @@ -96,8 +95,7 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_write(di, dump_va, 0, dumplo, fragsz); - dumplo += fragsz; + error = dump_append(di, dump_va, 0, fragsz); fragsz = 0; return (error); } @@ -183,10 +181,9 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t wdog_kern_pat(WD_LASTVAL); if (ptr) { - error = dump_write(di, ptr, 0, dumplo, len); + error = dump_append(di, ptr, 0, len); if (error) return (error); - dumplo += len; ptr += len; sz -= len; } else { @@ -295,7 +292,7 @@ minidumpsys(struct dumperinfo *di) printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, ptoa((uintmax_t)physmem) / 1048576); - error = dump_start(di, &kdh, &dumplo); + error = dump_start(di, &kdh); if (error != 0) goto fail; @@ -395,7 +392,7 @@ minidumpsys(struct dumperinfo *di) if (error) goto fail; - error = dump_finish(di, &kdh, dumplo); + error = dump_finish(di, &kdh); if (error != 0) goto fail; Modified: head/sys/i386/i386/minidump_machdep.c ============================================================================== --- head/sys/i386/i386/minidump_machdep.c Wed Oct 18 13:25:44 2017 (r324721) +++ head/sys/i386/i386/minidump_machdep.c Wed Oct 18 15:38:05 2017 (r324722) @@ -54,7 +54,6 @@ uint32_t *vm_page_dump; int vm_page_dump_size; static struct kerneldumpheader kdh; -static off_t dumplo; /* Handle chunked writes. */ static size_t fragsz; @@ -86,8 +85,7 @@ blk_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_write(di, dump_va, 0, dumplo, fragsz); - dumplo += fragsz; + error = dump_append(di, dump_va, 0, fragsz); fragsz = 0; return (error); } @@ -135,10 +133,9 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t wdog_kern_pat(WD_LASTVAL); if (ptr) { - error = dump_write(di, ptr, 0, dumplo, len); + error = dump_append(di, ptr, 0, len); if (error) return (error); - dumplo += len; ptr += len; sz -= len; } else { @@ -258,7 +255,7 @@ minidumpsys(struct dumperinfo *di) printf("Physical memory: %ju MB\n", ptoa((uintmax_t)physmem) / 1048576); printf("Dumping %llu MB:", (long long)dumpsize >> 20); - error = dump_start(di, &kdh, &dumplo); + error = dump_start(di, &kdh); if (error != 0) goto fail; @@ -334,7 +331,7 @@ minidumpsys(struct dumperinfo *di) if (error) goto fail; - error = dump_finish(di, &kdh, dumplo); + error = dump_finish(di, &kdh); if (error != 0) goto fail; Modified: head/sys/kern/kern_dump.c ============================================================================== --- head/sys/kern/kern_dump.c Wed Oct 18 13:25:44 2017 (r324721) +++ head/sys/kern/kern_dump.c Wed Oct 18 15:38:05 2017 (r324722) @@ -51,8 +51,6 @@ CTASSERT(sizeof(struct kerneldumpheader) == 512); #define MD_ALIGN(x) roundup2((off_t)(x), PAGE_SIZE) -off_t dumplo; - /* Handle buffered writes. */ static size_t fragsz; @@ -122,11 +120,9 @@ dumpsys_buf_seek(struct dumperinfo *di, size_t sz) while (sz > 0) { nbytes = MIN(sz, sizeof(buf)); - error = dump_write(di, buf, 0, dumplo, nbytes); + error = dump_append(di, buf, 0, nbytes); if (error) return (error); - dumplo += nbytes; - sz -= nbytes; } @@ -148,11 +144,9 @@ dumpsys_buf_write(struct dumperinfo *di, char *ptr, si ptr += len; sz -= len; if (fragsz == di->blocksize) { - error = dump_write(di, di->blockbuf, 0, dumplo, - di->blocksize); + error = dump_append(di, di->blockbuf, 0, di->blocksize); if (error) return (error); - dumplo += di->blocksize; fragsz = 0; } } @@ -167,8 +161,7 @@ dumpsys_buf_flush(struct dumperinfo *di) if (fragsz == 0) return (0); - error = dump_write(di, di->blockbuf, 0, dumplo, di->blocksize); - dumplo += di->blocksize; + error = dump_append(di, di->blockbuf, 0, di->blocksize); fragsz = 0; return (error); } @@ -216,11 +209,10 @@ dumpsys_cb_dumpdata(struct dump_pa *mdp, int seqnr, vo wdog_kern_pat(WD_LASTVAL); #endif - error = dump_write(di, va, 0, dumplo, sz); + error = dump_append(di, va, 0, sz); dumpsys_unmap_chunk(pa, chunk, va); if (error) break; - dumplo += sz; pgs -= chunk; pa += sz; @@ -347,7 +339,7 @@ dumpsys_generic(struct dumperinfo *di) printf("Dumping %ju MB (%d chunks)\n", (uintmax_t)dumpsize >> 20, ehdr.e_phnum - DUMPSYS_NUM_AUX_HDRS); - error = dump_start(di, &kdh, &dumplo); + error = dump_start(di, &kdh); if (error != 0) goto fail; @@ -369,19 +361,18 @@ dumpsys_generic(struct dumperinfo *di) * All headers are written using blocked I/O, so we know the * current offset is (still) block aligned. Skip the alignement * in the file to have the segment contents aligned at page - * boundary. We cannot use MD_ALIGN on dumplo, because we don't - * care and may very well be unaligned within the dump device. + * boundary. */ error = dumpsys_buf_seek(di, (size_t)hdrgap); if (error) goto fail; - /* Dump memory chunks (updates dumplo) */ + /* Dump memory chunks. */ error = dumpsys_foreach_chunk(dumpsys_cb_dumpdata, di); if (error < 0) goto fail; - error = dump_finish(di, &kdh, dumplo); + error = dump_finish(di, &kdh); if (error != 0) goto fail; Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Wed Oct 18 13:25:44 2017 (r324721) +++ head/sys/kern/kern_shutdown.c Wed Oct 18 15:38:05 2017 (r324722) @@ -157,7 +157,6 @@ struct kerneldumpcrypto { uint8_t kdc_iv[KERNELDUMP_IV_MAX_SIZE]; keyInstance kdc_ki; cipherInstance kdc_ci; - off_t kdc_nextoffset; uint32_t kdc_dumpkeysize; struct kerneldumpkey kdc_dumpkey[]; }; @@ -931,8 +930,6 @@ kerneldumpcrypto_init(struct kerneldumpcrypto *kdc) goto out; } - kdc->kdc_nextoffset = 0; - kdk = kdc->kdc_dumpkey; memcpy(kdk->kdk_iv, kdc->kdc_iv, sizeof(kdk->kdk_iv)); out: @@ -1024,24 +1021,20 @@ dump_check_bounds(struct dumperinfo *di, off_t offset, (uintmax_t)length, (intmax_t)di->mediasize); return (ENOSPC); } + if (length % di->blocksize != 0) { + printf("Attempt to write partial block of length %ju.\n", + (uintmax_t)length); + return (EINVAL); + } + if (offset % di->blocksize != 0) { + printf("Attempt to write at unaligned offset %jd.\n", + (intmax_t)offset); + return (EINVAL); + } return (0); } -/* Call dumper with bounds checking. */ -static int -dump_raw_write(struct dumperinfo *di, void *virtual, vm_offset_t physical, - off_t offset, size_t length) -{ - int error; - - error = dump_check_bounds(di, offset, length); - if (error != 0) - return (error); - - return (di->dumper(di->priv, virtual, physical, offset, length)); -} - #ifdef EKCD static int dump_encrypt(struct kerneldumpcrypto *kdc, uint8_t *buf, size_t size) @@ -1067,40 +1060,16 @@ dump_encrypt(struct kerneldumpcrypto *kdc, uint8_t *bu /* Encrypt data and call dumper. */ static int -dump_encrypted_write(struct dumperinfo *di, void *virtual, vm_offset_t physical, - off_t offset, size_t length) +dump_encrypted_write(struct dumperinfo *di, void *virtual, + vm_offset_t physical, off_t offset, size_t length) { static uint8_t buf[KERNELDUMP_BUFFER_SIZE]; struct kerneldumpcrypto *kdc; int error; size_t nbytes; - off_t nextoffset; kdc = di->kdc; - error = dump_check_bounds(di, offset, length); - if (error != 0) - return (error); - - /* Signal completion. */ - if (virtual == NULL && physical == 0 && offset == 0 && length == 0) { - return (di->dumper(di->priv, virtual, physical, offset, - length)); - } - - /* Data have to be aligned to block size. */ - if ((length % di->blocksize) != 0) - return (EINVAL); - - /* - * Data have to be written continuously becase we're encrypting using - * CBC mode which has this assumption. - */ - if (kdc->kdc_nextoffset != 0 && kdc->kdc_nextoffset != offset) - return (EINVAL); - - nextoffset = offset + (off_t)length; - while (length > 0) { nbytes = MIN(length, sizeof(buf)); bcopy(virtual, buf, nbytes); @@ -1108,7 +1077,7 @@ dump_encrypted_write(struct dumperinfo *di, void *virt if (dump_encrypt(kdc, buf, nbytes) != 0) return (EIO); - error = di->dumper(di->priv, buf, physical, offset, nbytes); + error = dump_write(di, buf, physical, offset, nbytes); if (error != 0) return (error); @@ -1117,8 +1086,6 @@ dump_encrypted_write(struct dumperinfo *di, void *virt length -= nbytes; } - kdc->kdc_nextoffset = nextoffset; - return (0); } @@ -1131,26 +1098,11 @@ dump_write_key(struct dumperinfo *di, vm_offset_t phys if (kdc == NULL) return (0); - return (dump_raw_write(di, kdc->kdc_dumpkey, physical, offset, + return (dump_write(di, kdc->kdc_dumpkey, physical, offset, kdc->kdc_dumpkeysize)); } #endif /* EKCD */ -int -dump_write(struct dumperinfo *di, void *virtual, vm_offset_t physical, - off_t offset, size_t length) -{ - -#ifdef EKCD - if (di->kdc != NULL) { - return (dump_encrypted_write(di, virtual, physical, offset, - length)); - } -#endif - - return (dump_raw_write(di, virtual, physical, offset, length)); -} - static int dump_write_header(struct dumperinfo *di, struct kerneldumpheader *kdh, vm_offset_t physical, off_t offset) @@ -1170,7 +1122,7 @@ dump_write_header(struct dumperinfo *di, struct kernel memcpy(buf, kdh, hdrsz); } - return (dump_raw_write(di, buf, physical, offset, di->blocksize)); + return (dump_write(di, buf, physical, offset, di->blocksize)); } /* @@ -1185,7 +1137,7 @@ dump_write_header(struct dumperinfo *di, struct kernel * key. */ int -dump_start(struct dumperinfo *di, struct kerneldumpheader *kdh, off_t *dumplop) +dump_start(struct dumperinfo *di, struct kerneldumpheader *kdh) { uint64_t dumpsize; uint32_t keysize; @@ -1204,33 +1156,65 @@ dump_start(struct dumperinfo *di, struct kerneldumphea if (di->mediasize < SIZEOF_METADATA + dumpsize) return (E2BIG); - *dumplop = di->mediaoffset + di->mediasize - dumpsize; + di->dumpoff = di->mediaoffset + di->mediasize - dumpsize; - error = dump_write_header(di, kdh, 0, *dumplop); + error = dump_write_header(di, kdh, 0, di->dumpoff); if (error != 0) return (error); - *dumplop += di->blocksize; + di->dumpoff += di->blocksize; #ifdef EKCD - error = dump_write_key(di, 0, *dumplop); + error = dump_write_key(di, 0, di->dumpoff); if (error != 0) return (error); - *dumplop += keysize; + di->dumpoff += keysize; #endif return (0); } +/* Write to the dump device at the current dump offset. */ +int +dump_append(struct dumperinfo *di, void *virtual, vm_offset_t physical, + size_t length) +{ + int error; + +#ifdef EKCD + if (di->kdc != NULL) + error = dump_encrypted_write(di, virtual, physical, di->dumpoff, + length); + else +#endif + error = dump_write(di, virtual, physical, di->dumpoff, length); + if (error == 0) + di->dumpoff += length; + return (error); +} + +/* Perform a raw write to the dump device at the specified offset. */ +int +dump_write(struct dumperinfo *di, void *virtual, vm_offset_t physical, + off_t offset, size_t length) +{ + int error; + + error = dump_check_bounds(di, offset, length); + if (error != 0) + return (error); + return (di->dumper(di->priv, virtual, physical, offset, length)); +} + /* * Write the trailing kernel dump header and signal to the lower layers that the * dump has completed. */ int -dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh, off_t dumplo) +dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh) { int error; - error = dump_write_header(di, kdh, 0, dumplo); + error = dump_write_header(di, kdh, 0, di->dumpoff); if (error != 0) return (error); Modified: head/sys/mips/mips/minidump_machdep.c ============================================================================== --- head/sys/mips/mips/minidump_machdep.c Wed Oct 18 13:25:44 2017 (r324721) +++ head/sys/mips/mips/minidump_machdep.c Wed Oct 18 15:38:05 2017 (r324722) @@ -56,7 +56,6 @@ uint32_t *vm_page_dump; int vm_page_dump_size; static struct kerneldumpheader kdh; -static off_t dumplo; /* Handle chunked writes. */ static uint64_t counter, progress, dumpsize; @@ -166,10 +165,9 @@ write_buffer(struct dumperinfo *di, char *ptr, size_t wdog_kern_pat(WD_LASTVAL); if (ptr) { - error = dump_write(di, ptr, 0, dumplo, len); + error = dump_append(di, ptr, 0, len); if (error) return (error); - dumplo += len; ptr += len; sz -= len; } else { @@ -267,7 +265,7 @@ minidumpsys(struct dumperinfo *di) printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, ptoa((uintmax_t)physmem) / 1048576); - error = dump_start(di, &kdh, &dumplo); + error = dump_start(di, &kdh); if (error != 0) goto fail; @@ -335,7 +333,7 @@ minidumpsys(struct dumperinfo *di) } } - error = dump_finish(di, &kdh, dumplo); + error = dump_finish(di, &kdh); if (error != 0) goto fail; Modified: head/sys/sparc64/sparc64/dump_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/dump_machdep.c Wed Oct 18 13:25:44 2017 (r324721) +++ head/sys/sparc64/sparc64/dump_machdep.c Wed Oct 18 15:38:05 2017 (r324722) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); static off_t fileofs; -extern off_t dumplo; extern struct dump_pa dump_map[DUMPSYS_MD_PA_NPAIRS]; int do_minidump = 0; @@ -99,7 +98,7 @@ dumpsys(struct dumperinfo *di) printf("Dumping %lu MB (%d chunks)\n", (u_long)(size >> 20), nreg); - error = dump_start(di, &kdh, &dumplo); + error = dump_start(di, &kdh); if (error != 0) goto fail; @@ -128,7 +127,7 @@ dumpsys(struct dumperinfo *di) if (error < 0) goto fail; - error = dump_finish(di, &kdh, dumplo); + error = dump_finish(di, &kdh); if (error != 0) goto fail; Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Wed Oct 18 13:25:44 2017 (r324721) +++ head/sys/sys/conf.h Wed Oct 18 15:38:05 2017 (r324722) @@ -336,21 +336,23 @@ struct dumperinfo { off_t mediaoffset; /* Initial offset in bytes. */ off_t mediasize; /* Space available in bytes. */ void *blockbuf; /* Buffer for padding shorter dump blocks */ + off_t dumpoff; /* Offset of ongoing kernel dump. */ struct kerneldumpcrypto *kdc; /* Kernel dump crypto. */ }; +extern int dumping; /* system is dumping */ + +int doadump(boolean_t); int set_dumper(struct dumperinfo *di, const char *devname, struct thread *td, uint8_t encrypt, const uint8_t *key, uint32_t encryptedkeysize, const uint8_t *encryptedkey); + +int dump_start(struct dumperinfo *di, struct kerneldumpheader *kdh); +int dump_append(struct dumperinfo *, void *, vm_offset_t, size_t); +int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t); +int dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh); void dump_init_header(const struct dumperinfo *di, struct kerneldumpheader *kdh, char *magic, uint32_t archver, uint64_t dumplen); -int dump_start(struct dumperinfo *di, struct kerneldumpheader *kdh, - off_t *dumplop); -int dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh, - off_t dumplo); -int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t); -int doadump(boolean_t); -extern int dumping; /* system is dumping */ #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Wed Oct 18 15:48:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A63DFE3CA80; Wed, 18 Oct 2017 15:48:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 746F183466; Wed, 18 Oct 2017 15:48:27 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IFmQIN010841; Wed, 18 Oct 2017 15:48:26 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IFmQlw010840; Wed, 18 Oct 2017 15:48:26 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201710181548.v9IFmQlw010840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Wed, 18 Oct 2017 15:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324723 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 324723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 15:48:27 -0000 Author: brd (doc,ports committer) Date: Wed Oct 18 15:48:26 2017 New Revision: 324723 URL: https://svnweb.freebsd.org/changeset/base/324723 Log: Teach beinstall to use and prefer svnlite, with a fallback to svn. Approved by: will Modified: head/tools/build/beinstall.sh Modified: head/tools/build/beinstall.sh ============================================================================== --- head/tools/build/beinstall.sh Wed Oct 18 15:38:05 2017 (r324722) +++ head/tools/build/beinstall.sh Wed Oct 18 15:48:26 2017 (r324723) @@ -106,7 +106,13 @@ if [ -d .git ] ; then [ $? -ne 0 ] && errx "Can't lookup git commit timestamp" commit_ts=$(date -r ${commit_time} '+%Y%m%d.%H%M%S') elif [ -d .svn ] ; then - commit_ts=$( svn info | awk '/Last Changed Date/ {print $4 "." $5}' | tr -d :- ) + if [ -f /usr/bin/svnlite ]; then + commit_ts=$( svnlite info --show-item last-changed-date | sed -e 's/\..*//' -e 's/T/./' -e 's/-//g' -e s'/://g' ) + elif [ -f /usr/local/bin/svn ]; then + commit_ts=$( svn info --show-item last-changed-date | sed -e 's/\..*//' -e 's/T/./' -e 's/-//g' -e s'/://g' ) + else + errx "Can't lookup Subversion commit timestamp" + fi [ $? -ne 0 ] && errx "Can't lookup Subversion commit timestamp" else errx "Unable to determine sandbox type" From owner-svn-src-head@freebsd.org Wed Oct 18 17:23:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D01A9E3F769; Wed, 18 Oct 2017 17:23:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97C7E3124; Wed, 18 Oct 2017 17:23:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IHNGZL055003; Wed, 18 Oct 2017 17:23:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IHNGQj055000; Wed, 18 Oct 2017 17:23:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201710181723.v9IHNGQj055000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Oct 2017 17:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324724 - in head/sys: conf mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: conf mips/mips X-SVN-Commit-Revision: 324724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 17:23:17 -0000 Author: jhb Date: Wed Oct 18 17:23:16 2017 New Revision: 324724 URL: https://svnweb.freebsd.org/changeset/base/324724 Log: Remove CPU_HAVEFPU. Instead, use a runtime decision to handle COP1 traps. If floating point support is present in the current CPU, enable saving of the floating point state. If support is not present, fail with SIGILL. Reviewed by: imp, br Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D12707 Modified: head/sys/conf/kern.mk head/sys/conf/options.mips head/sys/mips/mips/trap.c Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Wed Oct 18 15:48:26 2017 (r324723) +++ head/sys/conf/kern.mk Wed Oct 18 17:23:16 2017 (r324724) @@ -184,9 +184,6 @@ CFLAGS.gcc+= -mcall-aixdesc .if ${MACHINE_CPUARCH} == "mips" CFLAGS+= -msoft-float INLINE_LIMIT?= 8000 -.if ${MACHINE_ARCH:Mmips*hf} != "" -CFLAGS+= -DCPU_HAVEFPU -.endif .endif # Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Wed Oct 18 15:48:26 2017 (r324723) +++ head/sys/conf/options.mips Wed Oct 18 17:23:16 2017 (r324724) @@ -39,7 +39,6 @@ CPU_PROAPTIV opt_global.h CPU_MIPS32 opt_global.h CPU_MIPS64 opt_global.h CPU_SENTRY5 opt_global.h -CPU_HAVEFPU opt_global.h CPU_SB1 opt_global.h CPU_CNMIPS opt_global.h CPU_RMI opt_global.h Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Wed Oct 18 15:48:26 2017 (r324723) +++ head/sys/mips/mips/trap.c Wed Oct 18 17:23:16 2017 (r324724) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -970,12 +971,13 @@ dofault: case T_COP_UNUSABLE + T_USER: cop = (trapframe->cause & MIPS_CR_COP_ERR) >> MIPS_CR_COP_ERR_SHIFT; if (cop == 1) { -#if !defined(CPU_HAVEFPU) - /* FP (COP1) instruction */ - log_illegal_instruction("COP1_UNUSABLE", trapframe); - i = SIGILL; - break; -#else + /* FP (COP1) instruction */ + if (cpuinfo.fpu_id == 0) { + log_illegal_instruction("COP1_UNUSABLE", + trapframe); + i = SIGILL; + break; + } addr = trapframe->pc; MipsSwitchFPState(PCPU_GET(fpcurthread), td->td_frame); PCPU_SET(fpcurthread, td); @@ -986,7 +988,6 @@ dofault: #endif td->td_md.md_flags |= MDTD_FPUSED; goto out; -#endif } #ifdef CPU_CNMIPS else if (cop == 2) { From owner-svn-src-head@freebsd.org Wed Oct 18 18:56:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA120E415D7; Wed, 18 Oct 2017 18:56:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9666465B2B; Wed, 18 Oct 2017 18:56:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IIuufi092639; Wed, 18 Oct 2017 18:56:56 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IIuudP092637; Wed, 18 Oct 2017 18:56:56 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201710181856.v9IIuudP092637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 18 Oct 2017 18:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324725 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 18:56:57 -0000 Author: tuexen Date: Wed Oct 18 18:56:56 2017 New Revision: 324725 URL: https://svnweb.freebsd.org/changeset/base/324725 Log: Fix a bug introduced in r324638. Thanks to Felix Weinrank for making me aware of this. MFC after: 3 days Modified: head/sys/netinet/ip_fw.h head/sys/netinet/sctp_input.c Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Wed Oct 18 17:23:16 2017 (r324724) +++ head/sys/netinet/ip_fw.h Wed Oct 18 18:56:56 2017 (r324725) @@ -728,6 +728,8 @@ struct _ipfw_dyn_rule { #define ICMP_REJECT_RST 0x100 /* fake ICMP code (send a TCP RST) */ #define ICMP6_UNREACH_RST 0x100 /* fake ICMPv6 code (send a TCP RST) */ +#define ICMP_REJECT_ABORT 0x101 /* fake ICMP code (send an SCTP ABORT */ +#define ICMP6_UNREACH_ABORT 0x101 /* fake ICMPv6 code (send an SCTP ABORT) */ /* * These are used for lookup tables. Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Wed Oct 18 17:23:16 2017 (r324724) +++ head/sys/netinet/sctp_input.c Wed Oct 18 18:56:56 2017 (r324725) @@ -4536,6 +4536,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int * if (ntohs(ch->chunk_length) < sizeof(*ch)) { SCTPDBG(SCTP_DEBUG_INPUT1, "Invalid header length %d\n", ntohs(ch->chunk_length)); + *offset = length; return (stcb); } /* From owner-svn-src-head@freebsd.org Wed Oct 18 18:59:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03C0DE416B2; Wed, 18 Oct 2017 18:59:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C449D65CAC; Wed, 18 Oct 2017 18:59:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IIxZqw092782; Wed, 18 Oct 2017 18:59:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IIxZWg092781; Wed, 18 Oct 2017 18:59:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201710181859.v9IIxZWg092781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 18 Oct 2017 18:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324726 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 18:59:37 -0000 Author: tuexen Date: Wed Oct 18 18:59:35 2017 New Revision: 324726 URL: https://svnweb.freebsd.org/changeset/base/324726 Log: Revert change which got in accidently. Modified: head/sys/netinet/ip_fw.h Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Wed Oct 18 18:56:56 2017 (r324725) +++ head/sys/netinet/ip_fw.h Wed Oct 18 18:59:35 2017 (r324726) @@ -728,8 +728,6 @@ struct _ipfw_dyn_rule { #define ICMP_REJECT_RST 0x100 /* fake ICMP code (send a TCP RST) */ #define ICMP6_UNREACH_RST 0x100 /* fake ICMPv6 code (send a TCP RST) */ -#define ICMP_REJECT_ABORT 0x101 /* fake ICMP code (send an SCTP ABORT */ -#define ICMP6_UNREACH_ABORT 0x101 /* fake ICMPv6 code (send an SCTP ABORT) */ /* * These are used for lookup tables. From owner-svn-src-head@freebsd.org Wed Oct 18 19:22:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60C41E4216E; Wed, 18 Oct 2017 19:22:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0685766C4A; Wed, 18 Oct 2017 19:22:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IJMtQj004949; Wed, 18 Oct 2017 19:22:55 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IJMsiU004933; Wed, 18 Oct 2017 19:22:54 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201710181922.v9IJMsiU004933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 18 Oct 2017 19:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324727 - in head: sys/compat/cloudabi sys/compat/cloudabi32 sys/compat/cloudabi64 sys/contrib/cloudabi usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: in head: sys/compat/cloudabi sys/compat/cloudabi32 sys/compat/cloudabi64 sys/contrib/cloudabi usr.bin/truss X-SVN-Commit-Revision: 324727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 19:22:56 -0000 Author: ed Date: Wed Oct 18 19:22:53 2017 New Revision: 324727 URL: https://svnweb.freebsd.org/changeset/base/324727 Log: Import the latest CloudABI definitions, version 0.16. The most important change in this release is the removal of the poll_fd() system call; CloudABI's equivalent of kevent(). Though I think that kqueue is a lot saner than many of its alternatives, our experience is that emulating this system call on other systems accurately isn't easy. It has become a complex API, even though I'm not convinced this complexity is needed. This is why we've decided to take a different approach, by looking one layer up. We're currently adding an event loop to CloudABI's C library that is API compatible with libuv (except when incompatible with Capsicum). Initially, this event loop will be built on top of plain inefficient poll() calls. Only after this is finished, we'll work our way backwards and design a new set of system calls to optimize it. Interesting challenges will include integrating asynchronous I/O into such a system call API. libuv currently doesn't aio(4) on Linux/BSD, due to it being unreliable and having undesired semantics. Obtained from: https://github.com/NuxiNL/cloudabi Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/cloudabi32/cloudabi32_poll.c head/sys/compat/cloudabi32/cloudabi32_proto.h head/sys/compat/cloudabi32/cloudabi32_syscall.h head/sys/compat/cloudabi32/cloudabi32_syscalls.c head/sys/compat/cloudabi32/cloudabi32_sysent.c head/sys/compat/cloudabi32/cloudabi32_systrace_args.c head/sys/compat/cloudabi64/cloudabi64_poll.c head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c head/sys/compat/cloudabi64/cloudabi64_systrace_args.c head/sys/contrib/cloudabi/cloudabi32_types.h head/sys/contrib/cloudabi/cloudabi64_types.h head/sys/contrib/cloudabi/cloudabi_types_common.h head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S head/sys/contrib/cloudabi/cloudabi_vdso_i686.S head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S head/sys/contrib/cloudabi/syscalls32.master head/sys/contrib/cloudabi/syscalls64.master head/usr.bin/truss/syscalls.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi/cloudabi_fd.c Wed Oct 18 19:22:53 2017 (r324727) @@ -73,9 +73,7 @@ __FBSDID("$FreeBSD$"); MAPPING(CLOUDABI_RIGHT_MEM_MAP, CAP_MMAP) \ MAPPING(CLOUDABI_RIGHT_MEM_MAP_EXEC, CAP_MMAP_X) \ MAPPING(CLOUDABI_RIGHT_POLL_FD_READWRITE, CAP_EVENT) \ - MAPPING(CLOUDABI_RIGHT_POLL_MODIFY, CAP_KQUEUE_CHANGE) \ MAPPING(CLOUDABI_RIGHT_POLL_PROC_TERMINATE, CAP_EVENT) \ - MAPPING(CLOUDABI_RIGHT_POLL_WAIT, CAP_KQUEUE_EVENT) \ MAPPING(CLOUDABI_RIGHT_PROC_EXEC, CAP_FEXECVE) \ MAPPING(CLOUDABI_RIGHT_SOCK_SHUTDOWN, CAP_SHUTDOWN) \ @@ -93,9 +91,6 @@ cloudabi_sys_fd_create1(struct thread *td, struct filecaps fcaps = {}; switch (uap->type) { - case CLOUDABI_FILETYPE_POLL: - cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_KQUEUE); - return (kern_kqueue(td, 0, &fcaps)); case CLOUDABI_FILETYPE_SHARED_MEMORY: cap_rights_init(&fcaps.fc_rights, CAP_FSTAT, CAP_FTRUNCATE, CAP_MMAP_RWX); @@ -201,8 +196,6 @@ cloudabi_convert_filetype(const struct file *fp) switch (fp->f_type) { case DTYPE_FIFO: return (CLOUDABI_FILETYPE_SOCKET_STREAM); - case DTYPE_KQUEUE: - return (CLOUDABI_FILETYPE_POLL); case DTYPE_PIPE: return (CLOUDABI_FILETYPE_SOCKET_STREAM); case DTYPE_PROCDESC: @@ -315,10 +308,6 @@ cloudabi_remove_conflicting_rights(cloudabi_filetype_t CLOUDABI_RIGHT_MEM_MAP_EXEC | CLOUDABI_RIGHT_POLL_FD_READWRITE | CLOUDABI_RIGHT_PROC_EXEC; - break; - case CLOUDABI_FILETYPE_POLL: - *base &= ~CLOUDABI_RIGHT_FILE_ADVISE; - *inheriting = 0; break; case CLOUDABI_FILETYPE_PROCESS: *base &= ~(CLOUDABI_RIGHT_FILE_ADVISE | Modified: head/sys/compat/cloudabi32/cloudabi32_poll.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_poll.c Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi32/cloudabi32_poll.c Wed Oct 18 19:22:53 2017 (r324727) @@ -79,7 +79,6 @@ convert_signal(int sig) struct cloudabi32_kevent_args { const cloudabi32_subscription_t *in; cloudabi32_event_t *out; - bool once; }; /* Converts CloudABI's subscription objects to FreeBSD's struct kevent. */ @@ -124,9 +123,7 @@ cloudabi32_kevent_copyin(void *arg, struct kevent *kev case CLOUDABI_EVENTTYPE_FD_READ: kevp->filter = EVFILT_READ; kevp->ident = sub.fd_readwrite.fd; - if ((sub.fd_readwrite.flags & - CLOUDABI_SUBSCRIPTION_FD_READWRITE_POLL) != 0) - kevp->fflags = NOTE_FILE_POLL; + kevp->fflags = NOTE_FILE_POLL; break; case CLOUDABI_EVENTTYPE_FD_WRITE: kevp->filter = EVFILT_WRITE; @@ -138,24 +135,7 @@ cloudabi32_kevent_copyin(void *arg, struct kevent *kev kevp->fflags = NOTE_EXIT; break; } - if (args->once) { - /* Ignore flags. Simply use oneshot mode. */ - kevp->flags = EV_ADD | EV_ONESHOT; - } else { - /* Translate flags. */ - if ((sub.flags & CLOUDABI_SUBSCRIPTION_ADD) != 0) - kevp->flags |= EV_ADD; - if ((sub.flags & CLOUDABI_SUBSCRIPTION_CLEAR) != 0) - kevp->flags |= EV_CLEAR; - if ((sub.flags & CLOUDABI_SUBSCRIPTION_DELETE) != 0) - kevp->flags |= EV_DELETE; - if ((sub.flags & CLOUDABI_SUBSCRIPTION_DISABLE) != 0) - kevp->flags |= EV_DISABLE; - if ((sub.flags & CLOUDABI_SUBSCRIPTION_ENABLE) != 0) - kevp->flags |= EV_ENABLE; - if ((sub.flags & CLOUDABI_SUBSCRIPTION_ONESHOT) != 0) - kevp->flags |= EV_ONESHOT; - } + kevp->flags = EV_ADD | EV_ONESHOT; ++kevp; } return (0); @@ -238,7 +218,6 @@ cloudabi32_sys_poll(struct thread *td, struct cloudabi struct cloudabi32_kevent_args args = { .in = uap->in, .out = uap->out, - .once = true, }; struct kevent_copyops copyops = { .k_copyin = cloudabi32_kevent_copyin, @@ -368,41 +347,4 @@ cloudabi32_sys_poll(struct thread *td, struct cloudabi } return (kern_kevent_anonymous(td, uap->nsubscriptions, ©ops)); -} - -int -cloudabi32_sys_poll_fd(struct thread *td, - struct cloudabi32_sys_poll_fd_args *uap) -{ - struct cloudabi32_kevent_args args = { - .in = uap->in, - .out = uap->out, - .once = false, - }; - struct kevent_copyops copyops = { - .k_copyin = cloudabi32_kevent_copyin, - .k_copyout = cloudabi32_kevent_copyout, - .arg = &args, - }; - cloudabi32_subscription_t subtimo; - struct timespec timeout; - int error; - - if (uap->timeout != NULL) { - /* Poll with a timeout. */ - error = copyin(uap->timeout, &subtimo, sizeof(subtimo)); - if (error != 0) - return (error); - if (subtimo.type != CLOUDABI_EVENTTYPE_CLOCK || - subtimo.clock.flags != 0) - return (EINVAL); - timeout.tv_sec = subtimo.clock.timeout / 1000000000; - timeout.tv_nsec = subtimo.clock.timeout % 1000000000; - return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len, - ©ops, &timeout)); - } else { - /* Poll without a timeout. */ - return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len, - ©ops, NULL)); - } } Modified: head/sys/compat/cloudabi32/cloudabi32_proto.h ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_proto.h Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi32/cloudabi32_proto.h Wed Oct 18 19:22:53 2017 (r324727) @@ -227,14 +227,6 @@ struct cloudabi32_sys_poll_args { char out_l_[PADL_(cloudabi32_event_t *)]; cloudabi32_event_t * out; char out_r_[PADR_(cloudabi32_event_t *)]; char nsubscriptions_l_[PADL_(size_t)]; size_t nsubscriptions; char nsubscriptions_r_[PADR_(size_t)]; }; -struct cloudabi32_sys_poll_fd_args { - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)]; - char in_len_l_[PADL_(size_t)]; size_t in_len; char in_len_r_[PADR_(size_t)]; - char out_l_[PADL_(cloudabi32_event_t *)]; cloudabi32_event_t * out; char out_r_[PADR_(cloudabi32_event_t *)]; - char out_len_l_[PADL_(size_t)]; size_t out_len; char out_len_r_[PADR_(size_t)]; - char timeout_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi32_subscription_t *)]; -}; struct cloudabi_sys_proc_exec_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)]; @@ -317,7 +309,6 @@ int cloudabi_sys_mem_protect(struct thread *, struct c int cloudabi_sys_mem_sync(struct thread *, struct cloudabi_sys_mem_sync_args *); int cloudabi_sys_mem_unmap(struct thread *, struct cloudabi_sys_mem_unmap_args *); int cloudabi32_sys_poll(struct thread *, struct cloudabi32_sys_poll_args *); -int cloudabi32_sys_poll_fd(struct thread *, struct cloudabi32_sys_poll_fd_args *); int cloudabi_sys_proc_exec(struct thread *, struct cloudabi_sys_proc_exec_args *); int cloudabi_sys_proc_exit(struct thread *, struct cloudabi_sys_proc_exit_args *); int cloudabi_sys_proc_fork(struct thread *, struct cloudabi_sys_proc_fork_args *); @@ -403,7 +394,6 @@ int cloudabi_sys_thread_yield(struct thread *, struct #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_sync AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_mem_unmap AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi32_sys_poll AUE_NULL -#define CLOUDABI32_SYS_AUE_cloudabi32_sys_poll_fd AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_exec AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_exit AUE_NULL #define CLOUDABI32_SYS_AUE_cloudabi_sys_proc_fork AUE_NULL Modified: head/sys/compat/cloudabi32/cloudabi32_syscall.h ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscall.h Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi32/cloudabi32_syscall.h Wed Oct 18 19:22:53 2017 (r324727) @@ -43,16 +43,15 @@ #define CLOUDABI32_SYS_cloudabi_sys_mem_sync 35 #define CLOUDABI32_SYS_cloudabi_sys_mem_unmap 36 #define CLOUDABI32_SYS_cloudabi32_sys_poll 37 -#define CLOUDABI32_SYS_cloudabi32_sys_poll_fd 38 -#define CLOUDABI32_SYS_cloudabi_sys_proc_exec 39 -#define CLOUDABI32_SYS_cloudabi_sys_proc_exit 40 -#define CLOUDABI32_SYS_cloudabi_sys_proc_fork 41 -#define CLOUDABI32_SYS_cloudabi_sys_proc_raise 42 -#define CLOUDABI32_SYS_cloudabi_sys_random_get 43 -#define CLOUDABI32_SYS_cloudabi32_sys_sock_recv 44 -#define CLOUDABI32_SYS_cloudabi32_sys_sock_send 45 -#define CLOUDABI32_SYS_cloudabi_sys_sock_shutdown 46 -#define CLOUDABI32_SYS_cloudabi32_sys_thread_create 47 -#define CLOUDABI32_SYS_cloudabi_sys_thread_exit 48 -#define CLOUDABI32_SYS_cloudabi_sys_thread_yield 49 -#define CLOUDABI32_SYS_MAXSYSCALL 50 +#define CLOUDABI32_SYS_cloudabi_sys_proc_exec 38 +#define CLOUDABI32_SYS_cloudabi_sys_proc_exit 39 +#define CLOUDABI32_SYS_cloudabi_sys_proc_fork 40 +#define CLOUDABI32_SYS_cloudabi_sys_proc_raise 41 +#define CLOUDABI32_SYS_cloudabi_sys_random_get 42 +#define CLOUDABI32_SYS_cloudabi32_sys_sock_recv 43 +#define CLOUDABI32_SYS_cloudabi32_sys_sock_send 44 +#define CLOUDABI32_SYS_cloudabi_sys_sock_shutdown 45 +#define CLOUDABI32_SYS_cloudabi32_sys_thread_create 46 +#define CLOUDABI32_SYS_cloudabi_sys_thread_exit 47 +#define CLOUDABI32_SYS_cloudabi_sys_thread_yield 48 +#define CLOUDABI32_SYS_MAXSYSCALL 49 Modified: head/sys/compat/cloudabi32/cloudabi32_syscalls.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscalls.c Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi32/cloudabi32_syscalls.c Wed Oct 18 19:22:53 2017 (r324727) @@ -44,16 +44,15 @@ const char *cloudabi32_syscallnames[] = { "cloudabi_sys_mem_sync", /* 35 = cloudabi_sys_mem_sync */ "cloudabi_sys_mem_unmap", /* 36 = cloudabi_sys_mem_unmap */ "cloudabi32_sys_poll", /* 37 = cloudabi32_sys_poll */ - "cloudabi32_sys_poll_fd", /* 38 = cloudabi32_sys_poll_fd */ - "cloudabi_sys_proc_exec", /* 39 = cloudabi_sys_proc_exec */ - "cloudabi_sys_proc_exit", /* 40 = cloudabi_sys_proc_exit */ - "cloudabi_sys_proc_fork", /* 41 = cloudabi_sys_proc_fork */ - "cloudabi_sys_proc_raise", /* 42 = cloudabi_sys_proc_raise */ - "cloudabi_sys_random_get", /* 43 = cloudabi_sys_random_get */ - "cloudabi32_sys_sock_recv", /* 44 = cloudabi32_sys_sock_recv */ - "cloudabi32_sys_sock_send", /* 45 = cloudabi32_sys_sock_send */ - "cloudabi_sys_sock_shutdown", /* 46 = cloudabi_sys_sock_shutdown */ - "cloudabi32_sys_thread_create", /* 47 = cloudabi32_sys_thread_create */ - "cloudabi_sys_thread_exit", /* 48 = cloudabi_sys_thread_exit */ - "cloudabi_sys_thread_yield", /* 49 = cloudabi_sys_thread_yield */ + "cloudabi_sys_proc_exec", /* 38 = cloudabi_sys_proc_exec */ + "cloudabi_sys_proc_exit", /* 39 = cloudabi_sys_proc_exit */ + "cloudabi_sys_proc_fork", /* 40 = cloudabi_sys_proc_fork */ + "cloudabi_sys_proc_raise", /* 41 = cloudabi_sys_proc_raise */ + "cloudabi_sys_random_get", /* 42 = cloudabi_sys_random_get */ + "cloudabi32_sys_sock_recv", /* 43 = cloudabi32_sys_sock_recv */ + "cloudabi32_sys_sock_send", /* 44 = cloudabi32_sys_sock_send */ + "cloudabi_sys_sock_shutdown", /* 45 = cloudabi_sys_sock_shutdown */ + "cloudabi32_sys_thread_create", /* 46 = cloudabi32_sys_thread_create */ + "cloudabi_sys_thread_exit", /* 47 = cloudabi_sys_thread_exit */ + "cloudabi_sys_thread_yield", /* 48 = cloudabi_sys_thread_yield */ }; Modified: head/sys/compat/cloudabi32/cloudabi32_sysent.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_sysent.c Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi32/cloudabi32_sysent.c Wed Oct 18 19:22:53 2017 (r324727) @@ -52,16 +52,15 @@ struct sysent cloudabi32_sysent[] = { { AS(cloudabi_sys_mem_sync_args), (sy_call_t *)cloudabi_sys_mem_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = cloudabi_sys_mem_sync */ { AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = cloudabi_sys_mem_unmap */ { AS(cloudabi32_sys_poll_args), (sy_call_t *)cloudabi32_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi32_sys_poll */ - { AS(cloudabi32_sys_poll_fd_args), (sy_call_t *)cloudabi32_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi32_sys_poll_fd */ - { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi_sys_proc_exec */ - { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi_sys_proc_exit */ - { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_fork */ - { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_raise */ - { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_random_get */ - { AS(cloudabi32_sys_sock_recv_args), (sy_call_t *)cloudabi32_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi32_sys_sock_recv */ - { AS(cloudabi32_sys_sock_send_args), (sy_call_t *)cloudabi32_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi32_sys_sock_send */ - { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_shutdown */ - { AS(cloudabi32_sys_thread_create_args), (sy_call_t *)cloudabi32_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi32_sys_thread_create */ - { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_thread_exit */ - { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi_sys_thread_yield */ + { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi_sys_proc_exec */ + { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi_sys_proc_exit */ + { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi_sys_proc_fork */ + { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_raise */ + { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_random_get */ + { AS(cloudabi32_sys_sock_recv_args), (sy_call_t *)cloudabi32_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi32_sys_sock_recv */ + { AS(cloudabi32_sys_sock_send_args), (sy_call_t *)cloudabi32_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi32_sys_sock_send */ + { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_sock_shutdown */ + { AS(cloudabi32_sys_thread_create_args), (sy_call_t *)cloudabi32_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi32_sys_thread_create */ + { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_thread_exit */ + { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_thread_yield */ }; Modified: head/sys/compat/cloudabi32/cloudabi32_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Wed Oct 18 19:22:53 2017 (r324727) @@ -357,20 +357,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* cloudabi32_sys_poll_fd */ - case 38: { - struct cloudabi32_sys_poll_fd_args *p = params; - iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->in; /* const cloudabi32_subscription_t * */ - uarg[2] = p->in_len; /* size_t */ - uarg[3] = (intptr_t) p->out; /* cloudabi32_event_t * */ - uarg[4] = p->out_len; /* size_t */ - uarg[5] = (intptr_t) p->timeout; /* const cloudabi32_subscription_t * */ - *n_args = 6; - break; - } /* cloudabi_sys_proc_exec */ - case 39: { + case 38: { struct cloudabi_sys_proc_exec_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->data; /* const void * */ @@ -381,26 +369,26 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_proc_exit */ - case 40: { + case 39: { struct cloudabi_sys_proc_exit_args *p = params; iarg[0] = p->rval; /* cloudabi_exitcode_t */ *n_args = 1; break; } /* cloudabi_sys_proc_fork */ - case 41: { + case 40: { *n_args = 0; break; } /* cloudabi_sys_proc_raise */ - case 42: { + case 41: { struct cloudabi_sys_proc_raise_args *p = params; iarg[0] = p->sig; /* cloudabi_signal_t */ *n_args = 1; break; } /* cloudabi_sys_random_get */ - case 43: { + case 42: { struct cloudabi_sys_random_get_args *p = params; uarg[0] = (intptr_t) p->buf; /* void * */ uarg[1] = p->buf_len; /* size_t */ @@ -408,7 +396,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi32_sys_sock_recv */ - case 44: { + case 43: { struct cloudabi32_sys_sock_recv_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi32_recv_in_t * */ @@ -417,7 +405,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi32_sys_sock_send */ - case 45: { + case 44: { struct cloudabi32_sys_sock_send_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi32_send_in_t * */ @@ -426,7 +414,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_sock_shutdown */ - case 46: { + case 45: { struct cloudabi_sys_sock_shutdown_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->how; /* cloudabi_sdflags_t */ @@ -434,14 +422,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi32_sys_thread_create */ - case 47: { + case 46: { struct cloudabi32_sys_thread_create_args *p = params; uarg[0] = (intptr_t) p->attr; /* cloudabi32_threadattr_t * */ *n_args = 1; break; } /* cloudabi_sys_thread_exit */ - case 48: { + case 47: { struct cloudabi_sys_thread_exit_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ @@ -449,7 +437,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_thread_yield */ - case 49: { + case 48: { *n_args = 0; break; } @@ -1083,38 +1071,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* cloudabi32_sys_poll_fd */ + /* cloudabi_sys_proc_exec */ case 38: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: - p = "userland const cloudabi32_subscription_t *"; - break; - case 2: - p = "size_t"; - break; - case 3: - p = "userland cloudabi32_event_t *"; - break; - case 4: - p = "size_t"; - break; - case 5: - p = "userland const cloudabi32_subscription_t *"; - break; - default: - break; - }; - break; - /* cloudabi_sys_proc_exec */ - case 39: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: p = "userland const void *"; break; case 2: @@ -1131,7 +1094,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_proc_exit */ - case 40: + case 39: switch(ndx) { case 0: p = "cloudabi_exitcode_t"; @@ -1141,10 +1104,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_proc_fork */ - case 41: + case 40: break; /* cloudabi_sys_proc_raise */ - case 42: + case 41: switch(ndx) { case 0: p = "cloudabi_signal_t"; @@ -1154,7 +1117,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_random_get */ - case 43: + case 42: switch(ndx) { case 0: p = "userland void *"; @@ -1167,7 +1130,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi32_sys_sock_recv */ - case 44: + case 43: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1183,7 +1146,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi32_sys_sock_send */ - case 45: + case 44: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1199,7 +1162,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_sock_shutdown */ - case 46: + case 45: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1212,7 +1175,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi32_sys_thread_create */ - case 47: + case 46: switch(ndx) { case 0: p = "userland cloudabi32_threadattr_t *"; @@ -1222,7 +1185,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_thread_exit */ - case 48: + case 47: switch(ndx) { case 0: p = "userland cloudabi_lock_t *"; @@ -1235,7 +1198,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_thread_yield */ - case 49: + case 48: break; default: break; @@ -1438,60 +1401,55 @@ systrace_return_setargdesc(int sysnum, int ndx, char * if (ndx == 0 || ndx == 1) p = "size_t"; break; - /* cloudabi32_sys_poll_fd */ + /* cloudabi_sys_proc_exec */ case 38: if (ndx == 0 || ndx == 1) - p = "size_t"; - break; - /* cloudabi_sys_proc_exec */ - case 39: - if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_proc_exit */ - case 40: + case 39: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_proc_fork */ - case 41: + case 40: /* cloudabi_sys_proc_raise */ - case 42: + case 41: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_random_get */ - case 43: + case 42: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi32_sys_sock_recv */ - case 44: + case 43: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi32_sys_sock_send */ - case 45: + case 44: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_shutdown */ - case 46: + case 45: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi32_sys_thread_create */ - case 47: + case 46: if (ndx == 0 || ndx == 1) p = "cloudabi_tid_t"; break; /* cloudabi_sys_thread_exit */ - case 48: + case 47: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_thread_yield */ - case 49: + case 48: default: break; }; Modified: head/sys/compat/cloudabi64/cloudabi64_poll.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_poll.c Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi64/cloudabi64_poll.c Wed Oct 18 19:22:53 2017 (r324727) @@ -79,7 +79,6 @@ convert_signal(int sig) struct cloudabi64_kevent_args { const cloudabi64_subscription_t *in; cloudabi64_event_t *out; - bool once; }; /* Converts CloudABI's subscription objects to FreeBSD's struct kevent. */ @@ -124,9 +123,7 @@ cloudabi64_kevent_copyin(void *arg, struct kevent *kev case CLOUDABI_EVENTTYPE_FD_READ: kevp->filter = EVFILT_READ; kevp->ident = sub.fd_readwrite.fd; - if ((sub.fd_readwrite.flags & - CLOUDABI_SUBSCRIPTION_FD_READWRITE_POLL) != 0) - kevp->fflags = NOTE_FILE_POLL; + kevp->fflags = NOTE_FILE_POLL; break; case CLOUDABI_EVENTTYPE_FD_WRITE: kevp->filter = EVFILT_WRITE; @@ -138,24 +135,7 @@ cloudabi64_kevent_copyin(void *arg, struct kevent *kev kevp->fflags = NOTE_EXIT; break; } - if (args->once) { - /* Ignore flags. Simply use oneshot mode. */ - kevp->flags = EV_ADD | EV_ONESHOT; - } else { - /* Translate flags. */ - if ((sub.flags & CLOUDABI_SUBSCRIPTION_ADD) != 0) - kevp->flags |= EV_ADD; - if ((sub.flags & CLOUDABI_SUBSCRIPTION_CLEAR) != 0) - kevp->flags |= EV_CLEAR; - if ((sub.flags & CLOUDABI_SUBSCRIPTION_DELETE) != 0) - kevp->flags |= EV_DELETE; - if ((sub.flags & CLOUDABI_SUBSCRIPTION_DISABLE) != 0) - kevp->flags |= EV_DISABLE; - if ((sub.flags & CLOUDABI_SUBSCRIPTION_ENABLE) != 0) - kevp->flags |= EV_ENABLE; - if ((sub.flags & CLOUDABI_SUBSCRIPTION_ONESHOT) != 0) - kevp->flags |= EV_ONESHOT; - } + kevp->flags = EV_ADD | EV_ONESHOT; ++kevp; } return (0); @@ -238,7 +218,6 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi struct cloudabi64_kevent_args args = { .in = uap->in, .out = uap->out, - .once = true, }; struct kevent_copyops copyops = { .k_copyin = cloudabi64_kevent_copyin, @@ -368,41 +347,4 @@ cloudabi64_sys_poll(struct thread *td, struct cloudabi } return (kern_kevent_anonymous(td, uap->nsubscriptions, ©ops)); -} - -int -cloudabi64_sys_poll_fd(struct thread *td, - struct cloudabi64_sys_poll_fd_args *uap) -{ - struct cloudabi64_kevent_args args = { - .in = uap->in, - .out = uap->out, - .once = false, - }; - struct kevent_copyops copyops = { - .k_copyin = cloudabi64_kevent_copyin, - .k_copyout = cloudabi64_kevent_copyout, - .arg = &args, - }; - cloudabi64_subscription_t subtimo; - struct timespec timeout; - int error; - - if (uap->timeout != NULL) { - /* Poll with a timeout. */ - error = copyin(uap->timeout, &subtimo, sizeof(subtimo)); - if (error != 0) - return (error); - if (subtimo.type != CLOUDABI_EVENTTYPE_CLOCK || - subtimo.clock.flags != 0) - return (EINVAL); - timeout.tv_sec = subtimo.clock.timeout / 1000000000; - timeout.tv_nsec = subtimo.clock.timeout % 1000000000; - return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len, - ©ops, &timeout)); - } else { - /* Poll without a timeout. */ - return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len, - ©ops, NULL)); - } } Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Wed Oct 18 19:22:53 2017 (r324727) @@ -227,14 +227,6 @@ struct cloudabi64_sys_poll_args { char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; char nsubscriptions_l_[PADL_(size_t)]; size_t nsubscriptions; char nsubscriptions_r_[PADR_(size_t)]; }; -struct cloudabi64_sys_poll_fd_args { - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; - char in_len_l_[PADL_(size_t)]; size_t in_len; char in_len_r_[PADR_(size_t)]; - char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; - char out_len_l_[PADL_(size_t)]; size_t out_len; char out_len_r_[PADR_(size_t)]; - char timeout_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi64_subscription_t *)]; -}; struct cloudabi_sys_proc_exec_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)]; @@ -317,7 +309,6 @@ int cloudabi_sys_mem_protect(struct thread *, struct c int cloudabi_sys_mem_sync(struct thread *, struct cloudabi_sys_mem_sync_args *); int cloudabi_sys_mem_unmap(struct thread *, struct cloudabi_sys_mem_unmap_args *); int cloudabi64_sys_poll(struct thread *, struct cloudabi64_sys_poll_args *); -int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *); int cloudabi_sys_proc_exec(struct thread *, struct cloudabi_sys_proc_exec_args *); int cloudabi_sys_proc_exit(struct thread *, struct cloudabi_sys_proc_exit_args *); int cloudabi_sys_proc_fork(struct thread *, struct cloudabi_sys_proc_fork_args *); @@ -403,7 +394,6 @@ int cloudabi_sys_thread_yield(struct thread *, struct #define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_sync AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_unmap AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll AUE_NULL -#define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll_fd AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_exec AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_exit AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_fork AUE_NULL Modified: head/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Wed Oct 18 19:22:53 2017 (r324727) @@ -43,16 +43,15 @@ #define CLOUDABI64_SYS_cloudabi_sys_mem_sync 35 #define CLOUDABI64_SYS_cloudabi_sys_mem_unmap 36 #define CLOUDABI64_SYS_cloudabi64_sys_poll 37 -#define CLOUDABI64_SYS_cloudabi64_sys_poll_fd 38 -#define CLOUDABI64_SYS_cloudabi_sys_proc_exec 39 -#define CLOUDABI64_SYS_cloudabi_sys_proc_exit 40 -#define CLOUDABI64_SYS_cloudabi_sys_proc_fork 41 -#define CLOUDABI64_SYS_cloudabi_sys_proc_raise 42 -#define CLOUDABI64_SYS_cloudabi_sys_random_get 43 -#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 44 -#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 45 -#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 46 -#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 47 -#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 48 -#define CLOUDABI64_SYS_cloudabi_sys_thread_yield 49 -#define CLOUDABI64_SYS_MAXSYSCALL 50 +#define CLOUDABI64_SYS_cloudabi_sys_proc_exec 38 +#define CLOUDABI64_SYS_cloudabi_sys_proc_exit 39 +#define CLOUDABI64_SYS_cloudabi_sys_proc_fork 40 +#define CLOUDABI64_SYS_cloudabi_sys_proc_raise 41 +#define CLOUDABI64_SYS_cloudabi_sys_random_get 42 +#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 43 +#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 44 +#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 45 +#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 46 +#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 47 +#define CLOUDABI64_SYS_cloudabi_sys_thread_yield 48 +#define CLOUDABI64_SYS_MAXSYSCALL 49 Modified: head/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Wed Oct 18 19:22:53 2017 (r324727) @@ -44,16 +44,15 @@ const char *cloudabi64_syscallnames[] = { "cloudabi_sys_mem_sync", /* 35 = cloudabi_sys_mem_sync */ "cloudabi_sys_mem_unmap", /* 36 = cloudabi_sys_mem_unmap */ "cloudabi64_sys_poll", /* 37 = cloudabi64_sys_poll */ - "cloudabi64_sys_poll_fd", /* 38 = cloudabi64_sys_poll_fd */ - "cloudabi_sys_proc_exec", /* 39 = cloudabi_sys_proc_exec */ - "cloudabi_sys_proc_exit", /* 40 = cloudabi_sys_proc_exit */ - "cloudabi_sys_proc_fork", /* 41 = cloudabi_sys_proc_fork */ - "cloudabi_sys_proc_raise", /* 42 = cloudabi_sys_proc_raise */ - "cloudabi_sys_random_get", /* 43 = cloudabi_sys_random_get */ - "cloudabi64_sys_sock_recv", /* 44 = cloudabi64_sys_sock_recv */ - "cloudabi64_sys_sock_send", /* 45 = cloudabi64_sys_sock_send */ - "cloudabi_sys_sock_shutdown", /* 46 = cloudabi_sys_sock_shutdown */ - "cloudabi64_sys_thread_create", /* 47 = cloudabi64_sys_thread_create */ - "cloudabi_sys_thread_exit", /* 48 = cloudabi_sys_thread_exit */ - "cloudabi_sys_thread_yield", /* 49 = cloudabi_sys_thread_yield */ + "cloudabi_sys_proc_exec", /* 38 = cloudabi_sys_proc_exec */ + "cloudabi_sys_proc_exit", /* 39 = cloudabi_sys_proc_exit */ + "cloudabi_sys_proc_fork", /* 40 = cloudabi_sys_proc_fork */ + "cloudabi_sys_proc_raise", /* 41 = cloudabi_sys_proc_raise */ + "cloudabi_sys_random_get", /* 42 = cloudabi_sys_random_get */ + "cloudabi64_sys_sock_recv", /* 43 = cloudabi64_sys_sock_recv */ + "cloudabi64_sys_sock_send", /* 44 = cloudabi64_sys_sock_send */ + "cloudabi_sys_sock_shutdown", /* 45 = cloudabi_sys_sock_shutdown */ + "cloudabi64_sys_thread_create", /* 46 = cloudabi64_sys_thread_create */ + "cloudabi_sys_thread_exit", /* 47 = cloudabi_sys_thread_exit */ + "cloudabi_sys_thread_yield", /* 48 = cloudabi_sys_thread_yield */ }; Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Wed Oct 18 19:22:53 2017 (r324727) @@ -52,16 +52,15 @@ struct sysent cloudabi64_sysent[] = { { AS(cloudabi_sys_mem_sync_args), (sy_call_t *)cloudabi_sys_mem_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = cloudabi_sys_mem_sync */ { AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = cloudabi_sys_mem_unmap */ { AS(cloudabi64_sys_poll_args), (sy_call_t *)cloudabi64_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi64_sys_poll */ - { AS(cloudabi64_sys_poll_fd_args), (sy_call_t *)cloudabi64_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi64_sys_poll_fd */ - { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi_sys_proc_exec */ - { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi_sys_proc_exit */ - { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_fork */ - { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_raise */ - { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_random_get */ - { AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi64_sys_sock_recv */ - { AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi64_sys_sock_send */ - { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_shutdown */ - { AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi64_sys_thread_create */ - { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_thread_exit */ - { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi_sys_thread_yield */ + { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi_sys_proc_exec */ + { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi_sys_proc_exit */ + { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi_sys_proc_fork */ + { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_raise */ + { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_random_get */ + { AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi64_sys_sock_recv */ + { AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi64_sys_sock_send */ + { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_sock_shutdown */ + { AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi64_sys_thread_create */ + { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_thread_exit */ + { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_thread_yield */ }; Modified: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Wed Oct 18 18:59:35 2017 (r324726) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Wed Oct 18 19:22:53 2017 (r324727) @@ -357,20 +357,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } - /* cloudabi64_sys_poll_fd */ - case 38: { - struct cloudabi64_sys_poll_fd_args *p = params; - iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ - uarg[2] = p->in_len; /* size_t */ - uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */ - uarg[4] = p->out_len; /* size_t */ - uarg[5] = (intptr_t) p->timeout; /* const cloudabi64_subscription_t * */ - *n_args = 6; - break; - } /* cloudabi_sys_proc_exec */ - case 39: { + case 38: { struct cloudabi_sys_proc_exec_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->data; /* const void * */ @@ -381,26 +369,26 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_proc_exit */ - case 40: { + case 39: { struct cloudabi_sys_proc_exit_args *p = params; iarg[0] = p->rval; /* cloudabi_exitcode_t */ *n_args = 1; break; } /* cloudabi_sys_proc_fork */ - case 41: { + case 40: { *n_args = 0; break; } /* cloudabi_sys_proc_raise */ - case 42: { + case 41: { struct cloudabi_sys_proc_raise_args *p = params; iarg[0] = p->sig; /* cloudabi_signal_t */ *n_args = 1; break; } /* cloudabi_sys_random_get */ - case 43: { + case 42: { struct cloudabi_sys_random_get_args *p = params; uarg[0] = (intptr_t) p->buf; /* void * */ uarg[1] = p->buf_len; /* size_t */ @@ -408,7 +396,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi64_sys_sock_recv */ - case 44: { + case 43: { struct cloudabi64_sys_sock_recv_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_recv_in_t * */ @@ -417,7 +405,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi64_sys_sock_send */ - case 45: { + case 44: { struct cloudabi64_sys_sock_send_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_send_in_t * */ @@ -426,7 +414,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_sock_shutdown */ - case 46: { + case 45: { struct cloudabi_sys_sock_shutdown_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->how; /* cloudabi_sdflags_t */ @@ -434,14 +422,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi64_sys_thread_create */ - case 47: { + case 46: { struct cloudabi64_sys_thread_create_args *p = params; uarg[0] = (intptr_t) p->attr; /* cloudabi64_threadattr_t * */ *n_args = 1; break; } /* cloudabi_sys_thread_exit */ - case 48: { + case 47: { struct cloudabi_sys_thread_exit_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ @@ -449,7 +437,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg break; } /* cloudabi_sys_thread_yield */ - case 49: { + case 48: { *n_args = 0; break; } @@ -1083,38 +1071,13 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; - /* cloudabi64_sys_poll_fd */ + /* cloudabi_sys_proc_exec */ case 38: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: - p = "userland const cloudabi64_subscription_t *"; - break; - case 2: - p = "size_t"; - break; - case 3: - p = "userland cloudabi64_event_t *"; - break; - case 4: - p = "size_t"; - break; - case 5: - p = "userland const cloudabi64_subscription_t *"; - break; - default: - break; - }; - break; - /* cloudabi_sys_proc_exec */ - case 39: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: p = "userland const void *"; break; case 2: @@ -1131,7 +1094,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_proc_exit */ - case 40: + case 39: switch(ndx) { case 0: p = "cloudabi_exitcode_t"; @@ -1141,10 +1104,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_proc_fork */ - case 41: + case 40: break; /* cloudabi_sys_proc_raise */ - case 42: + case 41: switch(ndx) { case 0: p = "cloudabi_signal_t"; @@ -1154,7 +1117,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_random_get */ - case 43: + case 42: switch(ndx) { case 0: p = "userland void *"; @@ -1167,7 +1130,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi64_sys_sock_recv */ - case 44: + case 43: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1183,7 +1146,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi64_sys_sock_send */ - case 45: + case 44: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1199,7 +1162,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi_sys_sock_shutdown */ - case 46: + case 45: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1212,7 +1175,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d }; break; /* cloudabi64_sys_thread_create */ - case 47: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Oct 18 19:28:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2BFCE422BA; Wed, 18 Oct 2017 19:28:29 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB10666EC4; Wed, 18 Oct 2017 19:28:29 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IJSSrc005315; Wed, 18 Oct 2017 19:28:28 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IJSSfp005311; Wed, 18 Oct 2017 19:28:28 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201710181928.v9IJSSfp005311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Wed, 18 Oct 2017 19:28:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324728 - in head/sys/dev: qlnx/qlnxe qlxgb qlxgbe qlxge X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head/sys/dev: qlnx/qlnxe qlxgb qlxgbe qlxge X-SVN-Commit-Revision: 324728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 19:28:29 -0000 Author: rlibby Date: Wed Oct 18 19:28:28 2017 New Revision: 324728 URL: https://svnweb.freebsd.org/changeset/base/324728 Log: ql*_def.h: fix QL_ALIGN parenthesization QL_ALIGN is a set of copies of roundup2, but it was missing an outer set of parentheses, which began to matter with r324538. Now, fully copy the parenthesization of roundup2. Reviewed by: davidcs Differential Revision: https://reviews.freebsd.org/D12673 Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h head/sys/dev/qlxgb/qla_def.h head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxge/qls_def.h Modified: head/sys/dev/qlnx/qlnxe/qlnx_def.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_def.h Wed Oct 18 19:22:53 2017 (r324727) +++ head/sys/dev/qlnx/qlnxe/qlnx_def.h Wed Oct 18 19:28:28 2017 (r324728) @@ -486,7 +486,7 @@ struct qlnx_host { typedef struct qlnx_host qlnx_host_t; /* note that align has to be a power of 2 */ -#define QL_ALIGN(size, align) (size + (align - 1)) & ~(align - 1); +#define QL_ALIGN(size, align) (((size) + ((align) - 1)) & (~((align) - 1))) #define QL_MIN(x, y) ((x < y) ? x : y) #define QL_RUNNING(ifp) \ Modified: head/sys/dev/qlxgb/qla_def.h ============================================================================== --- head/sys/dev/qlxgb/qla_def.h Wed Oct 18 19:22:53 2017 (r324727) +++ head/sys/dev/qlxgb/qla_def.h Wed Oct 18 19:28:28 2017 (r324728) @@ -200,7 +200,7 @@ struct qla_host { typedef struct qla_host qla_host_t; /* note that align has to be a power of 2 */ -#define QL_ALIGN(size, align) (size + (align - 1)) & ~(align - 1); +#define QL_ALIGN(size, align) (((size) + ((align) - 1)) & (~((align) - 1))) #define QL_MIN(x, y) ((x < y) ? x : y) #define QL_RUNNING(ifp) \ Modified: head/sys/dev/qlxgbe/ql_def.h ============================================================================== --- head/sys/dev/qlxgbe/ql_def.h Wed Oct 18 19:22:53 2017 (r324727) +++ head/sys/dev/qlxgbe/ql_def.h Wed Oct 18 19:28:28 2017 (r324728) @@ -263,7 +263,7 @@ struct qla_host { typedef struct qla_host qla_host_t; /* note that align has to be a power of 2 */ -#define QL_ALIGN(size, align) (size + (align - 1)) & ~(align - 1); +#define QL_ALIGN(size, align) (((size) + ((align) - 1)) & (~((align) - 1))) #define QL_MIN(x, y) ((x < y) ? x : y) #define QL_RUNNING(ifp) (ifp->if_drv_flags & IFF_DRV_RUNNING) Modified: head/sys/dev/qlxge/qls_def.h ============================================================================== --- head/sys/dev/qlxge/qls_def.h Wed Oct 18 19:22:53 2017 (r324727) +++ head/sys/dev/qlxge/qls_def.h Wed Oct 18 19:28:28 2017 (r324728) @@ -361,7 +361,7 @@ struct qla_host { typedef struct qla_host qla_host_t; /* note that align has to be a power of 2 */ -#define QL_ALIGN(size, align) (size + (align - 1)) & ~(align - 1); +#define QL_ALIGN(size, align) (((size) + ((align) - 1)) & (~((align) - 1))) #define QL_MIN(x, y) ((x < y) ? x : y) #define QL_RUNNING(ifp) \ From owner-svn-src-head@freebsd.org Wed Oct 18 20:17:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFDE9E43030; Wed, 18 Oct 2017 20:17:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97BA668757; Wed, 18 Oct 2017 20:17:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IKHjXE026044; Wed, 18 Oct 2017 20:17:45 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IKHjKh026043; Wed, 18 Oct 2017 20:17:45 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201710182017.v9IKHjKh026043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 18 Oct 2017 20:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324729 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 20:17:47 -0000 Author: tuexen Date: Wed Oct 18 20:17:44 2017 New Revision: 324729 URL: https://svnweb.freebsd.org/changeset/base/324729 Log: Abort an SCTP association, when a DATA chunk is followed by an unknown chunk with a length smaller than the minimum length. Thanks to Felix Weinrank for making me aware of the problem. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Oct 18 19:28:28 2017 (r324728) +++ head/sys/netinet/sctp_indata.c Wed Oct 18 20:17:44 2017 (r324729) @@ -2696,7 +2696,8 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o } /* get pointer to the first chunk header */ ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, - sizeof(struct sctp_chunkhdr), (uint8_t *)&chunk_buf); + sizeof(struct sctp_chunkhdr), + (uint8_t *)&chunk_buf); if (ch == NULL) { return (1); } @@ -2753,7 +2754,8 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "DATA chunk of length %d", + snprintf(msg, sizeof(msg), "%s chunk of length %d", + ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; @@ -2830,7 +2832,25 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o return (2); } default: - /* unknown chunk type, use bit rules */ + /* + * Unknown chunk type: use bit rules after + * checking length + */ + if (chk_length < sizeof(struct sctp_chunkhdr)) { + /* + * Need to send an abort since we + * had a invalid chunk. + */ + struct mbuf *op_err; + char msg[SCTP_DIAG_INFO_LEN]; + + snprintf(msg, sizeof(msg), "Chunk of length %d", + chk_length); + op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); + stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; + sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); + return (2); + } if (ch->chunk_type & 0x40) { /* Add a error report to the queue */ struct mbuf *op_err; @@ -2866,7 +2886,8 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o continue; } ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset, - sizeof(struct sctp_chunkhdr), (uint8_t *)&chunk_buf); + sizeof(struct sctp_chunkhdr), + (uint8_t *)&chunk_buf); if (ch == NULL) { *offset = length; stop_proc = 1; From owner-svn-src-head@freebsd.org Wed Oct 18 21:08:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 033A0E43F6D; Wed, 18 Oct 2017 21:08:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C30A06A319; Wed, 18 Oct 2017 21:08:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IL8Zra046839; Wed, 18 Oct 2017 21:08:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IL8Zkx046838; Wed, 18 Oct 2017 21:08:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201710182108.v9IL8Zkx046838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 18 Oct 2017 21:08:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324730 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 21:08:37 -0000 Author: tuexen Date: Wed Oct 18 21:08:35 2017 New Revision: 324730 URL: https://svnweb.freebsd.org/changeset/base/324730 Log: Fix a signed/unsigned warning. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Oct 18 20:17:44 2017 (r324729) +++ head/sys/netinet/sctp_indata.c Wed Oct 18 21:08:35 2017 (r324730) @@ -2641,10 +2641,11 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct sctp_association *asoc; int num_chunks = 0; /* number of control chunks processed */ int stop_proc = 0; - int chk_length, break_flag, last_chunk; + int break_flag, last_chunk; int abort_flag = 0, was_a_gap; struct mbuf *m; uint32_t highest_tsn; + uint16_t chk_length; /* set the rwnd */ sctp_set_rwnd(stcb, &stcb->asoc); @@ -2739,7 +2740,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o } if ((ch->chunk_type == SCTP_DATA) || (ch->chunk_type == SCTP_IDATA)) { - int clen; + uint16_t clen; if (ch->chunk_type == SCTP_DATA) { clen = sizeof(struct sctp_data_chunk); @@ -2754,7 +2755,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "%s chunk of length %d", + snprintf(msg, sizeof(msg), "%s chunk of length %u", ch->chunk_type == SCTP_DATA ? "DATA" : "I-DATA", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); @@ -2844,7 +2845,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *o struct mbuf *op_err; char msg[SCTP_DIAG_INFO_LEN]; - snprintf(msg, sizeof(msg), "Chunk of length %d", + snprintf(msg, sizeof(msg), "Chunk of length %u", chk_length); op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_20; From owner-svn-src-head@freebsd.org Wed Oct 18 22:00:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04ECFE45141; Wed, 18 Oct 2017 22:00:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C725B6BBB8; Wed, 18 Oct 2017 22:00:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IM0ime067488; Wed, 18 Oct 2017 22:00:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IM0ihc067486; Wed, 18 Oct 2017 22:00:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710182200.v9IM0ihc067486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 18 Oct 2017 22:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324731 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 22:00:46 -0000 Author: mjg Date: Wed Oct 18 22:00:44 2017 New Revision: 324731 URL: https://svnweb.freebsd.org/changeset/base/324731 Log: Don't take Giant for SMP status and cpu topology sysctls. Not only this lock doesn't play any role here, dirtying it slows down other things a little bit as giant-held checks (e.g. DROP_GIANT) are spread all over the kernel. MFC after: 1 week Modified: head/sys/kern/sched_ule.c head/sys/kern/subr_smp.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Oct 18 21:08:35 2017 (r324730) +++ head/sys/kern/sched_ule.c Wed Oct 18 22:00:44 2017 (r324731) @@ -2939,7 +2939,7 @@ SYSCTL_INT(_kern_sched, OID_AUTO, steal_idle, CTLFLAG_ SYSCTL_INT(_kern_sched, OID_AUTO, steal_thresh, CTLFLAG_RW, &steal_thresh, 0, "Minimum load on remote CPU before we'll steal"); SYSCTL_PROC(_kern_sched, OID_AUTO, topology_spec, CTLTYPE_STRING | - CTLFLAG_RD, NULL, 0, sysctl_kern_sched_topology_spec, "A", + CTLFLAG_MPSAFE | CTLFLAG_RD, NULL, 0, sysctl_kern_sched_topology_spec, "A", "XML dump of detected CPU topology"); #endif Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Wed Oct 18 21:08:35 2017 (r324730) +++ head/sys/kern/subr_smp.c Wed Oct 18 22:00:44 2017 (r324731) @@ -84,8 +84,9 @@ SYSCTL_INT(_kern_smp, OID_AUTO, maxid, CTLFLAG_RD|CTLF SYSCTL_INT(_kern_smp, OID_AUTO, maxcpus, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_maxcpus, 0, "Max number of CPUs that the system was compiled for."); -SYSCTL_PROC(_kern_smp, OID_AUTO, active, CTLFLAG_RD | CTLTYPE_INT, NULL, 0, - sysctl_kern_smp_active, "I", "Indicates system is running in SMP mode"); +SYSCTL_PROC(_kern_smp, OID_AUTO, active, CTLFLAG_RD|CTLTYPE_INT|CTLFLAG_MPSAFE, + NULL, 0, sysctl_kern_smp_active, "I", + "Indicates system is running in SMP mode"); int smp_disabled = 0; /* has smp been disabled? */ SYSCTL_INT(_kern_smp, OID_AUTO, disabled, CTLFLAG_RDTUN|CTLFLAG_CAPRD, From owner-svn-src-head@freebsd.org Wed Oct 18 22:56:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23B08E461F0; Wed, 18 Oct 2017 22:56:48 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E60C46D750; Wed, 18 Oct 2017 22:56:47 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9IMulUq092311; Wed, 18 Oct 2017 22:56:47 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9IMulLG092310; Wed, 18 Oct 2017 22:56:47 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201710182256.v9IMulLG092310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Wed, 18 Oct 2017 22:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324732 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: bjk X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 324732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 22:56:48 -0000 Author: bjk (doc committer) Date: Wed Oct 18 22:56:46 2017 New Revision: 324732 URL: https://svnweb.freebsd.org/changeset/base/324732 Log: Adopt jail.8 to our brave new bsdinstall world Submitted by: Steve Kargl MFC after: 3 days Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Wed Oct 18 22:00:44 2017 (r324731) +++ head/usr.sbin/jail/jail.8 Wed Oct 18 22:56:46 2017 (r324732) @@ -1006,7 +1006,7 @@ jail -c path=/data/jail/testjail mount.devfs \\ .Pp Assuming no errors, you will end up with a shell prompt within the jail. You can now run -.Pa /usr/sbin/sysinstall +.Pa /usr/sbin/bsdinstall and do the post-install configuration to set various configuration options, or perform these actions manually by editing .Pa /etc/rc.conf , From owner-svn-src-head@freebsd.org Thu Oct 19 00:31:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15B3BE47BA0; Thu, 19 Oct 2017 00:31:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDDFE6FFF0; Thu, 19 Oct 2017 00:31:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9J0V0J4030134; Thu, 19 Oct 2017 00:31:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9J0V06e030133; Thu, 19 Oct 2017 00:31:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710190031.v9J0V06e030133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 19 Oct 2017 00:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324733 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 00:31:02 -0000 Author: mjg Date: Thu Oct 19 00:31:00 2017 New Revision: 324733 URL: https://svnweb.freebsd.org/changeset/base/324733 Log: sysvsem: check if semu_list has anything on it before grabbing the lock This should get a process-specific support instead. MFC after: 1 week Modified: head/sys/kern/sysv_sem.c Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Wed Oct 18 22:56:46 2017 (r324732) +++ head/sys/kern/sysv_sem.c Thu Oct 19 00:31:00 2017 (r324733) @@ -1412,6 +1412,8 @@ semexit_myhook(void *arg, struct proc *p) * Go through the chain of undo vectors looking for one * associated with this process. */ + if (LIST_EMPTY(&semu_list)) + return; SEMUNDO_LOCK(); LIST_FOREACH(suptr, &semu_list, un_next) { if (suptr->un_proc == p) From owner-svn-src-head@freebsd.org Thu Oct 19 00:38:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8863FE47DC7; Thu, 19 Oct 2017 00:38:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 494E77039E; Thu, 19 Oct 2017 00:38:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9J0cEbj033511; Thu, 19 Oct 2017 00:38:14 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9J0cEQ1033510; Thu, 19 Oct 2017 00:38:14 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710190038.v9J0cEQ1033510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 19 Oct 2017 00:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324734 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 00:38:15 -0000 Author: mjg Date: Thu Oct 19 00:38:14 2017 New Revision: 324734 URL: https://svnweb.freebsd.org/changeset/base/324734 Log: Tidy up pmc support at execve. The proc-specific check is inherently racy, so the code can just unlock beforehand. MFC after: 1 week Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Oct 19 00:31:00 2017 (r324733) +++ head/sys/kern/kern_exec.c Thu Oct 19 00:38:14 2017 (r324734) @@ -849,28 +849,23 @@ interpret: p->p_args = newargs; newargs = NULL; + PROC_UNLOCK(p); + #ifdef HWPMC_HOOKS /* * Check if system-wide sampling is in effect or if the * current process is using PMCs. If so, do exec() time * processing. This processing needs to happen AFTER the * P_INEXEC flag is cleared. - * - * The proc lock needs to be released before taking the PMC - * SX. */ if (PMC_SYSTEM_SAMPLING_ACTIVE() || PMC_PROC_IS_USING_PMCS(p)) { - PROC_UNLOCK(p); VOP_UNLOCK(imgp->vp, 0); pe.pm_credentialschanged = credential_changing; pe.pm_entryaddr = imgp->entry_addr; PMC_CALL_HOOK_X(td, PMC_FN_PROCESS_EXEC, (void *) &pe); vn_lock(imgp->vp, LK_SHARED | LK_RETRY); - } else - PROC_UNLOCK(p); -#else /* !HWPMC_HOOKS */ - PROC_UNLOCK(p); + } #endif /* Set values passed into the program in registers. */ From owner-svn-src-head@freebsd.org Thu Oct 19 00:46:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDF95E4802A; Thu, 19 Oct 2017 00:46:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BF08707C2; Thu, 19 Oct 2017 00:46:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9J0kF4v037739; Thu, 19 Oct 2017 00:46:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9J0kFqd037738; Thu, 19 Oct 2017 00:46:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710190046.v9J0kFqd037738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 19 Oct 2017 00:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324735 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 00:46:16 -0000 Author: mjg Date: Thu Oct 19 00:46:15 2017 New Revision: 324735 URL: https://svnweb.freebsd.org/changeset/base/324735 Log: execve: avoid one proc lock/unlock trip unless PTRACE_EXEC is set MFC after: 1 week Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Thu Oct 19 00:38:14 2017 (r324734) +++ head/sys/kern/kern_exec.c Thu Oct 19 00:46:15 2017 (r324735) @@ -900,10 +900,12 @@ exec_fail_dealloc: free(imgp->freepath, M_TEMP); if (error == 0) { - PROC_LOCK(p); - if (p->p_ptevents & PTRACE_EXEC) - td->td_dbgflags |= TDB_EXEC; - PROC_UNLOCK(p); + if (p->p_ptevents & PTRACE_EXEC) { + PROC_LOCK(p); + if (p->p_ptevents & PTRACE_EXEC) + td->td_dbgflags |= TDB_EXEC; + PROC_UNLOCK(p); + } /* * Stop the process here if its stop event mask has From owner-svn-src-head@freebsd.org Thu Oct 19 01:38:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A87AE4932F; Thu, 19 Oct 2017 01:38:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A5D971F96; Thu, 19 Oct 2017 01:38:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9J1cVUh058374; Thu, 19 Oct 2017 01:38:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9J1cV4B058373; Thu, 19 Oct 2017 01:38:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710190138.v9J1cV4B058373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 19 Oct 2017 01:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324736 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 01:38:32 -0000 Author: mjg Date: Thu Oct 19 01:38:31 2017 New Revision: 324736 URL: https://svnweb.freebsd.org/changeset/base/324736 Log: sysctl: only take mem lock if oldlen is > 4 * PAGE_SIZE The previous limit of just one page is hit by ps. The entire mechanism should be reworked, if not whacked. It seems the intent is to reduce kernel dos-ability - some handlers wire the amount of memory passed here. Handlers should probably stop wiring in the first place or in the worst case indicate they are doing so so that the check is done only if necessary. It should also probably be a counter, not a lock. MFC after: 1 week Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Oct 19 00:46:15 2017 (r324735) +++ head/sys/kern/kern_sysctl.c Thu Oct 19 01:38:31 2017 (r324736) @@ -2109,12 +2109,11 @@ userland_sysctl(struct thread *td, int *name, u_int na if (KTRPOINT(curthread, KTR_SYSCTL)) ktrsysctl(name, namelen); #endif - - if (req.oldptr && req.oldlen > PAGE_SIZE) { + memlocked = 0; + if (req.oldptr && req.oldlen > 4 * PAGE_SIZE) { memlocked = 1; sx_xlock(&sysctlmemlock); - } else - memlocked = 0; + } CURVNET_SET(TD_TO_VNET(td)); for (;;) { From owner-svn-src-head@freebsd.org Thu Oct 19 02:14:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A67DE4AB48; Thu, 19 Oct 2017 02:14:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAE32733AB; Thu, 19 Oct 2017 02:14:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9J2Ee2Z074732; Thu, 19 Oct 2017 02:14:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9J2EeFB074731; Thu, 19 Oct 2017 02:14:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201710190214.v9J2EeFB074731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 19 Oct 2017 02:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324737 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 324737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 02:14:41 -0000 Author: jhibbits Date: Thu Oct 19 02:14:39 2017 New Revision: 324737 URL: https://svnweb.freebsd.org/changeset/base/324737 Log: Remove some unnecessary includes Modified: head/sys/powerpc/mpc85xx/fsl_diu.c Modified: head/sys/powerpc/mpc85xx/fsl_diu.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_diu.c Thu Oct 19 01:38:31 2017 (r324736) +++ head/sys/powerpc/mpc85xx/fsl_diu.c Thu Oct 19 02:14:39 2017 (r324737) @@ -35,13 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include #include #include -#include -#include #include #include @@ -58,8 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include - -#include "gpio_if.h" #include #include From owner-svn-src-head@freebsd.org Thu Oct 19 03:17:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21D3BE4D16B; Thu, 19 Oct 2017 03:17:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E932A75617; Thu, 19 Oct 2017 03:17:51 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9J3HpSJ000808; Thu, 19 Oct 2017 03:17:51 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9J3Ho8I000805; Thu, 19 Oct 2017 03:17:50 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201710190317.v9J3Ho8I000805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 19 Oct 2017 03:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324738 - in head/etc: defaults periodic/daily rc.d X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/etc: defaults periodic/daily rc.d X-SVN-Commit-Revision: 324738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 03:17:52 -0000 Author: cy Date: Thu Oct 19 03:17:50 2017 New Revision: 324738 URL: https://svnweb.freebsd.org/changeset/base/324738 Log: Anticongestion refinements for ntpd rc script. This reverts r324681 and checks if ntp leapfile needs fetching before entering into the anticongestion sleep. Unfortunately some ports still use their own sleeps so, this commit doesn't address the complete problem which is compounded by every port that uses its own anticongestion mechanism. Discussed with: asomers Modified: head/etc/defaults/periodic.conf head/etc/periodic/daily/480.leapfile-ntpd head/etc/rc.d/ntpd Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Thu Oct 19 02:14:39 2017 (r324737) +++ head/etc/defaults/periodic.conf Thu Oct 19 03:17:50 2017 (r324738) @@ -141,8 +141,6 @@ daily_status_mail_rejects_shorten="NO" # Shorten out # 480.leapfile-ntpd daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile -daily_ntpd_leapfile_background="NO" # Fetch NTP leapfile - # in the background # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status Modified: head/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- head/etc/periodic/daily/480.leapfile-ntpd Thu Oct 19 02:14:39 2017 (r324737) +++ head/etc/periodic/daily/480.leapfile-ntpd Thu Oct 19 03:17:50 2017 (r324738) @@ -13,15 +13,10 @@ fi case "$daily_ntpd_leapfile_enable" in [Yy][Ee][Ss]) - case "$daily_ntpd_leapfile_background" in - [Yy][Ee][Ss]) - (anticongestion && service ntpd onefetch) & - ;; - *) + if service ntpd oneneedfetch; then anticongestion service ntpd onefetch - ;; - esac + fi ;; esac Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Thu Oct 19 02:14:39 2017 (r324737) +++ head/etc/rc.d/ntpd Thu Oct 19 03:17:50 2017 (r324738) @@ -15,8 +15,9 @@ desc="Network Time Protocol daemon" rcvar="ntpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" -extra_commands="fetch" +extra_commands="fetch needfetch" fetch_cmd="ntpd_fetch_leapfile" +needfetch_cmd="ntpd_needfetch_leapfile" start_precmd="ntpd_precmd" load_rc_config $name @@ -90,7 +91,7 @@ ntpd_init_leapfile() { fi } -ntpd_fetch_leapfile() { +ntpd_needfetch_leapfile() { local ntp_tmp_leapfile rc verbose if checkyesno ntp_leapfile_fetch_verbose; then @@ -122,6 +123,21 @@ ntpd_fetch_leapfile() { ntp_leap_fetch_date=$((ntp_leap_expiry-ntp_leapfile_expiry_seconds)) if [ $(current_ntp_ts) -ge $ntp_leap_fetch_date ]; then $verbose Within ntp leapfile expiry limit, initiating fetch + # Return code 0: ntp leapfile fetch needed + return 0 + fi + # Return code 1: ntp leapfile fetch not needed + return 1 +} + +ntpd_fetch_leapfile() { + if checkyesno ntp_leapfile_fetch_verbose; then + verbose=echo + else + verbose=: + fi + + if ntpd_needfetch_leapfile ; then for url in $ntp_leapfile_sources ; do $verbose fetching $url fetch $ntp_leapfile_fetch_opts -o $ntp_tmp_leapfile $url && break From owner-svn-src-head@freebsd.org Thu Oct 19 03:19:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14598E4D2FA; Thu, 19 Oct 2017 03:19:55 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BC9CE75961; Thu, 19 Oct 2017 03:19:54 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 51N4ekNPqM9gt51N5ezIzC; Wed, 18 Oct 2017 21:19:47 -0600 X-Authority-Analysis: v=2.2 cv=a+JAzQaF c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=3bP25S6_4ftGUFe_PV4A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 3C78A2CA; Wed, 18 Oct 2017 20:19:46 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v9J3GFh4070105; Wed, 18 Oct 2017 20:16:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201710190316.v9J3GFh4070105@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324738 - in head/etc: defaults periodic/daily rc.d In-Reply-To: Message from Cy Schubert of "Thu, 19 Oct 2017 03:17:50 -0000." <201710190317.v9J3Ho8I000805@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 18 Oct 2017 20:16:14 -0700 X-CMAE-Envelope: MS4wfE5HVeJtr1VZu8Ob5GOmF6uh9/SiGtT4SoRIEieaumQHMPQciI9+T18g6RphDx67vMJ7tpwmkCgq+ukSNlzt7HjBFwHb6+zjVPFNSmRzdgmgmnHLC9Mj hx/XcQgrJSYb8cC4qA/tOdmop/Yzob5NW+5EwLdI3Yfj/Ao72u61rB2JuLBiIwOsb+Voy/OC4oMOzLiJX+LMtCaP3Eui6EWHdGf3nqB1agX2lI3TrUshYe11 GGPRDmKDJkXFp+TRmDipBs+WijorMDMPxwS5t8qfzUiYnKYHJmub7TZOR5XgYPgI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 03:19:55 -0000 In message <201710190317.v9J3Ho8I000805@repo.freebsd.org>, Cy Schubert writes: > Author: cy > Date: Thu Oct 19 03:17:50 2017 > New Revision: 324738 > URL: https://svnweb.freebsd.org/changeset/base/324738 > > Log: > Anticongestion refinements for ntpd rc script. This reverts r324681 > and checks if ntp leapfile needs fetching before entering into the > anticongestion sleep. > > Unfortunately some ports still use their own sleeps so, this commit > doesn't address the complete problem which is compounded by every > port that uses its own anticongestion mechanism. > > Discussed with: asomers MFC after: 1 week -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu Oct 19 03:38:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66501E4DF1B; Thu, 19 Oct 2017 03:38:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 341B1766E5; Thu, 19 Oct 2017 03:38:55 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9J3cs85009197; Thu, 19 Oct 2017 03:38:54 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9J3csZx009195; Thu, 19 Oct 2017 03:38:54 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201710190338.v9J3csZx009195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 19 Oct 2017 03:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324742 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 324742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 03:38:55 -0000 Author: jhibbits Date: Thu Oct 19 03:38:53 2017 New Revision: 324742 URL: https://svnweb.freebsd.org/changeset/base/324742 Log: Add some more devices to the MPC85XX-based configs These devices bring the configs closer to a desktop-like (GENERIC) kernel config. * The Freescale DIU support was added to the config in r306358. Without keyboard support video support is nearly pointless, so add ukbd and ums. * The AmigaOne X5000, and P1022 devboard, both use a variant of the ds1307 RTC * cpufreq scaling is currently supported by the p1022. More SoCs will be added eventually. Modified: head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/MPC85XXSPE Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Thu Oct 19 03:20:17 2017 (r324741) +++ head/sys/powerpc/conf/MPC85XX Thu Oct 19 03:38:53 2017 (r324742) @@ -67,9 +67,11 @@ options DDB_CTF # Kernel ELF linker loads CTF data device ata device bpf device cfi +device cpufreq device crypto device cryptodev device da +device ds1307 device ds1553 device em device alc @@ -102,6 +104,8 @@ device uart options USB_DEBUG # enable debug msgs #device uhci device ehci +device ukbd +device ums device umass device usb device vlan Modified: head/sys/powerpc/conf/MPC85XXSPE ============================================================================== --- head/sys/powerpc/conf/MPC85XXSPE Thu Oct 19 03:20:17 2017 (r324741) +++ head/sys/powerpc/conf/MPC85XXSPE Thu Oct 19 03:38:53 2017 (r324742) @@ -67,9 +67,11 @@ options DDB_CTF # Kernel ELF linker loads CTF data device ata device bpf device cfi +device cpufreq device crypto device cryptodev device da +device ds1307 device ds1553 device em device alc @@ -103,6 +105,8 @@ device uart options USB_DEBUG # enable debug msgs #device uhci device ehci +device ukbd +device ums device umass device usb device vlan From owner-svn-src-head@freebsd.org Thu Oct 19 04:12:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFCC7E50C51; Thu, 19 Oct 2017 04:12:10 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 C70A77CA0C; Thu, 19 Oct 2017 04:12:10 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id v9J4C3qA024779 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 18 Oct 2017 21:12:03 -0700 Subject: Re: svn commit: r324732 - head/usr.sbin/jail To: Benjamin Kaduk , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710182256.v9IMulLG092310@repo.freebsd.org> From: Nathan Whitehorn Message-ID: <0dde8df6-6c8b-ac2d-f109-12ca6b1df341@freebsd.org> Date: Wed, 18 Oct 2017 21:12:02 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201710182256.v9IMulLG092310@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVa2mH5lRS8dngJbU0EYpE8NA1X1OWGtis1gN1xjL7zOlEI9u/P/tNJo+F911X3AIccHg30AEgP+3deN21cjbQ1BC9i/uM65zf4= X-Sonic-ID: C;7qUtqYO05xGbeIlQ3iMJ6w== M;BjtxqYO05xGbeIlQ3iMJ6w== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 04:12:11 -0000 Is this even true? Don't you want to run bsdconfig? We split that functionality out from the installer when sysinstall was replaced. -Nathan On 10/18/17 15:56, Benjamin Kaduk wrote: > Author: bjk (doc committer) > Date: Wed Oct 18 22:56:46 2017 > New Revision: 324732 > URL: https://svnweb.freebsd.org/changeset/base/324732 > > Log: > Adopt jail.8 to our brave new bsdinstall world > > Submitted by: Steve Kargl > MFC after: 3 days > > Modified: > head/usr.sbin/jail/jail.8 > > Modified: head/usr.sbin/jail/jail.8 > ============================================================================== > --- head/usr.sbin/jail/jail.8 Wed Oct 18 22:00:44 2017 (r324731) > +++ head/usr.sbin/jail/jail.8 Wed Oct 18 22:56:46 2017 (r324732) > @@ -1006,7 +1006,7 @@ jail -c path=/data/jail/testjail mount.devfs \\ > .Pp > Assuming no errors, you will end up with a shell prompt within the jail. > You can now run > -.Pa /usr/sbin/sysinstall > +.Pa /usr/sbin/bsdinstall > and do the post-install configuration to set various configuration options, > or perform these actions manually by editing > .Pa /etc/rc.conf , > From owner-svn-src-head@freebsd.org Thu Oct 19 04:13:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3216FE50D7D; Thu, 19 Oct 2017 04:13:49 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F286C7CC16; Thu, 19 Oct 2017 04:13:48 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9J4Dmq1025805; Thu, 19 Oct 2017 04:13:48 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9J4DmCe025804; Thu, 19 Oct 2017 04:13:48 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710190413.v9J4DmCe025804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 19 Oct 2017 04:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324743 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 04:13:49 -0000 Author: alc Date: Thu Oct 19 04:13:47 2017 New Revision: 324743 URL: https://svnweb.freebsd.org/changeset/base/324743 Log: Batch atomic updates to the number of active, inactive, and laundry pages by vm_object_terminate_pages(). For example, for a "buildworld" workload, this batching reduces vm_object_terminate_pages()'s average execution time by 12%. (The total savings were about 11.7 billion processor cycles.) Reviewed by: kib MFC after: 1 week Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu Oct 19 03:38:53 2017 (r324742) +++ head/sys/vm/vm_object.c Thu Oct 19 04:13:47 2017 (r324743) @@ -715,6 +715,7 @@ vm_object_terminate_pages(vm_object_t object) vm_page_t p, p_next; struct mtx *mtx, *mtx1; struct vm_pagequeue *pq, *pq1; + int dequeued; VM_OBJECT_ASSERT_WLOCKED(object); @@ -739,6 +740,7 @@ vm_object_terminate_pages(vm_object_t object) if (mtx != NULL) mtx_unlock(mtx); if (pq != NULL) { + vm_pagequeue_cnt_add(pq, dequeued); vm_pagequeue_unlock(pq); pq = NULL; } @@ -756,19 +758,27 @@ vm_object_terminate_pages(vm_object_t object) "page %p is not queued", p)); pq1 = vm_page_pagequeue(p); if (pq != pq1) { - if (pq != NULL) + if (pq != NULL) { + vm_pagequeue_cnt_add(pq, dequeued); vm_pagequeue_unlock(pq); + } pq = pq1; vm_pagequeue_lock(pq); + dequeued = 0; } + p->queue = PQ_NONE; + TAILQ_REMOVE(&pq->pq_pl, p, plinks.q); + dequeued--; } if (vm_page_free_prep(p, true)) continue; unlist: TAILQ_REMOVE(&object->memq, p, listq); } - if (pq != NULL) + if (pq != NULL) { + vm_pagequeue_cnt_add(pq, dequeued); vm_pagequeue_unlock(pq); + } if (mtx != NULL) mtx_unlock(mtx); From owner-svn-src-head@freebsd.org Thu Oct 19 09:01:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34C9FE345BF; Thu, 19 Oct 2017 09:01:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1188F1E90; Thu, 19 Oct 2017 09:01:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9J91GWZ043393; Thu, 19 Oct 2017 09:01:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9J91GKt043392; Thu, 19 Oct 2017 09:01:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201710190901.v9J91GKt043392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 19 Oct 2017 09:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324752 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 09:01:17 -0000 Author: mav Date: Thu Oct 19 09:01:15 2017 New Revision: 324752 URL: https://svnweb.freebsd.org/changeset/base/324752 Log: Relax per-ifnet cif_vrs list double locking in carp(4). In all cases where cif_vrs list is modified, two locks are held: per-ifnet CIF_LOCK and global carp_sx. It means to read that list only one of them is enough to be held, so we can skip CIF_LOCK when we already have carp_sx. This fixes kernel panic, caused by attempts of copyout() to sleep while holding non-sleepable CIF_LOCK mutex. Discussed with: glebius MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Thu Oct 19 08:17:32 2017 (r324751) +++ head/sys/netinet/ip_carp.c Thu Oct 19 09:01:15 2017 (r324752) @@ -175,8 +175,8 @@ static int proto_reg[] = {-1, -1}; * Each softc has a lock sc_mtx. It is used to synchronise carp_input_c(), * callout-driven events and ioctl()s. * - * To traverse the list of softcs on an ifnet we use CIF_LOCK(), to - * traverse the global list we use the mutex carp_mtx. + * To traverse the list of softcs on an ifnet we use CIF_LOCK() or carp_sx. + * To traverse the global list we use the mutex carp_mtx. * * Known issues with locking: * @@ -286,7 +286,8 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_carp, OID_AUTO, stats, ++_i) #define IFNET_FOREACH_CARP(ifp, sc) \ - CIF_LOCK_ASSERT(ifp->if_carp); \ + KASSERT(mtx_owned(&ifp->if_carp->cif_mtx) || \ + sx_xlocked(&carp_sx), ("cif_vrs not locked")); \ TAILQ_FOREACH((sc), &(ifp)->if_carp->cif_vrs, sc_list) #define DEMOTE_ADVSKEW(sc) \ @@ -1562,6 +1563,8 @@ carp_alloc(struct ifnet *ifp) struct carp_softc *sc; struct carp_if *cif; + sx_assert(&carp_sx, SA_XLOCKED); + if ((cif = ifp->if_carp) == NULL) cif = carp_alloc_if(ifp); @@ -1751,11 +1754,9 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa } if (ifp->if_carp) { - CIF_LOCK(ifp->if_carp); IFNET_FOREACH_CARP(ifp, sc) if (sc->sc_vhid == carpr.carpr_vhid) break; - CIF_UNLOCK(ifp->if_carp); } if (sc == NULL) { sc = carp_alloc(ifp); @@ -1826,11 +1827,9 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa priveleged = (priv_check(td, PRIV_NETINET_CARP) == 0); if (carpr.carpr_vhid != 0) { - CIF_LOCK(ifp->if_carp); IFNET_FOREACH_CARP(ifp, sc) if (sc->sc_vhid == carpr.carpr_vhid) break; - CIF_UNLOCK(ifp->if_carp); if (sc == NULL) { error = ENOENT; break; @@ -1841,7 +1840,6 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa int i, count; count = 0; - CIF_LOCK(ifp->if_carp); IFNET_FOREACH_CARP(ifp, sc) count++; @@ -1863,7 +1861,6 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa } i++; } - CIF_UNLOCK(ifp->if_carp); } break; } @@ -1918,11 +1915,9 @@ carp_attach(struct ifaddr *ifa, int vhid) return (ENOPROTOOPT); } - CIF_LOCK(cif); IFNET_FOREACH_CARP(ifp, sc) if (sc->sc_vhid == vhid) break; - CIF_UNLOCK(cif); if (sc == NULL) { sx_xunlock(&carp_sx); return (ENOENT); From owner-svn-src-head@freebsd.org Thu Oct 19 12:55:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE4B4E3A93F; Thu, 19 Oct 2017 12:55:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A636683F4; Thu, 19 Oct 2017 12:55:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JCtBx6043108; Thu, 19 Oct 2017 12:55:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JCtBQ0043104; Thu, 19 Oct 2017 12:55:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710191255.v9JCtBQ0043104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 Oct 2017 12:55:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324753 - head/sys/fs/msdosfs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/fs/msdosfs X-SVN-Commit-Revision: 324753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 12:55:12 -0000 Author: emaste Date: Thu Oct 19 12:55:11 2017 New Revision: 324753 URL: https://svnweb.freebsd.org/changeset/base/324753 Log: msdosfs: fix build with MSDOSFS_DEBUG Inspired by a patch submission by longwitz@incore.de with many changes for ino64 in HEAD. PR: 199152 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/msdosfs/msdosfs_conv.c head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_conv.c Thu Oct 19 09:01:15 2017 (r324752) +++ head/sys/fs/msdosfs/msdosfs_conv.c Thu Oct 19 12:55:11 2017 (r324753) @@ -594,7 +594,7 @@ winChkName(struct mbnambuf *nbp, const u_char *un, siz return -1; #ifdef MSDOSFS_DEBUG - printf("winChkName(): un=%s:%d,d_name=%s:%d\n", un, unlen, + printf("winChkName(): un=%s:%zu,d_name=%s:%d\n", un, unlen, dirbuf.d_name, dirbuf.d_namlen); #endif Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Thu Oct 19 09:01:15 2017 (r324752) +++ head/sys/fs/msdosfs/msdosfs_denode.c Thu Oct 19 12:55:11 2017 (r324753) @@ -590,8 +590,9 @@ msdosfs_inactive(struct vop_inactive_args *ap) * as empty. (This may not be necessary for the dos filesystem.) */ #ifdef MSDOSFS_DEBUG - printf("msdosfs_inactive(): dep %p, refcnt %ld, mntflag %x, MNT_RDONLY %x\n", - dep, dep->de_refcnt, vp->v_mount->mnt_flag, MNT_RDONLY); + printf("msdosfs_inactive(): dep %p, refcnt %ld, mntflag %llx, MNT_RDONLY %llx\n", + dep, dep->de_refcnt, (unsigned long long)vp->v_mount->mnt_flag, + (unsigned long long)MNT_RDONLY); #endif if (dep->de_refcnt <= 0 && (vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { error = detrunc(dep, (u_long) 0, 0, NOCRED); Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Thu Oct 19 09:01:15 2017 (r324752) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Thu Oct 19 12:55:11 2017 (r324753) @@ -75,6 +75,10 @@ #include #include +#ifdef MSDOSFS_DEBUG +#include +#endif + static const char msdosfs_lock_msg[] = "fatlk"; /* Mount options that we support. */ Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Thu Oct 19 09:01:15 2017 (r324752) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Thu Oct 19 12:55:11 2017 (r324753) @@ -348,10 +348,13 @@ msdosfs_setattr(struct vop_setattr_args *ap) (vap->va_bytes != VNOVAL) || (vap->va_gen != VNOVAL)) { #ifdef MSDOSFS_DEBUG printf("msdosfs_setattr(): returning EINVAL\n"); - printf(" va_type %d, va_nlink %x, va_fsid %lx, va_fileid %lx\n", - vap->va_type, vap->va_nlink, vap->va_fsid, vap->va_fileid); - printf(" va_blocksize %lx, va_rdev %x, va_bytes %qx, va_gen %lx\n", - vap->va_blocksize, vap->va_rdev, vap->va_bytes, vap->va_gen); + printf(" va_type %d, va_nlink %llx, va_fsid %llx, va_fileid %llx\n", + vap->va_type, (unsigned long long)vap->va_nlink, + (unsigned long long)vap->va_fsid, + (unsigned long long)vap->va_fileid); + printf(" va_blocksize %lx, va_rdev %llx, va_bytes %llx, va_gen %lx\n", + vap->va_blocksize, (unsigned long long)vap->va_rdev, + (unsigned long long)vap->va_bytes, vap->va_gen); printf(" va_uid %x, va_gid %x\n", vap->va_uid, vap->va_gid); #endif From owner-svn-src-head@freebsd.org Thu Oct 19 13:22:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B7FDE3B779; Thu, 19 Oct 2017 13:22:54 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0928B69C4B; Thu, 19 Oct 2017 13:22:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JDMrnP055755; Thu, 19 Oct 2017 13:22:53 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JDMrMO055754; Thu, 19 Oct 2017 13:22:53 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201710191322.v9JDMrMO055754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 19 Oct 2017 13:22:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324754 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 324754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 13:22:54 -0000 Author: andrew Date: Thu Oct 19 13:22:52 2017 New Revision: 324754 URL: https://svnweb.freebsd.org/changeset/base/324754 Log: Allow later PSCI revisions to also work. The latest ARM Trusted Firmware reports version 1.1 so the check was failing. As thjis is a minor change from 1.0, and future 1.x revisions are also expected to be backwards compatible just ignore the minor revision in the init handler. Sponsored by: DARPA, AFRL Modified: head/sys/dev/psci/psci.c Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Thu Oct 19 12:55:11 2017 (r324753) +++ head/sys/dev/psci/psci.c Thu Oct 19 13:22:52 2017 (r324754) @@ -493,7 +493,7 @@ psci_v0_2_init(device_t dev) return (1); if ((PSCI_VER_MAJOR(version) == 0 && PSCI_VER_MINOR(version) == 2) || - (PSCI_VER_MAJOR(version) == 1 && PSCI_VER_MINOR(version) == 0)) { + PSCI_VER_MAJOR(version) == 1) { if (bootverbose) device_printf(dev, "PSCI version 0.2 available\n"); From owner-svn-src-head@freebsd.org Thu Oct 19 15:49:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0D8DE3EED5; Thu, 19 Oct 2017 15:49:35 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr0-x235.google.com (mail-wr0-x235.google.com [IPv6:2a00:1450:400c:c0c::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 867316E829; Thu, 19 Oct 2017 15:49:35 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr0-x235.google.com with SMTP id u5so8814789wrc.5; Thu, 19 Oct 2017 08:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=5CHoxAlQUBiDCXhOO0aiQgI+Y4He593c2VFpRAKkix0=; b=j2kyIf+kEMkjZyAAy+LvbSbIcJIjrulzqVsukGqVXAduCBSsHBhFH98+YFCj0Q5UKI ipOP4OWOE/r4XptUQN08z1rQuu6L0Yj4misMEQgsjwFdvobT05pCO2yMmorGVPRVEvKA mg6SQwL0qrIGRHPafswjpEc160iTp7bQdc6C1fpA1Vohzzgr+FEUDXiqSsScwwnxKWR6 xvY+YbUDDtmypITFm8vwZa4kkYhC4N+k+MEog2wMdNsiSxpKy7nIxaGRoHRxlSNs/w3K qFL3JZ5PLL+8ZWsdPXhG5JA7kPtYXAGIf1kE1Ikk7NXDXzUehmutvhgHgnLlhwPgJcBz YRwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=5CHoxAlQUBiDCXhOO0aiQgI+Y4He593c2VFpRAKkix0=; b=EShEWDjE9iZ03JFzO+A2fpyPFImKYc76CPLP6R3JM0nxGF1H5jiLaGhZpE9hpZErbZ 3Uqb7qITvEVyfplGxCQtGGbdNelNRPyKDKZo5gR/2fp4NO4J680BikqvrfiAj1y4CC24 JH1IbGyF8o73Ty4J8Ikun0sxNCRHpylVUrVENbuya/XLpGJGLq/2pJ5xm1ARvHxUr1oF IP13or6lfJI3T9UXH1Tcain51KZXNhYWNZSEznyX/wooc9RhsMnp9bEhLWLP8lHKCuum zw8C5dlXSsHxBoWmzHwx47g/cFoIgt0gmmZ/+MfJgIvsTZsJWKjGJ26U8GhwkvEKF3Bm BlPQ== X-Gm-Message-State: AMCzsaWOaU2a4XMRxKL7T7NVgFMlvQ7Vn18IzjW8smOWr6qcZcioO3wk KlNOHOtK4YnmCPJw4+/Za2GSHA== X-Google-Smtp-Source: ABhQp+QrNI4FQPN47kEYFKuXmpL6K3HXYj7PYNLs+8WzbOxBjvPE/QM4z80m0sgh5O6TmGr0W9P9AQ== X-Received: by 10.223.199.69 with SMTP id b5mr1973959wrh.187.1508428173543; Thu, 19 Oct 2017 08:49:33 -0700 (PDT) Received: from brick (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id y23sm20284578wry.62.2017.10.19.08.49.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 08:49:32 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 19 Oct 2017 16:49:30 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Devin Teske Cc: Ngie Cooper , Warner Losh , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r324471 - head/sys/boot Message-ID: <20171019154930.GA35182@brick> Mail-Followup-To: Devin Teske , Ngie Cooper , Warner Losh , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> <41ECAC77-1DCF-4107-A2EC-52141540013E@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <41ECAC77-1DCF-4107-A2EC-52141540013E@freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 15:49:36 -0000 On 1013T1438, Devin Teske wrote: > > > On Oct 13, 2017, at 8:53 AM, Ngie Cooper wrote: > > > > > >> On Oct 9, 2017, at 21:57, Ngie Cooper (yaneurabeya) wrote: > >> > >> > >>> On Oct 9, 2017, at 21:56, Warner Losh wrote: > >>> > >>> DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. > >>> > >>> DO NOT MAKE ANY COMMITS TO sys/boot. > >>> > >>> BACK OFF. > >>> > >>> Seriously, though, extra changes create extra friction, and these changes aren't worth any friction at all. I'm deleting LIBSAU and this guarantees a conflict when I update. > >>> > >>> So please, do not make any edits to sys/boot whatsoever, no matter how trivial. > >>> > >>> At least until I'm done. > >> > >> Ok > > > > So... what’s the status? > > Your typo gave me an idea for a new tool ... > > Usage: whatfs path ... > > Return unique list of filesystems containing list of paths. > > Lol ;D > > E.g., "whatfs / /usr /usr/local /foo /bar" would list minimal filesystem mountpoints containing all given paths Like this? df / /usr /usr/local /foo /bar | awk 'NR > 1 { print $6 }' | sort -u From owner-svn-src-head@freebsd.org Thu Oct 19 16:36:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99985E3FEF3; Thu, 19 Oct 2017 16:36:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63868700F9; Thu, 19 Oct 2017 16:36:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JGa7H1035427; Thu, 19 Oct 2017 16:36:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JGa7Nf035426; Thu, 19 Oct 2017 16:36:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710191636.v9JGa7Nf035426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 19 Oct 2017 16:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324757 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 324757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 16:36:08 -0000 Author: avg Date: Thu Oct 19 16:36:07 2017 New Revision: 324757 URL: https://svnweb.freebsd.org/changeset/base/324757 Log: remove spa_sync_on assert from spa_async_thread_vd Unlike spa_async_thread that can get started only from spa_sync() spa_async_thread_vd can get started from other contexts. Additionally, spa_async_thread_vd does not really depend on spa sync being enabled. The incorrect assert could be triggered by importing a pool in the read-only mode and then disconnecting one of its disks. In this case spa_sync_on was false because the pool was read-only and spa_async_thread_vd was started to handle SPA_ASYNC_REMOVE event. Note: spa_async_thread_vd() currently exists only in FreeBSD, it was split out of spa_async_thread() in r253990. Discussed with: mav MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Oct 19 16:16:26 2017 (r324756) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Oct 19 16:36:07 2017 (r324757) @@ -6247,8 +6247,6 @@ spa_async_thread_vd(void *arg) spa_t *spa = arg; int tasks; - ASSERT(spa->spa_sync_on); - mutex_enter(&spa->spa_async_lock); tasks = spa->spa_async_tasks; retry: From owner-svn-src-head@freebsd.org Thu Oct 19 16:40:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB593E400A0; Thu, 19 Oct 2017 16:40:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A719702D1; Thu, 19 Oct 2017 16:40:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JGeHIn035638; Thu, 19 Oct 2017 16:40:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JGeHgI035637; Thu, 19 Oct 2017 16:40:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710191640.v9JGeHgI035637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 19 Oct 2017 16:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324758 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 324758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 16:40:18 -0000 Author: emaste Date: Thu Oct 19 16:40:17 2017 New Revision: 324758 URL: https://svnweb.freebsd.org/changeset/base/324758 Log: psci: change bootverbose string to 'PSCI 0.2 compatible' Prior to r324754 we treated PSCI 0.2 and 1.0 as identical, and r324754 extended that to include all PSCI 1.x revisions. Change the string emitted under bootverbose to reference '0.2 compatible' to avoid confusion when the system includes a later PSCI rev. Discussed with: andrew Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/psci/psci.c Modified: head/sys/dev/psci/psci.c ============================================================================== --- head/sys/dev/psci/psci.c Thu Oct 19 16:36:07 2017 (r324757) +++ head/sys/dev/psci/psci.c Thu Oct 19 16:40:17 2017 (r324758) @@ -495,7 +495,7 @@ psci_v0_2_init(device_t dev) if ((PSCI_VER_MAJOR(version) == 0 && PSCI_VER_MINOR(version) == 2) || PSCI_VER_MAJOR(version) == 1) { if (bootverbose) - device_printf(dev, "PSCI version 0.2 available\n"); + device_printf(dev, "PSCI version 0.2 compatible\n"); /* * We only register this for v0.2 since v0.1 doesn't support From owner-svn-src-head@freebsd.org Thu Oct 19 16:42:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25605E40266; Thu, 19 Oct 2017 16:42:05 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E755070645; Thu, 19 Oct 2017 16:42:04 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JGg3rD038747; Thu, 19 Oct 2017 16:42:03 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JGg3bM038746; Thu, 19 Oct 2017 16:42:03 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201710191642.v9JGg3bM038746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Thu, 19 Oct 2017 16:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324759 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 324759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 16:42:05 -0000 Author: fsu Date: Thu Oct 19 16:42:03 2017 New Revision: 324759 URL: https://svnweb.freebsd.org/changeset/base/324759 Log: Fix unused variable + style(9) fixes inside the ext4_ext_find_extent() Approved by: pfg (mentor) Reported by: Coverity CID: 1381754 MFC after: 6 months Modified: head/sys/fs/ext2fs/ext2_extents.c Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Thu Oct 19 16:40:17 2017 (r324758) +++ head/sys/fs/ext2fs/ext2_extents.c Thu Oct 19 16:42:03 2017 (r324759) @@ -377,11 +377,11 @@ ext4_ext_find_extent(struct inode *ip, daddr_t block, if (error) return (error); - if (!ppath) + if (ppath == NULL) return (EINVAL); path = *ppath; - if (!path) { + if (path == NULL) { path = malloc(EXT4_EXT_DEPTH_MAX * sizeof(struct ext4_extent_path), M_EXT2EXTENTS, M_WAITOK | M_ZERO); @@ -1349,7 +1349,7 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_ uint64_t start) { struct m_ext2fs *fs; - int depth, credits; + int depth; struct ext4_extent_header *eh; unsigned int a, b, block, num; unsigned long ex_blk; @@ -1402,11 +1402,8 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_ ("ext4_ext_rm_leaf: bad b")); } - credits = EXT4_EXT_DEPTH_MAX; - if (ex == EXT_FIRST_EXTENT(eh)) { + if (ex == EXT_FIRST_EXTENT(eh)) correct_index = 1; - credits += (ext4_ext_inode_depth(ip)) + 1; - } error = ext4_remove_blocks(ip, ex, a, b); if (error) From owner-svn-src-head@freebsd.org Thu Oct 19 18:04:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DD8EE430EB; Thu, 19 Oct 2017 18:04:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFA1F757C5; Thu, 19 Oct 2017 18:04:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JI4HkZ076708; Thu, 19 Oct 2017 18:04:17 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JI4Hps076707; Thu, 19 Oct 2017 18:04:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710191804.v9JI4Hps076707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 19 Oct 2017 18:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324767 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 324767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 18:04:18 -0000 Author: glebius Date: Thu Oct 19 18:04:16 2017 New Revision: 324767 URL: https://svnweb.freebsd.org/changeset/base/324767 Log: Hide struct sockbuf from userland. PR: 222917 (exp-run) Modified: head/sys/sys/sockbuf.h Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Thu Oct 19 17:57:38 2017 (r324766) +++ head/sys/sys/sockbuf.h Thu Oct 19 18:04:16 2017 (r324767) @@ -32,15 +32,9 @@ */ #ifndef _SYS_SOCKBUF_H_ #define _SYS_SOCKBUF_H_ -#include -#include -#include -#include -#define SB_MAX (2*1024*1024) /* default for max chars in sockbuf */ - /* - * Constants for sb_flags field of struct sockbuf. + * Constants for sb_flags field of struct sockbuf/xsockbuf. */ #define SB_WAIT 0x04 /* someone is waiting for data/space */ #define SB_SEL 0x08 /* someone is selecting */ @@ -59,6 +53,14 @@ #define SBS_CANTRCVMORE 0x0020 /* can't receive more data from peer */ #define SBS_RCVATMARK 0x0040 /* at mark on input */ +#if defined(_KERNEL) || defined(_WANT_SOCKET) +#include +#include +#include +#include + +#define SB_MAX (2*1024*1024) /* default for max chars in sockbuf */ + struct mbuf; struct sockaddr; struct socket; @@ -101,6 +103,7 @@ struct sockbuf { struct task sb_aiotask; /* AIO task */ }; +#endif /* defined(_KERNEL) || defined(_WANT_SOCKET) */ #ifdef _KERNEL /* From owner-svn-src-head@freebsd.org Thu Oct 19 20:42:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D32F9E47214; Thu, 19 Oct 2017 20:42:47 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0DEF800D4; Thu, 19 Oct 2017 20:42:47 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JKgkPS046430; Thu, 19 Oct 2017 20:42:46 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JKgkej046429; Thu, 19 Oct 2017 20:42:46 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201710192042.v9JKgkej046429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Thu, 19 Oct 2017 20:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324770 - head/usr.sbin/bluetooth/bthidd X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/usr.sbin/bluetooth/bthidd X-SVN-Commit-Revision: 324770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 20:42:47 -0000 Author: wulf Date: Thu Oct 19 20:42:46 2017 New Revision: 324770 URL: https://svnweb.freebsd.org/changeset/base/324770 Log: bthidd: Fix leds on multireport keyboards broken after r297217 Reviewed by: emax, gonzo Approved by: gonzo (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12214 Modified: head/usr.sbin/bluetooth/bthidd/kbd.c Modified: head/usr.sbin/bluetooth/bthidd/kbd.c ============================================================================== --- head/usr.sbin/bluetooth/bthidd/kbd.c Thu Oct 19 20:28:04 2017 (r324769) +++ head/usr.sbin/bluetooth/bthidd/kbd.c Thu Oct 19 20:42:46 2017 (r324770) @@ -569,6 +569,11 @@ kbd_status_changed(bthid_session_p s, uint8_t *data, i } hid_end_parse(d); + if (report_id != NO_REPORT_ID) { + data[2] = data[1]; + data[1] = report_id; + } + if (found) write(s->intr, data, (report_id != NO_REPORT_ID) ? 3 : 2); From owner-svn-src-head@freebsd.org Thu Oct 19 20:52:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A25AE474D4; Thu, 19 Oct 2017 20:52:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 497AA80549; Thu, 19 Oct 2017 20:52:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JKqHJq050510; Thu, 19 Oct 2017 20:52:17 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JKqHOV050509; Thu, 19 Oct 2017 20:52:17 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710192052.v9JKqHOV050509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 19 Oct 2017 20:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324771 - head/sys/arm/nvidia/tegra124 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/nvidia/tegra124 X-SVN-Commit-Revision: 324771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 20:52:18 -0000 Author: manu Date: Thu Oct 19 20:52:17 2017 New Revision: 324771 URL: https://svnweb.freebsd.org/changeset/base/324771 Log: tegra: Do not define early printf function Since tegra is now in GENERIC, do not enable the early printf function as it can conflict with others. Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_machdep.c Thu Oct 19 20:42:46 2017 (r324770) +++ head/sys/arm/nvidia/tegra124/tegra124_machdep.c Thu Oct 19 20:52:17 2017 (r324771) @@ -122,6 +122,7 @@ tegra124_cpu_reset(platform_t plat) * option SOCDEV_VA=0x70000000 * option EARLY_PRINTF */ +#if 0 #ifdef EARLY_PRINTF static void tegra124_early_putc(int c) @@ -135,6 +136,7 @@ tegra124_early_putc(int c) *UART_TX_REG = c; } early_putc_t *early_putc = tegra124_early_putc; +#endif #endif static platform_method_t tegra124_methods[] = { From owner-svn-src-head@freebsd.org Thu Oct 19 20:54:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0E99E4759C; Thu, 19 Oct 2017 20:54:56 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8D7480812; Thu, 19 Oct 2017 20:54:56 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JKstlp050630; Thu, 19 Oct 2017 20:54:55 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JKstJo050629; Thu, 19 Oct 2017 20:54:55 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201710192054.v9JKstJo050629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Thu, 19 Oct 2017 20:54:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324772 - head/sys/dev/usb/input X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/usb/input X-SVN-Commit-Revision: 324772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 20:54:57 -0000 Author: wulf Date: Thu Oct 19 20:54:55 2017 New Revision: 324772 URL: https://svnweb.freebsd.org/changeset/base/324772 Log: ums(4): Unreverse evdev Tilt-axis reporting to match Linux. sysmouse tilt to button mapping remained unchanged. Reviewed by: hselasky Approved by: gonzo (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12671 Modified: head/sys/dev/usb/input/ums.c Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Thu Oct 19 20:52:17 2017 (r324771) +++ head/sys/dev/usb/input/ums.c Thu Oct 19 20:54:55 2017 (r324772) @@ -296,7 +296,7 @@ ums_intr_callback(struct usb_xfer *xfer, usb_error_t e if ((info->sc_flags & UMS_FLAG_T_AXIS) && (id == info->sc_iid_t)) { - dt -= hid_get_data(buf, len, &info->sc_loc_t); + dt += hid_get_data(buf, len, &info->sc_loc_t); /* T-axis is translated into button presses */ buttons_found |= (1UL << 5) | (1UL << 6); } @@ -332,10 +332,10 @@ ums_intr_callback(struct usb_xfer *xfer, usb_error_t e /* translate T-axis into button presses until further */ if (dt > 0) { ums_put_queue(sc, 0, 0, 0, 0, buttons); - buttons |= 1UL << 5; + buttons |= 1UL << 6; } else if (dt < 0) { ums_put_queue(sc, 0, 0, 0, 0, buttons); - buttons |= 1UL << 6; + buttons |= 1UL << 5; } sc->sc_status.button = buttons; From owner-svn-src-head@freebsd.org Thu Oct 19 20:56:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E1BFE47621; Thu, 19 Oct 2017 20:56:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD6E8096B; Thu, 19 Oct 2017 20:56:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JKuU4S050753; Thu, 19 Oct 2017 20:56:30 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JKuUpQ050752; Thu, 19 Oct 2017 20:56:30 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710192056.v9JKuUpQ050752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 19 Oct 2017 20:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324773 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 324773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 20:56:31 -0000 Author: manu Date: Thu Oct 19 20:56:30 2017 New Revision: 324773 URL: https://svnweb.freebsd.org/changeset/base/324773 Log: Allwinner: Add EARLY_PRINTF function EARLY_PRINTF can help debugging early problems. Add it for Allwinner SoCs. Tested On: OrangePi One (H3) Modified: head/sys/arm/allwinner/aw_machdep.c Modified: head/sys/arm/allwinner/aw_machdep.c ============================================================================== --- head/sys/arm/allwinner/aw_machdep.c Thu Oct 19 20:54:55 2017 (r324772) +++ head/sys/arm/allwinner/aw_machdep.c Thu Oct 19 20:56:30 2017 (r324773) @@ -164,6 +164,29 @@ allwinner_cpu_reset(platform_t plat) while (1); } +/* + * To use early printf on Allwinner SoC, add to kernel config + * options SOCDEV_PA=0x01C00000 + * options SOCDEV_VA=0x10000000 + * options EARLY_PRINTF + * And remove the if 0 +*/ +#if 0 +#ifdef EARLY_PRINTF +static void +allwinner_early_putc(int c) +{ + volatile uint32_t * UART_STAT_REG = (uint32_t *)0x1002807C; + volatile uint32_t * UART_TX_REG = (uint32_t *)0x10028000; + const uint32_t UART_TXRDY = (1 << 2); + + while ((*UART_STAT_REG & UART_TXRDY) == 0) + continue; + *UART_TX_REG = c; +} +early_putc_t *early_putc = allwinner_early_putc; +#endif /* EARLY_PRINTF */ + #if defined(SOC_ALLWINNER_A10) static platform_method_t a10_methods[] = { PLATFORMMETHOD(platform_attach, a10_attach), From owner-svn-src-head@freebsd.org Thu Oct 19 21:07:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A128E4787D; Thu, 19 Oct 2017 21:07:29 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66A0880DF6; Thu, 19 Oct 2017 21:07:29 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JL7SOG054968; Thu, 19 Oct 2017 21:07:28 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JL7Siv054967; Thu, 19 Oct 2017 21:07:28 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201710192107.v9JL7Siv054967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Thu, 19 Oct 2017 21:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324774 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 324774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 21:07:29 -0000 Author: wulf Date: Thu Oct 19 21:07:28 2017 New Revision: 324774 URL: https://svnweb.freebsd.org/changeset/base/324774 Log: psm(4): Add sanity checks to Synaptics touchpad driver resolution parser. This fixes "Kernel has only x or y resolution, not both" libinput error. Reported by: Ivan Tested by: Ivan Approved by: gonzo (mentor) MFC after: 2 weeks Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Thu Oct 19 20:56:30 2017 (r324773) +++ head/sys/dev/atkbdc/psm.c Thu Oct 19 21:07:28 2017 (r324774) @@ -6094,8 +6094,10 @@ enable_synaptics(struct psm_softc *sc, enum probearg a if (get_mouse_status(kbdc, status, 0, 3) != 3) return (FALSE); - synhw.infoXupmm = status[0]; - synhw.infoYupmm = status[2]; + if (status[0] != 0 && (status[1] & 0x80) && status[2] != 0) { + synhw.infoXupmm = status[0]; + synhw.infoYupmm = status[2]; + } if (verbose >= 2) { printf(" Extended capabilities:\n"); From owner-svn-src-head@freebsd.org Thu Oct 19 21:34:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE0AEE47FAB; Thu, 19 Oct 2017 21:34:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D12B81B87; Thu, 19 Oct 2017 21:34:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JLYreS067230; Thu, 19 Oct 2017 21:34:53 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JLYrKu067229; Thu, 19 Oct 2017 21:34:53 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710192134.v9JLYrKu067229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 19 Oct 2017 21:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324775 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 324775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 21:34:54 -0000 Author: manu Date: Thu Oct 19 21:34:53 2017 New Revision: 324775 URL: https://svnweb.freebsd.org/changeset/base/324775 Log: Allwinner: Fix compilation Forgot an #endif in r324773, sorry for the breakage. Modified: head/sys/arm/allwinner/aw_machdep.c Modified: head/sys/arm/allwinner/aw_machdep.c ============================================================================== --- head/sys/arm/allwinner/aw_machdep.c Thu Oct 19 21:07:28 2017 (r324774) +++ head/sys/arm/allwinner/aw_machdep.c Thu Oct 19 21:34:53 2017 (r324775) @@ -186,6 +186,7 @@ allwinner_early_putc(int c) } early_putc_t *early_putc = allwinner_early_putc; #endif /* EARLY_PRINTF */ +#endif #if defined(SOC_ALLWINNER_A10) static platform_method_t a10_methods[] = { From owner-svn-src-head@freebsd.org Thu Oct 19 21:57:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C521CE4873B; Thu, 19 Oct 2017 21:57:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92EC78266B; Thu, 19 Oct 2017 21:57:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9JLvEJ3075832; Thu, 19 Oct 2017 21:57:14 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9JLvEE2075831; Thu, 19 Oct 2017 21:57:14 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201710192157.v9JLvEE2075831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 19 Oct 2017 21:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324776 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 324776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2017 21:57:15 -0000 Author: marius Date: Thu Oct 19 21:57:14 2017 New Revision: 324776 URL: https://svnweb.freebsd.org/changeset/base/324776 Log: Correct an inverted conditional for determining the multiplier of the user data area size. Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Thu Oct 19 21:34:53 2017 (r324775) +++ head/sys/dev/mmc/mmcsd.c Thu Oct 19 21:57:14 2017 (r324776) @@ -327,7 +327,7 @@ mmcsd_attach(device_t dev) (ext_csd[EXT_CSD_ENH_START_ADDR + 1] << 8) + (ext_csd[EXT_CSD_ENH_START_ADDR + 2] << 16) + (ext_csd[EXT_CSD_ENH_START_ADDR + 3] << 24)) * - (sc->high_cap != 0 ? MMC_SECTOR_SIZE : 1); + (sc->high_cap == 0 ? MMC_SECTOR_SIZE : 1); } else if (bootverbose) device_printf(dev, "enhanced user data area spans entire device\n"); From owner-svn-src-head@freebsd.org Fri Oct 20 00:30:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEF05E4B3A9; Fri, 20 Oct 2017 00:30:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89CA016CA; Fri, 20 Oct 2017 00:30:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K0UZgW037480; Fri, 20 Oct 2017 00:30:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K0UZLs037478; Fri, 20 Oct 2017 00:30:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710200030.v9K0UZLs037478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 20 Oct 2017 00:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324778 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 00:30:36 -0000 Author: mjg Date: Fri Oct 20 00:30:35 2017 New Revision: 324778 URL: https://svnweb.freebsd.org/changeset/base/324778 Log: mtx: clean up locking spin mutexes 1) shorten the fast path by pushing the lockstat probe to the slow path 2) test for kernel panic only after it turns out we will have to spin, in particular test only after we know we are not recursing MFC after: 1 week Modified: head/sys/kern/kern_mutex.c head/sys/sys/mutex.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Oct 20 00:29:39 2017 (r324777) +++ head/sys/kern/kern_mutex.c Fri Oct 20 00:30:35 2017 (r324778) @@ -289,6 +289,7 @@ __mtx_lock_spin_flags(volatile uintptr_t *c, int opts, int line) { struct mtx *m; + uintptr_t tid, v; if (SCHEDULER_STOPPED()) return; @@ -308,7 +309,14 @@ __mtx_lock_spin_flags(volatile uintptr_t *c, int opts, opts &= ~MTX_RECURSE; WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); - __mtx_lock_spin(m, curthread, opts, file, line); + spinlock_enter(); + tid = (uintptr_t)curthread; + v = MTX_UNOWNED; + if (!_mtx_obtain_lock_fetch(m, &v, tid)) + _mtx_lock_spin(m, v, opts, file, line); + else + LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, + m, 0, 0, file, line); LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file, line); WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); @@ -682,12 +690,18 @@ _mtx_lock_spin_failed(struct mtx *m) * This is only called if we need to actually spin for the lock. Recursion * is handled inline. */ +#if LOCK_DEBUG > 0 void -_mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, - int opts, const char *file, int line) +_mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t v, int opts, + const char *file, int line) +#else +void +_mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t v) +#endif { struct mtx *m; struct lock_delay_arg lda; + uintptr_t tid; #ifdef LOCK_PROFILING int contested = 0; uint64_t waittime = 0; @@ -699,10 +713,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t int doing_lockprof; #endif - if (SCHEDULER_STOPPED()) - return; - - lock_delay_arg_init(&lda, &mtx_spin_delay); + tid = (uintptr_t)curthread; m = mtxlock2mtx(c); if (__predict_false(v == MTX_UNOWNED)) @@ -712,6 +723,11 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t m->mtx_recurse++; return; } + + if (SCHEDULER_STOPPED()) + return; + + lock_delay_arg_init(&lda, &mtx_spin_delay); if (LOCK_LOG_TEST(&m->lock_object, opts)) CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m); Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Fri Oct 20 00:29:39 2017 (r324777) +++ head/sys/sys/mutex.h Fri Oct 20 00:30:35 2017 (r324778) @@ -105,9 +105,13 @@ void __mtx_unlock_sleep(volatile uintptr_t *c); #endif #ifdef SMP -void _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, - int opts, const char *file, int line); +#if LOCK_DEBUG > 0 +void _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t v, int opts, + const char *file, int line); +#else +void _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t v); #endif +#endif void __mtx_lock_flags(volatile uintptr_t *c, int opts, const char *file, int line); void __mtx_unlock_flags(volatile uintptr_t *c, int opts, const char *file, @@ -154,9 +158,14 @@ void thread_lock_flags_(struct thread *, int, const ch __mtx_unlock_sleep(&(m)->mtx_lock) #endif #ifdef SMP -#define _mtx_lock_spin(m, v, t, o, f, l) \ - _mtx_lock_spin_cookie(&(m)->mtx_lock, v, t, o, f, l) +#if LOCK_DEBUG > 0 +#define _mtx_lock_spin(m, v, o, f, l) \ + _mtx_lock_spin_cookie(&(m)->mtx_lock, v, o, f, l) +#else +#define _mtx_lock_spin(m, v, o, f, l) \ + _mtx_lock_spin_cookie(&(m)->mtx_lock, v) #endif +#endif #define _mtx_lock_flags(m, o, f, l) \ __mtx_lock_flags(&(m)->mtx_lock, o, f, l) #define _mtx_unlock_flags(m, o, f, l) \ @@ -219,11 +228,9 @@ void thread_lock_flags_(struct thread *, int, const ch uintptr_t _v = MTX_UNOWNED; \ \ spinlock_enter(); \ - if (!_mtx_obtain_lock_fetch((mp), &_v, _tid)) \ - _mtx_lock_spin((mp), _v, _tid, (opts), (file), (line)); \ - else \ - LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, \ - mp, 0, 0, file, line); \ + if (__predict_false(LOCKSTAT_PROFILE_ENABLED(spin__acquire) || \ + !_mtx_obtain_lock_fetch((mp), &_v, _tid))) \ + _mtx_lock_spin((mp), _v, (opts), (file), (line)); \ } while (0) #define __mtx_trylock_spin(mp, tid, opts, file, line) __extension__ ({ \ uintptr_t _tid = (uintptr_t)(tid); \ From owner-svn-src-head@freebsd.org Fri Oct 20 00:34:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9705DE4B4B0; Fri, 20 Oct 2017 00:34:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 654901C58; Fri, 20 Oct 2017 00:34:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K0YPLJ041413; Fri, 20 Oct 2017 00:34:25 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K0YPqB041412; Fri, 20 Oct 2017 00:34:25 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710200034.v9K0YPqB041412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 20 Oct 2017 00:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324780 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 00:34:26 -0000 Author: mjg Date: Fri Oct 20 00:34:25 2017 New Revision: 324780 URL: https://svnweb.freebsd.org/changeset/base/324780 Log: mtx: stop testing SCHEDULER_STOPPED in kabi funcs for spin mutexes There is nothing panic-breaking to do in the unlock case and the lock case will fallback to the slow path doing the check already. MFC after: 1 week Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Oct 20 00:33:49 2017 (r324779) +++ head/sys/kern/kern_mutex.c Fri Oct 20 00:34:25 2017 (r324780) @@ -291,9 +291,6 @@ __mtx_lock_spin_flags(volatile uintptr_t *c, int opts, struct mtx *m; uintptr_t tid, v; - if (SCHEDULER_STOPPED()) - return; - m = mtxlock2mtx(c); KASSERT(m->mtx_lock != MTX_DESTROYED, @@ -355,9 +352,6 @@ __mtx_unlock_spin_flags(volatile uintptr_t *c, int opt int line) { struct mtx *m; - - if (SCHEDULER_STOPPED()) - return; m = mtxlock2mtx(c); From owner-svn-src-head@freebsd.org Fri Oct 20 02:16:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25602E4D001; Fri, 20 Oct 2017 02:16:51 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu [18.9.25.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8942063848; Fri, 20 Oct 2017 02:16:50 +0000 (UTC) (envelope-from kaduk@mit.edu) X-AuditID: 1209190f-b7dff70000005824-e9-59e95c8bb0ac Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id 62.D9.22564.B8C59E95; Thu, 19 Oct 2017 22:16:43 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH-1.MIT.EDU [18.9.28.11]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id v9K2GgJS010470; Thu, 19 Oct 2017 22:16:42 -0400 Received: from kduck.kaduk.org (24-107-191-124.dhcp.stls.mo.charter.com [24.107.191.124]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id v9K2GcnD020915 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 19 Oct 2017 22:16:40 -0400 Date: Thu, 19 Oct 2017 21:16:38 -0500 From: Benjamin Kaduk To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324732 - head/usr.sbin/jail Message-ID: <20171020021638.GI96685@kduck.kaduk.org> References: <201710182256.v9IMulLG092310@repo.freebsd.org> <0dde8df6-6c8b-ac2d-f109-12ca6b1df341@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0dde8df6-6c8b-ac2d-f109-12ca6b1df341@freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrAIsWRmVeSWpSXmKPExsUixCmqrNsd8zLS4NomDYs5J18yW/xpn8Ji 8WfTQlaLpi8LmBxYPGZ8ms8SwBjFZZOSmpNZllqkb5fAldH6ZxJzwUbeip5dC9gaGE9wdTFy ckgImEjs2beCtYuRi0NIYDGTxOJdH5ghnI2MEnvPPGSCcK4ySextXsEC0sIioCrx798fJhCb TUBN4vHeZlYQW0RAV2Lh9xnsIDazQJTErWsPweLCAqYSc6ddB6vnBVr39/susBohgXyJXQe+ skLEBSVOznzCAtGrJXHj30ugeg4gW1pi+T8OkDCngL3E41//wUpEBZQl5u1bxTaBUWAWku5Z SLpnIXQvYGRexSibklulm5uYmVOcmqxbnJyYl5dapGuil5tZopeaUrqJERywkvw7GOc0eB9i FOBgVOLh3XDhRaQQa2JZcWXuIUZJDiYlUd4NHC8jhfiS8lMqMxKLM+KLSnNSiw8xSnAwK4nw vggDyvGmJFZWpRblw6SkOViUxHm3Be2KFBJITyxJzU5NLUgtgsnKcHAoSfDmRgM1ChalpqdW pGXmlCCkmTg4QYbzAA33BKnhLS5IzC3OTIfIn2JUlBLndYgCSgiAJDJK8+B6QQlFInt/zStG caBXhHkrQdp5gMkIrvsV0GAmoMHs9i9ABpckIqSkGhhzJjGtYdnncH/V5vCeleuq+g+s/+Lo e+zkh6lP0h/MrvfK2XbwSfSeCXMqHC6dTfC8we/CH6f77aMqW+npdxPi5C8sMlh121PKh+Vf zQ8x9bJkMxu/1V5FQel/Kn8evjr/XmJL6dUNN5gWii8o1DXmW+beuf6+4ollaZrsFpczp1zx 8z1wbu0MJZbijERDLeai4kQAPbwCUAMDAAA= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 02:16:51 -0000 That's a fair point. I didn't want Steve's report to get lost on the mailing list but didn't have time to look very hard yesterday, so I just put something quick in (as the old verison is obviously wrong). There's also some mandoc -Tling nits reported in this page, so hopefully I'll get some time to make further improvements this weekend. Unless you wanted to fix it yourself? Thanks, Ben On Wed, Oct 18, 2017 at 09:12:02PM -0700, Nathan Whitehorn wrote: > Is this even true? Don't you want to run bsdconfig? We split that > functionality out from the installer when sysinstall was replaced. > -Nathan > > On 10/18/17 15:56, Benjamin Kaduk wrote: > > Author: bjk (doc committer) > > Date: Wed Oct 18 22:56:46 2017 > > New Revision: 324732 > > URL: https://svnweb.freebsd.org/changeset/base/324732 > > > > Log: > > Adopt jail.8 to our brave new bsdinstall world > > > > Submitted by: Steve Kargl > > MFC after: 3 days > > > > Modified: > > head/usr.sbin/jail/jail.8 > > > > Modified: head/usr.sbin/jail/jail.8 > > ============================================================================== > > --- head/usr.sbin/jail/jail.8 Wed Oct 18 22:00:44 2017 (r324731) > > +++ head/usr.sbin/jail/jail.8 Wed Oct 18 22:56:46 2017 (r324732) > > @@ -1006,7 +1006,7 @@ jail -c path=/data/jail/testjail mount.devfs \\ > > .Pp > > Assuming no errors, you will end up with a shell prompt within the jail. > > You can now run > > -.Pa /usr/sbin/sysinstall > > +.Pa /usr/sbin/bsdinstall > > and do the post-install configuration to set various configuration options, > > or perform these actions manually by editing > > .Pa /etc/rc.conf , > > > From owner-svn-src-head@freebsd.org Fri Oct 20 03:03:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E415DE4DFE6; Fri, 20 Oct 2017 03:03:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B341A64E65; Fri, 20 Oct 2017 03:03:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K334kH004117; Fri, 20 Oct 2017 03:03:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K334oe004116; Fri, 20 Oct 2017 03:03:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201710200303.v9K334oe004116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 20 Oct 2017 03:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324783 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 324783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 03:03:06 -0000 Author: jhibbits Date: Fri Oct 20 03:03:04 2017 New Revision: 324783 URL: https://svnweb.freebsd.org/changeset/base/324783 Log: Book-E debug trace fixes * Book-E can have Altivec exceptions, so move it out of the AIM-only block. * Print the right DSI trap mode (read vs write) for Book-E While here, fix some whitespace found while reviewing other diffs. Modified: head/sys/powerpc/powerpc/db_trace.c Modified: head/sys/powerpc/powerpc/db_trace.c ============================================================================== --- head/sys/powerpc/powerpc/db_trace.c Fri Oct 20 00:38:01 2017 (r324782) +++ head/sys/powerpc/powerpc/db_trace.c Fri Oct 20 03:03:04 2017 (r324783) @@ -118,12 +118,12 @@ db_frame(struct db_variable *vp, db_expr_t *valuep, in if (kdb_frame == NULL) return (0); - reg = (register_t*)((uintptr_t)kdb_frame + (uintptr_t)vp->valuep); - if (op == DB_VAR_GET) - *valuep = *reg; - else - *reg = *valuep; - return (1); + reg = (register_t*)((uintptr_t)kdb_frame + (uintptr_t)vp->valuep); + if (op == DB_VAR_GET) + *valuep = *reg; + else + *reg = *valuep; + return (1); } @@ -215,12 +215,17 @@ db_backtrace(struct thread *td, db_addr_t fp, int coun switch (tf->exc) { case EXC_DSI: /* XXX take advantage of the union. */ +#ifdef BOOKE db_printf("DSI %s trap @ %#zx by ", + (tf->cpu.booke.esr & ESR_ST) ? "write" + : "read", tf->dar); +#else + db_printf("DSI %s trap @ %#zx by ", (tf->cpu.aim.dsisr & DSISR_STORE) ? "write" : "read", tf->dar); +#endif goto print_trap; case EXC_ALI: - /* XXX take advantage of the union. */ db_printf("ALI trap @ %#zx (xSR %#x) ", tf->dar, (uint32_t)tf->cpu.aim.dsisr); goto print_trap; @@ -237,8 +242,8 @@ db_backtrace(struct thread *td, db_addr_t fp, int coun case EXC_SC: trapstr = "SC"; break; case EXC_EXI: trapstr = "EXI"; break; case EXC_MCHK: trapstr = "MCHK"; break; -#if !defined(BOOKE) case EXC_VEC: trapstr = "VEC"; break; +#if !defined(BOOKE) case EXC_FPA: trapstr = "FPA"; break; case EXC_BPT: trapstr = "BPT"; break; case EXC_TRC: trapstr = "TRC"; break; From owner-svn-src-head@freebsd.org Fri Oct 20 03:13:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62EFAE4E315; Fri, 20 Oct 2017 03:13:32 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E32D65313; Fri, 20 Oct 2017 03:13:31 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K3DVtj008114; Fri, 20 Oct 2017 03:13:31 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K3DVdC008113; Fri, 20 Oct 2017 03:13:31 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201710200313.v9K3DVdC008113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 20 Oct 2017 03:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324784 - head/sys/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/ofw X-SVN-Commit-Revision: 324784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 03:13:32 -0000 Author: jhibbits Date: Fri Oct 20 03:13:31 2017 New Revision: 324784 URL: https://svnweb.freebsd.org/changeset/base/324784 Log: No need to check for AIM here This block is already in a #ifdef AIM block. Modified: head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Fri Oct 20 03:03:04 2017 (r324783) +++ head/sys/powerpc/ofw/ofw_machdep.c Fri Oct 20 03:13:31 2017 (r324784) @@ -461,7 +461,7 @@ openfirmware_core(void *args) /* Restore initially saved trap vectors */ ofw_restore_trap_vec(save_trap_init); -#if defined(AIM) && !defined(__powerpc64__) +#ifndef __powerpc64__ /* * Clear battable[] translations */ From owner-svn-src-head@freebsd.org Fri Oct 20 03:30:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84861E4E611; Fri, 20 Oct 2017 03:30:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 608406583B; Fri, 20 Oct 2017 03:30:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K3U3D7012719; Fri, 20 Oct 2017 03:30:03 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K3U3kO012713; Fri, 20 Oct 2017 03:30:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710200330.v9K3U3kO012713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 20 Oct 2017 03:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324785 - in head/sys/amd64: amd64 ia32 linux linux32 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys/amd64: amd64 ia32 linux linux32 X-SVN-Commit-Revision: 324785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 03:30:04 -0000 Author: mjg Date: Fri Oct 20 03:30:02 2017 New Revision: 324785 URL: https://svnweb.freebsd.org/changeset/base/324785 Log: amd64: avoid acquiring dt lock if possible (which is the common case) Discussed with: kib MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri Oct 20 03:13:31 2017 (r324784) +++ head/sys/amd64/amd64/machdep.c Fri Oct 20 03:30:02 2017 (r324785) @@ -581,12 +581,9 @@ exec_setregs(struct thread *td, struct image_params *i struct trapframe *regs = td->td_frame; struct pcb *pcb = td->td_pcb; - mtx_lock(&dt_lock); if (td->td_proc->p_md.md_ldt != NULL) user_ldt_free(td); - else - mtx_unlock(&dt_lock); - + update_pcb_bases(pcb); pcb->pcb_fsbase = 0; pcb->pcb_gsbase = 0; Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Fri Oct 20 03:13:31 2017 (r324784) +++ head/sys/amd64/amd64/sys_machdep.c Fri Oct 20 03:30:02 2017 (r324785) @@ -500,7 +500,7 @@ user_ldt_free(struct thread *td) struct mdproc *mdp = &p->p_md; struct proc_ldt *pldt; - mtx_assert(&dt_lock, MA_OWNED); + mtx_lock(&dt_lock); if ((pldt = mdp->md_ldt) == NULL) { mtx_unlock(&dt_lock); return; Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Fri Oct 20 03:13:31 2017 (r324784) +++ head/sys/amd64/amd64/vm_machdep.c Fri Oct 20 03:30:02 2017 (r324785) @@ -299,11 +299,8 @@ cpu_exit(struct thread *td) /* * If this process has a custom LDT, release it. */ - mtx_lock(&dt_lock); - if (td->td_proc->p_md.md_ldt != 0) + if (td->td_proc->p_md.md_ldt != NULL) user_ldt_free(td); - else - mtx_unlock(&dt_lock); } void Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Fri Oct 20 03:13:31 2017 (r324784) +++ head/sys/amd64/ia32/ia32_signal.c Fri Oct 20 03:30:02 2017 (r324785) @@ -937,12 +937,9 @@ ia32_setregs(struct thread *td, struct image_params *i { struct trapframe *regs = td->td_frame; struct pcb *pcb = td->td_pcb; - - mtx_lock(&dt_lock); + if (td->td_proc->p_md.md_ldt != NULL) user_ldt_free(td); - else - mtx_unlock(&dt_lock); #ifdef COMPAT_43 setup_lcall_gate(); #endif Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Fri Oct 20 03:13:31 2017 (r324784) +++ head/sys/amd64/linux/linux_sysvec.c Fri Oct 20 03:30:02 2017 (r324785) @@ -453,11 +453,8 @@ linux_exec_setregs(struct thread *td, struct image_par struct trapframe *regs = td->td_frame; struct pcb *pcb = td->td_pcb; - mtx_lock(&dt_lock); if (td->td_proc->p_md.md_ldt != NULL) user_ldt_free(td); - else - mtx_unlock(&dt_lock); pcb->pcb_fsbase = 0; pcb->pcb_gsbase = 0; Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Fri Oct 20 03:13:31 2017 (r324784) +++ head/sys/amd64/linux32/linux32_sysvec.c Fri Oct 20 03:30:02 2017 (r324785) @@ -804,11 +804,8 @@ exec_linux_setregs(struct thread *td, struct image_par struct trapframe *regs = td->td_frame; struct pcb *pcb = td->td_pcb; - mtx_lock(&dt_lock); if (td->td_proc->p_md.md_ldt != NULL) user_ldt_free(td); - else - mtx_unlock(&dt_lock); critical_enter(); wrmsr(MSR_FSBASE, 0); From owner-svn-src-head@freebsd.org Fri Oct 20 03:31:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D254E4E7CA; Fri, 20 Oct 2017 03:31:24 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AC2465B40; Fri, 20 Oct 2017 03:31:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K3VNEV013552; Fri, 20 Oct 2017 03:31:23 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K3VN2q013551; Fri, 20 Oct 2017 03:31:23 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201710200331.v9K3VN2q013551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 20 Oct 2017 03:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324786 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 324786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 03:31:24 -0000 Author: jhibbits Date: Fri Oct 20 03:31:23 2017 New Revision: 324786 URL: https://svnweb.freebsd.org/changeset/base/324786 Log: Expand the TLB nest level mask to 3 bits to match the 32-bit mask This really doesn't change anything right now, because BOOKE_TLB_MAXNEST is only 3, which fits into the 2 bits currently used. Modified: head/sys/powerpc/booke/trap_subr.S Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Fri Oct 20 03:30:02 2017 (r324785) +++ head/sys/powerpc/booke/trap_subr.S Fri Oct 20 03:31:23 2017 (r324786) @@ -365,7 +365,7 @@ ld %r30, (TLBSAVE_BOOKE_R30)(br); \ ld %r31, (TLBSAVE_BOOKE_R31)(br); #define TLB_NEST(outr,inr) \ - rlwinm outr, inr, 7, 23, 24; /* 8 x TLBSAVE_LEN */ + rlwinm outr, inr, 7, 22, 24; /* 8 x TLBSAVE_LEN */ #else #define TLB_SAVE_REGS(br) \ stmw %r20, TLBSAVE_BOOKE_R20(br) From owner-svn-src-head@freebsd.org Fri Oct 20 03:32:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0163AE4E845; Fri, 20 Oct 2017 03:32:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C521865D5D; Fri, 20 Oct 2017 03:32:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K3WgeK016472; Fri, 20 Oct 2017 03:32:42 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K3WgGW016471; Fri, 20 Oct 2017 03:32:42 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710200332.v9K3WgGW016471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 20 Oct 2017 03:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324787 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 03:32:44 -0000 Author: mjg Date: Fri Oct 20 03:32:42 2017 New Revision: 324787 URL: https://svnweb.freebsd.org/changeset/base/324787 Log: rwlock: reduce lockstat branches in the slowpath MFC after: 1 week Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Fri Oct 20 03:31:23 2017 (r324786) +++ head/sys/kern/kern_rwlock.c Fri Oct 20 03:32:42 2017 (r324787) @@ -847,6 +847,9 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, ui int64_t sleep_time = 0; int64_t all_time = 0; #endif +#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) + int doing_lockprof; +#endif if (SCHEDULER_STOPPED()) return; @@ -875,10 +878,17 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, ui CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__, rw->lock_object.lo_name, (void *)rw->rw_lock, file, line); -#ifdef KDTRACE_HOOKS - all_time -= lockstat_nsecs(&rw->lock_object); +#ifdef LOCK_PROFILING + doing_lockprof = 1; state = v; +#elif defined(KDTRACE_HOOKS) + doing_lockprof = lockstat_enabled; + if (__predict_false(doing_lockprof)) { + all_time -= lockstat_nsecs(&rw->lock_object); + state = v; + } #endif + for (;;) { if (v == RW_UNLOCKED) { if (_rw_write_lock_fetch(rw, &v, tid)) @@ -1024,6 +1034,10 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, ui #endif v = RW_READ_VALUE(rw); } +#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) + if (__predict_true(!doing_lockprof)) + return; +#endif #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&rw->lock_object); if (sleep_time) From owner-svn-src-head@freebsd.org Fri Oct 20 03:39:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15B17E4E912; Fri, 20 Oct 2017 03:39:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8DB765F2B; Fri, 20 Oct 2017 03:38:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K3cwLg016735; Fri, 20 Oct 2017 03:38:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K3cwe1016734; Fri, 20 Oct 2017 03:38:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710200338.v9K3cwe1016734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 20 Oct 2017 03:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324788 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 03:39:00 -0000 Author: mjg Date: Fri Oct 20 03:38:58 2017 New Revision: 324788 URL: https://svnweb.freebsd.org/changeset/base/324788 Log: amd64: __exclusive_cache_line pv_chunks_mutex and pv_list_locks Note that pv_list_locks is an array and currently it fits 2 locks per line. Resizing it and/or putting more locks in different lines requires several tests. MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Oct 20 03:32:42 2017 (r324787) +++ head/sys/amd64/amd64/pmap.c Fri Oct 20 03:38:58 2017 (r324788) @@ -380,8 +380,8 @@ static int pmap_initialized; * elements, but reads are not. */ static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); -static struct mtx pv_chunks_mutex; -static struct rwlock pv_list_locks[NPV_LIST_LOCKS]; +static struct mtx __exclusive_cache_line pv_chunks_mutex; +static struct rwlock __exclusive_cache_line pv_list_locks[NPV_LIST_LOCKS]; static u_long pv_invl_gen[NPV_LIST_LOCKS]; static struct md_page *pv_table; static struct md_page pv_dummy; From owner-svn-src-head@freebsd.org Fri Oct 20 04:02:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DD3AE4EE6E; Fri, 20 Oct 2017 04:02:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5716C66A1A; Fri, 20 Oct 2017 04:02:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K42rM2029262; Fri, 20 Oct 2017 04:02:53 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K42rFP029260; Fri, 20 Oct 2017 04:02:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710200402.v9K42rFP029260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 20 Oct 2017 04:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324789 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 04:02:54 -0000 Author: mjg Date: Fri Oct 20 04:02:53 2017 New Revision: 324789 URL: https://svnweb.freebsd.org/changeset/base/324789 Log: Mark kdb_active as __read_frequently and switch to bool to eat less space. Modified: head/sys/kern/subr_kdb.c head/sys/sys/kdb.h Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Fri Oct 20 03:38:58 2017 (r324788) +++ head/sys/kern/subr_kdb.c Fri Oct 20 04:02:53 2017 (r324789) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #endif -int kdb_active = 0; +bool __read_frequently kdb_active = 0; static void *kdb_jmpbufp = NULL; struct kdb_dbbe *kdb_dbbe = NULL; static struct pcb kdb_pcb; Modified: head/sys/sys/kdb.h ============================================================================== --- head/sys/sys/kdb.h Fri Oct 20 03:38:58 2017 (r324788) +++ head/sys/sys/kdb.h Fri Oct 20 04:02:53 2017 (r324789) @@ -59,7 +59,7 @@ struct kdb_dbbe { }; \ DATA_SET(kdb_dbbe_set, name##_dbbe) -extern int kdb_active; /* Non-zero while in debugger. */ +extern bool kdb_active; /* Non-zero while in debugger. */ extern int debugger_on_panic; /* enter the debugger on panic. */ extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */ extern struct trapframe *kdb_frame; /* Frame to kdb_trap(). */ From owner-svn-src-head@freebsd.org Fri Oct 20 08:20:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93A78E52914; Fri, 20 Oct 2017 08:20:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A1AB6CFDF; Fri, 20 Oct 2017 08:20:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K8KGhV032647; Fri, 20 Oct 2017 08:20:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K8KF0J032638; Fri, 20 Oct 2017 08:20:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710200820.v9K8KF0J032638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 Oct 2017 08:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324792 - in head/sys: dev/cxgbe/iw_cxgbe dev/mlx4/mlx4_ib dev/mlx5/mlx5_ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca ofed/include/rdma X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: dev/cxgbe/iw_cxgbe dev/mlx4/mlx4_ib dev/mlx5/mlx5_ib ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca ofed/include/rdma X-SVN-Commit-Revision: 324792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 08:20:17 -0000 Author: hselasky Date: Fri Oct 20 08:20:15 2017 New Revision: 324792 URL: https://svnweb.freebsd.org/changeset/base/324792 Log: The remote DMA TCP portspace selector, RDMA_PS_TCP, is used for both iWarp and RoCE in ibcore. The selection of RDMA_PS_TCP can not be used to indicate iWarp protocol use. Backport the proper IB device capabilities from Linux upstream to distinguish between iWarp and RoCE. Only allocate the additional socket required for iWarp for RDMA IDs when at least one iWarp device present. This resolves interopability issues between iWarp and RoCE in ibcore Reviewed by: np @ Differential Revision: https://reviews.freebsd.org/D12563 Sponsored by: Mellanox Technologies MFC after: 3 days Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c head/sys/ofed/drivers/infiniband/core/cma.c head/sys/ofed/drivers/infiniband/core/device.c head/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c head/sys/ofed/include/rdma/ib_mad.h head/sys/ofed/include/rdma/ib_verbs.h Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/provider.c Fri Oct 20 07:42:00 2017 (r324791) +++ head/sys/dev/cxgbe/iw_cxgbe/provider.c Fri Oct 20 08:20:15 2017 (r324792) @@ -388,6 +388,24 @@ c4iw_query_port(struct ib_device *ibdev, u8 port, stru return 0; } +static int c4iw_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + int err; + + immutable->core_cap_flags = RDMA_CORE_PORT_IWARP; + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + + return 0; +} + /* * Returns -errno on error. */ @@ -471,6 +489,7 @@ c4iw_register_device(struct c4iw_dev *dev) ibdev->post_send = c4iw_post_send; ibdev->post_recv = c4iw_post_receive; ibdev->uverbs_abi_ver = C4IW_UVERBS_ABI_VERSION; + ibdev->get_port_immutable = c4iw_port_immutable; iwcm = kmalloc(sizeof(*iwcm), GFP_KERNEL); if (iwcm == NULL) Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Fri Oct 20 07:42:00 2017 (r324791) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Fri Oct 20 08:20:15 2017 (r324792) @@ -2229,6 +2229,38 @@ static int mlx4_ib_dev_idx(struct mlx4_dev *dev) return -1; } +static int mlx4_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + struct mlx4_ib_dev *mdev = to_mdev(ibdev); + int err; + + if (mlx4_ib_port_link_layer(ibdev, port_num) == IB_LINK_LAYER_INFINIBAND) { + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_IB; + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + } else { + if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_IBOE) + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE; + if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ROCEV2) + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE | + RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP; + immutable->core_cap_flags |= RDMA_CORE_PORT_RAW_PACKET; + if (immutable->core_cap_flags & (RDMA_CORE_PORT_IBA_ROCE | + RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP)) + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + } + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + + return 0; +} + static void *mlx4_ib_add(struct mlx4_dev *dev) { struct mlx4_ib_dev *ibdev; @@ -2360,6 +2392,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) ibdev->ib_dev.attach_mcast = mlx4_ib_mcg_attach; ibdev->ib_dev.detach_mcast = mlx4_ib_mcg_detach; ibdev->ib_dev.process_mad = mlx4_ib_process_mad; + ibdev->ib_dev.get_port_immutable = mlx4_port_immutable; ibdev->ib_dev.get_netdev = mlx4_ib_get_netdev; ibdev->ib_dev.ioctl = mlx4_ib_ioctl; ibdev->ib_dev.query_values = mlx4_ib_query_values; Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Fri Oct 20 07:42:00 2017 (r324791) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Fri Oct 20 08:20:15 2017 (r324792) @@ -1670,6 +1670,57 @@ static void destroy_dev_resources(struct mlx5_ib_resou mlx5_ib_dealloc_pd(devr->p0); } +static u32 get_core_cap_flags(struct ib_device *ibdev) +{ + struct mlx5_ib_dev *dev = to_mdev(ibdev); + enum rdma_link_layer ll = mlx5_ib_port_link_layer(ibdev, 1); + u8 l3_type_cap = MLX5_CAP_ROCE(dev->mdev, l3_type); + u8 roce_version_cap = MLX5_CAP_ROCE(dev->mdev, roce_version); + u32 ret = 0; + + if (ll == IB_LINK_LAYER_INFINIBAND) + return RDMA_CORE_PORT_IBA_IB; + + ret = RDMA_CORE_PORT_RAW_PACKET; + + if (!(l3_type_cap & MLX5_ROCE_L3_TYPE_IPV4_CAP)) + return ret; + + if (!(l3_type_cap & MLX5_ROCE_L3_TYPE_IPV6_CAP)) + return ret; + + if (roce_version_cap & MLX5_ROCE_VERSION_1_CAP) + ret |= RDMA_CORE_PORT_IBA_ROCE; + + if (roce_version_cap & MLX5_ROCE_VERSION_2_CAP) + ret |= RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP; + + return ret; +} + +static int mlx5_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + struct mlx5_ib_dev *dev = to_mdev(ibdev); + enum rdma_link_layer ll = mlx5_ib_port_link_layer(ibdev, port_num); + int err; + + immutable->core_cap_flags = get_core_cap_flags(ibdev); + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + immutable->core_cap_flags = get_core_cap_flags(ibdev); + if ((ll == IB_LINK_LAYER_INFINIBAND) || MLX5_CAP_GEN(dev->mdev, roce)) + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + + return 0; +} + static void enable_dc_tracer(struct mlx5_ib_dev *dev) { struct device *device = dev->ib_dev.dma_device; @@ -2115,6 +2166,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) dev->ib_dev.attach_mcast = mlx5_ib_mcg_attach; dev->ib_dev.detach_mcast = mlx5_ib_mcg_detach; dev->ib_dev.process_mad = mlx5_ib_process_mad; + dev->ib_dev.get_port_immutable = mlx5_port_immutable; dev->ib_dev.alloc_fast_reg_mr = mlx5_ib_alloc_fast_reg_mr; dev->ib_dev.alloc_fast_reg_page_list = mlx5_ib_alloc_fast_reg_page_list; dev->ib_dev.free_fast_reg_page_list = mlx5_ib_free_fast_reg_page_list; Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Fri Oct 20 07:42:00 2017 (r324791) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c Fri Oct 20 08:20:15 2017 (r324792) @@ -1576,7 +1576,7 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, cons int gid_type; if ((ll == IB_LINK_LAYER_ETHERNET) || (ah->ah_flags & IB_AH_GRH)) { - int len = dev->ib_dev.gid_tbl_len[port - 1]; + int len = dev->mdev->port_caps[port - 1].gid_table_len; if (ah->grh.sgid_index >= len) { printf("mlx5_ib: ERR: ""sgid_index (%u) too large. max is %d\n", ah->grh.sgid_index, len - 1); return -EINVAL; Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Fri Oct 20 07:42:00 2017 (r324791) +++ head/sys/ofed/drivers/infiniband/core/cma.c Fri Oct 20 08:20:15 2017 (r324792) @@ -75,11 +75,6 @@ static int def_prec2sl = 3; module_param_named(def_prec2sl, def_prec2sl, int, 0644); MODULE_PARM_DESC(def_prec2sl, "Default value for SL priority with RoCE. Valid values 0 - 7"); -static int unify_tcp_port_space = 1; -module_param(unify_tcp_port_space, int, 0644); -MODULE_PARM_DESC(unify_tcp_port_space, "Unify the host TCP and RDMA port " - "space allocation (default=1)"); - static int debug_level = 0; #define cma_pr(level, priv, format, arg...) \ printk(level "CMA: %p: %s: " format, ((struct rdma_id_priv *) priv) , __func__, ## arg) @@ -198,6 +193,7 @@ struct rdma_id_private { /* cache for mc record params */ struct ib_sa_mcmember_rec rec; int is_valid_rec; + int unify_ps_tcp; }; struct cma_multicast { @@ -822,29 +818,24 @@ int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib int ret = 0; id_priv = container_of(id, struct rdma_id_private, id); - switch (rdma_node_get_transport(id_priv->id.device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (!id_priv->cm_id.ib || (id_priv->id.qp_type == IB_QPT_UD)) ret = cma_ib_init_qp_attr(id_priv, qp_attr, qp_attr_mask); else ret = ib_cm_init_qp_attr(id_priv->cm_id.ib, qp_attr, qp_attr_mask); + if (qp_attr->qp_state == IB_QPS_RTR) qp_attr->rq_psn = id_priv->seq_num; - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) { if (!id_priv->cm_id.iw) { qp_attr->qp_access_flags = 0; *qp_attr_mask = IB_QP_STATE | IB_QP_ACCESS_FLAGS; } else ret = iw_cm_init_qp_attr(id_priv->cm_id.iw, qp_attr, qp_attr_mask); - break; - default: + } else ret = -ENOSYS; - break; - } return ret; } @@ -1105,6 +1096,10 @@ static void __rdma_free(struct work_struct *work) if (id_priv->internal_id) cma_deref_id(id_priv->id.context); + if (id_priv->sock != NULL && !id_priv->internal_id && + !id_priv->unify_ps_tcp) + sock_release(id_priv->sock); + kfree(id_priv->id.route.path_rec); kfree(id_priv); } @@ -1128,8 +1123,7 @@ void rdma_destroy_id(struct rdma_cm_id *id) mutex_unlock(&id_priv->handler_mutex); if (id_priv->cma_dev) { - switch (rdma_node_get_transport(id_priv->id.device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id_priv->id.device, 1)) { spin_lock_irqsave(&id_priv->cm_lock, flags); if (id_priv->cm_id.ib && !IS_ERR(id_priv->cm_id.ib)) { ib = id_priv->cm_id.ib; @@ -1138,14 +1132,9 @@ void rdma_destroy_id(struct rdma_cm_id *id) ib_destroy_cm_id(ib); } else spin_unlock_irqrestore(&id_priv->cm_lock, flags); - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id_priv->id.device, 1)) { if (id_priv->cm_id.iw) iw_destroy_cm_id(id_priv->cm_id.iw); - break; - default: - break; } cma_leave_mc_groups(id_priv); cma_release_dev(id_priv); @@ -2141,27 +2130,15 @@ int rdma_resolve_route(struct rdma_cm_id *id, int time return -EINVAL; atomic_inc(&id_priv->refcount); - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: - switch (rdma_port_get_link_layer(id->device, id->port_num)) { - case IB_LINK_LAYER_INFINIBAND: - ret = cma_resolve_ib_route(id_priv, timeout_ms); - break; - case IB_LINK_LAYER_ETHERNET: - ret = cma_resolve_iboe_route(id_priv); - break; - default: - ret = -ENOSYS; - } - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + if (rdma_cap_ib_sa(id->device, id->port_num)) + ret = cma_resolve_ib_route(id_priv, timeout_ms); + else if (rdma_protocol_roce(id->device, id->port_num)) + ret = cma_resolve_iboe_route(id_priv); + else if (rdma_protocol_iwarp(id->device, id->port_num)) ret = cma_resolve_iw_route(id_priv, timeout_ms); - break; - default: + else ret = -ENOSYS; - break; - } + if (ret) goto err; @@ -2608,6 +2585,10 @@ static int cma_get_tcp_port(struct rdma_id_private *id (struct sockaddr *) &id_priv->id.route.addr.src_addr, ip_addr_size((struct sockaddr *) &id_priv->id.route.addr.src_addr)); #else + SOCK_LOCK(sock); + sock->so_options |= SO_REUSEADDR; + SOCK_UNLOCK(sock); + ret = -sobind(sock, (struct sockaddr *)&id_priv->id.route.addr.src_addr, curthread); @@ -2632,6 +2613,7 @@ static int cma_get_tcp_port(struct rdma_id_private *id static int cma_get_port(struct rdma_id_private *id_priv) { + struct cma_device *cma_dev; struct idr *ps; int ret; @@ -2641,7 +2623,18 @@ static int cma_get_port(struct rdma_id_private *id_pri break; case RDMA_PS_TCP: ps = &tcp_ps; - if (unify_tcp_port_space) { + + mutex_lock(&lock); + /* check if there are any iWarp IB devices present */ + list_for_each_entry(cma_dev, &dev_list, list) { + if (rdma_protocol_iwarp(cma_dev->device, 1)) { + id_priv->unify_ps_tcp = 1; + break; + } + } + mutex_unlock(&lock); + + if (id_priv->unify_ps_tcp) { ret = cma_get_tcp_port(id_priv); if (ret) goto out; @@ -2713,19 +2706,15 @@ int rdma_listen(struct rdma_cm_id *id, int backlog) id_priv->backlog = backlog; if (id->device) { - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, 1)) { ret = cma_ib_listen(id_priv); if (ret) goto err; - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, 1)) { ret = cma_iw_listen(id_priv, backlog); if (ret) goto err; - break; - default: + } else { ret = -ENOSYS; goto err; } @@ -3094,21 +3083,15 @@ int rdma_connect(struct rdma_cm_id *id, struct rdma_co id_priv->srq = conn_param->srq; } - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (id->qp_type == IB_QPT_UD) ret = cma_resolve_ib_udp(id_priv, conn_param); else ret = cma_connect_ib(id_priv, conn_param); - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) ret = cma_connect_iw(id_priv, conn_param); - break; - default: + else ret = -ENOSYS; - break; - } if (ret) goto err; @@ -3214,8 +3197,7 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_con id_priv->srq = conn_param->srq; } - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (id->qp_type == IB_QPT_UD) { if (conn_param) ret = cma_send_sidr_rep(id_priv, IB_SIDR_SUCCESS, @@ -3230,15 +3212,10 @@ int rdma_accept(struct rdma_cm_id *id, struct rdma_con else ret = cma_rep_recv(id_priv); } - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) ret = cma_accept_iw(id_priv, conn_param); - break; - default: + else ret = -ENOSYS; - break; - } if (ret) goto reject; @@ -3282,8 +3259,7 @@ int rdma_reject(struct rdma_cm_id *id, const void *pri if (!id_priv->cm_id.ib) return -EINVAL; - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { if (id->qp_type == IB_QPT_UD) ret = cma_send_sidr_rep(id_priv, IB_SIDR_REJECT, private_data, private_data_len); @@ -3293,16 +3269,12 @@ int rdma_reject(struct rdma_cm_id *id, const void *pri IB_CM_REJ_CONSUMER_DEFINED, NULL, 0, private_data, private_data_len); } - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) { ret = iw_cm_reject(id_priv->cm_id.iw, private_data, private_data_len); - break; - default: + } else ret = -ENOSYS; - break; - } + return ret; } EXPORT_SYMBOL(rdma_reject); @@ -3316,8 +3288,7 @@ int rdma_disconnect(struct rdma_cm_id *id) if (!id_priv->cm_id.ib) return -EINVAL; - switch (rdma_node_get_transport(id->device->node_type)) { - case RDMA_TRANSPORT_IB: + if (rdma_cap_ib_cm(id->device, id->port_num)) { ret = cma_modify_qp_err(id_priv); if (ret) goto out; @@ -3327,15 +3298,11 @@ int rdma_disconnect(struct rdma_cm_id *id) cma_dbg(id_priv, "sending DREP\n"); ib_send_cm_drep(id_priv->cm_id.ib, NULL, 0); } - break; - case RDMA_TRANSPORT_IWARP: - case RDMA_TRANSPORT_SCIF: + } else if (rdma_cap_iw_cm(id->device, id->port_num)) { ret = iw_cm_disconnect(id_priv->cm_id.iw, 0); - break; - default: + } else ret = -EINVAL; - break; - } + out: return ret; } Modified: head/sys/ofed/drivers/infiniband/core/device.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/device.c Fri Oct 20 07:42:00 2017 (r324791) +++ head/sys/ofed/drivers/infiniband/core/device.c Fri Oct 20 08:20:15 2017 (r324792) @@ -90,7 +90,8 @@ static int ib_device_check_mandatory(struct ib_device IB_MANDATORY_FUNC(poll_cq), IB_MANDATORY_FUNC(req_notify_cq), IB_MANDATORY_FUNC(get_dma_mr), - IB_MANDATORY_FUNC(dereg_mr) + IB_MANDATORY_FUNC(dereg_mr), + IB_MANDATORY_FUNC(get_port_immutable) }; int i; @@ -149,13 +150,13 @@ static int alloc_name(char *name) return 0; } -static int start_port(struct ib_device *device) +static int rdma_start_port(struct ib_device *device) { return (device->node_type == RDMA_NODE_IB_SWITCH) ? 0 : 1; } -static int end_port(struct ib_device *device) +static int rdma_end_port(struct ib_device *device) { return (device->node_type == RDMA_NODE_IB_SWITCH) ? 0 : device->phys_port_cnt; @@ -193,6 +194,7 @@ EXPORT_SYMBOL(ib_alloc_device); void ib_dealloc_device(struct ib_device *device) { if (device->reg_state == IB_DEV_UNINITIALIZED) { + kfree(device->port_immutable); kfree(device); return; } @@ -225,43 +227,42 @@ static int add_client_context(struct ib_device *device return 0; } -static int read_port_table_lengths(struct ib_device *device) +static int verify_immutable(const struct ib_device *dev, u8 port) { - struct ib_port_attr *tprops = NULL; - int num_ports, ret = -ENOMEM; - u8 port_index; + return WARN_ON(!rdma_cap_ib_mad(dev, port) && + rdma_max_mad_size(dev, port) != 0); +} - tprops = kmalloc(sizeof *tprops, GFP_KERNEL); - if (!tprops) - goto out; +static int read_port_immutable(struct ib_device *device) +{ + int ret; + u8 start_port = rdma_start_port(device); + u8 end_port = rdma_end_port(device); + u8 port; - num_ports = end_port(device) - start_port(device) + 1; + /** + * device->port_immutable is indexed directly by the port number to make + * access to this data as efficient as possible. + * + * Therefore port_immutable is declared as a 1 based array with + * potential empty slots at the beginning. + */ + device->port_immutable = kzalloc(sizeof(*device->port_immutable) + * (end_port + 1), + GFP_KERNEL); + if (!device->port_immutable) + return -ENOMEM; - device->pkey_tbl_len = kmalloc(sizeof *device->pkey_tbl_len * num_ports, - GFP_KERNEL); - device->gid_tbl_len = kmalloc(sizeof *device->gid_tbl_len * num_ports, - GFP_KERNEL); - if (!device->pkey_tbl_len || !device->gid_tbl_len) - goto err; - - for (port_index = 0; port_index < num_ports; ++port_index) { - ret = ib_query_port(device, port_index + start_port(device), - tprops); + for (port = start_port; port <= end_port; ++port) { + ret = device->get_port_immutable(device, port, + &device->port_immutable[port]); if (ret) - goto err; - device->pkey_tbl_len[port_index] = tprops->pkey_tbl_len; - device->gid_tbl_len[port_index] = tprops->gid_tbl_len; - } + return ret; - ret = 0; - goto out; - -err: - kfree(device->gid_tbl_len); - kfree(device->pkey_tbl_len); -out: - kfree(tprops); - return ret; + if (verify_immutable(device, port)) + return -EINVAL; + } + return 0; } /** @@ -297,10 +298,11 @@ int ib_register_device(struct ib_device *device, spin_lock_init(&device->event_handler_lock); spin_lock_init(&device->client_data_lock); - ret = read_port_table_lengths(device); + + ret = read_port_immutable(device); if (ret) { - printk(KERN_WARNING "Couldn't create table lengths cache for device %s\n", - device->name); + printk(KERN_WARNING "Couldn't create per port immutable data %s\n", + device->name); goto out; } @@ -308,8 +310,7 @@ int ib_register_device(struct ib_device *device, if (ret) { printk(KERN_WARNING "Couldn't register device %s with driver model\n", device->name); - kfree(device->gid_tbl_len); - kfree(device->pkey_tbl_len); + kfree(device->port_immutable); goto out; } @@ -351,9 +352,6 @@ void ib_unregister_device(struct ib_device *device) list_del(&device->core_list); - kfree(device->gid_tbl_len); - kfree(device->pkey_tbl_len); - mutex_unlock(&device_mutex); ib_device_unregister_sysfs(device); @@ -578,7 +576,7 @@ int ib_query_port(struct ib_device *device, u8 port_num, struct ib_port_attr *port_attr) { - if (port_num < start_port(device) || port_num > end_port(device)) + if (port_num < rdma_start_port(device) || port_num > rdma_end_port(device)) return -EINVAL; return device->query_port(device, port_num, port_attr); @@ -656,7 +654,7 @@ int ib_modify_port(struct ib_device *device, if (!device->modify_port) return -ENOSYS; - if (port_num < start_port(device) || port_num > end_port(device)) + if (port_num < rdma_start_port(device) || port_num > rdma_end_port(device)) return -EINVAL; return device->modify_port(device, port_num, port_modify_mask, @@ -679,8 +677,8 @@ int ib_find_gid(struct ib_device *device, union ib_gid union ib_gid tmp_gid; int ret, port, i; - for (port = start_port(device); port <= end_port(device); ++port) { - for (i = 0; i < device->gid_tbl_len[port - start_port(device)]; ++i) { + for (port = rdma_start_port(device); port <= rdma_end_port(device); ++port) { + for (i = 0; i < device->port_immutable[port].gid_tbl_len; ++i) { ret = ib_query_gid(device, port, i, &tmp_gid); if (ret) return ret; @@ -712,7 +710,7 @@ int ib_find_pkey(struct ib_device *device, u16 tmp_pkey; int partial_ix = -1; - for (i = 0; i < device->pkey_tbl_len[port_num - start_port(device)]; ++i) { + for (i = 0; i < device->port_immutable[port_num].pkey_tbl_len; ++i) { ret = ib_query_pkey(device, port_num, i, &tmp_pkey); if (ret) return ret; Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c ============================================================================== --- head/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c Fri Oct 20 07:42:00 2017 (r324791) +++ head/sys/ofed/drivers/infiniband/hw/mthca/mthca_provider.c Fri Oct 20 08:20:15 2017 (r324792) @@ -1297,6 +1297,25 @@ out: return err; } +static int mthca_port_immutable(struct ib_device *ibdev, u8 port_num, + struct ib_port_immutable *immutable) +{ + struct ib_port_attr attr; + int err; + + immutable->core_cap_flags = RDMA_CORE_PORT_IBA_IB; + + err = ib_query_port(ibdev, port_num, &attr); + if (err) + return err; + + immutable->pkey_tbl_len = attr.pkey_tbl_len; + immutable->gid_tbl_len = attr.gid_tbl_len; + immutable->max_mad_size = IB_MGMT_MAD_SIZE; + + return 0; +} + int mthca_register_device(struct mthca_dev *dev) { int ret; @@ -1376,6 +1395,7 @@ int mthca_register_device(struct mthca_dev *dev) dev->ib_dev.reg_phys_mr = mthca_reg_phys_mr; dev->ib_dev.reg_user_mr = mthca_reg_user_mr; dev->ib_dev.dereg_mr = mthca_dereg_mr; + dev->ib_dev.get_port_immutable = mthca_port_immutable; if (dev->mthca_flags & MTHCA_FLAG_FMR) { dev->ib_dev.alloc_fmr = mthca_alloc_fmr; Modified: head/sys/ofed/include/rdma/ib_mad.h ============================================================================== --- head/sys/ofed/include/rdma/ib_mad.h Fri Oct 20 07:42:00 2017 (r324791) +++ head/sys/ofed/include/rdma/ib_mad.h Fri Oct 20 08:20:15 2017 (r324792) @@ -134,6 +134,7 @@ enum { IB_MGMT_SA_DATA = 200, IB_MGMT_DEVICE_HDR = 64, IB_MGMT_DEVICE_DATA = 192, + IB_MGMT_MAD_SIZE = IB_MGMT_MAD_HDR + IB_MGMT_MAD_DATA, }; struct ib_mad_hdr { Modified: head/sys/ofed/include/rdma/ib_verbs.h ============================================================================== --- head/sys/ofed/include/rdma/ib_verbs.h Fri Oct 20 07:42:00 2017 (r324791) +++ head/sys/ofed/include/rdma/ib_verbs.h Fri Oct 20 08:20:15 2017 (r324792) @@ -348,6 +348,56 @@ union rdma_protocol_stats { struct iw_protocol_stats iw; }; +/* Define bits for the various functionality this port needs to be supported by + * the core. + */ +/* Management 0x00000FFF */ +#define RDMA_CORE_CAP_IB_MAD 0x00000001 +#define RDMA_CORE_CAP_IB_SMI 0x00000002 +#define RDMA_CORE_CAP_IB_CM 0x00000004 +#define RDMA_CORE_CAP_IW_CM 0x00000008 +#define RDMA_CORE_CAP_IB_SA 0x00000010 +#define RDMA_CORE_CAP_OPA_MAD 0x00000020 + +/* Address format 0x000FF000 */ +#define RDMA_CORE_CAP_AF_IB 0x00001000 +#define RDMA_CORE_CAP_ETH_AH 0x00002000 +#define RDMA_CORE_CAP_OPA_AH 0x00004000 + +/* Protocol 0xFFF00000 */ +#define RDMA_CORE_CAP_PROT_IB 0x00100000 +#define RDMA_CORE_CAP_PROT_ROCE 0x00200000 +#define RDMA_CORE_CAP_PROT_IWARP 0x00400000 +#define RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP 0x00800000 +#define RDMA_CORE_CAP_PROT_RAW_PACKET 0x01000000 +#define RDMA_CORE_CAP_PROT_USNIC 0x02000000 + +#define RDMA_CORE_PORT_IBA_IB (RDMA_CORE_CAP_PROT_IB \ + | RDMA_CORE_CAP_IB_MAD \ + | RDMA_CORE_CAP_IB_SMI \ + | RDMA_CORE_CAP_IB_CM \ + | RDMA_CORE_CAP_IB_SA \ + | RDMA_CORE_CAP_AF_IB) +#define RDMA_CORE_PORT_IBA_ROCE (RDMA_CORE_CAP_PROT_ROCE \ + | RDMA_CORE_CAP_IB_MAD \ + | RDMA_CORE_CAP_IB_CM \ + | RDMA_CORE_CAP_AF_IB \ + | RDMA_CORE_CAP_ETH_AH) +#define RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP \ + (RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP \ + | RDMA_CORE_CAP_IB_MAD \ + | RDMA_CORE_CAP_IB_CM \ + | RDMA_CORE_CAP_AF_IB \ + | RDMA_CORE_CAP_ETH_AH) +#define RDMA_CORE_PORT_IWARP (RDMA_CORE_CAP_PROT_IWARP \ + | RDMA_CORE_CAP_IW_CM) +#define RDMA_CORE_PORT_INTEL_OPA (RDMA_CORE_PORT_IBA_IB \ + | RDMA_CORE_CAP_OPA_MAD) + +#define RDMA_CORE_PORT_RAW_PACKET (RDMA_CORE_CAP_PROT_RAW_PACKET) + +#define RDMA_CORE_PORT_USNIC (RDMA_CORE_CAP_PROT_USNIC) + struct ib_port_attr { enum ib_port_state state; enum ib_mtu max_mtu; @@ -1623,6 +1673,14 @@ struct ib_dma_mapping_ops { }; struct iw_cm_verbs; + +struct ib_port_immutable { + int pkey_tbl_len; + int gid_tbl_len; + u32 core_cap_flags; + u32 max_mad_size; +}; + struct ib_exp_device_attr; struct ib_exp_qp_init_attr; @@ -1639,8 +1697,10 @@ struct ib_device { struct list_head client_data_list; struct ib_cache cache; - int *pkey_tbl_len; - int *gid_tbl_len; + /** + * port_immutable is indexed by port number + */ + struct ib_port_immutable *port_immutable; int num_comp_vectors; @@ -1845,6 +1905,15 @@ struct ib_device { u32 cmd_n; spinlock_t cmd_perf_lock; + + /** + * The following mandatory functions are used only at device + * registration. Keep functions such as these at the end of this + * structure to avoid cache line misses when accessing struct ib_device + * in fast paths. + */ + int (*get_port_immutable)(struct ib_device *, u8, struct ib_port_immutable *); + /* * Experimental data and functions */ @@ -1927,6 +1996,252 @@ int ib_query_port(struct ib_device *device, enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device, u8 port_num); + +static inline bool rdma_protocol_ib(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IB; +} + +static inline bool rdma_protocol_roce(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & + (RDMA_CORE_CAP_PROT_ROCE | RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP); +} + +static inline bool rdma_protocol_roce_udp_encap(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_ROCE_UDP_ENCAP; +} + +static inline bool rdma_protocol_roce_eth_encap(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_ROCE; +} + +static inline bool rdma_protocol_iwarp(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_PROT_IWARP; +} + +static inline bool rdma_ib_or_roce(const struct ib_device *device, u8 port_num) +{ + return rdma_protocol_ib(device, port_num) || + rdma_protocol_roce(device, port_num); +} + +/** + * rdma_cap_ib_mad - Check if the port of a device supports Infiniband + * Management Datagrams. + * @device: Device to check + * @port_num: Port number to check + * + * Management Datagrams (MAD) are a required part of the InfiniBand + * specification and are supported on all InfiniBand devices. A slightly + * extended version are also supported on OPA interfaces. + * + * Return: true if the port supports sending/receiving of MAD packets. + */ +static inline bool rdma_cap_ib_mad(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_MAD; +} + +/** + * rdma_cap_opa_mad - Check if the port of device provides support for OPA + * Management Datagrams. + * @device: Device to check + * @port_num: Port number to check + * + * Intel OmniPath devices extend and/or replace the InfiniBand Management + * datagrams with their own versions. These OPA MADs share many but not all of + * the characteristics of InfiniBand MADs. + * + * OPA MADs differ in the following ways: + * + * 1) MADs are variable size up to 2K + * IBTA defined MADs remain fixed at 256 bytes + * 2) OPA SMPs must carry valid PKeys + * 3) OPA SMP packets are a different format + * + * Return: true if the port supports OPA MAD packet formats. + */ +static inline bool rdma_cap_opa_mad(struct ib_device *device, u8 port_num) +{ + return (device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_OPA_MAD) + == RDMA_CORE_CAP_OPA_MAD; +} + +/** + * rdma_cap_ib_smi - Check if the port of a device provides an Infiniband + * Subnet Management Agent (SMA) on the Subnet Management Interface (SMI). + * @device: Device to check + * @port_num: Port number to check + * + * Each InfiniBand node is required to provide a Subnet Management Agent + * that the subnet manager can access. Prior to the fabric being fully + * configured by the subnet manager, the SMA is accessed via a well known + * interface called the Subnet Management Interface (SMI). This interface + * uses directed route packets to communicate with the SM to get around the + * chicken and egg problem of the SM needing to know what's on the fabric + * in order to configure the fabric, and needing to configure the fabric in + * order to send packets to the devices on the fabric. These directed + * route packets do not need the fabric fully configured in order to reach + * their destination. The SMI is the only method allowed to send + * directed route packets on an InfiniBand fabric. + * + * Return: true if the port provides an SMI. + */ +static inline bool rdma_cap_ib_smi(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_SMI; +} + +/** + * rdma_cap_ib_cm - Check if the port of device has the capability Infiniband + * Communication Manager. + * @device: Device to check + * @port_num: Port number to check + * + * The InfiniBand Communication Manager is one of many pre-defined General + * Service Agents (GSA) that are accessed via the General Service + * Interface (GSI). It's role is to facilitate establishment of connections + * between nodes as well as other management related tasks for established + * connections. + * + * Return: true if the port supports an IB CM (this does not guarantee that + * a CM is actually running however). + */ +static inline bool rdma_cap_ib_cm(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_CM; +} + +/** + * rdma_cap_iw_cm - Check if the port of device has the capability IWARP + * Communication Manager. + * @device: Device to check + * @port_num: Port number to check + * + * Similar to above, but specific to iWARP connections which have a different + * managment protocol than InfiniBand. + * + * Return: true if the port supports an iWARP CM (this does not guarantee that + * a CM is actually running however). + */ +static inline bool rdma_cap_iw_cm(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IW_CM; +} + +/** + * rdma_cap_ib_sa - Check if the port of device has the capability Infiniband + * Subnet Administration. + * @device: Device to check + * @port_num: Port number to check + * + * An InfiniBand Subnet Administration (SA) service is a pre-defined General + * Service Agent (GSA) provided by the Subnet Manager (SM). On InfiniBand + * fabrics, devices should resolve routes to other hosts by contacting the + * SA to query the proper route. + * + * Return: true if the port should act as a client to the fabric Subnet + * Administration interface. This does not imply that the SA service is + * running locally. + */ +static inline bool rdma_cap_ib_sa(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_IB_SA; +} + +/** + * rdma_cap_ib_mcast - Check if the port of device has the capability Infiniband + * Multicast. + * @device: Device to check + * @port_num: Port number to check + * + * InfiniBand multicast registration is more complex than normal IPv4 or + * IPv6 multicast registration. Each Host Channel Adapter must register + * with the Subnet Manager when it wishes to join a multicast group. It + * should do so only once regardless of how many queue pairs it subscribes + * to this group. And it should leave the group only after all queue pairs + * attached to the group have been detached. + * + * Return: true if the port must undertake the additional adminstrative + * overhead of registering/unregistering with the SM and tracking of the + * total number of queue pairs attached to the multicast group. + */ +static inline bool rdma_cap_ib_mcast(const struct ib_device *device, u8 port_num) +{ + return rdma_cap_ib_sa(device, port_num); +} + +/** + * rdma_cap_af_ib - Check if the port of device has the capability + * Native Infiniband Address. + * @device: Device to check + * @port_num: Port number to check + * + * InfiniBand addressing uses a port's GUID + Subnet Prefix to make a default + * GID. RoCE uses a different mechanism, but still generates a GID via + * a prescribed mechanism and port specific data. + * + * Return: true if the port uses a GID address to identify devices on the + * network. + */ +static inline bool rdma_cap_af_ib(const struct ib_device *device, u8 port_num) +{ + return device->port_immutable[port_num].core_cap_flags & RDMA_CORE_CAP_AF_IB; +} + +/** + * rdma_cap_eth_ah - Check if the port of device has the capability *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Oct 20 08:25:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26800E52B33; Fri, 20 Oct 2017 08:25:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD6A96D416; Fri, 20 Oct 2017 08:25:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K8Po3N036641; Fri, 20 Oct 2017 08:25:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K8PoYa036640; Fri, 20 Oct 2017 08:25:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710200825.v9K8PoYa036640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 Oct 2017 08:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324793 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 08:25:51 -0000 Author: kib Date: Fri Oct 20 08:25:49 2017 New Revision: 324793 URL: https://svnweb.freebsd.org/changeset/base/324793 Log: In vm_page_free_phys_pglist(), do not take vm_page_queue_free_mtx if there is nothing to do. Suggested by: mjg Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Oct 20 08:20:15 2017 (r324792) +++ head/sys/vm/vm_page.c Fri Oct 20 08:25:49 2017 (r324793) @@ -2857,6 +2857,8 @@ vm_page_free_phys_pglist(struct pglist *tq) { vm_page_t m; + if (TAILQ_EMPTY(tq)) + return; mtx_lock(&vm_page_queue_free_mtx); TAILQ_FOREACH(m, tq, listq) vm_page_free_phys(m); From owner-svn-src-head@freebsd.org Fri Oct 20 08:32:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D71BE52DF1; Fri, 20 Oct 2017 08:32:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 399206DA01; Fri, 20 Oct 2017 08:32:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K8WbVN040501; Fri, 20 Oct 2017 08:32:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K8WbB8040500; Fri, 20 Oct 2017 08:32:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710200832.v9K8WbB8040500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 Oct 2017 08:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324794 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 08:32:38 -0000 Author: kib Date: Fri Oct 20 08:32:37 2017 New Revision: 324794 URL: https://svnweb.freebsd.org/changeset/base/324794 Log: Do not overwrite clean blocks on pageout. If filesystem block size is less than the page size, it is possible that the page-out run contains partially clean pages. E.g., the chunk of the page might be bdwrite()-ed, or some thread performed bwrite() on a buffer which references a chunk of the paged out page. As result, the assertion added in r319975, which checked that all pages in the run are dirty, does not hold on such filesystems. One solution is to remove the assert, but it is undesirable, because we do overwrite the valid on-disk content. I cannot provide a scenario where such write would corrupt the file data, but I do not like it on principle. Another, in my opinion proper, solution is to only write parts of the pages still marked dirty. The patch implements this, it skips clean blocks and only writes the dirty block runs. Note that due to clustering, write one page might clean other pages in the run, so the next write range must be calculated only after the current range is written out. More, due to a possible invalidation, and the fact that the object lock is dropped and reacquired before the checks, it is possible that the whole page-out pages run appears to consist of only clean pages. For this reason, it is impossible to assert that there is some work for the pageout method to do (i.e. assert that there is at least one dirty page in the run). But such clearing can only occur due to invalidation, and not due to a parallel write, because we own the vnode lock exclusive. Reported by: fsu In collaboration with: pho Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D12668 Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Fri Oct 20 08:25:49 2017 (r324793) +++ head/sys/vm/vnode_pager.c Fri Oct 20 08:32:37 2017 (r324794) @@ -1179,7 +1179,24 @@ vnode_pager_putpages(vm_object_t object, vm_page_t *m, VM_OBJECT_WLOCK(object); } +static int +vn_off2bidx(vm_ooffset_t offset) +{ + return ((offset & PAGE_MASK) / DEV_BSIZE); +} + +static bool +vn_dirty_blk(vm_page_t m, vm_ooffset_t offset) +{ + + KASSERT(IDX_TO_OFF(m->pindex) <= offset && + offset < IDX_TO_OFF(m->pindex + 1), + ("page %p pidx %ju offset %ju", m, (uintmax_t)m->pindex, + (uintmax_t)offset)); + return ((m->dirty & ((vm_page_bits_t)1 << vn_off2bidx(offset))) != 0); +} + /* * This is now called from local media FS's to operate against their * own vnodes if they fail to implement VOP_PUTPAGES. @@ -1195,10 +1212,12 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page { vm_object_t object; vm_page_t m; - vm_ooffset_t poffset; + vm_ooffset_t maxblksz, next_offset, poffset, prev_offset; struct uio auio; struct iovec aiov; + off_t prev_resid, wrsz; int count, error, i, maxsize, ncount, pgoff, ppscheck; + bool in_hole; static struct timeval lastfail; static int curfail; @@ -1260,34 +1279,102 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page for (i = ncount; i < count; i++) rtvals[i] = VM_PAGER_BAD; } - for (i = 0; i < ncount - ((btoc(maxsize) & PAGE_MASK) != 0); i++) - MPASS(ma[i]->dirty == VM_PAGE_BITS_ALL); - VM_OBJECT_WUNLOCK(object); - aiov.iov_base = NULL; - aiov.iov_len = maxsize; auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_offset = poffset; auio.uio_segflg = UIO_NOCOPY; auio.uio_rw = UIO_WRITE; - auio.uio_resid = maxsize; auio.uio_td = NULL; - error = VOP_WRITE(vp, &auio, vnode_pager_putpages_ioflags(flags), - curthread->td_ucred); - VM_CNT_INC(v_vnodeout); - VM_CNT_ADD(v_vnodepgsout, ncount); + maxblksz = roundup2(poffset + maxsize, DEV_BSIZE); - ppscheck = 0; - if (error != 0 && (ppscheck = ppsratecheck(&lastfail, &curfail, 1)) - != 0) - printf("vnode_pager_putpages: I/O error %d\n", error); - if (auio.uio_resid != 0 && (ppscheck != 0 || - ppsratecheck(&lastfail, &curfail, 1) != 0)) - printf("vnode_pager_putpages: residual I/O %zd at %ju\n", - auio.uio_resid, (uintmax_t)ma[0]->pindex); - for (i = 0; i < ncount; i++) + for (prev_offset = poffset; prev_offset < maxblksz;) { + /* Skip clean blocks. */ + for (in_hole = true; in_hole && prev_offset < maxblksz;) { + m = ma[OFF_TO_IDX(prev_offset - poffset)]; + for (i = vn_off2bidx(prev_offset); + i < sizeof(vm_page_bits_t) * NBBY && + prev_offset < maxblksz; i++) { + if (vn_dirty_blk(m, prev_offset)) { + in_hole = false; + break; + } + prev_offset += DEV_BSIZE; + } + } + if (in_hole) + goto write_done; + + /* Find longest run of dirty blocks. */ + for (next_offset = prev_offset; next_offset < maxblksz;) { + m = ma[OFF_TO_IDX(next_offset - poffset)]; + for (i = vn_off2bidx(next_offset); + i < sizeof(vm_page_bits_t) * NBBY && + next_offset < maxblksz; i++) { + if (!vn_dirty_blk(m, next_offset)) + goto start_write; + next_offset += DEV_BSIZE; + } + } +start_write: + if (next_offset > poffset + maxsize) + next_offset = poffset + maxsize; + + /* + * Getting here requires finding a dirty block in the + * 'skip clean blocks' loop. + */ + MPASS(prev_offset < next_offset); + + VM_OBJECT_WUNLOCK(object); + aiov.iov_base = NULL; + auio.uio_iovcnt = 1; + auio.uio_offset = prev_offset; + prev_resid = auio.uio_resid = aiov.iov_len = next_offset - + prev_offset; + error = VOP_WRITE(vp, &auio, + vnode_pager_putpages_ioflags(flags), curthread->td_ucred); + + wrsz = prev_resid - auio.uio_resid; + if (wrsz == 0) { + if (ppsratecheck(&lastfail, &curfail, 1) != 0) { + vn_printf(vp, "vnode_pager_putpages: " + "zero-length write at %ju resid %zd\n", + auio.uio_offset, auio.uio_resid); + } + VM_OBJECT_WLOCK(object); + break; + } + + /* Adjust the starting offset for next iteration. */ + prev_offset += wrsz; + MPASS(auio.uio_offset == prev_offset); + + ppscheck = 0; + if (error != 0 && (ppscheck = ppsratecheck(&lastfail, + &curfail, 1)) != 0) + vn_printf(vp, "vnode_pager_putpages: I/O error %d\n", + error); + if (auio.uio_resid != 0 && (ppscheck != 0 || + ppsratecheck(&lastfail, &curfail, 1) != 0)) + vn_printf(vp, "vnode_pager_putpages: residual I/O %zd " + "at %ju\n", auio.uio_resid, + (uintmax_t)ma[0]->pindex); + VM_OBJECT_WLOCK(object); + if (error != 0 || auio.uio_resid != 0) + break; + } +write_done: + /* Mark completely processed pages. */ + for (i = 0; i < OFF_TO_IDX(prev_offset - poffset); i++) rtvals[i] = VM_PAGER_OK; + /* Mark partial EOF page. */ + if (prev_offset == poffset + maxsize && (prev_offset & PAGE_MASK) != 0) + rtvals[i++] = VM_PAGER_OK; + /* Unwritten pages in range, free bonus if the page is clean. */ + for (; i < ncount; i++) + rtvals[i] = ma[i]->dirty == 0 ? VM_PAGER_OK : VM_PAGER_ERROR; + VM_OBJECT_WUNLOCK(object); + VM_CNT_ADD(v_vnodepgsout, i); + VM_CNT_INC(v_vnodeout); return (rtvals[0]); } From owner-svn-src-head@freebsd.org Fri Oct 20 09:10:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 715A5E2BAF6; Fri, 20 Oct 2017 09:10:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26C356EB72; Fri, 20 Oct 2017 09:10:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9K9AoNk053375; Fri, 20 Oct 2017 09:10:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9K9An9O053369; Fri, 20 Oct 2017 09:10:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710200910.v9K9An9O053369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 Oct 2017 09:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324795 - in head/sys: conf sys vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: conf sys vm X-SVN-Commit-Revision: 324795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 09:10:51 -0000 Author: kib Date: Fri Oct 20 09:10:49 2017 New Revision: 324795 URL: https://svnweb.freebsd.org/changeset/base/324795 Log: Move swapout code into vm/vm_swapout.c. There is no NO_SWAPPING #ifdef left in the code. Requested by: alc Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D12663 Added: head/sys/vm/vm_swapout.c - copied, changed from r324794, head/sys/vm/vm_pageout.c head/sys/vm/vm_swapout_dummy.c - copied, changed from r324794, head/sys/vm/vm_pageout.c Modified: head/sys/conf/files head/sys/sys/_kstack_cache.h head/sys/vm/vm_extern.h head/sys/vm/vm_glue.c head/sys/vm/vm_pageout.c head/sys/vm/vm_pageout.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Oct 20 08:32:37 2017 (r324794) +++ head/sys/conf/files Fri Oct 20 09:10:49 2017 (r324795) @@ -4828,6 +4828,7 @@ vm/swap_pager.c standard vm/uma_core.c standard vm/uma_dbg.c standard vm/memguard.c optional DEBUG_MEMGUARD +vm/vm_domain.c standard vm/vm_fault.c standard vm/vm_glue.c standard vm/vm_init.c standard @@ -4842,7 +4843,8 @@ vm/vm_pager.c standard vm/vm_phys.c standard vm/vm_radix.c standard vm/vm_reserv.c standard -vm/vm_domain.c standard +vm/vm_swapout.c optional !NO_SWAPPING +vm/vm_swapout_dummy.c optional NO_SWAPPING vm/vm_unix.c standard vm/vnode_pager.c standard xen/features.c optional xenhvm Modified: head/sys/sys/_kstack_cache.h ============================================================================== --- head/sys/sys/_kstack_cache.h Fri Oct 20 08:32:37 2017 (r324794) +++ head/sys/sys/_kstack_cache.h Fri Oct 20 09:10:49 2017 (r324795) @@ -38,6 +38,10 @@ struct kstack_cache_entry { extern struct kstack_cache_entry *kstack_cache; +#ifndef KSTACK_MAX_PAGES +#define KSTACK_MAX_PAGES 32 +#endif + #endif Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Fri Oct 20 08:32:37 2017 (r324794) +++ head/sys/vm/vm_extern.h Fri Oct 20 09:10:49 2017 (r324795) @@ -71,7 +71,6 @@ void kmem_init(vm_offset_t, vm_offset_t); void kmem_init_zero_region(void); void kmeminit(void); -void swapout_procs(int); int kernacc(void *, int, int); int useracc(void *, int, int); int vm_fault(vm_map_t, vm_offset_t, vm_prot_t, int); Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Fri Oct 20 08:32:37 2017 (r324794) +++ head/sys/vm/vm_glue.c Fri Oct 20 09:10:49 2017 (r324795) @@ -101,13 +101,6 @@ __FBSDID("$FreeBSD$"); #include -#ifndef NO_SWAPPING -static int swapout(struct proc *); -static void swapclear(struct proc *); -static void vm_thread_swapin(struct thread *td); -static void vm_thread_swapout(struct thread *td); -#endif - /* * MPSAFE * @@ -308,10 +301,6 @@ SYSCTL_INT(_vm, OID_AUTO, kstack_cache_size, CTLFLAG_R SYSCTL_INT(_vm, OID_AUTO, kstacks, CTLFLAG_RD, &kstacks, 0, ""); -#ifndef KSTACK_MAX_PAGES -#define KSTACK_MAX_PAGES 32 -#endif - /* * Create the kernel stack (including pcb for i386) for a new thread. * This routine directly affects the fork perf for a process and @@ -527,80 +516,7 @@ intr_prof_stack_use(struct thread *td, struct trapfram } #endif /* KSTACK_USAGE_PROF */ -#ifndef NO_SWAPPING /* - * Allow a thread's kernel stack to be paged out. - */ -static void -vm_thread_swapout(struct thread *td) -{ - vm_object_t ksobj; - vm_page_t m; - int i, pages; - - cpu_thread_swapout(td); - pages = td->td_kstack_pages; - ksobj = td->td_kstack_obj; - pmap_qremove(td->td_kstack, pages); - VM_OBJECT_WLOCK(ksobj); - for (i = 0; i < pages; i++) { - m = vm_page_lookup(ksobj, i); - if (m == NULL) - panic("vm_thread_swapout: kstack already missing?"); - vm_page_dirty(m); - vm_page_lock(m); - vm_page_unwire(m, PQ_INACTIVE); - vm_page_unlock(m); - } - VM_OBJECT_WUNLOCK(ksobj); -} - -/* - * Bring the kernel stack for a specified thread back in. - */ -static void -vm_thread_swapin(struct thread *td) -{ - vm_object_t ksobj; - vm_page_t ma[KSTACK_MAX_PAGES]; - int pages; - - pages = td->td_kstack_pages; - ksobj = td->td_kstack_obj; - VM_OBJECT_WLOCK(ksobj); - (void)vm_page_grab_pages(ksobj, 0, VM_ALLOC_NORMAL | VM_ALLOC_WIRED, ma, - pages); - for (int i = 0; i < pages;) { - int j, a, count, rv; - - vm_page_assert_xbusied(ma[i]); - if (ma[i]->valid == VM_PAGE_BITS_ALL) { - vm_page_xunbusy(ma[i]); - i++; - continue; - } - vm_object_pip_add(ksobj, 1); - for (j = i + 1; j < pages; j++) - if (ma[j]->valid == VM_PAGE_BITS_ALL) - break; - rv = vm_pager_has_page(ksobj, ma[i]->pindex, NULL, &a); - KASSERT(rv == 1, ("%s: missing page %p", __func__, ma[i])); - count = min(a + 1, j - i); - rv = vm_pager_get_pages(ksobj, ma + i, count, NULL, NULL); - KASSERT(rv == VM_PAGER_OK, ("%s: cannot get kstack for proc %d", - __func__, td->td_proc->p_pid)); - vm_object_pip_wakeup(ksobj); - for (j = i; j < i + count; j++) - vm_page_xunbusy(ma[j]); - i += count; - } - VM_OBJECT_WUNLOCK(ksobj); - pmap_qenter(td->td_kstack, ma, pages); - cpu_thread_swapin(td); -} -#endif /* !NO_SWAPPING */ - -/* * Implement fork's actions on an address space. * Here we arrange for the address space to be copied or referenced, * allocate a user struct (pcb and kernel stack), then call the @@ -673,425 +589,8 @@ vm_waitproc(p) } void -faultin(p) - struct proc *p; -{ -#ifdef NO_SWAPPING - - PROC_LOCK_ASSERT(p, MA_OWNED); - if ((p->p_flag & P_INMEM) == 0) - panic("faultin: proc swapped out with NO_SWAPPING!"); -#else /* !NO_SWAPPING */ - struct thread *td; - - PROC_LOCK_ASSERT(p, MA_OWNED); - /* - * If another process is swapping in this process, - * just wait until it finishes. - */ - if (p->p_flag & P_SWAPPINGIN) { - while (p->p_flag & P_SWAPPINGIN) - msleep(&p->p_flag, &p->p_mtx, PVM, "faultin", 0); - return; - } - if ((p->p_flag & P_INMEM) == 0) { - /* - * Don't let another thread swap process p out while we are - * busy swapping it in. - */ - ++p->p_lock; - p->p_flag |= P_SWAPPINGIN; - PROC_UNLOCK(p); - - /* - * We hold no lock here because the list of threads - * can not change while all threads in the process are - * swapped out. - */ - FOREACH_THREAD_IN_PROC(p, td) - vm_thread_swapin(td); - PROC_LOCK(p); - swapclear(p); - p->p_swtick = ticks; - - wakeup(&p->p_flag); - - /* Allow other threads to swap p out now. */ - --p->p_lock; - } -#endif /* NO_SWAPPING */ -} - -/* - * This swapin algorithm attempts to swap-in processes only if there - * is enough space for them. Of course, if a process waits for a long - * time, it will be swapped in anyway. - */ -void -swapper(void) -{ - struct proc *p; - struct thread *td; - struct proc *pp; - int slptime; - int swtime; - int ppri; - int pri; - -loop: - if (vm_page_count_min()) { - VM_WAIT; - goto loop; - } - - pp = NULL; - ppri = INT_MIN; - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - PROC_LOCK(p); - if (p->p_state == PRS_NEW || - p->p_flag & (P_SWAPPINGOUT | P_SWAPPINGIN | P_INMEM)) { - PROC_UNLOCK(p); - continue; - } - swtime = (ticks - p->p_swtick) / hz; - FOREACH_THREAD_IN_PROC(p, td) { - /* - * An otherwise runnable thread of a process - * swapped out has only the TDI_SWAPPED bit set. - * - */ - thread_lock(td); - if (td->td_inhibitors == TDI_SWAPPED) { - slptime = (ticks - td->td_slptick) / hz; - pri = swtime + slptime; - if ((td->td_flags & TDF_SWAPINREQ) == 0) - pri -= p->p_nice * 8; - /* - * if this thread is higher priority - * and there is enough space, then select - * this process instead of the previous - * selection. - */ - if (pri > ppri) { - pp = p; - ppri = pri; - } - } - thread_unlock(td); - } - PROC_UNLOCK(p); - } - sx_sunlock(&allproc_lock); - - /* - * Nothing to do, back to sleep. - */ - if ((p = pp) == NULL) { - tsleep(&proc0, PVM, "swapin", MAXSLP * hz / 2); - goto loop; - } - PROC_LOCK(p); - - /* - * Another process may be bringing or may have already - * brought this process in while we traverse all threads. - * Or, this process may even be being swapped out again. - */ - if (p->p_flag & (P_INMEM | P_SWAPPINGOUT | P_SWAPPINGIN)) { - PROC_UNLOCK(p); - goto loop; - } - - /* - * We would like to bring someone in. (only if there is space). - * [What checks the space? ] - */ - faultin(p); - PROC_UNLOCK(p); - goto loop; -} - -void kick_proc0(void) { wakeup(&proc0); } - -#ifndef NO_SWAPPING - -/* - * Swap_idle_threshold1 is the guaranteed swapped in time for a process - */ -static int swap_idle_threshold1 = 2; -SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold1, CTLFLAG_RW, - &swap_idle_threshold1, 0, "Guaranteed swapped in time for a process"); - -/* - * Swap_idle_threshold2 is the time that a process can be idle before - * it will be swapped out, if idle swapping is enabled. - */ -static int swap_idle_threshold2 = 10; -SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold2, CTLFLAG_RW, - &swap_idle_threshold2, 0, "Time before a process will be swapped out"); - -/* - * First, if any processes have been sleeping or stopped for at least - * "swap_idle_threshold1" seconds, they are swapped out. If, however, - * no such processes exist, then the longest-sleeping or stopped - * process is swapped out. Finally, and only as a last resort, if - * there are no sleeping or stopped processes, the longest-resident - * process is swapped out. - */ -void -swapout_procs(action) -int action; -{ - struct proc *p; - struct thread *td; - int didswap = 0; - -retry: - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - struct vmspace *vm; - int minslptime = 100000; - int slptime; - - PROC_LOCK(p); - /* - * Watch out for a process in - * creation. It may have no - * address space or lock yet. - */ - if (p->p_state == PRS_NEW) { - PROC_UNLOCK(p); - continue; - } - /* - * An aio daemon switches its - * address space while running. - * Perform a quick check whether - * a process has P_SYSTEM. - * Filter out exiting processes. - */ - if ((p->p_flag & (P_SYSTEM | P_WEXIT)) != 0) { - PROC_UNLOCK(p); - continue; - } - _PHOLD_LITE(p); - PROC_UNLOCK(p); - sx_sunlock(&allproc_lock); - - /* - * Do not swapout a process that - * is waiting for VM data - * structures as there is a possible - * deadlock. Test this first as - * this may block. - * - * Lock the map until swapout - * finishes, or a thread of this - * process may attempt to alter - * the map. - */ - vm = vmspace_acquire_ref(p); - if (vm == NULL) - goto nextproc2; - if (!vm_map_trylock(&vm->vm_map)) - goto nextproc1; - - PROC_LOCK(p); - if (p->p_lock != 1 || (p->p_flag & (P_STOPPED_SINGLE | - P_TRACED | P_SYSTEM)) != 0) - goto nextproc; - - /* - * only aiod changes vmspace, however it will be - * skipped because of the if statement above checking - * for P_SYSTEM - */ - if ((p->p_flag & (P_INMEM|P_SWAPPINGOUT|P_SWAPPINGIN)) != P_INMEM) - goto nextproc; - - switch (p->p_state) { - default: - /* Don't swap out processes in any sort - * of 'special' state. */ - break; - - case PRS_NORMAL: - /* - * do not swapout a realtime process - * Check all the thread groups.. - */ - FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - if (PRI_IS_REALTIME(td->td_pri_class)) { - thread_unlock(td); - goto nextproc; - } - slptime = (ticks - td->td_slptick) / hz; - /* - * Guarantee swap_idle_threshold1 - * time in memory. - */ - if (slptime < swap_idle_threshold1) { - thread_unlock(td); - goto nextproc; - } - - /* - * Do not swapout a process if it is - * waiting on a critical event of some - * kind or there is a thread whose - * pageable memory may be accessed. - * - * This could be refined to support - * swapping out a thread. - */ - if (!thread_safetoswapout(td)) { - thread_unlock(td); - goto nextproc; - } - /* - * If the system is under memory stress, - * or if we are swapping - * idle processes >= swap_idle_threshold2, - * then swap the process out. - */ - if (((action & VM_SWAP_NORMAL) == 0) && - (((action & VM_SWAP_IDLE) == 0) || - (slptime < swap_idle_threshold2))) { - thread_unlock(td); - goto nextproc; - } - - if (minslptime > slptime) - minslptime = slptime; - thread_unlock(td); - } - - /* - * If the pageout daemon didn't free enough pages, - * or if this process is idle and the system is - * configured to swap proactively, swap it out. - */ - if ((action & VM_SWAP_NORMAL) || - ((action & VM_SWAP_IDLE) && - (minslptime > swap_idle_threshold2))) { - _PRELE(p); - if (swapout(p) == 0) - didswap++; - PROC_UNLOCK(p); - vm_map_unlock(&vm->vm_map); - vmspace_free(vm); - goto retry; - } - } -nextproc: - PROC_UNLOCK(p); - vm_map_unlock(&vm->vm_map); -nextproc1: - vmspace_free(vm); -nextproc2: - sx_slock(&allproc_lock); - PRELE(p); - } - sx_sunlock(&allproc_lock); - /* - * If we swapped something out, and another process needed memory, - * then wakeup the sched process. - */ - if (didswap) - wakeup(&proc0); -} - -static void -swapclear(p) - struct proc *p; -{ - struct thread *td; - - PROC_LOCK_ASSERT(p, MA_OWNED); - - FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - td->td_flags |= TDF_INMEM; - td->td_flags &= ~TDF_SWAPINREQ; - TD_CLR_SWAPPED(td); - if (TD_CAN_RUN(td)) - if (setrunnable(td)) { -#ifdef INVARIANTS - /* - * XXX: We just cleared TDI_SWAPPED - * above and set TDF_INMEM, so this - * should never happen. - */ - panic("not waking up swapper"); -#endif - } - thread_unlock(td); - } - p->p_flag &= ~(P_SWAPPINGIN|P_SWAPPINGOUT); - p->p_flag |= P_INMEM; -} - -static int -swapout(p) - struct proc *p; -{ - struct thread *td; - - PROC_LOCK_ASSERT(p, MA_OWNED); -#if defined(SWAP_DEBUG) - printf("swapping out %d\n", p->p_pid); -#endif - - /* - * The states of this process and its threads may have changed - * by now. Assuming that there is only one pageout daemon thread, - * this process should still be in memory. - */ - KASSERT((p->p_flag & (P_INMEM|P_SWAPPINGOUT|P_SWAPPINGIN)) == P_INMEM, - ("swapout: lost a swapout race?")); - - /* - * remember the process resident count - */ - p->p_vmspace->vm_swrss = vmspace_resident_count(p->p_vmspace); - /* - * Check and mark all threads before we proceed. - */ - p->p_flag &= ~P_INMEM; - p->p_flag |= P_SWAPPINGOUT; - FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - if (!thread_safetoswapout(td)) { - thread_unlock(td); - swapclear(p); - return (EBUSY); - } - td->td_flags &= ~TDF_INMEM; - TD_SET_SWAPPED(td); - thread_unlock(td); - } - td = FIRST_THREAD_IN_PROC(p); - ++td->td_ru.ru_nswap; - PROC_UNLOCK(p); - - /* - * This list is stable because all threads are now prevented from - * running. The list is only modified in the context of a running - * thread in this process. - */ - FOREACH_THREAD_IN_PROC(p, td) - vm_thread_swapout(td); - - PROC_LOCK(p); - p->p_flag &= ~P_SWAPPINGOUT; - p->p_swtick = ticks; - return (0); -} -#endif /* !NO_SWAPPING */ Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri Oct 20 08:32:37 2017 (r324794) +++ head/sys/vm/vm_pageout.c Fri Oct 20 09:10:49 2017 (r324795) @@ -141,19 +141,6 @@ SYSINIT(pagedaemon, SI_SUB_KTHREAD_PAGE, SI_ORDER_SECO SDT_PROVIDER_DEFINE(vm); SDT_PROBE_DEFINE(vm, , , vm__lowmem_scan); -#if !defined(NO_SWAPPING) -/* the kernel process "vm_daemon"*/ -static void vm_daemon(void); -static struct proc *vmproc; - -static struct kproc_desc vm_kp = { - "vmdaemon", - vm_daemon, - &vmproc -}; -SYSINIT(vmdaemon, SI_SUB_KTHREAD_VM, SI_ORDER_FIRST, kproc_start, &vm_kp); -#endif - /* Pagedaemon activity rates, in subdivisions of one second. */ #define VM_LAUNDER_RATE 10 #define VM_INACT_SCAN_RATE 2 @@ -171,27 +158,12 @@ static enum { VM_LAUNDRY_SHORTFALL } vm_laundry_request = VM_LAUNDRY_IDLE; -#if !defined(NO_SWAPPING) -static int vm_pageout_req_swapout; /* XXX */ -static int vm_daemon_needed; -static struct mtx vm_daemon_mtx; -/* Allow for use by vm_pageout before vm_daemon is initialized. */ -MTX_SYSINIT(vm_daemon, &vm_daemon_mtx, "vm daemon", MTX_DEF); -#endif static int vm_pageout_update_period; static int disable_swap_pageouts; static int lowmem_period = 10; static time_t lowmem_uptime; static int swapdev_enabled; -#if defined(NO_SWAPPING) -static int vm_swap_enabled = 0; -static int vm_swap_idle_enabled = 0; -#else -static int vm_swap_enabled = 1; -static int vm_swap_idle_enabled = 0; -#endif - static int vm_panic_on_oom = 0; SYSCTL_INT(_vm, OID_AUTO, panic_on_oom, @@ -209,18 +181,6 @@ SYSCTL_INT(_vm, OID_AUTO, pageout_update_period, SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RW, &lowmem_period, 0, "Low memory callback period"); -#if defined(NO_SWAPPING) -SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled, - CTLFLAG_RD, &vm_swap_enabled, 0, "Enable entire process swapout"); -SYSCTL_INT(_vm, OID_AUTO, swap_idle_enabled, - CTLFLAG_RD, &vm_swap_idle_enabled, 0, "Allow swapout on idle criteria"); -#else -SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled, - CTLFLAG_RW, &vm_swap_enabled, 0, "Enable entire process swapout"); -SYSCTL_INT(_vm, OID_AUTO, swap_idle_enabled, - CTLFLAG_RW, &vm_swap_idle_enabled, 0, "Allow swapout on idle criteria"); -#endif - SYSCTL_INT(_vm, OID_AUTO, disable_swapspace_pageouts, CTLFLAG_RW, &disable_swap_pageouts, 0, "Disallow swapout of dirty pages"); @@ -262,11 +222,6 @@ static boolean_t vm_pageout_fallback_object_lock(vm_pa static int vm_pageout_launder(struct vm_domain *vmd, int launder, bool in_shortfall); static void vm_pageout_laundry_worker(void *arg); -#if !defined(NO_SWAPPING) -static void vm_pageout_map_deactivate_pages(vm_map_t, long); -static void vm_pageout_object_deactivate_pages(pmap_t, vm_object_t, long); -static void vm_req_vmdaemon(int req); -#endif static boolean_t vm_pageout_page_lock(vm_page_t, vm_page_t *); /* @@ -632,172 +587,7 @@ vm_pageout_swapoff(void *arg __unused, struct swdevt * atomic_store_rel_int(&swapdev_enabled, 0); } -#if !defined(NO_SWAPPING) /* - * vm_pageout_object_deactivate_pages - * - * Deactivate enough pages to satisfy the inactive target - * requirements. - * - * The object and map must be locked. - */ -static void -vm_pageout_object_deactivate_pages(pmap_t pmap, vm_object_t first_object, - long desired) -{ - vm_object_t backing_object, object; - vm_page_t p; - int act_delta, remove_mode; - - VM_OBJECT_ASSERT_LOCKED(first_object); - if ((first_object->flags & OBJ_FICTITIOUS) != 0) - return; - for (object = first_object;; object = backing_object) { - if (pmap_resident_count(pmap) <= desired) - goto unlock_return; - VM_OBJECT_ASSERT_LOCKED(object); - if ((object->flags & OBJ_UNMANAGED) != 0 || - object->paging_in_progress != 0) - goto unlock_return; - - remove_mode = 0; - if (object->shadow_count > 1) - remove_mode = 1; - /* - * Scan the object's entire memory queue. - */ - TAILQ_FOREACH(p, &object->memq, listq) { - if (pmap_resident_count(pmap) <= desired) - goto unlock_return; - if (vm_page_busied(p)) - continue; - VM_CNT_INC(v_pdpages); - vm_page_lock(p); - if (p->wire_count != 0 || p->hold_count != 0 || - !pmap_page_exists_quick(pmap, p)) { - vm_page_unlock(p); - continue; - } - act_delta = pmap_ts_referenced(p); - if ((p->aflags & PGA_REFERENCED) != 0) { - if (act_delta == 0) - act_delta = 1; - vm_page_aflag_clear(p, PGA_REFERENCED); - } - if (!vm_page_active(p) && act_delta != 0) { - vm_page_activate(p); - p->act_count += act_delta; - } else if (vm_page_active(p)) { - if (act_delta == 0) { - p->act_count -= min(p->act_count, - ACT_DECLINE); - if (!remove_mode && p->act_count == 0) { - pmap_remove_all(p); - vm_page_deactivate(p); - } else - vm_page_requeue(p); - } else { - vm_page_activate(p); - if (p->act_count < ACT_MAX - - ACT_ADVANCE) - p->act_count += ACT_ADVANCE; - vm_page_requeue(p); - } - } else if (vm_page_inactive(p)) - pmap_remove_all(p); - vm_page_unlock(p); - } - if ((backing_object = object->backing_object) == NULL) - goto unlock_return; - VM_OBJECT_RLOCK(backing_object); - if (object != first_object) - VM_OBJECT_RUNLOCK(object); - } -unlock_return: - if (object != first_object) - VM_OBJECT_RUNLOCK(object); -} - -/* - * deactivate some number of pages in a map, try to do it fairly, but - * that is really hard to do. - */ -static void -vm_pageout_map_deactivate_pages(map, desired) - vm_map_t map; - long desired; -{ - vm_map_entry_t tmpe; - vm_object_t obj, bigobj; - int nothingwired; - - if (!vm_map_trylock(map)) - return; - - bigobj = NULL; - nothingwired = TRUE; - - /* - * first, search out the biggest object, and try to free pages from - * that. - */ - tmpe = map->header.next; - while (tmpe != &map->header) { - if ((tmpe->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { - obj = tmpe->object.vm_object; - if (obj != NULL && VM_OBJECT_TRYRLOCK(obj)) { - if (obj->shadow_count <= 1 && - (bigobj == NULL || - bigobj->resident_page_count < obj->resident_page_count)) { - if (bigobj != NULL) - VM_OBJECT_RUNLOCK(bigobj); - bigobj = obj; - } else - VM_OBJECT_RUNLOCK(obj); - } - } - if (tmpe->wired_count > 0) - nothingwired = FALSE; - tmpe = tmpe->next; - } - - if (bigobj != NULL) { - vm_pageout_object_deactivate_pages(map->pmap, bigobj, desired); - VM_OBJECT_RUNLOCK(bigobj); - } - /* - * Next, hunt around for other pages to deactivate. We actually - * do this search sort of wrong -- .text first is not the best idea. - */ - tmpe = map->header.next; - while (tmpe != &map->header) { - if (pmap_resident_count(vm_map_pmap(map)) <= desired) - break; - if ((tmpe->eflags & MAP_ENTRY_IS_SUB_MAP) == 0) { - obj = tmpe->object.vm_object; - if (obj != NULL) { - VM_OBJECT_RLOCK(obj); - vm_pageout_object_deactivate_pages(map->pmap, obj, desired); - VM_OBJECT_RUNLOCK(obj); - } - } - tmpe = tmpe->next; - } - - /* - * Remove all mappings if a process is swapped out, this will free page - * table pages. - */ - if (desired == 0 && nothingwired) { - pmap_remove(vm_map_pmap(map), vm_map_min(map), - vm_map_max(map)); - } - - vm_map_unlock(map); -} -#endif /* !defined(NO_SWAPPING) */ - -/* * Attempt to acquire all of the necessary locks to launder a page and * then call through the clustering layer to PUTPAGES. Wait a short * time for a vnode lock. @@ -1563,14 +1353,12 @@ drop_page: vm_pagequeue_unlock(pq); } -#if !defined(NO_SWAPPING) /* * Wakeup the swapout daemon if we didn't free the targeted number of * pages. */ - if (vm_swap_enabled && page_shortage > 0) - vm_req_vmdaemon(VM_SWAP_NORMAL); -#endif + if (page_shortage > 0) + vm_swapout_run(); /* * If the inactive queue scan fails repeatedly to meet its @@ -1720,19 +1508,8 @@ drop_page: vm_page_unlock(m); } vm_pagequeue_unlock(pq); -#if !defined(NO_SWAPPING) - /* - * Idle process swapout -- run once per second when we are reclaiming - * pages. - */ - if (vm_swap_idle_enabled && pass > 0) { - static long lsec; - if (time_second != lsec) { - vm_req_vmdaemon(VM_SWAP_IDLE); - lsec = time_second; - } - } -#endif + if (pass > 0) + vm_swapout_run_idle(); return (page_shortage <= 0); } @@ -2158,167 +1935,3 @@ pagedaemon_wakeup(void) wakeup(&vm_pageout_wanted); } } - -#if !defined(NO_SWAPPING) -static void -vm_req_vmdaemon(int req) -{ - static int lastrun = 0; - - mtx_lock(&vm_daemon_mtx); - vm_pageout_req_swapout |= req; - if ((ticks > (lastrun + hz)) || (ticks < lastrun)) { - wakeup(&vm_daemon_needed); - lastrun = ticks; - } - mtx_unlock(&vm_daemon_mtx); -} - -static void -vm_daemon(void) -{ - struct rlimit rsslim; - struct proc *p; - struct thread *td; - struct vmspace *vm; - int breakout, swapout_flags, tryagain, attempts; -#ifdef RACCT - uint64_t rsize, ravailable; -#endif - - while (TRUE) { - mtx_lock(&vm_daemon_mtx); - msleep(&vm_daemon_needed, &vm_daemon_mtx, PPAUSE, "psleep", -#ifdef RACCT - racct_enable ? hz : 0 -#else - 0 -#endif - ); - swapout_flags = vm_pageout_req_swapout; - vm_pageout_req_swapout = 0; - mtx_unlock(&vm_daemon_mtx); - if (swapout_flags) - swapout_procs(swapout_flags); - - /* - * scan the processes for exceeding their rlimits or if - * process is swapped out -- deactivate pages - */ - tryagain = 0; - attempts = 0; -again: - attempts++; - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - vm_pindex_t limit, size; - - /* - * if this is a system process or if we have already - * looked at this process, skip it. - */ - PROC_LOCK(p); - if (p->p_state != PRS_NORMAL || - p->p_flag & (P_INEXEC | P_SYSTEM | P_WEXIT)) { - PROC_UNLOCK(p); - continue; - } - /* - * if the process is in a non-running type state, - * don't touch it. - */ - breakout = 0; - FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - if (!TD_ON_RUNQ(td) && - !TD_IS_RUNNING(td) && - !TD_IS_SLEEPING(td) && - !TD_IS_SUSPENDED(td)) { - thread_unlock(td); - breakout = 1; - break; - } - thread_unlock(td); - } - if (breakout) { - PROC_UNLOCK(p); - continue; - } - /* - * get a limit - */ - lim_rlimit_proc(p, RLIMIT_RSS, &rsslim); - limit = OFF_TO_IDX( - qmin(rsslim.rlim_cur, rsslim.rlim_max)); - - /* - * let processes that are swapped out really be - * swapped out set the limit to nothing (will force a - * swap-out.) - */ - if ((p->p_flag & P_INMEM) == 0) - limit = 0; /* XXX */ - vm = vmspace_acquire_ref(p); - _PHOLD_LITE(p); - PROC_UNLOCK(p); - if (vm == NULL) { - PRELE(p); - continue; - } - sx_sunlock(&allproc_lock); - - size = vmspace_resident_count(vm); - if (size >= limit) { - vm_pageout_map_deactivate_pages( - &vm->vm_map, limit); - size = vmspace_resident_count(vm); - } -#ifdef RACCT - if (racct_enable) { - rsize = IDX_TO_OFF(size); - PROC_LOCK(p); - if (p->p_state == PRS_NORMAL) - racct_set(p, RACCT_RSS, rsize); - ravailable = racct_get_available(p, RACCT_RSS); - PROC_UNLOCK(p); - if (rsize > ravailable) { - /* - * Don't be overly aggressive; this *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Oct 20 14:04:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E15E8E36594; Fri, 20 Oct 2017 14:04:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACCFC77706; Fri, 20 Oct 2017 14:04:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9KE41nW078440; Fri, 20 Oct 2017 14:04:01 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9KE417j078439; Fri, 20 Oct 2017 14:04:01 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710201404.v9KE417j078439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 20 Oct 2017 14:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324803 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 14:04:03 -0000 Author: mjg Date: Fri Oct 20 14:04:01 2017 New Revision: 324803 URL: https://svnweb.freebsd.org/changeset/base/324803 Log: mtx: fix up UP build after r324778 Reported by: Michael Butler Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Oct 20 11:07:51 2017 (r324802) +++ head/sys/kern/kern_mutex.c Fri Oct 20 14:04:01 2017 (r324803) @@ -289,7 +289,9 @@ __mtx_lock_spin_flags(volatile uintptr_t *c, int opts, int line) { struct mtx *m; +#ifdef SMP uintptr_t tid, v; +#endif m = mtxlock2mtx(c); @@ -306,6 +308,7 @@ __mtx_lock_spin_flags(volatile uintptr_t *c, int opts, opts &= ~MTX_RECURSE; WITNESS_CHECKORDER(&m->lock_object, opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); +#ifdef SMP spinlock_enter(); tid = (uintptr_t)curthread; v = MTX_UNOWNED; @@ -314,6 +317,9 @@ __mtx_lock_spin_flags(volatile uintptr_t *c, int opts, else LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, 0, 0, file, line); +#else + __mtx_lock_spin(m, curthread, opts, file, line); +#endif LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file, line); WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line); From owner-svn-src-head@freebsd.org Fri Oct 20 14:56:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A1A5E37BCF; Fri, 20 Oct 2017 14:56:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27ED47DD69; Fri, 20 Oct 2017 14:56:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9KEuDXP000505; Fri, 20 Oct 2017 14:56:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9KEuDiE000504; Fri, 20 Oct 2017 14:56:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201710201456.v9KEuDiE000504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 20 Oct 2017 14:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324804 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 14:56:14 -0000 Author: markj Date: Fri Oct 20 14:56:13 2017 New Revision: 324804 URL: https://svnweb.freebsd.org/changeset/base/324804 Log: Avoid the nbp lookup in the final loop iteration in flushbuflist(). The end of the loop must re-lookup the next buf since the bufobj lock is dropped in the loop body. If the lookup fails, the loop is restarted. This mechanism non-obviously also terminates the loop when the end of the buf list is reached. Split up the two loops termination cases to make the code a bit less fragile. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12730 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Oct 20 14:04:01 2017 (r324803) +++ head/sys/kern/vfs_subr.c Fri Oct 20 14:56:13 2017 (r324804) @@ -1746,8 +1746,6 @@ flushbuflist(struct bufv *bufv, int flags, struct bufo ((flags & V_ALT) && (bp->b_xflags & BX_ALTDATA) == 0)) { continue; } - lblkno = 0; - xflags = 0; if (nbp != NULL) { lblkno = nbp->b_lblkno; xflags = nbp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN); @@ -1782,6 +1780,8 @@ flushbuflist(struct bufv *bufv, int flags, struct bufo bp->b_flags &= ~B_ASYNC; brelse(bp); BO_LOCK(bo); + if (nbp == NULL) + break; nbp = gbincore(bo, lblkno); if (nbp == NULL || (nbp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN)) != xflags) From owner-svn-src-head@freebsd.org Fri Oct 20 15:24:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0AB4E38A4D; Fri, 20 Oct 2017 15:24:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C5267F5B2; Fri, 20 Oct 2017 15:24:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9KFOSp7013482; Fri, 20 Oct 2017 15:24:28 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9KFOSfT013481; Fri, 20 Oct 2017 15:24:28 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710201524.v9KFOSfT013481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 20 Oct 2017 15:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324805 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 324805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 15:24:29 -0000 Author: asomers Date: Fri Oct 20 15:24:28 2017 New Revision: 324805 URL: https://svnweb.freebsd.org/changeset/base/324805 Log: Fix the mps(4) HISTORY section. Looks like a copy/paste error from r302673. MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/share/man/man4/mps.4 Modified: head/share/man/man4/mps.4 ============================================================================== --- head/share/man/man4/mps.4 Fri Oct 20 14:56:13 2017 (r324804) +++ head/share/man/man4/mps.4 Fri Oct 20 15:24:28 2017 (r324805) @@ -369,7 +369,8 @@ The following levels are available: .Sh HISTORY The .Nm -driver first appeared in FreeBSD 9.3. +driver first appeared in +.Fx 9.0 . .Sh AUTHORS The .Nm From owner-svn-src-head@freebsd.org Fri Oct 20 15:29:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1D63E38B9C; Fri, 20 Oct 2017 15:29:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F1927F7EC; Fri, 20 Oct 2017 15:29:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9KFTSh2013759; Fri, 20 Oct 2017 15:29:28 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9KFTSWf013757; Fri, 20 Oct 2017 15:29:28 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710201529.v9KFTSWf013757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 20 Oct 2017 15:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324806 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 324806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 15:29:29 -0000 Author: asomers Date: Fri Oct 20 15:29:28 2017 New Revision: 324806 URL: https://svnweb.freebsd.org/changeset/base/324806 Log: Use the .Fx macro consistently. Sponsored by: Spectra Logic Corp Modified: head/share/man/man4/mpr.4 head/share/man/man4/usfs.4 Modified: head/share/man/man4/mpr.4 ============================================================================== --- head/share/man/man4/mpr.4 Fri Oct 20 15:24:28 2017 (r324805) +++ head/share/man/man4/mpr.4 Fri Oct 20 15:29:28 2017 (r324806) @@ -393,7 +393,8 @@ The following levels are available: .Sh HISTORY The .Nm -driver first appeared in FreeBSD 9.3. +driver first appeared in +.Fx 9.3 . .Sh AUTHORS The .Nm Modified: head/share/man/man4/usfs.4 ============================================================================== --- head/share/man/man4/usfs.4 Fri Oct 20 15:24:28 2017 (r324805) +++ head/share/man/man4/usfs.4 Fri Oct 20 15:29:28 2017 (r324806) @@ -65,4 +65,5 @@ Upon attach the driver creates a RAM disk which can be .Sh HISTORY The .Nm -driver appeared in FreeBSD 8. +driver appeared in +.Fx 8.0 . From owner-svn-src-head@freebsd.org Fri Oct 20 18:40:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1906E3D03E; Fri, 20 Oct 2017 18:40:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F43E2288; Fri, 20 Oct 2017 18:40:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9KIeTod093718; Fri, 20 Oct 2017 18:40:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9KIeT9F093717; Fri, 20 Oct 2017 18:40:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710201840.v9KIeT9F093717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 Oct 2017 18:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324807 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 18:40:30 -0000 Author: kib Date: Fri Oct 20 18:40:29 2017 New Revision: 324807 URL: https://svnweb.freebsd.org/changeset/base/324807 Log: Take the vm object lock in read mode in vnode_generic_putpages(). Only upgrade it to write mode if we need to clear dirty bits of the partially valid page after EOF. Suggested and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Fri Oct 20 15:29:28 2017 (r324806) +++ head/sys/vm/vnode_pager.c Fri Oct 20 18:40:29 2017 (r324807) @@ -1252,8 +1252,14 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page * We do not under any circumstances truncate the valid bits, as * this will screw up bogus page replacement. */ - VM_OBJECT_WLOCK(object); + VM_OBJECT_RLOCK(object); if (maxsize + poffset > object->un_pager.vnp.vnp_size) { + if (!VM_OBJECT_TRYUPGRADE(object)) { + VM_OBJECT_RUNLOCK(object); + VM_OBJECT_WLOCK(object); + if (maxsize + poffset <= object->un_pager.vnp.vnp_size) + goto downgrade; + } if (object->un_pager.vnp.vnp_size > poffset) { maxsize = object->un_pager.vnp.vnp_size - poffset; ncount = btoc(maxsize); @@ -1278,6 +1284,8 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page } for (i = ncount; i < count; i++) rtvals[i] = VM_PAGER_BAD; +downgrade: + VM_OBJECT_LOCK_DOWNGRADE(object); } auio.uio_iov = &aiov; @@ -1324,7 +1332,7 @@ start_write: */ MPASS(prev_offset < next_offset); - VM_OBJECT_WUNLOCK(object); + VM_OBJECT_RUNLOCK(object); aiov.iov_base = NULL; auio.uio_iovcnt = 1; auio.uio_offset = prev_offset; @@ -1340,7 +1348,7 @@ start_write: "zero-length write at %ju resid %zd\n", auio.uio_offset, auio.uio_resid); } - VM_OBJECT_WLOCK(object); + VM_OBJECT_RLOCK(object); break; } @@ -1358,7 +1366,7 @@ start_write: vn_printf(vp, "vnode_pager_putpages: residual I/O %zd " "at %ju\n", auio.uio_resid, (uintmax_t)ma[0]->pindex); - VM_OBJECT_WLOCK(object); + VM_OBJECT_RLOCK(object); if (error != 0 || auio.uio_resid != 0) break; } @@ -1372,7 +1380,7 @@ write_done: /* Unwritten pages in range, free bonus if the page is clean. */ for (; i < ncount; i++) rtvals[i] = ma[i]->dirty == 0 ? VM_PAGER_OK : VM_PAGER_ERROR; - VM_OBJECT_WUNLOCK(object); + VM_OBJECT_RUNLOCK(object); VM_CNT_ADD(v_vnodepgsout, i); VM_CNT_INC(v_vnodeout); return (rtvals[0]); From owner-svn-src-head@freebsd.org Fri Oct 20 18:58:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46D72E3D57F; Fri, 20 Oct 2017 18:58:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 162392D17; Fri, 20 Oct 2017 18:58:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9KIwBwB002445; Fri, 20 Oct 2017 18:58:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9KIwBKB002444; Fri, 20 Oct 2017 18:58:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710201858.v9KIwBKB002444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 20 Oct 2017 18:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324808 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 18:58:12 -0000 Author: mjg Date: Fri Oct 20 18:58:11 2017 New Revision: 324808 URL: https://svnweb.freebsd.org/changeset/base/324808 Log: amd64: plug missed dt_lock in cpu_fork Modified: head/sys/amd64/amd64/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Fri Oct 20 18:40:29 2017 (r324807) +++ head/sys/amd64/amd64/vm_machdep.c Fri Oct 20 18:58:11 2017 (r324808) @@ -244,6 +244,10 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t /* Copy the LDT, if necessary. */ mdp1 = &td1->td_proc->p_md; mdp2 = &p2->p_md; + if (mdp1->md_ldt == NULL) { + mdp2->md_ldt = NULL; + return; + } mtx_lock(&dt_lock); if (mdp1->md_ldt != NULL) { if (flags & RFMEM) { From owner-svn-src-head@freebsd.org Fri Oct 20 21:13:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4396BE401F9; Fri, 20 Oct 2017 21:13:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10C1166197; Fri, 20 Oct 2017 21:13:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9KLDKZ0060436; Fri, 20 Oct 2017 21:13:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9KLDKMA060435; Fri, 20 Oct 2017 21:13:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201710202113.v9KLDKMA060435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 20 Oct 2017 21:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324809 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 21:13:21 -0000 Author: markj Date: Fri Oct 20 21:13:19 2017 New Revision: 324809 URL: https://svnweb.freebsd.org/changeset/base/324809 Log: Free the right address range if kmem_back() fails in memguard_alloc(). MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/sys/vm/memguard.c Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Fri Oct 20 18:58:11 2017 (r324808) +++ head/sys/vm/memguard.c Fri Oct 20 21:13:19 2017 (r324809) @@ -284,7 +284,7 @@ v2sizev(vm_offset_t va) void * memguard_alloc(unsigned long req_size, int flags) { - vm_offset_t addr; + vm_offset_t addr, origaddr; u_long size_p, size_v; int do_guard, rv; @@ -328,7 +328,7 @@ memguard_alloc(unsigned long req_size, int flags) for (;;) { if (vmem_xalloc(memguard_arena, size_v, 0, 0, 0, memguard_cursor, VMEM_ADDR_MAX, - M_BESTFIT | M_NOWAIT, &addr) == 0) + M_BESTFIT | M_NOWAIT, &origaddr) == 0) break; /* * The map has no space. This may be due to @@ -343,11 +343,12 @@ memguard_alloc(unsigned long req_size, int flags) memguard_wrap++; memguard_cursor = memguard_base; } + addr = origaddr; if (do_guard) addr += PAGE_SIZE; rv = kmem_back(kmem_object, addr, size_p, flags); if (rv != KERN_SUCCESS) { - vmem_xfree(memguard_arena, addr, size_v); + vmem_xfree(memguard_arena, origaddr, size_v); memguard_fail_pgs++; addr = (vm_offset_t)NULL; goto out; From owner-svn-src-head@freebsd.org Fri Oct 20 21:41:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B061E4093D; Fri, 20 Oct 2017 21:41:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4619166E74; Fri, 20 Oct 2017 21:41:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9KLf1Qc069246; Fri, 20 Oct 2017 21:41:01 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9KLexFK069227; Fri, 20 Oct 2017 21:40:59 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201710202140.v9KLexFK069227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 20 Oct 2017 21:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324810 - in head/sys: amd64/conf arm/conf arm64/conf conf i386/conf mips/conf net powerpc/conf riscv/conf sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/sys: amd64/conf arm/conf arm64/conf conf i386/conf mips/conf net powerpc/conf riscv/conf sparc64/conf X-SVN-Commit-Revision: 324810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Oct 2017 21:41:02 -0000 Author: bz Date: Fri Oct 20 21:40:59 2017 New Revision: 324810 URL: https://svnweb.freebsd.org/changeset/base/324810 Log: With r181803 on 2008-08-17 23:27:27Z the first VIMAGE commit went into HEAD. Enable VIMAGE in GENERIC kernels and some others (where GENERIC does not exist) on HEAD. Disable building LINT-VIMAGE with VIMAGE being default. This should give it a lot more exposure in the run-up to 12 to help us evaluate whether to keep it on by default or not. We are also hoping to get better performance testing. The feature can be disabled using nooptions. Requested by: many Reviewed by: kristof, emaste, hiren X-MFC after: never Relnotes: yes Differential Revision: https://reviews.freebsd.org/D12639 Modified: head/sys/amd64/conf/GENERIC head/sys/arm/conf/std.armv6 head/sys/arm/conf/std.armv7 head/sys/arm64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/makeLINT.mk head/sys/i386/conf/GENERIC head/sys/mips/conf/GXEMUL head/sys/mips/conf/GXEMUL32 head/sys/mips/conf/QEMU head/sys/net/vnet.c head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/riscv/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/amd64/conf/GENERIC Fri Oct 20 21:40:59 2017 (r324810) @@ -26,6 +26,7 @@ makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption +options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/arm/conf/std.armv6 Fri Oct 20 21:40:59 2017 (r324810) @@ -5,6 +5,7 @@ options HZ=1000 options ARM_L2_PIPT # Only L2 PIPT is supported options PREEMPTION # Enable kernel thread preemption +options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP Modified: head/sys/arm/conf/std.armv7 ============================================================================== --- head/sys/arm/conf/std.armv7 Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/arm/conf/std.armv7 Fri Oct 20 21:40:59 2017 (r324810) @@ -5,6 +5,7 @@ options HZ=1000 options ARM_L2_PIPT # Only L2 PIPT is supported options PREEMPTION # Enable kernel thread preemption +options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/arm64/conf/GENERIC Fri Oct 20 21:40:59 2017 (r324810) @@ -26,6 +26,7 @@ makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption +options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/conf/NOTES Fri Oct 20 21:40:59 2017 (r324810) @@ -802,8 +802,8 @@ options NGATM_CCATM device mn # Munich32x/Falc54 Nx64kbit/sec cards. # Network stack virtualization. -#options VIMAGE -#options VNET_DEBUG # debug for VIMAGE +options VIMAGE +options VNET_DEBUG # debug for VIMAGE # # Network interfaces: Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/conf/makeLINT.mk Fri Oct 20 21:40:59 2017 (r324810) @@ -6,16 +6,13 @@ all: clean: rm -f LINT .if ${TARGET} == "amd64" || ${TARGET} == "i386" - rm -f LINT-VIMAGE LINT-NOINET LINT-NOINET6 LINT-NOIP + rm -f LINT-NOINET LINT-NOINET6 LINT-NOIP .endif NOTES= ../../conf/NOTES NOTES LINT: ${NOTES} ../../conf/makeLINT.sed cat ${NOTES} | sed -E -n -f ../../conf/makeLINT.sed > ${.TARGET} .if ${TARGET} == "amd64" || ${TARGET} == "i386" - echo "include ${.TARGET}" > ${.TARGET}-VIMAGE - echo "ident ${.TARGET}-VIMAGE" >> ${.TARGET}-VIMAGE - echo "options VIMAGE" >> ${.TARGET}-VIMAGE echo "include ${.TARGET}" > ${.TARGET}-NOINET echo "ident ${.TARGET}-NOINET" >> ${.TARGET}-NOINET echo 'makeoptions MKMODULESENV+="WITHOUT_INET_SUPPORT="' >> ${.TARGET}-NOINET Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/i386/conf/GENERIC Fri Oct 20 21:40:59 2017 (r324810) @@ -28,6 +28,7 @@ makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption +options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security Modified: head/sys/mips/conf/GXEMUL ============================================================================== --- head/sys/mips/conf/GXEMUL Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/mips/conf/GXEMUL Fri Oct 20 21:40:59 2017 (r324810) @@ -30,6 +30,7 @@ options KDB options SMP # Symmetric MultiProcessor Kernel options SCHED_ULE +options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP Modified: head/sys/mips/conf/GXEMUL32 ============================================================================== --- head/sys/mips/conf/GXEMUL32 Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/mips/conf/GXEMUL32 Fri Oct 20 21:40:59 2017 (r324810) @@ -28,6 +28,7 @@ options KDB options SMP # Symmetric MultiProcessor Kernel options SCHED_ULE +options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP Modified: head/sys/mips/conf/QEMU ============================================================================== --- head/sys/mips/conf/QEMU Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/mips/conf/QEMU Fri Oct 20 21:40:59 2017 (r324810) @@ -31,6 +31,7 @@ options DDB options KDB options SCHED_4BSD #4BSD scheduler +options VIMAGE # Subsystem virtualization, e.g. VNET options INET #InterNETworking options TCP_HHOOK # hhook(9) framework for TCP options NFSCL #Network Filesystem Client @@ -44,6 +45,11 @@ options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B r #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter device loop device ether Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/net/vnet.c Fri Oct 20 21:40:59 2017 (r324810) @@ -312,9 +312,8 @@ static void vnet0_init(void *arg __unused) { - /* Warn people before take off - in case we crash early. */ - printf("WARNING: VIMAGE (virtualized network stack) is a highly " - "experimental feature.\n"); + if (bootverbose) + printf("VIMAGE (virtualized network stack) enabled\n"); /* * We MUST clear curvnet in vi_init_done() before going SMP, Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/powerpc/conf/GENERIC Fri Oct 20 21:40:59 2017 (r324810) @@ -35,6 +35,7 @@ options PSERIES #PAPR-compliant systems options FDT options SCHED_ULE #ULE scheduler options PREEMPTION #Enable kernel thread preemption +options VIMAGE # Subsystem virtualization, e.g. VNET options INET #InterNETworking options INET6 #IPv6 communications protocols options IPSEC # IP (v4/v6) security Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/powerpc/conf/GENERIC64 Fri Oct 20 21:40:59 2017 (r324810) @@ -35,6 +35,7 @@ options PSERIES #PAPR-compliant systems (e.g. IBM p options FDT #Flattened Device Tree options SCHED_ULE #ULE scheduler options PREEMPTION #Enable kernel thread preemption +options VIMAGE # Subsystem virtualization, e.g. VNET options INET #InterNETworking options INET6 #IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/riscv/conf/GENERIC Fri Oct 20 21:40:59 2017 (r324810) @@ -30,6 +30,7 @@ makeoptions WITHOUT_MODULES="usb otusfw mwlfw ispfw mw options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption +options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options TCP_HHOOK # hhook(9) framework for TCP Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Oct 20 21:13:19 2017 (r324809) +++ head/sys/sparc64/conf/GENERIC Fri Oct 20 21:40:59 2017 (r324810) @@ -28,6 +28,7 @@ makeoptions DEBUG=-g # Build kernel with gdb(1) debug options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption +options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security From owner-svn-src-head@freebsd.org Sat Oct 21 07:23:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C71D1E4FB7F; Sat, 21 Oct 2017 07:23:46 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A38876B84; Sat, 21 Oct 2017 07:23:46 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9L7NjJ3016494; Sat, 21 Oct 2017 07:23:45 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9L7Nj6W016491; Sat, 21 Oct 2017 07:23:45 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201710210723.v9L7Nj6W016491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 21 Oct 2017 07:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324811 - in head/sys/dev/pms/freebsd/driver: common ini/src X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head/sys/dev/pms/freebsd/driver: common ini/src X-SVN-Commit-Revision: 324811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 07:23:46 -0000 Author: rlibby Date: Sat Oct 21 07:23:45 2017 New Revision: 324811 URL: https://svnweb.freebsd.org/changeset/base/324811 Log: pms/freebsd: fix compiler warnings - A number of unused variable warnings, - a missing prototype warning (actually a dead function), - and a potential use of an uninitialized variable. Reviewed by: pfg Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12683 Modified: head/sys/dev/pms/freebsd/driver/common/lxencrypt.c head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c head/sys/dev/pms/freebsd/driver/ini/src/osapi.c Modified: head/sys/dev/pms/freebsd/driver/common/lxencrypt.c ============================================================================== --- head/sys/dev/pms/freebsd/driver/common/lxencrypt.c Fri Oct 20 21:40:59 2017 (r324810) +++ head/sys/dev/pms/freebsd/driver/common/lxencrypt.c Sat Oct 21 07:23:45 2017 (r324811) @@ -41,8 +41,8 @@ #include -static atomic_t ioerr_queue_count; #ifdef ENCRYPT_ENHANCE +static atomic_t ioerr_queue_count; /****************************************************************************** careful_write(): Modified: head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c ============================================================================== --- head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Fri Oct 20 21:40:59 2017 (r324810) +++ head/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c Sat Oct 21 07:23:45 2017 (r324811) @@ -533,9 +533,6 @@ static int agtiapi_CharIoctl( struct cdev *dev, tiIOCTLPayload_t *pIoctlPayload; struct agtiapi_softc *pCard; pCard=dev->si_drv1; - void *param1 = NULL; - void *param2 = NULL; - void *param3 = NULL; U32 status = 0; U32 retValue; int err = 0; @@ -649,8 +646,8 @@ static int agtiapi_CharIoctl( struct cdev *dev, status = tiCOMMgntIOCTL( &pCard->tiRoot, pIoctlPayload, pCard, - param2, - param3 ); + NULL, + NULL ); if (status == IOCTL_CALL_PENDING) { ostiIOCTLWaitForSignal(&pCard->tiRoot,NULL, NULL, NULL); @@ -2069,17 +2066,14 @@ int agtiapi_QueueCmnd_(struct agtiapi_softc *pmcsc, un /* get a ccb */ if ((pccb = agtiapi_GetCCB(pmcsc)) == NULL) { - ag_device_t *targ; AGTIAPI_PRINTK("agtiapi_QueueCmnd_: GetCCB ERROR\n"); if (pmcsc != NULL) { + ag_device_t *targ; TID = INDEX(pmcsc, TID); targ = &pmcsc->pDevList[TID]; - } - if (targ != NULL) - { agtiapi_adjust_queue_depth(ccb->ccb_h.path,targ->qdepth); - } + } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; ccb->ccb_h.status &= ~CAM_STATUS_MASK; ccb->ccb_h.status |= CAM_REQUEUE_REQ; @@ -3089,7 +3083,6 @@ STATIC void agtiapi_StartIO( struct agtiapi_softc *pmc ccb_t *pccb; int TID; ag_device_t *targ; - struct ccb_relsim crs; AGTIAPI_IO( "agtiapi_StartIO: start\n" ); @@ -4345,18 +4338,6 @@ int agtiapi_eh_HostReset( struct agtiapi_softc *pmcsc, } -int agtiapi_eh_DeviceReset( struct agtiapi_softc *pmcsc, union ccb *cmnd ) -{ - AGTIAPI_PRINTK( "agtiapi_eh_HostReset: ccb pointer %p\n", - cmnd ); - - if( cmnd == NULL ) - { - printf( "agtiapi_eh_HostReset: null command, skipping reset.\n" ); - return tiInvalidHandle; - } - return agtiapi_DoSoftReset( pmcsc ); -} /****************************************************************************** agtiapi_QueueCCB() @@ -5661,8 +5642,7 @@ Note: static void agtiapi_scan(struct agtiapi_softc *pmcsc) { union ccb *ccb; - int bus, tid, lun, card_no; - static int num=0; + int bus, tid, lun; AGTIAPI_PRINTK("agtiapi_scan: start cardNO %d \n", pmcsc->cardNo); Modified: head/sys/dev/pms/freebsd/driver/ini/src/osapi.c ============================================================================== --- head/sys/dev/pms/freebsd/driver/ini/src/osapi.c Fri Oct 20 21:40:59 2017 (r324810) +++ head/sys/dev/pms/freebsd/driver/ini/src/osapi.c Sat Oct 21 07:23:45 2017 (r324811) @@ -764,7 +764,6 @@ ostiSetDeviceQueueDepth( tiRoot_t *tiRoot, ) { bit32 retVal = 0; - struct agtiapi_softc *pCard = TIROOT_TO_CARD(tiRoot); ccb_t *pccb = (ccb_t *) tiIORequest->osData; tiDeviceHandle_t *tiDeviceHandle = pccb->devHandle; ag_device_t *pDevice = (ag_device_t *)tiDeviceHandle->osData; From owner-svn-src-head@freebsd.org Sat Oct 21 07:43:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDB98E501FE; Sat, 21 Oct 2017 07:43:42 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x236.google.com (mail-pf0-x236.google.com [IPv6:2607:f8b0:400e:c00::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF0437737F; Sat, 21 Oct 2017 07:43:42 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x236.google.com with SMTP id t188so13669601pfd.10; Sat, 21 Oct 2017 00:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=tWo6O7VR6vdrAr9fke+yS7yW4efvEzb+CbpT6ljp7v0=; b=qVjy+xjylec+uJdVtnumgUNYHm/uOu7yY+PDCrhMWP4k3+msfsoWCnVCRFSATDmbEf c4wBiQRw6p/ORZzJ4X+KUTUuCS3KrBGMCbdrgIIcd1VEOV/UoxG0Emsct6qeXyROEIr5 IPQvRqjPTmDUxSQUaI0wrYhlgIMWy7ElYWTa+tDYpVyOAxi8qcXQEhNt4577/BCOXFGR I3Yb3x6SJrusI0aXErMuElOoHcr80imTNYaPpg1PZCdkVA/vPkFeshiAZLh2V616hZ/e 9MH1g85/J6fFUxy+BXeyYX14FRDq8PdoKFUB2/neMX/X14+0lr5l5a1rNHPR7gn2V26P bt2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=tWo6O7VR6vdrAr9fke+yS7yW4efvEzb+CbpT6ljp7v0=; b=t0KA01GGbAnfF9sZ6jbto2OuurBpXnJmvxZLvDID4zlBfRFDK/nXD4JwrEGQhekWRm IA7v/MC0S505i43K2QDnHMJFNO+ZEPbTZcLsZo/2bxlxSpjd01yztI5kPIf7sxUt6BYC 4/4tiHy+/a/Y++B/SUNv44L+jHgdw9BFfWHEXnPY5oq1FPYCUqsRXkyaNi3sqMOnBfzg R4bsMxakiSQUDvWd20rvfBWbnHDhDlDfh7FP+MuNJpSRFthZ13eCzLWhtfMkFIbIAEH6 oxmcB2LQ4llqMu3YVUI7A5TWBl4zefKt/c0x0s9DvyouYenAYn7NscqZl6iLREYMw6E+ 2+XQ== X-Gm-Message-State: AMCzsaXEYfXzvWwuZDFDprhA/pAnpVnEM0v3XikDHyn9ukfT1tI3TdSR RlvyUDHB+VRGUose6WoKSK3GAm6e X-Google-Smtp-Source: ABhQp+SQDKZH0D8Br0nuS5pM92rH92tVSNQ8tWmAnI6nNUsf+E2EB3BiWgXPDJ4YCiYcMuoGy3QH+A== X-Received: by 10.99.126.5 with SMTP id z5mr6419268pgc.371.1508571821486; Sat, 21 Oct 2017 00:43:41 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id u6sm4097079pgo.9.2017.10.21.00.43.40 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 21 Oct 2017 00:43:40 -0700 (PDT) Subject: Re: svn commit: r324811 - in head/sys/dev/pms/freebsd/driver: common ini/src Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_A8DE908C-3E7B-4F1B-826A-AB324F7A18BE"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201710210723.v9L7Nj6W016491@repo.freebsd.org> Date: Sat, 21 Oct 2017 00:43:42 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <401F7CFC-1381-4F60-92DE-5771566CD992@gmail.com> References: <201710210723.v9L7Nj6W016491@repo.freebsd.org> To: Ryan Libby X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 07:43:43 -0000 --Apple-Mail=_A8DE908C-3E7B-4F1B-826A-AB324F7A18BE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Oct 21, 2017, at 00:23, Ryan Libby wrote: >=20 > Author: rlibby > Date: Sat Oct 21 07:23:45 2017 > New Revision: 324811 > URL: https://svnweb.freebsd.org/changeset/base/324811 >=20 > Log: > pms/freebsd: fix compiler warnings >=20 > - A number of unused variable warnings, > - a missing prototype warning (actually a dead function), > - and a potential use of an uninitialized variable. You probably should look for the other _fantastic_ fixes that Danny Ryan = cooked up for the driver. I don=E2=80=99t think you=E2=80=99ve found the = branches that result in logic errors which trigger corruption yet=E2=80=A6= Cheers, -Ngie --Apple-Mail=_A8DE908C-3E7B-4F1B-826A-AB324F7A18BE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZ6vquAAoJEPWDqSZpMIYVunsP/0ffffMvpTeNXsP6ahrV3llL DKShIlN01zA1+Wcrijtb+X5eu3B4pkRkUlJYhvsWddYKEMGWxVIgOk2FWBKOruML R59Gk2Oi/NOOFg3XXkh2fAuZrCA5o6mAUqVyNlCzcc7fQB3+n9k7qxT3q9dq4xpJ B8iMRcCbon7maJDfysyrYhjhIqrnFSCPH6pEuqAZNwP4lx4DQ7jl/36vRB/EP/9N 4lSP+y4br9l2FFmP/u6tZSXbqdNyidpuZeFzhKzulAnLPiQkX86t42spzrCjZByV GhEdHS0QCptmbhIe8sBrmpbOnioLlwtnBXqBI/3wovUHQYPkrbfbKX0RRrqs2+sR D84jECtqabYlvHepYglj+gBSwFKSTBNZTuooH33pYXZKSODXgvFzv4w6+883Wtfc yTxa2JpnS77ls01EPIIrg8qm02rARZnM38/TAVzECbG54iOjfLj2qkW2pa1mLqp5 4rZzBjDh2Y8DAhuCsUiZP4sTvqO7OssXjxA8u/cNd3HD87lMO2rJcnECJDYw92// H0frcu0NczLrNz0FLpEdfd71jDoJIiOybBYumR0yiCwNfJMrow0ttXyX7CcUKzrv DjL3dChJwHeGH4Ev0kLiJVjdGKLzq5oy3vmnZXFFnXZ/N4DXkOYdu8k+gsWk4eor 1j9l0vw29XnesJaGFVoa =Ygaq -----END PGP SIGNATURE----- --Apple-Mail=_A8DE908C-3E7B-4F1B-826A-AB324F7A18BE-- From owner-svn-src-head@freebsd.org Sat Oct 21 08:10:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABB42E50AB3; Sat, 21 Oct 2017 08:10:39 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-pg0-f48.google.com (mail-pg0-f48.google.com [74.125.83.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 836B177DDA; Sat, 21 Oct 2017 08:10:39 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: by mail-pg0-f48.google.com with SMTP id m18so8282873pgd.13; Sat, 21 Oct 2017 01:10:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=RYpPPACEXlbN9IgHNQ+wEfSym4htlSkDJq/Go05HliU=; b=MNKIXnRoxeTn0+BWqNUQORC4XGfN0/FuyxDrNkCHp+K6J6F5rk9MLWN2v8PU1WDuh0 IK8AMwAM+XjxbhmD7+1GqTwKzsXwE6E9nRDONCTNr7omR4t/0M/Z0W/FBTnfLFv1JahB WoYW+cdGY9nZyht0cWHw9lNX6K3kYc2kpxCeqrYWLZZBHPWNKMeS4qvf6tUCaqtbP0Fz vuF2MQBbp3MSnaxEJHWDhpKhZeBi+gJkxp0obwIiycfeI0YmlnpxSxfAjvFS5Al1ZMYh esNozpXLe3HFDPGAxrbeu76q+rg7l8B/yGbe6btNEpHaHADB7Uz9+5PcJAirUPfqIDZh SbcA== X-Gm-Message-State: AMCzsaV2TH+V6otYC1gUk0nSKw+qy5WWDZwujzHhgoBRoPz+MdL4ixZT rQ9zji+VpGE7jejFT3muUpgbTB0Yl/s= X-Received: by 10.98.133.28 with SMTP id u28mr7392361pfd.241.1508573432753; Sat, 21 Oct 2017 01:10:32 -0700 (PDT) Received: from mail-pg0-f52.google.com (mail-pg0-f52.google.com. [74.125.83.52]) by smtp.gmail.com with ESMTPSA id f6sm3760806pgo.11.2017.10.21.01.10.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Oct 2017 01:10:32 -0700 (PDT) Received: by mail-pg0-f52.google.com with SMTP id s2so8280803pge.10; Sat, 21 Oct 2017 01:10:32 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TtPj6yBBX1VwgSkmhUXNXXGWwYeGqELdOX8e4CbLmcSEL3eh+b0Mg6zu4Hd7+OKEHMX4m68s5VAGlioANBjpE= X-Received: by 10.98.51.198 with SMTP id z189mr7246558pfz.198.1508573431729; Sat, 21 Oct 2017 01:10:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.180.131 with HTTP; Sat, 21 Oct 2017 01:10:31 -0700 (PDT) In-Reply-To: <401F7CFC-1381-4F60-92DE-5771566CD992@gmail.com> References: <201710210723.v9L7Nj6W016491@repo.freebsd.org> <401F7CFC-1381-4F60-92DE-5771566CD992@gmail.com> From: Ryan Libby Date: Sat, 21 Oct 2017 01:10:31 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r324811 - in head/sys/dev/pms/freebsd/driver: common ini/src To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Pedro Giffuni , benno@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 08:10:39 -0000 On Sat, Oct 21, 2017 at 12:43 AM, Ngie Cooper (yaneurabeya) wrote: > >> On Oct 21, 2017, at 00:23, Ryan Libby wrote: >> >> Author: rlibby >> Date: Sat Oct 21 07:23:45 2017 >> New Revision: 324811 >> URL: https://svnweb.freebsd.org/changeset/base/324811 >> >> Log: >> pms/freebsd: fix compiler warnings >> >> - A number of unused variable warnings, >> - a missing prototype warning (actually a dead function), >> - and a potential use of an uninitialized variable. > > You probably should look for the other _fantastic_ fixes that Danny Ryan = cooked up for the driver. I don=E2=80=99t think you=E2=80=99ve found the br= anches that result in logic errors which trigger corruption yet=E2=80=A6 > Cheers, > -Ngie Thanks, I will ping him. Yes, this is just from clang and gcc warnings and of that just for what's under sys/dev/pms/freebsd. I also have patches for fixes for warnings across sys/dev/pms, and pfg has a spelling fixup patch. There seems to be a little uncertainty about how to proceed wrt maintenance of the driver, so I won't be pushing those changes until that is clarified. (Is freebsd the de facto upstream now?) From owner-svn-src-head@freebsd.org Sat Oct 21 12:05:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0444FE54BF5; Sat, 21 Oct 2017 12:05:03 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D457681F45; Sat, 21 Oct 2017 12:05:02 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LC52K6032598; Sat, 21 Oct 2017 12:05:02 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LC512m032589; Sat, 21 Oct 2017 12:05:01 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201710211205.v9LC512m032589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 21 Oct 2017 12:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324814 - in head/sys: arm/include arm64/include kern mips/include powerpc/include riscv/include sparc64/include sys x86/include X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys: arm/include arm64/include kern mips/include powerpc/include riscv/include sparc64/include sys x86/include X-SVN-Commit-Revision: 324814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 12:05:03 -0000 Author: mmel Date: Sat Oct 21 12:05:01 2017 New Revision: 324814 URL: https://svnweb.freebsd.org/changeset/base/324814 Log: Add AT_HWCAP2 ELF auxiliary vector. - allocate value for new AT_HWCAP2 auxiliary vector on all platforms. - expand 'struct sysentvec' by new 'u_long *sv_hwcap2', in exactly same way as for AT_HWCAP. MFC after: 1 month Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D12699 Modified: head/sys/arm/include/elf.h head/sys/arm64/include/elf.h head/sys/kern/imgact_elf.c head/sys/mips/include/elf.h head/sys/powerpc/include/elf.h head/sys/riscv/include/elf.h head/sys/sparc64/include/elf.h head/sys/sys/sysent.h head/sys/x86/include/elf.h Modified: head/sys/arm/include/elf.h ============================================================================== --- head/sys/arm/include/elf.h Sat Oct 21 10:48:06 2017 (r324813) +++ head/sys/arm/include/elf.h Sat Oct 21 12:05:01 2017 (r324814) @@ -86,8 +86,9 @@ __ElfType(Auxinfo); #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ #define AT_HWCAP 25 /* CPU feature flags. */ +#define AT_HWCAP2 26 /* CPU feature flags 2. */ -#define AT_COUNT 26 /* Count of defined aux entry types. */ +#define AT_COUNT 27 /* Count of defined aux entry types. */ #define R_ARM_COUNT 33 /* Count of defined relocation types. */ Modified: head/sys/arm64/include/elf.h ============================================================================== --- head/sys/arm64/include/elf.h Sat Oct 21 10:48:06 2017 (r324813) +++ head/sys/arm64/include/elf.h Sat Oct 21 12:05:01 2017 (r324814) @@ -92,8 +92,9 @@ __ElfType(Auxinfo); #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ #define AT_HWCAP 25 /* CPU feature flags. */ +#define AT_HWCAP2 26 /* CPU feature flags 2. */ -#define AT_COUNT 26 /* Count of defined aux entry types. */ +#define AT_COUNT 27 /* Count of defined aux entry types. */ /* Define "machine" characteristics */ #define ELF_TARG_CLASS ELFCLASS64 Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat Oct 21 10:48:06 2017 (r324813) +++ head/sys/kern/imgact_elf.c Sat Oct 21 12:05:01 2017 (r324814) @@ -1133,6 +1133,8 @@ __elfN(freebsd_fixup)(register_t **stack_base, struct imgp->sysent->sv_stackprot); if (imgp->sysent->sv_hwcap != NULL) AUXARGS_ENTRY(pos, AT_HWCAP, *imgp->sysent->sv_hwcap); + if (imgp->sysent->sv_hwcap2 != NULL) + AUXARGS_ENTRY(pos, AT_HWCAP2, *imgp->sysent->sv_hwcap2); AUXARGS_ENTRY(pos, AT_NULL, 0); free(imgp->auxargs, M_TEMP); Modified: head/sys/mips/include/elf.h ============================================================================== --- head/sys/mips/include/elf.h Sat Oct 21 10:48:06 2017 (r324813) +++ head/sys/mips/include/elf.h Sat Oct 21 12:05:01 2017 (r324814) @@ -146,8 +146,9 @@ __ElfType(Auxinfo); #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ #define AT_HWCAP 25 /* CPU feature flags. */ +#define AT_HWCAP2 26 /* CPU feature flags 2. */ -#define AT_COUNT 26 /* Count of defined aux entry types. */ +#define AT_COUNT 27 /* Count of defined aux entry types. */ #define ET_DYN_LOAD_ADDR 0x0120000 Modified: head/sys/powerpc/include/elf.h ============================================================================== --- head/sys/powerpc/include/elf.h Sat Oct 21 10:48:06 2017 (r324813) +++ head/sys/powerpc/include/elf.h Sat Oct 21 12:05:01 2017 (r324814) @@ -109,8 +109,9 @@ __ElfType(Auxinfo); #define AT_TIMEKEEP 22 /* Pointer to timehands. */ #define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ #define AT_HWCAP 25 /* CPU feature flags. */ +#define AT_HWCAP2 26 /* CPU feature flags 2. */ -#define AT_COUNT 26 /* Count of defined aux entry types. */ +#define AT_COUNT 27 /* Count of defined aux entry types. */ /* * Relocation types. Modified: head/sys/riscv/include/elf.h ============================================================================== --- head/sys/riscv/include/elf.h Sat Oct 21 10:48:06 2017 (r324813) +++ head/sys/riscv/include/elf.h Sat Oct 21 12:05:01 2017 (r324814) @@ -92,8 +92,9 @@ __ElfType(Auxinfo); #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ #define AT_HWCAP 25 /* CPU feature flags. */ +#define AT_HWCAP2 26 /* CPU feature flags 2. */ -#define AT_COUNT 26 /* Count of defined aux entry types. */ +#define AT_COUNT 27 /* Count of defined aux entry types. */ /* Define "machine" characteristics */ #define ELF_TARG_CLASS ELFCLASS64 Modified: head/sys/sparc64/include/elf.h ============================================================================== --- head/sys/sparc64/include/elf.h Sat Oct 21 10:48:06 2017 (r324813) +++ head/sys/sparc64/include/elf.h Sat Oct 21 12:05:01 2017 (r324814) @@ -94,8 +94,9 @@ __ElfType(Auxinfo); #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ #define AT_HWCAP 25 /* CPU feature flags. */ +#define AT_HWCAP2 26 /* CPU feature flags 2. */ -#define AT_COUNT 26 /* Count of defined aux entry types. */ +#define AT_COUNT 27 /* Count of defined aux entry types. */ /* Define "machine" characteristics */ #if __ELF_WORD_SIZE == 32 Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Sat Oct 21 10:48:06 2017 (r324813) +++ head/sys/sys/sysent.h Sat Oct 21 12:05:01 2017 (r324814) @@ -130,6 +130,7 @@ struct sysentvec { void (*sv_thread_detach)(struct thread *); int (*sv_trap)(struct thread *); u_long *sv_hwcap; /* Value passed in AT_HWCAP. */ + u_long *sv_hwcap2; /* Value passed in AT_HWCAP2. */ }; #define SV_ILP32 0x000100 /* 32-bit executable. */ Modified: head/sys/x86/include/elf.h ============================================================================== --- head/sys/x86/include/elf.h Sat Oct 21 10:48:06 2017 (r324813) +++ head/sys/x86/include/elf.h Sat Oct 21 12:05:01 2017 (r324814) @@ -102,8 +102,9 @@ __ElfType(Auxinfo); #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ #define AT_HWCAP 25 /* CPU feature flags. */ +#define AT_HWCAP2 26 /* CPU feature flags 2. */ -#define AT_COUNT 26 /* Count of defined aux entry types. */ +#define AT_COUNT 27 /* Count of defined aux entry types. */ /* * Relocation types. @@ -189,8 +190,9 @@ __ElfType(Auxinfo); #define AT_STACKPROT 23 /* Initial stack protection. */ #define AT_EHDRFLAGS 24 /* e_flags field from elf hdr */ #define AT_HWCAP 25 /* CPU feature flags. */ +#define AT_HWCAP2 26 /* CPU feature flags 2. */ -#define AT_COUNT 26 /* Count of defined aux entry types. */ +#define AT_COUNT 27 /* Count of defined aux entry types. */ /* * Relocation types. From owner-svn-src-head@freebsd.org Sat Oct 21 12:06:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB8ACE54C90; Sat, 21 Oct 2017 12:06:19 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4D85820C1; Sat, 21 Oct 2017 12:06:19 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LC6IMA032683; Sat, 21 Oct 2017 12:06:18 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LC6INJ032680; Sat, 21 Oct 2017 12:06:18 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201710211206.v9LC6INJ032680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 21 Oct 2017 12:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324815 - in head: lib/libc/gen sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head: lib/libc/gen sys/sys X-SVN-Commit-Revision: 324815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 12:06:19 -0000 Author: mmel Date: Sat Oct 21 12:06:18 2017 New Revision: 324815 URL: https://svnweb.freebsd.org/changeset/base/324815 Log: Make elf_aux_info() as public libc function. - Teach elf aux vector functions about newly added AT_HWCAP and AT_HWCAP2 vectors. - Export _elf_aux_info() as new public libc function elf_aux_info(3) The elf_aux_info(3) should be considered as FreeBSD counterpart of glibc getauxval() with more robust interface. Note: We cannot name this new function as getauxval(), with glibc compatible interface. Some ports autodetect its existence and then expects that all Linux specific AT_<*> vectors are defined and implemented. MFC after: 1 month Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D12743 Added: head/sys/sys/auxv.h (contents, props changed) Modified: head/lib/libc/gen/Symbol.map head/lib/libc/gen/auxv.c Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sat Oct 21 12:05:01 2017 (r324814) +++ head/lib/libc/gen/Symbol.map Sat Oct 21 12:06:18 2017 (r324815) @@ -398,6 +398,7 @@ FBSD_1.5 { devname; devname_r; dirname; + elf_aux_info; fts_children; fts_close; fts_get_clientptr; Modified: head/lib/libc/gen/auxv.c ============================================================================== --- head/lib/libc/gen/auxv.c Sat Oct 21 12:05:01 2017 (r324814) +++ head/lib/libc/gen/auxv.c Sat Oct 21 12:06:18 2017 (r324815) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "un-namespace.h" #include "libc_private.h" @@ -65,8 +66,10 @@ __init_elf_aux_vector(void) static pthread_once_t aux_once = PTHREAD_ONCE_INIT; static int pagesize, osreldate, canary_len, ncpus, pagesizes_len; +static int hwcap_present, hwcap2_present; static char *canary, *pagesizes; static void *timekeep; +static u_long hwcap, hwcap2; static void init_aux(void) @@ -83,6 +86,16 @@ init_aux(void) canary_len = aux->a_un.a_val; break; + case AT_HWCAP: + hwcap_present = 1; + hwcap = (u_long)(aux->a_un.a_val); + break; + + case AT_HWCAP2: + hwcap2_present = 1; + hwcap2 = (u_long)(aux->a_un.a_val); + break; + case AT_PAGESIZES: pagesizes = (char *)(aux->a_un.a_ptr); break; @@ -110,6 +123,8 @@ init_aux(void) } } +__weak_reference(_elf_aux_info, elf_aux_info); + int _elf_aux_info(int aux, void *buf, int buflen) { @@ -130,6 +145,20 @@ _elf_aux_info(int aux, void *buf, int buflen) } else res = ENOENT; break; + case AT_HWCAP: + if (hwcap_present && buflen == sizeof(u_long)) { + *(u_long *)buf = hwcap; + res = 0; + } else + res = ENOENT; + break; + case AT_HWCAP2: + if (hwcap2_present && buflen == sizeof(u_long)) { + *(u_long *)buf = hwcap2; + res = 0; + } else + res = ENOENT; + break; case AT_PAGESIZES: if (pagesizes != NULL && pagesizes_len >= buflen) { memcpy(buf, pagesizes, buflen); @@ -137,7 +166,6 @@ _elf_aux_info(int aux, void *buf, int buflen) } else res = ENOENT; break; - case AT_PAGESZ: if (buflen == sizeof(int)) { if (pagesize != 0) { Added: head/sys/sys/auxv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/auxv.h Sat Oct 21 12:06:18 2017 (r324815) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2017 Michal Meloun + * All rights reserved. + * + * 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. + * + * $FreeBSD$ + */ + +#ifndef _SYS_AUXV_H_ +#define _SYS_AUXV_H_ + +#include +#include + +int elf_aux_info(int aux, void *buf, int buflen); + +#endif /* !_SYS_AUXV_H_ */ From owner-svn-src-head@freebsd.org Sat Oct 21 12:15:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FA5DE54EFA; Sat, 21 Oct 2017 12:15:13 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F1B68260A; Sat, 21 Oct 2017 12:15:13 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LCFClo037192; Sat, 21 Oct 2017 12:15:12 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LCFCol037191; Sat, 21 Oct 2017 12:15:12 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201710211215.v9LCFCol037191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 21 Oct 2017 12:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324816 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 324816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 12:15:13 -0000 Author: mmel Date: Sat Oct 21 12:15:12 2017 New Revision: 324816 URL: https://svnweb.freebsd.org/changeset/base/324816 Log: Add C++ decoration to auxv.v forgotten in r324815. MFC after: 1 month Modified: head/sys/sys/auxv.h Modified: head/sys/sys/auxv.h ============================================================================== --- head/sys/sys/auxv.h Sat Oct 21 12:06:18 2017 (r324815) +++ head/sys/sys/auxv.h Sat Oct 21 12:15:12 2017 (r324816) @@ -32,6 +32,8 @@ #include #include +__BEGIN_DECLS int elf_aux_info(int aux, void *buf, int buflen); +__END_DECLS #endif /* !_SYS_AUXV_H_ */ From owner-svn-src-head@freebsd.org Sat Oct 21 12:16:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38043E54F65; Sat, 21 Oct 2017 12:16:23 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 123EF8275F; Sat, 21 Oct 2017 12:16:23 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LCGMF7037278; Sat, 21 Oct 2017 12:16:22 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LCGLhW037272; Sat, 21 Oct 2017 12:16:21 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201710211216.v9LCGLhW037272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 21 Oct 2017 12:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324817 - in head/sys/arm: arm include X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys/arm: arm include X-SVN-Commit-Revision: 324817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 12:16:23 -0000 Author: mmel Date: Sat Oct 21 12:16:21 2017 New Revision: 324817 URL: https://svnweb.freebsd.org/changeset/base/324817 Log: Fullify implementation of AT_HWCAP and AT_HWCAP2 for ARMv6,7. This makes elf_aux_info(3) useable for ARM ports. MFC after: 1 month Modified: head/sys/arm/arm/cpuinfo.c head/sys/arm/arm/elf_machdep.c head/sys/arm/arm/vfp.c head/sys/arm/include/elf.h head/sys/arm/include/md_var.h head/sys/arm/include/vfp.h Modified: head/sys/arm/arm/cpuinfo.c ============================================================================== --- head/sys/arm/arm/cpuinfo.c Sat Oct 21 12:15:12 2017 (r324816) +++ head/sys/arm/arm/cpuinfo.c Sat Oct 21 12:16:21 2017 (r324817) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #if __ARM_ARCH >= 6 void reinit_mmu(uint32_t ttb, uint32_t aux_clr, uint32_t aux_set); @@ -77,6 +79,9 @@ SYSCTL_INT(_hw_cpu_quirks, OID_AUTO, actlr_set, void cpuinfo_init(void) { +#if __ARM_ARCH >= 6 + uint32_t tmp; +#endif /* * Prematurely fetch CPU quirks. Standard fetch for tunable @@ -190,6 +195,47 @@ cpuinfo_init(void) } cpuinfo.dcache_line_mask = cpuinfo.dcache_line_size - 1; cpuinfo.icache_line_mask = cpuinfo.icache_line_size - 1; + + /* Fill AT_HWCAP bits. */ + elf_hwcap |= HWCAP_HALF | HWCAP_FAST_MULT; /* Requierd for all CPUs */ + elf_hwcap |= HWCAP_TLS | HWCAP_EDSP; /* Requierd for v6+ CPUs */ + + tmp = (cpuinfo.id_isar0 >> 24) & 0xF; /* Divide_instrs */ + if (tmp >= 1) + elf_hwcap |= HWCAP_IDIVT; + if (tmp >= 2) + elf_hwcap |= HWCAP_IDIVA; + + tmp = (cpuinfo.id_pfr0 >> 4) & 0xF; /* State1 */ + if (tmp >= 1) + elf_hwcap |= HWCAP_THUMB; + + tmp = (cpuinfo.id_pfr0 >> 12) & 0xF; /* State3 */ + if (tmp >= 1) + elf_hwcap |= HWCAP_THUMBEE; + + tmp = (cpuinfo.id_mmfr0 >> 0) & 0xF; /* VMSA */ + if (tmp >= 5) + elf_hwcap |= HWCAP_LPAE; + + /* Fill AT_HWCAP2 bits. */ + tmp = (cpuinfo.id_isar5 >> 4) & 0xF; /* AES */ + if (tmp >= 1) + elf_hwcap2 |= HWCAP2_AES; + if (tmp >= 2) + elf_hwcap2 |= HWCAP2_PMULL; + + tmp = (cpuinfo.id_isar5 >> 8) & 0xF; /* SHA1 */ + if (tmp >= 1) + elf_hwcap2 |= HWCAP2_SHA1; + + tmp = (cpuinfo.id_isar5 >> 12) & 0xF; /* SHA2 */ + if (tmp >= 1) + elf_hwcap2 |= HWCAP2_SHA2; + + tmp = (cpuinfo.id_isar5 >> 16) & 0xF; /* CRC32 */ + if (tmp >= 1) + elf_hwcap2 |= HWCAP2_CRC32; #endif } Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Sat Oct 21 12:15:12 2017 (r324816) +++ head/sys/arm/arm/elf_machdep.c Sat Oct 21 12:16:21 2017 (r324817) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); static boolean_t elf32_arm_abi_supported(struct image_params *); u_long elf_hwcap; +u_long elf_hwcap2; struct sysentvec elf32_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, @@ -92,6 +93,7 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_thread_detach = NULL, .sv_trap = NULL, .sv_hwcap = &elf_hwcap, + .sv_hwcap2 = &elf_hwcap2, }; INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); Modified: head/sys/arm/arm/vfp.c ============================================================================== --- head/sys/arm/arm/vfp.c Sat Oct 21 12:15:12 2017 (r324816) +++ head/sys/arm/arm/vfp.c Sat Oct 21 12:16:21 2017 (r324817) @@ -149,6 +149,8 @@ vfp_init(void) (tmp & VMVFR1_I_MASK) >> VMVFR1_I_OFF == 1 && (tmp & VMVFR1_SP_MASK) >> VMVFR1_SP_OFF == 1) elf_hwcap |= HWCAP_NEON; + if ((tmp & VMVFR1_FMAC_MASK) >> VMVFR1_FMAC_OFF == 1) + elf_hwcap |= HWCAP_VFPv4; } /* initialize the coprocess 10 and 11 calls Modified: head/sys/arm/include/elf.h ============================================================================== --- head/sys/arm/include/elf.h Sat Oct 21 12:15:12 2017 (r324816) +++ head/sys/arm/include/elf.h Sat Oct 21 12:16:21 2017 (r324817) @@ -117,10 +117,36 @@ __ElfType(Auxinfo); #define ET_DYN_LOAD_ADDR 0x12000 /* Flags passed in AT_HWCAP. */ +#define HWCAP_SWP 0x00000001 /* Unsupported, never set. */ +#define HWCAP_HALF 0x00000002 /* Always set. */ +#define HWCAP_THUMB 0x00000004 +#define HWCAP_26BIT 0x00000008 /* Unsupported, never set. */ +#define HWCAP_FAST_MULT 0x00000010 /* Always set. */ +#define HWCAP_FPA 0x00000020 /* Unsupported, never set. */ #define HWCAP_VFP 0x00000040 +#define HWCAP_EDSP 0x00000080 /* Always set for ARMv6+. */ +#define HWCAP_JAVA 0x00000100 /* Unsupported, never set. */ +#define HWCAP_IWMMXT 0x00000200 /* Unsupported, never set. */ +#define HWCAP_CRUNCH 0x00000400 /* Unsupported, never set. */ +#define HWCAP_THUMBEE 0x00000800 #define HWCAP_NEON 0x00001000 #define HWCAP_VFPv3 0x00002000 #define HWCAP_VFPv3D16 0x00004000 +#define HWCAP_TLS 0x00008000 /* Always set for ARMv6+. */ +#define HWCAP_VFPv4 0x00010000 +#define HWCAP_IDIVA 0x00020000 +#define HWCAP_IDIVT 0x00040000 #define HWCAP_VFPD32 0x00080000 +#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) +#define HWCAP_LPAE 0x00100000 +#define HWCAP_EVTSTRM 0x00200000 /* Not implemented yet. */ + + +/* Flags passed in AT_HWCAP2. */ +#define HWCAP2_AES 0x00000001 +#define HWCAP2_PMULL 0x00000002 +#define HWCAP2_SHA1 0x00000004 +#define HWCAP2_SHA2 0x00000008 +#define HWCAP2_CRC32 0x00000010 #endif /* !_MACHINE_ELF_H_ */ Modified: head/sys/arm/include/md_var.h ============================================================================== --- head/sys/arm/include/md_var.h Sat Oct 21 12:15:12 2017 (r324816) +++ head/sys/arm/include/md_var.h Sat Oct 21 12:16:21 2017 (r324817) @@ -39,6 +39,7 @@ extern int szsigcode; extern uint32_t *vm_page_dump; extern int vm_page_dump_size; extern u_long elf_hwcap; +extern u_long elf_hwcap2; extern int (*_arm_memcpy)(void *, void *, int, int); extern int (*_arm_bzero)(void *, int, int); Modified: head/sys/arm/include/vfp.h ============================================================================== --- head/sys/arm/include/vfp.h Sat Oct 21 12:15:12 2017 (r324816) +++ head/sys/arm/include/vfp.h Sat Oct 21 12:16:21 2017 (r324817) @@ -119,6 +119,12 @@ #define VMVFR0_RB_MASK (0x0000000f) /* VFP 64 bit media support */ /* VMVFR1 */ +#define VMVFR1_FMAC_OFF 28 +#define VMVFR1_FMAC_MASK (0xf0000000) /* Neon FMAC support */ +#define VMVFR1_VFP_HP_OFF 24 +#define VMVFR1_VFP_HP_MASK (0x0f000000) /* VFP half prec support */ +#define VMVFR1_HP_OFF 20 +#define VMVFR1_HP_MASK (0x00f00000) /* Neon half prec support */ #define VMVFR1_SP_OFF 16 #define VMVFR1_SP_MASK (0x000f0000) /* Neon single prec support */ #define VMVFR1_I_OFF 12 From owner-svn-src-head@freebsd.org Sat Oct 21 15:47:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDAA1E3163E; Sat, 21 Oct 2017 15:47:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76C932B1C; Sat, 21 Oct 2017 15:47:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LFlgGj024099; Sat, 21 Oct 2017 15:47:42 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LFle2e024076; Sat, 21 Oct 2017 15:47:40 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710211547.v9LFle2e024076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 21 Oct 2017 15:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324820 - in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/interrupt-controller include/dt-bindings/mux include/... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/interrupt-controller include/dt-bindings/mux include/dt-bindings/pinctrl inclu... X-SVN-Commit-Revision: 324820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 15:47:43 -0000 Author: manu Date: Sat Oct 21 15:47:40 2017 New Revision: 324820 URL: https://svnweb.freebsd.org/changeset/base/324820 Log: dts: Update our device tree sources file fomr Linux 4.13 Added: - copied unchanged from r324818, vendor/device-tree/dist/src/arm/am335x-boneblue.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/armada-385-linksys-rango.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/bcm2837-rpi-3-b.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/bcm283x-rpi-usb-otg.dtsi - copied unchanged from r324818, vendor/device-tree/dist/src/arm/imx6dl-gw560x.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/imx6q-gw560x.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/imx6qdl-gw560x.dtsi - copied unchanged from r324818, vendor/device-tree/dist/src/arm/imx7d-pico.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/keystone-k2g-ice.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/owl-s500-guitar-bb-rev-b.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/owl-s500-guitar.dtsi - copied unchanged from r324818, vendor/device-tree/dist/src/arm/owl-s500.dtsi - copied unchanged from r324818, vendor/device-tree/dist/src/arm/r7s72100-gr-peach.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/r8a7743-iwg20d-q7.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/r8a7743-iwg20m.dtsi - copied unchanged from r324818, vendor/device-tree/dist/src/arm/rv1108-evb.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/rv1108.dtsi - copied unchanged from r324818, vendor/device-tree/dist/src/arm/stm32f746-disco.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/stm32f769-disco.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/stm32h743i-disco.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/sun8i-h3-nanopi-m1-plus.dts - copied unchanged from r324818, vendor/device-tree/dist/src/arm/sun8i-v3s-licheepi-zero-dock.dts head/sys/gnu/dts/include/dt-bindings/clock/bcm-sr.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/bcm-sr.h head/sys/gnu/dts/include/dt-bindings/clock/boston-clock.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/boston-clock.h head/sys/gnu/dts/include/dt-bindings/clock/cortina,gemini-clock.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/cortina,gemini-clock.h head/sys/gnu/dts/include/dt-bindings/clock/omap4.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/omap4.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq8074.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-ipq8074.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7790-cpg-mssr.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/r8a7790-cpg-mssr.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7791-cpg-mssr.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/r8a7791-cpg-mssr.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7792-cpg-mssr.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/r8a7792-cpg-mssr.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7793-cpg-mssr.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/r8a7793-cpg-mssr.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7794-cpg-mssr.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/r8a7794-cpg-mssr.h head/sys/gnu/dts/include/dt-bindings/clock/rk3128-cru.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/rk3128-cru.h head/sys/gnu/dts/include/dt-bindings/clock/sun8i-a83t-ccu.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/sun8i-a83t-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/sun8i-de2.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/clock/sun8i-de2.h head/sys/gnu/dts/include/dt-bindings/interrupt-controller/mvebu-icu.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/interrupt-controller/mvebu-icu.h head/sys/gnu/dts/include/dt-bindings/mux/ - copied from r324818, vendor/device-tree/dist/include/dt-bindings/mux/ head/sys/gnu/dts/include/dt-bindings/pinctrl/brcm,pinctrl-stingray.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/pinctrl/brcm,pinctrl-stingray.h head/sys/gnu/dts/include/dt-bindings/pinctrl/r7s72100-pinctrl.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/pinctrl/r7s72100-pinctrl.h head/sys/gnu/dts/include/dt-bindings/power/mt6797-power.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/power/mt6797-power.h head/sys/gnu/dts/include/dt-bindings/power/owl-s500-powergate.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/power/owl-s500-powergate.h head/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr-s10.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/reset/altr,rst-mgr-s10.h head/sys/gnu/dts/include/dt-bindings/reset/cortina,gemini-reset.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/reset/cortina,gemini-reset.h head/sys/gnu/dts/include/dt-bindings/reset/sun8i-a83t-ccu.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/reset/sun8i-a83t-ccu.h head/sys/gnu/dts/include/dt-bindings/reset/sun8i-de2.h - copied unchanged from r324818, vendor/device-tree/dist/include/dt-bindings/reset/sun8i-de2.h Directory Properties: head/sys/gnu/dts/arm/am335x-boneblue.dts (props changed) head/sys/gnu/dts/arm/armada-385-linksys-rango.dts (props changed) head/sys/gnu/dts/arm/bcm2837-rpi-3-b.dts (props changed) head/sys/gnu/dts/arm/bcm283x-rpi-usb-otg.dtsi (props changed) head/sys/gnu/dts/arm/imx6dl-gw560x.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw560x.dts (props changed) head/sys/gnu/dts/arm/imx6qdl-gw560x.dtsi (props changed) head/sys/gnu/dts/arm/imx7d-pico.dts (props changed) head/sys/gnu/dts/arm/keystone-k2g-ice.dts (props changed) head/sys/gnu/dts/arm/owl-s500-guitar-bb-rev-b.dts (props changed) head/sys/gnu/dts/arm/owl-s500-guitar.dtsi (props changed) head/sys/gnu/dts/arm/owl-s500.dtsi (props changed) head/sys/gnu/dts/arm/r7s72100-gr-peach.dts (props changed) head/sys/gnu/dts/arm/r8a7743-iwg20d-q7.dts (props changed) head/sys/gnu/dts/arm/r8a7743-iwg20m.dtsi (props changed) head/sys/gnu/dts/arm/rv1108-evb.dts (props changed) head/sys/gnu/dts/arm/rv1108.dtsi (props changed) head/sys/gnu/dts/arm/stm32f746-disco.dts (props changed) head/sys/gnu/dts/arm/stm32f769-disco.dts (props changed) head/sys/gnu/dts/arm/stm32h743i-disco.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1-plus.dts (props changed) head/sys/gnu/dts/arm/sun8i-v3s-licheepi-zero-dock.dts (props changed) Modified: head/sys/gnu/dts/arm/aks-cdu.dts head/sys/gnu/dts/arm/am335x-baltos.dtsi head/sys/gnu/dts/arm/am335x-base0033.dts head/sys/gnu/dts/arm/am335x-bone-common.dtsi head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts head/sys/gnu/dts/arm/am335x-boneblack.dts head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts head/sys/gnu/dts/arm/am335x-nano.dts head/sys/gnu/dts/arm/am335x-pepper.dts head/sys/gnu/dts/arm/am335x-phycore-som.dtsi head/sys/gnu/dts/arm/am335x-shc.dts head/sys/gnu/dts/arm/am335x-sl50.dts head/sys/gnu/dts/arm/am33xx.dtsi head/sys/gnu/dts/arm/am4372.dtsi head/sys/gnu/dts/arm/am437x-gp-evm.dts head/sys/gnu/dts/arm/am437x-idk-evm.dts head/sys/gnu/dts/arm/am437x-sk-evm.dts head/sys/gnu/dts/arm/am43x-epos-evm.dts head/sys/gnu/dts/arm/am43xx-clocks.dtsi head/sys/gnu/dts/arm/am571x-idk.dts head/sys/gnu/dts/arm/am572x-idk.dts head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi head/sys/gnu/dts/arm/animeo_ip.dts head/sys/gnu/dts/arm/armada-370.dtsi head/sys/gnu/dts/arm/armada-385-linksys-caiman.dts head/sys/gnu/dts/arm/armada-385-linksys-cobra.dts head/sys/gnu/dts/arm/armada-385-linksys-shelby.dts (contents, props changed) head/sys/gnu/dts/arm/armada-385-linksys.dtsi head/sys/gnu/dts/arm/armada-385-turris-omnia.dts head/sys/gnu/dts/arm/armada-388-gp.dts head/sys/gnu/dts/arm/armada-38x.dtsi head/sys/gnu/dts/arm/armada-xp-98dx3236.dtsi head/sys/gnu/dts/arm/armada-xp-98dx4251.dtsi head/sys/gnu/dts/arm/armada-xp-linksys-mamba.dts head/sys/gnu/dts/arm/armada-xp-mv78230.dtsi head/sys/gnu/dts/arm/armada-xp-mv78260.dtsi head/sys/gnu/dts/arm/armada-xp-mv78460.dtsi head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/at91-cosino.dtsi head/sys/gnu/dts/arm/at91-kizbox.dts head/sys/gnu/dts/arm/at91-kizbox2.dts head/sys/gnu/dts/arm/at91-kizboxmini.dts head/sys/gnu/dts/arm/at91-linea.dtsi head/sys/gnu/dts/arm/at91-qil_a9260.dts head/sys/gnu/dts/arm/at91-sama5d2_xplained.dts head/sys/gnu/dts/arm/at91-sama5d3_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4_ma5d4.dtsi head/sys/gnu/dts/arm/at91-sama5d4_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4ek.dts head/sys/gnu/dts/arm/at91-tse850-3.dts head/sys/gnu/dts/arm/at91sam9260.dtsi head/sys/gnu/dts/arm/at91sam9261.dtsi head/sys/gnu/dts/arm/at91sam9261ek.dts head/sys/gnu/dts/arm/at91sam9263.dtsi head/sys/gnu/dts/arm/at91sam9263ek.dts head/sys/gnu/dts/arm/at91sam9g20ek_common.dtsi head/sys/gnu/dts/arm/at91sam9g45.dtsi head/sys/gnu/dts/arm/at91sam9m10g45ek.dts head/sys/gnu/dts/arm/at91sam9n12.dtsi head/sys/gnu/dts/arm/at91sam9n12ek.dts head/sys/gnu/dts/arm/at91sam9rl.dtsi head/sys/gnu/dts/arm/at91sam9rlek.dts head/sys/gnu/dts/arm/at91sam9x5.dtsi head/sys/gnu/dts/arm/at91sam9x5cm.dtsi head/sys/gnu/dts/arm/axp209.dtsi head/sys/gnu/dts/arm/axp22x.dtsi head/sys/gnu/dts/arm/bcm-cygnus.dtsi head/sys/gnu/dts/arm/bcm-nsp.dtsi head/sys/gnu/dts/arm/bcm2835-rpi-zero.dts head/sys/gnu/dts/arm/bcm2835-rpi.dtsi head/sys/gnu/dts/arm/bcm2835.dtsi head/sys/gnu/dts/arm/bcm2836.dtsi head/sys/gnu/dts/arm/bcm283x.dtsi head/sys/gnu/dts/arm/bcm5301x.dtsi head/sys/gnu/dts/arm/bcm911360_entphn.dts head/sys/gnu/dts/arm/da850-evm.dts head/sys/gnu/dts/arm/da850-lcdk.dts head/sys/gnu/dts/arm/da850-lego-ev3.dts head/sys/gnu/dts/arm/da850.dtsi head/sys/gnu/dts/arm/dm8168-evm.dts head/sys/gnu/dts/arm/dm816x.dtsi head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7.dtsi head/sys/gnu/dts/arm/dra71-evm.dts head/sys/gnu/dts/arm/dra72-evm-common.dtsi head/sys/gnu/dts/arm/dra7xx-clocks.dtsi head/sys/gnu/dts/arm/emev2.dtsi head/sys/gnu/dts/arm/ethernut5.dts head/sys/gnu/dts/arm/exynos3250-monk.dts head/sys/gnu/dts/arm/exynos3250-rinato.dts head/sys/gnu/dts/arm/exynos4.dtsi head/sys/gnu/dts/arm/exynos4210-origen.dts head/sys/gnu/dts/arm/exynos4210-trats.dts head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi head/sys/gnu/dts/arm/exynos4412-odroidu3.dts head/sys/gnu/dts/arm/exynos4412-odroidx.dts head/sys/gnu/dts/arm/exynos4412-trats2.dts head/sys/gnu/dts/arm/exynos5.dtsi head/sys/gnu/dts/arm/exynos5250-arndale.dts head/sys/gnu/dts/arm/exynos5250-pinctrl.dtsi head/sys/gnu/dts/arm/exynos5250-smdk5250.dts head/sys/gnu/dts/arm/exynos5250-snow-common.dtsi head/sys/gnu/dts/arm/exynos5250-spring.dts head/sys/gnu/dts/arm/exynos5250.dtsi head/sys/gnu/dts/arm/exynos5420-arndale-octa.dts head/sys/gnu/dts/arm/exynos5420-peach-pit.dts head/sys/gnu/dts/arm/exynos5420-pinctrl.dtsi head/sys/gnu/dts/arm/exynos5420-smdk5420.dts head/sys/gnu/dts/arm/exynos5420.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-audio.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi head/sys/gnu/dts/arm/exynos5440.dtsi head/sys/gnu/dts/arm/exynos5800-peach-pi.dts head/sys/gnu/dts/arm/ge863-pro3.dtsi head/sys/gnu/dts/arm/gemini-nas4220b.dts (contents, props changed) head/sys/gnu/dts/arm/gemini-sq201.dts (contents, props changed) head/sys/gnu/dts/arm/gemini.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx23-sansa.dts head/sys/gnu/dts/arm/imx25-karo-tx25.dts head/sys/gnu/dts/arm/imx25-pdk.dts head/sys/gnu/dts/arm/imx25.dtsi head/sys/gnu/dts/arm/imx27-phytec-phycard-s-som.dtsi head/sys/gnu/dts/arm/imx27-phytec-phycore-som.dtsi head/sys/gnu/dts/arm/imx28-cfa10037.dts head/sys/gnu/dts/arm/imx28-cfa10049.dts head/sys/gnu/dts/arm/imx28-cfa10057.dts head/sys/gnu/dts/arm/imx28-cfa10058.dts head/sys/gnu/dts/arm/imx28-eukrea-mbmx287lc.dts head/sys/gnu/dts/arm/imx28-evk.dts head/sys/gnu/dts/arm/imx28-m28cu3.dts head/sys/gnu/dts/arm/imx50-evk.dts head/sys/gnu/dts/arm/imx50.dtsi head/sys/gnu/dts/arm/imx51-apf51.dts head/sys/gnu/dts/arm/imx53-mba53.dts head/sys/gnu/dts/arm/imx53-qsb-common.dtsi head/sys/gnu/dts/arm/imx53-smd.dts head/sys/gnu/dts/arm/imx53-tqma53.dtsi head/sys/gnu/dts/arm/imx53-tx53.dtsi head/sys/gnu/dts/arm/imx53-voipac-dmm-668.dtsi head/sys/gnu/dts/arm/imx6dl-riotboard.dts head/sys/gnu/dts/arm/imx6dl-sabrelite.dts head/sys/gnu/dts/arm/imx6dl-sabresd.dts head/sys/gnu/dts/arm/imx6dl.dtsi head/sys/gnu/dts/arm/imx6q-ba16.dtsi head/sys/gnu/dts/arm/imx6q-cm-fx6.dts head/sys/gnu/dts/arm/imx6q-dmo-edmqmx6.dts head/sys/gnu/dts/arm/imx6q-evi.dts head/sys/gnu/dts/arm/imx6q-gw5400-a.dts head/sys/gnu/dts/arm/imx6q-novena.dts head/sys/gnu/dts/arm/imx6q-sabrelite.dts head/sys/gnu/dts/arm/imx6q-sabresd.dts head/sys/gnu/dts/arm/imx6q-utilite-pro.dts head/sys/gnu/dts/arm/imx6q-zii-rdu2.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q.dtsi head/sys/gnu/dts/arm/imx6qdl-apf6dev.dtsi head/sys/gnu/dts/arm/imx6qdl-aristainetos.dtsi head/sys/gnu/dts/arm/imx6qdl-aristainetos2.dtsi head/sys/gnu/dts/arm/imx6qdl-colibri.dtsi head/sys/gnu/dts/arm/imx6qdl-gw53xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw54xx.dtsi head/sys/gnu/dts/arm/imx6qdl-microsom-ar8035.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6_max.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6_som2.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6x.dtsi head/sys/gnu/dts/arm/imx6qdl-phytec-pfla02.dtsi head/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi head/sys/gnu/dts/arm/imx6qdl-sabrelite.dtsi head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi head/sys/gnu/dts/arm/imx6qdl-tx6.dtsi head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6qp-zii-rdu2.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qp.dtsi head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sx-nitrogen6sx.dts head/sys/gnu/dts/arm/imx6sx-sdb.dts head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-opos6ul.dtsi head/sys/gnu/dts/arm/imx6ul-tx6ul-mainboard.dts head/sys/gnu/dts/arm/imx6ul-tx6ul.dtsi head/sys/gnu/dts/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx7-colibri.dtsi head/sys/gnu/dts/arm/imx7d-nitrogen7.dts head/sys/gnu/dts/arm/imx7d-pinfunc.h head/sys/gnu/dts/arm/imx7d-sdb.dts head/sys/gnu/dts/arm/imx7d.dtsi head/sys/gnu/dts/arm/imx7s-warp.dts head/sys/gnu/dts/arm/imx7s.dtsi head/sys/gnu/dts/arm/keystone-k2g-evm.dts head/sys/gnu/dts/arm/keystone-k2g.dtsi head/sys/gnu/dts/arm/kirkwood-openblocks_a6.dts head/sys/gnu/dts/arm/logicpd-torpedo-som.dtsi head/sys/gnu/dts/arm/ls1021a.dtsi head/sys/gnu/dts/arm/meson.dtsi head/sys/gnu/dts/arm/meson6-atv1200.dts head/sys/gnu/dts/arm/meson6.dtsi head/sys/gnu/dts/arm/meson8.dtsi head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/motorola-cpcap-mapphone.dtsi (contents, props changed) head/sys/gnu/dts/arm/moxart.dtsi head/sys/gnu/dts/arm/mt2701-evb.dts head/sys/gnu/dts/arm/mt2701.dtsi head/sys/gnu/dts/arm/mt7623.dtsi head/sys/gnu/dts/arm/omap3-cm-t3x.dtsi head/sys/gnu/dts/arm/omap3-devkit8000-common.dtsi head/sys/gnu/dts/arm/omap3-evm-37xx.dts head/sys/gnu/dts/arm/omap3-evm-common.dtsi head/sys/gnu/dts/arm/omap3-gta04.dtsi head/sys/gnu/dts/arm/omap3-overo-base.dtsi head/sys/gnu/dts/arm/omap3-sb-t35.dtsi head/sys/gnu/dts/arm/omap3-tao3530.dtsi head/sys/gnu/dts/arm/omap4-droid4-xt894.dts head/sys/gnu/dts/arm/omap4-duovero.dtsi head/sys/gnu/dts/arm/omap4-var-som-om44.dtsi head/sys/gnu/dts/arm/omap4.dtsi head/sys/gnu/dts/arm/omap44xx-clocks.dtsi head/sys/gnu/dts/arm/omap5-cm-t54.dts head/sys/gnu/dts/arm/omap5-sbc-t54.dts head/sys/gnu/dts/arm/omap5-uevm.dts head/sys/gnu/dts/arm/omap54xx-clocks.dtsi head/sys/gnu/dts/arm/pm9g45.dts head/sys/gnu/dts/arm/pxa25x.dtsi head/sys/gnu/dts/arm/pxa27x.dtsi head/sys/gnu/dts/arm/qcom-apq8060-dragonboard.dts head/sys/gnu/dts/arm/qcom-apq8064-arrow-sd-600eval.dts head/sys/gnu/dts/arm/qcom-apq8064-asus-nexus7-flo.dts head/sys/gnu/dts/arm/qcom-apq8064-cm-qs600.dts head/sys/gnu/dts/arm/qcom-apq8064-ifc6410.dts head/sys/gnu/dts/arm/qcom-apq8064-sony-xperia-yuga.dts head/sys/gnu/dts/arm/qcom-apq8064.dtsi head/sys/gnu/dts/arm/qcom-apq8074-dragonboard.dts head/sys/gnu/dts/arm/qcom-ipq4019.dtsi head/sys/gnu/dts/arm/qcom-ipq8064.dtsi head/sys/gnu/dts/arm/qcom-msm8660.dtsi head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-honami.dts head/sys/gnu/dts/arm/qcom-msm8974.dtsi head/sys/gnu/dts/arm/qcom-pm8941.dtsi head/sys/gnu/dts/arm/r7s72100.dtsi head/sys/gnu/dts/arm/r8a73a4.dtsi head/sys/gnu/dts/arm/r8a7740-armadillo800eva.dts head/sys/gnu/dts/arm/r8a7740.dtsi head/sys/gnu/dts/arm/r8a7778.dtsi head/sys/gnu/dts/arm/r8a7779.dtsi head/sys/gnu/dts/arm/r8a7790.dtsi head/sys/gnu/dts/arm/r8a7791.dtsi head/sys/gnu/dts/arm/r8a7793-gose.dts head/sys/gnu/dts/arm/r8a7793.dtsi head/sys/gnu/dts/arm/r8a7794.dtsi head/sys/gnu/dts/arm/r8a77xx-aa104xd12-panel.dtsi head/sys/gnu/dts/arm/r8a77xx-aa121td01-panel.dtsi head/sys/gnu/dts/arm/rk3229-evb.dts head/sys/gnu/dts/arm/rk322x.dtsi head/sys/gnu/dts/arm/rk3288-firefly-reload.dts head/sys/gnu/dts/arm/rk3288-firefly.dtsi head/sys/gnu/dts/arm/rk3288-rock2-som.dtsi head/sys/gnu/dts/arm/rk3288-rock2-square.dts head/sys/gnu/dts/arm/rk3288-veyron.dtsi head/sys/gnu/dts/arm/rk3288.dtsi head/sys/gnu/dts/arm/sama5d2.dtsi head/sys/gnu/dts/arm/sama5d3.dtsi head/sys/gnu/dts/arm/sama5d3xcm.dtsi head/sys/gnu/dts/arm/sama5d3xcm_cmp.dtsi head/sys/gnu/dts/arm/sama5d4.dtsi head/sys/gnu/dts/arm/sh73a0.dtsi head/sys/gnu/dts/arm/socfpga.dtsi head/sys/gnu/dts/arm/socfpga_arria10_socdk.dtsi head/sys/gnu/dts/arm/socfpga_cyclone5_de0_sockit.dts head/sys/gnu/dts/arm/socfpga_cyclone5_mcvevk.dts head/sys/gnu/dts/arm/socfpga_cyclone5_vining_fpga.dts head/sys/gnu/dts/arm/stm32429i-eval.dts head/sys/gnu/dts/arm/stm32f429-disco.dts head/sys/gnu/dts/arm/stm32f429.dtsi head/sys/gnu/dts/arm/stm32f746.dtsi head/sys/gnu/dts/arm/stm32h743-pinctrl.dtsi (contents, props changed) head/sys/gnu/dts/arm/stm32h743.dtsi (contents, props changed) head/sys/gnu/dts/arm/sun4i-a10-a1000.dts head/sys/gnu/dts/arm/sun4i-a10-ba10-tvbox.dts head/sys/gnu/dts/arm/sun4i-a10-chuwi-v7-cw0825.dts head/sys/gnu/dts/arm/sun4i-a10-cubieboard.dts head/sys/gnu/dts/arm/sun4i-a10-dserve-dsrv9703c.dts head/sys/gnu/dts/arm/sun4i-a10-gemei-g9.dts head/sys/gnu/dts/arm/sun4i-a10-hackberry.dts head/sys/gnu/dts/arm/sun4i-a10-hyundai-a7hd.dts head/sys/gnu/dts/arm/sun4i-a10-inet1.dts head/sys/gnu/dts/arm/sun4i-a10-inet97fv2.dts head/sys/gnu/dts/arm/sun4i-a10-inet9f-rev03.dts head/sys/gnu/dts/arm/sun4i-a10-itead-iteaduino-plus.dts head/sys/gnu/dts/arm/sun4i-a10-jesurun-q5.dts head/sys/gnu/dts/arm/sun4i-a10-marsboard.dts head/sys/gnu/dts/arm/sun4i-a10-mini-xplus.dts head/sys/gnu/dts/arm/sun4i-a10-mk802.dts head/sys/gnu/dts/arm/sun4i-a10-mk802ii.dts head/sys/gnu/dts/arm/sun4i-a10-olinuxino-lime.dts head/sys/gnu/dts/arm/sun4i-a10-pcduino.dts head/sys/gnu/dts/arm/sun4i-a10-pov-protab2-ips9.dts head/sys/gnu/dts/arm/sun4i-a10.dtsi head/sys/gnu/dts/arm/sun5i-a10s-auxtek-t003.dts head/sys/gnu/dts/arm/sun5i-a10s-auxtek-t004.dts head/sys/gnu/dts/arm/sun5i-a10s-olinuxino-micro.dts head/sys/gnu/dts/arm/sun5i-a10s-wobo-i5.dts head/sys/gnu/dts/arm/sun5i-a10s.dtsi head/sys/gnu/dts/arm/sun5i-a13-empire-electronix-d709.dts head/sys/gnu/dts/arm/sun5i-a13-hsg-h702.dts head/sys/gnu/dts/arm/sun5i-a13-olinuxino.dts head/sys/gnu/dts/arm/sun5i-r8-chip.dts head/sys/gnu/dts/arm/sun5i.dtsi head/sys/gnu/dts/arm/sun6i-a31-hummingbird.dts head/sys/gnu/dts/arm/sun6i-a31.dtsi head/sys/gnu/dts/arm/sun6i-a31s-primo81.dts head/sys/gnu/dts/arm/sun6i-a31s-sinovoip-bpi-m2.dts head/sys/gnu/dts/arm/sun7i-a20-bananapi-m1-plus.dts head/sys/gnu/dts/arm/sun7i-a20-bananapi.dts head/sys/gnu/dts/arm/sun7i-a20-bananapro.dts head/sys/gnu/dts/arm/sun7i-a20-cubieboard2.dts head/sys/gnu/dts/arm/sun7i-a20-cubietruck.dts head/sys/gnu/dts/arm/sun7i-a20-hummingbird.dts head/sys/gnu/dts/arm/sun7i-a20-i12-tvbox.dts head/sys/gnu/dts/arm/sun7i-a20-icnova-swac.dts head/sys/gnu/dts/arm/sun7i-a20-itead-ibox.dts head/sys/gnu/dts/arm/sun7i-a20-lamobo-r1.dts head/sys/gnu/dts/arm/sun7i-a20-m3.dts head/sys/gnu/dts/arm/sun7i-a20-mk808c.dts head/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3-nano.dts head/sys/gnu/dts/arm/sun7i-a20-pcduino3.dts head/sys/gnu/dts/arm/sun7i-a20-wexler-tab7200.dts head/sys/gnu/dts/arm/sun7i-a20-wits-pro-a20-dkt.dts head/sys/gnu/dts/arm/sun7i-a20.dtsi head/sys/gnu/dts/arm/sun8i-a33-sinlinx-sina33.dts head/sys/gnu/dts/arm/sun8i-a33.dtsi head/sys/gnu/dts/arm/sun8i-a83t-allwinner-h8homlet-v2.dts head/sys/gnu/dts/arm/sun8i-a83t-cubietruck-plus.dts head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts head/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-2.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-plus.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-plus2e.dts head/sys/gnu/dts/arm/sun8i-v3s.dtsi head/sys/gnu/dts/arm/sunxi-common-regulators.dtsi head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi (contents, props changed) head/sys/gnu/dts/arm/tango4-vantage-1172.dts head/sys/gnu/dts/arm/tegra124-apalis-eval.dts head/sys/gnu/dts/arm/tegra124-apalis.dtsi head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts head/sys/gnu/dts/arm/tegra124.dtsi head/sys/gnu/dts/arm/tegra20-harmony.dts head/sys/gnu/dts/arm/tegra20-tamonten.dtsi head/sys/gnu/dts/arm/tegra20-tec.dts head/sys/gnu/dts/arm/tegra20-trimslice.dts head/sys/gnu/dts/arm/tegra20.dtsi head/sys/gnu/dts/arm/tegra30-apalis-eval.dts head/sys/gnu/dts/arm/tegra30-apalis.dtsi head/sys/gnu/dts/arm/tegra30-beaver.dts head/sys/gnu/dts/arm/tegra30-cardhu.dtsi head/sys/gnu/dts/arm/tegra30.dtsi head/sys/gnu/dts/arm/tny_a9260_common.dtsi head/sys/gnu/dts/arm/tny_a9263.dts head/sys/gnu/dts/arm/twl4030.dtsi head/sys/gnu/dts/arm/uniphier-ld4-ref.dts head/sys/gnu/dts/arm/uniphier-ld4.dtsi head/sys/gnu/dts/arm/uniphier-ld6b-ref.dts head/sys/gnu/dts/arm/uniphier-ld6b.dtsi head/sys/gnu/dts/arm/uniphier-pro4-ace.dts head/sys/gnu/dts/arm/uniphier-pro4-ref.dts head/sys/gnu/dts/arm/uniphier-pro4-sanji.dts head/sys/gnu/dts/arm/uniphier-pro4.dtsi head/sys/gnu/dts/arm/uniphier-pro5.dtsi head/sys/gnu/dts/arm/uniphier-pxs2-gentil.dts head/sys/gnu/dts/arm/uniphier-pxs2-vodka.dts head/sys/gnu/dts/arm/uniphier-pxs2.dtsi head/sys/gnu/dts/arm/uniphier-ref-daughter.dtsi head/sys/gnu/dts/arm/uniphier-sld3-ref.dts head/sys/gnu/dts/arm/uniphier-sld3.dtsi head/sys/gnu/dts/arm/uniphier-sld8-ref.dts head/sys/gnu/dts/arm/uniphier-sld8.dtsi head/sys/gnu/dts/arm/uniphier-support-card.dtsi head/sys/gnu/dts/arm/usb_a9260_common.dtsi head/sys/gnu/dts/arm/usb_a9263.dts head/sys/gnu/dts/arm/vf610-zii-dev-rev-b.dts head/sys/gnu/dts/include/dt-bindings/clock/exynos5420.h head/sys/gnu/dts/include/dt-bindings/clock/gxbb-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/hi3660-clock.h head/sys/gnu/dts/include/dt-bindings/clock/hi6220-clock.h head/sys/gnu/dts/include/dt-bindings/clock/histb-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx7d-clock.h head/sys/gnu/dts/include/dt-bindings/clock/meson8b-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/mt2701-clk.h head/sys/gnu/dts/include/dt-bindings/clock/mt8173-clk.h head/sys/gnu/dts/include/dt-bindings/clock/r7s72100-clock.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7791-clock.h head/sys/gnu/dts/include/dt-bindings/clock/rk3228-cru.h head/sys/gnu/dts/include/dt-bindings/clock/rk3399-cru.h head/sys/gnu/dts/include/dt-bindings/clock/sun5i-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/zx296718-clock.h head/sys/gnu/dts/include/dt-bindings/gpio/gpio.h head/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/arm/am335x-baltos-leds.dtsi (props changed) head/sys/gnu/dts/arm/armada-385-synology-ds116.dts (props changed) head/sys/gnu/dts/arm/bcm4708-linksys-ea6300-v1.dts (props changed) head/sys/gnu/dts/arm/bcm47081-tplink-archer-c5-v2.dts (props changed) head/sys/gnu/dts/arm/bcm4709-linksys-ea9200.dts (props changed) head/sys/gnu/dts/arm/bcm47094-linksys-panamera.dts (props changed) head/sys/gnu/dts/arm/bcm953012hr.dts (props changed) head/sys/gnu/dts/arm/exynos5420-tmu-sensor-conf.dtsi (props changed) head/sys/gnu/dts/arm/gemini-rut1xx.dts (props changed) head/sys/gnu/dts/arm/gemini-wbd111.dts (props changed) head/sys/gnu/dts/arm/gemini-wbd222.dts (props changed) head/sys/gnu/dts/arm/imx28-duckbill-2-485.dts (props changed) head/sys/gnu/dts/arm/imx28-duckbill-2-enocean.dts (props changed) head/sys/gnu/dts/arm/imx28-duckbill-2-spi.dts (props changed) head/sys/gnu/dts/arm/imx28-duckbill-2.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw5903.dts (props changed) head/sys/gnu/dts/arm/imx6dl-gw5904.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw5903.dts (props changed) head/sys/gnu/dts/arm/imx6q-gw5904.dts (props changed) head/sys/gnu/dts/arm/imx6q-icore-ofcap10.dts (props changed) head/sys/gnu/dts/arm/imx6q-icore-ofcap12.dts (props changed) head/sys/gnu/dts/arm/imx6qdl-gw5903.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-gw5904.dtsi (props changed) head/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi (props changed) head/sys/gnu/dts/arm/imx6qp-nitrogen6_som2.dts (props changed) head/sys/gnu/dts/arm/imx6ul-isiot-common.dtsi (props changed) head/sys/gnu/dts/arm/imx6ull-pinfunc.h (props changed) head/sys/gnu/dts/arm/imx7d-sdb-sht11.dts (props changed) head/sys/gnu/dts/arm/omap3-cpu-thermal.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-phycore-rdk.dts (props changed) head/sys/gnu/dts/arm/rk3288-phycore-som.dtsi (props changed) head/sys/gnu/dts/arm/rk3288-tinker.dts (props changed) head/sys/gnu/dts/arm/stm32h743i-eval.dts (props changed) head/sys/gnu/dts/arm/sun8i-h3-nanopi-neo-air.dts (props changed) head/sys/gnu/dts/include/ (props changed) Modified: head/sys/gnu/dts/arm/aks-cdu.dts ============================================================================== --- head/sys/gnu/dts/arm/aks-cdu.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/aks-cdu.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -62,32 +62,36 @@ status = "okay"; }; - nand0: nand@40000000 { - nand-bus-width = <8>; - nand-ecc-mode = "soft"; - nand-on-flash-bbt; - status = "okay"; + ebi: ebi@10000000 { + nand_controller: nand-controller { + nand: nand@3 { + partitions { + bootstrap@0 { + label = "bootstrap"; + reg = <0x0 0x40000>; + }; - bootstrap@0 { - label = "bootstrap"; - reg = <0x0 0x40000>; - }; + uboot@40000 { + label = "uboot"; + reg = <0x40000 0x80000>; + }; - uboot@40000 { - label = "uboot"; - reg = <0x40000 0x80000>; - }; - ubootenv@c0000 { - label = "ubootenv"; - reg = <0xc0000 0x40000>; - }; - kernel@100000 { - label = "kernel"; - reg = <0x100000 0x400000>; - }; - rootfs@500000 { - label = "rootfs"; - reg = <0x500000 0x7b00000>; + ubootenv@c0000 { + label = "ubootenv"; + reg = <0xc0000 0x40000>; + }; + + kernel@100000 { + label = "kernel"; + reg = <0x100000 0x400000>; + }; + + rootfs@500000 { + label = "rootfs"; + reg = <0x500000 0x7b00000>; + }; + }; + }; }; }; }; Modified: head/sys/gnu/dts/arm/am335x-baltos.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos.dtsi Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am335x-baltos.dtsi Sat Oct 21 15:47:40 2017 (r324820) @@ -255,7 +255,7 @@ }; at24@50 { - compatible = "at24,24c02"; + compatible = "atmel,24c02"; pagesize = <8>; reg = <0x50>; }; Modified: head/sys/gnu/dts/arm/am335x-base0033.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-base0033.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am335x-base0033.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -89,7 +89,7 @@ &i2c0 { eeprom: eeprom@50 { - compatible = "at,24c256"; + compatible = "atmel,24c256"; reg = <0x50>; }; }; Modified: head/sys/gnu/dts/arm/am335x-bone-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-bone-common.dtsi Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am335x-bone-common.dtsi Sat Oct 21 15:47:40 2017 (r324820) @@ -232,7 +232,7 @@ }; baseboard_eeprom: baseboard_eeprom@50 { - compatible = "at,24c256"; + compatible = "atmel,24c256"; reg = <0x50>; #address-cells = <1>; @@ -251,7 +251,7 @@ clock-frequency = <100000>; cape_eeprom0: cape_eeprom0@54 { - compatible = "at,24c256"; + compatible = "atmel,24c256"; reg = <0x54>; #address-cells = <1>; #size-cells = <1>; @@ -261,7 +261,7 @@ }; cape_eeprom1: cape_eeprom1@55 { - compatible = "at,24c256"; + compatible = "atmel,24c256"; reg = <0x55>; #address-cells = <1>; #size-cells = <1>; @@ -271,7 +271,7 @@ }; cape_eeprom2: cape_eeprom2@56 { - compatible = "at,24c256"; + compatible = "atmel,24c256"; reg = <0x56>; #address-cells = <1>; #size-cells = <1>; @@ -281,7 +281,7 @@ }; cape_eeprom3: cape_eeprom3@57 { - compatible = "at,24c256"; + compatible = "atmel,24c256"; reg = <0x57>; #address-cells = <1>; #size-cells = <1>; Modified: head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -97,6 +97,11 @@ pinctrl-names = "default"; pinctrl-0 = <&uart3_pins &bt_pins>; status = "okay"; + + bluetooth { + compatible = "ti,wl1835-st"; + enable-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; + }; }; &gpio3 { Modified: head/sys/gnu/dts/arm/am335x-boneblack.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblack.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am335x-boneblack.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -22,7 +22,7 @@ * BeagleBone Blacks have PG 2.0 silicon which is guaranteed * to support 1GHz OPP so enable it for PG 2.0 on this board. */ - oppnitro@1000000000 { + oppnitro-1000000000 { opp-supported-hw = <0x06 0x0100>; }; }; Copied: head/sys/gnu/dts/arm/am335x-boneblue.dts (from r324818, vendor/device-tree/dist/src/arm/am335x-boneblue.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am335x-boneblue.dts Sat Oct 21 15:47:40 2017 (r324820, copy of r324818, vendor/device-tree/dist/src/arm/am335x-boneblue.dts) @@ -0,0 +1,460 @@ +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +/dts-v1/; + +#include "am33xx.dtsi" +#include + +/ { + model = "TI AM335x BeagleBone Blue"; + compatible = "ti,am335x-bone-blue", "ti,am33xx"; + + cpus { + cpu@0 { + cpu0-supply = <&dcdc2_reg>; + }; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x20000000>; /* 512 MB */ + }; + + chosen { + stdout-path = &uart0; + }; + + leds { + pinctrl-names = "default"; + pinctrl-0 = <&user_leds_s0>; + + compatible = "gpio-leds"; + + usr_0_led { + label = "beaglebone:green:usr0"; + gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + + usr_1_led { + label = "beaglebone:green:usr1"; + gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc0"; + default-state = "off"; + }; + + usr_2_led { + label = "beaglebone:green:usr2"; + gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "cpu0"; + default-state = "off"; + }; + + usr_3_led { + label = "beaglebone:green:usr3"; + gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc1"; + default-state = "off"; + }; + + wifi_led { + label = "wifi"; + gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; + default-state = "off"; + linux,default-trigger = "phy0assoc"; + }; + + red_led { + label = "red"; + gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + green_led { + label = "green"; + gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + batt_1_led { + label = "bat25"; + gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + batt_2_led { + label = "bat50"; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + batt_3_led { + label = "bat75"; + gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + batt_4_led { + label = "bat100"; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + vmmcsd_fixed: fixedregulator0 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + wlan_en_reg: fixedregulator@2 { + compatible = "regulator-fixed"; + regulator-name = "wlan-en-regulator"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + startup-delay-us= <70000>; + + /* WL_EN */ + gpio = <&gpio3 9 0>; + enable-active-high; + }; +}; + +&am33xx_pinmux { + user_leds_s0: user_leds_s0 { + pinctrl-single,pins = < + AM33XX_IOPAD(0x854, PIN_OUTPUT | MUX_MODE7) /* (V15) gpmc_a5.gpio1[21] - USR_LED_0 */ + AM33XX_IOPAD(0x858, PIN_OUTPUT | MUX_MODE7) /* (U15) gpmc_a6.gpio1[22] - USR_LED_1 */ + AM33XX_IOPAD(0x85c, PIN_OUTPUT | MUX_MODE7) /* (T15) gpmc_a7.gpio1[23] - USR_LED_2 */ + AM33XX_IOPAD(0x860, PIN_OUTPUT | MUX_MODE7) /* (V16) gpmc_a8.gpio1[24] - USR_LED_3 */ + AM33XX_IOPAD(0x9b0, PIN_OUTPUT | MUX_MODE7) /* (A15) xdma_event_intr0.gpio0[19] - WIFI_LED */ + AM33XX_IOPAD(0x890, PIN_OUTPUT | MUX_MODE7) /* (R7) gpmc_advn_ale.gpio2[2] - P8.7, LED_RED, GP1_PIN_5 */ + AM33XX_IOPAD(0x894, PIN_OUTPUT | MUX_MODE7) /* (T7) gpmc_oen_ren.gpio2[3] - P8.8, LED_GREEN, GP1_PIN_6 */ + AM33XX_IOPAD(0x82c, PIN_OUTPUT | MUX_MODE7) /* (U12) gpmc_ad11.gpio0[27] - P8.17, BATT_LED_1 */ + AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE7) /* (T5) lcd_data15.gpio0[11] - P8.32, BATT_LED_2 */ + AM33XX_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE7) /* (V6) gpmc_csn0.gpio1[29] - P8.26, BATT_LED_3 */ + AM33XX_IOPAD(0x828, PIN_OUTPUT | MUX_MODE7) /* (T11) gpmc_ad10.gpio0[26] - P8.14, BATT_LED_4 */ + + >; + }; + + i2c0_pins: pinmux_i2c0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* (C17) I2C0_SDA.I2C0_SDA */ + AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* (C16) I2C0_SCL.I2C0_SCL */ + >; + }; + + i2c2_pins: pinmux_i2c2_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE3) /* (D18) uart1_ctsn.I2C2_SDA */ + AM33XX_IOPAD(0x97c, PIN_INPUT_PULLUP | MUX_MODE3) /* (D17) uart1_rtsn.I2C2_SCL */ + >; + }; + + uart0_pins: pinmux_uart0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* (E15) uart0_rxd.uart0_rxd */ + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* (E16) uart0_txd.uart0_txd */ + >; + }; + + mmc1_pins: pinmux_mmc1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* (C15) spi0_cs1.gpio0[6] */ + >; + }; + + mmc2_pins: pinmux_mmc2_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* (U9) gpmc_csn1.mmc1_clk */ + AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* (V9) gpmc_csn2.mmc1_cmd */ + AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* (U7) gpmc_ad0.mmc1_dat0 */ + AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* (V7) gpmc_ad1.mmc1_dat1 */ + AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* (R8) gpmc_ad2.mmc1_dat2 */ + AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* (T8) gpmc_ad3.mmc1_dat3 */ + AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE1) /* (U8) gpmc_ad4.mmc1_dat4 */ + AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE1) /* (V8) gpmc_ad5.mmc1_dat5 */ + AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE1) /* (R9) gpmc_ad6.mmc1_dat6 */ + AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE1) /* (T9) gpmc_ad7.mmc1_dat7 */ + >; + }; + + mmc3_pins: pinmux_mmc3_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE6) /* (L15) gmii1_rxd1.mmc2_clk */ + AM33XX_IOPAD(0x914, PIN_INPUT_PULLUP | MUX_MODE6) /* (J16) gmii1_txen.mmc2_cmd */ + AM33XX_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE5) /* (J17) gmii1_rxdv.mmc2_dat0 */ + AM33XX_IOPAD(0x91c, PIN_INPUT_PULLUP | MUX_MODE5) /* (J18) gmii1_txd3.mmc2_dat1 */ + AM33XX_IOPAD(0x920, PIN_INPUT_PULLUP | MUX_MODE5) /* (K15) gmii1_txd2.mmc2_dat2 */ + AM33XX_IOPAD(0x908, PIN_INPUT_PULLUP | MUX_MODE5) /* (H16) gmii1_col.mmc2_dat3 */ + >; + }; + + bt_pins: pinmux_bt_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (K17) gmii1_txd0.gpio0[28] - BT_EN */ + >; + }; + + uart3_pins: pinmux_uart3_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE1) /* (L17) gmii1_rxd3.uart3_rxd */ + AM33XX_IOPAD(0x938, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* (L16) gmii1_rxd2.uart3_txd */ + AM33XX_IOPAD(0x948, PIN_INPUT | MUX_MODE3) /* (M17) mdio_data.uart3_ctsn */ + AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* (M18) mdio_clk.uart3_rtsn */ + >; + }; + + wl18xx_pins: pinmux_wl18xx_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x92c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* (K18) gmii1_txclk.gpio3[9] - WL_EN */ + AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE7) /* (H18) rmii1_refclk.gpio0[29] - WL_IRQ */ + AM33XX_IOPAD(0x930, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (L18) gmii1_rxclk.gpio3[10] - LS_BUF_EN */ + >; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + + status = "okay"; +}; + +&usb { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb1_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "peripheral"; + interrupts-extended = <&intc 18 &tps 0>; + interrupt-names = "mc", "vbus"; +}; + +&usb1 { + status = "okay"; + dr_mode = "host"; +}; + +&cppi41dma { + status = "okay"; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + + status = "okay"; + clock-frequency = <400000>; + + tps: tps@24 { + reg = <0x24>; + }; + + baseboard_eeprom: baseboard_eeprom@50 { + compatible = "at,24c256"; + reg = <0x50>; + + #address-cells = <1>; + #size-cells = <1>; + baseboard_data: baseboard_data@0 { + reg = <0 0x100>; + }; + }; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; + + status = "okay"; + clock-frequency = <400000>; + + mpu9250@68 { + compatible = "invensense,mpu9250"; + reg = <0x68>; + interrupt-parent = <&gpio3>; + interrupts = <21 GPIO_ACTIVE_LOW>; + i2c-gate { + #address-cells = <1>; + #size-cells = <0>; + ax8975@c { + compatible = "ak,ak8975"; + reg = <0x0c>; + }; + }; + }; + + pressure@76 { + compatible = "bosch,bmp280"; + reg = <0x76>; + }; +}; + +/include/ "tps65217.dtsi" + +&tps { + interrupts = <7>; /* NMI */ + interrupt-parent = <&intc>; + + charger { + interrupts = <0>, <1>; + interrupt-names = "USB", "AC"; + status = "okay"; + }; + + pwrbutton { + interrupts = <2>; + status = "okay"; + }; + + regulators { + dcdc1_reg: regulator@0 { + regulator-name = "vdds_dpr"; + regulator-always-on; + }; + + dcdc2_reg: regulator@1 { + /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */ + regulator-name = "vdd_mpu"; + regulator-min-microvolt = <925000>; + regulator-max-microvolt = <1351500>; + regulator-boot-on; + regulator-always-on; + }; + + dcdc3_reg: regulator@2 { + /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */ + regulator-name = "vdd_core"; + regulator-min-microvolt = <925000>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; + }; + + ldo1_reg: regulator@3 { + regulator-name = "vio,vrtc,vdds"; + regulator-always-on; + }; + + ldo2_reg: regulator@4 { + regulator-name = "vdd_3v3aux"; + regulator-always-on; + }; + + ldo3_reg: regulator@5 { + regulator-name = "vdd_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + ldo4_reg: regulator@6 { + regulator-name = "vdd_3v3a"; + regulator-always-on; + }; + }; +}; + +&mmc1 { + status = "okay"; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; +}; + +&mmc2 { + status = "okay"; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <8>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_pins>; +}; + +&mmc3 { + dmas = <&edma_xbar 12 0 1 + &edma_xbar 13 0 2>; + dma-names = "tx", "rx"; + status = "okay"; + vmmc-supply = <&wlan_en_reg>; + bus-width = <4>; + non-removable; + cap-power-off-card; + ti,needs-special-hs-handling; + keep-power-in-suspend; + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins &wl18xx_pins>; + + #address-cells = <1>; + #size-cells = <0>; + wlcore: wlcore@2 { + compatible = "ti,wl1835"; + reg = <2>; + interrupt-parent = <&gpio0>; + interrupts = <29 IRQ_TYPE_EDGE_RISING>; + }; +}; + +&tscadc { + status = "okay"; + adc { + ti,adc-channels = <0 1 2 3 4 5 6 7>; + }; +}; + +&uart3 { + pinctrl-names = "default"; + pinctrl-0 = <&uart3_pins &bt_pins>; + status = "okay"; + + bluetooth { + compatible = "ti,wl1835-st"; + enable-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; + }; +}; + +&aes { + status = "okay"; +}; + +&sham { + status = "okay"; +}; + +&rtc { + system-power-controller; + clocks = <&clk_32768_ck>, <&clkdiv32k_ick>; + clock-names = "ext-clk", "int-clk"; +}; + +&gpio3 { + ls_buf_en { + gpio-hog; + gpios = <10 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "LS_BUF_EN"; + }; +}; Modified: head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -97,6 +97,11 @@ pinctrl-names = "default"; pinctrl-0 = <&uart3_pins &bt_pins>; status = "okay"; + + bluetooth { + compatible = "ti,wl1835-st"; + enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>; + }; }; &gpio1 { Modified: head/sys/gnu/dts/arm/am335x-nano.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-nano.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am335x-nano.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -224,7 +224,7 @@ }; eeprom@53 { - compatible = "microchip,24c02"; + compatible = "microchip,24c02", "atmel,24c02"; reg = <0x53>; pagesize = <8>; }; Modified: head/sys/gnu/dts/arm/am335x-pepper.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-pepper.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am335x-pepper.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -67,7 +67,7 @@ }; eeprom: eeprom@50 { - compatible = "at,24c256"; + compatible = "atmel,24c256"; reg = <0x50>; }; Modified: head/sys/gnu/dts/arm/am335x-phycore-som.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-phycore-som.dtsi Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am335x-phycore-som.dtsi Sat Oct 21 15:47:40 2017 (r324820) @@ -138,7 +138,7 @@ }; i2c_rtc: rtc@68 { - compatible = "rv4162"; + compatible = "microcrystal,rv4162"; reg = <0x68>; status = "disabled"; }; Modified: head/sys/gnu/dts/arm/am335x-shc.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-shc.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am335x-shc.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -188,7 +188,7 @@ }; at24@50 { - compatible = "at24,24c32"; + compatible = "atmel,24c32"; pagesize = <32>; reg = <0x50>; }; Modified: head/sys/gnu/dts/arm/am335x-sl50.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-sl50.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am335x-sl50.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -305,7 +305,7 @@ }; eeprom: eeprom@50 { - compatible = "at,24c256"; + compatible = "atmel,24c256"; reg = <0x50>; }; Modified: head/sys/gnu/dts/arm/am33xx.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx.dtsi Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am33xx.dtsi Sat Oct 21 15:47:40 2017 (r324820) @@ -64,64 +64,64 @@ * because the can not be enabled simultaneously on a * single SoC. */ - opp50@300000000 { + opp50-300000000 { opp-hz = /bits/ 64 <300000000>; opp-microvolt = <950000 931000 969000>; opp-supported-hw = <0x06 0x0010>; opp-suspend; }; - opp100@275000000 { + opp100-275000000 { opp-hz = /bits/ 64 <275000000>; opp-microvolt = <1100000 1078000 1122000>; opp-supported-hw = <0x01 0x00FF>; opp-suspend; }; - opp100@300000000 { + opp100-300000000 { opp-hz = /bits/ 64 <300000000>; opp-microvolt = <1100000 1078000 1122000>; opp-supported-hw = <0x06 0x0020>; opp-suspend; }; - opp100@500000000 { + opp100-500000000 { opp-hz = /bits/ 64 <500000000>; opp-microvolt = <1100000 1078000 1122000>; opp-supported-hw = <0x01 0xFFFF>; }; - opp100@600000000 { + opp100-600000000 { opp-hz = /bits/ 64 <600000000>; opp-microvolt = <1100000 1078000 1122000>; opp-supported-hw = <0x06 0x0040>; }; - opp120@600000000 { + opp120-600000000 { opp-hz = /bits/ 64 <600000000>; opp-microvolt = <1200000 1176000 1224000>; opp-supported-hw = <0x01 0xFFFF>; }; - opp120@720000000 { + opp120-720000000 { opp-hz = /bits/ 64 <720000000>; opp-microvolt = <1200000 1176000 1224000>; opp-supported-hw = <0x06 0x0080>; }; - oppturbo@720000000 { + oppturbo-720000000 { opp-hz = /bits/ 64 <720000000>; opp-microvolt = <1260000 1234800 1285200>; opp-supported-hw = <0x01 0xFFFF>; }; - oppturbo@800000000 { + oppturbo-800000000 { opp-hz = /bits/ 64 <800000000>; opp-microvolt = <1260000 1234800 1285200>; opp-supported-hw = <0x06 0x0100>; }; - oppnitro@1000000000 { + oppnitro-1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <1325000 1298500 1351500>; opp-supported-hw = <0x04 0x0200>; @@ -431,7 +431,6 @@ &edma_xbar 25 0 0>; dma-names = "tx", "rx"; interrupts = <64>; - interrupt-parent = <&intc>; reg = <0x48060000 0x1000>; status = "disabled"; }; @@ -444,7 +443,6 @@ &edma 3 0>; dma-names = "tx", "rx"; interrupts = <28>; - interrupt-parent = <&intc>; reg = <0x481d8000 0x1000>; status = "disabled"; }; @@ -454,7 +452,6 @@ ti,hwmods = "mmc3"; ti,needs-special-reset; interrupts = <29>; - interrupt-parent = <&intc>; reg = <0x47810000 0x1000>; status = "disabled"; }; @@ -853,7 +850,6 @@ 0x4a101200 0x100>; #address-cells = <1>; #size-cells = <1>; - interrupt-parent = <&intc>; /* * c0_rx_thresh_pend * c0_rx_pend @@ -908,7 +904,6 @@ lcdc: lcdc@4830e000 { compatible = "ti,am33xx-tilcdc"; reg = <0x4830e000 0x1000>; - interrupt-parent = <&intc>; interrupts = <36>; ti,hwmods = "lcdc"; status = "disabled"; @@ -917,7 +912,6 @@ tscadc: tscadc@44e0d000 { compatible = "ti,am3359-tscadc"; reg = <0x44e0d000 0x1000>; - interrupt-parent = <&intc>; interrupts = <16>; ti,hwmods = "adc_tsc"; status = "disabled"; Modified: head/sys/gnu/dts/arm/am4372.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am4372.dtsi Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am4372.dtsi Sat Oct 21 15:47:40 2017 (r324820) @@ -59,32 +59,32 @@ compatible = "operating-points-v2-ti-cpu"; syscon = <&scm_conf>; - opp50@300000000 { + opp50-300000000 { opp-hz = /bits/ 64 <300000000>; opp-microvolt = <950000 931000 969000>; opp-supported-hw = <0xFF 0x01>; opp-suspend; }; - opp100@600000000 { + opp100-600000000 { opp-hz = /bits/ 64 <600000000>; opp-microvolt = <1100000 1078000 1122000>; opp-supported-hw = <0xFF 0x04>; }; - opp120@720000000 { + opp120-720000000 { opp-hz = /bits/ 64 <720000000>; opp-microvolt = <1200000 1176000 1224000>; opp-supported-hw = <0xFF 0x08>; }; - oppturbo@800000000 { + oppturbo-800000000 { opp-hz = /bits/ 64 <800000000>; opp-microvolt = <1260000 1234800 1285200>; opp-supported-hw = <0xFF 0x10>; }; - oppnitro@1000000000 { + oppnitro-1000000000 { opp-hz = /bits/ 64 <1000000000>; opp-microvolt = <1325000 1298500 1351500>; opp-supported-hw = <0xFF 0x20>; Modified: head/sys/gnu/dts/arm/am437x-gp-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-gp-evm.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am437x-gp-evm.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -549,8 +549,6 @@ dcdc3: regulator-dcdc3 { regulator-name = "vdcdc3"; - regulator-min-microvolt = <1500000>; - regulator-max-microvolt = <1500000>; regulator-boot-on; regulator-always-on; regulator-state-mem { Modified: head/sys/gnu/dts/arm/am437x-idk-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-idk-evm.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am437x-idk-evm.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -339,7 +339,7 @@ clock-frequency = <400000>; at24@50 { - compatible = "at24,24c256"; + compatible = "atmel,24c256"; pagesize = <64>; reg = <0x50>; }; Modified: head/sys/gnu/dts/arm/am437x-sk-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-sk-evm.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am437x-sk-evm.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -451,8 +451,6 @@ dcdc3: regulator-dcdc3 { regulator-name = "vdds_ddr"; - regulator-min-microvolt = <1500000>; - regulator-max-microvolt = <1500000>; regulator-boot-on; regulator-always-on; regulator-state-mem { @@ -511,7 +509,7 @@ }; at24@50 { - compatible = "at24,24c256"; + compatible = "atmel,24c256"; pagesize = <64>; reg = <0x50>; }; Modified: head/sys/gnu/dts/arm/am43x-epos-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am43x-epos-evm.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am43x-epos-evm.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -442,8 +442,6 @@ dcdc3: regulator-dcdc3 { regulator-name = "vdcdc3"; - regulator-min-microvolt = <1500000>; - regulator-max-microvolt = <1500000>; regulator-boot-on; regulator-always-on; }; @@ -477,7 +475,7 @@ }; at24@50 { - compatible = "at24,24c256"; + compatible = "atmel,24c256"; pagesize = <64>; reg = <0x50>; }; Modified: head/sys/gnu/dts/arm/am43xx-clocks.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am43xx-clocks.dtsi Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am43xx-clocks.dtsi Sat Oct 21 15:47:40 2017 (r324820) @@ -833,4 +833,40 @@ ti,bit-shift = <23>; reg = <0x4100>; }; + + clkout2_src_mux_ck: clkout2_src_mux_ck { + #clock-cells = <0>; + compatible = "ti,mux-clock"; + clocks = <&clk_rc32k_ck>, <&sysclk_div>, <&dpll_ddr_m2_ck>, + <&dpll_per_m2_ck>, <&dpll_disp_m2_ck>, + <&dpll_mpu_m2_ck>, <&dpll_extdev_ck>; + reg = <0x4108>; + }; + + clkout2_pre_div_ck: clkout2_pre_div_ck { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&clkout2_src_mux_ck>; + ti,bit-shift = <4>; + ti,max-div = <8>; + reg = <0x4108>; + }; + + clkout2_post_div_ck: clkout2_post_div_ck { + #clock-cells = <0>; + compatible = "ti,divider-clock"; + clocks = <&clkout2_pre_div_ck>; + ti,bit-shift = <8>; + ti,max-div = <32>; + ti,index-power-of-two; + reg = <0x4108>; + }; + + clkout2_ck: clkout2_ck { + #clock-cells = <0>; + compatible = "ti,gate-clock"; + clocks = <&clkout2_post_div_ck>; + ti,bit-shift = <16>; + reg = <0x4108>; + }; }; Modified: head/sys/gnu/dts/arm/am571x-idk.dts ============================================================================== --- head/sys/gnu/dts/arm/am571x-idk.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am571x-idk.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -79,3 +79,20 @@ id-gpio = <&gpio5 7 GPIO_ACTIVE_HIGH>; vbus-gpio = <&gpio7 22 GPIO_ACTIVE_HIGH>; }; + +&mailbox5 { + status = "okay"; + mbox_ipu1_ipc3x: mbox_ipu1_ipc3x { + status = "okay"; + }; + mbox_dsp1_ipc3x: mbox_dsp1_ipc3x { + status = "okay"; + }; +}; + +&mailbox6 { + status = "okay"; + mbox_ipu2_ipc3x: mbox_ipu2_ipc3x { + status = "okay"; + }; +}; Modified: head/sys/gnu/dts/arm/am572x-idk.dts ============================================================================== --- head/sys/gnu/dts/arm/am572x-idk.dts Sat Oct 21 15:19:00 2017 (r324819) +++ head/sys/gnu/dts/arm/am572x-idk.dts Sat Oct 21 15:47:40 2017 (r324820) @@ -91,3 +91,23 @@ &pcie1 { gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; }; + +&mailbox5 { + status = "okay"; + mbox_ipu1_ipc3x: mbox_ipu1_ipc3x { + status = "okay"; + }; + mbox_dsp1_ipc3x: mbox_dsp1_ipc3x { + status = "okay"; + }; +}; + +&mailbox6 { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Oct 21 15:48:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA913E316B0; Sat, 21 Oct 2017 15:48:17 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A815A2C67; Sat, 21 Oct 2017 15:48:17 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LFmGnG024163; Sat, 21 Oct 2017 15:48:16 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LFmGVI024162; Sat, 21 Oct 2017 15:48:16 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201710211548.v9LFmGVI024162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 21 Oct 2017 15:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324821 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 324821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 15:48:18 -0000 Author: mmel Date: Sat Oct 21 15:48:16 2017 New Revision: 324821 URL: https://svnweb.freebsd.org/changeset/base/324821 Log: Fix spelling. Reported by: lidl MFC after: 1 month Modified: head/sys/arm/arm/cpuinfo.c Modified: head/sys/arm/arm/cpuinfo.c ============================================================================== --- head/sys/arm/arm/cpuinfo.c Sat Oct 21 15:47:40 2017 (r324820) +++ head/sys/arm/arm/cpuinfo.c Sat Oct 21 15:48:16 2017 (r324821) @@ -197,8 +197,8 @@ cpuinfo_init(void) cpuinfo.icache_line_mask = cpuinfo.icache_line_size - 1; /* Fill AT_HWCAP bits. */ - elf_hwcap |= HWCAP_HALF | HWCAP_FAST_MULT; /* Requierd for all CPUs */ - elf_hwcap |= HWCAP_TLS | HWCAP_EDSP; /* Requierd for v6+ CPUs */ + elf_hwcap |= HWCAP_HALF | HWCAP_FAST_MULT; /* Required for all CPUs */ + elf_hwcap |= HWCAP_TLS | HWCAP_EDSP; /* Required for v6+ CPUs */ tmp = (cpuinfo.id_isar0 >> 24) & 0xF; /* Divide_instrs */ if (tmp >= 1) From owner-svn-src-head@freebsd.org Sat Oct 21 16:12:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A12BCE332FC; Sat, 21 Oct 2017 16:12:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7051238A1; Sat, 21 Oct 2017 16:12:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LGC0CR036302; Sat, 21 Oct 2017 16:12:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LGC0Mm036301; Sat, 21 Oct 2017 16:12:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710211612.v9LGC0Mm036301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 21 Oct 2017 16:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324822 - head/sys/modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/modules/dtb/allwinner X-SVN-Commit-Revision: 324822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 16:12:01 -0000 Author: manu Date: Sat Oct 21 16:12:00 2017 New Revision: 324822 URL: https://svnweb.freebsd.org/changeset/base/324822 Log: dtb/allwinner: Disconnect sinovoip-bpi-m3.dts from the build No active commiter have this board and we diverged too much from the upstream DTS. Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Sat Oct 21 15:48:16 2017 (r324821) +++ head/sys/modules/dtb/allwinner/Makefile Sat Oct 21 16:12:00 2017 (r324822) @@ -3,7 +3,6 @@ DTS= \ nanopi-neo.dts \ orangepi-plus-2e.dts \ - sinovoip-bpi-m3.dts \ sun4i-a10-cubieboard.dts \ sun4i-a10-olinuxino-lime.dts \ sun6i-a31s-sinovoip-bpi-m2.dts \ From owner-svn-src-head@freebsd.org Sat Oct 21 16:55:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB532E33BAB; Sat, 21 Oct 2017 16:55:53 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7806463A7D; Sat, 21 Oct 2017 16:55:53 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LGtqFr053016; Sat, 21 Oct 2017 16:55:52 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LGtqKO053014; Sat, 21 Oct 2017 16:55:52 GMT (envelope-from se@FreeBSD.org) Message-Id: <201710211655.v9LGtqKO053014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Sat, 21 Oct 2017 16:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324823 - in head/share/man: man5 man8 X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/share/man: man5 man8 X-SVN-Commit-Revision: 324823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 16:55:53 -0000 Author: se Date: Sat Oct 21 16:55:52 2017 New Revision: 324823 URL: https://svnweb.freebsd.org/changeset/base/324823 Log: Mention sysrc(8) as scripting interface for the modification of config files. This is a follow up commit to r324721, which added sysrc(8) to the SEE ALSO list. Submitted by: Kurt Jaeger (lists at opsec.eu) MFC after: 1 week Modified: head/share/man/man5/rc.conf.5 head/share/man/man8/rc.8 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Oct 21 16:12:00 2017 (r324822) +++ head/share/man/man5/rc.conf.5 Sat Oct 21 16:55:52 2017 (r324823) @@ -64,6 +64,9 @@ is used to override settings in .Pa /etc/rc.conf for historical reasons. .Pp +The sysrc(8) command provides a scripting interface to modify system +config files. +.Pp In addition to .Pa /etc/rc.conf.local you can also place smaller configuration files for each Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Sat Oct 21 16:12:00 2017 (r324822) +++ head/share/man/man8/rc.8 Sat Oct 21 16:55:52 2017 (r324823) @@ -87,6 +87,9 @@ The .Nm rc.d/ directories contain scripts which will be automatically executed at boot time and shutdown time. +.Pp +The sysrc(8) command provides a scripting interface to modify system +config files. .Ss Operation of Nm .Bl -enum .It From owner-svn-src-head@freebsd.org Sat Oct 21 17:28:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 144B9E34526; Sat, 21 Oct 2017 17:28:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAC5864661; Sat, 21 Oct 2017 17:28:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LHSCqc065497; Sat, 21 Oct 2017 17:28:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LHSCb4065496; Sat, 21 Oct 2017 17:28:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710211728.v9LHSCb4065496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 Oct 2017 17:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324824 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 17:28:14 -0000 Author: kib Date: Sat Oct 21 17:28:12 2017 New Revision: 324824 URL: https://svnweb.freebsd.org/changeset/base/324824 Log: Check that the page which is freed as zeroed, indeed has all-zero content. This catches some rare mysterious failures at the source. The check is only performed on architectures which implement direct map, and only enabled with option DIAGNOSTIC, similar to other costly consistency checks. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Oct 21 16:55:52 2017 (r324823) +++ head/sys/vm/vm_page.c Sat Oct 21 17:28:12 2017 (r324824) @@ -2780,6 +2780,16 @@ bool vm_page_free_prep(vm_page_t m, bool pagequeue_locked) { +#if defined(DIAGNOSTIC) && defined(PHYS_TO_DMAP) + if ((m->flags & PG_ZERO) != 0) { + uint64_t *p; + int i; + p = (uint64_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); + for (i = 0; i < PAGE_SIZE / sizeof(uint64_t); i++, p++) + KASSERT(*p == 0, ("vm_page_free_prep %p PG_ZERO %d %jx", + m, i, (uintmax_t)*p)); + } +#endif if ((m->oflags & VPO_UNMANAGED) == 0) { vm_page_lock_assert(m, MA_OWNED); KASSERT(!pmap_page_is_mapped(m), From owner-svn-src-head@freebsd.org Sat Oct 21 17:55:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB079E34D51; Sat, 21 Oct 2017 17:55:30 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0743652BE; Sat, 21 Oct 2017 17:55:29 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v9LHtSS9035304; Sat, 21 Oct 2017 10:55:28 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v9LHtSob035303; Sat, 21 Oct 2017 10:55:28 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201710211755.v9LHtSob035303@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r324810 - in head/sys: amd64/conf arm/conf arm64/conf conf i386/conf mips/conf net powerpc/conf riscv/conf sparc64/conf In-Reply-To: <201710202140.v9KLexFK069227@repo.freebsd.org> To: "Bjoern A. Zeeb" Date: Sat, 21 Oct 2017 10:55:28 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 17:55:31 -0000 > Author: bz > Date: Fri Oct 20 21:40:59 2017 > New Revision: 324810 > URL: https://svnweb.freebsd.org/changeset/base/324810 > > Log: > With r181803 on 2008-08-17 23:27:27Z the first VIMAGE commit went into > HEAD. Enable VIMAGE in GENERIC kernels and some others (where GENERIC does > not exist) on HEAD. > > Disable building LINT-VIMAGE with VIMAGE being default. > > This should give it a lot more exposure in the run-up to 12 to help > us evaluate whether to keep it on by default or not. > We are also hoping to get better performance testing. > The feature can be disabled using nooptions. > > Requested by: many > Reviewed by: kristof, emaste, hiren > X-MFC after: never > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D12639 > > Modified: ... > +options VIMAGE # Subsystem virtualization, e.g. VNET > options INET #InterNETworking > options TCP_HHOOK # hhook(9) framework for TCP > options NFSCL #Network Filesystem Client > @@ -44,6 +45,11 @@ options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B r > #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS > #options WITNESS #Enable checks to detect deadlocks and cycles > #options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed > + > +# The `bpf' device enables the Berkeley Packet Filter. > +# Be aware of the administrative consequences of enabling this! > +# Note that 'bpf' is required for DHCP. > +device bpf # Berkeley packet filter You answer eugen_grosbein question about this being needed to compile, if that is true, and iirc all the other configs already have bpf on by default then VIMAGE depends on bpf and at least the comment about "required for" should be updated until the depenedency on bpf is found and removed. That or quickly find and fix the dependency. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Oct 21 18:21:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6184E36902; Sat, 21 Oct 2017 18:21:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8600865EA9; Sat, 21 Oct 2017 18:21:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LILiIA089663; Sat, 21 Oct 2017 18:21:44 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LILiJL089662; Sat, 21 Oct 2017 18:21:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201710211821.v9LILiJL089662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 21 Oct 2017 18:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324825 - head/lib X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib X-SVN-Commit-Revision: 324825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 18:21:45 -0000 Author: dim Date: Sat Oct 21 18:21:44 2017 New Revision: 324825 URL: https://svnweb.freebsd.org/changeset/base/324825 Log: After the import of libc++ 5.0.0, there is no need to disable building libc++experimental.a on arm (r318654) and mips (r318859) anymore, since upstream fixed the static assertions which would occur. Noticed by: George Abdelmalik PR: 223119 MFC after: 3 days Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Sat Oct 21 17:28:12 2017 (r324824) +++ head/lib/Makefile Sat Oct 21 18:21:44 2017 (r324825) @@ -157,9 +157,7 @@ _libclang_rt= libclang_rt .if ${MK_LIBCPLUSPLUS} != "no" _libcxxrt= libcxxrt _libcplusplus= libc++ -.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" _libcplusplus+= libc++experimental -.endif .endif SUBDIR.${MK_EFI}+= libefivar From owner-svn-src-head@freebsd.org Sat Oct 21 19:14:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0614E376A0; Sat, 21 Oct 2017 19:14:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9383267346; Sat, 21 Oct 2017 19:14:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LJEjpK011029; Sat, 21 Oct 2017 19:14:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LJEjeE011027; Sat, 21 Oct 2017 19:14:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201710211914.v9LJEjeE011027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 21 Oct 2017 19:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324826 - head/contrib/llvm/lib/Target/AArch64 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Target/AArch64 X-SVN-Commit-Revision: 324826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 19:14:47 -0000 Author: dim Date: Sat Oct 21 19:14:45 2017 New Revision: 324826 URL: https://svnweb.freebsd.org/changeset/base/324826 Log: Pull in r316035 from upstream llvm trunk (by Tim Northover): AArch64: account for possible frame index operand in compares. If the address of a local is used in a comparison, AArch64 can fold the address-calculation into the comparison via "adds". Unfortunately, a couple of places (both hit in this one test) are not ready to deal with that yet and just assume the first source operand is a register. This should fix an assertion failure while building the test suite of www/firefox for AArch64. PR: 223048 MFC after: 3 days Modified: head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp head/contrib/llvm/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp Modified: head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp Sat Oct 21 18:21:44 2017 (r324825) +++ head/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp Sat Oct 21 19:14:45 2017 (r324826) @@ -940,6 +940,12 @@ bool AArch64InstrInfo::areMemAccessesTriviallyDisjoint bool AArch64InstrInfo::analyzeCompare(const MachineInstr &MI, unsigned &SrcReg, unsigned &SrcReg2, int &CmpMask, int &CmpValue) const { + // The first operand can be a frame index where we'd normally expect a + // register. + assert(MI.getNumOperands() >= 2 && "All AArch64 cmps should have 2 operands"); + if (!MI.getOperand(1).isReg()) + return false; + switch (MI.getOpcode()) { default: break; Modified: head/contrib/llvm/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp Sat Oct 21 18:21:44 2017 (r324825) +++ head/contrib/llvm/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp Sat Oct 21 19:14:45 2017 (r324826) @@ -167,6 +167,9 @@ AArch64RedundantCopyElimination::knownRegValInBlock( // CMP is an alias for SUBS with a dead destination register. case AArch64::SUBSWri: case AArch64::SUBSXri: { + // Sometimes the first operand is a FrameIndex. Bail if tht happens. + if (!PredI.getOperand(1).isReg()) + return None; MCPhysReg SrcReg = PredI.getOperand(1).getReg(); // Must not be a symbolic immediate. From owner-svn-src-head@freebsd.org Sat Oct 21 19:29:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACE70E37E2D; Sat, 21 Oct 2017 19:29:34 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86CC667A5F; Sat, 21 Oct 2017 19:29:34 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id E8DDA13023; Sat, 21 Oct 2017 19:29:32 +0000 (UTC) Subject: Re: svn commit: r318751 - in head/sys: kern sys To: Steve Wills , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201705231659.v4NGxOB8013882@repo.freebsd.org> From: Allan Jude Message-ID: Date: Sat, 21 Oct 2017 15:29:28 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201705231659.v4NGxOB8013882@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PQgM5TCpTanP0vUaA5Ipij1vCTKhkeqTB" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 19:29:34 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PQgM5TCpTanP0vUaA5Ipij1vCTKhkeqTB Content-Type: multipart/mixed; boundary="unnuTAAAXVjLnG1k4kEwmILShSJFFK4KC"; protected-headers="v1" From: Allan Jude To: Steve Wills , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r318751 - in head/sys: kern sys References: <201705231659.v4NGxOB8013882@repo.freebsd.org> In-Reply-To: <201705231659.v4NGxOB8013882@repo.freebsd.org> --unnuTAAAXVjLnG1k4kEwmILShSJFFK4KC Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2017-05-23 12:59, Steve Wills wrote: > Author: swills (ports committer) > Date: Tue May 23 16:59:24 2017 > New Revision: 318751 > URL: https://svnweb.freebsd.org/changeset/base/318751 >=20 > Log: > Add security.bsd.see_jail_proc > =20 > Add security.bsd.see_jail_proc sysctl to hide jail processes from non= -root > users > =20 > Reviewed by: jamie > Approved by: allanjude > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D10770 >=20 I user was asking about this issue on IRC today. I think I have changed my mind a bit. I think we should make the default be off (so you can't see processes in a jail from the host) by default in 12. And that we should MFC this sysctl to stable/11, but not change the default behaviour there. Anyone else have thoughts? --=20 Allan Jude --unnuTAAAXVjLnG1k4kEwmILShSJFFK4KC-- --PQgM5TCpTanP0vUaA5Ipij1vCTKhkeqTB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJZ66AbAAoJEBmVNT4SmAt+2D4QANZ2Iw5lUqNO9ekgt60kHbVU WHHjBm3Ef3DGSRB4n9trqjSxYvpleaVRaWU/53ns7mah4OqIIhmw/qRQUZaNVkgT 2JF4imxcTqsy3MEtpg9BW/DDJ9XmVmQaKNRFe7TXfhL4P4m4v+Gi8BEVzoRr3Uiu 7xTLzGEGGs9OYANtrtzdx6qMo47DtUeIpsmK5crAezgAU4kBbAnPJv8S5vXUHj22 Avylv3Za0K0ffFs+6+RkENjqgrK1vkWpAymPzMpZv/EPvQ+30FLGxg8DwmIC5huB HOQXoXCGHJ3l6a3N9VelQ3vOaTigm4R9Zsl6NLpqzD1MRffnKguGkcuWGHlarY8c GTLSHYkBvkWwJAhJnMQ5P0l+QgavAh4NnaDCS9Z1H7FXrEifXOqppd+EVuONYB1V cokRWjT4eX2dPkn3YesS/Gfabz4O3wSLeXBFVd/oPJeLyLQ8/rlVB+eX1+6wlg4P oF/mIHfpSs+5VVqmIL6a76jVLDzW1V44qyyTbe7ymS/FqnlAfLEM4ZCp7CFhnCb+ RmB5ypIJbNHLz3zVvZENhfOdTPZnBnBhpFT1U4HNOfAEtR7Nyb/uOr+NZz2B0+if zq6QNgTiZSUV+rMHyQgH94wKevElFzNjF5SnNHVNffUtYzclh2lPbMZa75CFPJf9 tFgT5HwKjkWtYcOgS84m =CUxj -----END PGP SIGNATURE----- --PQgM5TCpTanP0vUaA5Ipij1vCTKhkeqTB-- From owner-svn-src-head@freebsd.org Sat Oct 21 21:58:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C8EDE3B1ED; Sat, 21 Oct 2017 21:58:26 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD8BD6CFCD; Sat, 21 Oct 2017 21:58:25 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LLwOwm079628; Sat, 21 Oct 2017 21:58:24 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LLwOsi079627; Sat, 21 Oct 2017 21:58:24 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201710212158.v9LLwOsi079627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 21 Oct 2017 21:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324835 - head/etc X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 324835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 21:58:26 -0000 Author: brd (doc,ports committer) Date: Sat Oct 21 21:58:24 2017 New Revision: 324835 URL: https://svnweb.freebsd.org/changeset/base/324835 Log: Remove a atrun check that is nullified by r318443. Approved by: will Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Sat Oct 21 19:38:36 2017 (r324834) +++ head/etc/Makefile Sat Oct 21 21:58:24 2017 (r324835) @@ -212,9 +212,6 @@ distribution: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ snmpd.config ${DESTDIR}/etc; .endif -.if ${MK_AT} == "no" - sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab -.endif .if ${MK_TCSH} == "no" sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd .endif From owner-svn-src-head@freebsd.org Sat Oct 21 22:40:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0B5DE3BC09; Sat, 21 Oct 2017 22:40:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAC856DDB4; Sat, 21 Oct 2017 22:40:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9LMe9og096076; Sat, 21 Oct 2017 22:40:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9LMe9iK096074; Sat, 21 Oct 2017 22:40:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710212240.v9LMe9iK096074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 21 Oct 2017 22:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324836 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 22:40:10 -0000 Author: mjg Date: Sat Oct 21 22:40:09 2017 New Revision: 324836 URL: https://svnweb.freebsd.org/changeset/base/324836 Log: mtx: implement thread lock fastpath MFC after: 1 week Modified: head/sys/kern/kern_mutex.c head/sys/sys/mutex.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sat Oct 21 21:58:24 2017 (r324835) +++ head/sys/kern/kern_mutex.c Sat Oct 21 22:40:09 2017 (r324836) @@ -791,7 +791,67 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t } #endif /* SMP */ +#ifdef INVARIANTS +static void +thread_lock_validate(struct mtx *m, int opts, const char *file, int line) +{ + + KASSERT(m->mtx_lock != MTX_DESTROYED, + ("thread_lock() of destroyed mutex @ %s:%d", file, line)); + KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin, + ("thread_lock() of sleep mutex %s @ %s:%d", + m->lock_object.lo_name, file, line)); + if (mtx_owned(m)) + KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0, + ("thread_lock: recursed on non-recursive mutex %s @ %s:%d\n", + m->lock_object.lo_name, file, line)); + WITNESS_CHECKORDER(&m->lock_object, + opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); +} +#else +#define thread_lock_validate(m, opts, file, line) do { } while (0) +#endif + +#ifndef LOCK_PROFILING +#if LOCK_DEBUG > 0 void +_thread_lock(struct thread *td, int opts, const char *file, int line) +#else +void +_thread_lock(struct thread *td) +#endif +{ + struct mtx *m; + uintptr_t tid, v; + + tid = (uintptr_t)curthread; + + spinlock_enter(); + m = td->td_lock; + thread_lock_validate(m, 0, file, line); + v = MTX_READ_VALUE(m); + if (__predict_true(v == MTX_UNOWNED)) { + if (__predict_false(!_mtx_obtain_lock(m, tid))) + goto slowpath_unlocked; + } else if (v == tid) { + m->mtx_recurse++; + } else + goto slowpath_unlocked; + if (__predict_true(m == td->td_lock)) { + WITNESS_LOCK(&m->lock_object, LOP_EXCLUSIVE, file, line); + return; + } + if (m->mtx_recurse != 0) + m->mtx_recurse--; + else + _mtx_release_lock_quick(m); +slowpath_unlocked: + spinlock_exit(); + thread_lock_flags_(td, 0, 0, 0); +} +#endif + +void thread_lock_flags_(struct thread *td, int opts, const char *file, int line) { struct mtx *m; @@ -834,17 +894,7 @@ retry: v = MTX_UNOWNED; spinlock_enter(); m = td->td_lock; - KASSERT(m->mtx_lock != MTX_DESTROYED, - ("thread_lock() of destroyed mutex @ %s:%d", file, line)); - KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin, - ("thread_lock() of sleep mutex %s @ %s:%d", - m->lock_object.lo_name, file, line)); - if (mtx_owned(m)) - KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0, - ("thread_lock: recursed on non-recursive mutex %s @ %s:%d\n", - m->lock_object.lo_name, file, line)); - WITNESS_CHECKORDER(&m->lock_object, - opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL); + thread_lock_validate(m, opts, file, line); for (;;) { if (_mtx_obtain_lock_fetch(m, &v, tid)) break; Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Sat Oct 21 21:58:24 2017 (r324835) +++ head/sys/sys/mutex.h Sat Oct 21 22:40:09 2017 (r324836) @@ -127,9 +127,23 @@ void __mtx_assert(const volatile uintptr_t *c, int wha int line); #endif void thread_lock_flags_(struct thread *, int, const char *, int); +#if LOCK_DEBUG > 0 +void _thread_lock(struct thread *td, int opts, const char *file, int line); +#else +void _thread_lock(struct thread *); +#endif +#if defined(LOCK_PROFILING) || defined(KLD_MODULE) #define thread_lock(tdp) \ thread_lock_flags_((tdp), 0, __FILE__, __LINE__) +#elif LOCK_DEBUG > 0 +#define thread_lock(tdp) \ + _thread_lock((tdp), 0, __FILE__, __LINE__) +#else +#define thread_lock(tdp) \ + _thread_lock((tdp)) +#endif + #define thread_lock_flags(tdp, opt) \ thread_lock_flags_((tdp), (opt), __FILE__, __LINE__) #define thread_unlock(tdp) \ From owner-svn-src-head@freebsd.org Sat Oct 21 22:45:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49519E3BDE7 for ; Sat, 21 Oct 2017 22:45:19 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-lf0-x234.google.com (mail-lf0-x234.google.com [IPv6:2a00:1450:4010:c07::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C23766E19F for ; Sat, 21 Oct 2017 22:45:18 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-lf0-x234.google.com with SMTP id 90so16482435lfs.13 for ; Sat, 21 Oct 2017 15:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=wXsTNSS2MNhkCRFojOGV7vevaRlpiJjdQj2/HTxzu6s=; b=c57MgOxy5RUSS3DUju0Ll2wPV0AnldFNoGhXoah8xGWzvPus7IuCg3N9x4ZLmScQ8b YwTwNWIfRzFR5EQjp8rks0WEbKe3VdtBZn6VUdURQBThy/tJ8vpW+XKztrpXbxfn7fDk 6egDbzOxvOl/OVOGPhR9KxsgieFh2nW4QCEUCRi5Vsg4DL0CO8yO9l+mZ8hxgpaKrF9m NKsOio86m8i2L/ahcNp+WSqcbRVjTpuNZ9FBaoAYl4l4IjULFcrmF4Wh75bNaPB9HTEt th59tpYwu6ehXuO75rlyRud4kz9h0KUiCMFNfqujq1nVnNjYMCASolbHulJPj6wx6u6J OGug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=wXsTNSS2MNhkCRFojOGV7vevaRlpiJjdQj2/HTxzu6s=; b=K5ePyMNRNvJLa2VYQ2XgxQrcxX3+KMV4rD1PoEvGUaY2W/f3YESImYCXdVy5F+Ee0k jaXBA7+v8Jtjells1Yx/mcOLwPvsf1BgbWbbD6Zofi8LMw1qHz+AJDWRlhHQKACmmw/5 bT6/XNwwut15O0qnFU+UjfabKQgPZbVfFbdLZ/0qzHY6mlNkD1gqaze7XmGpROhGa2n8 PtE5w/XHZLCCEF2T8Pmo5+iCzUYERFMJwMTt4pawoGQUPXoCsssMpxqH9HTp8J7Jex5Q R2Usxi2c0A1jK0B2sjSbnxKu6mc0a3Jl5WVtx0bCyT6DTLisxe89/bU3q9wQcRQAn629 XoOg== X-Gm-Message-State: AMCzsaXkJwaDJISK43UEIHvxW+rjZ9AOJsotCRWC7O5CoenvRcDpprFA FsJlYXWFlaFNfn1XyRYzDX/aHmLz4kz8LoGhbqrh3w== X-Google-Smtp-Source: ABhQp+TJ3bxwJaLwVQTxEw1H5pj/rzSN3dFfsqF2yFdBvLX16/FNxCrImnxXdiUZx1CGj65Z4y6drBXKS2yHGyJeypI= X-Received: by 10.25.83.71 with SMTP id h68mr2893381lfb.241.1508625916620; Sat, 21 Oct 2017 15:45:16 -0700 (PDT) MIME-Version: 1.0 References: <201705231659.v4NGxOB8013882@repo.freebsd.org> In-Reply-To: From: Steven Hartland Date: Sat, 21 Oct 2017 22:45:05 +0000 Message-ID: Subject: Re: svn commit: r318751 - in head/sys: kern sys To: Allan Jude , Steve Wills , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 22:45:19 -0000 Personally I hate that idea as like being able to see all the processes from the host. I have a similar hate of Linux containers where you have to jump though hoops just to see whats really happening on the host. On Sat, 21 Oct 2017 at 20:29, Allan Jude wrote: > On 2017-05-23 12:59, Steve Wills wrote: > > Author: swills (ports committer) > > Date: Tue May 23 16:59:24 2017 > > New Revision: 318751 > > URL: https://svnweb.freebsd.org/changeset/base/318751 > > > > Log: > > Add security.bsd.see_jail_proc > > > > Add security.bsd.see_jail_proc sysctl to hide jail processes from > non-root > > users > > > > Reviewed by: jamie > > Approved by: allanjude > > Relnotes: yes > > Differential Revision: https://reviews.freebsd.org/D10770 > > > I user was asking about this issue on IRC today. > > I think I have changed my mind a bit. > > I think we should make the default be off (so you can't see processes in > a jail from the host) by default in 12. > > And that we should MFC this sysctl to stable/11, but not change the > default behaviour there. > > Anyone else have thoughts? > > -- > Allan Jude > > From owner-svn-src-head@freebsd.org Sat Oct 21 22:55:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4045E3C4A8; Sat, 21 Oct 2017 22:55:40 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA9136E6ED; Sat, 21 Oct 2017 22:55:40 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id CBCCA133C0; Sat, 21 Oct 2017 22:55:38 +0000 (UTC) Subject: Re: svn commit: r318751 - in head/sys: kern sys To: Steven Hartland , Steve Wills , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201705231659.v4NGxOB8013882@repo.freebsd.org> From: Allan Jude Message-ID: <96e0c0bc-eb9c-2ffa-9216-88678d0e8730@freebsd.org> Date: Sat, 21 Oct 2017 18:55:34 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vFwxUcvivvD2ITOrruoMDvRPtSs8gM853" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 22:55:41 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vFwxUcvivvD2ITOrruoMDvRPtSs8gM853 Content-Type: multipart/mixed; boundary="8Xp2jf0tca3I9Jr5Uw22UMCA17XsgC2al"; protected-headers="v1" From: Allan Jude To: Steven Hartland , Steve Wills , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <96e0c0bc-eb9c-2ffa-9216-88678d0e8730@freebsd.org> Subject: Re: svn commit: r318751 - in head/sys: kern sys References: <201705231659.v4NGxOB8013882@repo.freebsd.org> In-Reply-To: --8Xp2jf0tca3I9Jr5Uw22UMCA17XsgC2al Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2017-10-21 18:45, Steven Hartland wrote: > Personally I hate that idea as like being able to see all the processes= > from the host. >=20 > I have a similar hate of Linux containers where you have to jump though= > hoops just to see whats really happening on the host. >=20 > On Sat, 21 Oct 2017 at 20:29, Allan Jude > wrote: >=20 > On 2017-05-23 12:59, Steve Wills wrote: > > Author: swills (ports committer) > > Date: Tue May 23 16:59:24 2017 > > New Revision: 318751 > > URL: https://svnweb.freebsd.org/changeset/base/318751 > > > > Log: > >=C2=A0 =C2=A0Add security.bsd.see_jail_proc > > > >=C2=A0 =C2=A0Add security.bsd.see_jail_proc sysctl to hide jail pr= ocesses > from non-root > >=C2=A0 =C2=A0users > > > >=C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 jamie > >=C2=A0 =C2=A0Approved by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 allanjude > >=C2=A0 =C2=A0Relnotes:=C2=A0 =C2=A0yes > >=C2=A0 =C2=A0Differential Revision:=C2=A0 =C2=A0 =C2=A0 https://re= views.freebsd.org/D10770 > > > I user was asking about this issue on IRC today. >=20 > I think I have changed my mind a bit. >=20 > I think we should make the default be off (so you can't see process= es in > a jail from the host) by default in 12. >=20 > And that we should MFC this sysctl to stable/11, but not change the= > default behaviour there. >=20 > Anyone else have thoughts? >=20 > -- > Allan Jude >=20 Note: this does NOT change root's ability to see the processes in the jai= l. I just stops uid 1001 on the host, from using the processes owned by uid 1001 in each jail, even in the presence of: security.bsd.see_other_uids=3D= 0 --=20 Allan Jude --8Xp2jf0tca3I9Jr5Uw22UMCA17XsgC2al-- --vFwxUcvivvD2ITOrruoMDvRPtSs8gM853 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJZ69BpAAoJEBmVNT4SmAt+WlcQAJqY8JjmmRdNCFgE5fNKwjyc Lvur8LvuNljn0R8v8CRDHdUdWaLBN82T7B8mztLmyuCTCl6HHgE5dKzzHcA7/Arb PPqoXMsN4rBkVKDbuWcbhRSAsZf1EQpUT7BHQLSPt9MyNmlUR+e55/LpbKNhRi3s nZWzg7H9nmVoDTl3mp+ALujI6c9uAAXQVtrji+K3RX+pNaUfp528jEjsqRg49+wq amrlJrkZSemzwPeIG76g6lLAe628SpVZ21cSPi+qI6ZgfL9ZSN+qN8k0VR6sNFSC LSn/IlG2Vrgdw4Fn40mNlvjp7oT4MQao3nPCvuB+MGYjopJ9txNxGBct5mVn/UjE 7nBV7DBFVxA3qny11nodsSCzPP9BIAeCh99jH338AbEeoqd6rI2plgz3KxVhjoKQ b4ISAwzgi6ag8mjaAE/RU0WkjTTMLg8Oy2RaHzWAWCwV++dFDpiSZHP8hFZnQPYj iLtFNQ2EdxbnpcLmC0MT83X6ZxzS8rRbnfe60gZndClRZEyOdhO3qK4LsXNt6KnZ 3MupgA13F+8L81Z4fWNVH6IeEQQjFENplmw5E7Zk0HUUJE84vFbc/g/Xx6p2usyn iKgibaFYpmOx80DrC9MT+lDtM3Kg0EuB8hLwL25ZJyB2GTwVyW1fVLMjJKKnnRvk c+gMHESAJIGLWWvSLCLp =PBL/ -----END PGP SIGNATURE----- --vFwxUcvivvD2ITOrruoMDvRPtSs8gM853-- From owner-svn-src-head@freebsd.org Sat Oct 21 23:42:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E005AE3D4CF; Sat, 21 Oct 2017 23:42:33 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x22d.google.com (mail-pg0-x22d.google.com [IPv6:2607:f8b0:400e:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAAE46FCE1; Sat, 21 Oct 2017 23:42:33 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x22d.google.com with SMTP id s75so9156733pgs.0; Sat, 21 Oct 2017 16:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=bg6hKIPO/0j5z7Lr9NI83Kgjy8EW4RJGIuDLn4wyspo=; b=JwAa9emyzf+QldRRWk6sCm5GmePkKo0vdaQZ5fQV8/6NfLOq4JmeTnA3rH4SIBXa/n brOc863g3rnDeiUQ7S5DL37cdHpg5VXHORINRPwLxhlDeXlo0KaxeaRzLhk4s+dbrRzD BnMUTuHsAfjNFIRHHE24aAxe3ZA3zfmX+WO9QaM1MshDn8N6Kbybl6hDCq6FlzmBIvY3 5S0RoCwhPR7QazuJME1yFfOKCRaX8QKPeJReVOl8jw8+zQ357B5Ovyn4O+GrvxKrCAhH r3TJrXiXGXjjiFE1mW+6UtPXFCuFLZjIEWYRTvAwj475AEPa4bLiURQjXIrFkznGFst9 3Umg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=bg6hKIPO/0j5z7Lr9NI83Kgjy8EW4RJGIuDLn4wyspo=; b=iPoKcMnAg+9cLZeGQ7P6isLg0B+Sha+CiaBFGBTYPGcY00nIVTP+ID/UeuVe0okg31 bp2E6GCbpUQhIBrLPhQMrYMpVtEYu0LH5hieRKklP6+n7ueVKei3pX3Emg3J7+qDZG6L U36OxbP1pyWlUIHBDVCFVt70MhjhyxAcFrHB6k8pKhyTkpj74OZa/BHhknX72EO2HjGo XxN6pn49tIkTgyrmCHgHheBiDigrp2ubijnhjq6uOL54OH3qDUm+Ld5rPY47+4zHBkr8 3P25QD2hV+SVyqg0Ic9YCZMx0wOXXpbpN7HX9gznHE7ANCHV10FUvBSjpl0KEms19KVw zoow== X-Gm-Message-State: AMCzsaVeLsRpCW20e3fBDUm0Gn0UzHtWe75dag97f7zg9oDSyYNVVBin Xzs1gOJ3qDv4FNJQjNJkCaaf9Zcb X-Google-Smtp-Source: ABhQp+TiZjpfltisjItndkIdJr5EvkXI/eBgCv9zyP1MuY+GFaTVK4gpaNc7VlPSZaQVtvlOnQa5pw== X-Received: by 10.159.197.11 with SMTP id bj11mr7230333plb.354.1508629352946; Sat, 21 Oct 2017 16:42:32 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id r77sm7277174pfk.93.2017.10.21.16.42.31 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 21 Oct 2017 16:42:32 -0700 (PDT) Subject: Re: svn commit: r324835 - head/etc Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_CD35312B-CD80-46DE-884F-721E75D45CFC"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201710212158.v9LLwOsi079627@repo.freebsd.org> Date: Sat, 21 Oct 2017 16:42:30 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <7E6069EB-30CE-46D2-A173-7D84B1E64435@gmail.com> References: <201710212158.v9LLwOsi079627@repo.freebsd.org> To: Brad Davis X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Oct 2017 23:42:34 -0000 --Apple-Mail=_CD35312B-CD80-46DE-884F-721E75D45CFC Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Oct 21, 2017, at 14:58, Brad Davis wrote: > > Author: brd (doc,ports committer) > Date: Sat Oct 21 21:58:24 2017 > New Revision: 324835 > URL: https://svnweb.freebsd.org/changeset/base/324835 > > Log: > Remove a atrun check that is nullified by r318443. > > Approved by: will Thanks :). -Ngie --Apple-Mail=_CD35312B-CD80-46DE-884F-721E75D45CFC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZ69tnAAoJEPWDqSZpMIYViCIP/0aGLgBn7+Uwvi4OBb21aNnN eKvv6fAhD4AGAAaGBRUTVZrQMmTYVgIbWXVqw8Vl5fbaZo8IJtpOqlpT/QQABWgV zSs5qOoXVQ84DGsdCSIFF8rHwNJXNzq/Mz34p3IngV5Ny6l+A14cU4CcOfrt/XJP 2htoeJDAZ51zwoBTJSzA5/4jZhHLZIJt5RdH5BCs0aOf5+MJ3LdQl/p12GKHHcI3 YMWjuIW1nz+ZgSINToN/jvls2L/Yd6H2lYGIBGJjoKXygRjdoB8nmUg9EL7/0jAY HHeoQnJ0hKqv5bdAtV2djXudmHUImmYVmiUAPXyADqnJwE9rJ9EfTMeUjMBasiyH 40USQ6ySHgLEyuzunAdN+2PThZXojV4lJ+WhYhvju7u/S+Vwfi72p7fV0y4PEp7B vj3fp6ODGu4rIJzmaIjlNpO3JxYN2/VhO5vkHUiqhe9tm9MglZcwt4J2PapRR8xh QVnDBXiu015midGhImFuN6B9mcrh/B4nctWLv9t6rOT0Mj3R17KJp5KULYHw65bL uaBDmhRfAhnicjE8fS99zj3ps8NZmZ4WGqhzPxUz7adbBK3KCxmRN+RXlkQPuu5Q spq+rSyVkJDB730PDG9irrm2tcy+vxad3rRXjoPepazCABwEyqMJrBhhGgKaDta0 laS9zc9+gOEflQj0lJnU =Oyks -----END PGP SIGNATURE----- --Apple-Mail=_CD35312B-CD80-46DE-884F-721E75D45CFC--