Re: Grammar and style edits to installation guide

2019-07-27 Thread Evan Silberman
"Theo de Raadt"  wrote:
> Evan Silberman  wrote:
> 
> > -   You may now be given the opportunity to configure the time zone
> > -   your system will be using (this depends on the installation
> > -   media you are using).
> > -
> > -   If the installation program skips this question, do not be
> > -   alarmed, the time zone will be configured at the end
> > -   of the installation.
> > +   Depending on the installation media you are using, you may now
> > +   be given the opportunity to configure the time zone your system
> > +   will use.  If the installation program skips this question, do
> > +   not be alarmed: the time zone will be configured at the end of
> > +   the installation.
> 
> This does not depend on the installation media.  If anything, it depends
> on the network environment (time comes from the attempt to fetch ftplist
> from remote, which is always performed in the background).  But I think
> it is no longer true that it asks early, I think the manual time
> adjustment is only at the end.

This paragraph is referring to time _zone_ selection, and the dependency
on installation media (as best I can tell from my first-ever read of
install.sub and the ramdisk list files, mind you) appears to be that a
time zone list is not included in the floppy images due to space
constraints.

The installation guides don't appear mention that the user might be
asked to weigh in on adjusting the system time.

Evan Silberman



Re: unveil and immuatble directory

2019-07-27 Thread Theo de Raadt
OK as is.  ok deraadt

Alexander Bluhm  wrote:

> Hi,
> 
> When setting immutable flags on directories with chflags(1), unveil(2)
> behaves poorly.
> 
> # rm /etc/hosts
> # chflags uchg /etc
> # ifconfig vio0
> ifconfig: unveil: Operation not permitted
> 
> Adding another exception for EPERM fixes this.
> 
> ok?
> 
> bluhm
> 
> Index: kern/vfs_lookup.c
> ===
> RCS file: /data/mirror/openbsd/cvs/src/sys/kern/vfs_lookup.c,v
> retrieving revision 1.80
> diff -u -p -r1.80 vfs_lookup.c
> --- kern/vfs_lookup.c 18 Jul 2019 18:06:17 -  1.80
> +++ kern/vfs_lookup.c 26 Jul 2019 12:24:55 -
> @@ -581,7 +581,7 @@ dirloop:
>* create ourselves.
>*/
>   if (ndp->ni_pledge == PLEDGE_UNVEIL &&
> - (error == EACCES || error == EROFS))
> + (error == EPERM || error == EACCES || error == EROFS))
>   error = EJUSTRETURN;
> 
>   if (error != EJUSTRETURN)
> 
> 



Re: ix(4): enable checksum offload

2019-07-27 Thread Jan Klemkow
On 9.9.2013. 22:07, Mike Belopuhov wrote:
> On 9 September 2013 21:48, Brad Smith  wrote:
> > Here is a diff to enable the checksum offload support for ix(4).
> >
> > Looking for any testing.
> >
> 
> last time i checked this broke ospf traffic.  please make sure at least
> ip/tcp, ip/udp, ip/icmp, ip/ip, ip/gre, ip/esp, ip/ah and ip/ospf work fine
> with this.

With checksum offloading enabled on the ix(4) I got ~20% performance
improvement with relayd(8) using socket splicing.  I think its worth to
enable this feature by default.

I also did my homework and tested all requested protocols:

IPv4IPv64over6  6over4
ip/tcp  check   check
ip/udp  check   check
ip/icmp check   check
ip/ip   check   check   check   check
ip/gre  check   check   check   check
ip/esp  check   check
ip/ospf check   check
nfs v2  check   -
nfs v3  check   -

I used the following card for testing:
ix0 at pci3 dev 0 function 0 "Intel 82599" rev 0x01: msi, address 
xx:xx:xx:xx:xx:xx

Looking for further testing or any OK?

Bye,
Jan

