From owner-freebsd-hackers@freebsd.org Sun Aug 18 13:38:50 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 136D8C7AC6 for ; Sun, 18 Aug 2019 13:38:50 +0000 (UTC) (envelope-from wojtek@puchar.net) Received: from puchar.net (puchar.net [194.1.144.90]) (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 46BJ6w2xMZz4XvG for ; Sun, 18 Aug 2019 13:38:47 +0000 (UTC) (envelope-from wojtek@puchar.net) Received: Received: from 127.0.0.1 (localhost [127.0.0.1]) by puchar.net (8.15.2/8.15.2) with ESMTPS id x7IDdaxt003985 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 18 Aug 2019 15:39:36 +0200 (CEST) (envelope-from puchar-wojtek@puchar.net) Received: from localhost (puchar-wojtek@localhost) by puchar.net (8.15.2/8.15.2/Submit) with ESMTP id x7IDdafs003980 for ; Sun, 18 Aug 2019 15:39:36 +0200 (CEST) (envelope-from puchar-wojtek@puchar.net) Date: Sun, 18 Aug 2019 15:39:36 +0200 (CEST) From: Wojciech Puchar To: freebsd-hackers@freebsd.org Subject: bhyve problem Message-ID: User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 46BJ6w2xMZz4XvG X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of wojtek@puchar.net designates 194.1.144.90 as permitted sender) smtp.mailfrom=wojtek@puchar.net X-Spamd-Result: default: False [-6.77 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; RCVD_IN_DNSWL_NONE(0.00)[90.144.1.194.list.dnswl.org : 127.0.10.0]; IP_SCORE(-3.48)[ip: (-9.18), ipnet: 194.1.144.0/24(-4.59), asn: 43476(-3.67), country: PL(0.06)]; DMARC_NA(0.00)[puchar.net]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:43476, ipnet:194.1.144.0/24, country:PL]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2019 13:38:50 -0000 after updating system to FreeBSD puchar.net 11.3-PRERELEASE FreeBSD 11.3-PRERELEASE #2 r347617: Sat Jun 1 18:32:23 CEST 2019 root@puchar.net:/h/backup1/src/sys/amd64/compile/puchar amd64 bhyve no longer works attempts to start VM that worked normally like nice -n -20 /usr/sbin/bhyve -s 0,hostbridge -m 2048M -P -H -c 2 \ -s 7,fbuf,rfb=10.0.1.1:5902,password=2j74uo5 \ -s 3,ahci-hd,/dev/label/Windows2-C.eli,hd:/dev/label/Windows2-U.eli,hd:/dev/label/Windows2-V.eli \ -s 5,virtio-net,tap5,mac=08:00:27:b7:ca:0b \ -s 30,virtio-rnd -s 31,lpc -U dc53b3f7-7eb0-11e7-b5b8-54ee7513f26b \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -w windows2 /usr/sbin/bhyvectl --destroy --vm=windows2 results in bhyve: vm_set_topology on console and bhyve exits. no more messages. no VM. what's wrong? From owner-freebsd-hackers@freebsd.org Sun Aug 18 14:55:47 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9638C9313 for ; Sun, 18 Aug 2019 14:55:47 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46BKqk4bPMz4cJv for ; Sun, 18 Aug 2019 14:55:46 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: by mail-io1-xd33.google.com with SMTP id t6so15545044ios.7 for ; Sun, 18 Aug 2019 07:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wJmFY/J68rW+3qDEgkPoYOFgc7eIBXKSS5URGx4ipqY=; b=kmf7YIznOI5wHY9YW7ayvbw9jqddRDMUj3OcWj5/W2+9hbT8bvN9ArhWQ9pgZJZ1iS mNhmoHRvA4Ao1LjQb41Le3J7/LgGg1wewYkbEwtaNaXEko0gm8vFht6/2XSGBwlZhTvc /IZja7vWudidw1O1aKfQ1tq2GKzBnpWzPXHbq9su/emhAS0x0+TKth7qWv1vTzkIzgEA rE0H015/1RaHNs9pkyX0LON/q2Da1jdLI5GDMnSr9mQ/plaWqKexWGFajwtiQDKKSUuH H75O1x640AZrlcN5U/pOJ+ZjOY/bqx9/+1pG9XeTHwOz0SAaxoOZSE6bPGlttu3Jne9J IP+A== 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:cc; bh=wJmFY/J68rW+3qDEgkPoYOFgc7eIBXKSS5URGx4ipqY=; b=XVcgMyxuhRgN2OnmD6n45Ab6O1QghPl+Ni/aloxjCHmvQbTLyefTzS6PchHpTwHz48 J2TeBvFqkly9TWA7SXPqOoBUtBhXVF+HKarz0e0ENvgsrvAJ9nDAlCNC9h/ltEJZfMae WC2ViMiosz4enAmaIyY0JIq3StIxcINA16ZWS4JlaPm/mEyVWMNb4Tu0hedGY4dI54Xi dbYqMjpdfC4qRlbn9MicT1HyIwKGmEM6DjhK/AS+8wuXVhPLL60B/NKBAIG8jvYBVohm 3kzLw/0BunCXHwglbV9sg5wLfhCHfHrVhnAP5lMLhDRPP3u/IWn2wG+8vNnuIXjml4Nr 0AsQ== X-Gm-Message-State: APjAAAWeIE1L3tFQlT814NPJqc5crexfd7kqAxSpNPNPn8P6WP77epIT s2cY0OyyP9FkikGoMvaHfC8awyN8dSlz5J3+6QlZwqlv X-Google-Smtp-Source: APXvYqz2mPHi2EV2NbYQTiIMW/hnD2BO8OiM2WgHrLG6j8nLEf2O3SRGDhT+9nTBASpd/90lkroALarEhulKerdTr6U= X-Received: by 2002:a02:ba91:: with SMTP id g17mr21296750jao.11.1566140145324; Sun, 18 Aug 2019 07:55:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Adam Date: Sun, 18 Aug 2019 09:55:34 -0500 Message-ID: Subject: Re: bhyve problem To: Wojciech Puchar Cc: FreeBSD Hackers X-Rspamd-Queue-Id: 46BKqk4bPMz4cJv X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=kmf7YIzn; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of amvandemore@gmail.com designates 2607:f8b0:4864:20::d33 as permitted sender) smtp.mailfrom=amvandemore@gmail.com X-Spamd-Result: default: False [-1.99 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; URI_COUNT_ODD(1.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.99)[-0.995,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-3.76), ipnet: 2607:f8b0::/32(-2.95), asn: 15169(-2.38), country: US(-0.05)]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; HTTP_TO_IP(1.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2019 14:55:48 -0000 On Sun, Aug 18, 2019 at 8:39 AM Wojciech Puchar wrote: > after updating system to > > FreeBSD puchar.net 11.3-PRERELEASE FreeBSD 11.3-PRERELEASE #2 r347617: > Sat > Jun 1 18:32:23 CEST 2019 > root@puchar.net:/h/backup1/src/sys/amd64/compile/puchar amd64 > > bhyve no longer works > > attempts to start VM that worked normally like > > nice -n -20 /usr/sbin/bhyve -s 0,hostbridge -m 2048M -P -H -c 2 \ > -s 7,fbuf,rfb=10.0.1.1:5902,password=2j74uo5 \ > -s > 3,ahci-hd,/dev/label/Windows2-C.eli,hd:/dev/label/Windows2-U.eli,hd:/dev/label/Windows2-V.eli > \ > -s 5,virtio-net,tap5,mac=08:00:27:b7:ca:0b \ > -s 30,virtio-rnd -s 31,lpc -U dc53b3f7-7eb0-11e7-b5b8-54ee7513f26b \ > -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -w windows2 > /usr/sbin/bhyvectl --destroy --vm=windows2 > > > results in > > bhyve: vm_set_topology > > > on console > > and bhyve exits. no more messages. no VM. > > what's wrong? > I think how bhyve presents CPU to guest changed, you can try syntax like this: -c 4,sockets=1,cores=4 -- Adam From owner-freebsd-hackers@freebsd.org Sun Aug 18 17:06:14 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4DFACBD52 for ; Sun, 18 Aug 2019 17:06:14 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.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 46BNkF5XQ8z3G9S for ; Sun, 18 Aug 2019 17:06:13 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x7IH6AWG040851; Sun, 18 Aug 2019 10:06:10 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x7IH6ASf040850; Sun, 18 Aug 2019 10:06:10 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201908181706.x7IH6ASf040850@gndrsh.dnsmgr.net> Subject: Re: bhyve problem In-Reply-To: To: Wojciech Puchar Date: Sun, 18 Aug 2019 10:06:10 -0700 (PDT) CC: freebsd-hackers@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-Rspamd-Queue-Id: 46BNkF5XQ8z3G9S X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [-0.64 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.73)[-0.725,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.72)[-0.719,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.14)[-0.139,0]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.05)[ip: (0.15), ipnet: 69.59.192.0/19(0.08), asn: 13868(0.05), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2019 17:06:14 -0000 > after updating system to > > FreeBSD puchar.net 11.3-PRERELEASE FreeBSD 11.3-PRERELEASE #2 r347617: Sat > Jun 1 18:32:23 CEST 2019 > root@puchar.net:/h/backup1/src/sys/amd64/compile/puchar amd64 > > bhyve no longer works > > attempts to start VM that worked normally like > > nice -n -20 /usr/sbin/bhyve -s 0,hostbridge -m 2048M -P -H -c 2 \ ^^^^ This is the topology, it looks fine. Hummm... You could try "-c cpus=2" but that should make no difference at all. Are you by any chance having syctl's for cpu topology set? hw.vmm.topology.cores_per_package hw.vmm.topology.threads_per_core Can you show me the output of: sysctl -a hw.vmm.topology > -s 7,fbuf,rfb=10.0.1.1:5902,password=2j74uo5 \ > -s 3,ahci-hd,/dev/label/Windows2-C.eli,hd:/dev/label/Windows2-U.eli,hd:/dev/label/Windows2-V.eli \ > -s 5,virtio-net,tap5,mac=08:00:27:b7:ca:0b \ > -s 30,virtio-rnd -s 31,lpc -U dc53b3f7-7eb0-11e7-b5b8-54ee7513f26b \ > -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -w windows2 > /usr/sbin/bhyvectl --destroy --vm=windows2 > > > results in > > bhyve: vm_set_topology Humm.. you have 2 commands above, which one produced this error? I think you actually only ran the first command which failed, and you never actually ran the second command. If it is the first command that is failing can you do a ls -lag /dev/vmm/windows2 BEFORE you run that command, I want to see if this might be a reinit attempt. > on console > > and bhyve exits. no more messages. no VM. > > what's wrong? -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Sun Aug 18 17:07:34 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68EF2CBF03 for ; Sun, 18 Aug 2019 17:07:34 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.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 46BNln3cCDz3GX1 for ; Sun, 18 Aug 2019 17:07:32 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x7IH7Vi2040866; Sun, 18 Aug 2019 10:07:31 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x7IH7Vrm040865; Sun, 18 Aug 2019 10:07:31 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201908181707.x7IH7Vrm040865@gndrsh.dnsmgr.net> Subject: Re: bhyve problem In-Reply-To: To: Adam Date: Sun, 18 Aug 2019 10:07:31 -0700 (PDT) CC: Wojciech Puchar , FreeBSD Hackers X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46BNln3cCDz3GX1 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [-0.67 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.76)[-0.758,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-0.76)[-0.761,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.10)[-0.098,0]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.05)[ip: (0.15), ipnet: 69.59.192.0/19(0.08), asn: 13868(0.05), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2019 17:07:34 -0000 > On Sun, Aug 18, 2019 at 8:39 AM Wojciech Puchar wrote: > > > after updating system to > > > > FreeBSD puchar.net 11.3-PRERELEASE FreeBSD 11.3-PRERELEASE #2 r347617: > > Sat > > Jun 1 18:32:23 CEST 2019 > > root@puchar.net:/h/backup1/src/sys/amd64/compile/puchar amd64 > > > > bhyve no longer works > > > > attempts to start VM that worked normally like > > > > nice -n -20 /usr/sbin/bhyve -s 0,hostbridge -m 2048M -P -H -c 2 \ > > -s 7,fbuf,rfb=10.0.1.1:5902,password=2j74uo5 \ > > -s > > 3,ahci-hd,/dev/label/Windows2-C.eli,hd:/dev/label/Windows2-U.eli,hd:/dev/label/Windows2-V.eli > > \ > > -s 5,virtio-net,tap5,mac=08:00:27:b7:ca:0b \ > > -s 30,virtio-rnd -s 31,lpc -U dc53b3f7-7eb0-11e7-b5b8-54ee7513f26b \ > > -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -w windows2 > > /usr/sbin/bhyvectl --destroy --vm=windows2 > > > > > > results in > > > > bhyve: vm_set_topology > > > > > > on console > > > > and bhyve exits. no more messages. no VM. > > > > what's wrong? > > > > I think how bhyve presents CPU to guest changed, you can try syntax like > this: > > -c 4,sockets=1,cores=4 A raw -c 2 should still work just fine, the new code was written to be fully backwards compatible in that respect. BUT there may be a bug, or there may also be other things at play like topology sysctl's might be interfering with this. -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Mon Aug 19 07:05:09 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 270AAAAD57 for ; Mon, 19 Aug 2019 07:05:09 +0000 (UTC) (envelope-from wojtek@puchar.net) Received: from puchar.net (puchar.net [194.1.144.90]) (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 46BlLD01Jnz4Pjv for ; Mon, 19 Aug 2019 07:05:06 +0000 (UTC) (envelope-from wojtek@puchar.net) Received: Received: from 127.0.0.1 (localhost [127.0.0.1]) by puchar.net (8.15.2/8.15.2) with ESMTPS id x7J75rup080173 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 19 Aug 2019 09:05:53 +0200 (CEST) (envelope-from puchar-wojtek@puchar.net) Received: from localhost (puchar-wojtek@localhost) by puchar.net (8.15.2/8.15.2/Submit) with ESMTP id x7J75rJP080169; Mon, 19 Aug 2019 09:05:53 +0200 (CEST) (envelope-from puchar-wojtek@puchar.net) Date: Mon, 19 Aug 2019 09:05:53 +0200 (CEST) From: Wojciech Puchar To: "Rodney W. Grimes" cc: Wojciech Puchar , freebsd-hackers@freebsd.org Subject: Re: bhyve problem In-Reply-To: <201908181706.x7IH6ASf040850@gndrsh.dnsmgr.net> Message-ID: References: <201908181706.x7IH6ASf040850@gndrsh.dnsmgr.net> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 46BlLD01Jnz4Pjv X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of wojtek@puchar.net designates 194.1.144.90 as permitted sender) smtp.mailfrom=wojtek@puchar.net X-Spamd-Result: default: False [-6.77 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[puchar.net]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; RCVD_IN_DNSWL_NONE(0.00)[90.144.1.194.list.dnswl.org : 127.0.10.0]; IP_SCORE(-3.48)[ip: (-9.19), ipnet: 194.1.144.0/24(-4.59), asn: 43476(-3.68), country: PL(0.06)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:43476, ipnet:194.1.144.0/24, country:PL]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2019 07:05:09 -0000 the problem was that i upgraded userland, compiled kernel but forgot to install kernel. On Sun, 18 Aug 2019, Rodney W. Grimes wrote: >> after updating system to >> >> FreeBSD puchar.net 11.3-PRERELEASE FreeBSD 11.3-PRERELEASE #2 r347617: Sat >> Jun 1 18:32:23 CEST 2019 >> root@puchar.net:/h/backup1/src/sys/amd64/compile/puchar amd64 >> >> bhyve no longer works >> >> attempts to start VM that worked normally like >> >> nice -n -20 /usr/sbin/bhyve -s 0,hostbridge -m 2048M -P -H -c 2 \ > ^^^^ > This is the topology, it looks fine. Hummm... > You could try "-c cpus=2" but that should make no difference at all. > > Are you by any chance having syctl's for cpu topology set? > hw.vmm.topology.cores_per_package > hw.vmm.topology.threads_per_core > > Can you show me the output of: > sysctl -a hw.vmm.topology > > >> -s 7,fbuf,rfb=10.0.1.1:5902,password=2j74uo5 \ >> -s 3,ahci-hd,/dev/label/Windows2-C.eli,hd:/dev/label/Windows2-U.eli,hd:/dev/label/Windows2-V.eli \ >> -s 5,virtio-net,tap5,mac=08:00:27:b7:ca:0b \ >> -s 30,virtio-rnd -s 31,lpc -U dc53b3f7-7eb0-11e7-b5b8-54ee7513f26b \ >> -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -w windows2 >> /usr/sbin/bhyvectl --destroy --vm=windows2 >> >> >> results in >> >> bhyve: vm_set_topology > > Humm.. you have 2 commands above, which one produced this error? > I think you actually only ran the first command which failed, and > you never actually ran the second command. > > If it is the first command that is failing can you do a > ls -lag /dev/vmm/windows2 > BEFORE you run that command, I want to see if this might > be a reinit attempt. > >> on console >> >> and bhyve exits. no more messages. no VM. >> >> what's wrong? > > -- > Rod Grimes rgrimes@freebsd.org > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > From owner-freebsd-hackers@freebsd.org Mon Aug 19 13:35:14 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E71E5C6AEE for ; Mon, 19 Aug 2019 13:35:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Bw0K5Lwyz3LWm for ; Mon, 19 Aug 2019 13:35:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x829.google.com with SMTP id k13so1838344qtm.12 for ; Mon, 19 Aug 2019 06:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HAriBfEimGEDOh7qeJxw1XaMg4S70U7HtNf6OJx51a0=; b=PAf3JFeN9U+0nwTQyiQINpX8KUAEuZQFQu6eqQFyzjHJ9wQb/XhauePE6AJULonMXm fmObS2TNFCHuTz1tO80U97pch+zQO9UuMhOuavwGNOqFbsMCDVccTrGRuW4+kBmO8GjL eGBdYgmYMmu0I9WEMSfpMwChiLlC6+/LR93EXGXYnjdtta2yNGS70Q3YNolTG07vtU+2 J6H0mg7LQDrZJZ4R7kgEViuN73nvBm5J/xNFcUrU/BL9uC+Ww9m3ejISZkZ9ZqZ/vlGA OTF9Tkt+3kkgpmM/Ig3y8xbyIZG3375+4Wrk1qCEMsjDlhXYaDdQrpn9MgWyoaujv35h I3bA== 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:cc; bh=HAriBfEimGEDOh7qeJxw1XaMg4S70U7HtNf6OJx51a0=; b=sRZpfJ2essCZBxAQUGYojHCMot4kMp73Iv+iJe5DLInKWJk9+peDDa7TaoPqegc6Jk JObKCw+c7ekA3pY+g0v3bbFNBe3AbxKyeyemukb2C0ahpuWy5oTac/2aOdCFmB0zOdj+ pCs2gZyOFbipI2LhxNK77UiLSi4yHzQ1WSIL+RicCll7qAGlYHgKDA1YOP0Jjhy1L4vB AV36ra29BebZ/drlQp/2WYyPQIOwZBuu2VomACrNsCTTv7YlJUdp8PjGiiNtS1EhnOuO ytBFmgR9/JYORsbmC1EEBdX/JCPRAHUPDk5LXyRYeyroW3cpAiqJR+in7OAqFk4Qc6yg cTwg== X-Gm-Message-State: APjAAAXt1PY32DkySvXd/q4LqiNz1GhT9dyJLsCKYO9C64vKiCxc1lwt 0AUo6+65ZUIDCx+QXgCRZL1pq4O92mt85dGw4h8UtQ== X-Google-Smtp-Source: APXvYqz8bsuQEkZw9kTy70IWWfcmy2hHPBDqltJCao6SvbkGg95/vWe6ppz5ROVvUPHRh6HCHfydQ7LoS9uhzsnvF9M= X-Received: by 2002:a0c:c250:: with SMTP id w16mr10320646qvh.188.1566221712249; Mon, 19 Aug 2019 06:35:12 -0700 (PDT) MIME-Version: 1.0 References: <201908181706.x7IH6ASf040850@gndrsh.dnsmgr.net> In-Reply-To: From: Warner Losh Date: Mon, 19 Aug 2019 07:34:59 -0600 Message-ID: Subject: Re: bhyve problem To: Wojciech Puchar Cc: "Rodney W. Grimes" , FreeBSD Hackers X-Rspamd-Queue-Id: 46Bw0K5Lwyz3LWm X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=PAf3JFeN; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::829) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.94 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[9]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; RCVD_IN_DNSWL_NONE(0.00)[9.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; HTTP_TO_IP(1.00)[]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.95)[ip: (-9.39), ipnet: 2607:f8b0::/32(-2.93), asn: 15169(-2.37), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2019 13:35:15 -0000 I wonder which kernel interface changed in an incompatible way... Warner On Mon, Aug 19, 2019, 1:05 AM Wojciech Puchar wrote: > the problem was that i upgraded userland, compiled kernel but forgot to > install kernel. > > > On Sun, 18 Aug 2019, Rodney W. Grimes wrote: > > >> after updating system to > >> > >> FreeBSD puchar.net 11.3-PRERELEASE FreeBSD 11.3-PRERELEASE #2 r347617: > Sat > >> Jun 1 18:32:23 CEST 2019 > >> root@puchar.net:/h/backup1/src/sys/amd64/compile/puchar amd64 > >> > >> bhyve no longer works > >> > >> attempts to start VM that worked normally like > >> > >> nice -n -20 /usr/sbin/bhyve -s 0,hostbridge -m 2048M -P -H -c 2 \ > > ^^^^ > > This is the topology, it looks fine. Hummm... > > You could try "-c cpus=2" but that should make no difference at all. > > > > Are you by any chance having syctl's for cpu topology set? > > hw.vmm.topology.cores_per_package > > hw.vmm.topology.threads_per_core > > > > Can you show me the output of: > > sysctl -a hw.vmm.topology > > > > > >> -s 7,fbuf,rfb=10.0.1.1:5902,password=2j74uo5 \ > >> -s > 3,ahci-hd,/dev/label/Windows2-C.eli,hd:/dev/label/Windows2-U.eli,hd:/dev/label/Windows2-V.eli > \ > >> -s 5,virtio-net,tap5,mac=08:00:27:b7:ca:0b \ > >> -s 30,virtio-rnd -s 31,lpc -U dc53b3f7-7eb0-11e7-b5b8-54ee7513f26b \ > >> -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -w windows2 > >> /usr/sbin/bhyvectl --destroy --vm=windows2 > >> > >> > >> results in > >> > >> bhyve: vm_set_topology > > > > Humm.. you have 2 commands above, which one produced this error? > > I think you actually only ran the first command which failed, and > > you never actually ran the second command. > > > > If it is the first command that is failing can you do a > > ls -lag /dev/vmm/windows2 > > BEFORE you run that command, I want to see if this might > > be a reinit attempt. > > > >> on console > >> > >> and bhyve exits. no more messages. no VM. > >> > >> what's wrong? > > > > -- > > Rod Grimes > rgrimes@freebsd.org > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to " > freebsd-hackers-unsubscribe@freebsd.org" > > > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@freebsd.org Mon Aug 19 15:29:11 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76AD4C955B for ; Mon, 19 Aug 2019 15:29:11 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.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 46ByWp2mypz3xBl for ; Mon, 19 Aug 2019 15:29:09 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x7JFT5bl045008; Mon, 19 Aug 2019 08:29:05 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x7JFT4lN045007; Mon, 19 Aug 2019 08:29:04 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201908191529.x7JFT4lN045007@gndrsh.dnsmgr.net> Subject: Re: bhyve problem In-Reply-To: To: Warner Losh Date: Mon, 19 Aug 2019 08:29:04 -0700 (PDT) CC: Wojciech Puchar , FreeBSD Hackers , "Rodney W. Grimes" X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46ByWp2mypz3xBl X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [-0.46 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.80)[-0.797,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-0.47)[-0.470,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.14)[-0.137,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.05)[ip: (0.15), ipnet: 69.59.192.0/19(0.08), asn: 13868(0.05), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2019 15:29:11 -0000 > I wonder which kernel interface changed in an incompatible way... The fact that he had a new user land with an ioctl that does not exist in his kernel would be the "incompatible way". The ioctl didnt exist so an error was returned. Nothing more in the name of compatibility could be done. > Warner > > On Mon, Aug 19, 2019, 1:05 AM Wojciech Puchar wrote: > > > the problem was that i upgraded userland, compiled kernel but forgot to > > install kernel. > > > > > > On Sun, 18 Aug 2019, Rodney W. Grimes wrote: > > > > >> after updating system to > > >> > > >> FreeBSD puchar.net 11.3-PRERELEASE FreeBSD 11.3-PRERELEASE #2 r347617: > > Sat > > >> Jun 1 18:32:23 CEST 2019 > > >> root@puchar.net:/h/backup1/src/sys/amd64/compile/puchar amd64 > > >> > > >> bhyve no longer works > > >> > > >> attempts to start VM that worked normally like > > >> > > >> nice -n -20 /usr/sbin/bhyve -s 0,hostbridge -m 2048M -P -H -c 2 \ > > > ^^^^ > > > This is the topology, it looks fine. Hummm... > > > You could try "-c cpus=2" but that should make no difference at all. > > > > > > Are you by any chance having syctl's for cpu topology set? > > > hw.vmm.topology.cores_per_package > > > hw.vmm.topology.threads_per_core > > > > > > Can you show me the output of: > > > sysctl -a hw.vmm.topology > > > > > > > > >> -s 7,fbuf,rfb=10.0.1.1:5902,password=2j74uo5 \ > > >> -s > > 3,ahci-hd,/dev/label/Windows2-C.eli,hd:/dev/label/Windows2-U.eli,hd:/dev/label/Windows2-V.eli > > \ > > >> -s 5,virtio-net,tap5,mac=08:00:27:b7:ca:0b \ > > >> -s 30,virtio-rnd -s 31,lpc -U dc53b3f7-7eb0-11e7-b5b8-54ee7513f26b \ > > >> -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -w windows2 > > >> /usr/sbin/bhyvectl --destroy --vm=windows2 > > >> > > >> > > >> results in > > >> > > >> bhyve: vm_set_topology > > > > > > Humm.. you have 2 commands above, which one produced this error? > > > I think you actually only ran the first command which failed, and > > > you never actually ran the second command. > > > > > > If it is the first command that is failing can you do a > > > ls -lag /dev/vmm/windows2 > > > BEFORE you run that command, I want to see if this might > > > be a reinit attempt. > > > > > >> on console > > >> > > >> and bhyve exits. no more messages. no VM. > > >> > > >> what's wrong? > > > > > > -- > > > Rod Grimes > > rgrimes@freebsd.org > > > _______________________________________________ > > > freebsd-hackers@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > > To unsubscribe, send any mail to " > > freebsd-hackers-unsubscribe@freebsd.org" > > > > > > > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Mon Aug 19 16:59:44 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DED0ECB52C for ; Mon, 19 Aug 2019 16:59:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46C0XH72Nrz42Sn for ; Mon, 19 Aug 2019 16:59:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x829.google.com with SMTP id x4so2663299qts.5 for ; Mon, 19 Aug 2019 09:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iusklYsgUNQJmX9+v1EnCRTiIVPfeZ9TwBeAtUuiz6U=; b=Pg4UXN4ijsHtkUy/4qcIfJsWyAEr+NDlz5vojuq83BfwsUQnE7DRazJQ/LtDmhuUA1 4OCXUej2ti9+YVhPs5hoZDezprK8lNuBzHAVFvo8bW/X4sggPg5j6mB6Lfaho7jmlUAI DdT566pS7QV0z4dcAXORnbrRQV3TU0cYfrhNpVzkCV3lolt9YR3r7UgOs+DTvLj6q0+q psNHonHcXJobV6+VIMS7Za3NYlJD1QLmVWYsRz5vo+9kI5V6lXlxW+FU9J8/FiloUiGG avuzPwZv2lB9TGKOj4R9N4vulPkA8pO/SOvvPghXBVHOen4gSGnA1e1UB/bckI7KmY5u WYZg== 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:cc; bh=iusklYsgUNQJmX9+v1EnCRTiIVPfeZ9TwBeAtUuiz6U=; b=HYHkVSb2hPsy3AXsiktopAO9yTxiwh04AvqPwWzLUNBDPgkMh01VSPj9NE3rJLCeMJ Bd9RX/CnyVfgKMw6EMeujyArzmCni50Xyb/sGNgwBA3pjn6U6j0clgJ8rvHNnoRTSSse mWEDXbdp1DNsPhnOHhmWiFsCl/bOXQ0/rANQ8g+2OaX41IERkbDgsaKnya31vGlVWa0b Q3PTXZ6X8w3yNuMJ1zmxl1woT+H6ZoF2nspUZbdD9dCqEbPImA9o4cyu82YeQzYmCFXW CiCAhrD5RGNMvYviJC6o7hMlkBtC6rcZXYrQEgtLXaK72RIypQtUMP9UT9FtZHKp5xRo SG2A== X-Gm-Message-State: APjAAAXPxszukTkVVrBcUTaChODy7OK1IWl0rWN1N+m071IEROQGA41Y EU8nRaBdKUzZYB2ErYr1Pn2tc9gCZYBbRpTBiPOTgvD3bMQ= X-Google-Smtp-Source: APXvYqxIKYjNX0aKvav8MI1iXZeQRk+DpsWzQzssoDC5MXELbNcevnLoS6Em+3x0y51E03S9CnKluJiDd4f9+hqTwaY= X-Received: by 2002:ac8:6907:: with SMTP id e7mr2257689qtr.32.1566233982190; Mon, 19 Aug 2019 09:59:42 -0700 (PDT) MIME-Version: 1.0 References: <201908191529.x7JFT4lN045007@gndrsh.dnsmgr.net> In-Reply-To: <201908191529.x7JFT4lN045007@gndrsh.dnsmgr.net> From: Warner Losh Date: Mon, 19 Aug 2019 10:59:31 -0600 Message-ID: Subject: Re: bhyve problem To: "Rodney W. Grimes" Cc: Wojciech Puchar , FreeBSD Hackers X-Rspamd-Queue-Id: 46C0XH72Nrz42Sn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=Pg4UXN4i; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::829) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.94 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; RCVD_IN_DNSWL_NONE(0.00)[9.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; HTTP_TO_IP(1.00)[]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.95)[ip: (-9.39), ipnet: 2607:f8b0::/32(-2.93), asn: 15169(-2.37), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2019 16:59:44 -0000 On Mon, Aug 19, 2019 at 9:29 AM Rodney W. Grimes < freebsd-rwg@gndrsh.dnsmgr.net> wrote: > > I wonder which kernel interface changed in an incompatible way... > > The fact that he had a new user land with an ioctl that > does not exist in his kernel would be the "incompatible way". > > The ioctl didnt exist so an error was returned. > Nothing more in the name of compatibility could be done. > I'm concerned that the errors weren't properly reported so the OP had to send mail to the mailing list. Either we need a better error reporting mechanism or need to back to the old way of doing things when the new way fails... Warner > > Warner > > > > On Mon, Aug 19, 2019, 1:05 AM Wojciech Puchar wrote: > > > > > the problem was that i upgraded userland, compiled kernel but forgot to > > > install kernel. > > > > > > > > > On Sun, 18 Aug 2019, Rodney W. Grimes wrote: > > > > > > >> after updating system to > > > >> > > > >> FreeBSD puchar.net 11.3-PRERELEASE FreeBSD 11.3-PRERELEASE #2 > r347617: > > > Sat > > > >> Jun 1 18:32:23 CEST 2019 > > > >> root@puchar.net:/h/backup1/src/sys/amd64/compile/puchar amd64 > > > >> > > > >> bhyve no longer works > > > >> > > > >> attempts to start VM that worked normally like > > > >> > > > >> nice -n -20 /usr/sbin/bhyve -s 0,hostbridge -m 2048M -P -H -c 2 \ > > > > ^^^^ > > > > This is the topology, it looks fine. Hummm... > > > > You could try "-c cpus=2" but that should make no difference at all. > > > > > > > > Are you by any chance having syctl's for cpu topology set? > > > > hw.vmm.topology.cores_per_package > > > > hw.vmm.topology.threads_per_core > > > > > > > > Can you show me the output of: > > > > sysctl -a hw.vmm.topology > > > > > > > > > > > >> -s 7,fbuf,rfb=10.0.1.1:5902,password=2j74uo5 \ > > > >> -s > > > > 3,ahci-hd,/dev/label/Windows2-C.eli,hd:/dev/label/Windows2-U.eli,hd:/dev/label/Windows2-V.eli > > > \ > > > >> -s 5,virtio-net,tap5,mac=08:00:27:b7:ca:0b \ > > > >> -s 30,virtio-rnd -s 31,lpc -U dc53b3f7-7eb0-11e7-b5b8-54ee7513f26b \ > > > >> -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -w windows2 > > > >> /usr/sbin/bhyvectl --destroy --vm=windows2 > > > >> > > > >> > > > >> results in > > > >> > > > >> bhyve: vm_set_topology > > > > > > > > Humm.. you have 2 commands above, which one produced this error? > > > > I think you actually only ran the first command which failed, and > > > > you never actually ran the second command. > > > > > > > > If it is the first command that is failing can you do a > > > > ls -lag /dev/vmm/windows2 > > > > BEFORE you run that command, I want to see if this might > > > > be a reinit attempt. > > > > > > > >> on console > > > >> > > > >> and bhyve exits. no more messages. no VM. > > > >> > > > >> what's wrong? > > > > > > > > -- > > > > Rod Grimes > > > rgrimes@freebsd.org > > > > _______________________________________________ > > > > freebsd-hackers@freebsd.org mailing list > > > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > > > To unsubscribe, send any mail to " > > > freebsd-hackers-unsubscribe@freebsd.org" > > > > > > > > > > > _______________________________________________ > > > freebsd-hackers@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > > To unsubscribe, send any mail to " > freebsd-hackers-unsubscribe@freebsd.org" > > > > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to " > freebsd-hackers-unsubscribe@freebsd.org" > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-freebsd-hackers@freebsd.org Mon Aug 19 17:10:07 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4157BCBC1D for ; Mon, 19 Aug 2019 17:10:07 +0000 (UTC) (envelope-from luthramihir708@gmail.com) Received: from mail-ua1-x944.google.com (mail-ua1-x944.google.com [IPv6:2607:f8b0:4864:20::944]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46C0mG1X5Kz43D2 for ; Mon, 19 Aug 2019 17:10:05 +0000 (UTC) (envelope-from luthramihir708@gmail.com) Received: by mail-ua1-x944.google.com with SMTP id y7so911211uae.10 for ; Mon, 19 Aug 2019 10:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Rb+F02UKxpgz3UxcVvfj7GvkMkR9iXoro03B97qLaWY=; b=Fn48+bplWcFZ5yyKXnsvSaIfUzeyIl1NrfElnD1i6NwoUaY6wo0iC4r/phWnZ/ykjm B6I6Kq+DA/4ga+KZ3FCgpbuLBph079/3dWqvty8Ez64jdLykSRIpADRpGVfhGEMYw35q SQ6aBePQ7Mlrlyno9+xMqoUPH5P1n4NJlGWgEEmedmAXg7KQahZ2yMyVlcChoWbhXGEh iCddOHMc7pP9ZglI4aQtDvo+O2bXsE+O8BoshnfeTtJepLALOG2geZDU68y+mi8E7nX9 cvpvh2YHMHlHeElrHy6bte+1bELWNnMGULZmUX/kIo1VbgMQGiaVfZlaCCfvtUrZGToY 5h9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Rb+F02UKxpgz3UxcVvfj7GvkMkR9iXoro03B97qLaWY=; b=NH9q2IwHOLZjeDJvxUgKZi9X2kh9cz0xt8pT5GZKSv1FURn+xkp97zMoiBRQM2Fz0K X6kkKFhHwW5Wtmf4yzVIiCn+Hcun6xhIZIRx1e+kvr0oHm+qguRF0qj/Q4+r9En5k4qt qNeomKIPYfRmN7O0/qI2yJQYakQnKH4HlCqARGi9eNzXQdf9Bb96S8qhKl/ecAr68Wfb Z2g1Vd5WfGwUq//eULIxipPon5FNp06WuQ6DQelCv+A2qeIWdUl/sc2eVPGXIgwyKHn4 HKSpDsOHIOx+ZL5EiD7IvdIpZA9EmwvZOOQi+6QrheGffaosC6KjCKOOMIpM9lq/G35S 2x4Q== X-Gm-Message-State: APjAAAVhQKfJW4qKcwi0pRIO3pnD0lA9Vw6cynnGzQeMHoi2UL7oSQ2b QUHPzC0GuIA2jON3E46tT6fQi7LmTSjcD95h8Ar9OwDf X-Google-Smtp-Source: APXvYqw0v9XrEUrosQglvCCvbRM6VoRrii2fsnE84GJr22YJ/YirERPr0WMYrV+r07KC1RSykCy2rQOtAK5rKWHr/Rs= X-Received: by 2002:ab0:1573:: with SMTP id p48mr1859409uae.78.1566234604376; Mon, 19 Aug 2019 10:10:04 -0700 (PDT) MIME-Version: 1.0 From: Mihir Luthra Date: Mon, 19 Aug 2019 22:39:53 +0530 Message-ID: Subject: undefined behaviour of return statement in /bin/sh and missing man entry To: freebsd-hackers@freebsd.org X-Rspamd-Queue-Id: 46C0mG1X5Kz43D2 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Fn48+bpl; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of luthramihir708@gmail.com designates 2607:f8b0:4864:20::944 as permitted sender) smtp.mailfrom=luthramihir708@gmail.com X-Spamd-Result: default: False [-3.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(0.00)[ip: (2.63), ipnet: 2607:f8b0::/32(-2.93), asn: 15169(-2.37), country: US(-0.05)]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[4.4.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2019 17:10:07 -0000 Hi everyone, Recently I was writing script on my virtual machine where I needed to know If a /bin/sh script has been sourced. I found many ways on stackoverflow, most of which only seem to work for bash. Although after some research, I found a way that should have worked with /bin/sh. It was that if I executed return from a function or sourced script, it should work fine and in other cases it should have wrote to stderr. Although on executing return on command line I got logged out and on executing same on non-login shells it just exited. Also, there seem to be no entry for return statement on man page of sh. [1] I have posted a brief explanation for the same in my stackoverfow question. [2]. [1] https://www.freebsd.org/cgi/man.cgi?query=sh&manpath=Unix+Seventh+Edition [2] https://stackoverflow.com/questions/57547626/detect-if-a-script-has-been-sourced-in-bin-sh Kind Regards, Mihir From owner-freebsd-hackers@freebsd.org Mon Aug 19 17:30:35 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C700CC68B for ; Mon, 19 Aug 2019 17:30:35 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46C1Ct5PGYz45B3 for ; Mon, 19 Aug 2019 17:30:34 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1566235832; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=V2m6yg4MoWKOie00MVJE1ZTZPJoXb5tzIv/FsbaZqmyUSgN985ACYIwEOTJmOk5hdfY0V5EMrxSkp +Th+qoujxilpfW/5gayXrDsDJyBg6fDbIa8VX+V3JxcNN1sJnIZK1m6+lCg7dfr4bugvq5T+l3HZrv 6CMxi1YCusOoN+k+1Rk7qkfnSA0PD2LKWM3cJwF76tckEer8Yux4xFnP9RuHv0Y3XYmS/j3YXJZW8Q EC6gvZs8tVbQy8gq+UQuo8X2Qt8PaGdUBZ6t7YJe2/78fAfcKk45WGBURwruTVe959tM+XglTVQ2Ul 59weRGoVcg4xyUqPlOeRxtI7XpUIaMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=xSj4NU+X/f/mSJNkehQ84leLxjgAoNvEyXTZWLJT42o=; b=lUQPGNMN5kv09RKFcbRkwSxNxzJBZUzesHnVhj1cJrgQaER2wreZMCP0H559/Orfg4dq3BQpA94/C V8m1a0l4iMIzwsOzqkb0nT2IH/hAWXdofLYW1z3mS6UJUVz6eGMfummx4QS1Dd0bLU0iH6HrEkP57S A67gZHRPIFoI14/OqLj9shLvBMVkjAKdimcMVfssMKqEFj3epGedJg+v1KabPfhSqLwkFtcEaM1Ie0 w7bMdEUQ5lEDEYRA8jkvzkHPs1kUHxv/V9LvHY+tioObdJ96atGh26oTkmsI+5nh92aWMW69sz+wzs 81kQwbdRRj6sbOlCBmRP7515V0PFsyA== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=xSj4NU+X/f/mSJNkehQ84leLxjgAoNvEyXTZWLJT42o=; b=ksVyZhJbWPfQDPBepsWC2yEkt4Tju0JgujFJD/EqcnutmhnfuO4bK0wYqDn57Y3G2lstF5ijmFd1O s69BEuEYplknJF67kSTtuDj9jbWf0/qHhgXMzgKisUKe0Cyr+CMElGABbZG4QnIeNuu3IfHpfUIN/N ry5b9kQ1KLpqG+6IeoNjmZk4FqBDKvYFkNphkTmoBs2LsHM5B2tYhbUiL1LxMUzo4NLrht8y2VPV8y xbXdUVBqvOZBRk09DJXSx+3J+WK0p1/i62EWypC8VaCdM3eeg85sfoEd09JpAZcFW7enmQqOhEBcE0 o3PLecilAaXe29F8xsp1nU0O4m1iZ7w== X-MHO-RoutePath: aGlwcGll X-MHO-User: 0a95f868-c2a7-11e9-b67b-cdd75d6ce7a8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 0a95f868-c2a7-11e9-b67b-cdd75d6ce7a8; Mon, 19 Aug 2019 17:30:31 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x7JHUU5o076500; Mon, 19 Aug 2019 11:30:30 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: undefined behaviour of return statement in /bin/sh and missing man entry From: Ian Lepore To: Mihir Luthra , freebsd-hackers@freebsd.org Date: Mon, 19 Aug 2019 11:30:30 -0600 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46C1Ct5PGYz45B3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2019 17:30:35 -0000 On Mon, 2019-08-19 at 22:39 +0530, Mihir Luthra wrote: > Hi everyone, > > Recently I was writing script on my virtual machine where I needed to > know > If a /bin/sh script has been sourced. I found many ways on > stackoverflow, > most of which only seem to work for bash. Although after some > research, I > found a way that should have worked with /bin/sh. It was that if I > executed > return from a function or sourced script, it should work fine and in > other > cases it should have wrote to stderr. > > Although on executing return on command line I got logged out and on > executing same on non-login shells it just exited. > Also, there seem to be no entry for return statement on man page of > sh. [1] > > I have posted a brief explanation for the same in my stackoverfow > question. > [2]. > > [1] > https://www.freebsd.org/cgi/man.cgi?query=sh&manpath=Unix+Seventh+Edition > [2] > https://stackoverflow.com/questions/57547626/detect-if-a-script-has-been-sourced-in-bin-sh > You looked in the wrong set of manpages, right one [1] says... The syntax of the return command is return [exitstatus] It terminates the current executional scope, returning from the closest nested function or sourced script; if no function or sourced script is being executed, it exits the shell instance. The return command is implemented as a special built-in command. I think when I tried to solve this problem once, the only thing I came up with is the fact that $0 doesn't change when you source-in a script. So if a given script knows what its name should be, and the expansion of ${0##*/} doesn't match that name, it can mean the script was sourced in. Or it can mean the user renamed the file or executed it through a link, so it's not foolproof. [1] https://www.freebsd.org/cgi/man.cgi?query=sh -- Ian From owner-freebsd-hackers@freebsd.org Mon Aug 19 18:09:00 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F382DCD250 for ; Mon, 19 Aug 2019 18:08:59 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.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 46C24B5vx5z47Wv for ; Mon, 19 Aug 2019 18:08:58 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x7JI8mHe045609; Mon, 19 Aug 2019 11:08:48 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x7JI8mbN045608; Mon, 19 Aug 2019 11:08:48 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201908191808.x7JI8mbN045608@gndrsh.dnsmgr.net> Subject: Re: bhyve problem In-Reply-To: To: Warner Losh Date: Mon, 19 Aug 2019 11:08:48 -0700 (PDT) CC: "Rodney W. Grimes" , FreeBSD Hackers , Wojciech Puchar X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46C24B5vx5z47Wv X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [-0.45 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.79)[-0.795,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-0.47)[-0.468,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.14)[-0.137,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.05)[ip: (0.15), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.05), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Aug 2019 18:09:00 -0000 > On Mon, Aug 19, 2019 at 9:29 AM Rodney W. Grimes < > freebsd-rwg@gndrsh.dnsmgr.net> wrote: > > > > I wonder which kernel interface changed in an incompatible way... > > > > The fact that he had a new user land with an ioctl that > > does not exist in his kernel would be the "incompatible way". > > > > The ioctl didnt exist so an error was returned. > > Nothing more in the name of compatibility could be done. > > > > I'm concerned that the errors weren't properly reported so the OP had to > send mail to the mailing list. Either we need a better error reporting > mechanism or need to back to the old way of doing things when the new way > fails... I do not know what more can new code report when it makes a call that it expects to be there and is told that the call does not exist? The OP shot his foot, he tried to run a new user land on an old kernel, an unsupported environment. Exactly how could one in prove the error reporting? Check for kernel version and function support, that opens a massive can of worms. Exactly what old way are you refering to? I think your running down a rabbit hole that is purely foot shot by trying to run new userland on old kernel, something that would take all the developers the rest of time to solve. > Warner > > > > > Warner > > > > > > On Mon, Aug 19, 2019, 1:05 AM Wojciech Puchar wrote: > > > > > > > the problem was that i upgraded userland, compiled kernel but forgot to > > > > install kernel. > > > > > > > > > > > > On Sun, 18 Aug 2019, Rodney W. Grimes wrote: > > > > > > > > >> after updating system to > > > > >> > > > > >> FreeBSD puchar.net 11.3-PRERELEASE FreeBSD 11.3-PRERELEASE #2 > > r347617: > > > > Sat > > > > >> Jun 1 18:32:23 CEST 2019 > > > > >> root@puchar.net:/h/backup1/src/sys/amd64/compile/puchar amd64 > > > > >> > > > > >> bhyve no longer works > > > > >> > > > > >> attempts to start VM that worked normally like > > > > >> > > > > >> nice -n -20 /usr/sbin/bhyve -s 0,hostbridge -m 2048M -P -H -c 2 \ > > > > > ^^^^ > > > > > This is the topology, it looks fine. Hummm... > > > > > You could try "-c cpus=2" but that should make no difference at all. > > > > > > > > > > Are you by any chance having syctl's for cpu topology set? > > > > > hw.vmm.topology.cores_per_package > > > > > hw.vmm.topology.threads_per_core > > > > > > > > > > Can you show me the output of: > > > > > sysctl -a hw.vmm.topology > > > > > > > > > > > > > > >> -s 7,fbuf,rfb=10.0.1.1:5902,password=2j74uo5 \ > > > > >> -s > > > > > > 3,ahci-hd,/dev/label/Windows2-C.eli,hd:/dev/label/Windows2-U.eli,hd:/dev/label/Windows2-V.eli > > > > \ > > > > >> -s 5,virtio-net,tap5,mac=08:00:27:b7:ca:0b \ > > > > >> -s 30,virtio-rnd -s 31,lpc -U dc53b3f7-7eb0-11e7-b5b8-54ee7513f26b \ > > > > >> -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -w windows2 > > > > >> /usr/sbin/bhyvectl --destroy --vm=windows2 > > > > >> > > > > >> > > > > >> results in > > > > >> > > > > >> bhyve: vm_set_topology > > > > > > > > > > Humm.. you have 2 commands above, which one produced this error? > > > > > I think you actually only ran the first command which failed, and > > > > > you never actually ran the second command. > > > > > > > > > > If it is the first command that is failing can you do a > > > > > ls -lag /dev/vmm/windows2 > > > > > BEFORE you run that command, I want to see if this might > > > > > be a reinit attempt. > > > > > > > > > >> on console > > > > >> > > > > >> and bhyve exits. no more messages. no VM. > > > > >> > > > > >> what's wrong? > > > > > > > > > > -- > > > > > Rod Grimes > > > > rgrimes@freebsd.org > > > > > _______________________________________________ > > > > > freebsd-hackers@freebsd.org mailing list > > > > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > > > > To unsubscribe, send any mail to " > > > > freebsd-hackers-unsubscribe@freebsd.org" > > > > > > > > > > > > > > _______________________________________________ > > > > freebsd-hackers@freebsd.org mailing list > > > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > > > To unsubscribe, send any mail to " > > freebsd-hackers-unsubscribe@freebsd.org" > > > > > > > _______________________________________________ > > > freebsd-hackers@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > > To unsubscribe, send any mail to " > > freebsd-hackers-unsubscribe@freebsd.org" > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Tue Aug 20 21:56:16 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F476E2269; Tue, 20 Aug 2019 21:56:16 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Cl3z1HyGz484b; Tue, 20 Aug 2019 21:56:14 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id x7KLuASe018890 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Aug 2019 21:56:11 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: freebsd-security@freebsd.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id x7KLu2Cr069045 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 21 Aug 2019 04:56:02 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: FreeBSD Security Advisory FreeBSD-SA-19:23.midi To: freebsd-security@freebsd.org References: <20190820201257.7A9D41F8B7@freefall.freebsd.org> From: Eugene Grosbein Cc: Freebsd hackers list Message-ID: Date: Wed, 21 Aug 2019 04:55:58 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20190820201257.7A9D41F8B7@freefall.freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 46Cl3z1HyGz484b X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-4.08 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.05)[ip: (-1.43), ipnet: 2a01:4f8::/29(-1.95), asn: 24940(-1.85), country: DE(-0.01)]; R_SPF_PERMFAIL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2019 21:56:16 -0000 21.08.2019 3:12, FreeBSD Security Advisories wrote: [skip] > IV. Workaround > > No workaround is available. Custom kernels without "device sound" > are not vulnerable. Is it true that there is no way to disable vulnerable and unneeded device driver built in GENERIC other that through rebuilding the kernel? I remember that pre-4.x versions of FreeBSD had visual VGA-based pre-boot configurator allowing to disable any compiled-in device driver. Don't device.hints(5) or loader(8) have means to do so? These days GENERIC have LOTS of drivers and it's convenient but unsafe. From owner-freebsd-hackers@freebsd.org Tue Aug 20 22:01:45 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3E41E2671 for ; Tue, 20 Aug 2019 22:01:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46ClBJ4RlDz48kM for ; Tue, 20 Aug 2019 22:01:44 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1566338503; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=fE2yDXMYl+xNKZsR+MVNchiYpSoqJgJI04DgKeC7zmjU+RQUftxIrI6u4pWhvrQazF2VH9DMIoC1/ vqS4D3u9I/yF22U2z8L9jmEK5pGBKoScOKkV8mjAIBeTsIelzTguTzclmn9QsIB8AGFAckjHkHfDyu RR9cQAGDH65R02Im/UIY4kw8KeSggBvDcmULCinpwL61OMZqTRwQYjnGJEprXtmlhSXago5NIkOx1v 3nxKvv+37zWaJPYq7KHdWP3zobxsTdotDV7m3U7uAGj+pWu9yowI4PXV+mbZ2uzrZPNkQ8WK84TkPg GC2MESFPCqG/SOKnGH56ggRRplnJodA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=ABIqVPr2u8Ujx+vBa+OdbASKAJ00dLkpgYgEHnN3inQ=; b=PL9xdcHGcuLFIUHaboktvuN9vRbqtwxnS+H8wJ62qqAmLfYBpzZLVlG59YtQnKbEbGph6Jansctr6 UFvOBLawmLLML0KRNGrE+4BkVe2np6TJ1KtH/EjqVTxUJETuu94iOT0F/M7uF7vD8aiXDkIaLYuDQ5 t077uIPFIhneSK719mReOV5OAF6l7WQ/94oCOqGGLTxwajEIj2tjcYFs5kacMjzaYXnHivUOl+1ACm iyJcNAD0kxcR7nRJA2+h3T93wCPqnLO7JFYleGFEWhDbTDGToCCwF3ivtRmBi1aOCSl3B0FgELm+Oy DxzEdHNWTLveiromGCT91nG6AhJTsTg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=ABIqVPr2u8Ujx+vBa+OdbASKAJ00dLkpgYgEHnN3inQ=; b=iLK4IRv+Lq/iZtcE6ozi0mvBT8fLmneU3zxqQXLMvpuzQXYGTakdJNafH/nEEkVoeUrJ7VMNp8kyp qc+5M4CJXNC41nGrD7XT48WE7qZp802l8q9LLdW3qpgX9Sh6qaJiMOaYNvHhCC2TI2UheqqPv7r+ZC i8yXtPFKv955kirl0Rs+2seKss9W0Dl6h+zMLc1s70Gg4lrjLCrT+/sGfHe+SmF1P7NGeE8OT68uYS zhwzhuasD0XdNm9EhO1Xee+WsBW6Dl2r3iMhK/PShF6cYbUARdqVkIislhDcFGZrZHwimrrw3JRnbB MrLh2qmTVBBpbALhS9Rc1dDzWPdnlTA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 1602e52c-c396-11e9-85ec-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 1602e52c-c396-11e9-85ec-13b9aae3a1d2; Tue, 20 Aug 2019 22:01:42 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x7KM1dgZ081449; Tue, 20 Aug 2019 16:01:39 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1909279dfc6002f6c21ff8e92ca2925511dca322.camel@freebsd.org> Subject: Re: FreeBSD Security Advisory FreeBSD-SA-19:23.midi From: Ian Lepore To: Eugene Grosbein , freebsd-security@freebsd.org Cc: Freebsd hackers list Date: Tue, 20 Aug 2019 16:01:39 -0600 In-Reply-To: References: <20190820201257.7A9D41F8B7@freefall.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46ClBJ4RlDz48kM X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2019 22:01:45 -0000 On Wed, 2019-08-21 at 04:55 +0700, Eugene Grosbein wrote: > 21.08.2019 3:12, FreeBSD Security Advisories wrote: > > [skip] > > > IV. Workaround > > > > No workaround is available. Custom kernels without "device sound" > > are not vulnerable. > > Is it true that there is no way to disable vulnerable and unneeded > device driver > built in GENERIC other that through rebuilding the kernel? > > I remember that pre-4.x versions of FreeBSD had visual VGA-based pre- > boot configurator > allowing to disable any compiled-in device driver. Don't > device.hints(5) or loader(8) have means to do so? > > These days GENERIC have LOTS of drivers and it's convenient but > unsafe. > "No workaround" just seems to be wrong. Aside from setting the disabled hint to turn off the driver (or using devctl to turn it off on a live system), the exploit also requires opening /dev/midistat, so a viable workaround is to change its permissions so that users can't open it. -- Ian From owner-freebsd-hackers@freebsd.org Tue Aug 20 22:30:13 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 845C4E2ED2; Tue, 20 Aug 2019 22:30:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Clq92wXSz4BQ8; Tue, 20 Aug 2019 22:30:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd44.google.com with SMTP id i22so687811ioh.2; Tue, 20 Aug 2019 15:30:13 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VRIlT7a7YXFktXwjNVDsT761cPKD1N/FXHEcPtQxNUg=; b=gRerU0JwoJKJh9mtrHe41yXA+sJCRxoAd6TrDkI7AC15oxTx1f/h8dGnxJB3tfuVgO J88ANZH4BBPtBqLZdYoGY3a7Wk5cDulgpfWivX0ddG5CO1IvxlyTmTC4WTbopDsT8X7p GHoC/RfVvAtsgxGI/T7L/sGqZAn17Vqto92svKM1gcHekxbBQ+GqwzhFjn0kb1bEqwc/ VuGBOMUKg0OZs6EYEssfWOnNyE4hB2ZH+oS4rnUcGbj7hcpBvLke+9iA83eJVhZhdOlz +OnH0ixkmeL4/fjj8TyklnTs0rfnt+8TUjhBdQq9wUL8jdOgFSbfA90AbH05nybp0m4E HKVA== 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 :references:mime-version:content-disposition:in-reply-to:user-agent; bh=VRIlT7a7YXFktXwjNVDsT761cPKD1N/FXHEcPtQxNUg=; b=D3M0L2/xyuEqJs9KXOjakL39ovzCz+rqVTijR/HThfWoY8pIz+rCBtpPmJx752XBb8 sRjtWMYcF4hvtRKuVVaj48jQRrT9pHUcpRWXKCvOXILnn4qWCLF2NIpN68sWPM2uPjkE dCrAbsFG+Rz54r72B5HK0QUAmlRiSziUf0gvBta6i3asLhDf/8BCvqOC9IklkkZwHmap gRITEfC0LtJ8q8PMsx21KVbbzqLYjAfyPGTgQraMmCC3KLRWZl9fR4mCH8aZa+li07vC 9VsYOZ/yCMdw5Po4JHnqpvwj1zBVTSmy8gkjlgvedUl3H+pO/lNKdqzQXT5h89o0sQy1 F4LA== X-Gm-Message-State: APjAAAVNyjthntmBLst0xgBtUUY/RyMzAQ9vDZn4gPlH5/a5B5HzrhFP eyb/YRP7yfEHitqrEXBqyS75o+dwVw8= X-Google-Smtp-Source: APXvYqxzdjEwZzlZ263SsyHJUJ9je//uUBSkkY7hv+TdLOdX1nhTe4iRjvhG7m6uoxnoXk9UBMOz0g== X-Received: by 2002:a6b:ee12:: with SMTP id i18mr33845472ioh.172.1566340211972; Tue, 20 Aug 2019 15:30:11 -0700 (PDT) Received: from raichu (toroon0560w-lp130-04-184-145-252-124.dsl.bell.ca. [184.145.252.124]) by smtp.gmail.com with ESMTPSA id u24sm2615819iot.38.2019.08.20.15.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 15:30:10 -0700 (PDT) Sender: Mark Johnston Date: Tue, 20 Aug 2019 18:30:08 -0400 From: Mark Johnston To: Ian Lepore Cc: Eugene Grosbein , freebsd-security@freebsd.org, Freebsd hackers list Subject: Re: FreeBSD Security Advisory FreeBSD-SA-19:23.midi Message-ID: <20190820223008.GC46556@raichu> References: <20190820201257.7A9D41F8B7@freefall.freebsd.org> <1909279dfc6002f6c21ff8e92ca2925511dca322.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1909279dfc6002f6c21ff8e92ca2925511dca322.camel@freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46Clq92wXSz4BQ8 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.973,0] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2019 22:30:13 -0000 On Tue, Aug 20, 2019 at 04:01:39PM -0600, Ian Lepore wrote: > On Wed, 2019-08-21 at 04:55 +0700, Eugene Grosbein wrote: > > 21.08.2019 3:12, FreeBSD Security Advisories wrote: > > > > [skip] > > > > > IV. Workaround > > > > > > No workaround is available. Custom kernels without "device sound" > > > are not vulnerable. > > > > Is it true that there is no way to disable vulnerable and unneeded > > device driver > > built in GENERIC other that through rebuilding the kernel? > > > > I remember that pre-4.x versions of FreeBSD had visual VGA-based pre- > > boot configurator > > allowing to disable any compiled-in device driver. Don't > > device.hints(5) or loader(8) have means to do so? > > > > These days GENERIC have LOTS of drivers and it's convenient but > > unsafe. > > > > "No workaround" just seems to be wrong. Aside from setting the > disabled hint to turn off the driver (or using devctl to turn it off on > a live system), the exploit also requires opening /dev/midistat, so a > viable workaround is to change its permissions so that users can't open > it. Yeah, this was an oversight. The SA text will be amended. From owner-freebsd-hackers@freebsd.org Wed Aug 21 17:14:36 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60765CE895; Wed, 21 Aug 2019 17:14:36 +0000 (UTC) (envelope-from shivankgarg98@gmail.com) Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DDmW1NWRz4F28; Wed, 21 Aug 2019 17:14:34 +0000 (UTC) (envelope-from shivankgarg98@gmail.com) Received: by mail-ed1-f68.google.com with SMTP id z51so3756735edz.13; Wed, 21 Aug 2019 10:14:34 -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:from:date:message-id:subject:to; bh=5DytjjhbIngv/VSn0G4tbBSoOT5HLY+UGUMDExp7FIY=; b=R04MUQ1UoMflpwhjOFKIwZmyhrH7praFeoRwV3TCjEm7CRL5ICZntGIqqOpWHYOOID hJJMrDpKpvyemIMVhUSU7erOqlfeXJ1PClIQKplkSMEYSfZe+HlNqaPxBA0jWCWg5RCF +2wQ6fxkYV5Ay/swCPRjUxRTUu2cLKGSvOkr2xZDlXEmfvKMkROEaICe1roLwV00tAn5 YxxNe0z0xdP88yeR5A4bKqJlla+M2VMKHSOV7NVsbctJkzYsFYbHDf3II5qXCN2JK0c4 BJJ+pZDy61BjnhD3Nc9VJzzyC0hojaQlQqhyo8JkIitsTdAtYenSB66GzQvYPpdbSHz3 8Yxg== X-Gm-Message-State: APjAAAXbpXm/Rt8yl/j708CdfGmfMPQDmG7MiTcKx3c2pywGY2bQwluc An5Q+CADUqUBE91bjUQ56gHtap2I3GfkrQ== X-Google-Smtp-Source: APXvYqxLjSJ3k6MXPF2SnNhTV/DjXetvm+SlCIXIWmlFyhKw+QqdqvCdb/lFlncU2qpU1kE7G3v0og== X-Received: by 2002:a05:6402:1346:: with SMTP id y6mr37743575edw.27.1566407672286; Wed, 21 Aug 2019 10:14:32 -0700 (PDT) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com. [209.85.208.52]) by smtp.gmail.com with ESMTPSA id c14sm4259617edb.5.2019.08.21.10.14.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Aug 2019 10:14:32 -0700 (PDT) Received: by mail-ed1-f52.google.com with SMTP id f22so3819461edt.4; Wed, 21 Aug 2019 10:14:31 -0700 (PDT) X-Received: by 2002:a17:906:759:: with SMTP id z25mr31498271ejb.72.1566407671545; Wed, 21 Aug 2019 10:14:31 -0700 (PDT) MIME-Version: 1.0 From: Shivank Garg Date: Wed, 21 Aug 2019 22:43:45 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: MAC Policy on IP addresses in Jails To: freebsd-hackers@freebsd.org, freebsd-jail@freebsd.org, trustedbsd-discuss@freebsd.org, "Bjoern A. Zeeb" , soc-status@freebsd.org X-Rspamd-Queue-Id: 46DDmW1NWRz4F28 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of shivankgarg98@gmail.com designates 209.85.208.68 as permitted sender) smtp.mailfrom=shivankgarg98@gmail.com X-Spamd-Result: default: False [-5.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-2.12)[ip: (-4.84), ipnet: 209.85.128.0/17(-3.36), asn: 15169(-2.35), country: US(-0.05)]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; RCVD_IN_DNSWL_NONE(0.00)[68.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[shivank@freebsd.org,shivankgarg98@gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[shivank@freebsd.org,shivankgarg98@gmail.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2019 17:14:36 -0000 Hi Everyone, I am a fourth-year undergraduate student in Department of EE at IIT Kanpur, India. I am an open-source enthusiast and interested in Operating Systems, Computer Networks, and system security. As a part of Google Summer of Code'19, I wrote a loadable kernel MAC module with the TrustedBSD MAC framework to limit the set of IP addresses for a VNET-enabled Jail to choose from. I was mentored by Bjoern A. Zeeb (bz@FreeBSD.org). *About the project:* With the introduction of VNET(9) in FreeBSD, Jails are free to set their IP addresses. However, this privilege may need to be limited by the host as per its need for multiple security reasons. This project uses mac(9) for an access control framework to impose restrictions on FreeBSD jails according to rules defined by the root of the host using sysctl(8). It involves the development of a dynamically loadable kernel module (mac_ipacl) based on The TrustedBSD MAC Framework to implement a security policy for configuring the network stack. This project allows the root of the host to define the policy rules to limit a jail to a set of IP (v4 or v6) addresses and/or subnets for a set of interfaces. Features this new MAC policy module are: - Host can define the list(multiple lists) of IP addresses/subnets for the jail to choose from. - Host can restrict the jail from setting the certain IP addresses or prefixes(subnets). - Host can restrict this privilege to a few networks interfaces. *How to use the module:* I have also wrote a man page for the module. Please refer to the mac_ipacl(4) for using the new MAC module and examples on it. *Test Plan:* Test Scripts integrated with kyua and ATF are included with the module. *Review Link:* This module has been reviewed and revision has been accepted and is ready to land. To check the review: https://reviews.freebsd.org/D20967 *Download Patch/Raw diff from here: * https://reviews.freebsd.org/file/data/udbhpp4gvffsqbqkkekc/PHID-FILE-wun5bhf4qlx6677fdd73/D20967.diff *Wiki and other links:* Please refer to wiki page from more detailed description of the project: *Project FreeBSD Wikipage*: https://wiki.freebsd.org/SummerOfCode2019Projects/MACPolicyIPAddressJail GitHub: https://github.com/shivankgarg98/freebsd/tree/shivank_MACPolicyIPAddressJail/sys/security/mac_ipacl I'll be be very thankful if you can give this module a try and share your valuable experience about it. Please be free to share your ideas and feedback on this module. Regards, Shivank Garg From owner-freebsd-hackers@freebsd.org Wed Aug 21 19:22:35 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A3F0D11F4 for ; Wed, 21 Aug 2019 19:22:35 +0000 (UTC) (envelope-from gbergling@gmail.com) Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DHcB3HzHz4MpJ; Wed, 21 Aug 2019 19:22:33 +0000 (UTC) (envelope-from gbergling@gmail.com) Received: by mail-wm1-x329.google.com with SMTP id c5so3084094wmb.5; Wed, 21 Aug 2019 12:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0xQv++3ih8fSas0HaygY7COMreviP+I45DsTwRanwQs=; b=mCuow4S1gr7u3XlBqx/DPap2B/TNMpflL+fuO39CMNbx8O3vC5kTLytCL7C/M/aTeu CDZ2Om/alZhPWM1+pmYWqcehHCDZ2dv/T1gK1WBj8lm4zsxzcXtuhTLpxIuOtdFegVlb TwljbwpJsZGk2++8cyp8TI4eNtibYuk2/dxt5VDK2FQtLet0BQIEzI4/YLZbQrvKvh1g StB4WNmE4dleHar8DtVz/aW9656HcToFQJJJ49q5IJaAGRav/EoF0+ynunrZpHhbwKTH aBQKYSKEI0GsDtxOZScLJbdYgr1Sv07p6+fCjeySEv9N8/06dBgMIUdUtLTXnzkEsLd9 B1Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=0xQv++3ih8fSas0HaygY7COMreviP+I45DsTwRanwQs=; b=QCamcysH7GSBxo/UwDoWx8LvXtgJ3zGV0TO21r0EHjejoEQKG64piPogptKKXakpSp vSz0//1TL7KSjMVE8U0Dxi6If0xVwFHTxrLCIFzA2kDbjQ5EZVYhTlWv6EEfMmLVf8jx lC3QZO+Jnj8eGxDxjfcwDnip4cDaFqavsDBzfq6w7qx6nwi8D8dZfUvU26LWl5Ms0qWV nUUp9YU8yyJbmXuonxdhI3C+jh4YHLPig0I8xLowP+kLhkB2azyLsmJdTDKcpOIz52CO kus7vKITYqE81M+M4O77k0N6NOOkft3i6nipGPw0kywNqy5GSsWseu8x6b59Y9HPioAG Wo1Q== X-Gm-Message-State: APjAAAXbiVMdc7dXmCyabJBw3+wFJIDqNZ54gJy9tQGNpEwBU04ML0PI hF4q4Tn5OYmoPYyJ1UyWitkI0bvg X-Google-Smtp-Source: APXvYqxrldv63oLfwZDYKzjoWIWGwvGQqj1hXLsQHFmTayALz48Ts7N1tdF1kC5GFe11FeTpgaAXWg== X-Received: by 2002:a1c:a852:: with SMTP id r79mr1779742wme.36.1566415352369; Wed, 21 Aug 2019 12:22:32 -0700 (PDT) Received: from [10.0.1.104] (p4FD3AB4E.dip0.t-ipconnect.de. [79.211.171.78]) by smtp.gmail.com with ESMTPSA id c15sm65003036wrb.80.2019.08.21.12.22.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2019 12:22:31 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: uname -a default options From: Gordon Bergling In-Reply-To: <201908171616.x7HGGhpK036345@gndrsh.dnsmgr.net> Date: Wed, 21 Aug 2019 21:22:30 +0200 Cc: Ian Lepore , freebsd-hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <67A10C58-7A1A-4E8E-A567-6A2AD3E195B1@gmail.com> References: <201908171616.x7HGGhpK036345@gndrsh.dnsmgr.net> To: "Rodney W. Grimes" X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 46DHcB3HzHz4MpJ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=mCuow4S1; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gbergling@gmail.com designates 2a00:1450:4864:20::329 as permitted sender) smtp.mailfrom=gbergling@gmail.com X-Spamd-Result: default: False [-3.49 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; RECEIVED_SPAMHAUS_PBL(0.00)[78.171.211.79.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-9.35), ipnet: 2a00:1450::/32(-3.02), asn: 15169(-2.35), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[9.2.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2019 19:22:35 -0000 Hi Rod, after reading the POSIX spec [1] I agree that the default options behind = =E2=80=9E-a" can not be changed. While reading the source of usr.bin/uname/uname.c I recognized that = FreeBSD=E2=80=99s uname is getting its information from sysctl calls. = Can you point me to right direction where in sys/ the sysctl = =E2=80=9Ekern.version=E2=80=9C (KERN_VERSION internally) is set? I would like create a small patch that changes =E2=80=9E-v=E2=80=9C=20 from "FreeBSD 12.0-STABLE r351343 GENERIC=E2=80=9C=20 to =E2=80=9Er351343 GENERIC=E2=80=9C for a further discussion. Kind Regards, Gordon [1] = https://pubs.opengroup.org/onlinepubs/9699919799/utilities/uname.html > Am 17.08.2019 um 18:16 schrieb Rodney W. Grimes = : >=20 >> On Sat, 2019-08-17 at 15:08 +0200, Gordon Bergling wrote: >>> Hello List, >>>=20 >>> "uname -a" is currently mapping the -a option to ?-mnrsv?, which >>> results in something similar like >>>=20 >>> $ uname -a >>> FreeBSD lion.0xfce3.net 12.0-STABLE = FreeBSD >>> 12.0-STABLE r350835 GENERIC amd64 >>>=20 >>> What would you think about reducing the option mapping for ?-a? to = ?- >>> vmn? , which would result in a less repetitive version string like >>> the one below. >>>=20 >>> $ uname -vmn >>> lion.0xfce3.net FreeBSD 12.0-STABLE = r350835 >>> GENERIC amd64 >>>=20 >>> Adapting this would be trivial, but before I hack something = together, >>> I would like to get some feedback if such a change would be = welcomed? >>>=20 >>> Best regards, >>>=20 >>> Gordon >>>=20 >>=20 >> I think there are likely very many existing scripts in the world that >> parse the output of uname -a and would break if the fields moved = around >> or disappeared. >=20 > I agree that we should not change the output of uname -a, for one > it is a POSIX spec'ed command, though I would not expect scripts > to be parsing the output of -a, they should actually invoke the > more specific item(s) they need and parse those, a much less error > prone methods. >=20 > I would however like to note that Linux (or atleast Ubuntu 19.04) > has a man page that -a says "All of the below" and are infact = returning > more info than the Posix man page which says -a is -mnrsv >=20 > rgrimes@mgmt:~$ uname -a > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 = x86_64 x86_64 GNU/Linux > rgrimes@mgmt:~$ man uname > rgrimes@mgmt:~$ uname -mnrsv > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 > rgrimes@mgmt:~$ uname -m > x86_64 > rgrimes@mgmt:~$ uname -n > mgmt > rgrimes@mgmt:~$ uname -r > 5.1.0-rc2+ > rgrimes@mgmt:~$ uname -s > Linux > rgrimes@mgmt:~$ uname -v > #14 SMP Sun Aug 4 09:23:12 UTC 2019 >=20 > FreeBSD: > root {1003}# uname -a > FreeBSD w530a.dnsmgr.net 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 = GENERIC amd64 > root {1004}# uname -m > amd64 > root {1005}# uname -n > w530a.dnsmgr.net > root {1006}# uname -r > 12.0-RELEASE > root {1007}# uname -s > FreeBSD > root {1008}# uname -v > FreeBSD 12.0-RELEASE r341666 GENERIC=20 >=20 > So it is really our -v string that is full of redundant > data that MAY want to be evaluated for trimming. >=20 > --=20 > Rod Grimes = rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Wed Aug 21 19:32:35 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1DBDD1BEB for ; Wed, 21 Aug 2019 19:32:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DHql0qCPz4QG1 for ; Wed, 21 Aug 2019 19:32:34 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb1-xb30.google.com with SMTP id x10so1478400ybs.13 for ; Wed, 21 Aug 2019 12:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YT/6mb6tJWBmxoOl4DW/FkfKl7ON6xh4FMzePrnR4Ak=; b=UEhseOH+AIF5X/B3Zz5aGBQPK1gRBlPpjfVlje2vwuzDzqEBq8aMOyEO/BAKiQ11JU rMZcTUfZxuosZfW2S7D/9CU3jHD5V1cfx9Sckdfpgw5mGs6PyeJ44jP9CkgSMWbA84mi nQnKvxXMquKNW56nzm6lKG4ov8S1PjLu+0zVqH8RHzWNucFQMsCz+mCOR7hk+vzMs3yZ YVxJIg3reQeDXPw1R2KDLwPWINCosondKKyVcj71Nac+/CKGJTnDXhaPAiXtpaylw5QD UkiO5IufyZWk5l4063tt4RDx5ujmHmnZsuCHk7gyX/i8Qb3QvoJbrNsT3koHNcqLpCC8 qLWQ== 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=YT/6mb6tJWBmxoOl4DW/FkfKl7ON6xh4FMzePrnR4Ak=; b=X6TElxvQYe/+X7Oc2lNJAV5UR6oxkibPH2w1mze749vN69Ubkz1itOM0ER2JjnWLYj MLR0v9xotTUPggEUCAXiTgvfK6YyrVffYDCCtYgVB/HMn8pJhNx+AaK+WATWmZ0JLLmk Ugsn6i+vMwurHVwPYCt3LfW2NSJj+7/+l0vVFUz9JQe+5lgWW6w+IutJz4ntSjc+jFtd Cl2y76PIKKDr6DXlSb5GXJYMKe1RyvHU1MsPjGfP4LICIt8EZUQhQoqhTs4Xmb22pQ5l hARPt5EJpy53rRjngpEY8VDDI4fv2llaNUw3QRd2BSyi+xirNzIi1ZOGyu/OOm3DObW/ yQAQ== X-Gm-Message-State: APjAAAVkmhcn7uL8Tdl7WgYUaGik/2amrCpSX5FBo/U8GETRXe+k3T42 QDedGzEWhSmQju2uvKfPtDiV0KBXGN6rX/OgDwTIDg== X-Google-Smtp-Source: APXvYqw/NfWzGYkb4CscEcef5adptzPcSY6IbHdEFTrrCfDxtsp2eryTZWsZ3+ObnHHf0HWBFICpqzN3p8Z0xF9a8d0= X-Received: by 2002:a25:c486:: with SMTP id u128mr24970828ybf.428.1566415953803; Wed, 21 Aug 2019 12:32:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:1003:0:0:0:0:0 with HTTP; Wed, 21 Aug 2019 12:32:33 -0700 (PDT) In-Reply-To: <67A10C58-7A1A-4E8E-A567-6A2AD3E195B1@gmail.com> References: <201908171616.x7HGGhpK036345@gndrsh.dnsmgr.net> <67A10C58-7A1A-4E8E-A567-6A2AD3E195B1@gmail.com> From: Oliver Pinter Date: Wed, 21 Aug 2019 21:32:33 +0200 Message-ID: Subject: Re: uname -a default options To: Gordon Bergling Cc: "Rodney W. Grimes" , "freebsd-hackers@freebsd.org" , Ian Lepore X-Rspamd-Queue-Id: 46DHql0qCPz4QG1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=UEhseOH+; dmarc=none; spf=pass (mx1.freebsd.org: domain of oliver.pinter@hardenedbsd.org designates 2607:f8b0:4864:20::b30 as permitted sender) smtp.mailfrom=oliver.pinter@hardenedbsd.org X-Spamd-Result: default: False [-6.44 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-1.00)[-0.997,0]; RCVD_IN_DNSWL_NONE(0.00)[0.3.b.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.94)[ip: (-9.41), ipnet: 2607:f8b0::/32(-2.90), asn: 15169(-2.35), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2019 19:32:35 -0000 On Wednesday, August 21, 2019, Gordon Bergling wrote: > Hi Rod, > > after reading the POSIX spec [1] I agree that the default options behind > =E2=80=9E-a" can not be changed. > > While reading the source of usr.bin/uname/uname.c I recognized that > FreeBSD=E2=80=99s uname is getting its information from sysctl calls. Can= you point > me to right direction where in sys/ the sysctl =E2=80=9Ekern.version=E2= =80=9C (KERN_VERSION > internally) is set? > > I would like create a small patch that changes =E2=80=9E-v=E2=80=9C > from "FreeBSD 12.0-STABLE r351343 GENERIC=E2=80=9C > to =E2=80=9Er351343 GENERIC=E2=80=9C for a further discussion. Please no. Keep them at the current behavior. > > Kind Regards, > > Gordon > > [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/uname.html > > > Am 17.08.2019 um 18:16 schrieb Rodney W. Grimes < > freebsd-rwg@gndrsh.dnsmgr.net>: > > > >> On Sat, 2019-08-17 at 15:08 +0200, Gordon Bergling wrote: > >>> Hello List, > >>> > >>> "uname -a" is currently mapping the -a option to ?-mnrsv?, which > >>> results in something similar like > >>> > >>> $ uname -a > >>> FreeBSD lion.0xfce3.net 12.0-STABLE FreeBSD > >>> 12.0-STABLE r350835 GENERIC amd64 > >>> > >>> What would you think about reducing the option mapping for ?-a? to ?- > >>> vmn? , which would result in a less repetitive version string like > >>> the one below. > >>> > >>> $ uname -vmn > >>> lion.0xfce3.net FreeBSD 12.0-STABLE r350835 > >>> GENERIC amd64 > >>> > >>> Adapting this would be trivial, but before I hack something together, > >>> I would like to get some feedback if such a change would be welcomed? > >>> > >>> Best regards, > >>> > >>> Gordon > >>> > >> > >> I think there are likely very many existing scripts in the world that > >> parse the output of uname -a and would break if the fields moved aroun= d > >> or disappeared. > > > > I agree that we should not change the output of uname -a, for one > > it is a POSIX spec'ed command, though I would not expect scripts > > to be parsing the output of -a, they should actually invoke the > > more specific item(s) they need and parse those, a much less error > > prone methods. > > > > I would however like to note that Linux (or atleast Ubuntu 19.04) > > has a man page that -a says "All of the below" and are infact returning > > more info than the Posix man page which says -a is -mnrsv > > > > rgrimes@mgmt:~$ uname -a > > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 x86_64 > x86_64 GNU/Linux > > rgrimes@mgmt:~$ man uname > > rgrimes@mgmt:~$ uname -mnrsv > > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 > > rgrimes@mgmt:~$ uname -m > > x86_64 > > rgrimes@mgmt:~$ uname -n > > mgmt > > rgrimes@mgmt:~$ uname -r > > 5.1.0-rc2+ > > rgrimes@mgmt:~$ uname -s > > Linux > > rgrimes@mgmt:~$ uname -v > > #14 SMP Sun Aug 4 09:23:12 UTC 2019 > > > > FreeBSD: > > root {1003}# uname -a > > FreeBSD w530a.dnsmgr.net 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 > GENERIC amd64 > > root {1004}# uname -m > > amd64 > > root {1005}# uname -n > > w530a.dnsmgr.net > > root {1006}# uname -r > > 12.0-RELEASE > > root {1007}# uname -s > > FreeBSD > > root {1008}# uname -v > > FreeBSD 12.0-RELEASE r341666 GENERIC > > > > So it is really our -v string that is full of redundant > > data that MAY want to be evaluated for trimming. > > > > -- > > Rod Grimes > rgrimes@freebsd.org > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " > From owner-freebsd-hackers@freebsd.org Wed Aug 21 20:06:49 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2014D2AC1 for ; Wed, 21 Aug 2019 20:06:49 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.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 46DJbD5YrPz4Sxc; Wed, 21 Aug 2019 20:06:48 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x7LK6kSu055365; Wed, 21 Aug 2019 13:06:46 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x7LK6kIK055364; Wed, 21 Aug 2019 13:06:46 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201908212006.x7LK6kIK055364@gndrsh.dnsmgr.net> Subject: Re: uname -a default options In-Reply-To: <67A10C58-7A1A-4E8E-A567-6A2AD3E195B1@gmail.com> To: Gordon Bergling Date: Wed, 21 Aug 2019 13:06:46 -0700 (PDT) CC: "Rodney W. Grimes" , freebsd-hackers@freebsd.org, Ian Lepore X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46DJbD5YrPz4Sxc X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.84 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.23)[0.233,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.59)[0.594,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.07)[0.067,0]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.04)[ip: (0.15), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.05), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2019 20:06:49 -0000 > Hi Rod, > > after reading the POSIX spec [1] I agree that the default options behind ?-a" can not be changed. > > While reading the source of usr.bin/uname/uname.c I recognized that FreeBSD?s uname is getting its information from sysctl calls. Can you point me to right direction where in sys/ the sysctl ?kern.version? (KERN_VERSION internally) is set? > > I would like create a small patch that changes ?-v? > from "FreeBSD 12.0-STABLE r351343 GENERIC? > to ?r351343 GENERIC? for a further discussion. > > Kind Regards, > > Gordon /usr/src/sys/conf/newvers.sh Is the source of that data... > [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/uname.html > > > Am 17.08.2019 um 18:16 schrieb Rodney W. Grimes : > > > >> On Sat, 2019-08-17 at 15:08 +0200, Gordon Bergling wrote: > >>> Hello List, > >>> > >>> "uname -a" is currently mapping the -a option to ?-mnrsv?, which > >>> results in something similar like > >>> > >>> $ uname -a > >>> FreeBSD lion.0xfce3.net 12.0-STABLE FreeBSD > >>> 12.0-STABLE r350835 GENERIC amd64 > >>> > >>> What would you think about reducing the option mapping for ?-a? to ?- > >>> vmn? , which would result in a less repetitive version string like > >>> the one below. > >>> > >>> $ uname -vmn > >>> lion.0xfce3.net FreeBSD 12.0-STABLE r350835 > >>> GENERIC amd64 > >>> > >>> Adapting this would be trivial, but before I hack something together, > >>> I would like to get some feedback if such a change would be welcomed? > >>> > >>> Best regards, > >>> > >>> Gordon > >>> > >> > >> I think there are likely very many existing scripts in the world that > >> parse the output of uname -a and would break if the fields moved around > >> or disappeared. > > > > I agree that we should not change the output of uname -a, for one > > it is a POSIX spec'ed command, though I would not expect scripts > > to be parsing the output of -a, they should actually invoke the > > more specific item(s) they need and parse those, a much less error > > prone methods. > > > > I would however like to note that Linux (or atleast Ubuntu 19.04) > > has a man page that -a says "All of the below" and are infact returning > > more info than the Posix man page which says -a is -mnrsv > > > > rgrimes@mgmt:~$ uname -a > > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux > > rgrimes@mgmt:~$ man uname > > rgrimes@mgmt:~$ uname -mnrsv > > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 > > rgrimes@mgmt:~$ uname -m > > x86_64 > > rgrimes@mgmt:~$ uname -n > > mgmt > > rgrimes@mgmt:~$ uname -r > > 5.1.0-rc2+ > > rgrimes@mgmt:~$ uname -s > > Linux > > rgrimes@mgmt:~$ uname -v > > #14 SMP Sun Aug 4 09:23:12 UTC 2019 > > > > FreeBSD: > > root {1003}# uname -a > > FreeBSD w530a.dnsmgr.net 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC amd64 > > root {1004}# uname -m > > amd64 > > root {1005}# uname -n > > w530a.dnsmgr.net > > root {1006}# uname -r > > 12.0-RELEASE > > root {1007}# uname -s > > FreeBSD > > root {1008}# uname -v > > FreeBSD 12.0-RELEASE r341666 GENERIC > > > > So it is really our -v string that is full of redundant > > data that MAY want to be evaluated for trimming. > > > > -- > > Rod Grimes rgrimes@freebsd.org > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Wed Aug 21 20:10:35 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87554D2C66 for ; Wed, 21 Aug 2019 20:10:35 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.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 46DJgZ5Cfbz4TCQ; Wed, 21 Aug 2019 20:10:34 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x7LKAWjd055382; Wed, 21 Aug 2019 13:10:32 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x7LKAWsw055381; Wed, 21 Aug 2019 13:10:32 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201908212010.x7LKAWsw055381@gndrsh.dnsmgr.net> Subject: Re: uname -a default options In-Reply-To: To: Oliver Pinter Date: Wed, 21 Aug 2019 13:10:32 -0700 (PDT) CC: Gordon Bergling , "Rodney W. Grimes" , "freebsd-hackers@freebsd.org" , Ian Lepore X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 46DJgZ5Cfbz4TCQ X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.78 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.24)[0.236,0]; IP_SCORE(0.04)[ip: (0.15), ipnet: 69.59.192.0/19(0.07), asn: 13868(0.05), country: US(-0.05)]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_MEDIUM(0.57)[0.573,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.03)[0.027,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; FREEMAIL_CC(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2019 20:10:35 -0000 > On Wednesday, August 21, 2019, Gordon Bergling wrote: > > > Hi Rod, > > > > after reading the POSIX spec [1] I agree that the default options behind > > ?-a" can not be changed. > > > > While reading the source of usr.bin/uname/uname.c I recognized that > > FreeBSD?s uname is getting its information from sysctl calls. Can you point > > me to right direction where in sys/ the sysctl ?kern.version? (KERN_VERSION > > internally) is set? > > > > I would like create a small patch that changes ?-v? > > from "FreeBSD 12.0-STABLE r351343 GENERIC? > > to ?r351343 GENERIC? for a further discussion. > > > Please no. Keep them at the current behavior. Do you have some rational that the value -v should contain data that is already in -s and -r? I do know that -v gets "different" stuff if REPRODUCIBLE build is turned off, but I do not see the reason to include the values that are already avaliable in -s and -r. > > > > Kind Regards, > > > > Gordon > > > > [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/uname.html > > > > > Am 17.08.2019 um 18:16 schrieb Rodney W. Grimes < > > freebsd-rwg@gndrsh.dnsmgr.net>: > > > > > >> On Sat, 2019-08-17 at 15:08 +0200, Gordon Bergling wrote: > > >>> Hello List, > > >>> > > >>> "uname -a" is currently mapping the -a option to ?-mnrsv?, which > > >>> results in something similar like > > >>> > > >>> $ uname -a > > >>> FreeBSD lion.0xfce3.net 12.0-STABLE FreeBSD > > >>> 12.0-STABLE r350835 GENERIC amd64 > > >>> > > >>> What would you think about reducing the option mapping for ?-a? to ?- > > >>> vmn? , which would result in a less repetitive version string like > > >>> the one below. > > >>> > > >>> $ uname -vmn > > >>> lion.0xfce3.net FreeBSD 12.0-STABLE r350835 > > >>> GENERIC amd64 > > >>> > > >>> Adapting this would be trivial, but before I hack something together, > > >>> I would like to get some feedback if such a change would be welcomed? > > >>> > > >>> Best regards, > > >>> > > >>> Gordon > > >>> > > >> > > >> I think there are likely very many existing scripts in the world that > > >> parse the output of uname -a and would break if the fields moved around > > >> or disappeared. > > > > > > I agree that we should not change the output of uname -a, for one > > > it is a POSIX spec'ed command, though I would not expect scripts > > > to be parsing the output of -a, they should actually invoke the > > > more specific item(s) they need and parse those, a much less error > > > prone methods. > > > > > > I would however like to note that Linux (or atleast Ubuntu 19.04) > > > has a man page that -a says "All of the below" and are infact returning > > > more info than the Posix man page which says -a is -mnrsv > > > > > > rgrimes@mgmt:~$ uname -a > > > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 x86_64 > > x86_64 GNU/Linux > > > rgrimes@mgmt:~$ man uname > > > rgrimes@mgmt:~$ uname -mnrsv > > > Linux mgmt 5.1.0-rc2+ #14 SMP Sun Aug 4 09:23:12 UTC 2019 x86_64 > > > rgrimes@mgmt:~$ uname -m > > > x86_64 > > > rgrimes@mgmt:~$ uname -n > > > mgmt > > > rgrimes@mgmt:~$ uname -r > > > 5.1.0-rc2+ > > > rgrimes@mgmt:~$ uname -s > > > Linux > > > rgrimes@mgmt:~$ uname -v > > > #14 SMP Sun Aug 4 09:23:12 UTC 2019 > > > > > > FreeBSD: > > > root {1003}# uname -a > > > FreeBSD w530a.dnsmgr.net 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 > > GENERIC amd64 > > > root {1004}# uname -m > > > amd64 > > > root {1005}# uname -n > > > w530a.dnsmgr.net > > > root {1006}# uname -r > > > 12.0-RELEASE > > > root {1007}# uname -s > > > FreeBSD > > > root {1008}# uname -v > > > FreeBSD 12.0-RELEASE r341666 GENERIC > > > > > > So it is really our -v string that is full of redundant > > > data that MAY want to be evaluated for trimming. > > > > > > -- > > > Rod Grimes > > rgrimes@freebsd.org > > > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-hackers@freebsd.org Thu Aug 22 16:24:29 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5ECD0CC1C9 for ; Thu, 22 Aug 2019 16:24:29 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from mail.farhan.codes (mail.farhan.codes [155.138.165.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46DqcD3whFz4c86 for ; Thu, 22 Aug 2019 16:24:28 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from mail.farhan.codes (rainloop [172.16.0.4]) by mail.farhan.codes (Postfix) with ESMTPSA id 9399516427 for ; Thu, 22 Aug 2019 12:24:19 -0400 (EDT) MIME-Version: 1.0 Date: Thu, 22 Aug 2019 16:24:19 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: RainLoop/1.12.1 From: "Farhan Khan" Message-ID: <519c2fce85fe0db1cd189d2060f09a0f@farhan.codes> Subject: Trouble using and understanding funopen(3) To: freebsd-hackers@freebsd.org X-Rspamd-Queue-Id: 46DqcD3whFz4c86 X-Spamd-Bar: ------- X-Spamd-Result: default: False [-7.05 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[farhan.codes:s=mail]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; DKIM_TRACE(0.00)[farhan.codes:+]; DMARC_POLICY_ALLOW(-0.50)[farhan.codes,reject]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-3.06)[ip: (-9.86), ipnet: 155.138.160.0/20(-4.93), asn: 20473(-0.44), country: US(-0.05)]; ASN(0.00)[asn:20473, ipnet:155.138.160.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2019 16:24:29 -0000 Hi all,=0A=0AI am having trouble understanding how funopen(3)'s read func= tion works. Specifically, how do I have the readfn return with less than = the requested amount of bytes.=0A=0AMy understanding: I believe that funo= pen(3) allows you to assign the read, write and close methods to a FILE s= tream. When a program runs fread(3) on a FILE stream opened by funopen(3)= , the program will run the readfn handler in a loop until it returns eith= er returns the requested number of bytes, 0 or -1 (error).=0A=0AQuestion:= How do I structure the code so that readfn returns with less than the nu= mbe of requested bytes? For example, what if the calling fread() function= requests 100 bytes, but the readfn can only return 10 bytes? What mechan= ism do I need to implement so that the fread(3) returns "10" bytes rather= than the readfn handler running 10 times? This results in the fread()'s = return value as 100, even though only 10 bytes were *actually* read.=0A= =0AI have looked at a few examples from the src tree. Clearly they have t= o use buffering and append the bytes they read to the memory object they = were initially passed. Somehow they return with the number of bytes they = actually read, not necessarily the requested amount. But it is not clear = to me how they make this distinction and avoid having their respective re= adfn function re-rerun. Also, in the examples I did look up there does no= t appear to be any use of setvbuf().=0A=0ABelow is a very simple test cas= e to illustrate the issue.=0A=0A------=0A#include =0A#include =0A#include =0A=0Astatic int=0Assh_readfn(void *v, char= *buf, int len)=0A{=0A printf("Running readfn handler\n");=0A memcpy(buf,= "AAAAAAAAAA", 10);=0A return 10;=0A}=0A=0Astatic int=0Assh_writefn(void = *v, const char *buf, int len)=0A{=0A return 0;=0A}=0A=0Aint=0Amain()=0A{= =0A int x;=0A char buf[1000];=0A FILE *f;=0A=0A f =3D funopen(NULL, ssh_r= eadfn, ssh_writefn, NULL, NULL);=0A if (f =3D=3D NULL) {=0A printf("funo= pen failed, exiting.\n");=0A exit(0);=0A }=0A=0A x =3D fread(buf, 1, 100= , f);=0A printf("Bytes read: %d\n", x);=0A}=0A------=0A=0AThis displays 1= 0 "Running readfn handler" lines fllowed by "Bytes read: 100" even though= I am explicitly returning 10 in ssh_readfn. Please advise what the mecha= nism is only return with less than the requested number of bytes.=0A=0ATh= anks!=0A---=0AFarhan Khan=0APGP Fingerprint: 1312 89CE 663E 1EB2 179C 1C8= 3 C41D 2281 F8DA C0DE From owner-freebsd-hackers@freebsd.org Thu Aug 22 20:28:43 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CDCFCD1D2A for ; Thu, 22 Aug 2019 20:28:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Dx2267GFz3P4Y for ; Thu, 22 Aug 2019 20:28:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f51.google.com with SMTP id j4so6443034iog.11 for ; Thu, 22 Aug 2019 13:28:42 -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:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=cQsAP+df6Z6GEGHjY2g8jfROCTZrHrYVXRm6DzSOxdI=; b=dqvPJOhZonDo9tTyop5ZJ/CN3+gAN4f27b7AcX2qoneAQYCmLOdDCYhlk/0TaXhRpK JqC0DkOqy5N5OLIi1esD1TbS/SYkwdryn+tVe+XEmCK/OspnLXVYpiNp4bCzSgaFay23 hkESWATpAqQMtX+nJrKYQk3dURxiFQDkST5izTi/Vy8mEEqfpNa3sDl1DkkEDnYWLClW ExnasGYQBKivZCLJ+kaweXDd+5PzCwsgdcrQ6imWokm9/rR7b7w0XWIaha+mtp5gdS0i KJFqvg3ADGGQ8UB358a+tbGkKFkInMpwZ6vZdC6Yb6WoV5kCP1BUXerhmdvAQZsRPwcQ hiUg== X-Gm-Message-State: APjAAAVRD52XEiybULqexQ2o/QkNPZ/uQsp/lFnW3ZtGN6ZOWFaesmhO h0p/r/jqsSaxXtnun9kG/a6Sl/tt X-Google-Smtp-Source: APXvYqzVshsGzt2gs0EBhDYKL5e4mEfJcv1gODFdUuKjEtEVSN+EvODH4CqQ25Q1AjvQlvdumCGUDg== X-Received: by 2002:a02:650b:: with SMTP id u11mr1451891jab.81.1566505721528; Thu, 22 Aug 2019 13:28:41 -0700 (PDT) Received: from mail-io1-f49.google.com (mail-io1-f49.google.com. [209.85.166.49]) by smtp.gmail.com with ESMTPSA id y5sm460313ioc.86.2019.08.22.13.28.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Aug 2019 13:28:40 -0700 (PDT) Received: by mail-io1-f49.google.com with SMTP id x4so14679412iog.13 for ; Thu, 22 Aug 2019 13:28:40 -0700 (PDT) X-Received: by 2002:a5e:c101:: with SMTP id v1mr958126iol.231.1566505720779; Thu, 22 Aug 2019 13:28:40 -0700 (PDT) MIME-Version: 1.0 References: <519c2fce85fe0db1cd189d2060f09a0f@farhan.codes> In-Reply-To: <519c2fce85fe0db1cd189d2060f09a0f@farhan.codes> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 22 Aug 2019 13:28:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Trouble using and understanding funopen(3) To: Farhan Khan Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 46Dx2267GFz3P4Y X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.51 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-5.54 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; RCPT_COUNT_TWO(0.00)[2]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[51.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.55)[ip: (-6.99), ipnet: 209.85.128.0/17(-3.35), asn: 15169(-2.35), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2019 20:28:43 -0000 Hi Farhan, First, I'd suggest using the more portable fopencookie(3) interface, which is similar to funopen(3). Second, read functions return 0 to indicate end of file. Finally, the file cookie routines are stateful. If you want to create a pseudo-FILE that only has 10 bytes in it, you have to track the current file offset by creating a cookie. Here is a minimal example of using a cookie. struct my_file { off_t offset; }; my_read(void *v, buf, len) { struct my_file *f =3D v; size_t rlen; /* Indicate EOF for reads past EOF. */ if (f->offset >=3D 10) return (0); rlen =3D MIN(len, 10 - f->offset); memcpy(buf, "AAAAAAAAAA", rlen); f->offset +=3D rlen; return ((int)rlen); } main() { struct my_file *cookie; FILE *f; char buf[100]; size_t x; cookie =3D calloc(1, sizeof(*cookie)); f =3D fopencookie(cookie, "rb", { .read =3D my_read, }); x =3D fread(buf, 1, sizeof(buf), f); ... } Conrad On Thu, Aug 22, 2019 at 9:24 AM Farhan Khan via freebsd-hackers wrote: > > Hi all, > > I am having trouble understanding how funopen(3)'s read function works. S= pecifically, how do I have the readfn return with less than the requested a= mount of bytes. > > My understanding: I believe that funopen(3) allows you to assign the read= , write and close methods to a FILE stream. When a program runs fread(3) on= a FILE stream opened by funopen(3), the program will run the readfn handle= r in a loop until it returns either returns the requested number of bytes, = 0 or -1 (error). > > Question: How do I structure the code so that readfn returns with less th= an the numbe of requested bytes? For example, what if the calling fread() f= unction requests 100 bytes, but the readfn can only return 10 bytes? What m= echanism do I need to implement so that the fread(3) returns "10" bytes rat= her than the readfn handler running 10 times? This results in the fread()'s= return value as 100, even though only 10 bytes were *actually* read. > > I have looked at a few examples from the src tree. Clearly they have to u= se buffering and append the bytes they read to the memory object they were = initially passed. Somehow they return with the number of bytes they actuall= y read, not necessarily the requested amount. But it is not clear to me how= they make this distinction and avoid having their respective readfn functi= on re-rerun. Also, in the examples I did look up there does not appear to b= e any use of setvbuf(). > > Below is a very simple test case to illustrate the issue. > > ------ > #include > #include > #include > > static int > ssh_readfn(void *v, char *buf, int len) > { > printf("Running readfn handler\n"); > memcpy(buf, "AAAAAAAAAA", 10); > return 10; > } > > static int > ssh_writefn(void *v, const char *buf, int len) > { > return 0; > } > > int > main() > { > int x; > char buf[1000]; > FILE *f; > > f =3D funopen(NULL, ssh_readfn, ssh_writefn, NULL, NULL); > if (f =3D=3D NULL) { > printf("funopen failed, exiting.\n"); > exit(0); > } > > x =3D fread(buf, 1, 100, f); > printf("Bytes read: %d\n", x); > } > ------ > > This displays 10 "Running readfn handler" lines fllowed by "Bytes read: 1= 00" even though I am explicitly returning 10 in ssh_readfn. Please advise w= hat the mechanism is only return with less than the requested number of byt= es. > > Thanks! > --- > Farhan Khan > PGP Fingerprint: 1312 89CE 663E 1EB2 179C 1C83 C41D 2281 F8DA C0DE > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " From owner-freebsd-hackers@freebsd.org Fri Aug 23 19:05:20 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33244CC177 for ; Fri, 23 Aug 2019 19:05:20 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com [IPv6:2607:f8b0:4864:20::e2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46FW7L2bD9z45Vf for ; Fri, 23 Aug 2019 19:05:18 +0000 (UTC) (envelope-from ray@ddteam.net) Received: by mail-vs1-xe2d.google.com with SMTP id m62so6872709vsc.8 for ; Fri, 23 Aug 2019 12:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddteam-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LsUymhlCrc+ylpcNhJUP+umZpkHtmG1zq53y9yjz/NA=; b=FcduBqfQUxPq/loEPBmgD/4mbBI/KG82HoL4b9viZtydi74P0Bp1jU7RpHJfE1dW3M pJT1i+v9dbF6k7QViU3nVErqqhG7NS9Slyz8RUzSdyvw8ihZx0nG+Z6VqIk4SD2vVafU d1yV5Tx8qk82FZlXSZyIiCRgx+smbo/WFIhZV9d+AiJV5igFX2bpEegnqeLHJLQFXovD mPnowNF46b+olOShYeVTbQ85Y3c8v6hmKBZ5Lq30KT1kdDoO8rQ7jvo0KgVjlxe4By+S kkiDQvIwBIZKnjO4fAG9R7///usYtdQm1UiP5wZGhz0ojfD96OuU4VahXQH/QfTPRxDG IbkQ== 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:cc; bh=LsUymhlCrc+ylpcNhJUP+umZpkHtmG1zq53y9yjz/NA=; b=B57oNrZRyprtjMJ4n/n8VFvOsr9UEiLXkmQD/K+VaoNcNpXBtiJznhw0R2X2kKdaA0 tD19WLPBkHzCy8vlzdxVoGehR50CxO8FE3Hq1Jzh6nEuCUvI7xWZMX0YYeZit1MsiRTe Pa4NAGkUOR08et/JOjV1F4wch0mdcMVZ2EESeOJ6zjNodL9N0a5HHLd55WP2ZTfBGV2q LHIQB/mT1eSoT4+7AA9iIf4YmEuWM6EKe8yO6vgBcQugu0ONl/rZd3TPiGglVp9P2hiR 3ELp8K5jErmyaPAdm+dS2Ih3aaBF9EE6qSw8Svx/2N2i+Oeg79B06zCCJiUd2vkCLjUs fu/A== X-Gm-Message-State: APjAAAUqAq2Zba5gmU3GUeGdaJD/MhYgFqfIkfDwh+cOA71z/0sP+j45 afl/kjacGdYfVno7hN30Efgs96aZdEZtpNQ3a+SGkw== X-Google-Smtp-Source: APXvYqwthCOFl4I4G6CZ/NRhYgSt6SWQKrM01BsYH0u1App0ChYmBn5yrrBbj/+swTSf9HorijnSIrj7bKV/Zmvlwvo= X-Received: by 2002:a05:6102:db:: with SMTP id u27mr3872103vsp.144.1566587116930; Fri, 23 Aug 2019 12:05:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aleksandr Rybalko Date: Fri, 23 Aug 2019 22:05:04 +0300 Message-ID: Subject: Re: Question regarding framebuffer driver. To: Vijay Kumar Banerjee Cc: freebsd-hackers@freebsd.org X-Rspamd-Queue-Id: 46FW7L2bD9z45Vf X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ddteam-net.20150623.gappssmtp.com header.s=20150623 header.b=FcduBqfQ; dmarc=none; spf=softfail (mx1.freebsd.org: 2607:f8b0:4864:20::e2d is neither permitted nor denied by domain of ray@ddteam.net) smtp.mailfrom=ray@ddteam.net X-Spamd-Result: default: False [-5.29 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[ddteam-net.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[ddteam.net]; R_SPF_SOFTFAIL(0.00)[~all]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ddteam-net.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[d.2.e.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.99)[ip: (-9.70), ipnet: 2607:f8b0::/32(-2.87), asn: 15169(-2.34), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Aug 2019 19:05:20 -0000 Hi Vijay! vt_fb driver is a simple consumer, it just use passed info about location of FrameBuffer in memory and its properties, like width/height/colors/etc. So if display keeps blank, you have to check correctness of passed data. Or maybe even writing driver that prepare graphic subsystem to work with FB. Thanks. =D0=B2=D1=82, 16 =D0=BB=D0=B8=D0=BF. 2019 =D0=BE 15:22 Vijay Kumar Banerjee= =D0=BF=D0=B8=D1=88=D0=B5: > Hello everyone, > > I'm working on porting the framebuffer driver to RTEMS with Beaglebone > Black as the target device. I have have already ported the am335x_lcd, > tda19988, fbd and VT drivers, but the screen doesn't seem to "power up". > From the FreeBSD bootlog (12-RELEASE), I see that the screen is > turning on after the VT initialization message, so I guess it's something > that happens after the vt initialization that turns the screen on. > > So far I have ported the vt_fb and vt_core and it boots up well with the > message : > VT: initialize with new VT driver "fb". > > But the screen doesn't seem to turn on. Can someone please tell me > or point me to the right place in code that is responsible for turning th= e > screen on after VT initialization? > > Thank you, > Vijay > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " > --=20 WBW ------- Rybalko Aleksandr