svn commit: r363630 - in head: lib/libpmc sys/dev/hwpmc

2020-07-27 Thread Ryan Moeller
Author: freqlabs
Date: Tue Jul 28 02:56:26 2020
New Revision: 363630
URL: https://svnweb.freebsd.org/changeset/base/363630

Log:
  libpmc: Use known pmc_cpuid buffer size
  
  Use the existing PMC_CPUID_LEN to size pmc_cpuid in the kernel and various
  buffers for reading it in libpmc.  This avoids some extra syscalls and
  malloc/frees.
  
  While in here, use strlcpy to copy a user-provided cpuid string instead of
  memcpy, to make sure we terminate the buffer.
  
  Reviewed by:  mav
  MFC after:1 week
  Sponsored by: iXsystems, Inc.
  Differential Revision:https://reviews.freebsd.org/D25679

Modified:
  head/lib/libpmc/libpmc_pmu_util.c
  head/sys/dev/hwpmc/hwpmc_mod.c

Modified: head/lib/libpmc/libpmc_pmu_util.c
==
--- head/lib/libpmc/libpmc_pmu_util.c   Tue Jul 28 02:53:44 2020
(r363629)
+++ head/lib/libpmc/libpmc_pmu_util.c   Tue Jul 28 02:56:26 2020
(r363630)
@@ -30,6 +30,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -89,20 +90,13 @@ static struct pmu_alias pmu_amd_alias_table[] = {
 static pmu_mfr_t
 pmu_events_mfr(void)
 {
-   char *buf;
-   size_t s;
+   char buf[PMC_CPUID_LEN];
+   size_t s = sizeof(buf);
pmu_mfr_t mfr;
 
-   if (sysctlbyname("kern.hwpmc.cpuid", (void *)NULL, ,
+   if (sysctlbyname("kern.hwpmc.cpuid", buf, ,
(void *)NULL, 0) == -1)
return (PMU_INVALID);
-   if ((buf = malloc(s + 1)) == NULL)
-   return (PMU_INVALID);
-   if (sysctlbyname("kern.hwpmc.cpuid", buf, ,
-   (void *)NULL, 0) == -1) {
-   free(buf);
-   return (PMU_INVALID);
-   }
if (strcasestr(buf, "AuthenticAMD") != NULL ||
strcasestr(buf, "HygonGenuine") != NULL)
mfr = PMU_AMD;
@@ -110,7 +104,6 @@ pmu_events_mfr(void)
mfr = PMU_INTEL;
else
mfr = PMU_INVALID;
-   free(buf);
return (mfr);
 }
 
@@ -169,17 +162,14 @@ pmu_events_map_get(const char *cpuid)
 {
regex_t re;
regmatch_t pmatch[1];
-   size_t s;
-   char buf[64];
+   char buf[PMC_CPUID_LEN];
+   size_t s = sizeof(buf);
int match;
const struct pmu_events_map *pme;
 
if (cpuid != NULL) {
-   memcpy(buf, cpuid, 64);
+   strlcpy(buf, cpuid, s);
} else {
-   if (sysctlbyname("kern.hwpmc.cpuid", (void *)NULL, ,
-   (void *)NULL, 0) == -1)
-   return (NULL);
if (sysctlbyname("kern.hwpmc.cpuid", buf, ,
(void *)NULL, 0) == -1)
return (NULL);

Modified: head/sys/dev/hwpmc/hwpmc_mod.c
==
--- head/sys/dev/hwpmc/hwpmc_mod.c  Tue Jul 28 02:53:44 2020
(r363629)
+++ head/sys/dev/hwpmc/hwpmc_mod.c  Tue Jul 28 02:56:26 2020
(r363630)
@@ -305,7 +305,7 @@ static int pmc_callchaindepth = PMC_CALLCHAIN_DEPTH;
 SYSCTL_INT(_kern_hwpmc, OID_AUTO, callchaindepth, CTLFLAG_RDTUN,
 _callchaindepth, 0, "depth of call chain records");
 
-char pmc_cpuid[64];
+char pmc_cpuid[PMC_CPUID_LEN];
 SYSCTL_STRING(_kern_hwpmc, OID_AUTO, cpuid, CTLFLAG_RD,
pmc_cpuid, 0, "cpu version string");
 #ifdef HWPMC_DEBUG
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r363595 - head/sys/kern

2020-07-27 Thread Kyle Evans
On Mon, Jul 27, 2020 at 11:39 AM Rodney W. Grimes
 wrote:
>
> > Hi,
> >
> > Helpful addition. Might it help people more to make the message point to 
> > the replacement of the deprecated functionality?
> >
> > Regards,
> > Ronald.
>
> I tend to agree here, the functionality was not depricated,
> it was replaced by a new implementation in another language.
>

Sure, that's why the wording was specifically that "this script is
deprecated." Because it is, we no longer
support generating syscall bits with it. I don't really care much
about this at all because I'm not convinced
any downstreams are doing anything special here (besides, of course,
the one I already know about), and thus
I think this will have very little or no impact. Either way, I've
incorporated the two suggestions above into r363628.

Feel free to tweak it however you want and just commit it... consider
any adjustment okay by me unless
said adjustment is the complete opposite of what we're doing.

Thanks,

Kyle Evans

> >
> >
> > Van: Kyle Evans 
> > Datum: maandag, 27 juli 2020 05:13
> > Aan: src-committ...@freebsd.org, svn-src-...@freebsd.org, 
> > svn-src-head@freebsd.org
> > Onderwerp: svn commit: r363595 - head/sys/kern
> > >
> > > Author: kevans
> > > Date: Mon Jul 27 03:13:23 2020
> > > New Revision: 363595
> > > URL: https://svnweb.freebsd.org/changeset/base/363595
> > >
> > > Log:
> > >   makesyscalls.sh: spit out a deprecation notice to stderr
> > >
> > >   This has for a while been replaced by makesyscalls.lua in the stock 
> > > FreeBSD
> > >   build.  Ensure downstreams get some notice that it'a going away if 
> > > they're
> > >   reliant on it, maybe.
> > >
> > > Modified:
> > >   head/sys/kern/makesyscalls.sh
> > >
> > > Modified: head/sys/kern/makesyscalls.sh
> > > ==
> > > --- head/sys/kern/makesyscalls.sh   Mon Jul 27 01:53:27 2020(r363594)
> > > +++ head/sys/kern/makesyscalls.sh   Mon Jul 27 03:13:23 2020(r363595)
> > > @@ -60,6 +60,8 @@ case $# in
> > > ;;
> > >  esac
> > >
> > > +1>&2 echo "$0: This script is deprecated and will be removed before 
> > > FreeBSD 13."
> > > +
> > >  if [ -n "$2" ]; then
> > > . "$2"
> > >  fi
> > > ___
> > > svn-src-...@freebsd.org mailing list
> > > https://lists.freebsd.org/mailman/listinfo/svn-src-all
> > > To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
> > >
> > >
> > >
>
> --
> Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363628 - head/sys/kern

2020-07-27 Thread Kyle Evans
Author: kevans
Date: Tue Jul 28 01:05:40 2020
New Revision: 363628
URL: https://svnweb.freebsd.org/changeset/base/363628

Log:
  makesyscalls.sh: improve the 'this is going away' message
  
  Reported by:  Ronald Klop, rgrimes

Modified:
  head/sys/kern/makesyscalls.sh

Modified: head/sys/kern/makesyscalls.sh
==
--- head/sys/kern/makesyscalls.sh   Tue Jul 28 00:24:12 2020
(r363627)
+++ head/sys/kern/makesyscalls.sh   Tue Jul 28 01:05:40 2020
(r363628)
@@ -60,7 +60,8 @@ case $# in
;;
 esac
 
-1>&2 echo "$0: This script is deprecated and will be removed before FreeBSD 
13."
+1>&2 echo "$0: This script has been replaced by sys/tools/makesyscalls.lua and"
+1>&2 echo "$0: will be removed before FreeBSD 13.  See also: 
sys/conf/sysent.mk"
 
 if [ -n "$2" ]; then
. "$2"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363627 - head/crypto/openssh

2020-07-27 Thread Ed Maste
Author: emaste
Date: Tue Jul 28 00:24:12 2020
New Revision: 363627
URL: https://svnweb.freebsd.org/changeset/base/363627

Log:
  ssh: Remove AES-CBC ciphers from default server and client lists
  
  A base system OpenSSH update in 2016 or so removed a number of ciphers
  from the default lists offered by the server/client, due to known
  weaknesses.  This caused POLA issues for some users and prompted
  PR207679; the ciphers were restored to the default lists in r296634.
  
  When upstream removed these ciphers from the default server list, they
  moved them to the client-only default list.  They were subsequently
  removed from the client default, in OpenSSH 7.9p1.
  
  The change has persisted long enough.  Remove these extra ciphers from
  both the server and client default lists, in advance of FreeBSD 13.
  
  Reviewed by:  markm, rgrimes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25833

Modified:
  head/crypto/openssh/FREEBSD-upgrade
  head/crypto/openssh/myproposal.h
  head/crypto/openssh/sshd_config.5

Modified: head/crypto/openssh/FREEBSD-upgrade
==
--- head/crypto/openssh/FREEBSD-upgrade Mon Jul 27 23:19:46 2020
(r363626)
+++ head/crypto/openssh/FREEBSD-upgrade Tue Jul 28 00:24:12 2020
(r363627)
@@ -168,13 +168,6 @@
ignore HPN-related configuration options to avoid breaking existing
configurations.
 
-9) AES-CBC
-
-   The AES-CBC ciphers were removed from the server-side proposal list
-   in 6.7p1 due to theoretical weaknesses and the availability of
-   superior ciphers (including AES-CTR and AES-GCM).  We have re-added
-   them for compatibility with third-party clients.
-
 
 
 This port was brought to you by (in no particular order) DARPA, NAI

Modified: head/crypto/openssh/myproposal.h
==
--- head/crypto/openssh/myproposal.hMon Jul 27 23:19:46 2020
(r363626)
+++ head/crypto/openssh/myproposal.hTue Jul 28 00:24:12 2020
(r363627)
@@ -1,5 +1,4 @@
 /* $OpenBSD: myproposal.h,v 1.57 2018/09/12 01:34:02 djm Exp $ */
-/* $FreeBSD$ */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -122,8 +121,7 @@
 #define KEX_SERVER_ENCRYPT \
"chacha20-poly1...@openssh.com," \
"aes128-ctr,aes192-ctr,aes256-ctr" \
-   AESGCM_CIPHER_MODES \
-   ",aes128-cbc,aes192-cbc,aes256-cbc"
+   AESGCM_CIPHER_MODES
 
 #define KEX_CLIENT_ENCRYPT KEX_SERVER_ENCRYPT
 

Modified: head/crypto/openssh/sshd_config.5
==
--- head/crypto/openssh/sshd_config.5   Mon Jul 27 23:19:46 2020
(r363626)
+++ head/crypto/openssh/sshd_config.5   Tue Jul 28 00:24:12 2020
(r363627)
@@ -495,8 +495,7 @@ The default is:
 .Bd -literal -offset indent
 chacha20-poly1...@openssh.com,
 aes128-ctr,aes192-ctr,aes256-ctr,
-aes128-...@openssh.com,aes256-...@openssh.com,
-aes128-cbc,aes192-cbc,aes256-cbc
+aes128-...@openssh.com,aes256-...@openssh.com
 .Ed
 .Pp
 The list of available ciphers may also be obtained using
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363624 - in head/sys: arm64/arm64 arm64/include conf dev/acpica dev/pci x86/include x86/x86

2020-07-27 Thread Alexander Motin
Author: mav
Date: Mon Jul 27 21:19:41 2020
New Revision: 363624
URL: https://svnweb.freebsd.org/changeset/base/363624

Log:
  Add initial driver for ACPI Platform Error Interfaces.
  
  APEI allows platform to report different kinds of errors to OS in several
  ways.  We've found that Supermicro X10/X11 motherboards report PCIe errors
  appearing on hot-unplug via this interface using NMI.  Without respective
  driver it ended up in kernel panic without any additional information.
  
  This driver introduces support for the APEI Generic Hardware Error Source
  reporting via NMI, SCI or polling.  It decodes the reported errors and
  either pass them to pci(4) for processing or just logs otherwise.  Errors
  marked as fatal still end up in kernel panic, but some more informative.
  
  When somebody get to native PCIe AER support implementation both of the
  reporting mechanisms should get common error recovery code.  Since in our
  case errors happen when the device is already gone, there is nothing to
  recover, so the code just clears the error statuses, practically ignoring
  the otherwise destructive NMIs in nicer way.
  
  MFC after:2 weeks
  Relnotes: yes
  Sponsored by: iXsystems, Inc.

Added:
  head/sys/dev/acpica/acpi_apei.c   (contents, props changed)
Modified:
  head/sys/arm64/arm64/machdep.c
  head/sys/arm64/include/acpica_machdep.h
  head/sys/conf/files
  head/sys/dev/acpica/acpi.c
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pcivar.h
  head/sys/x86/include/acpica_machdep.h
  head/sys/x86/x86/cpu_machdep.c

Modified: head/sys/arm64/arm64/machdep.c
==
--- head/sys/arm64/arm64/machdep.c  Mon Jul 27 19:05:53 2020
(r363623)
+++ head/sys/arm64/arm64/machdep.c  Mon Jul 27 21:19:41 2020
(r363624)
@@ -132,6 +132,8 @@ void pagezero_cache(void *);
 /* pagezero_simple is default pagezero */
 void (*pagezero)(void *p) = pagezero_simple;
 
+int (*apei_nmi)(void);
+
 static void
 pan_setup(void)
 {

Modified: head/sys/arm64/include/acpica_machdep.h
==
--- head/sys/arm64/include/acpica_machdep.h Mon Jul 27 19:05:53 2020
(r363623)
+++ head/sys/arm64/include/acpica_machdep.h Mon Jul 27 21:19:41 2020
(r363624)
@@ -57,6 +57,8 @@ struct acpi_generic_address;
 intacpi_map_addr(struct acpi_generic_address  *, bus_space_tag_t *,
 bus_space_handle_t *, bus_size_t);
 
+extern int (*apei_nmi)(void);
+
 #endif /* _KERNEL */
 
 #endif /* __ACPICA_MACHDEP_H__ */

Modified: head/sys/conf/files
==
--- head/sys/conf/files Mon Jul 27 19:05:53 2020(r363623)
+++ head/sys/conf/files Mon Jul 27 21:19:41 2020(r363624)
@@ -754,6 +754,7 @@ dev/acpica/Osd/OsdSynch.c   optional acpi
 dev/acpica/Osd/OsdTable.c  optional acpi
 dev/acpica/acpi.c  optional acpi
 dev/acpica/acpi_acad.c optional acpi
+dev/acpica/acpi_apei.c optional acpi
 dev/acpica/acpi_battery.c  optional acpi
 dev/acpica/acpi_button.c   optional acpi
 dev/acpica/acpi_cmbat.coptional acpi

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Mon Jul 27 19:05:53 2020(r363623)
+++ head/sys/dev/acpica/acpi.c  Mon Jul 27 21:19:41 2020(r363624)
@@ -152,6 +152,7 @@ static ACPI_STATUS acpi_device_scan_children(device_t 
int max_depth, acpi_scan_cb_t user_fn, void *arg);
 static int acpi_isa_pnp_probe(device_t bus, device_t child,
struct isa_pnp_id *ids);
+static voidacpi_platform_osc(device_t dev);
 static voidacpi_probe_children(device_t bus);
 static voidacpi_probe_order(ACPI_HANDLE handle, int *order);
 static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level,
@@ -683,6 +684,8 @@ acpi_attach(device_t dev)
 /* Register ACPI again to pass the correct argument of pm_func. */
 power_pm_register(POWER_PM_TYPE_ACPI, acpi_pm_func, sc);
 
+acpi_platform_osc(dev);
+
 if (!acpi_disabled("bus")) {
EVENTHANDLER_REGISTER(dev_lookup, acpi_lookup, NULL, 1000);
acpi_probe_children(dev);
@@ -1941,6 +1944,34 @@ acpi_enable_pcie(void)
alloc++;
}
 #endif
+}
+
+static void
+acpi_platform_osc(device_t dev)
+{
+   ACPI_HANDLE sb_handle;
+   ACPI_STATUS status;
+   uint32_t cap_set[2];
+
+   /* 0811B06E-4A27-44F9-8D60-3CBBC22E7B48 */
+   static uint8_t acpi_platform_uuid[ACPI_UUID_LENGTH] = {
+   0x6e, 0xb0, 0x11, 0x08, 0x27, 0x4a, 0xf9, 0x44,
+   0x8d, 0x60, 0x3c, 0xbb, 0xc2, 0x2e, 0x7b, 0x48
+   };
+
+   if (ACPI_FAILURE(AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", _handle)))
+   return;
+
+   cap_set[1] = 0x10;  /* APEI Support */
+   

svn commit: r363623 - head/sys/dev/cxgbe

2020-07-27 Thread Mark Johnston
Author: markj
Date: Mon Jul 27 19:05:53 2020
New Revision: 363623
URL: https://svnweb.freebsd.org/changeset/base/363623

Log:
  cxgbe(4): Stop checking for failures from malloc(M_WAITOK).
  
  PR:   240545
  Submitted by: Andrew Reiter 
  Reviewed by:  np
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D25767

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cMon Jul 27 18:57:28 2020
(r363622)
+++ head/sys/dev/cxgbe/t4_main.cMon Jul 27 19:05:53 2020
(r363623)
@@ -10003,10 +10003,6 @@ load_fw(struct adapter *sc, struct t4_data *fw)
}
 
fw_data = malloc(fw->len, M_CXGBE, M_WAITOK);
-   if (fw_data == NULL) {
-   rc = ENOMEM;
-   goto done;
-   }
 
rc = copyin(fw->data, fw_data, fw->len);
if (rc == 0)
@@ -10035,10 +10031,6 @@ load_cfg(struct adapter *sc, struct t4_data *cfg)
}
 
cfg_data = malloc(cfg->len, M_CXGBE, M_WAITOK);
-   if (cfg_data == NULL) {
-   rc = ENOMEM;
-   goto done;
-   }
 
rc = copyin(cfg->data, cfg_data, cfg->len);
if (rc == 0)
@@ -10084,10 +10076,6 @@ load_boot(struct adapter *sc, struct t4_bootrom *br)
}
 
br_data = malloc(br->len, M_CXGBE, M_WAITOK);
-   if (br_data == NULL) {
-   rc = ENOMEM;
-   goto done;
-   }
 
rc = copyin(br->data, br_data, br->len);
if (rc == 0)
@@ -10116,10 +10104,6 @@ load_bootcfg(struct adapter *sc, struct t4_data *bc)
}
 
bc_data = malloc(bc->len, M_CXGBE, M_WAITOK);
-   if (bc_data == NULL) {
-   rc = ENOMEM;
-   goto done;
-   }
 
rc = copyin(bc->data, bc_data, bc->len);
if (rc == 0)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363622 - head/sys/sys

2020-07-27 Thread Alan Somers
Author: asomers
Date: Mon Jul 27 18:57:28 2020
New Revision: 363622
URL: https://svnweb.freebsd.org/changeset/base/363622

Log:
  Restrict definition of CTL_P1003_1B_MAXID to the kernel
  
  This constant is only used to size an array within the kernel. There are
  probably no legitimate uses in userland. Worse, since the kernel's array
  could theoretically change size over time, any use of that symbol in
  userland wouldn't be forwards compatible to new kernel versions.
  
  Reviewed by:  jhb
  MFC after:Never
  Differential Revision:https://reviews.freebsd.org/D25816

Modified:
  head/sys/sys/sysctl.h

Modified: head/sys/sys/sysctl.h
==
--- head/sys/sys/sysctl.h   Mon Jul 27 18:46:20 2020(r363621)
+++ head/sys/sys/sysctl.h   Mon Jul 27 18:57:28 2020(r363622)
@@ -1096,9 +1096,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
 #defineCTL_P1003_1B_SIGQUEUE_MAX   24  /* int */
 #defineCTL_P1003_1B_TIMER_MAX  25  /* int */
 
-#defineCTL_P1003_1B_MAXID  26
-
 #ifdef _KERNEL
+
+#defineCTL_P1003_1B_MAXID  26
 
 /*
  * Declare some common oids.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363621 - head/bin/sh

2020-07-27 Thread Piotr Pawel Stefaniak
Author: pstef
Date: Mon Jul 27 18:46:20 2020
New Revision: 363621
URL: https://svnweb.freebsd.org/changeset/base/363621

Log:
  sh(1): print a newline when ^D quits sh
  
  I've always found this a little bit confusing:
  > sh
  $ ^D> sh
  $ ^D>
  
  Reviewed by:  0mp, jilles
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D25813

Modified:
  head/bin/sh/main.c

Modified: head/bin/sh/main.c
==
--- head/bin/sh/main.c  Mon Jul 27 16:51:23 2020(r363620)
+++ head/bin/sh/main.c  Mon Jul 27 18:46:20 2020(r363621)
@@ -228,6 +228,10 @@ cmdloop(int top)
}
}
popstackmark();
+   if (top && iflag) {
+   out2c('\n');
+   flushout(out2);
+   }
 }
 
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r363598 - head/usr.sbin/nologin

2020-07-27 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Hi!
> 
> On 7/27/20 6:41 PM, Rodney W. Grimes wrote:
> >> Author: 0mp (doc,ports committer)
> >> Date: Mon Jul 27 10:45:47 2020
> >> New Revision: 363598
> >> URL: https://svnweb.freebsd.org/changeset/base/363598
> >>
> >> Log:
> >>nologin.8: Improve wording
> > I disagree that this improves wording.  The norm of action for
> > "logging" in Unix is to "write to syslog", not "log to syslog".
> 
> Hmm, I agree, but here it is "log using syslog".

Please read syslog(3) it is rather consistent about using
"write to syslog".  The action of calling syslog(3) is to
"writes message to the system message logger."


> 
> Have you got any idea how to further improve this sentence?

No, but can we not degrade it?

> 
> >>Reported by:yuripv
> >>Reviewed by:bcr, yuripv
> >>MFC after:  3 days
> >>Differential Revision:  https://reviews.freebsd.org/D25814
> >>
> >> Modified:
> >>head/usr.sbin/nologin/nologin.8
> >>
> >> Modified: head/usr.sbin/nologin/nologin.8
> >> ==
> >> --- head/usr.sbin/nologin/nologin.8Mon Jul 27 09:10:02 2020
> >> (r363597)
> >> +++ head/usr.sbin/nologin/nologin.8Mon Jul 27 10:45:47 2020
> >> (r363598)
> >> @@ -44,7 +44,7 @@ have been disabled.
> >>   .Pp
> >>   When executed,
> >>   .Nm
> >> -first writes about the login attempt to
> >> +first logs about the login attempt using
> >>   .Xr syslog 3
> >>   and then displays a message that an account is not available.
> >>   .Pp
> 
> Cheers!
> 
> Mateusz Piotrowski
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r363598 - head/usr.sbin/nologin

2020-07-27 Thread Mateusz Piotrowski

Hi!

On 7/27/20 6:41 PM, Rodney W. Grimes wrote:

Author: 0mp (doc,ports committer)
Date: Mon Jul 27 10:45:47 2020
New Revision: 363598
URL: https://svnweb.freebsd.org/changeset/base/363598

Log:
   nologin.8: Improve wording

I disagree that this improves wording.  The norm of action for
"logging" in Unix is to "write to syslog", not "log to syslog".


Hmm, I agree, but here it is "log using syslog".

Have you got any idea how to further improve this sentence?


   Reported by: yuripv
   Reviewed by: bcr, yuripv
   MFC after:   3 days
   Differential Revision:   https://reviews.freebsd.org/D25814

Modified:
   head/usr.sbin/nologin/nologin.8

Modified: head/usr.sbin/nologin/nologin.8
==
--- head/usr.sbin/nologin/nologin.8 Mon Jul 27 09:10:02 2020
(r363597)
+++ head/usr.sbin/nologin/nologin.8 Mon Jul 27 10:45:47 2020
(r363598)
@@ -44,7 +44,7 @@ have been disabled.
  .Pp
  When executed,
  .Nm
-first writes about the login attempt to
+first logs about the login attempt using
  .Xr syslog 3
  and then displays a message that an account is not available.
  .Pp


Cheers!

Mateusz Piotrowski

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363620 - head/usr.bin/comm

2020-07-27 Thread Fernando ApesteguĂ­a
Author: fernape (ports committer)
Date: Mon Jul 27 16:51:23 2020
New Revision: 363620
URL: https://svnweb.freebsd.org/changeset/base/363620

Log:
  comm(1): Add EXAMPLES section
  
  Add two very simple examples.
  
  Approved by:  manpages (gbe@)
  Differential Revision: https://reviews.freebsd.org/D25344

Modified:
  head/usr.bin/comm/comm.1

Modified: head/usr.bin/comm/comm.1
==
--- head/usr.bin/comm/comm.1Mon Jul 27 16:37:18 2020(r363619)
+++ head/usr.bin/comm/comm.1Mon Jul 27 16:51:23 2020(r363620)
@@ -31,7 +31,7 @@
 .\" From: @(#)comm.1   8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd December 12, 2009
+.Dd July 27, 2020
 .Dt COMM 1
 .Os
 .Sh NAME
@@ -95,6 +95,35 @@ as described in
 .Xr environ 7 .
 .Sh EXIT STATUS
 .Ex -std
+.Sh EXAMPLES
+Assuming a file named
+.Pa example.txt
+with the following contents:
+.Bd -literal -offset indent
+a
+b
+c
+d
+.Ed
+.Pp
+Show lines only in
+.Pa example.txt ,
+lines only in stdin and common lines:
+.Bd -literal -offset indent
+$ echo -e "B\enc" | comm example.txt -
+B
+a
+b
+c
+d
+.Ed
+.Pp
+Show only common lines doing case insensitive comparisons:
+.Bd -literal -offset indent
+$ echo -e "B\enc" | comm -1 -2 -i example.txt -
+b
+c
+.Ed
 .Sh SEE ALSO
 .Xr cmp 1 ,
 .Xr diff 1 ,
@@ -108,9 +137,7 @@ utility conforms to
 .Pp
 The
 .Fl i
-option is an extension to the
-.Tn POSIX
-standard.
+option is an extension to the POSIX standard.
 .Sh HISTORY
 A
 .Nm
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r363598 - head/usr.sbin/nologin

2020-07-27 Thread Rodney W. Grimes
> Author: 0mp (doc,ports committer)
> Date: Mon Jul 27 10:45:47 2020
> New Revision: 363598
> URL: https://svnweb.freebsd.org/changeset/base/363598
> 
> Log:
>   nologin.8: Improve wording

I disagree that this improves wording.  The norm of action for
"logging" in Unix is to "write to syslog", not "log to syslog".

>   Reported by:yuripv
>   Reviewed by:bcr, yuripv
>   MFC after:  3 days
>   Differential Revision:  https://reviews.freebsd.org/D25814
> 
> Modified:
>   head/usr.sbin/nologin/nologin.8
> 
> Modified: head/usr.sbin/nologin/nologin.8
> ==
> --- head/usr.sbin/nologin/nologin.8   Mon Jul 27 09:10:02 2020
> (r363597)
> +++ head/usr.sbin/nologin/nologin.8   Mon Jul 27 10:45:47 2020
> (r363598)
> @@ -44,7 +44,7 @@ have been disabled.
>  .Pp
>  When executed,
>  .Nm
> -first writes about the login attempt to
> +first logs about the login attempt using
>  .Xr syslog 3
>  and then displays a message that an account is not available.
>  .Pp
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r363595 - head/sys/kern

2020-07-27 Thread Rodney W. Grimes
> Hi,
> 
> Helpful addition. Might it help people more to make the message point to the 
> replacement of the deprecated functionality?
> 
> Regards,
> Ronald.

I tend to agree here, the functionality was not depricated,
it was replaced by a new implementation in another language.

It would be better to replace the word deprecated with "replaced
by" as in:
This script has been replaced by makesyscalls.lua and
this version shall be removed in FreeBSD 13.

> 
>  
> Van: Kyle Evans 
> Datum: maandag, 27 juli 2020 05:13
> Aan: src-committ...@freebsd.org, svn-src-...@freebsd.org, 
> svn-src-head@freebsd.org
> Onderwerp: svn commit: r363595 - head/sys/kern
> > 
> > Author: kevans
> > Date: Mon Jul 27 03:13:23 2020
> > New Revision: 363595
> > URL: https://svnweb.freebsd.org/changeset/base/363595
> > 
> > Log:
> >   makesyscalls.sh: spit out a deprecation notice to stderr
> >   
> >   This has for a while been replaced by makesyscalls.lua in the stock 
> > FreeBSD
> >   build.  Ensure downstreams get some notice that it'a going away if they're
> >   reliant on it, maybe.
> > 
> > Modified:
> >   head/sys/kern/makesyscalls.sh
> > 
> > Modified: head/sys/kern/makesyscalls.sh
> > ==
> > --- head/sys/kern/makesyscalls.sh   Mon Jul 27 01:53:27 2020(r363594)
> > +++ head/sys/kern/makesyscalls.sh   Mon Jul 27 03:13:23 2020(r363595)
> > @@ -60,6 +60,8 @@ case $# in
> > ;;
> >  esac
> >  
> > +1>&2 echo "$0: This script is deprecated and will be removed before 
> > FreeBSD 13."
> > +
> >  if [ -n "$2" ]; then
> > . "$2"
> >  fi
> > ___
> > svn-src-...@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/svn-src-all
> > To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
> > 
> > 
> > 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363619 - head/sys/riscv/riscv

2020-07-27 Thread John Baldwin
Author: jhb
Date: Mon Jul 27 16:37:18 2020
New Revision: 363619
URL: https://svnweb.freebsd.org/changeset/base/363619

Log:
  Trim some extraneous parentheses.
  
  Reported by:  kib (do_trap_user)
  Sponsored by: DARPA

Modified:
  head/sys/riscv/riscv/intr_machdep.c
  head/sys/riscv/riscv/trap.c

Modified: head/sys/riscv/riscv/intr_machdep.c
==
--- head/sys/riscv/riscv/intr_machdep.c Mon Jul 27 16:34:31 2020
(r363618)
+++ head/sys/riscv/riscv/intr_machdep.c Mon Jul 27 16:37:18 2020
(r363619)
@@ -163,7 +163,7 @@ riscv_cpu_intr(struct trapframe *frame)
KASSERT(frame->tf_scause & EXCP_INTR,
("riscv_cpu_intr: wrong frame passed"));
 
-   active_irq = (frame->tf_scause & EXCP_MASK);
+   active_irq = frame->tf_scause & EXCP_MASK;
 
switch (active_irq) {
case IRQ_SOFTWARE_USER:

Modified: head/sys/riscv/riscv/trap.c
==
--- head/sys/riscv/riscv/trap.c Mon Jul 27 16:34:31 2020(r363618)
+++ head/sys/riscv/riscv/trap.c Mon Jul 27 16:37:18 2020(r363619)
@@ -256,7 +256,7 @@ do_trap_supervisor(struct trapframe *frame)
KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) ==
SSTATUS_SPP, ("Came from S mode with interrupts enabled"));
 
-   exception = (frame->tf_scause & EXCP_MASK);
+   exception = frame->tf_scause & EXCP_MASK;
if (frame->tf_scause & EXCP_INTR) {
/* Interrupt */
riscv_cpu_intr(frame);
@@ -318,7 +318,7 @@ do_trap_user(struct trapframe *frame)
KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == 0,
("Came from U mode with interrupts enabled"));
 
-   exception = (frame->tf_scause & EXCP_MASK);
+   exception = frame->tf_scause & EXCP_MASK;
if (frame->tf_scause & EXCP_INTR) {
/* Interrupt */
riscv_cpu_intr(frame);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363618 - head/sys/powerpc/powerpc

2020-07-27 Thread John Baldwin
Author: jhb
Date: Mon Jul 27 16:34:31 2020
New Revision: 363618
URL: https://svnweb.freebsd.org/changeset/base/363618

Log:
  Set si_addr to dar for MMU and alignment faults.
  
  Reviewed by:  kib
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25776

Modified:
  head/sys/powerpc/powerpc/trap.c

Modified: head/sys/powerpc/powerpc/trap.c
==
--- head/sys/powerpc/powerpc/trap.c Mon Jul 27 16:32:21 2020
(r363617)
+++ head/sys/powerpc/powerpc/trap.c Mon Jul 27 16:34:31 2020
(r363618)
@@ -207,7 +207,7 @@ trap(struct trapframe *frame)
int sig, type, user;
u_int   ucode;
ksiginfo_t  ksi;
-   register_t  fscr;
+   register_t  addr, fscr;
 
VM_CNT_INC(v_trap);
 
@@ -224,6 +224,7 @@ trap(struct trapframe *frame)
type = ucode = frame->exc;
sig = 0;
user = frame->srr1 & PSL_PR;
+   addr = 0;
 
CTR3(KTR_TRAP, "trap: %s type=%s (%s)", td->td_name,
trapname(type), user ? "user" : "kernel");
@@ -248,6 +249,7 @@ trap(struct trapframe *frame)
if (user) {
td->td_pticks = 0;
td->td_frame = frame;
+   addr = frame->srr0;
if (td->td_cowgen != p->p_cowgen)
thread_cow_update(td);
 
@@ -261,18 +263,22 @@ trap(struct trapframe *frame)
break;
 
 #if defined(__powerpc64__) && defined(AIM)
-   case EXC_ISE:
case EXC_DSE:
+   addr = frame->dar;
+   /* FALLTHROUGH */
+   case EXC_ISE:
/* DSE/ISE are automatically fatal with radix pmap. */
if (radix_mmu ||
handle_user_slb_spill(>p_vmspace->vm_pmap,
-   (type == EXC_ISE) ? frame->srr0 : frame->dar) != 0){
+   addr) != 0){
sig = SIGSEGV;
ucode = SEGV_MAPERR;
}
break;
 #endif
case EXC_DSI:
+   addr = frame->dar;
+   /* FALLTHROUGH */
case EXC_ISI:
if (trap_pfault(frame, true, , ))
sig = 0;
@@ -368,6 +374,7 @@ trap(struct trapframe *frame)
if (fix_unaligned(td, frame) != 0) {
sig = SIGBUS;
ucode = BUS_ADRALN;
+   addr = frame->dar;
}
else
frame->srr0 += 4;
@@ -481,7 +488,7 @@ trap(struct trapframe *frame)
ksiginfo_init_trap();
ksi.ksi_signo = sig;
ksi.ksi_code = (int) ucode; /* XXX, not POSIX */
-   ksi.ksi_addr = (void *)frame->srr0;
+   ksi.ksi_addr = (void *)addr;
ksi.ksi_trapno = type;
trapsignal(td, );
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363617 - head/sys/mips/mips

2020-07-27 Thread John Baldwin
Author: jhb
Date: Mon Jul 27 16:32:21 2020
New Revision: 363617
URL: https://svnweb.freebsd.org/changeset/base/363617

Log:
  Fix si_addr value for breakpoints in a delay slot.
  
  Reviewed by:  kib
  Obtained from:CheriBSD
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25773

Modified:
  head/sys/mips/mips/trap.c

Modified: head/sys/mips/mips/trap.c
==
--- head/sys/mips/mips/trap.c   Mon Jul 27 16:31:21 2020(r363616)
+++ head/sys/mips/mips/trap.c   Mon Jul 27 16:32:21 2020(r363617)
@@ -824,12 +824,12 @@ dofault:
 
i = SIGTRAP;
ucode = TRAP_BRKPT;
-   addr = trapframe->pc;
 
/* compute address of break instruction */
va = trapframe->pc;
if (DELAYBRANCH(trapframe->cause))
va += sizeof(int);
+   addr = va;
 
if (td->td_md.md_ss_addr != va)
break;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363616 - head/sys/geom/eli

2020-07-27 Thread John Baldwin
Author: jhb
Date: Mon Jul 27 16:31:21 2020
New Revision: 363616
URL: https://svnweb.freebsd.org/changeset/base/363616

Log:
  Fix indentation.

Modified:
  head/sys/geom/eli/g_eli_integrity.c
  head/sys/geom/eli/g_eli_privacy.c

Modified: head/sys/geom/eli/g_eli_integrity.c
==
--- head/sys/geom/eli/g_eli_integrity.c Mon Jul 27 16:29:21 2020
(r363615)
+++ head/sys/geom/eli/g_eli_integrity.c Mon Jul 27 16:31:21 2020
(r363616)
@@ -543,7 +543,7 @@ g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp
if (g_eli_ivlen(sc->sc_ealgo) != 0) {
crp->crp_flags |= CRYPTO_F_IV_SEPARATE;
g_eli_crypto_ivgen(sc, dstoff, crp->crp_iv,
-   sizeof(crp->crp_iv));
+   sizeof(crp->crp_iv));
}
 
g_eli_auth_keygen(sc, dstoff, authkey);

Modified: head/sys/geom/eli/g_eli_privacy.c
==
--- head/sys/geom/eli/g_eli_privacy.c   Mon Jul 27 16:29:21 2020
(r363615)
+++ head/sys/geom/eli/g_eli_privacy.c   Mon Jul 27 16:31:21 2020
(r363616)
@@ -288,7 +288,7 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio *
if (g_eli_ivlen(sc->sc_ealgo) != 0) {
crp->crp_flags |= CRYPTO_F_IV_SEPARATE;
g_eli_crypto_ivgen(sc, dstoff, crp->crp_iv,
-   sizeof(crp->crp_iv));
+   sizeof(crp->crp_iv));
}
 
error = crypto_dispatch(crp);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363615 - head/sys/arm/arm

2020-07-27 Thread John Baldwin
Author: jhb
Date: Mon Jul 27 16:29:21 2020
New Revision: 363615
URL: https://svnweb.freebsd.org/changeset/base/363615

Log:
  Set si_trapno to the fault index from fsr.
  
  Reviewed by:  kib
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25772

Modified:
  head/sys/arm/arm/trap-v6.c

Modified: head/sys/arm/arm/trap-v6.c
==
--- head/sys/arm/arm/trap-v6.c  Mon Jul 27 16:28:44 2020(r363614)
+++ head/sys/arm/arm/trap-v6.c  Mon Jul 27 16:29:21 2020(r363615)
@@ -169,7 +169,8 @@ static const struct abort aborts[] = {
 };
 
 static __inline void
-call_trapsignal(struct thread *td, int sig, int code, vm_offset_t addr)
+call_trapsignal(struct thread *td, int sig, int code, vm_offset_t addr,
+int trapno)
 {
ksiginfo_t ksi;
 
@@ -185,6 +186,7 @@ call_trapsignal(struct thread *td, int sig, int code, 
ksi.ksi_signo = sig;
ksi.ksi_code = code;
ksi.ksi_addr = (void *)addr;
+   ksi.ksi_trapno = trapno;
trapsignal(td, );
 }
 
@@ -252,7 +254,7 @@ abort_debug(struct trapframe *tf, u_int fsr, u_int pre
struct thread *td;
 
td = curthread;
-   call_trapsignal(td, SIGTRAP, TRAP_BRKPT, far);
+   call_trapsignal(td, SIGTRAP, TRAP_BRKPT, far, FAULT_DEBUG);
userret(td, tf);
} else {
 #ifdef KDB
@@ -523,7 +525,7 @@ nogo:
ksig.addr = far;
 
 do_trapsignal:
-   call_trapsignal(td, ksig.sig, ksig.code, ksig.addr);
+   call_trapsignal(td, ksig.sig, ksig.code, ksig.addr, idx);
 out:
if (usermode)
userret(td, tf);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363614 - head/sys/riscv/riscv

2020-07-27 Thread John Baldwin
Author: jhb
Date: Mon Jul 27 16:28:44 2020
New Revision: 363614
URL: https://svnweb.freebsd.org/changeset/base/363614

Log:
  Set si_trapno to the exception code from scause.
  
  Reviewed by:  kib
  Obtained from:CheriBSD
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25770

Modified:
  head/sys/riscv/riscv/trap.c

Modified: head/sys/riscv/riscv/trap.c
==
--- head/sys/riscv/riscv/trap.c Mon Jul 27 16:25:18 2020(r363613)
+++ head/sys/riscv/riscv/trap.c Mon Jul 27 16:28:44 2020(r363614)
@@ -80,7 +80,7 @@ void do_trap_supervisor(struct trapframe *);
 void do_trap_user(struct trapframe *);
 
 static __inline void
-call_trapsignal(struct thread *td, int sig, int code, void *addr)
+call_trapsignal(struct thread *td, int sig, int code, void *addr, int trapno)
 {
ksiginfo_t ksi;
 
@@ -88,6 +88,7 @@ call_trapsignal(struct thread *td, int sig, int code, 
ksi.ksi_signo = sig;
ksi.ksi_code = code;
ksi.ksi_addr = addr;
+   ksi.ksi_trapno = trapno;
trapsignal(td, );
 }
 
@@ -224,7 +225,8 @@ data_abort(struct trapframe *frame, int usermode)
error = vm_fault_trap(map, va, ftype, VM_FAULT_NORMAL, , );
if (error != KERN_SUCCESS) {
if (usermode) {
-   call_trapsignal(td, sig, ucode, (void *)stval);
+   call_trapsignal(td, sig, ucode, (void *)stval,
+   frame->tf_scause & EXCP_MASK);
} else {
if (pcb->pcb_onfault != 0) {
frame->tf_a[0] = error;
@@ -353,11 +355,13 @@ do_trap_user(struct trapframe *frame)
break;
}
 #endif
-   call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)frame->tf_sepc);
+   call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)frame->tf_sepc,
+   exception);
userret(td, frame);
break;
case EXCP_BREAKPOINT:
-   call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void 
*)frame->tf_sepc);
+   call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_sepc,
+   exception);
userret(td, frame);
break;
default:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363613 - head/sys/mips/mips