Index: sys/dev/pci/if_ix.c
===
RCS file: /cvs/src/sys/dev/pci/if_ix.c,v
retrieving revision 1.157
diff -u -p -r1.157 if_ix.c
--- sys/dev/pci/if_ix.c 10 Apr 2019 09:55:02 -  1.157
+++ sys/dev/pci/if_ix.c 27 Jul 2019 19:50:04 -
@@ -1678,9 +1678,7 @@ ixgbe_setup_interface(struct ix_softc *s
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
 #endif
 
-#ifdef IX_CSUM_OFFLOAD
ifp->if_capabilities |= IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
-#endif
 
/*
 * Specify the media types supported by this sc and register



Re: ldom.conf.5: mention eeprom(8)

2019-07-27 Thread Klemens Nanni
On Sat, Jul 27, 2019 at 10:43:23AM -0600, Theo de Raadt wrote:
> Mark Kettenis  wrote:
> > I realuze that eeprom(8) calls these fields, but they're usually just
> > called variables.
> 
> makes sense.
Sure, let's call them variables here.

> > Also, it is strange to have the ldom.conf in the usr.sbin/ldomd
> > directory.  The config file really isn't a config file for the daemon.
> > It is a config file for use with ldomctl.  So I think the man page
> > should live in usr.sbin/ldomctl.
> 
> Also makes sense to move it
I put it next to the daemon as that is the usual case, but ldomctl(8) is
indeed special in this regard.


Diff to mention eeprom(8) and move it to ldomctl.
OK?

Index: ldomctl/Makefile
===
RCS file: /cvs/src/usr.sbin/ldomctl/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- ldomctl/Makefile24 Nov 2012 11:50:45 -  1.8
+++ ldomctl/Makefile27 Jul 2019 17:33:43 -
@@ -16,7 +16,7 @@ NOPROG=   yes
 
 .endif
 
-MAN=   ldomctl.8
+MAN=   ldomctl.8 ldom.conf.5
 MANSUBDIR=sparc64
 
 .include 
Index: ldomctl/ldom.conf.5
===
RCS file: ldomctl/ldom.conf.5
diff -N ldomctl/ldom.conf.5
--- /dev/null   1 Jan 1970 00:00:00 -
+++ ldomctl/ldom.conf.5 27 Jul 2019 17:33:43 -
@@ -0,0 +1,98 @@
+.\" $OpenBSD: ldom.conf.5,v 1.1 2019/07/27 09:55:46 kn Exp $
+.\"
+.\" Copyright (c) 2012 Mark Kettenis 
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: July 27 2019 $
+.Dt LDOM.CONF 5 sparc64
+.Os
+.Sh NAME
+.Nm ldom.conf
+.Nd Logical Domain configuration
+.Sh DESCRIPTION
+.Nm
+is the configuration file to configure logical domains.
+.Pp
+Domains are defined in following format:
+.Bl -tag -width Ds
+.It Ic domain Ar name Brq ...
+Declares a scope for resources assigned to the specified domain.
+The scope must be opened and closed with curly braces and contains
+one or more of the following keywords, each on a separate line.
+A scope with
+.Ar name
+"primary" configures resources for the primary domain.
+If no configuration for the primary domain exists it is assigned
+all CPU and memory resources not used by any guest domains.
+.It Ic vcpu Ar number
+Declares the number of virtual CPUs assigned to a domain.
+.It Ic memory Ar number Ns Op Ar unit
+Declares the amount of memory assigned to a domain, in bytes.
+Optionally, the units 'K', 'M', or 'G', for kilo-, mega-, and gigabytes
+can be used.
+.It Ic variable Ar name Ns = Ns Ar value
+Sets the specified NVRAM variable for the domain.
+See
+.Xr eeprom 8
+for a list of OpenPROM variables.
+.It Ic vdisk Ar file
+The specified file is used to back a virtual disk of the guest
+domain.
+.Ar file
+can be a block device node or a disk image file created with
+.Xr dd 1 .
+This keyword can be used multiple times.
+.It Ic vnet Op Brq Ar keyword Ns = Ns Ar value ...
+Assign a
+.Xr vnet 4
+network interface to the guest domain.
+This keyword can be used multiple times.
+The curly braces are optional and can contain the following keywords:
+.Bl -tag -width Ds
+.It Ic mac-addr Ar address
+Configures the MAC address of the interface.
+.It Ic mtu Ar number
+Configures the MTU of the interface.
+.El
+.El
+.Sh EXAMPLES
+Define a domain with 12 virtual cores, 1GB memory, two file based virtual disks
+and one virtual network interface:
+.Bd -literal -offset indent
+domain "puffy" {
+   vcpu 12
+   memory 4G
+   vdisk "/home/puffy/vdisk0"
+   vdisk "/home/puffy/vdisk1"
+   vnet
+}
+.Ed
+.Pp
+Define another one with slightly less resources:
+.Bd -literal -offset indent
+domain "salmah" {
+   vcpu 8
+   memory 2G
+   vdisk "/home/salmah/vdisk0"
+   vdisk "/home/salmah/vdisk1"
+   vnet
+}
+.Ed
+.Pp
+On a machine with 32 cores and 64GB physical memory, this leaves 12 cores and
+58GB memory to the primary domain.
+.Sh SEE ALSO
+.Xr eeprom 8 ,
+.Xr ldomctl 8 ,
+.Xr ldomd 8
Index: ldomd/Makefile
===
RCS file: /cvs/src/usr.sbin/ldomd/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- ldomd/Makefile  27 Jul 2019 09:55:46 -  1.4
+++ ldomd/Makefile  27 Jul 2019 17:33:43 -
@@ -16,7 +16,7 @@ 

Re: Grammar and style edits to installation guide

2019-07-27 Thread Theo de Raadt
Evan Silberman  wrote:

> - You may now be given the opportunity to configure the time zone
> - your system will be using (this depends on the installation
> - media you are using).
> -
> - If the installation program skips this question, do not be
> - alarmed, the time zone will be configured at the end
> - of the installation.
> + Depending on the installation media you are using, you may now
> + be given the opportunity to configure the time zone your system
> + will use.  If the installation program skips this question, do
> + not be alarmed: the time zone will be configured at the end of
> + the installation.

This does not depend on the installation media.  If anything, it depends
on the network environment (time comes from the attempt to fetch ftplist
from remote, which is always performed in the background).  But I think
it is no longer true that it asks early, I think the manual time
adjustment is only at the end.



Re: ldom.conf.5: mention eeprom(8)

2019-07-27 Thread Theo de Raadt
Mark Kettenis  wrote:

> > Date: Sat, 27 Jul 2019 16:59:37 +0200
> > From: Klemens Nanni 
> > 
> > Point users to the manual describing "auto-boot?" and the like.
> > 
> > Feedback? OK?
> 
> I realuze that eeprom(8) calls these fields, but they're usually just
> called variables.

makes sense.

> Also, it is strange to have the ldom.conf in the usr.sbin/ldomd
> directory.  The config file really isn't a config file for the daemon.
> It is a config file for use with ldomctl.  So I think the man page
> should live in usr.sbin/ldomctl.

Also makes sense to move it



Re: Grammar and style edits to installation guide

2019-07-27 Thread Evan Silberman
Jason McIntyre  wrote:
> ok. so if i didn't comment on a change, i didn;t see any issue.
> if it's a rewording of an already ok text, i don;t see the point.
> i don;t see the point of Un*x->Unix, but some of our more, er,
> experienced, developers may want to chip in.

Hi Jason & tech@,

Below is my patch to the installation guide macros from a few weeks ago,
including only hunks jmc had no issues with, and without addressing the
UN*X/UNIX/Unix issue.

thanks!

Evan Silberman

Index: m4.common
===
RCS file: /cvs/src/distrib/notes/m4.common,v
retrieving revision 1.127
diff -u -p -r1.127 m4.common
--- m4.common   23 Aug 2017 02:59:45 -  1.127
+++ m4.common   27 Jul 2019 16:34:28 -
@@ -409,7 +409,7 @@ dnl install.sub (install) user_setup()
with a lowercase letter.  If the login name matches this
criteria, and doesn't conflict with any of the administrative
user accounts (such as `root', `daemon' or `ftp'), you
-   will be prompted with the users descriptive name, as well
+   will be prompted for the user's descriptive name, as well
as its password, twice.
 
As for the root password earlier, the install program will only
@@ -422,13 +422,11 @@ dnl install.sub (install) user_setup()
 dnl install.sub (install) set_timezone
 ifelse(MDTZ,,,
 {:-
-   You may now be given the opportunity to configure the time zone
-   your system will be using (this depends on the installation
-   media you are using).
-
-   If the installation program skips this question, do not be
-   alarmed, the time zone will be configured at the end
-   of the installation.
+   Depending on the installation media you are using, you may now
+   be given the opportunity to configure the time zone your system
+   will use.  If the installation program skips this question, do
+   not be alarmed: the time zone will be configured at the end of
+   the installation.
 -:})dnl
 dnl install.sh ask whether to use DUIDs before the md_prep_disklabel loop
The installation program will now tell you which disks it can
@@ -512,7 +510,7 @@ define({:-OpenBSDInstallPart5-:},
partition layout) and the `n' command (to change mount points)
are of particular interest.
 
-   Although the partitions position and size are written in exact
+   Although the partitions' position and size are written in exact
sector values, you do not need a calculator to create your
partitions!  Human-friendly units can be specified by adding `k',
`m' or `g' after any numbers to have them converted to kilobytes,
@@ -652,10 +650,10 @@ define({:-OpenBSDCommonInstall-:},
A list of available distribution sets found on the
given location will be listed.
 
-   You may individually select distribution sets to install,
-   by entering their name, or wildcards (e.g. `*.tgz' or
-   `base*|comp*', or `all' to select all the sets (which
-   is what most users will want to do).
+   You may individually select distribution sets to install
+   by entering their names or wildcards (e.g. `*.tgz' or
+   `base*|comp*'), or you may enter `all' to select all the
+   sets (which is what most users will want to do).
You may also enter `abort' to deselect everything and
restart the selection from scratch, or unselect sets
by entering their name prefixed with `-' (e.g. `-x*').
@@ -710,8 +708,8 @@ dnl
 define({:-OpenBSDCongratulations-:},{:-
 Congratulations, you have successfully installed OpenBSD OSREV.  When you
 reboot into OpenBSD, you should log in as "root" at the login prompt.
-You should create yourself an account and protect it and the "root"
-account with good passwords.
+You should create yourself an account, if you skipped this step during
+installation, and protect it and the "root" account with good passwords.
 
 The install program leaves root an initial mail message.  We recommend
 you read it, as it contains answers to basic questions you might have
@@ -751,8 +749,8 @@ installation.
 The installer runs dhclient(8) on the network interface the system
 booted from, or in case of multiple interfaces it will ask which one
 to use. Upon success it retrieves a response file via HTTP. If that
-fails, the installer asks for the response file location which can be
-either an url or a local path and retrieves the response file from
+fails, the installer asks for the response file location, which can be
+either a URL or a local path, and retrieves the response file from
 there.
 
 The "next-server" DHCP option specifies the hostname part of the URL,



Re: ldomctl.8: split config into new ldom.conf.5

2019-07-27 Thread Matthieu Herrb
On Sat, Jul 27, 2019 at 03:30:53AM +0200, Klemens Nanni wrote:
> Index: usr.sbin/ldomd/Makefile
> ===
> RCS file: /cvs/src/usr.sbin/ldomd/Makefile,v
> retrieving revision 1.3
> diff -u -p -r1.3 Makefile
> --- usr.sbin/ldomd/Makefile   27 Oct 2012 20:03:24 -  1.3
> +++ usr.sbin/ldomd/Makefile   27 Jul 2019 01:25:36 -
> @@ -16,7 +16,7 @@ NOPROG= yes
>  
>  .endif
>  
> -MAN= ldomd.8
> +MAN= ldomd.8 ldom.conf.5
>  MANSUBDIR=sparc64
>  
>  .include 

Here on amd64 this breaks the build:

install -c -o root -g bin -m 444  /share/OpenBSD/src/usr.sbin/ldomd/ldomd.8 
/usr/share/man/man8/sparc64/ldomd.8
install -c -o root -g bin -m 444  /share/OpenBSD/src/usr.sbin/ldomd/ldom.conf.5 
/usr/share/man/man5/sparc64/ldom.conf.5
install: /usr/share/man/man5/sparc64/INS@uuYbA85wgn: No such file or directory
*** Error 1 in /share/OpenBSD/src/usr.sbin/ldomd (:35 
'/usr/share/man/man5/sparc64/ldom.conf.5')

-- 
Matthieu Herrb



Re: ldom.conf.5: mention eeprom(8)

2019-07-27 Thread Mark Kettenis
> Date: Sat, 27 Jul 2019 16:59:37 +0200
> From: Klemens Nanni 
> 
> Point users to the manual describing "auto-boot?" and the like.
> 
> Feedback? OK?

I realuze that eeprom(8) calls these fields, but they're usually just
called variables.

Also, it is strange to have the ldom.conf in the usr.sbin/ldomd
directory.  The config file really isn't a config file for the daemon.
It is a config file for use with ldomctl.  So I think the man page
should live in usr.sbin/ldomctl.

> Index: ldom.conf.5
> ===
> RCS file: /cvs/src/usr.sbin/ldomd/ldom.conf.5,v
> retrieving revision 1.1
> diff -u -p -r1.1 ldom.conf.5
> --- ldom.conf.5   27 Jul 2019 09:55:46 -  1.1
> +++ ldom.conf.5   27 Jul 2019 14:58:26 -
> @@ -43,6 +43,9 @@ Optionally, the units 'K', 'M', or 'G', 
>  can be used.
>  .It Ic variable Ar name Ns = Ns Ar value
>  Sets the specified NVRAM variable for the domain.
> +See
> +.Xr eeprom 8
> +for a list of OpenPROM fields.
>  .It Ic vdisk Ar file
>  The specified file is used to back a virtual disk of the guest
>  domain.
> @@ -90,5 +93,6 @@ domain "salmah" {
>  On a machine with 32 cores and 64GB physical memory, this leaves 12 cores and
>  58GB memory to the primary domain.
>  .Sh SEE ALSO
> +.Xr eeprom 8 ,
>  .Xr ldomctl 8 ,
>  .Xr ldomd 8
> 
> 



ldom.conf.5: mention eeprom(8)

2019-07-27 Thread Klemens Nanni
Point users to the manual describing "auto-boot?" and the like.

Feedback? OK?

Index: ldom.conf.5
===
RCS file: /cvs/src/usr.sbin/ldomd/ldom.conf.5,v
retrieving revision 1.1
diff -u -p -r1.1 ldom.conf.5
--- ldom.conf.5 27 Jul 2019 09:55:46 -  1.1
+++ ldom.conf.5 27 Jul 2019 14:58:26 -
@@ -43,6 +43,9 @@ Optionally, the units 'K', 'M', or 'G', 
 can be used.
 .It Ic variable Ar name Ns = Ns Ar value
 Sets the specified NVRAM variable for the domain.
+See
+.Xr eeprom 8
+for a list of OpenPROM fields.
 .It Ic vdisk Ar file
 The specified file is used to back a virtual disk of the guest
 domain.
@@ -90,5 +93,6 @@ domain "salmah" {
 On a machine with 32 cores and 64GB physical memory, this leaves 12 cores and
 58GB memory to the primary domain.
 .Sh SEE ALSO
+.Xr eeprom 8 ,
 .Xr ldomctl 8 ,
 .Xr ldomd 8



Re: unveil prototypes

2019-07-27 Thread Alexander Bluhm
On Sat, Jul 27, 2019 at 12:41:24AM +0200, Mark Kettenis wrote:
> > Date: Sat, 27 Jul 2019 00:09:11 +0200
> > From: Alexander Bluhm 
> >
> > Hi,
> >
> > Can we move the unveil function prototypes into the namei.h header
> > file?  This guarantees consistency.  Protected by _KERNEL, survived
> > make build.
> >
> > ok?
>
> Why?  If these are internal interfaces for the unveil subsystem it
> makes sense not to put them in a header file.

They are implemented in kern/kern_unveil.c and used in kern/vfs_lookup.c.
The usual way to keep caller and callee perameters synchronized is
to put a prototype into a header file.

bluhm

> > Index: kern/vfs_lookup.c
> > ===
> > RCS file: /data/mirror/openbsd/cvs/src/sys/kern/vfs_lookup.c,v
> > retrieving revision 1.80
> > diff -u -p -r1.80 vfs_lookup.c
> > --- kern/vfs_lookup.c   18 Jul 2019 18:06:17 -  1.80
> > +++ kern/vfs_lookup.c   26 Jul 2019 08:16:01 -
> > @@ -57,10 +57,6 @@
> >  #include 
> >  #endif
> >
> > -void unveil_start_relative(struct proc *p, struct nameidata *ni);
> > -void unveil_check_component(struct proc *p, struct nameidata *ni, struct 
> > vnode *dp );
> > -int unveil_check_final(struct proc *p, struct nameidata *ni);
> > -
> >  int
> >  component_push(struct componentname *cnp, char *component, size_t len)
> >  {
> > Index: sys/namei.h
> > ===
> > RCS file: /data/mirror/openbsd/cvs/src/sys/sys/namei.h,v
> > retrieving revision 1.40
> > diff -u -p -r1.40 namei.h
> > --- sys/namei.h 13 May 2019 22:55:27 -  1.40
> > +++ sys/namei.h 26 Jul 2019 08:17:03 -
> > @@ -204,6 +204,10 @@ void nchinit(void);
> >  struct mount;
> >  void cache_purgevfs(struct mount *);
> >
> > +void unveil_start_relative(struct proc *, struct nameidata *);
> > +void unveil_check_component(struct proc *, struct nameidata *, struct 
> > vnode *);
> > +int unveil_check_final(struct proc *, struct nameidata *);
> > +
> >  extern struct pool namei_pool;
> >
> >  #endif
> >
> >



Re: taking kernel config into consideration when reorder

2019-07-27 Thread martian67
> A subsequent reboot will fail to relink because the SHA256 file has not
> been updated, also rewriting the kernel at this point nullifies the sync
> that was recently added for a reason.
> 
> (Also as you'd probably expect, a similar suggestion has been made
> before and already rejected.)

Out of curiosity, what was the reason this idea was rejected? I'd be
interested in writing a patch that addressed them if possible.