2020-07-27 Thread John Baldwin
Author: jhb
Date: Mon Jul 27 16:25:18 2020
New Revision: 363613
URL: https://svnweb.freebsd.org/changeset/base/363613

Log:
  Don't include T_USER in si_trapno reported to userland.
  
  Signals are only reported for user traps, so T_USER is redundant.  It
  is also a software convention and not included in the value reported
  by the hardware.
  
  Reviewed by:  kib
  Obtained from:CheriBSD
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25769

Modified:
  head/sys/mips/mips/trap.c

Modified: head/sys/mips/mips/trap.c
==
--- head/sys/mips/mips/trap.c   Mon Jul 27 15:34:07 2020(r363612)
+++ head/sys/mips/mips/trap.c   Mon Jul 27 16:25:18 2020(r363613)
@@ -1107,7 +1107,7 @@ err:
ksi.ksi_signo = i;
ksi.ksi_code = ucode;
ksi.ksi_addr = (void *)addr;
-   ksi.ksi_trapno = type;
+   ksi.ksi_trapno = type & ~T_USER;
trapsignal(td, );
 out:
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363611 - head/usr.bin/truncate

2020-07-27 Thread Fernando ApesteguĂ­a
Author: fernape (ports committer)
Date: Mon Jul 27 15:25:04 2020
New Revision: 363611
URL: https://svnweb.freebsd.org/changeset/base/363611

Log:
  truncate(1): Add EXAMPLES section
  
  Add four simple examples showing the use of -c, -r and -s
  
  Approved by:  manpages (bcr@)
  Differential Revision: https://reviews.freebsd.org/D25774

Modified:
  head/usr.bin/truncate/truncate.1

Modified: head/usr.bin/truncate/truncate.1
==
--- head/usr.bin/truncate/truncate.1Mon Jul 27 15:09:07 2020
(r363610)
+++ head/usr.bin/truncate/truncate.1Mon Jul 27 15:25:04 2020
(r363611)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 19, 2006
+.Dd July 27, 2020
 .Dt TRUNCATE 1
 .Os
 .Sh NAME
@@ -143,6 +143,43 @@ If the operation fails for an argument,
 .Nm
 will issue a diagnostic
 and continue processing the remaining arguments.
+.Sh EXAMPLES
+Adjust the size of the file
+.Pa test_file
+to 10 Megabytes but do not create it if it does not exist:
+.Bd -literal -offset indent
+truncate -c -s +10M test_file
+.Ed
+.Pp
+Same as above but create the file if it does not exist:
+.Bd -literal -offset indent
+truncate -s +10M test_file
+ls -l test_file
+-rw-r--r--  1 root  wheel  10485760 Jul 22 18:48 test_file
+.Ed
+.Pp
+Adjust the size of
+.Pa test_file
+to the size of the kernel and create another file
+.Pa test_file2
+with the same size:
+.Bd -literal -offset indent
+truncate -r /boot/kernel/kernel test_file test_file2
+ls -l /boot/kernel/kernel test_file*
+-r-xr-xr-x  1 root  wheel31352552 May 15 14:18 /boot/kernel/kernel*
+-rw-r--r--  1 root  wheel31352552 Jul 22 19:15 test_file
+-rw-r--r--  1 root  wheel31352552 Jul 22 19:15 test_file2
+.Ed
+.Pp
+Downsize
+.Pa test_file
+in 5 Megabytes:
+.Bd -literal -offset indent
+# truncate -s -5M test_file
+ls -l test_file*
+-rw-r--r--  1 root  wheel26109672 Jul 22 19:17 test_file
+-rw-r--r--  1 root  wheel31352552 Jul 22 19:15 test_file2
+.Ed
 .Sh SEE ALSO
 .Xr dd 1 ,
 .Xr touch 1 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363608 - in head/sys/dev: mpr mps

2020-07-27 Thread Mark Johnston
Author: markj
Date: Mon Jul 27 14:28:55 2020
New Revision: 363608
URL: https://svnweb.freebsd.org/changeset/base/363608

Log:
  mpr(4), mps(4): Stop checking for failures from malloc(M_WAITOK).
  
  PR:   240545
  Submitted by: Andrew Reiter 
  Reviewed by:  imp
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D25766

Modified:
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_user.c
  head/sys/dev/mps/mps.c
  head/sys/dev/mps/mps_sas.c
  head/sys/dev/mps/mps_user.c

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Mon Jul 27 14:25:10 2020(r363607)
+++ head/sys/dev/mpr/mpr.c  Mon Jul 27 14:28:55 2020(r363608)
@@ -1529,10 +1529,6 @@ mpr_alloc_requests(struct mpr_softc *sc)
 */
sc->commands = malloc(sizeof(struct mpr_command) * sc->num_reqs,
M_MPR, M_WAITOK | M_ZERO);
-   if (!sc->commands) {
-   mpr_dprint(sc, MPR_ERROR, "Cannot allocate command memory\n");
-   return (ENOMEM);
-   }
for (i = 1; i < sc->num_reqs; i++) {
cm = >commands[i];
cm->cm_req = sc->req_frames + i * sc->reqframesz;
@@ -2684,11 +2680,6 @@ mpr_register_events(struct mpr_softc *sc, uint8_t *mas
int error = 0;
 
eh = malloc(sizeof(struct mpr_event_handle), M_MPR, M_WAITOK|M_ZERO);
-   if (!eh) {
-   mpr_dprint(sc, MPR_EVENT|MPR_ERROR,
-   "Cannot allocate event memory\n");
-   return (ENOMEM);
-   }
eh->callback = cb;
eh->data = data;
TAILQ_INSERT_TAIL(>event_list, eh, eh_list);

Modified: head/sys/dev/mpr/mpr_sas.c
==
--- head/sys/dev/mpr/mpr_sas.c  Mon Jul 27 14:25:10 2020(r363607)
+++ head/sys/dev/mpr/mpr_sas.c  Mon Jul 27 14:28:55 2020(r363608)
@@ -736,11 +736,6 @@ mpr_attach_sas(struct mpr_softc *sc)
mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__);
 
sassc = malloc(sizeof(struct mprsas_softc), M_MPR, M_WAITOK|M_ZERO);
-   if (!sassc) {
-   mpr_dprint(sc, MPR_INIT|MPR_ERROR,
-   "Cannot allocate SAS subsystem memory\n");
-   return (ENOMEM);
-   }
 
/*
 * XXX MaxTargets could change during a reinit.  Since we don't
@@ -751,12 +746,6 @@ mpr_attach_sas(struct mpr_softc *sc)
sassc->maxtargets = sc->facts->MaxTargets + sc->facts->MaxVolumes;
sassc->targets = malloc(sizeof(struct mprsas_target) *
sassc->maxtargets, M_MPR, M_WAITOK|M_ZERO);
-   if (!sassc->targets) {
-   mpr_dprint(sc, MPR_INIT|MPR_ERROR,
-   "Cannot allocate SAS target memory\n");
-   free(sassc, M_MPR);
-   return (ENOMEM);
-   }
sc->sassc = sassc;
sassc->sc = sc;
 
@@ -3556,8 +3545,4 @@ mprsas_realloc_targets(struct mpr_softc *sc, int maxta
 
sassc->targets = malloc(sizeof(struct mprsas_target) * maxtargets,
M_MPR, M_WAITOK|M_ZERO);
-   if (!sassc->targets) {
-   panic("%s failed to alloc targets with error %d\n",
-   __func__, ENOMEM);
-   }
 }

Modified: head/sys/dev/mpr/mpr_user.c
==
--- head/sys/dev/mpr/mpr_user.c Mon Jul 27 14:25:10 2020(r363607)
+++ head/sys/dev/mpr/mpr_user.c Mon Jul 27 14:28:55 2020(r363608)
@@ -1528,13 +1528,6 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re
bzero(sc->fw_diag_buffer, buffer_size);
 
ctx = malloc(sizeof(*ctx), M_MPR, M_WAITOK | M_ZERO);
-   if (ctx == NULL) {
-   device_printf(sc->mpr_dev, "%s: context malloc failed\n",
-   __func__);
-   *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER;
-   status = MPR_DIAG_FAILURE;
-   goto bailout;
-   }
ctx->addr = >fw_diag_busaddr;
ctx->buffer_dmat = sc->fw_diag_dmat;
ctx->buffer_dmamap = sc->fw_diag_map;

Modified: head/sys/dev/mps/mps.c
==
--- head/sys/dev/mps/mps.c  Mon Jul 27 14:25:10 2020(r363607)
+++ head/sys/dev/mps/mps.c  Mon Jul 27 14:28:55 2020(r363608)
@@ -1520,10 +1520,6 @@ mps_alloc_requests(struct mps_softc *sc)
 */
sc->commands = malloc(sizeof(struct mps_command) * sc->num_reqs,
M_MPT2, M_WAITOK | M_ZERO);
-   if(!sc->commands) {
-   mps_dprint(sc, MPS_ERROR, "Cannot allocate command memory\n");
-   return (ENOMEM);
-   }
for (i = 1; i < sc->num_reqs; i++) {
cm = >commands[i];
cm->cm_req = sc->req_frames + i * sc->reqframesz;
@@ -2598,10 +2594,6 @@ mps_register_events(struct 

svn commit: r363607 - head/sys/vm

2020-07-27 Thread Mark Johnston
Author: markj
Date: Mon Jul 27 14:25:10 2020
New Revision: 363607
URL: https://svnweb.freebsd.org/changeset/base/363607

Log:
  vm_page_free_invalid(): Relax the xbusy assertion.
  
  vm_page_assert_xbusied() asserts that the busying thread is the current
  thread.  For some uses of vm_page_free_invalid() (e.g., error handling
  in vnode_pager_generic_getpages_done()), this condition might not hold.
  
  Reported by:  Jenkins via trasz
  Reviewed by:  chs, kib
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25828

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Mon Jul 27 14:16:27 2020(r363606)
+++ head/sys/vm/vm_page.c   Mon Jul 27 14:25:10 2020(r363607)
@@ -1371,9 +1371,14 @@ vm_page_free_invalid(vm_page_t m)
 
KASSERT(vm_page_none_valid(m), ("page %p is valid", m));
KASSERT(!pmap_page_is_mapped(m), ("page %p is mapped", m));
-   vm_page_assert_xbusied(m);
KASSERT(m->object != NULL, ("page %p has no object", m));
VM_OBJECT_ASSERT_WLOCKED(m->object);
+
+   /*
+* We may be attempting to free the page as part of the handling for an
+* I/O error, in which case the page was xbusied by a different thread.
+*/
+   vm_page_xbusy_claim(m);
 
/*
 * If someone has wired this page while the object lock
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363599 - head/share/man/man3

2020-07-27 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Mon Jul 27 11:42:22 2020
New Revision: 363599
URL: https://svnweb.freebsd.org/changeset/base/363599

Log:
  tree.3: Bump date after 363450 (WAVL)
  
  While here:
  - Address whitespace warnings.
  - Start sentences on a new line.

Modified:
  head/share/man/man3/tree.3

Modified: head/share/man/man3/tree.3
==
--- head/share/man/man3/tree.3  Mon Jul 27 10:45:47 2020(r363598)
+++ head/share/man/man3/tree.3  Mon Jul 27 11:42:22 2020(r363599)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 25, 2020
+.Dd July 27, 2020
 .Dt TREE 3
 .Os
 .Sh NAME
@@ -371,7 +371,7 @@ Each tree node has an associated rank.
 Balance conditions are expressed by conditions on the differences in
 rank between any node and its children.
 Rank differences are stored in each tree node.
-.Pp  
+.Pp
 The balance conditions implemented by the RB macros lead to weak AVL
 (wavl) trees, which combine the best aspects of AVL and red-black
 trees.
@@ -380,7 +380,8 @@ with the same worst-case time as red-black trees offer
 better balance in the resulting tree.
 Wavl trees rebalance after a removal in a way that requires less
 restructuring, in the worst case, than either AVL or red-black trees
-do.  Removals can lead to a tree almost as unbalanced as a red-black
+do.
+Removals can lead to a tree almost as unbalanced as a red-black
 tree; insertions lead to a tree becoming as balanced as an AVL tree.
 .Pp
 A rank-balanced tree is headed by a structure defined by the
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363598 - head/usr.sbin/nologin

2020-07-27 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Mon Jul 27 10:45:47 2020
New Revision: 363598
URL: https://svnweb.freebsd.org/changeset/base/363598

Log:
  nologin.8: Improve wording
  
  Reported by:  yuripv
  Reviewed by:  bcr, yuripv
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D25814

Modified:
  head/usr.sbin/nologin/nologin.8

Modified: head/usr.sbin/nologin/nologin.8
==
--- head/usr.sbin/nologin/nologin.8 Mon Jul 27 09:10:02 2020
(r363597)
+++ head/usr.sbin/nologin/nologin.8 Mon Jul 27 10:45:47 2020
(r363598)
@@ -44,7 +44,7 @@ have been disabled.
 .Pp
 When executed,
 .Nm
-first writes about the login attempt to
+first logs about the login attempt using
 .Xr syslog 3
 and then displays a message that an account is not available.
 .Pp
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r363595 - head/sys/kern

2020-07-27 Thread Ronald Klop

Hi,

Helpful addition. Might it help people more to make the message point to the 
replacement of the deprecated functionality?

Regards,
Ronald.


Van: Kyle Evans 
Datum: maandag, 27 juli 2020 05:13
Aan: src-committ...@freebsd.org, svn-src-...@freebsd.org, 
svn-src-head@freebsd.org
Onderwerp: svn commit: r363595 - head/sys/kern


Author: kevans
Date: Mon Jul 27 03:13:23 2020
New Revision: 363595
URL: https://svnweb.freebsd.org/changeset/base/363595

Log:
  makesyscalls.sh: spit out a deprecation notice to stderr
  
  This has for a while been replaced by makesyscalls.lua in the stock FreeBSD

  build.  Ensure downstreams get some notice that it'a going away if they're
  reliant on it, maybe.

Modified:
  head/sys/kern/makesyscalls.sh

Modified: head/sys/kern/makesyscalls.sh
==
--- head/sys/kern/makesyscalls.sh   Mon Jul 27 01:53:27 2020(r363594)
+++ head/sys/kern/makesyscalls.sh   Mon Jul 27 03:13:23 2020(r363595)
@@ -60,6 +60,8 @@ case $# in
;;
 esac
 
+1>&2 echo "$0: This script is deprecated and will be removed before FreeBSD 13."

+
 if [ -n "$2" ]; then
. "$2"
 fi
___
svn-src-...@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"




___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363597 - head/sys/arm/allwinner/clkng

2020-07-27 Thread Andriy Gapon
Author: avg
Date: Mon Jul 27 09:10:02 2020
New Revision: 363597
URL: https://svnweb.freebsd.org/changeset/base/363597

Log:
  actually enable gate control for allwinner's r-ccu ir clock
  
  The gate control bit offset was correctly specified, but AW_CLK_HAS_GATE
  flag was not set.
  Tested with (C)IR receiver on Orange Pi PC Plus.
  
  Reviewed by:  manu
  MFC after:1 week

Modified:
  head/sys/arm/allwinner/clkng/ccu_sun8i_r.c

Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c
==
--- head/sys/arm/allwinner/clkng/ccu_sun8i_r.c  Mon Jul 27 07:56:55 2020
(r363596)
+++ head/sys/arm/allwinner/clkng/ccu_sun8i_r.c  Mon Jul 27 09:10:02 2020
(r363597)
@@ -122,7 +122,7 @@ NM_CLK(r_ccu_ir_clk,
 16, 2, 0, 0,   /* M flags */
 24, 2, /* mux */
 31,/* gate */
-AW_CLK_HAS_MUX | AW_CLK_REPARENT); /* flags */
+AW_CLK_HAS_MUX | AW_CLK_REPARENT | AW_CLK_HAS_GATE);/* flags */
 
 static const char *a83t_ir_parents[] = {"osc16M", "osc24M"};
 static struct aw_clk_nm_def a83t_ir_clk = {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r363382 - head/sys/dev/gpio

2020-07-27 Thread Andriy Gapon
On 21/07/2020 10:35, Andriy Gapon wrote:
> Author: avg
> Date: Tue Jul 21 07:35:03 2020
> New Revision: 363382
> URL: https://svnweb.freebsd.org/changeset/base/363382
> 
> Log:
>   gpioiic: never drive lines active high
>   
>   I2C communication is done by a combination of driving a line low or
>   letting it float, so that it is either pulled up or driven low by
>   another party.
>   
>   r355276 besides the stated goal of the change -- using the new GPIO API
>   -- also changed the logic, so that active state is signaled by actively
>   driving a line.

Actually, the code was not incorrect.
Ian pointed out something that I overlooked.
The driver configures I2C pins as GPIO_PIN_OPENDRAIN and that alone should have
ensured the correct behavior of setting active and inactive output states (that
is, active == hi-Z).
The real problem is that only a few drivers implement or emulate that
configuration bit.  Far from all hardware provides that option natively too.

>   That worked with iicbb prior to r362042, but stopped working after that
>   commit on at least some hardware.  My guess that the breakage was
>   related to getting an ACK bit.  A device expected to be able to drive
>   SDA actively low, but controller was actively driving it high for some
>   time.
>   
>   Anyway, this change seems to fix the problem.
>   Tested using gpioiic on Orange Pi PC Plus with HTU21 sensor.
>   
>   Reported by:Nick Kostirya 
>   Reviewed by:manu
>   MFC after:  1 week
>   Differential Revision: https://reviews.freebsd.org/D25684
> 
> Modified:
>   head/sys/dev/gpio/gpioiic.c
> 
> Modified: head/sys/dev/gpio/gpioiic.c
> ==
> --- head/sys/dev/gpio/gpioiic.c   Mon Jul 20 23:57:53 2020
> (r363381)
> +++ head/sys/dev/gpio/gpioiic.c   Tue Jul 21 07:35:03 2020
> (r363382)
> @@ -191,16 +191,14 @@ static void
>  gpioiic_setsda(device_t dev, int val)
>  {
>   struct gpioiic_softc *sc = device_get_softc(dev);
> - int err;
>  
> - /*
> -  * Some controllers cannot set an output value while a pin is in input
> -  * mode; in that case we set the pin again after changing mode.
> -  */
> - err = gpio_pin_set_active(sc->sdapin, val);
> - gpio_pin_setflags(sc->sdapin, GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
> - if (err != 0)
> - gpio_pin_set_active(sc->sdapin, val);
> + if (val) {
> + gpio_pin_setflags(sc->sdapin, GPIO_PIN_INPUT);
> + } else {
> + gpio_pin_setflags(sc->sdapin,
> + GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
> + gpio_pin_set_active(sc->sdapin, 0);
> + }
>  }
>  
>  static void
> @@ -208,8 +206,13 @@ gpioiic_setscl(device_t dev, int val)
>  {
>   struct gpioiic_softc *sc = device_get_softc(dev);
>  
> - gpio_pin_setflags(sc->sclpin, GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
> - gpio_pin_set_active(sc->sclpin, val);
> + if (val) {
> + gpio_pin_setflags(sc->sclpin, GPIO_PIN_INPUT);
> + } else {
> + gpio_pin_setflags(sc->sclpin,
> + GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
> + gpio_pin_set_active(sc->sclpin, 0);
> + }
>  }
>  
>  static int
> 


-- 
Andriy Gapon
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r363596 - head/usr.sbin/bhyve

2020-07-27 Thread Peter Grehan
Author: grehan
Date: Mon Jul 27 07:56:55 2020
New Revision: 363596
URL: https://svnweb.freebsd.org/changeset/base/363596

Log:
  Support the setting of additional AHCI controller parameters.
  
  Allow the serial number, firmware revision, model number and nominal media
  rotation rate (nmrr) parameters to be set from the command line.
  
  Note that setting the nmrr value can be   used to indicate the AHCI
  device is an SSD.
  
  Submitted by: Wanpeng Qian
  Reviewed by:  jhb, grehan (#bhyve)
  Approved by:  jhb, grehan
  MFC after:3 weeks
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D24174

Modified:
  head/usr.sbin/bhyve/bhyve.8
  head/usr.sbin/bhyve/pci_ahci.c

Modified: head/usr.sbin/bhyve/bhyve.8
==
--- head/usr.sbin/bhyve/bhyve.8 Mon Jul 27 03:13:23 2020(r363595)
+++ head/usr.sbin/bhyve/bhyve.8 Mon Jul 27 07:56:55 2020(r363596)
@@ -540,6 +540,18 @@ Sector size (defaults to blockif sector size).
 Serial number with maximum 20 characters.
 .El
 .Pp
+AHCI devices:
+.Bl -tag -width 10n
+.It Li nmrr
+Nominal Media Rotation Rate, known as RPM. value 1 will indicate device as 
Solid State Disk. default value is 0, not report.
+.It Li ser
+Serial Number with maximum 20 characters.
+.It Li rev
+Revision Number with maximum 8 characters.
+.It Li model
+Model Number with maximum 40 characters.
+.El
+.Pp
 HD Audio devices:
 .Bl -tag -width 10n
 .It Li play

Modified: head/usr.sbin/bhyve/pci_ahci.c
==
--- head/usr.sbin/bhyve/pci_ahci.c  Mon Jul 27 03:13:23 2020
(r363595)
+++ head/usr.sbin/bhyve/pci_ahci.c  Mon Jul 27 07:56:55 2020
(r363596)
@@ -139,9 +139,9 @@ struct ahci_ioreq {
 struct ahci_port {
struct blockif_ctxt *bctx;
struct pci_ahci_softc *pr_sc;
+   struct ata_params ata_ident;
uint8_t *cmd_lst;
uint8_t *rfis;
-   char ident[AHCI_PORT_IDENT];
int port;
int atapi;
int reset;
@@ -987,7 +987,49 @@ handle_identify(struct ahci_port *p, int slot, uint8_t
ahci_write_fis_d2h(p, slot, cfis,
(ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR);
} else {
-   uint16_t buf[256];
+   ahci_write_fis_piosetup(p);
+   write_prdt(p, slot, cfis, (void*)>ata_ident, sizeof(struct 
ata_params));
+   ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY);
+   }
+}
+
+static void
+ata_identify_init(struct ahci_port* p, int atapi)
+{
+   struct ata_params* ata_ident = >ata_ident;
+
+   if (atapi) {
+   ata_ident->config = (2 << 14 | 5 << 8 | 1 << 7 | 2 << 5);
+   ata_ident->capabilities1 = ATA_SUPPORT_LBA |
+   ATA_SUPPORT_DMA;
+   ata_ident->capabilities2 = (1 << 14 | 1);
+   ata_ident->atavalid = ATA_FLAG_54_58 | ATA_FLAG_64_70;
+   ata_ident->obsolete62 = 0x3f;
+   ata_ident->mwdmamodes = 7;
+   if (p->xfermode & ATA_WDMA0)
+   ata_ident->mwdmamodes |= (1 << ((p->xfermode & 7) + 8));
+   ata_ident->apiomodes = 3;
+   ata_ident->mwdmamin = 0x0078;
+   ata_ident->mwdmarec = 0x0078;
+   ata_ident->pioblind = 0x0078;
+   ata_ident->pioiordy = 0x0078;
+   ata_ident->satacapabilities = (ATA_SATA_GEN1 | ATA_SATA_GEN2 | 
ATA_SATA_GEN3);
+   ata_ident->satacapabilities2 = ((p->ssts & ATA_SS_SPD_MASK) >> 
3);
+   ata_ident->satasupport = ATA_SUPPORT_NCQ_STREAM;
+   ata_ident->version_major = 0x3f0;
+   ata_ident->support.command1 = (ATA_SUPPORT_POWERMGT | 
ATA_SUPPORT_PACKET |
+   ATA_SUPPORT_RESET | ATA_SUPPORT_NOP);
+   ata_ident->support.command2 = (1 << 14);
+   ata_ident->support.extension = (1 << 14);
+   ata_ident->enabled.command1 = (ATA_SUPPORT_POWERMGT | 
ATA_SUPPORT_PACKET |
+   ATA_SUPPORT_RESET | ATA_SUPPORT_NOP);
+   ata_ident->enabled.extension = (1 << 14);
+   ata_ident->udmamodes = 0x7f;
+   if (p->xfermode & ATA_UDMA0)
+   ata_ident->udmamodes |= (1 << ((p->xfermode & 7) + 8));
+   ata_ident->transport_major = 0x1020;
+   ata_ident->integrity = 0x00a5;
+   } else {
uint64_t sectors;
int sectsz, psectsz, psectoff, candelete, ro;
uint16_t cyl;
@@ -999,87 +1041,85 @@ handle_identify(struct ahci_port *p, int slot, uint8_t
sectors = blockif_size(p->bctx) / sectsz;
blockif_chs(p->bctx, , , );
blockif_psectsz(p->bctx, , );
-   memset(buf, 0, sizeof(buf));
-   buf[0] = 0x0040;
-   buf[1] = cyl;
-