Re: svn commit: r358348 - in head/lib/libc: . gdtoa gen sparc64 sparc64/fpu sparc64/gen sparc64/sys sys

2020-02-26 Thread Warner Losh
On Wed, Feb 26, 2020, 9:36 PM Pedro Giffuni  wrote:

>
> On 26/02/2020 18:09, Warner Losh wrote:
>
>
>
> On Wed, Feb 26, 2020 at 3:47 PM Warner Losh  wrote:
>
>>
>>
>> On Wed, Feb 26, 2020 at 12:10 PM Bjoern A. Zeeb <
>> bzeeb-li...@lists.zabbadoz.net> wrote:
>>
>>> On 26 Feb 2020, at 18:55, Warner Losh wrote:
>>>
>>> > Author: imp
>>> > Date: Wed Feb 26 18:55:09 2020
>>> > New Revision: 358348
>>> > URL: https://svnweb.freebsd.org/changeset/base/358348
>>> >
>>> > Log:
>>> >   Remove sparc64 specific parts of libc.
>>>
>>> I have a silly question for which it’s long been too late, but for the
>>> next time .. why do we need a gazillion of commits to remove sparc64
>>> rather than 1 “atomic” one (or maybe 2 in case the one missed a bit)
>>> to remove it all (which would also allow other people to bring it back
>>> into private trees a lot more easily compared to tracking changes over
>>> weeks)?
>>>
>>
>> One atomic commit is harder and more work for me.
>>
>> It's hard to get all the details right before pushing it. It's hard to
>> develop it as other things in the tree change things which leads to more
>> conflicts. It can be hard to MFC around (though these changes won't be
>> MFC'd having too large a commit around them may generate more conflicts
>> when those things are MFC'd). So I optimized for my convenience, not others
>> wishing to import it into their trees. But I'd contend that the delta as
>> far as bringing back as 10 commits isn't onerous for such a niche demand.
>>
>
> Also, if I screw something up, it's easier to back out smaller commits
> should that be necessary. Backing out huge commits that remove lots of
> things and then reapplying them is tedious and error-prone. Doing it a
> little at a time also allows me to make sure that all the CI stuff works
> before moving on to the next step.
>
> We should/could nevertheless, track the removal process in some PR, or in
> the Wiki, to make life easier to whomever hero wants to resurrect the
> changes (not that I see that happening)
>
Go for it. Since I don't see anybody doing it either, I view it as wasted
work. Git log can dig this out easily enough, though.

Warner

>
___
svn-src-all@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 commit: r358366 - head/sys/cam/ata

2020-02-26 Thread Scott Long
Author: scottl
Date: Thu Feb 27 05:00:21 2020
New Revision: 358366
URL: https://svnweb.freebsd.org/changeset/base/358366

Log:
  Add a quirk for the WDC Green series of SSDs to disable NCQ TRIM, as this
  avoids silent data corruption.
  
  PR:   225666
  Submitted by: anders lundgren
  MFC after:3 days

Modified:
  head/sys/cam/ata/ata_da.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Thu Feb 27 04:47:12 2020(r358365)
+++ head/sys/cam/ata/ata_da.c   Thu Feb 27 05:00:21 2020(r358366)
@@ -786,6 +786,11 @@ static struct ada_quirk_entry ada_quirk_table[] =
/*quirks*/ADA_Q_SMR_DM
},
{
+   /* WD Green SSD */
+   { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WDS?G0*", "*" },
+   /*quirks*/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN
+   },
+   {
/* Default */
{
  T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED,
___
svn-src-all@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 commit: r358365 - in head: lib/libc/sparc64 lib/msun/sparc64 stand/ficl/sparc64 stand/libsa/sparc64 stand/sparc64

2020-02-26 Thread Warner Losh
Author: imp
Date: Thu Feb 27 04:47:12 2020
New Revision: 358365
URL: https://svnweb.freebsd.org/changeset/base/358365

Log:
  Remove now empty sparc64 directories (oh, and stand/sparc64 files)

Deleted:
  head/lib/libc/sparc64/
  head/lib/msun/sparc64/
  head/stand/ficl/sparc64/
  head/stand/libsa/sparc64/
  head/stand/sparc64/
___
svn-src-all@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 commit: r358364 - in head: lib/csu/sparc64 lib/libthr/arch/sparc64 lib/libthread_db/arch/sparc64 tools/test/testfloat/sparc64

2020-02-26 Thread Warner Losh
Author: imp
Date: Thu Feb 27 04:44:58 2020
New Revision: 358364
URL: https://svnweb.freebsd.org/changeset/base/358364

Log:
  Remove libthr, csu, libthread_db and testfloat sparc64 specific directories.
  
  Submitted by: kib@ (libthr)

Deleted:
  head/lib/csu/sparc64/
  head/lib/libthr/arch/sparc64/
  head/lib/libthread_db/arch/sparc64/
  head/tools/test/testfloat/sparc64/
___
svn-src-all@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"


Re: svn commit: r358348 - in head/lib/libc: . gdtoa gen sparc64 sparc64/fpu sparc64/gen sparc64/sys sys

2020-02-26 Thread Pedro Giffuni


On 26/02/2020 18:09, Warner Losh wrote:



On Wed, Feb 26, 2020 at 3:47 PM Warner Losh > wrote:




On Wed, Feb 26, 2020 at 12:10 PM Bjoern A. Zeeb
mailto:bzeeb-li...@lists.zabbadoz.net>> wrote:

On 26 Feb 2020, at 18:55, Warner Losh wrote:

> Author: imp
> Date: Wed Feb 26 18:55:09 2020
> New Revision: 358348
> URL: https://svnweb.freebsd.org/changeset/base/358348
>
> Log:
>   Remove sparc64 specific parts of libc.

I have a silly question for which it’s long been too late, but
for the
next time .. why do we need a gazillion of commits to remove
sparc64
rather than 1 “atomic” one (or maybe 2 in case the one missed
a bit)
to remove it all (which would also allow other people to bring
it back
into private trees a lot more easily compared to tracking
changes over
weeks)?


One atomic commit is harder and more work for me.

It's hard to get all the details right before pushing it. It's
hard to develop it as other things in the tree change things which
leads to more conflicts. It can be hard to MFC around (though
these changes won't be MFC'd having too large a commit around them
may generate more conflicts when those things are MFC'd). So I
optimized for my convenience, not others wishing to import it into
their trees. But I'd contend that the delta as far as bringing
back as 10 commits isn't onerous for such a niche demand.


Also, if I screw something up, it's easier to back out smaller commits 
should that be necessary. Backing out huge commits that remove lots of 
things and then reapplying them is tedious and error-prone. Doing it a 
little at a time also allows me to make sure that all the CI stuff 
works before moving on to the next step.


We should/could nevertheless, track the removal process in some PR, or 
in the Wiki, to make life easier to whomever hero wants to resurrect the 
changes (not that I see that happening).


Pedro.


___
svn-src-all@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 commit: r358363 - head/sys/vm

2020-02-26 Thread Jeff Roberson
Author: jeff
Date: Thu Feb 27 02:37:27 2020
New Revision: 358363
URL: https://svnweb.freebsd.org/changeset/base/358363

Log:
  Add unlocked grab* function variants that use lockless radix code to
  lookup pages.  These variants will fall back to their locked counterparts
  if the page is not present.
  
  Discussed with:   kib, markj
  Differential Revision:https://reviews.freebsd.org/D23449

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Thu Feb 27 00:57:36 2020(r358362)
+++ head/sys/vm/vm_page.c   Thu Feb 27 02:37:27 2020(r358363)
@@ -830,47 +830,39 @@ vm_page_reference(vm_page_t m)
vm_page_aflag_set(m, PGA_REFERENCED);
 }
 
+/*
+ * vm_page_trybusy
+ *
+ * Helper routine for grab functions to trylock busy.
+ *
+ * Returns true on success and false on failure.
+ */
 static bool
-vm_page_acquire_flags(vm_page_t m, int allocflags)
+vm_page_trybusy(vm_page_t m, int allocflags)
 {
-   bool locked;
 
if ((allocflags & (VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY)) != 0)
-   locked = vm_page_trysbusy(m);
+   return (vm_page_trysbusy(m));
else
-   locked = vm_page_tryxbusy(m);
-   if (locked && (allocflags & VM_ALLOC_WIRED) != 0)
-   vm_page_wire(m);
-   return (locked);
+   return (vm_page_tryxbusy(m));
 }
 
 /*
- * vm_page_busy_sleep_flags
+ * vm_page_tryacquire
  *
- * Sleep for busy according to VM_ALLOC_ parameters.  Returns true
- * if the caller should retry and false otherwise.
+ * Helper routine for grab functions to trylock busy and wire.
+ *
+ * Returns true on success and false on failure.
  */
-static bool
-vm_page_busy_sleep_flags(vm_object_t object, vm_page_t m, const char *wmesg,
-int allocflags)
+static inline bool
+vm_page_tryacquire(vm_page_t m, int allocflags)
 {
+   bool locked;
 
-   if ((allocflags & VM_ALLOC_NOWAIT) != 0)
-   return (false);
-
-   /*
-* Reference the page before unlocking and sleeping so that
-* the page daemon is less likely to reclaim it.
-*/
-   if ((allocflags & VM_ALLOC_NOCREAT) == 0)
-   vm_page_reference(m);
-
-   if (_vm_page_busy_sleep(object, m, m->pindex, wmesg, allocflags, true))
-   VM_OBJECT_WLOCK(object);
-   if ((allocflags & VM_ALLOC_WAITFAIL) != 0)
-   return (false);
-
-   return (true);
+   locked = vm_page_trybusy(m, allocflags);
+   if (locked && (allocflags & VM_ALLOC_WIRED) != 0)
+   vm_page_wire(m);
+   return (locked);
 }
 
 /*
@@ -894,7 +886,7 @@ vm_page_busy_acquire(vm_page_t m, int allocflags)
 */
obj = m->object;
for (;;) {
-   if (vm_page_acquire_flags(m, allocflags))
+   if (vm_page_tryacquire(m, allocflags))
return (true);
if ((allocflags & VM_ALLOC_NOWAIT) != 0)
return (false);
@@ -1604,6 +1596,7 @@ vm_page_object_remove(vm_page_t m)
if ((m->a.flags & PGA_SWAP_FREE) != 0)
vm_pager_page_unswapped(m);
 
+   m->object = NULL;
mrem = vm_radix_remove(>rtree, m->pindex);
KASSERT(mrem == m, ("removed page %p, expected page %p", mrem, m));
 
@@ -1658,7 +1651,6 @@ vm_page_remove_xbusy(vm_page_t m)
 {
 
vm_page_object_remove(m);
-   m->object = NULL;
return (vm_page_drop(m, VPRC_OBJREF) == VPRC_OBJREF);
 }
 
@@ -1679,6 +1671,38 @@ vm_page_lookup(vm_object_t object, vm_pindex_t pindex)
 }
 
 /*
+ * This should only be used by lockless functions for releasing transient
+ * incorrect acquires.  The page may have been freed after we acquired a
+ * busy lock.  In this case busy_lock == VPB_FREED and we have nothing
+ * further to do.
+ */
+static void
+vm_page_busy_release(vm_page_t m)
+{
+   u_int x;
+
+   x = atomic_load_int(>busy_lock);
+   for (;;) {
+   if (x == VPB_FREED)
+   break;
+   if ((x & VPB_BIT_SHARED) != 0 && VPB_SHARERS(x) > 1) {
+   if (atomic_fcmpset_int(>busy_lock, ,
+   x - VPB_ONE_SHARER))
+   break;
+   continue;
+   }
+   KASSERT((x & VPB_BIT_SHARED) != 0 ||
+   (x & ~VPB_BIT_WAITERS) == VPB_CURTHREAD_EXCLUSIVE,
+   ("vm_page_busy_release: %p xbusy not owned.", m));
+   if (!atomic_fcmpset_rel_int(>busy_lock, , VPB_UNBUSIED))
+   continue;
+   if ((x & VPB_BIT_WAITERS) != 0)
+   wakeup(m);
+   break;
+   }
+}
+
+/*
  * vm_page_find_least:
  *
  * Returns the page associated with the object with least pindex
@@ -3688,7 +3712,6 @@ 

svn commit: r358362 - stable/11/usr.sbin/pciconf

2020-02-26 Thread Konstantin Belousov
Author: kib
Date: Thu Feb 27 00:57:36 2020
New Revision: 358362
URL: https://svnweb.freebsd.org/changeset/base/358362

Log:
  MFC r358175:
  Print out some newly added PCIe extended capabilities and subclasses.

Modified:
  stable/11/usr.sbin/pciconf/cap.c
  stable/11/usr.sbin/pciconf/pciconf.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/pciconf/cap.c
==
--- stable/11/usr.sbin/pciconf/cap.cThu Feb 27 00:57:02 2020
(r358361)
+++ stable/11/usr.sbin/pciconf/cap.cThu Feb 27 00:57:36 2020
(r358362)
@@ -979,6 +979,20 @@ static struct {
{ PCIZ_LN_REQ, "LN Requester" },
{ PCIZ_DPC, "Downstream Port Containment" },
{ PCIZ_L1PM, "L1 PM Substates" },
+   { PCIZ_PTM, "Precision Time Measurement" },
+   { PCIZ_M_PCIE, "PCIe over M-PHY" },
+   { PCIZ_FRS, "FRS Queuing" },
+   { PCIZ_RTR, "Readiness Time Reporting" },
+   { PCIZ_DVSEC, "Designated Vendor-Specific" },
+   { PCIZ_VF_REBAR, "VF Resizable BAR" },
+   { PCIZ_DLNK, "Data Link Feature" },
+   { PCIZ_16GT, "Physical Layer 16.0 GT/s" },
+   { PCIZ_LMR, "Lane Margining at Receiver" },
+   { PCIZ_HIER_ID, "Hierarchy ID" },
+   { PCIZ_NPEM, "Native PCIe Enclosure Management" },
+   { PCIZ_PL32, "Physical Layer 32.0 GT/s" },
+   { PCIZ_AP, "Alternate Protocol" },
+   { PCIZ_SFI, "System Firmware Intermediary" },
{ 0, NULL }
 };
 

Modified: stable/11/usr.sbin/pciconf/pciconf.c
==
--- stable/11/usr.sbin/pciconf/pciconf.cThu Feb 27 00:57:02 2020
(r358361)
+++ stable/11/usr.sbin/pciconf/pciconf.cThu Feb 27 00:57:36 2020
(r358362)
@@ -625,12 +625,17 @@ static struct
{PCIC_STORAGE,  PCIS_STORAGE_SATA,  "SATA"},
{PCIC_STORAGE,  PCIS_STORAGE_SAS,   "SAS"},
{PCIC_STORAGE,  PCIS_STORAGE_NVM,   "NVM"},
+   {PCIC_STORAGE,  PCIS_STORAGE_UFS,   "UFS"},
{PCIC_NETWORK,  -1, "network"},
{PCIC_NETWORK,  PCIS_NETWORK_ETHERNET,  "ethernet"},
{PCIC_NETWORK,  PCIS_NETWORK_TOKENRING, "token ring"},
{PCIC_NETWORK,  PCIS_NETWORK_FDDI,  "fddi"},
{PCIC_NETWORK,  PCIS_NETWORK_ATM,   "ATM"},
{PCIC_NETWORK,  PCIS_NETWORK_ISDN,  "ISDN"},
+   {PCIC_NETWORK,  PCIS_NETWORK_WORLDFIP,  "WorldFip"},
+   {PCIC_NETWORK,  PCIS_NETWORK_PICMG, "PICMG"},
+   {PCIC_NETWORK,  PCIS_NETWORK_INFINIBAND,"InfiniBand"},
+   {PCIC_NETWORK,  PCIS_NETWORK_HFC,   "host fabric"},
{PCIC_DISPLAY,  -1, "display"},
{PCIC_DISPLAY,  PCIS_DISPLAY_VGA,   "VGA"},
{PCIC_DISPLAY,  PCIS_DISPLAY_XGA,   "XGA"},
@@ -653,6 +658,11 @@ static struct
{PCIC_BRIDGE,   PCIS_BRIDGE_NUBUS,  "PCI-NuBus"},
{PCIC_BRIDGE,   PCIS_BRIDGE_CARDBUS,"PCI-CardBus"},
{PCIC_BRIDGE,   PCIS_BRIDGE_RACEWAY,"PCI-RACEway"},
+   {PCIC_BRIDGE,   PCIS_BRIDGE_PCI_TRANSPARENT,
+   "Semi-transparent PCI-to-PCI"},
+   {PCIC_BRIDGE,   PCIS_BRIDGE_INFINIBAND, "InfiniBand-PCI"},
+   {PCIC_BRIDGE,   PCIS_BRIDGE_AS_PCI,
+   "AdvancedSwitching-PCI"},
{PCIC_SIMPLECOMM,   -1, "simple comms"},
{PCIC_SIMPLECOMM,   PCIS_SIMPLECOMM_UART,   "UART"},/* 
could detect 16550 */
{PCIC_SIMPLECOMM,   PCIS_SIMPLECOMM_PAR,"parallel port"},
@@ -666,6 +676,8 @@ static struct
{PCIC_BASEPERIPH,   PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug 
controller"},
{PCIC_BASEPERIPH,   PCIS_BASEPERIPH_SDHC,   "SD host controller"},
{PCIC_BASEPERIPH,   PCIS_BASEPERIPH_IOMMU,  "IOMMU"},
+   {PCIC_BASEPERIPH,   PCIS_BASEPERIPH_RCEC,
+   "Root Complex Event Collector"},
{PCIC_INPUTDEV, -1, "input device"},
{PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"},
{PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"},
@@ -681,10 +693,23 @@ static struct
{PCIC_SERIALBUS,PCIS_SERIALBUS_USB, "USB"},
{PCIC_SERIALBUS,PCIS_SERIALBUS_FC,  "Fibre Channel"},
{PCIC_SERIALBUS,PCIS_SERIALBUS_SMBUS,   "SMBus"},
+   {PCIC_SERIALBUS,PCIS_SERIALBUS_INFINIBAND,  "InfiniBand"},
+   {PCIC_SERIALBUS,PCIS_SERIALBUS_IPMI,"IPMI"},
+   {PCIC_SERIALBUS,PCIS_SERIALBUS_SERCOS,  "SERCOS"},
+   {PCIC_SERIALBUS,PCIS_SERIALBUS_CANBUS,  "CANbus"},
+   {PCIC_SERIALBUS,PCIS_SERIALBUS_MIPI_I3C,"MIPI I3C"},
{PCIC_WIRELESS, -1, 

svn commit: r358361 - stable/11/sys/dev/pci

2020-02-26 Thread Konstantin Belousov
Author: kib
Date: Thu Feb 27 00:57:02 2020
New Revision: 358361
URL: https://svnweb.freebsd.org/changeset/base/358361

Log:
  MFC r358174:
  Add more values for PCI capabilities, PCIe extended capabilities, and 
subclasses.

Modified:
  stable/11/sys/dev/pci/pcireg.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/pci/pcireg.h
==
--- stable/11/sys/dev/pci/pcireg.h  Thu Feb 27 00:55:31 2020
(r358360)
+++ stable/11/sys/dev/pci/pcireg.h  Thu Feb 27 00:57:02 2020
(r358361)
@@ -150,6 +150,7 @@
 #definePCIY_SATA   0x12/* SATA */
 #definePCIY_PCIAF  0x13/* PCI Advanced Features */
 #definePCIY_EA 0x14/* PCI Extended Allocation */
+#definePCIY_FPB0x15/* Flattening Portal Bridge */
 
 /* Extended Capability Register Fields */
 
@@ -193,6 +194,20 @@
 #definePCIZ_LN_REQ 0x001c  /* LN Requester */
 #definePCIZ_DPC0x001d  /* Downstream Port Containment */
 #definePCIZ_L1PM   0x001e  /* L1 PM Substates */
+#definePCIZ_PTM0x001f  /* Precision Time Measurement */
+#definePCIZ_M_PCIE 0x0020  /* PCIe over M-PHY */
+#definePCIZ_FRS0x0021  /* FRS Queuing */
+#definePCIZ_RTR0x0022  /* Readiness Time Reporting */
+#definePCIZ_DVSEC  0x0023  /* Designated Vendor-Specific */
+#definePCIZ_VF_REBAR   0x0024  /* VF Resizable BAR */
+#definePCIZ_DLNK   0x0025  /* Data Link Feature */
+#definePCIZ_16GT   0x0026  /* Physical Layer 16.0 GT/s */
+#definePCIZ_LMR0x0027  /* Lane Margining at Receiver */
+#definePCIZ_HIER_ID0x0028  /* Hierarchy ID */
+#definePCIZ_NPEM   0x0029  /* Native PCIe Enclosure Management */
+#definePCIZ_PL32   0x002a  /* Physical Layer 32.0 GT/s */
+#definePCIZ_AP 0x002b  /* Alternate Protocol */
+#definePCIZ_SFI0x002c  /* System Firmware Intermediary */
 
 /* config registers for header type 0 devices */
 
@@ -333,6 +348,8 @@
 #definePCIS_STORAGE_NVM0x08
 #definePCIP_STORAGE_NVM_NVMHCI_1_0 0x01
 #definePCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0  0x02
+#definePCIS_STORAGE_UFS0x09
+#definePCIP_STORAGE_UFS_UFSHCI_1_0 0x01
 #definePCIS_STORAGE_OTHER  0x80
 
 #definePCIC_NETWORK0x02
@@ -343,6 +360,8 @@
 #definePCIS_NETWORK_ISDN   0x04
 #definePCIS_NETWORK_WORLDFIP   0x05
 #definePCIS_NETWORK_PICMG  0x06
+#definePCIS_NETWORK_INFINIBAND 0x07
+#definePCIS_NETWORK_HFC0x08
 #definePCIS_NETWORK_OTHER  0x80
 
 #definePCIC_DISPLAY0x03
@@ -356,6 +375,7 @@
 #definePCIS_MULTIMEDIA_AUDIO   0x01
 #definePCIS_MULTIMEDIA_TELE0x02
 #definePCIS_MULTIMEDIA_HDA 0x03
+#definePCIP_MULTIMEDIA_HDA_VENDOR  0x01
 #definePCIS_MULTIMEDIA_OTHER   0x80
 
 #definePCIC_MEMORY 0x05
@@ -376,6 +396,8 @@
 #definePCIS_BRIDGE_RACEWAY 0x08
 #definePCIS_BRIDGE_PCI_TRANSPARENT 0x09
 #definePCIS_BRIDGE_INFINIBAND  0x0a
+#definePCIS_BRIDGE_AS_PCI  0x0b
+#definePCIS_BRIDGE_AS_PCI_ASI_SIG  0x01
 #definePCIS_BRIDGE_OTHER   0x80
 
 #definePCIC_SIMPLECOMM 0x07
@@ -407,6 +429,7 @@
 #definePCIS_BASEPERIPH_PCIHOT  0x04
 #definePCIS_BASEPERIPH_SDHC0x05
 #definePCIS_BASEPERIPH_IOMMU   0x06
+#definePCIS_BASEPERIPH_RCEC0x07
 #definePCIS_BASEPERIPH_OTHER   0x80
 
 #definePCIC_INPUTDEV   0x09
@@ -449,6 +472,7 @@
 #definePCIP_SERIALBUS_IPMI_BT  0x02
 #definePCIS_SERIALBUS_SERCOS   0x08
 #definePCIS_SERIALBUS_CANBUS   0x09
+#definePCIS_SERIALBUS_MIPI_I3C 0x0a
 
 #definePCIC_WIRELESS   0x0d
 #definePCIS_WIRELESS_IRDA  0x00
@@ -458,6 +482,8 @@
 #definePCIS_WIRELESS_BROADBAND 0x12
 #definePCIS_WIRELESS_80211A0x20
 #definePCIS_WIRELESS_80211B0x21
+#definePCIS_WIRELESS_CELL  0x40
+#definePCIS_WIRELESS_CELL_E0x41
 #definePCIS_WIRELESS_OTHER 0x80
 
 #definePCIC_INTELLIIO  0x0e
___
svn-src-all@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 commit: r358360 - stable/12/usr.sbin/pciconf

2020-02-26 Thread Konstantin Belousov
Author: kib
Date: Thu Feb 27 00:55:31 2020
New Revision: 358360
URL: https://svnweb.freebsd.org/changeset/base/358360

Log:
  MFC r358175:
  Print out some newly added PCIe extended capabilities and subclasses.

Modified:
  stable/12/usr.sbin/pciconf/cap.c
  stable/12/usr.sbin/pciconf/pciconf.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/pciconf/cap.c
==
--- stable/12/usr.sbin/pciconf/cap.cThu Feb 27 00:51:30 2020
(r358359)
+++ stable/12/usr.sbin/pciconf/cap.cThu Feb 27 00:55:31 2020
(r358360)
@@ -988,6 +988,20 @@ static struct {
{ PCIZ_LN_REQ, "LN Requester" },
{ PCIZ_DPC, "Downstream Port Containment" },
{ PCIZ_L1PM, "L1 PM Substates" },
+   { PCIZ_PTM, "Precision Time Measurement" },
+   { PCIZ_M_PCIE, "PCIe over M-PHY" },
+   { PCIZ_FRS, "FRS Queuing" },
+   { PCIZ_RTR, "Readiness Time Reporting" },
+   { PCIZ_DVSEC, "Designated Vendor-Specific" },
+   { PCIZ_VF_REBAR, "VF Resizable BAR" },
+   { PCIZ_DLNK, "Data Link Feature" },
+   { PCIZ_16GT, "Physical Layer 16.0 GT/s" },
+   { PCIZ_LMR, "Lane Margining at Receiver" },
+   { PCIZ_HIER_ID, "Hierarchy ID" },
+   { PCIZ_NPEM, "Native PCIe Enclosure Management" },
+   { PCIZ_PL32, "Physical Layer 32.0 GT/s" },
+   { PCIZ_AP, "Alternate Protocol" },
+   { PCIZ_SFI, "System Firmware Intermediary" },
{ 0, NULL }
 };
 

Modified: stable/12/usr.sbin/pciconf/pciconf.c
==
--- stable/12/usr.sbin/pciconf/pciconf.cThu Feb 27 00:51:30 2020
(r358359)
+++ stable/12/usr.sbin/pciconf/pciconf.cThu Feb 27 00:55:31 2020
(r358360)
@@ -647,12 +647,17 @@ static struct
{PCIC_STORAGE,  PCIS_STORAGE_SATA,  "SATA"},
{PCIC_STORAGE,  PCIS_STORAGE_SAS,   "SAS"},
{PCIC_STORAGE,  PCIS_STORAGE_NVM,   "NVM"},
+   {PCIC_STORAGE,  PCIS_STORAGE_UFS,   "UFS"},
{PCIC_NETWORK,  -1, "network"},
{PCIC_NETWORK,  PCIS_NETWORK_ETHERNET,  "ethernet"},
{PCIC_NETWORK,  PCIS_NETWORK_TOKENRING, "token ring"},
{PCIC_NETWORK,  PCIS_NETWORK_FDDI,  "fddi"},
{PCIC_NETWORK,  PCIS_NETWORK_ATM,   "ATM"},
{PCIC_NETWORK,  PCIS_NETWORK_ISDN,  "ISDN"},
+   {PCIC_NETWORK,  PCIS_NETWORK_WORLDFIP,  "WorldFip"},
+   {PCIC_NETWORK,  PCIS_NETWORK_PICMG, "PICMG"},
+   {PCIC_NETWORK,  PCIS_NETWORK_INFINIBAND,"InfiniBand"},
+   {PCIC_NETWORK,  PCIS_NETWORK_HFC,   "host fabric"},
{PCIC_DISPLAY,  -1, "display"},
{PCIC_DISPLAY,  PCIS_DISPLAY_VGA,   "VGA"},
{PCIC_DISPLAY,  PCIS_DISPLAY_XGA,   "XGA"},
@@ -675,6 +680,11 @@ static struct
{PCIC_BRIDGE,   PCIS_BRIDGE_NUBUS,  "PCI-NuBus"},
{PCIC_BRIDGE,   PCIS_BRIDGE_CARDBUS,"PCI-CardBus"},
{PCIC_BRIDGE,   PCIS_BRIDGE_RACEWAY,"PCI-RACEway"},
+   {PCIC_BRIDGE,   PCIS_BRIDGE_PCI_TRANSPARENT,
+   "Semi-transparent PCI-to-PCI"},
+   {PCIC_BRIDGE,   PCIS_BRIDGE_INFINIBAND, "InfiniBand-PCI"},
+   {PCIC_BRIDGE,   PCIS_BRIDGE_AS_PCI,
+   "AdvancedSwitching-PCI"},
{PCIC_SIMPLECOMM,   -1, "simple comms"},
{PCIC_SIMPLECOMM,   PCIS_SIMPLECOMM_UART,   "UART"},/* 
could detect 16550 */
{PCIC_SIMPLECOMM,   PCIS_SIMPLECOMM_PAR,"parallel port"},
@@ -688,6 +698,8 @@ static struct
{PCIC_BASEPERIPH,   PCIS_BASEPERIPH_PCIHOT, "PCI hot-plug 
controller"},
{PCIC_BASEPERIPH,   PCIS_BASEPERIPH_SDHC,   "SD host controller"},
{PCIC_BASEPERIPH,   PCIS_BASEPERIPH_IOMMU,  "IOMMU"},
+   {PCIC_BASEPERIPH,   PCIS_BASEPERIPH_RCEC,
+   "Root Complex Event Collector"},
{PCIC_INPUTDEV, -1, "input device"},
{PCIC_INPUTDEV, PCIS_INPUTDEV_KEYBOARD, "keyboard"},
{PCIC_INPUTDEV, PCIS_INPUTDEV_DIGITIZER,"digitizer"},
@@ -703,10 +715,23 @@ static struct
{PCIC_SERIALBUS,PCIS_SERIALBUS_USB, "USB"},
{PCIC_SERIALBUS,PCIS_SERIALBUS_FC,  "Fibre Channel"},
{PCIC_SERIALBUS,PCIS_SERIALBUS_SMBUS,   "SMBus"},
+   {PCIC_SERIALBUS,PCIS_SERIALBUS_INFINIBAND,  "InfiniBand"},
+   {PCIC_SERIALBUS,PCIS_SERIALBUS_IPMI,"IPMI"},
+   {PCIC_SERIALBUS,PCIS_SERIALBUS_SERCOS,  "SERCOS"},
+   {PCIC_SERIALBUS,PCIS_SERIALBUS_CANBUS,  "CANbus"},
+   {PCIC_SERIALBUS,PCIS_SERIALBUS_MIPI_I3C,"MIPI I3C"},
{PCIC_WIRELESS, -1, 

svn commit: r358359 - stable/12/sys/dev/pci

2020-02-26 Thread Konstantin Belousov
Author: kib
Date: Thu Feb 27 00:51:30 2020
New Revision: 358359
URL: https://svnweb.freebsd.org/changeset/base/358359

Log:
  MFC r358174:
  Add more values for PCI capabilities, PCIe extended capabilities, and 
subclasses.

Modified:
  stable/12/sys/dev/pci/pcireg.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/pci/pcireg.h
==
--- stable/12/sys/dev/pci/pcireg.h  Wed Feb 26 23:17:16 2020
(r358358)
+++ stable/12/sys/dev/pci/pcireg.h  Thu Feb 27 00:51:30 2020
(r358359)
@@ -152,6 +152,7 @@
 #definePCIY_SATA   0x12/* SATA */
 #definePCIY_PCIAF  0x13/* PCI Advanced Features */
 #definePCIY_EA 0x14/* PCI Extended Allocation */
+#definePCIY_FPB0x15/* Flattening Portal Bridge */
 
 /* Extended Capability Register Fields */
 
@@ -195,6 +196,20 @@
 #definePCIZ_LN_REQ 0x001c  /* LN Requester */
 #definePCIZ_DPC0x001d  /* Downstream Port Containment */
 #definePCIZ_L1PM   0x001e  /* L1 PM Substates */
+#definePCIZ_PTM0x001f  /* Precision Time Measurement */
+#definePCIZ_M_PCIE 0x0020  /* PCIe over M-PHY */
+#definePCIZ_FRS0x0021  /* FRS Queuing */
+#definePCIZ_RTR0x0022  /* Readiness Time Reporting */
+#definePCIZ_DVSEC  0x0023  /* Designated Vendor-Specific */
+#definePCIZ_VF_REBAR   0x0024  /* VF Resizable BAR */
+#definePCIZ_DLNK   0x0025  /* Data Link Feature */
+#definePCIZ_16GT   0x0026  /* Physical Layer 16.0 GT/s */
+#definePCIZ_LMR0x0027  /* Lane Margining at Receiver */
+#definePCIZ_HIER_ID0x0028  /* Hierarchy ID */
+#definePCIZ_NPEM   0x0029  /* Native PCIe Enclosure Management */
+#definePCIZ_PL32   0x002a  /* Physical Layer 32.0 GT/s */
+#definePCIZ_AP 0x002b  /* Alternate Protocol */
+#definePCIZ_SFI0x002c  /* System Firmware Intermediary */
 
 /* config registers for header type 0 devices */
 
@@ -335,6 +350,8 @@
 #definePCIS_STORAGE_NVM0x08
 #definePCIP_STORAGE_NVM_NVMHCI_1_0 0x01
 #definePCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0  0x02
+#definePCIS_STORAGE_UFS0x09
+#definePCIP_STORAGE_UFS_UFSHCI_1_0 0x01
 #definePCIS_STORAGE_OTHER  0x80
 
 #definePCIC_NETWORK0x02
@@ -345,6 +362,8 @@
 #definePCIS_NETWORK_ISDN   0x04
 #definePCIS_NETWORK_WORLDFIP   0x05
 #definePCIS_NETWORK_PICMG  0x06
+#definePCIS_NETWORK_INFINIBAND 0x07
+#definePCIS_NETWORK_HFC0x08
 #definePCIS_NETWORK_OTHER  0x80
 
 #definePCIC_DISPLAY0x03
@@ -358,6 +377,7 @@
 #definePCIS_MULTIMEDIA_AUDIO   0x01
 #definePCIS_MULTIMEDIA_TELE0x02
 #definePCIS_MULTIMEDIA_HDA 0x03
+#definePCIP_MULTIMEDIA_HDA_VENDOR  0x01
 #definePCIS_MULTIMEDIA_OTHER   0x80
 
 #definePCIC_MEMORY 0x05
@@ -378,6 +398,8 @@
 #definePCIS_BRIDGE_RACEWAY 0x08
 #definePCIS_BRIDGE_PCI_TRANSPARENT 0x09
 #definePCIS_BRIDGE_INFINIBAND  0x0a
+#definePCIS_BRIDGE_AS_PCI  0x0b
+#definePCIS_BRIDGE_AS_PCI_ASI_SIG  0x01
 #definePCIS_BRIDGE_OTHER   0x80
 
 #definePCIC_SIMPLECOMM 0x07
@@ -409,6 +431,7 @@
 #definePCIS_BASEPERIPH_PCIHOT  0x04
 #definePCIS_BASEPERIPH_SDHC0x05
 #definePCIS_BASEPERIPH_IOMMU   0x06
+#definePCIS_BASEPERIPH_RCEC0x07
 #definePCIS_BASEPERIPH_OTHER   0x80
 
 #definePCIC_INPUTDEV   0x09
@@ -451,6 +474,7 @@
 #definePCIP_SERIALBUS_IPMI_BT  0x02
 #definePCIS_SERIALBUS_SERCOS   0x08
 #definePCIS_SERIALBUS_CANBUS   0x09
+#definePCIS_SERIALBUS_MIPI_I3C 0x0a
 
 #definePCIC_WIRELESS   0x0d
 #definePCIS_WIRELESS_IRDA  0x00
@@ -460,6 +484,8 @@
 #definePCIS_WIRELESS_BROADBAND 0x12
 #definePCIS_WIRELESS_80211A0x20
 #definePCIS_WIRELESS_80211B0x21
+#definePCIS_WIRELESS_CELL  0x40
+#definePCIS_WIRELESS_CELL_E0x41
 #definePCIS_WIRELESS_OTHER 0x80
 
 #definePCIC_INTELLIIO  0x0e
___
svn-src-all@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 commit: r358358 - head/libexec/rtld-elf/sparc64

2020-02-26 Thread Warner Losh
Author: imp
Date: Wed Feb 26 23:17:16 2020
New Revision: 358358
URL: https://svnweb.freebsd.org/changeset/base/358358

Log:
  Remove sparc64 source files from rtld-elf
  
  These were missed in the prior sweep.
  
  Submitted by: jhb@

Deleted:
  head/libexec/rtld-elf/sparc64/
___
svn-src-all@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"


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

2020-02-26 Thread Ravi Pokala
-Original Message-
From: Gleb Smirnoff 
Date: 2020-02-26, Wednesday at 13:55
To: Ravi Pokala 
Cc: , , 

Subject: Re: svn commit: r358317 - head/sys/kern

On Tue, Feb 25, 2020 at 12:02:29PM -0800, Ravi Pokala wrote:
R>   When sendfile_swapin() sweeps through pages in search for a bogus 
page
R>   skip first and last pages.  This is a micro optimisation.
R> 
R> Yes, but *why* skip the first and last pages?

We may have inserted bogus pages in the middle of a request. We never 
substitute
first or last.

-- 
Gleb Smirnoff

Oh god, "bogus_page" -- Panasas had to jump through a bunch of hoops involving 
bogus_page and our RAIDing-across-sectors GEOM class years ago. 

-Ravi (rpokala@)



___
svn-src-all@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"


Re: svn commit: r358348 - in head/lib/libc: . gdtoa gen sparc64 sparc64/fpu sparc64/gen sparc64/sys sys

2020-02-26 Thread Warner Losh
On Wed, Feb 26, 2020 at 3:47 PM Warner Losh  wrote:

>
>
> On Wed, Feb 26, 2020 at 12:10 PM Bjoern A. Zeeb <
> bzeeb-li...@lists.zabbadoz.net> wrote:
>
>> On 26 Feb 2020, at 18:55, Warner Losh wrote:
>>
>> > Author: imp
>> > Date: Wed Feb 26 18:55:09 2020
>> > New Revision: 358348
>> > URL: https://svnweb.freebsd.org/changeset/base/358348
>> >
>> > Log:
>> >   Remove sparc64 specific parts of libc.
>>
>> I have a silly question for which it’s long been too late, but for the
>> next time .. why do we need a gazillion of commits to remove sparc64
>> rather than 1 “atomic” one (or maybe 2 in case the one missed a bit)
>> to remove it all (which would also allow other people to bring it back
>> into private trees a lot more easily compared to tracking changes over
>> weeks)?
>>
>
> One atomic commit is harder and more work for me.
>
> It's hard to get all the details right before pushing it. It's hard to
> develop it as other things in the tree change things which leads to more
> conflicts. It can be hard to MFC around (though these changes won't be
> MFC'd having too large a commit around them may generate more conflicts
> when those things are MFC'd). So I optimized for my convenience, not others
> wishing to import it into their trees. But I'd contend that the delta as
> far as bringing back as 10 commits isn't onerous for such a niche demand.
>

Also, if I screw something up, it's easier to back out smaller commits
should that be necessary. Backing out huge commits that remove lots of
things and then reapplying them is tedious and error-prone. Doing it a
little at a time also allows me to make sure that all the CI stuff works
before moving on to the next step.


> We don't remove entire architectures often, and we usually do because they
> work poorly at best.
>
> Warner
>
___
svn-src-all@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"


Re: svn commit: r358348 - in head/lib/libc: . gdtoa gen sparc64 sparc64/fpu sparc64/gen sparc64/sys sys

2020-02-26 Thread Warner Losh
On Wed, Feb 26, 2020 at 12:10 PM Bjoern A. Zeeb <
bzeeb-li...@lists.zabbadoz.net> wrote:

> On 26 Feb 2020, at 18:55, Warner Losh wrote:
>
> > Author: imp
> > Date: Wed Feb 26 18:55:09 2020
> > New Revision: 358348
> > URL: https://svnweb.freebsd.org/changeset/base/358348
> >
> > Log:
> >   Remove sparc64 specific parts of libc.
>
> I have a silly question for which it’s long been too late, but for the
> next time .. why do we need a gazillion of commits to remove sparc64
> rather than 1 “atomic” one (or maybe 2 in case the one missed a bit)
> to remove it all (which would also allow other people to bring it back
> into private trees a lot more easily compared to tracking changes over
> weeks)?
>

One atomic commit is harder and more work for me.

It's hard to get all the details right before pushing it. It's hard to
develop it as other things in the tree change things which leads to more
conflicts. It can be hard to MFC around (though these changes won't be
MFC'd having too large a commit around them may generate more conflicts
when those things are MFC'd). So I optimized for my convenience, not others
wishing to import it into their trees. But I'd contend that the delta as
far as bringing back as 10 commits isn't onerous for such a niche demand.

We don't remove entire architectures often, and we usually do because they
work poorly at best.

Warner
___
svn-src-all@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"


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

2020-02-26 Thread Gleb Smirnoff
On Tue, Feb 25, 2020 at 12:02:29PM -0800, Ravi Pokala wrote:
R>   When sendfile_swapin() sweeps through pages in search for a bogus page
R>   skip first and last pages.  This is a micro optimisation.
R> 
R> Yes, but *why* skip the first and last pages?

We may have inserted bogus pages in the middle of a request. We never substitute
first or last.

-- 
Gleb Smirnoff
___
svn-src-all@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"


Re: svn commit: r358346 - in head/libexec/rtld-elf: . rtld-libc

2020-02-26 Thread John Baldwin
On 2/26/20 10:49 AM, Warner Losh wrote:
> Author: imp
> Date: Wed Feb 26 18:49:25 2020
> New Revision: 358346
> URL: https://svnweb.freebsd.org/changeset/base/358346
> 
> Log:
>   Remove sparc64 specific parts of rtld-elf.
> 
> Modified:
>   head/libexec/rtld-elf/rtld-libc/Makefile.inc
>   head/libexec/rtld-elf/rtld.c
>   head/libexec/rtld-elf/rtld_tls.h

libexec/rtld-elf/sparc64?

-- 
John Baldwin
___
svn-src-all@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 commit: r358357 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-02-26 Thread Alexander Motin
Author: mav
Date: Wed Feb 26 20:38:48 2020
New Revision: 358357
URL: https://svnweb.freebsd.org/changeset/base/358357

Log:
  MFZoL: Relax restriction on zfs_ioc_next_obj() iteration
  
  Per the documentation for dnode_next_offset in dnode.c, the "txg"
  parameter specifies a lower bound on which transaction the dnode can
  be found in. We are interested in all dnodes that are removed between
  the first and last transaction in the snapshot. It doesn't need to be
  created in that snapshot to correspond to a removed file.
  
  In fact, the behavior of zfs diff in the test case exactly matches
  this: the transaction that created the data that was deleted in snapshot
  "2" was produced before, in snapshot "1", definitely predating the first
  transaction in snapshot "2".
  
  Signed-off-by: Brian Behlendorf 
  Signed-off-by: Tim Chase 
  Closes #2081
  zfsonlinux/zfs@7290cd3c4ed19fb3f75b8133db2e36afcdd24beb
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Feb 
26 20:18:38 2020(r358356)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Feb 
26 20:38:48 2020(r358357)
@@ -5553,8 +5553,7 @@ zfs_ioc_next_obj(zfs_cmd_t *zc)
if (error != 0)
return (error);
 
-   error = dmu_object_next(os, >zc_obj, B_FALSE,
-   dsl_dataset_phys(os->os_dsl_dataset)->ds_prev_snap_txg);
+   error = dmu_object_next(os, >zc_obj, B_FALSE, 0);
 
dmu_objset_rele(os, FTAG);
return (error);
___
svn-src-all@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 commit: r358356 - head/sys/contrib/ipfilter/netinet

2020-02-26 Thread Cy Schubert
Author: cy
Date: Wed Feb 26 20:18:38 2020
New Revision: 358356
URL: https://svnweb.freebsd.org/changeset/base/358356

Log:
  With the planned removal of GIANT (sysctl uses GIANT), make future-proof
  ipfilter by making it sysctl locking mpsafe.
  
  Reviewed by:  kaktus
  Differential Revision:https://reviews.freebsd.org/D23839

Modified:
  head/sys/contrib/ipfilter/netinet/mlfk_ipl.c

Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c
==
--- head/sys/contrib/ipfilter/netinet/mlfk_ipl.cWed Feb 26 20:03:43 
2020(r358355)
+++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.cWed Feb 26 20:18:38 
2020(r358356)
@@ -84,23 +84,23 @@ static  int ipfwrite __P((dev_t, struct uio *, 
int));
 SYSCTL_DECL(_net_inet);
 #define SYSCTL_IPF(parent, nbr, name, access, ptr, val, descr) \
 SYSCTL_OID(parent, nbr, name, \
-CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_NEEDGIANT | access, \
+CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
 ptr, val, sysctl_ipf_int, "I", descr)
 #define SYSCTL_DYN_IPF_NAT(parent, nbr, name, access,ptr, val, descr) \
 SYSCTL_ADD_OID(_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \
-CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_NEEDGIANT |access, \
+CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE |access, \
 ptr, val, sysctl_ipf_int_nat, "I", descr)
 #define SYSCTL_DYN_IPF_STATE(parent, nbr, name, access,ptr, val, descr) \
 SYSCTL_ADD_OID(_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \
-CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_NEEDGIANT | access, 
\
+CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
 ptr, val, sysctl_ipf_int_state, "I", descr)
 #define SYSCTL_DYN_IPF_FRAG(parent, nbr, name, access,ptr, val, descr) \
 SYSCTL_ADD_OID(_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \
-CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_NEEDGIANT | access, 
\
+CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
ptr, val, sysctl_ipf_int_frag, "I", descr)
 #define SYSCTL_DYN_IPF_AUTH(parent, nbr, name, access,ptr, val, descr) \
 SYSCTL_ADD_OID(_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \
-CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_NEEDGIANT | access, 
\
+CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \
ptr, val, sysctl_ipf_int_auth, "I", descr)
 static struct sysctl_ctx_list ipf_clist;
 #defineCTLFLAG_OFF 0x0080  /* IPFilter must be disabled */
@@ -343,13 +343,14 @@ sysctl_ipf_int ( SYSCTL_HANDLER_ARGS )
 {
int error = 0;
 
+   WRITE_ENTER(_ipfmain.ipf_mutex);
if (arg1)
error = SYSCTL_OUT(req, arg1, sizeof(int));
else
error = SYSCTL_OUT(req, , sizeof(int));
 
if (error || !req->newptr)
-   return (error);
+   goto sysctl_error;
 
if (!arg1)
error = EPERM;
@@ -359,6 +360,9 @@ sysctl_ipf_int ( SYSCTL_HANDLER_ARGS )
else
error = SYSCTL_IN(req, arg1, sizeof(int));
}
+
+sysctl_error:
+   RWLOCK_EXIT(_ipfmain.ipf_mutex);
return (error);
 }
 
___
svn-src-all@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 commit: r358355 - in head: lib/libc/sys sys/vm

2020-02-26 Thread Ed Maste
Author: emaste
Date: Wed Feb 26 20:03:43 2020
New Revision: 358355
URL: https://svnweb.freebsd.org/changeset/base/358355

Log:
  Return ENOTSUP for mmap/mprotect if prot not subset of prot_max
  
  From POSIX,
  
  [ENOTSUP]
  The implementation does not support the combination of accesses
  requested in the prot argument.
  
  This fits the case that prot contains permissions which are not a subset
  of prot_max.
  
  Reviewed by:  brooks, cem
  Relnotes: Yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D23843

Modified:
  head/lib/libc/sys/mmap.2
  head/lib/libc/sys/mprotect.2
  head/sys/vm/vm_mmap.c

Modified: head/lib/libc/sys/mmap.2
==
--- head/lib/libc/sys/mmap.2Wed Feb 26 19:39:59 2020(r358354)
+++ head/lib/libc/sys/mmap.2Wed Feb 26 20:03:43 2020(r358355)
@@ -28,7 +28,7 @@
 .\"@(#)mmap.2  8.4 (Berkeley) 5/11/95
 .\" $FreeBSD$
 .\"
-.Dd June 20, 2019
+.Dd February 26, 2020
 .Dt MMAP 2
 .Os
 .Sh NAME
@@ -432,11 +432,6 @@ An invalid value was passed in the
 .Fa prot
 argument.
 .It Bq Er EINVAL
-The
-.Fa prot
-argument contains permissions which are not a subset of the specified
-maximum permissions.
-.It Bq Er EINVAL
 An undefined option was set in the
 .Fa flags
 argument.
@@ -530,6 +525,11 @@ was specified and the
 argument was not available.
 .Dv MAP_ANON
 was specified and insufficient memory was available.
+.It Bq Er ENOTSUP
+The
+.Fa prot
+argument contains permissions which are not a subset of the specified
+maximum permissions.
 .El
 .Sh SEE ALSO
 .Xr madvise 2 ,

Modified: head/lib/libc/sys/mprotect.2
==
--- head/lib/libc/sys/mprotect.2Wed Feb 26 19:39:59 2020
(r358354)
+++ head/lib/libc/sys/mprotect.2Wed Feb 26 20:03:43 2020
(r358355)
@@ -28,7 +28,7 @@
 .\"@(#)mprotect.2  8.1 (Berkeley) 6/9/93
 .\" $FreeBSD$
 .\"
-.Dd June 20, 2019
+.Dd February 26, 2020
 .Dt MPROTECT 2
 .Os
 .Sh NAME
@@ -104,7 +104,7 @@ arguments is not valid.
 The
 .Fa prot
 argument contains unhandled bits.
-.It Bq Er EINVAL
+.It Bq Er ENOTSUP
 The
 .Fa prot
 argument contains permissions which are not a subset of the specified

Modified: head/sys/vm/vm_mmap.c
==
--- head/sys/vm/vm_mmap.c   Wed Feb 26 19:39:59 2020(r358354)
+++ head/sys/vm/vm_mmap.c   Wed Feb 26 20:03:43 2020(r358355)
@@ -225,7 +225,7 @@ kern_mmap_fpcheck(struct thread *td, uintptr_t addr0, 
max_prot = PROT_MAX_EXTRACT(prot);
prot = PROT_EXTRACT(prot);
if (max_prot != 0 && (max_prot & prot) != prot)
-   return (EINVAL);
+   return (ENOTSUP);
 
p = td->td_proc;
 
@@ -668,7 +668,7 @@ kern_mprotect(struct thread *td, uintptr_t addr0, size
vm_error = KERN_SUCCESS;
if (max_prot != 0) {
if ((max_prot & prot) != prot)
-   return (EINVAL);
+   return (ENOTSUP);
vm_error = vm_map_protect(>td_proc->p_vmspace->vm_map,
addr, addr + size, max_prot, TRUE);
}
___
svn-src-all@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 commit: r358353 - head/sys/dev/agp

2020-02-26 Thread Warner Losh
Author: imp
Date: Wed Feb 26 19:39:52 2020
New Revision: 358353
URL: https://svnweb.freebsd.org/changeset/base/358353

Log:
  Remove support for FreeBSD 4.x and earlier from agp driver
  
  Compile tested only, but do we still need this driver?

Modified:
  head/sys/dev/agp/agp_nvidia.c

Modified: head/sys/dev/agp/agp_nvidia.c
==
--- head/sys/dev/agp/agp_nvidia.c   Wed Feb 26 19:16:23 2020
(r358352)
+++ head/sys/dev/agp/agp_nvidia.c   Wed Feb 26 19:39:52 2020
(r358353)
@@ -41,15 +41,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-
-#if __FreeBSD_version < 50
-#include "opt_pci.h"
-#endif
-
-#if __FreeBSD_version > 50
 #include 
 #include 
-#endif
 
 #include 
 #include 
___
svn-src-all@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 commit: r358354 - head/sys/dev/aic7xxx

2020-02-26 Thread Warner Losh
Author: imp
Date: Wed Feb 26 19:39:59 2020
New Revision: 358354
URL: https://svnweb.freebsd.org/changeset/base/358354

Log:
  Remove support for FreeBSD 4-7.
  
  It's doubtful this driver would still work unchanged there.
  Compile tested only because I no longer have ahc/ahd devices.

Modified:
  head/sys/dev/aic7xxx/aic79xx_osm.h
  head/sys/dev/aic7xxx/aic7xxx_osm.h
  head/sys/dev/aic7xxx/aic_osm_lib.c
  head/sys/dev/aic7xxx/aic_osm_lib.h

Modified: head/sys/dev/aic7xxx/aic79xx_osm.h
==
--- head/sys/dev/aic7xxx/aic79xx_osm.h  Wed Feb 26 19:39:52 2020
(r358353)
+++ head/sys/dev/aic7xxx/aic79xx_osm.h  Wed Feb 26 19:39:59 2020
(r358354)
@@ -43,9 +43,7 @@
 #include 
 #include 
 #include/* For device_t */
-#if __FreeBSD_version >= 50
 #include 
-#endif
 #include 
 #include 
 #include 
@@ -60,13 +58,8 @@
 
 #include 
 
-#if __FreeBSD_version >= 50
 #include 
 #include 
-#else
-#include 
-#include 
-#endif
 
 #include 
 #include 

Modified: head/sys/dev/aic7xxx/aic7xxx_osm.h
==
--- head/sys/dev/aic7xxx/aic7xxx_osm.h  Wed Feb 26 19:39:52 2020
(r358353)
+++ head/sys/dev/aic7xxx/aic7xxx_osm.h  Wed Feb 26 19:39:59 2020
(r358354)
@@ -42,39 +42,22 @@
 #include 
 #include 
 #include/* For device_t */
-#if __FreeBSD_version >= 50
 #include 
-#endif
 #include 
 #include 
 #include 
 #include 
 #include 
 
-#if __FreeBSD_version < 50
-#include 
-#else
-#define NPCI 1
-#endif
-
-#if NPCI > 0
 #define AIC_PCI_CONFIG 1
-#endif
 #include 
 #include 
 #include 
 
 #include 
 
-#if NPCI > 0
-#if __FreeBSD_version >= 50
 #include 
 #include 
-#else
-#include 
-#include 
-#endif
-#endif
 
 #include 
 #include 

Modified: head/sys/dev/aic7xxx/aic_osm_lib.c
==
--- head/sys/dev/aic7xxx/aic_osm_lib.c  Wed Feb 26 19:39:52 2020
(r358353)
+++ head/sys/dev/aic7xxx/aic_osm_lib.c  Wed Feb 26 19:39:59 2020
(r358354)
@@ -128,23 +128,6 @@ aic_recovery_thread(void *arg)
 void
 aic_calc_geometry(struct ccb_calc_geometry *ccg, int extended)
 {
-#if __FreeBSD_version >= 50
cam_calc_geometry(ccg, extended);
-#else
-   uint32_t size_mb;
-   uint32_t secs_per_cylinder;
-
-   size_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size);
-   if (size_mb > 1024 && extended) {
-   ccg->heads = 255;
-   ccg->secs_per_track = 63;
-   } else {
-   ccg->heads = 64;
-   ccg->secs_per_track = 32;
-   }
-   secs_per_cylinder = ccg->heads * ccg->secs_per_track;
-   ccg->cylinders = ccg->volume_size / secs_per_cylinder;
-   ccg->ccb_h.status = CAM_REQ_CMP;
-#endif
 }
 

Modified: head/sys/dev/aic7xxx/aic_osm_lib.h
==
--- head/sys/dev/aic7xxx/aic_osm_lib.h  Wed Feb 26 19:39:52 2020
(r358353)
+++ head/sys/dev/aic7xxx/aic_osm_lib.h  Wed Feb 26 19:39:59 2020
(r358354)
@@ -36,9 +36,7 @@
  */
 
 / OS Includes 
*/
-#if __FreeBSD_version >= 50
 #include 
-#endif
 
 /*** Library Symbol Mapping 
***/
 #defineAIC_LIB_ENTRY_CONCAT(x, prefix) prefix ## x
@@ -71,7 +69,6 @@
 #defineAIC_SHUTDOWN_RECOVERY   
AIC_CONST_ENTRY(_SHUTDOWN_RECOVERY)
 
 /* Byte Order 
*/
-#if __FreeBSD_version >= 50
 #define aic_htobe16(x) htobe16(x)
 #define aic_htobe32(x) htobe32(x)
 #define aic_htobe64(x) htobe64(x)
@@ -85,22 +82,7 @@
 #define aic_le16toh(x) le16toh(x)
 #define aic_le32toh(x) le32toh(x)
 #define aic_le64toh(x) le64toh(x)
-#else
-#define aic_htobe16(x) (x)
-#define aic_htobe32(x) (x)
-#define aic_htobe64(x) (x)
-#define aic_htole16(x) (x)
-#define aic_htole32(x) (x)
-#define aic_htole64(x) (x)
 
-#define aic_be16toh(x) (x)
-#define aic_be32toh(x) (x)
-#define aic_be64toh(x) (x)
-#define aic_le16toh(x) (x)
-#define aic_le32toh(x) (x)
-#define aic_le64toh(x) (x)
-#endif
-
 /* Forward Declarations 
***/
 typedef device_t aic_dev_softc_t;
 typedef union ccb *aic_io_ctx_t;
@@ -125,22 +107,11 @@ aic_wakeup_recovery_thread(struct aic_softc *aic)
 }
 
 /** Kernel Threads 
/
-#if __FreeBSD_version > 55
-#if __FreeBSD_version > 81
 #defineaic_kthread_create(func, farg, proc_ptr, flags, stackpgs, 
fmtstr, arg) \
kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg)
-#else
-#defineaic_kthread_create(func, farg, proc_ptr, flags, stackpgs, 
fmtstr, arg) \
-   kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg)
-#endif

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

2020-02-26 Thread Sergio Carlavilla Delgado
Author: carlavilla (doc committer)
Date: Wed Feb 26 19:16:23 2020
New Revision: 358352
URL: https://svnweb.freebsd.org/changeset/base/358352

Log:
  Add HISTORY sections to tree(3), stdarg(3) and sigevent(3)
  
  Submitted by: gbergling_gmail.com
  Approved by:  bcr@(mentor)
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D23832

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

Modified: head/share/man/man3/sigevent.3
==
--- head/share/man/man3/sigevent.3  Wed Feb 26 19:15:08 2020
(r358351)
+++ head/share/man/man3/sigevent.3  Wed Feb 26 19:16:23 2020
(r358352)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd February 25, 2020
 .Dt SIGEVENT 3
 .Os
 .Sh NAME
@@ -119,6 +119,11 @@ notifications must link against the
 .Xr mq_notify 2 ,
 .Xr timer_create 2 ,
 .Xr siginfo 3
+.Sh HISTORY
+The
+.Va sigevent
+structure first appeared in
+.Fx 3.3 .
 .Sh STANDARDS
 The
 .Vt struct sigevent

Modified: head/share/man/man3/stdarg.3
==
--- head/share/man/man3/stdarg.3Wed Feb 26 19:15:08 2020
(r358351)
+++ head/share/man/man3/stdarg.3Wed Feb 26 19:16:23 2020
(r358352)
@@ -32,7 +32,7 @@
 .\"@(#)stdarg.38.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd October 25, 2002
+.Dd February 25, 2020
 .Dt STDARG 3
 .Os
 .Sh NAME
@@ -216,6 +216,18 @@ The
 and
 .Fn va_end
 macros conform to
+.St -isoC-99 .
+.Sh HISTORY
+The
+.Fn va_start ,
+.Fn va_arg
+and
+.Fn va_end
+macros were introduced in
+.St -ansiC .
+The
+.Fn va_copy
+macro was introduced in
 .St -isoC-99 .
 .Sh BUGS
 Unlike the

Modified: head/share/man/man3/tree.3
==
--- head/share/man/man3/tree.3  Wed Feb 26 19:15:08 2020(r358351)
+++ head/share/man/man3/tree.3  Wed Feb 26 19:16:23 2020(r358352)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 28, 2019
+.Dd February 25, 2020
 .Dt TREE 3
 .Os
 .Sh NAME
@@ -697,6 +697,9 @@ to indicate an error.
 .Sh SEE ALSO
 .Xr arb 3 ,
 .Xr queue 3
+.Sh HISTORY
+The tree macros first appeared in
+.Fx 4.6 .
 .Sh AUTHORS
 The author of the tree macros is
 .An Niels Provos .
___
svn-src-all@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 commit: r358351 - in head/sys/dev: mpr mps

2020-02-26 Thread Warner Losh
Author: imp
Date: Wed Feb 26 19:15:08 2020
New Revision: 358351
URL: https://svnweb.freebsd.org/changeset/base/358351

Log:
  Remove support for all pre FreeBSD 11.0 versions from mpr and mps.
  
  Remove a number of workarounds for older versions of FreeBSD. FreeBSD 
stable/10
  was branched over 6 years ago. All of these changes date from about that time 
or
  earlier. These workarounds are extensive and get in the way of understanding
  the current flow in the driver.

Modified:
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_sas_lsi.c
  head/sys/dev/mpr/mprvar.h
  head/sys/dev/mps/mps_sas.c
  head/sys/dev/mps/mps_sas_lsi.c
  head/sys/dev/mps/mpsvar.h

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Wed Feb 26 19:12:36 2020(r358350)
+++ head/sys/dev/mpr/mpr.c  Wed Feb 26 19:15:08 2020(r358351)
@@ -165,11 +165,7 @@ mpr_diag_reset(struct mpr_softc *sc,int sleep_flag)
 * Force NO_SLEEP for threads prohibited to sleep
 * e.a Thread from interrupt handler are prohibited to sleep.
 */
-#if __FreeBSD_version >= 129
if (curthread->td_no_sleeping)
-#else //__FreeBSD_version < 129
-   if (curthread->td_pflags & TDP_NOSLEEPING)
-#endif //__FreeBSD_version >= 129
sleep_flag = NO_SLEEP;
 
mpr_dprint(sc, MPR_INIT, "sequence start, sleep_flag=%d\n", sleep_flag);
@@ -1005,11 +1001,7 @@ mpr_request_sync(struct mpr_softc *sc, void *req, MPI2
int i, count, ioc_sz, residual;
int sleep_flags = CAN_SLEEP;

-#if __FreeBSD_version >= 129
if (curthread->td_no_sleeping)
-#else //__FreeBSD_version < 129
-   if (curthread->td_pflags & TDP_NOSLEEPING)
-#endif //__FreeBSD_version >= 129
sleep_flags = NO_SLEEP;
 
/* Step 1 */
@@ -3762,11 +3754,7 @@ mpr_wait_command(struct mpr_softc *sc, struct mpr_comm
// Check for context and wait for 50 mSec at a time until time has
// expired or the command has finished.  If msleep can't be used, need
// to poll.
-#if __FreeBSD_version >= 129
if (curthread->td_no_sleeping)
-#else //__FreeBSD_version < 129
-   if (curthread->td_pflags & TDP_NOSLEEPING)
-#endif //__FreeBSD_version >= 129
sleep_flag = NO_SLEEP;
getmicrouptime(_time);
if (mtx_owned(>mpr_mtx) && sleep_flag == CAN_SLEEP) {

Modified: head/sys/dev/mpr/mpr_sas.c
==
--- head/sys/dev/mpr/mpr_sas.c  Wed Feb 26 19:12:36 2020(r358350)
+++ head/sys/dev/mpr/mpr_sas.c  Wed Feb 26 19:15:08 2020(r358351)
@@ -69,9 +69,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#if __FreeBSD_version >= 900026
 #include 
-#endif
 
 #include 
 
@@ -132,23 +130,14 @@ static int mprsas_send_abort(struct mpr_softc *sc, str
 struct mpr_command *cm);
 static void mprsas_async(void *callback_arg, uint32_t code,
 struct cam_path *path, void *arg);
-#if (__FreeBSD_version < 901503) || \
-((__FreeBSD_version >= 100) && (__FreeBSD_version < 106))
-static void mprsas_check_eedp(struct mpr_softc *sc, struct cam_path *path,
-struct ccb_getdev *cgd);
-static void mprsas_read_cap_done(struct cam_periph *periph,
-union ccb *done_ccb);
-#endif
 static int mprsas_send_portenable(struct mpr_softc *sc);
 static void mprsas_portenable_complete(struct mpr_softc *sc,
 struct mpr_command *cm);
 
-#if __FreeBSD_version >= 900026
 static void mprsas_smpio_complete(struct mpr_softc *sc, struct mpr_command 
*cm);
 static void mprsas_send_smpcmd(struct mprsas_softc *sassc, union ccb *ccb,
 uint64_t sasaddr);
 static void mprsas_action_smpio(struct mprsas_softc *sassc, union ccb *ccb);
-#endif //FreeBSD_version >= 900026
 
 struct mprsas_target *
 mprsas_find_target_by_handle(struct mprsas_softc *sassc, int start,
@@ -183,10 +172,7 @@ mprsas_startup_increment(struct mprsas_softc *sassc)
/* just starting, freeze the simq */
mpr_dprint(sassc->sc, MPR_INIT,
"%s freezing simq\n", __func__);
-#if (__FreeBSD_version >= 139) || \
-((__FreeBSD_version < 100) && (__FreeBSD_version >= 902502))
xpt_hold_boot();
-#endif
xpt_freeze_simq(sassc->sim, 1);
}
mpr_dprint(sassc->sc, MPR_INIT, "%s refcount %u\n", __func__,
@@ -218,12 +204,7 @@ mprsas_startup_decrement(struct mprsas_softc *sassc)
"%s releasing simq\n", __func__);
sassc->flags &= ~MPRSAS_IN_STARTUP;
xpt_release_simq(sassc->sim, 1);
-#if (__FreeBSD_version >= 139) || \
-((__FreeBSD_version < 100) && (__FreeBSD_version >= 902502))
xpt_release_boot();
-#else
- 

svn commit: r358350 - head/share/man/man5

2020-02-26 Thread Ed Maste
Author: emaste
Date: Wed Feb 26 19:12:36 2020
New Revision: 358350
URL: https://svnweb.freebsd.org/changeset/base/358350

Log:
  src.conf.5: regen after sparc64 removal

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Wed Feb 26 19:08:23 2020
(r358349)
+++ head/share/man/man5/src.conf.5  Wed Feb 26 19:12:36 2020
(r358350)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd February 19, 2020
+.Dd February 26, 2020
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -1028,10 +1028,6 @@ is set explicitly)
 (unless
 .Va WITH_LLVM_TARGET_RISCV
 is set explicitly)
-.It Va WITHOUT_LLVM_TARGET_SPARC
-(unless
-.Va WITH_LLVM_TARGET_SPARC
-is set explicitly)
 .El
 .It Va WITHOUT_LLVM_TARGET_ARM
 Set to not build LLVM target support for ARM.
@@ -1058,8 +1054,8 @@ Set to not build LLVM target support for RISC-V.
 The
 .Va LLVM_TARGET_ALL
 option should be used rather than this in most cases.
-.It Va WITHOUT_LLVM_TARGET_SPARC
-Set to not build LLVM target support for SPARC.
+.It Va WITH_LLVM_TARGET_SPARC
+Set to build LLVM target support for SPARC.
 The
 .Va LLVM_TARGET_ALL
 option should be used rather than this in most cases.
___
svn-src-all@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"


Re: svn commit: r358348 - in head/lib/libc: . gdtoa gen sparc64 sparc64/fpu sparc64/gen sparc64/sys sys

2020-02-26 Thread Bjoern A. Zeeb

On 26 Feb 2020, at 18:55, Warner Losh wrote:


Author: imp
Date: Wed Feb 26 18:55:09 2020
New Revision: 358348
URL: https://svnweb.freebsd.org/changeset/base/358348

Log:
  Remove sparc64 specific parts of libc.


I have a silly question for which it’s long been too late, but for the 
next time .. why do we need a gazillion of commits to remove sparc64 
rather than 1 “atomic” one (or maybe 2 in case the one missed a bit) 
to remove it all (which would also allow other people to bring it back 
into private trees a lot more easily compared to tracking changes over 
weeks)?


Bjoern
___
svn-src-all@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 commit: r358349 - head/share/mk

2020-02-26 Thread Ed Maste
Author: emaste
Date: Wed Feb 26 19:08:23 2020
New Revision: 358349
URL: https://svnweb.freebsd.org/changeset/base/358349

Log:
  src.opts.mk: drop MIPS special case for disabling BINUTILS_BOOTSTRAP
  
  Binutils has already been reduced to installing ld only on powerpc32
  and as only on amd64.  (Also objdump on every arch supported by binutils
  2.17.50.)  Although BINUTILS_BOOTSTRAP serves no purpose on MIPS there
  is no reason to have a special case for it.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/mk/src.opts.mk

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Wed Feb 26 18:55:09 2020(r358348)
+++ head/share/mk/src.opts.mk   Wed Feb 26 19:08:23 2020(r358349)
@@ -471,10 +471,6 @@ MK_BSDINSTALL:=no
 MK_SVNLITE:=   no
 .endif
 
-.if ${__TT} == "mips" && ${MK_GCC} == "no"
-MK_BINUTILS_BOOTSTRAP:=no
-.endif
-
 .if ${MK_MAIL} == "no"
 MK_MAILWRAPPER:= no
 MK_SENDMAIL:=  no
___
svn-src-all@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 commit: r358348 - in head/lib/libc: . gdtoa gen sparc64 sparc64/fpu sparc64/gen sparc64/sys sys

2020-02-26 Thread Warner Losh
Author: imp
Date: Wed Feb 26 18:55:09 2020
New Revision: 358348
URL: https://svnweb.freebsd.org/changeset/base/358348

Log:
  Remove sparc64 specific parts of libc.
  
  Also update comments for which architectures use 128 bit long doubles,
  as appropriate.
  
  The softfloat specialization routines weren't updated since they
  appear to be from an upstream source which we may want to update in
  the future to get a more favorable license.
  
  Reviewed by: emaste@
  Differential Revision:  https://reviews.freebsd.org/D23658

Deleted:
  head/lib/libc/sparc64/Makefile.inc
  head/lib/libc/sparc64/SYS.h
  head/lib/libc/sparc64/Symbol.map
  head/lib/libc/sparc64/_fpmath.h
  head/lib/libc/sparc64/arith.h
  head/lib/libc/sparc64/fpu/Makefile.inc
  head/lib/libc/sparc64/fpu/fpu.c
  head/lib/libc/sparc64/fpu/fpu_add.c
  head/lib/libc/sparc64/fpu/fpu_arith.h
  head/lib/libc/sparc64/fpu/fpu_compare.c
  head/lib/libc/sparc64/fpu/fpu_div.c
  head/lib/libc/sparc64/fpu/fpu_emu.h
  head/lib/libc/sparc64/fpu/fpu_explode.c
  head/lib/libc/sparc64/fpu/fpu_extern.h
  head/lib/libc/sparc64/fpu/fpu_implode.c
  head/lib/libc/sparc64/fpu/fpu_mul.c
  head/lib/libc/sparc64/fpu/fpu_qp.c
  head/lib/libc/sparc64/fpu/fpu_reg.S
  head/lib/libc/sparc64/fpu/fpu_reg.h
  head/lib/libc/sparc64/fpu/fpu_sqrt.c
  head/lib/libc/sparc64/fpu/fpu_subr.c
  head/lib/libc/sparc64/gd_qnan.h
  head/lib/libc/sparc64/gen/Makefile.inc
  head/lib/libc/sparc64/gen/_ctx_start.S
  head/lib/libc/sparc64/gen/_set_tp.c
  head/lib/libc/sparc64/gen/_setjmp.S
  head/lib/libc/sparc64/gen/assym.s
  head/lib/libc/sparc64/gen/fabs.S
  head/lib/libc/sparc64/gen/fixunsdfsi.S
  head/lib/libc/sparc64/gen/flt_rounds.c
  head/lib/libc/sparc64/gen/fpgetmask.c
  head/lib/libc/sparc64/gen/fpgetround.c
  head/lib/libc/sparc64/gen/fpgetsticky.c
  head/lib/libc/sparc64/gen/fpsetmask.c
  head/lib/libc/sparc64/gen/fpsetround.c
  head/lib/libc/sparc64/gen/infinity.c
  head/lib/libc/sparc64/gen/makecontext.c
  head/lib/libc/sparc64/gen/setjmp.S
  head/lib/libc/sparc64/gen/signalcontext.c
  head/lib/libc/sparc64/gen/sigsetjmp.S
  head/lib/libc/sparc64/static_tls.h
  head/lib/libc/sparc64/sys/Makefile.inc
  head/lib/libc/sparc64/sys/__sparc_sigtramp_setup.c
  head/lib/libc/sparc64/sys/__sparc_utrap.c
  head/lib/libc/sparc64/sys/__sparc_utrap_align.c
  head/lib/libc/sparc64/sys/__sparc_utrap_emul.c
  head/lib/libc/sparc64/sys/__sparc_utrap_fp_disabled.S
  head/lib/libc/sparc64/sys/__sparc_utrap_gen.S
  head/lib/libc/sparc64/sys/__sparc_utrap_install.c
  head/lib/libc/sparc64/sys/__sparc_utrap_private.h
  head/lib/libc/sparc64/sys/__sparc_utrap_setup.c
  head/lib/libc/sparc64/sys/assym.s
  head/lib/libc/sparc64/sys/cerror.S
  head/lib/libc/sparc64/sys/sigaction1.S
  head/lib/libc/sparc64/sys/sigcode.S
Modified:
  head/lib/libc/Makefile
  head/lib/libc/gdtoa/machdep_ldisQ.c
  head/lib/libc/gen/tls.c
  head/lib/libc/sys/Makefile.inc

Modified: head/lib/libc/Makefile
==
--- head/lib/libc/Makefile  Wed Feb 26 18:55:03 2020(r358347)
+++ head/lib/libc/Makefile  Wed Feb 26 18:55:09 2020(r358348)
@@ -97,7 +97,6 @@ NOASM=
 ${LIBC_ARCH} != "amd64" && \
 ${LIBC_ARCH} != "powerpc64" && \
 ${LIBC_ARCH} != "riscv" && \
-${LIBC_ARCH} != "sparc64" && \
 ${MACHINE_ARCH:Mmipsn32*} == "" && \
 ${MACHINE_ARCH:Mmips64*} == ""
 .include "${LIBC_SRCTOP}/quad/Makefile.inc"

Modified: head/lib/libc/gdtoa/machdep_ldisQ.c
==
--- head/lib/libc/gdtoa/machdep_ldisQ.c Wed Feb 26 18:55:03 2020
(r358347)
+++ head/lib/libc/gdtoa/machdep_ldisQ.c Wed Feb 26 18:55:09 2020
(r358348)
@@ -34,7 +34,7 @@
 /*
  * Machine-dependent glue to integrate David Gay's gdtoa
  * package into libc for architectures where a long double
- * uses quad precision, such as sparc64.
+ * uses quad precision, such as aarch64 or riscv.
  */
 
 #include 

Modified: head/lib/libc/gen/tls.c
==
--- head/lib/libc/gen/tls.c Wed Feb 26 18:55:03 2020(r358347)
+++ head/lib/libc/gen/tls.c Wed Feb 26 18:55:09 2020(r358348)
@@ -74,8 +74,7 @@ void __libc_free_tls(void *tls, size_t tcbsize, size_t
 #if defined(__amd64__)
 #define TLS_TCB_ALIGN 16
 #elif defined(__aarch64__) || defined(__arm__) || defined(__i386__) || \
-defined(__mips__) || defined(__powerpc__) || defined(__riscv) || \
-defined(__sparc64__)
+defined(__mips__) || defined(__powerpc__) || defined(__riscv)
 #define TLS_TCB_ALIGN sizeof(void *)
 #else
 #error TLS_TCB_ALIGN undefined for target architecture
@@ -85,7 +84,7 @@ void __libc_free_tls(void *tls, size_t tcbsize, size_t
 defined(__powerpc__) || defined(__riscv)
 #define TLS_VARIANT_I
 #endif
-#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__)
+#if defined(__i386__) || defined(__amd64__)
 #define 

svn commit: r358347 - in head/lib/msun: ld128 sparc64

2020-02-26 Thread Warner Losh
Author: imp
Date: Wed Feb 26 18:55:03 2020
New Revision: 358347
URL: https://svnweb.freebsd.org/changeset/base/358347

Log:
  Remove sparc64 specific parts of libm and fix comments
  
  Once upon a time, sparc64 was the only ld128 architecture. However,
  both aarch64 and riscv are now such architectures. Many of the
  comments about how slow multiplication was on old sparc64 processors
  are now no longer true. However, since no evaluation has been done for
  aarch64 yet, it's unclear if they are still relevant or not. If not,
  the code should be changed. If so, the comments should remove the
  uncertainty.
  
  Reviewed by: emaste@
  Differential Revision: https://reviews.freebsd.org/D23658

Deleted:
  head/lib/msun/sparc64/Makefile.inc
  head/lib/msun/sparc64/Symbol.map
  head/lib/msun/sparc64/e_sqrt.S
  head/lib/msun/sparc64/e_sqrtf.S
  head/lib/msun/sparc64/fenv.c
  head/lib/msun/sparc64/fenv.h
Modified:
  head/lib/msun/ld128/k_expl.h
  head/lib/msun/ld128/s_expl.c
  head/lib/msun/ld128/s_logl.c

Modified: head/lib/msun/ld128/k_expl.h
==
--- head/lib/msun/ld128/k_expl.hWed Feb 26 18:49:25 2020
(r358346)
+++ head/lib/msun/ld128/k_expl.hWed Feb 26 18:55:03 2020
(r358347)
@@ -265,7 +265,8 @@ __k_expl(long double x, long double *hip, long double 
 /*
  * XXX: the rest of the functions are identical for ld80 and ld128.
  * However, we should use scalbnl() for ld128, since long double
- * multiplication is very slow on the only supported ld128 arch (sparc64).
+ * multiplication was very slow on sparc64 and no new evaluation has
+ * been made for aarch64 and/or riscv.
  */
 
 static inline void

Modified: head/lib/msun/ld128/s_expl.c
==
--- head/lib/msun/ld128/s_expl.cWed Feb 26 18:49:25 2020
(r358346)
+++ head/lib/msun/ld128/s_expl.cWed Feb 26 18:55:03 2020
(r358347)
@@ -92,7 +92,10 @@ expl(long double x)
t = SUM2P(hi, lo);
 
/* Scale by 2**k. */
-   /* XXX sparc64 multiplication is so slow that scalbnl() is faster. */
+   /*
+* XXX sparc64 multiplication was so slow that scalbnl() is faster,
+* but performance on aarch64 and riscv hasn't yet been quantified.
+*/
if (k >= LDBL_MIN_EXP) {
if (k == LDBL_MAX_EXP)
RETURNI(t * 2 * 0x1p16383L);

Modified: head/lib/msun/ld128/s_logl.c
==
--- head/lib/msun/ld128/s_logl.cWed Feb 26 18:49:25 2020
(r358346)
+++ head/lib/msun/ld128/s_logl.cWed Feb 26 18:55:03 2020
(r358347)
@@ -535,16 +535,17 @@ logl(long double x)
 * efficiency than is gained.
 */
/*
-* Use double precision operations wherever possible, since long
-* double operations are emulated and are very slow on the only
-* known machines that support ld128 (sparc64).  Also, don't try
-* to improve parallelism by increasing the number of operations,
-* since any parallelism on such machines is needed for the
-* emulation.  Horner's method is good for this, and is also good
-* for accuracy.  Horner's method doesn't handle the `lo' term
-* well, either for efficiency or accuracy.  However, for accuracy
-* we evaluate d * d * P2 separately to take advantage of
-* by P2 being exact, and this gives a good place to sum the 'lo'
+* Use double precision operations wherever possible, since
+* long double operations are emulated and were very slow on
+* the old sparc64 and unknown on the newer aarch64 and riscv
+* machines.  Also, don't try to improve parallelism by
+* increasing the number of operations, since any parallelism
+* on such machines is needed for the emulation.  Horner's
+* method is good for this, and is also good for accuracy.
+* Horner's method doesn't handle the `lo' term well, either
+* for efficiency or accuracy.  However, for accuracy we
+* evaluate d * d * P2 separately to take advantage of by P2
+* being exact, and this gives a good place to sum the 'lo'
 * term too.
 */
dd = (double)d;
___
svn-src-all@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 commit: r358346 - in head/libexec/rtld-elf: . rtld-libc

2020-02-26 Thread Warner Losh
Author: imp
Date: Wed Feb 26 18:49:25 2020
New Revision: 358346
URL: https://svnweb.freebsd.org/changeset/base/358346

Log:
  Remove sparc64 specific parts of rtld-elf.

Modified:
  head/libexec/rtld-elf/rtld-libc/Makefile.inc
  head/libexec/rtld-elf/rtld.c
  head/libexec/rtld-elf/rtld_tls.h

Modified: head/libexec/rtld-elf/rtld-libc/Makefile.inc
==
--- head/libexec/rtld-elf/rtld-libc/Makefile.incWed Feb 26 18:49:20 
2020(r358345)
+++ head/libexec/rtld-elf/rtld-libc/Makefile.incWed Feb 26 18:49:25 
2020(r358346)
@@ -73,12 +73,6 @@ _libc_other_objects+=syncicache
 .if ${MACHINE_ARCH:Mmipsn32*} == "" && ${MACHINE_ARCH:Mmips64*} == ""
 _libc_other_objects+=umoddi3 udivdi3 qdivrem
 .endif
-.elif ${LIBC_ARCH} == "sparc64"
-# reloc.c uses __sparc_utrap which needs a lot of other object files
-_libc_other_objects+=__sparc_utrap __sparc_utrap_fp_disabled __sparc_utrap_gen 
\
-__sparc_utrap_setup __sparc_utrap_align __sparc_utrap_emul kill getpid \
-fpu fpu_explode fpu_div fpu_reg fpu_sqrt fpu_implode fpu_subr fpu_add \
-fpu_compare fpu_mul
 .endif
 
 # Extract all the .o files from libc_nossp_pic.a. This ensures that

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cWed Feb 26 18:49:20 2020
(r358345)
+++ head/libexec/rtld-elf/rtld.cWed Feb 26 18:49:25 2020
(r358346)
@@ -4954,7 +4954,7 @@ free_tls(void *tcb, size_t tcbsize, size_t tcbalign __
 
 #endif
 
-#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__)
+#if defined(__i386__) || defined(__amd64__)
 
 /*
  * Allocate Static TLS using the Variant II method.

Modified: head/libexec/rtld-elf/rtld_tls.h
==
--- head/libexec/rtld-elf/rtld_tls.hWed Feb 26 18:49:20 2020
(r358345)
+++ head/libexec/rtld-elf/rtld_tls.hWed Feb 26 18:49:25 2020
(r358346)
@@ -43,11 +43,10 @@
  * block is returned by this function. For architectures using
  * 'Variant I' TLS, the thread local storage follows the TCB, and for
  * 'Variant II', the thread local storage precedes it. For
- * architectures using the 'Variant II' model (e.g. i386, amd64,
- * sparc64), the TCB must begin with two pointer fields which are used
- * by rtld for its TLS implementation. For the 'Variant I' model, the
- * TCB must begin with a single pointer field for rtld's
- * implementation.
+ * architectures using the 'Variant II' model (e.g. i386, amd64) the
+ * TCB must begin with two pointer fields which are used by rtld for
+ * its TLS implementation. For the 'Variant I' model, the TCB must
+ * begin with a single pointer field for rtld's implementation.
  *
  * If the value of 'oldtls' is non-NULL, the new TLS block will be
  * initialised using the values contained in 'oldtls' and 'oldtls'
___
svn-src-all@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 commit: r358345 - head/share/mk

2020-02-26 Thread Warner Losh
Author: imp
Date: Wed Feb 26 18:49:20 2020
New Revision: 358345
URL: https://svnweb.freebsd.org/changeset/base/358345

Log:
  Remove sparc64 specific buid-system hacks
  
  Remove all the sparc64 hacks and tweaks to the build system. We don't
  need them anymore.

Modified:
  head/share/mk/bsd.cpu.mk
  head/share/mk/bsd.endian.mk
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.sys.mk
  head/share/mk/local.meta.sys.mk
  head/share/mk/src.opts.mk

Modified: head/share/mk/bsd.cpu.mk
==
--- head/share/mk/bsd.cpu.mkWed Feb 26 18:46:41 2020(r358344)
+++ head/share/mk/bsd.cpu.mkWed Feb 26 18:49:20 2020(r358345)
@@ -20,8 +20,6 @@ MACHINE_CPU = mips
 MACHINE_CPU = aim
 . elif ${MACHINE_CPUARCH} == "riscv"
 MACHINE_CPU = riscv
-. elif ${MACHINE_CPUARCH} == "sparc64"
-MACHINE_CPU = ultrasparc
 . endif
 .else
 
@@ -75,12 +73,6 @@ CPUTYPE = pentium-mmx
 CPUTYPE = pentium
 .   endif
 .  endif
-. elif ${MACHINE_ARCH} == "sparc64"
-.  if ${CPUTYPE} == "us"
-CPUTYPE = ultrasparc
-.  elif ${CPUTYPE} == "us3"
-CPUTYPE = ultrasparc3
-.  endif
 . endif
 
 ###
@@ -152,14 +144,6 @@ _CPUCFLAGS = -march=${CPUTYPE}
 #  sb1, xlp, xlr
 _CPUCFLAGS = -march=${CPUTYPE:S/^mips//}
 . endif
-. elif ${MACHINE_ARCH} == "sparc64"
-.  if ${CPUTYPE} == "v9"
-_CPUCFLAGS = -mcpu=v9
-.  elif ${CPUTYPE} == "ultrasparc"
-_CPUCFLAGS = -mcpu=ultrasparc
-.  elif ${CPUTYPE} == "ultrasparc3"
-_CPUCFLAGS = -mcpu=ultrasparc3
-.  endif
 . elif ${MACHINE_CPUARCH} == "aarch64"
 _CPUCFLAGS = -mcpu=${CPUTYPE}
 . endif
@@ -298,15 +282,6 @@ MACHINE_CPU = booke softfp
 ## riscv
 . elif ${MACHINE_CPUARCH} == "riscv"
 MACHINE_CPU = riscv
-## sparc64
-. elif ${MACHINE_ARCH} == "sparc64"
-.  if ${CPUTYPE} == "v9"
-MACHINE_CPU = v9
-.  elif ${CPUTYPE} == "ultrasparc"
-MACHINE_CPU = v9 ultrasparc
-.  elif ${CPUTYPE} == "ultrasparc3"
-MACHINE_CPU = v9 ultrasparc ultrasparc3
-.  endif
 . endif
 .endif
 
@@ -353,7 +328,7 @@ MACHINE_CPU += softfp
 # when CPUTYPE has 'soft' in it, we use the soft-float ABI to allow building of
 # soft-float ABI libraries. In this case, we have to add the -mfloat-abi=softfp
 # to force that.
-.if ${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != ""
+. if ${MACHINE_ARCH:Marmv[67]*} && defined(CPUTYPE) && ${CPUTYPE:M*soft*} != ""
 # Needs to be CFLAGS not _CPUCFLAGS because it's needed for the ABI
 # not a nice optimization. Please note: softfp ABI uses hardware floating
 # instructions, but passes arguments to function calls in integer regsiters.
@@ -361,7 +336,7 @@ MACHINE_CPU += softfp
 # supported. softfp support in FreeBSD may disappear in FreeBSD 13.0 since
 # it was a transition tool from FreeBSD 10 to 11 and is a bit of an odd duck.
 CFLAGS += -mfloat-abi=softfp
-.endif
+. endif
 .endif
 
 .if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe"

Modified: head/share/mk/bsd.endian.mk
==
--- head/share/mk/bsd.endian.mk Wed Feb 26 18:46:41 2020(r358344)
+++ head/share/mk/bsd.endian.mk Wed Feb 26 18:49:20 2020(r358345)
@@ -12,7 +12,6 @@ LOCALEDEF_ENDIAN= -l
 .elif ${MACHINE_ARCH} == "powerpc" || \
 ${MACHINE_ARCH} == "powerpc64" || \
 ${MACHINE_ARCH} == "powerpcspe" || \
-${MACHINE_ARCH} == "sparc64" || \
 (${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} != "") || \
 ${MACHINE_ARCH:Mmips*} != ""
 TARGET_ENDIANNESS= 4321

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkWed Feb 26 18:46:41 2020(r358344)
+++ head/share/mk/bsd.lib.mkWed Feb 26 18:49:20 2020(r358345)
@@ -111,13 +111,8 @@ CFLAGS += -mno-relax
 .SUFFIXES: .out .o .bc .ll .po .pico .nossppico .pieo .S .asm .s .c .cc .cpp 
.cxx .C .f .y .l .ln
 
 .if !defined(PICFLAG)
-.if ${MACHINE_CPUARCH} == "sparc64"
-PICFLAG=-fPIC
-PIEFLAG=-fPIE
-.else
 PICFLAG=-fpic
 PIEFLAG=-fpie
-.endif
 .endif
 
 PO_FLAG=-pg

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkWed Feb 26 18:46:41 2020(r358344)
+++ head/share/mk/bsd.sys.mkWed Feb 26 18:49:20 2020(r358345)
@@ -214,10 +214,6 @@ CLANG_OPT_SMALL+= -mllvm -enable-gvn=false
 CLANG_OPT_SMALL+= -mllvm -enable-load-pre=false
 .endif
 CFLAGS.clang+=  -Qunused-arguments
-.if ${MACHINE_CPUARCH} == "sparc64"
-# Don't emit .cfi directives, since we must use GNU as on sparc64, for now.
-CFLAGS.clang+=  -fno-dwarf2-cfi-asm
-.endif # SPARC64
 # The libc++ headers use c++11 extensions.  These are normally silenced because
 # they are treated as system headers, but we explicitly disable that warning
 # suppression when building the base system to catch bugs in our headers.

Modified: 

svn commit: r358344 - head/lib/libc/sys

2020-02-26 Thread Ed Maste
Author: emaste
Date: Wed Feb 26 18:46:41 2020
New Revision: 358344
URL: https://svnweb.freebsd.org/changeset/base/358344

Log:
  mprotect.2: sort errors alphabetically
  
  Reported by:  brooks
  MFC after:3 days

Modified:
  head/lib/libc/sys/mprotect.2

Modified: head/lib/libc/sys/mprotect.2
==
--- head/lib/libc/sys/mprotect.2Wed Feb 26 18:12:12 2020
(r358343)
+++ head/lib/libc/sys/mprotect.2Wed Feb 26 18:46:41 2020
(r358344)
@@ -88,6 +88,12 @@ The
 .Fn mprotect
 system call will fail if:
 .Bl -tag -width Er
+.It Bq Er EACCES
+The calling process was not allowed to change
+the protection to the value specified by
+the
+.Fa prot
+argument.
 .It Bq Er EINVAL
 The virtual address range specified by the
 .Fa addr
@@ -103,12 +109,6 @@ The
 .Fa prot
 argument contains permissions which are not a subset of the specified
 maximum permissions.
-.It Bq Er EACCES
-The calling process was not allowed to change
-the protection to the value specified by
-the
-.Fa prot
-argument.
 .El
 .Sh SEE ALSO
 .Xr madvise 2 ,
___
svn-src-all@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 commit: r358343 - in head: stand/libsa/zfs sys/cddl/boot/zfs

2020-02-26 Thread Toomas Soome
Author: tsoome
Date: Wed Feb 26 18:12:12 2020
New Revision: 358343
URL: https://svnweb.freebsd.org/changeset/base/358343

Log:
  loader: replace zfs_alloc/zfs_free with malloc/free
  
  Use common memory management.

Modified:
  head/stand/libsa/zfs/zfs.c
  head/stand/libsa/zfs/zfsimpl.c
  head/sys/cddl/boot/zfs/zfssubr.c

Modified: head/stand/libsa/zfs/zfs.c
==
--- head/stand/libsa/zfs/zfs.c  Wed Feb 26 16:51:45 2020(r358342)
+++ head/stand/libsa/zfs/zfs.c  Wed Feb 26 18:12:12 2020(r358343)
@@ -419,7 +419,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void
 
/* Return of partial sector data requires a bounce buffer. */
if ((head > 0) || do_tail_read) {
-   bouncebuf = zfs_alloc(secsz);
+   bouncebuf = malloc(secsz);
if (bouncebuf == NULL) {
printf("vdev_read: out of memory\n");
return (ENOMEM);
@@ -464,8 +464,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void
 
ret = 0;
 error:
-   if (bouncebuf != NULL)
-   zfs_free(bouncebuf, secsz);
+   free(bouncebuf);
return (ret);
 }
 

Modified: head/stand/libsa/zfs/zfsimpl.c
==
--- head/stand/libsa/zfs/zfsimpl.c  Wed Feb 26 16:51:45 2020
(r358342)
+++ head/stand/libsa/zfs/zfsimpl.c  Wed Feb 26 18:12:12 2020
(r358343)
@@ -138,10 +138,7 @@ static spa_list_t zfs_pools;
 static const dnode_phys_t *dnode_cache_obj;
 static uint64_t dnode_cache_bn;
 static char *dnode_cache_buf;
-static char *zfs_temp_buf, *zfs_temp_end, *zfs_temp_ptr;
 
-#defineTEMP_SIZE   (1024 * 1024)
-
 static int zio_read(const spa_t *spa, const blkptr_t *bp, void *buf);
 static int zfs_get_root(const spa_t *spa, uint64_t *objid);
 static int zfs_rlookup(const spa_t *spa, uint64_t objnum, char *result);
@@ -167,38 +164,11 @@ zfs_init(void)
STAILQ_INIT(_vdevs);
STAILQ_INIT(_pools);
 
-   zfs_temp_buf = malloc(TEMP_SIZE);
-   zfs_temp_end = zfs_temp_buf + TEMP_SIZE;
-   zfs_temp_ptr = zfs_temp_buf;
dnode_cache_buf = malloc(SPA_MAXBLOCKSIZE);
 
zfs_init_crc();
 }
 
-static void *
-zfs_alloc(size_t size)
-{
-   char *ptr;
-
-   if (zfs_temp_ptr + size > zfs_temp_end) {
-   panic("ZFS: out of temporary buffer space");
-   }
-   ptr = zfs_temp_ptr;
-   zfs_temp_ptr += size;
-
-   return (ptr);
-}
-
-static void
-zfs_free(void *ptr, size_t size)
-{
-
-   zfs_temp_ptr -= size;
-   if (zfs_temp_ptr != ptr) {
-   panic("ZFS: zfs_alloc()/zfs_free() mismatch");
-   }
-}
-
 static int
 xdr_int(const unsigned char **xdr, int *ip)
 {
@@ -2151,17 +2121,20 @@ zio_read(const spa_t *spa, const blkptr_t *bp, void *b
ASSERT(size <= BPE_PAYLOAD_SIZE);
 
if (cpfunc != ZIO_COMPRESS_OFF)
-   pbuf = zfs_alloc(size);
+   pbuf = malloc(size);
else
pbuf = buf;
 
+   if (pbuf == NULL)
+   return (ENOMEM);
+
decode_embedded_bp_compressed(bp, pbuf);
error = 0;
 
if (cpfunc != ZIO_COMPRESS_OFF) {
error = zio_decompress_data(cpfunc, pbuf,
size, buf, BP_GET_LSIZE(bp));
-   zfs_free(pbuf, size);
+   free(pbuf);
}
if (error != 0)
printf("ZFS: i/o error - unable to decompress "
@@ -2198,10 +2171,15 @@ zio_read(const spa_t *spa, const blkptr_t *bp, void *b
size = P2ROUNDUP(size, align);
}
if (size != BP_GET_PSIZE(bp) || cpfunc != ZIO_COMPRESS_OFF)
-   pbuf = zfs_alloc(size);
+   pbuf = malloc(size);
else
pbuf = buf;
 
+   if (pbuf == NULL) {
+   error = ENOMEM;
+   break;
+   }
+
if (DVA_GET_GANG(dva))
error = zio_read_gang(spa, bp, pbuf);
else
@@ -2214,12 +2192,13 @@ zio_read(const spa_t *spa, const blkptr_t *bp, void *b
bcopy(pbuf, buf, BP_GET_PSIZE(bp));
}
if (buf != pbuf)
-   zfs_free(pbuf, size);
+   free(pbuf);
if (error == 0)
break;
}
if (error != 0)
printf("ZFS: i/o error - all block copies unavailable\n");
+
return (error);
 }
 
@@ -3418,10 +3397,14 @@ zfs_dnode_stat(const spa_t *spa, dnode_phys_t *dn, str
int error;
 
size = 

svn commit: r358342 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-02-26 Thread Alexander Motin
Author: mav
Date: Wed Feb 26 16:51:45 2020
New Revision: 358342
URL: https://svnweb.freebsd.org/changeset/base/358342

Log:
  MFZoL: Fix resilver writes in vdev_indirect_io_start
  
  This patch addresses an issue found in ztest where resilver
  write zios that were passed to an indirect vdev would end up
  being handled as though they were resilver read zios. This
  caused issues where the zio->io_abd would be both read to
  and written from at the same time, causing asserts to fail.
  
  Reviewed-by: Brian Behlendorf 
  Reviewed by: Matt Ahrens 
  Reviewed-by: Serapheim Dimitropoulos 
  Signed-off-by: Tom Caputi 
  Closes #8193
  zfsonlinux/zfs@5aa95ba0d3502779695341b5f55fa5ba1d3330ff
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c Wed Feb 
26 16:22:28 2020(r358341)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c Wed Feb 
26 16:51:45 2020(r358342)
@@ -1243,6 +1243,8 @@ vdev_indirect_read_all(zio_t *zio)
 {
indirect_vsd_t *iv = zio->io_vsd;
 
+   ASSERT3U(zio->io_type, ==, ZIO_TYPE_READ);
+
for (indirect_split_t *is = list_head(>iv_splits);
is != NULL; is = list_next(>iv_splits, is)) {
for (int i = 0; i < is->is_children; i++) {
@@ -1332,7 +1334,8 @@ vdev_indirect_io_start(zio_t *zio)
vdev_indirect_child_io_done, zio));
} else {
iv->iv_split_block = B_TRUE;
-   if (zio->io_flags & (ZIO_FLAG_SCRUB | ZIO_FLAG_RESILVER)) {
+   if (zio->io_type == ZIO_TYPE_READ &&
+   zio->io_flags & (ZIO_FLAG_SCRUB | ZIO_FLAG_RESILVER)) {
/*
 * Read all copies.  Note that for simplicity,
 * we don't bother consulting the DTL in the
@@ -1341,13 +1344,17 @@ vdev_indirect_io_start(zio_t *zio)
vdev_indirect_read_all(zio);
} else {
/*
-* Read one copy of each split segment, from the
-* top-level vdev.  Since we don't know the
-* checksum of each split individually, the child
-* zio can't ensure that we get the right data.
-* E.g. if it's a mirror, it will just read from a
-* random (healthy) leaf vdev.  We have to verify
-* the checksum in vdev_indirect_io_done().
+* If this is a read zio, we read one copy of each
+* split segment, from the top-level vdev.  Since
+* we don't know the checksum of each split
+* individually, the child zio can't ensure that
+* we get the right data. E.g. if it's a mirror,
+* it will just read from a random (healthy) leaf
+* vdev. We have to verify the checksum in
+* vdev_indirect_io_done().
+*
+* For write zios, the vdev code will ensure we write
+* to all children.
 */
for (indirect_split_t *is = list_head(>iv_splits);
is != NULL; is = list_next(>iv_splits, is)) {
___
svn-src-all@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 commit: r358341 - head/sys/kern

2020-02-26 Thread Warner Losh
Author: imp
Date: Wed Feb 26 16:22:28 2020
New Revision: 358341
URL: https://svnweb.freebsd.org/changeset/base/358341

Log:
  Remove trailing white space.

Modified:
  head/sys/kern/bus_if.m

Modified: head/sys/kern/bus_if.m
==
--- head/sys/kern/bus_if.m  Wed Feb 26 16:04:24 2020(r358340)
+++ head/sys/kern/bus_if.m  Wed Feb 26 16:22:28 2020(r358341)
@@ -96,7 +96,7 @@ CODE {
  * This is called from system code which prints out a description of a
  * device. It should describe the attachment that the child has with
  * the parent. For instance the TurboLaser bus prints which node the
- * device is attached to. See bus_generic_print_child() for more 
+ * device is attached to. See bus_generic_print_child() for more
  * information.
  *
  * @param _dev the device whose child is being printed
@@ -117,7 +117,7 @@ METHOD int print_child {
  *
  * @param _dev the device whose child was being probed
  * @param _child   the child device which failed to probe
- */   
+ */
 METHOD void probe_nomatch {
 device_t _dev;
 device_t _child;
@@ -138,17 +138,17 @@ METHOD void probe_nomatch {
  *
  * This method copies the value of an instance variable to the
  * location specified by @p *_result.
- * 
+ *
  * @param _dev the device whose child was being examined
  * @param _child   the child device whose instance variable is
  * being read
  * @param _index   the instance variable to read
  * @param _result  a location to receive the instance variable
  * value
- * 
+ *
  * @retval 0   success
  * @retval ENOENT  no such instance variable is supported by @p
- * _dev 
+ * _dev
  */
 METHOD int read_ivar {
device_t _dev;
@@ -159,18 +159,18 @@ METHOD int read_ivar {
 
 /**
  * @brief Write the value of a bus-specific attribute of a device
- * 
+ *
  * This method sets the value of an instance variable to @p _value.
- * 
+ *
  * @param _dev the device whose child was being updated
  * @param _child   the child device whose instance variable is
  * being written
  * @param _index   the instance variable to write
  * @param _value   the value to write to that instance variable
- * 
+ *
  * @retval 0   success
  * @retval ENOENT  no such instance variable is supported by @p
- * _dev 
+ * _dev
  * @retval EINVAL  the instance variable was recognised but
  * contains a read-only value
  */
@@ -186,7 +186,7 @@ METHOD int write_ivar {
  *
  * Called at the beginning of device_delete_child() to allow the parent
  * to teardown any bus-specific state for the child.
- * 
+ *
  * @param _dev the device whose child is being deleted
  * @param _child   the child device which is being deleted
  */
@@ -200,7 +200,7 @@ METHOD void child_deleted {
  *
  * Called after the child's DEVICE_DETACH() method to allow the parent
  * to reclaim any resources allocated on behalf of the child.
- * 
+ *
  * @param _dev the device whose child changed state
  * @param _child   the child device which changed state
  */
@@ -211,11 +211,11 @@ METHOD void child_detached {
 
 /**
  * @brief Notify a bus that a new driver was added
- * 
+ *
  * Called when a new driver is added to the devclass which owns this
  * bus. The generic implementation of this method attempts to probe and
  * attach any un-matched children of the bus.
- * 
+ *
  * @param _dev the device whose devclass had a new driver
  * added to it
  * @param _driver  the new driver which was added
@@ -234,7 +234,7 @@ METHOD void driver_added {
  * existing child with the same order. Implementations of bus_add_child
  * call device_add_child_ordered to add the child and often add
  * a suitable ivar to the device specific to that bus.
- * 
+ *
  * @param _dev the bus device which will be the parent of the
  * new child device
  * @param _order   a value which is used to partially sort the
@@ -290,7 +290,7 @@ METHOD int rescan {
  * @param _flags   any extra flags to control the resource
  * allocation - see @c RF_XXX flags in
  *  for details
- * 
+ *
  * @returnsthe resource which was allocated or @c NULL if no
  * resource could be allocated
  */
@@ -378,7 +378,7 @@ METHOD int unmap_resource {
  * @brief Deactivate a resource
  *
  * Deactivate a resource previously allocated with
- * BUS_ALLOC_RESOURCE(). 
+ * BUS_ALLOC_RESOURCE().
  *
  * @param _dev the parent device of @p _child
  * @param _child   the device which allocated the resource
@@ -465,7 +465,7 @@ METHOD int release_resource {
  * argument. The value returned in @p *_cookiep is used to cancel the
  * 

svn commit: r358340 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-02-26 Thread Alexander Motin
Author: mav
Date: Wed Feb 26 16:04:24 2020
New Revision: 358340
URL: https://svnweb.freebsd.org/changeset/base/358340

Log:
  Fix patch mismerge in r358336.
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Wed Feb 
26 15:59:46 2020(r358339)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Wed Feb 
26 16:04:24 2020(r358340)
@@ -3681,8 +3681,6 @@ dsl_scan_scrub_done(zio_t *zio)
 
abd_free(zio->io_abd);
 
-   ASSERT3U(scn->scn_maxinflight_bytes, >, 0);
-
if (queue == NULL) {
mutex_enter(>spa_scrub_lock);
ASSERT3U(spa->spa_scrub_inflight, >=, BP_GET_PSIZE(bp));
@@ -3719,6 +3717,8 @@ scan_exec_io(dsl_pool_t *dp, const blkptr_t *bp, int z
size_t size = BP_GET_PSIZE(bp);
abd_t *data = abd_alloc_for_io(size, B_FALSE);
unsigned int scan_delay = 0;
+
+   ASSERT3U(scn->scn_maxinflight_bytes, >, 0);
 
if (queue == NULL) {
mutex_enter(>spa_scrub_lock);
___
svn-src-all@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 commit: r358339 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-02-26 Thread Alexander Motin
Author: mav
Date: Wed Feb 26 15:59:46 2020
New Revision: 358339
URL: https://svnweb.freebsd.org/changeset/base/358339

Log:
  MFZoL: Fix issue with scanning dedup blocks as scan ends
  
  This patch fixes an issue discovered by ztest where
  dsl_scan_ddt_entry() could add I/Os to the dsl scan queues
  between when the scan had finished all required work and
  when the scan was marked as complete. This caused the scan
  to spin indefinitely without ending.
  
  Reviewed-by: Brian Behlendorf 
  Reviewed-by: Serapheim Dimitropoulos 
  Reviewed-by: Matthew Ahrens 
  Signed-off-by: Tom Caputi 
  Closes #8010
  zfsonlinux/zfs@5e0bd0ae056e26de36dee3c199c6fcff8f14ee15
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Wed Feb 
26 15:56:07 2020(r358338)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Wed Feb 
26 15:59:46 2020(r358339)
@@ -2365,6 +2365,20 @@ dsl_scan_ddt_entry(dsl_scan_t *scn, enum zio_checksum 
if (!dsl_scan_is_running(scn))
return;
 
+   /*
+* This function is special because it is the only thing
+* that can add scan_io_t's to the vdev scan queues from
+* outside dsl_scan_sync(). For the most part this is ok
+* as long as it is called from within syncing context.
+* However, dsl_scan_sync() expects that no new sio's will
+* be added between when all the work for a scan is done
+* and the next txg when the scan is actually marked as
+* completed. This check ensures we do not issue new sio's
+* during this period.
+*/
+   if (scn->scn_done_txg != 0)
+   return;
+
for (p = 0; p < DDT_PHYS_TYPES; p++, ddp++) {
if (ddp->ddp_phys_birth == 0 ||
ddp->ddp_phys_birth > scn->scn_phys.scn_max_txg)
@@ -3416,6 +3430,8 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx)
   (longlong_t)tx->tx_txg);
}
} else if (scn->scn_is_sorted && scn->scn_bytes_pending != 0) {
+   ASSERT(scn->scn_clearing);
+
/* need to issue scrubbing IOs from per-vdev queues */
scn->scn_zio_root = zio_root(dp->dp_spa, NULL,
NULL, ZIO_FLAG_CANFAIL);
___
svn-src-all@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 commit: r358338 - head/sys/arm64/arm64

2020-02-26 Thread Andrew Turner
Author: andrew
Date: Wed Feb 26 15:56:07 2020
New Revision: 358338
URL: https://svnweb.freebsd.org/changeset/base/358338

Log:
  Fix the cache type identification
  
  DIC and IDC are supported when the field bits are set.
  
  Sponsored by: Innovate UK

Modified:
  head/sys/arm64/arm64/identcpu.c

Modified: head/sys/arm64/arm64/identcpu.c
==
--- head/sys/arm64/arm64/identcpu.c Wed Feb 26 15:47:40 2020
(r358337)
+++ head/sys/arm64/arm64/identcpu.c Wed Feb 26 15:56:07 2020
(r358338)
@@ -1119,9 +1119,9 @@ print_ctr_fields(struct sbuf *sb, uint64_t reg, void *
sbuf_printf(sb, "%d byte CWG", CTR_CWG_SIZE(reg));
reg &= ~(CTR_ERG_MASK | CTR_CWG_MASK);
 
-   if (CTR_IDC_VAL(reg) == 0)
+   if (CTR_IDC_VAL(reg) != 0)
sbuf_printf(sb, ",IDC");
-   if (CTR_DIC_VAL(reg) == 0)
+   if (CTR_DIC_VAL(reg) != 0)
sbuf_printf(sb, ",DIC");
reg &= ~(CTR_IDC_MASK | CTR_DIC_MASK);
reg &= ~CTR_RES1;
___
svn-src-all@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 commit: r358337 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-02-26 Thread Alexander Motin
Author: mav
Date: Wed Feb 26 15:47:40 2020
New Revision: 358337
URL: https://svnweb.freebsd.org/changeset/base/358337

Log:
  MFZoL: Fix 2 small bugs with cached dsl_scan_phys_t
  
  This patch corrects 2 small bugs where scn->scn_phys_cached was
  not properly updated to match the primary copy when it needed to
  be. The first resulted in the pause state not being properly
  updated and the second resulted in the cached version being
  completely zeroed even if the primary was not.
  
  Reviewed-by: Brian Behlendorf 
  Reviewed-by: Serapheim Dimitropoulos 
  Reviewed-by: Matthew Ahrens 
  Signed-off-by: Tom Caputi 
  Closes #8010
  zfsonlinux/zfs@8cb119e3dc0ac6c90b1517fbadc021b7e9741fc6
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Wed Feb 
26 15:45:04 2020(r358336)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Wed Feb 
26 15:47:40 2020(r358337)
@@ -448,7 +448,6 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t txg)
scn->scn_maxinflight_bytes = MAX(zfs_scan_vdev_limit *
dsl_scan_count_leaves(spa->spa_root_vdev), 1ULL << 20);
 
-   bcopy(>scn_phys, >scn_phys_cached, sizeof (scn->scn_phys));
avl_create(>scn_queue, scan_ds_queue_compare, sizeof (scan_ds_t),
offsetof(scan_ds_t, sds_node));
avl_create(>scn_prefetch_queue, scan_prefetch_queue_compare,
@@ -506,6 +505,8 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t txg)
}
}
 
+   bcopy(>scn_phys, >scn_phys_cached, sizeof (scn->scn_phys));
+
/* reload the queue into the in-core state */
if (scn->scn_phys.scn_queue_obj != 0) {
zap_cursor_t zc;
@@ -928,6 +929,7 @@ dsl_scrub_pause_resume_sync(void *arg, dmu_tx_t *tx)
/* can't pause a scrub when there is no in-progress scrub */
spa->spa_scan_pass_scrub_pause = gethrestime_sec();
scn->scn_phys.scn_flags |= DSF_SCRUB_PAUSED;
+   scn->scn_phys_cached.scn_flags |= DSF_SCRUB_PAUSED;
dsl_scan_sync_state(scn, tx, SYNC_CACHED);
spa_event_notify(spa, NULL, NULL, ESC_ZFS_SCRUB_PAUSED);
} else {
@@ -942,6 +944,7 @@ dsl_scrub_pause_resume_sync(void *arg, dmu_tx_t *tx)
gethrestime_sec() - spa->spa_scan_pass_scrub_pause;
spa->spa_scan_pass_scrub_pause = 0;
scn->scn_phys.scn_flags &= ~DSF_SCRUB_PAUSED;
+   scn->scn_phys_cached.scn_flags &= ~DSF_SCRUB_PAUSED;
dsl_scan_sync_state(scn, tx, SYNC_CACHED);
}
}
___
svn-src-all@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 commit: r358336 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-02-26 Thread Alexander Motin
Author: mav
Date: Wed Feb 26 15:45:04 2020
New Revision: 358336
URL: https://svnweb.freebsd.org/changeset/base/358336

Log:
  MFZoL: Fix txg_sync_thread hang in scan_exec_io()
  
  When scn->scn_maxinflight_bytes has not been initialized it's
  possible to hang on the condition variable in scan_exec_io().
  This issue was uncovered by ztest and is only possible when
  deduplication is enabled through the following call path.
  
txg_sync_thread()
  spa_sync()
ddt_sync_table()
  ddt_sync_entry()
dsl_scan_ddt_entry()
  dsl_scan_scrub_cb()
dsl_scan_enqueuei()
  scan_exec_io()
cv_wait()
  
  Resolve the issue by always initializing scn_maxinflight_bytes
  to a reasonable minimum value.  This value will be recalculated
  in dsl_scan_sync() to pick up changes to zfs_scan_vdev_limit
  and the addition/removal of vdevs.
  
  Reviewed-by: Tom Caputi 
  Reviewed by: George Melikov 
  Signed-off-by: Brian Behlendorf 
  Closes #7098
  zfsonlinux/zfs@f90a30ad1b32a971f62a540f8944e42f99b254ce
  
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Wed Feb 
26 15:15:55 2020(r358335)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c  Wed Feb 
26 15:45:04 2020(r358336)
@@ -125,6 +125,7 @@ static boolean_t scan_ds_queue_contains(dsl_scan_t *sc
 static void scan_ds_queue_insert(dsl_scan_t *scn, uint64_t dsobj, uint64_t 
txg);
 static void scan_ds_queue_remove(dsl_scan_t *scn, uint64_t dsobj);
 static void scan_ds_queue_sync(dsl_scan_t *scn, dmu_tx_t *tx);
+static uint64_t dsl_scan_count_leaves(vdev_t *vd);
 
 extern int zfs_vdev_async_write_active_min_dirty_percent;
 
@@ -439,6 +440,14 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t txg)
scn->scn_async_destroying = spa_feature_is_active(dp->dp_spa,
SPA_FEATURE_ASYNC_DESTROY);
 
+   /*
+* Calculate the max number of in-flight bytes for pool-wide
+* scanning operations (minimum 1MB). Limits for the issuing
+* phase are done per top-level vdev and are handled separately.
+*/
+   scn->scn_maxinflight_bytes = MAX(zfs_scan_vdev_limit *
+   dsl_scan_count_leaves(spa->spa_root_vdev), 1ULL << 20);
+
bcopy(>scn_phys, >scn_phys_cached, sizeof (scn->scn_phys));
avl_create(>scn_queue, scan_ds_queue_compare, sizeof (scan_ds_t),
offsetof(scan_ds_t, sds_node));
@@ -2350,7 +2359,7 @@ dsl_scan_ddt_entry(dsl_scan_t *scn, enum zio_checksum 
zbookmark_phys_t zb = { 0 };
int p;
 
-   if (scn->scn_phys.scn_state != DSS_SCANNING)
+   if (!dsl_scan_is_running(scn))
return;
 
for (p = 0; p < DDT_PHYS_TYPES; p++, ddp++) {
@@ -,7 +3342,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx)
uint64_t nr_leaves = dsl_scan_count_leaves(spa->spa_root_vdev);
 
/*
-* Calculate the max number of in-flight bytes for pool-wide
+* Recalculate the max number of in-flight bytes for pool-wide
 * scanning operations (minimum 1MB). Limits for the issuing
 * phase are done per top-level vdev and are handled separately.
 */
@@ -3652,6 +3661,8 @@ dsl_scan_scrub_done(zio_t *zio)
dsl_scan_io_queue_t *queue = zio->io_private;
 
abd_free(zio->io_abd);
+
+   ASSERT3U(scn->scn_maxinflight_bytes, >, 0);
 
if (queue == NULL) {
mutex_enter(>spa_scrub_lock);
___
svn-src-all@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"


Re: svn commit: r358334 - head/sys/sys

2020-02-26 Thread Paweł Biernacki
 Approved by:   kib (mentor, blanket)

> On 26 Feb 2020, at 16:12, Pawel Biernacki  wrote:
> 
> Author: kaktus
> Date: Wed Feb 26 15:12:38 2020
> New Revision: 358334
> URL: https://svnweb.freebsd.org/changeset/base/358334
> 
> Log:
>  Move the SYSCTL_ENFORCE_FLAGS to SYSCTL_NODE_WITH_LABEL where it should be
>  at the beginning.
> 
> Modified:
>  head/sys/sys/sysctl.h
> 
> Modified: head/sys/sys/sysctl.h
> ==
> --- head/sys/sys/sysctl.h Wed Feb 26 14:26:36 2020(r358333)
> +++ head/sys/sys/sysctl.h Wed Feb 26 15:12:38 2020(r358334)
> @@ -324,7 +324,6 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
>   SYSCTL_OID_RAW(sysctl___##name, __children,  \
>   nbr, #name, CTLTYPE_NODE|(access), NULL, 0, \
>   handler, "N", descr, NULL); \
> - SYSCTL_ENFORCE_FLAGS(access);   \
>   CTASSERT(((access) & CTLTYPE) == 0 ||   \
>   ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE)
> 
> @@ -335,6 +334,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
> #define   SYSCTL_NODE_WITH_LABEL(parent, nbr, name, access, handler, 
> descr, label) \
>   SYSCTL_OID_GLOBAL(parent, nbr, name, CTLTYPE_NODE|(access), \
>   NULL, 0, handler, "N", descr, label);   \
> + SYSCTL_ENFORCE_FLAGS(access);   \
>   CTASSERT(((access) & CTLTYPE) == 0 ||   \
>   ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE)
> 

___
svn-src-all@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 commit: r358335 - head/tests/sys/netinet

2020-02-26 Thread Li-Wen Hsu
Author: lwhsu
Date: Wed Feb 26 15:15:55 2020
New Revision: 358335
URL: https://svnweb.freebsd.org/changeset/base/358335

Log:
  Skip the right test case
  
  PR:   244172
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/netinet/fibs_test.sh

Modified: head/tests/sys/netinet/fibs_test.sh
==
--- head/tests/sys/netinet/fibs_test.sh Wed Feb 26 15:12:38 2020
(r358334)
+++ head/tests/sys/netinet/fibs_test.sh Wed Feb 26 15:15:55 2020
(r358335)
@@ -626,9 +626,6 @@ udp_dontroute_head()
 
 udp_dontroute_body()
 {
-   if [ "$(atf_config_get ci false)" = "true" ]; then
-   atf_skip "https://bugs.freebsd.org/244172;
-   fi
# Configure the TAP interface to use an RFC5737 nonrouteable address
# and a non-default fib
ADDR0="192.0.2.2"
@@ -680,6 +677,9 @@ udp_dontroute6_head()
 
 udp_dontroute6_body()
 {
+   if [ "$(atf_config_get ci false)" = "true" ]; then
+   atf_skip "https://bugs.freebsd.org/244172;
+   fi
# Configure the TAP interface to use an RFC3849 nonrouteable address
# and a non-default fib
ADDR0="2001:db8::2"
___
svn-src-all@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 commit: r358334 - head/sys/sys

2020-02-26 Thread Pawel Biernacki
Author: kaktus
Date: Wed Feb 26 15:12:38 2020
New Revision: 358334
URL: https://svnweb.freebsd.org/changeset/base/358334

Log:
  Move the SYSCTL_ENFORCE_FLAGS to SYSCTL_NODE_WITH_LABEL where it should be
  at the beginning.

Modified:
  head/sys/sys/sysctl.h

Modified: head/sys/sys/sysctl.h
==
--- head/sys/sys/sysctl.h   Wed Feb 26 14:26:36 2020(r358333)
+++ head/sys/sys/sysctl.h   Wed Feb 26 15:12:38 2020(r358334)
@@ -324,7 +324,6 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
SYSCTL_OID_RAW(sysctl___##name, __children,  \
nbr, #name, CTLTYPE_NODE|(access), NULL, 0, \
handler, "N", descr, NULL); \
-   SYSCTL_ENFORCE_FLAGS(access);   \
CTASSERT(((access) & CTLTYPE) == 0 ||   \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE)
 
@@ -335,6 +334,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
 #defineSYSCTL_NODE_WITH_LABEL(parent, nbr, name, access, handler, 
descr, label) \
SYSCTL_OID_GLOBAL(parent, nbr, name, CTLTYPE_NODE|(access), \
NULL, 0, handler, "N", descr, label);   \
+   SYSCTL_ENFORCE_FLAGS(access);   \
CTASSERT(((access) & CTLTYPE) == 0 ||   \
((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_NODE)
 
___
svn-src-all@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 commit: r358333 - in head/sys: amd64/amd64 amd64/linux32 arm/altera/socfpga arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/nvidia arm/nvidia/tegra124 arm/ti arm/ti/am335x arm/ti/cpsw...

2020-02-26 Thread Pawel Biernacki
Author: kaktus
Date: Wed Feb 26 14:26:36 2020
New Revision: 358333
URL: https://svnweb.freebsd.org/changeset/base/358333

Log:
  Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
  
  r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
  still not MPSAFE (or already are but aren’t properly marked).
  Use it in preparation for a general review of all nodes.
  
  This is non-functional change that adds annotations to SYSCTL_NODE and
  SYSCTL_PROC nodes using one of the soon-to-be-required flags.
  
  Mark all obvious cases as MPSAFE.  All entries that haven't been marked
  as MPSAFE before are by default marked as NEEDGIANT
  
  Approved by:  kib (mentor, blanket)
  Commented by: kib, gallatin, melifaro
  Differential Revision:https://reviews.freebsd.org/D23718

Modified:
  head/sys/amd64/amd64/efirt_machdep.c
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/amd64/pmap.c
  head/sys/amd64/amd64/prof_machdep.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/arm/altera/socfpga/socfpga_rstmgr.c
  head/sys/arm/arm/busdma_machdep.c
  head/sys/arm/arm/cpuinfo.c
  head/sys/arm/arm/machdep_boot.c
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/broadcom/bcm2835/bcm2835_audio.c
  head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c
  head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c
  head/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
  head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
  head/sys/arm/broadcom/bcm2835/bcm2835_pwm.c
  head/sys/arm/broadcom/bcm2835/bcm2835_rng.c
  head/sys/arm/broadcom/bcm2835/bcm2835_spi.c
  head/sys/arm/freescale/imx/imx6_anatop.c
  head/sys/arm/freescale/imx/imx_machdep.c
  head/sys/arm/mv/mv_thermal.c
  head/sys/arm/mv/mv_ts.c
  head/sys/arm/nvidia/tegra124/tegra124_coretemp.c
  head/sys/arm/nvidia/tegra_soctherm.c
  head/sys/arm/ti/am335x/am335x_ehrpwm.c
  head/sys/arm/ti/am335x/am335x_lcd.c
  head/sys/arm/ti/am335x/am335x_musb.c
  head/sys/arm/ti/cpsw/if_cpsw.c
  head/sys/arm/ti/ti_adc.c
  head/sys/arm/ti/ti_pruss.c
  head/sys/arm/ti/twl/twl_clks.c
  head/sys/arm/ti/twl/twl_vreg.c
  head/sys/arm/xilinx/zy7_devcfg.c
  head/sys/arm/xilinx/zy7_slcr.c
  head/sys/arm64/arm64/busdma_bounce.c
  head/sys/arm64/arm64/pmap.c
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_pmp.c
  head/sys/cam/cam.c
  head/sys/cam/cam_iosched.c
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend_block.c
  head/sys/cam/ctl/ctl_frontend_cam_sim.c
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_ha.c
  head/sys/cam/nvme/nvme_da.c
  head/sys/cam/scsi/scsi_all.c
  head/sys/cam/scsi/scsi_cd.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/cam/scsi/scsi_enc.c
  head/sys/cam/scsi/scsi_sa.c
  head/sys/cam/scsi/scsi_xpt.c
  head/sys/cddl/compat/opensolaris/kern/opensolaris_kstat.c
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
  head/sys/cddl/dev/dtrace/dtrace_sysctl.c
  head/sys/cddl/dev/dtrace/dtrace_test.c
  head/sys/cddl/dev/profile/profile.c
  head/sys/compat/ia32/ia32_sysvec.c
  head/sys/compat/linux/linux_mib.c
  head/sys/compat/ndis/subr_ntoskrnl.c
  head/sys/compat/x86bios/x86bios.c
  head/sys/contrib/rdma/krping/krping_dev.c
  head/sys/crypto/ccp/ccp_hardware.c
  head/sys/ddb/db_capture.c
  head/sys/ddb/db_main.c
  head/sys/ddb/db_script.c
  head/sys/ddb/db_textdump.c
  head/sys/dev/aac/aac.c
  head/sys/dev/aacraid/aacraid.c
  head/sys/dev/acpi_support/acpi_asus.c
  head/sys/dev/acpi_support/acpi_asus_wmi.c
  head/sys/dev/acpi_support/acpi_fujitsu.c
  head/sys/dev/acpi_support/acpi_hp.c
  head/sys/dev/acpi_support/acpi_ibm.c
  head/sys/dev/acpi_support/acpi_panasonic.c
  head/sys/dev/acpi_support/acpi_rapidstart.c
  head/sys/dev/acpi_support/acpi_sony.c
  head/sys/dev/acpi_support/acpi_toshiba.c
  head/sys/dev/acpi_support/atk0110.c
  head/sys/dev/acpica/acpi.c
  head/sys/dev/acpica/acpi_acad.c
  head/sys/dev/acpica/acpi_battery.c
  head/sys/dev/acpica/acpi_cpu.c
  head/sys/dev/acpica/acpi_dock.c
  head/sys/dev/acpica/acpi_ec.c
  head/sys/dev/acpica/acpi_smbat.c
  head/sys/dev/acpica/acpi_thermal.c
  head/sys/dev/acpica/acpi_timer.c
  head/sys/dev/acpica/acpi_video.c
  head/sys/dev/adb/adb_kbd.c
  head/sys/dev/adb/adb_mouse.c
  head/sys/dev/ae/if_ae.c
  head/sys/dev/age/if_age.c
  head/sys/dev/ahci/ahci.c
  head/sys/dev/aic7xxx/aic79xx_osm.c
  

svn commit: r358332 - in head/sys: net netinet

2020-02-26 Thread Randall Stewart
Author: rrs
Date: Wed Feb 26 13:48:33 2020
New Revision: 358332
URL: https://svnweb.freebsd.org/changeset/base/358332

Log:
  This commit expands tcp_ratelimit to be able to handle cards
  like the mlx-c5 and c6 that require a "setup" routine before
  the tcp_ratelimit code can declare and use a rate. I add the
  setup routine to if_var as well as fix tcp_ratelimit to call it.
  I also revisit the rates so that in the case of a mlx card
  of type c5/6 we will use about 100 rates concentrated in the range
  where the most gain can be had (1-200Mbps). Note that I have
  tested these on a c5 and they work and perform well. In fact
  in an unloaded system they pace right to the correct rate (great
  job mlx!). There will be a further commit here from Hans that
  will add the respective changes to the mlx driver to support this
  work (which I was testing with).
  
  Sponsored by: Netflix Inc.
  Differential Revision:ttps://reviews.freebsd.org/D23647

Modified:
  head/sys/net/if_var.h
  head/sys/netinet/tcp_ratelimit.c
  head/sys/netinet/tcp_ratelimit.h

Modified: head/sys/net/if_var.h
==
--- head/sys/net/if_var.h   Wed Feb 26 13:23:52 2020(r358331)
+++ head/sys/net/if_var.h   Wed Feb 26 13:48:33 2020(r358332)
@@ -252,6 +252,7 @@ union if_snd_tag_query_params {
 */
 #define RT_IS_FIXED_TABLE 0x0004   /* A fixed table is attached */
 #define RT_IS_UNUSABLE   0x0008/* It is not usable for this */
+#define RT_IS_SETUP_REQ  0x0010/* The interface setup must be 
called before use */
 
 struct if_ratelimit_query_results {
const uint64_t *rate_table; /* Pointer to table if present */
@@ -268,8 +269,8 @@ typedef int (if_snd_tag_query_t)(struct m_snd_tag *, u
 typedef void (if_snd_tag_free_t)(struct m_snd_tag *);
 typedef void (if_ratelimit_query_t)(struct ifnet *,
 struct if_ratelimit_query_results *);
+typedef int (if_ratelimit_setup_t)(struct ifnet *, uint64_t, uint32_t);
 
-
 /*
  * Structure defining a network interface.
  */
@@ -368,7 +369,7 @@ struct ifnet {
if_init_fn_tif_init;/* Init routine */
int (*if_resolvemulti)  /* validate/resolve multicast */
(struct ifnet *, struct sockaddr **, struct sockaddr *);
-   if_qflush_fn_t  if_qflush;  /* flush any queue */   
+   if_qflush_fn_t  if_qflush;  /* flush any queue */
if_transmit_fn_t if_transmit;   /* initiate output routine */
 
void(*if_reassign)  /* reassign to vnet routine */
@@ -411,6 +412,7 @@ struct ifnet {
if_snd_tag_query_t *if_snd_tag_query;
if_snd_tag_free_t *if_snd_tag_free;
if_ratelimit_query_t *if_ratelimit_query;
+   if_ratelimit_setup_t *if_ratelimit_setup;
 
/* Ethernet PCP */
uint8_t if_pcp;
@@ -555,7 +557,7 @@ struct ifaddr {
u_int   ifa_refcnt; /* references to this structure */
 
counter_u64_t   ifa_ipackets;
-   counter_u64_t   ifa_opackets;
+   counter_u64_t   ifa_opackets;
counter_u64_t   ifa_ibytes;
counter_u64_t   ifa_obytes;
struct  epoch_context   ifa_epoch_ctx;
@@ -769,7 +771,7 @@ void if_setstartfn(if_t ifp, void (*)(if_t));
 void if_settransmitfn(if_t ifp, if_transmit_fn_t);
 void if_setqflushfn(if_t ifp, if_qflush_fn_t);
 void if_setgetcounterfn(if_t ifp, if_get_counter_t);
- 
+
 /* Revisit the below. These are inline functions originally */
 int drbr_inuse_drv(if_t ifp, struct buf_ring *br);
 struct mbuf* drbr_dequeue_drv(if_t ifp, struct buf_ring *br);

Modified: head/sys/netinet/tcp_ratelimit.c
==
--- head/sys/netinet/tcp_ratelimit.cWed Feb 26 13:23:52 2020
(r358331)
+++ head/sys/netinet/tcp_ratelimit.cWed Feb 26 13:48:33 2020
(r358332)
@@ -66,45 +66,199 @@ __FBSDID("$FreeBSD$");
  * For the purposes of each send, what is the size
  * of an ethernet frame.
  */
-#ifndef ETHERNET_SEGMENT_SIZE
-#define ETHERNET_SEGMENT_SIZE 1500
-#endif
 MALLOC_DEFINE(M_TCPPACE, "tcp_hwpace", "TCP Hardware pacing memory");
 #ifdef RATELIMIT
 
+/*
+ * The following preferred table will seem weird to
+ * the casual viewer. Why do we not have any rates below
+ * 1Mbps? Why do we have a rate at 1.44Mbps called common?
+ * Why do the rates cluster in the 1-100Mbps range more
+ * than others? Why does the table jump around at the beginnign
+ * and then be more consistently raising?
+ *
+ * Let me try to answer those questions. A lot of
+ * this is dependant on the hardware. We have three basic
+ * supporters of rate limiting
+ *
+ * Chelsio - Supporting 16 configurable rates.
+ * Mlx  - c4 supporting 13 fixed rates.
+ * Mlx  - c5 & c6 supporting 127 configurable rates.
+ *
+ * The c4 is why we have a common rate that is available
+ * in all rate tables. This is a 

svn commit: r358331 - stable/12/sys/mips/conf

2020-02-26 Thread Kyle Evans
Author: kevans
Date: Wed Feb 26 13:23:52 2020
New Revision: 358331
URL: https://svnweb.freebsd.org/changeset/base/358331

Log:
  MFC r347515: Catch up with r347241 (if_tuntap rename).

Modified:
  stable/12/sys/mips/conf/std.AR_MIPS_BASE
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/mips/conf/std.AR_MIPS_BASE
==
--- stable/12/sys/mips/conf/std.AR_MIPS_BASEWed Feb 26 13:22:23 2020
(r358330)
+++ stable/12/sys/mips/conf/std.AR_MIPS_BASEWed Feb 26 13:23:52 2020
(r358331)
@@ -21,8 +21,8 @@ options   SCSI_NO_OP_STRINGS
 # .. And no sysctl strings
 optionsNO_SYSCTL_DESCR
 
-makeoptionsMODULES_OVERRIDE+="gpio ar71xx if_gif if_vlan if_gre if_tap"
-makeoptionsMODULES_OVERRIDE+="if_tun if_bridge bridgestp usb"
+makeoptionsMODULES_OVERRIDE+="gpio ar71xx if_gif if_vlan if_gre if_tuntap"
+makeoptionsMODULES_OVERRIDE+="if_bridge bridgestp usb"
 makeoptionsMODULES_OVERRIDE+="alq"
 
 # Random - required during early boot!
___
svn-src-all@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 commit: r358330 - head/sys/arm64/arm64

2020-02-26 Thread Andrew Turner
Author: andrew
Date: Wed Feb 26 13:22:23 2020
New Revision: 358330
URL: https://svnweb.freebsd.org/changeset/base/358330

Log:
  Teach the arm64 ident CPU code to print non-ID registers
  
  Add support for non-ID registers when printing CPU information. This is
  used with the cache type register to print details of the cache on boot.
  
  Sponsored by: Innovate UK

Modified:
  head/sys/arm64/arm64/identcpu.c

Modified: head/sys/arm64/arm64/identcpu.c
==
--- head/sys/arm64/arm64/identcpu.c Wed Feb 26 12:38:21 2020
(r358329)
+++ head/sys/arm64/arm64/identcpu.c Wed Feb 26 13:22:23 2020
(r358330)
@@ -112,6 +112,7 @@ struct cpu_desc {
uint64_tid_aa64mmfr2;
uint64_tid_aa64pfr0;
uint64_tid_aa64pfr1;
+   uint64_tctr;
 };
 
 static struct cpu_desc cpu_desc[MAXCPU];
@@ -128,6 +129,7 @@ static u_int cpu_print_regs;
 #definePRINT_ID_AA64_MMFR2 0x4000
 #definePRINT_ID_AA64_PFR0  0x0001
 #definePRINT_ID_AA64_PFR1  0x0002
+#definePRINT_CTR_EL0   0x1000
 
 struct cpu_parts {
u_int   part_id;
@@ -1089,14 +1091,66 @@ parse_cpu_features_hwcap(u_int cpu)
 }
 
 static void
-print_id_register(struct sbuf *sb, const char *reg_name, uint64_t reg,
-struct mrs_field *fields)
+print_ctr_fields(struct sbuf *sb, uint64_t reg, void *arg)
 {
-   struct mrs_field_value *fv;
-   int field, i, j, printed;
 
+   sbuf_printf(sb, "%u byte D-cacheline,", CTR_DLINE_SIZE(reg));
+   sbuf_printf(sb, "%u byte I-cacheline,", CTR_ILINE_SIZE(reg));
+   reg &= ~(CTR_DLINE_MASK | CTR_ILINE_MASK);
+
+   switch(CTR_L1IP_VAL(reg)) {
+   case CTR_L1IP_VPIPT:
+   sbuf_printf(sb, "VPIPT");
+   break;
+   case CTR_L1IP_AIVIVT:
+   sbuf_printf(sb, "AIVIVT");
+   break;
+   case CTR_L1IP_VIVT:
+   sbuf_printf(sb, "VIVT");
+   break;
+   case CTR_L1IP_PIPT:
+   sbuf_printf(sb, "PIPT");
+   break;
+   }
+   sbuf_printf(sb, " ICache,");
+   reg &= ~CTR_L1IP_MASK;
+
+   sbuf_printf(sb, "%d byte ERG,", CTR_ERG_SIZE(reg));
+   sbuf_printf(sb, "%d byte CWG", CTR_CWG_SIZE(reg));
+   reg &= ~(CTR_ERG_MASK | CTR_CWG_MASK);
+
+   if (CTR_IDC_VAL(reg) == 0)
+   sbuf_printf(sb, ",IDC");
+   if (CTR_DIC_VAL(reg) == 0)
+   sbuf_printf(sb, ",DIC");
+   reg &= ~(CTR_IDC_MASK | CTR_DIC_MASK);
+   reg &= ~CTR_RES1;
+
+   if (reg != 0)
+   sbuf_printf(sb, ",%lx", reg);
+}
+
+static void
+print_register(struct sbuf *sb, const char *reg_name, uint64_t reg,
+void (*print_fields)(struct sbuf *, uint64_t, void *), void *arg)
+{
+
sbuf_printf(sb, "%29s = <", reg_name);
 
+   print_fields(sb, reg, arg);
+
+   sbuf_finish(sb);
+   printf("%s>\n", sbuf_data(sb));
+   sbuf_clear(sb);
+}
+
+static void
+print_id_fields(struct sbuf *sb, uint64_t reg, void *arg)
+{
+   struct mrs_field *fields = arg;
+   struct mrs_field_value *fv;
+   int field, i, j, printed;
+
 #define SEP_STR((printed++) == 0) ? "" : ","
printed = 0;
for (i = 0; fields[i].type != 0; i++) {
@@ -1125,10 +1179,14 @@ print_id_register(struct sbuf *sb, const char *reg_nam
if (reg != 0)
sbuf_printf(sb, "%s%#lx", SEP_STR, reg);
 #undef SEP_STR
+}
 
-   sbuf_finish(sb);
-   printf("%s>\n", sbuf_data(sb));
-   sbuf_clear(sb);
+static void
+print_id_register(struct sbuf *sb, const char *reg_name, uint64_t reg,
+struct mrs_field *fields)
+{
+
+   print_register(sb, reg_name, reg, print_id_fields, fields);
 }
 
 static void
@@ -1184,6 +1242,12 @@ print_cpu_features(u_int cpu)
"hardware bugs that may cause the incorrect operation of "
"atomic operations.\n");
 
+   /* Cache Type Register */
+   if (cpu == 0 || (cpu_print_regs & PRINT_CTR_EL0) != 0) {
+   print_register(sb, "Cache Type",
+   cpu_desc[cpu].ctr, print_ctr_fields, NULL);
+   }
+
/* AArch64 Instruction Set Attribute Register 0 */
if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_ISAR0) != 0)
print_id_register(sb, "Instruction Set Attributes 0",
@@ -1295,6 +1359,7 @@ identify_cpu(void)
cpu_desc[cpu].mpidr = get_mpidr();
CPU_AFFINITY(cpu) = cpu_desc[cpu].mpidr & CPU_AFF_MASK;
 
+   cpu_desc[cpu].ctr = READ_SPECIALREG(ctr_el0);
cpu_desc[cpu].id_aa64dfr0 = READ_SPECIALREG(id_aa64dfr0_el1);
cpu_desc[cpu].id_aa64dfr1 = READ_SPECIALREG(id_aa64dfr1_el1);
cpu_desc[cpu].id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1);
@@ -1363,6 +1428,9 @@ identify_cpu(void)
cpu_print_regs |= PRINT_ID_AA64_PFR0;
if (cpu_desc[cpu].id_aa64pfr1 != 

svn commit: r358329 - head/sys/sys

2020-02-26 Thread Pietro Cerutti
Author: gahr (ports committer)
Date: Wed Feb 26 12:38:21 2020
New Revision: 358329
URL: https://svnweb.freebsd.org/changeset/base/358329

Log:
  Trim trailing white space in comment
  
  Approved by:  cognet

Modified:
  head/sys/sys/queue.h

Modified: head/sys/sys/queue.h
==
--- head/sys/sys/queue.hWed Feb 26 11:50:24 2020(r358328)
+++ head/sys/sys/queue.hWed Feb 26 12:38:21 2020(r358329)
@@ -817,7 +817,7 @@ struct {
\
 /*
  * The FAST function is fast in that it causes no data access other
  * then the access to the head. The standard LAST function above
- * will cause a data access of both the element you want and 
+ * will cause a data access of both the element you want and
  * the previous element. FAST is very useful for instances when
  * you may want to prefetch the last data element.
  */
___
svn-src-all@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 commit: r358328 - in head/sys/arm64: arm64 include

2020-02-26 Thread Andrew Turner
Author: andrew
Date: Wed Feb 26 11:50:24 2020
New Revision: 358328
URL: https://svnweb.freebsd.org/changeset/base/358328

Log:
  Generalise the arm64 ASID allocator.
  
  The requirements of an Address Space ID allocator and a Virtual Machine ID
  allocator are similar. Generalise the former code so it can be used with
  the latter.
  
  Reviewed by:  alc (previous version)
  Sponsored by: Innovate UK
  Differential Revision:https://reviews.freebsd.org/D23831

Modified:
  head/sys/arm64/arm64/pmap.c
  head/sys/arm64/include/pmap.h

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Wed Feb 26 11:47:24 2020(r358327)
+++ head/sys/arm64/arm64/pmap.c Wed Feb 26 11:50:24 2020(r358328)
@@ -283,19 +283,24 @@ static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0,
  * numbers and INT_MAX are reserved for special cases that are described
  * below.
  */
+struct asid_set {
+   int asid_bits;
+   bitstr_t *asid_set;
+   int asid_set_size;
+   int asid_next;
+   int asid_epoch;
+   struct mtx asid_set_mutex;
+};
+
+static struct asid_set asids;
+
 static SYSCTL_NODE(_vm_pmap, OID_AUTO, asid, CTLFLAG_RD, 0, "ASID allocator");
-static int asid_bits;
-SYSCTL_INT(_vm_pmap_asid, OID_AUTO, bits, CTLFLAG_RD, _bits, 0,
+SYSCTL_INT(_vm_pmap_asid, OID_AUTO, bits, CTLFLAG_RD, _bits, 0,
 "The number of bits in an ASID");
-static bitstr_t *asid_set;
-static int asid_set_size;
-static int asid_next;
-SYSCTL_INT(_vm_pmap_asid, OID_AUTO, next, CTLFLAG_RD, _next, 0,
+SYSCTL_INT(_vm_pmap_asid, OID_AUTO, next, CTLFLAG_RD, _next, 0,
 "The last allocated ASID plus one");
-static int asid_epoch;
-SYSCTL_INT(_vm_pmap_asid, OID_AUTO, epoch, CTLFLAG_RD, _epoch, 0,
+SYSCTL_INT(_vm_pmap_asid, OID_AUTO, epoch, CTLFLAG_RD, _epoch, 0,
 "The current epoch number");
-static struct mtx asid_set_mutex;
 
 /*
  * A pmap's cookie encodes an ASID and epoch number.  Cookies for reserved
@@ -349,7 +354,7 @@ static int pmap_remove_l2(pmap_t pmap, pt_entry_t *l2,
 pd_entry_t l1e, struct spglist *free, struct rwlock **lockp);
 static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t sva,
 pd_entry_t l2e, struct spglist *free, struct rwlock **lockp);
-static void pmap_reset_asid_set(void);
+static void pmap_reset_asid_set(pmap_t pmap);
 static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va,
 vm_page_t m, struct rwlock **lockp);
 
@@ -849,6 +854,7 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_
kernel_pmap->pm_l0_paddr = l0pt - kern_delta;
kernel_pmap->pm_cookie = COOKIE_FROM(-1, INT_MIN);
kernel_pmap->pm_stage = PM_STAGE1;
+   kernel_pmap->pm_asid_set = 
 
/* Assume the address we were loaded to is a valid physical address */
min_pa = KERNBASE - kern_delta;
@@ -950,6 +956,26 @@ pmap_page_init(vm_page_t m)
m->md.pv_memattr = VM_MEMATTR_WRITE_BACK;
 }
 
+static void
+pmap_init_asids(struct asid_set *set, int bits)
+{
+   int i;
+
+   set->asid_bits = bits;
+
+   /*
+* We may be too early in the overall initialization process to use
+* bit_alloc().
+*/
+   set->asid_set_size = 1 << set->asid_bits;
+   set->asid_set = (bitstr_t *)kmem_malloc(bitstr_size(set->asid_set_size),
+   M_WAITOK | M_ZERO);
+   for (i = 0; i < ASID_FIRST_AVAILABLE; i++)
+   bit_set(set->asid_set, i);
+   set->asid_next = ASID_FIRST_AVAILABLE;
+   mtx_init(>asid_set_mutex, "asid set", NULL, MTX_SPIN);
+}
+
 /*
  * Initialize the pmap module.
  * Called by vm_init, to initialize any structures that the pmap
@@ -962,11 +988,6 @@ pmap_init(void)
int i, pv_npg;
 
/*
-* Determine whether an ASID is 8 or 16 bits in size.
-*/
-   asid_bits = (READ_SPECIALREG(tcr_el1) & TCR_ASID_16) != 0 ? 16 : 8;
-
-   /*
 * Are large page mappings enabled?
 */
TUNABLE_INT_FETCH("vm.pmap.superpages_enabled", _enabled);
@@ -977,16 +998,10 @@ pmap_init(void)
}
 
/*
-* Initialize the ASID allocator.  At this point, we are still too
-* early in the overall initialization process to use bit_alloc().
+* Initialize the ASID allocator.
 */
-   asid_set_size = 1 << asid_bits;
-   asid_set = (bitstr_t *)kmem_malloc(bitstr_size(asid_set_size),
-   M_WAITOK | M_ZERO);
-   for (i = 0; i < ASID_FIRST_AVAILABLE; i++)
-   bit_set(asid_set, i);
-   asid_next = ASID_FIRST_AVAILABLE;
-   mtx_init(_set_mutex, "asid set", NULL, MTX_SPIN);
+   pmap_init_asids(,
+   (READ_SPECIALREG(tcr_el1) & TCR_ASID_16) != 0 ? 16 : 8);
 
/*
 * Initialize the pv chunk list mutex.
@@ -1552,6 +1567,7 @@ pmap_pinit0(pmap_t pmap)
pmap->pm_root.rt_root = 0;
pmap->pm_cookie = COOKIE_FROM(ASID_RESERVED_FOR_PID_0, INT_MIN);

svn commit: r358327 - in head/sys/arm64: arm64 include

2020-02-26 Thread Andrew Turner
Author: andrew
Date: Wed Feb 26 11:47:24 2020
New Revision: 358327
URL: https://svnweb.freebsd.org/changeset/base/358327

Log:
  Start to support multiple stages in the arm64 pmap.
  
  On arm64 the stage 1 and stage 2 pte formats are similar enough we can
  reuse the pmap code for both. As they are only similar and not identical
  we need to know if we are managing stage 1 or stage 2 tables.
  
  Add an enum to store this information and a check to make sure it is
  set to stage 1 when we manage stage 1 pte fields.
  
  Sponsored by: Innovate UK
  Differential Revision:https://reviews.freebsd.org/D23830

Modified:
  head/sys/arm64/arm64/pmap.c
  head/sys/arm64/include/pmap.h

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Wed Feb 26 11:29:03 2020(r358326)
+++ head/sys/arm64/arm64/pmap.c Wed Feb 26 11:47:24 2020(r358327)
@@ -150,6 +150,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#definePMAP_ASSERT_STAGE1(pmap)MPASS((pmap)->pm_stage == 
PM_STAGE1)
+
 #defineNL0PG   (PAGE_SIZE/(sizeof (pd_entry_t)))
 #defineNL1PG   (PAGE_SIZE/(sizeof (pd_entry_t)))
 #defineNL2PG   (PAGE_SIZE/(sizeof (pd_entry_t)))
@@ -586,9 +588,10 @@ CTASSERT(L1_BLOCK == L2_BLOCK);
  * Checks if the PTE is dirty.
  */
 static inline int
-pmap_pte_dirty(pt_entry_t pte)
+pmap_pte_dirty(pmap_t pmap, pt_entry_t pte)
 {
 
+   PMAP_ASSERT_STAGE1(pmap);
KASSERT((pte & ATTR_SW_MANAGED) != 0, ("pte %#lx is unmanaged", pte));
KASSERT((pte & (ATTR_S1_AP_RW_BIT | ATTR_SW_DBM)) != 0,
("pte %#lx is writeable and missing ATTR_SW_DBM", pte));
@@ -845,6 +848,7 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_
PMAP_LOCK_INIT(kernel_pmap);
kernel_pmap->pm_l0_paddr = l0pt - kern_delta;
kernel_pmap->pm_cookie = COOKIE_FROM(-1, INT_MIN);
+   kernel_pmap->pm_stage = PM_STAGE1;
 
/* Assume the address we were loaded to is a valid physical address */
min_pa = KERNBASE - kern_delta;
@@ -1040,6 +1044,8 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
 {
uint64_t r;
 
+   PMAP_ASSERT_STAGE1(pmap);
+
dsb(ishst);
if (pmap == kernel_pmap) {
r = atop(va);
@@ -1057,6 +1063,8 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm
 {
uint64_t end, r, start;
 
+   PMAP_ASSERT_STAGE1(pmap);
+
dsb(ishst);
if (pmap == kernel_pmap) {
start = atop(sva);
@@ -1079,6 +1087,8 @@ pmap_invalidate_all(pmap_t pmap)
 {
uint64_t r;
 
+   PMAP_ASSERT_STAGE1(pmap);
+
dsb(ishst);
if (pmap == kernel_pmap) {
__asm __volatile("tlbi vmalle1is");
@@ -1153,6 +1163,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_
vm_page_t m;
int lvl;
 
+   PMAP_ASSERT_STAGE1(pmap);
+
m = NULL;
PMAP_LOCK(pmap);
pte = pmap_pte(pmap, va, );
@@ -1539,6 +1551,7 @@ pmap_pinit0(pmap_t pmap)
pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr);
pmap->pm_root.rt_root = 0;
pmap->pm_cookie = COOKIE_FROM(ASID_RESERVED_FOR_PID_0, INT_MIN);
+   pmap->pm_stage = PM_STAGE1;
 
PCPU_SET(curpmap, pmap);
 }
@@ -1564,6 +1577,7 @@ pmap_pinit(pmap_t pmap)
pmap->pm_root.rt_root = 0;
bzero(>pm_stats, sizeof(pmap->pm_stats));
pmap->pm_cookie = COOKIE_FROM(-1, INT_MAX);
+   pmap->pm_stage = PM_STAGE1;
/* XXX Temporarily disable deferred ASID allocation. */
pmap_alloc_asid(pmap);
 
@@ -1828,6 +1842,7 @@ pmap_release(pmap_t pmap)
pmap->pm_stats.resident_count));
KASSERT(vm_radix_is_empty(>pm_root),
("pmap_release: pmap has reserved page table page(s)"));
+   PMAP_ASSERT_STAGE1(pmap);
 
mtx_lock_spin(_set_mutex);
if (COOKIE_TO_EPOCH(pmap->pm_cookie) == asid_epoch) {
@@ -2089,7 +2104,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l
continue;
tpte = pmap_load_clear(pte);
m = PHYS_TO_VM_PAGE(tpte & ~ATTR_MASK);
-   if (pmap_pte_dirty(tpte))
+   if (pmap_pte_dirty(pmap, tpte))
vm_page_dirty(m);
if ((tpte & ATTR_AF) != 0) {
pmap_invalidate_page(pmap, va);
@@ -2588,7 +2603,7 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_
eva = sva + L2_SIZE;
for (va = sva, m = PHYS_TO_VM_PAGE(old_l2 & ~ATTR_MASK);
va < eva; va += PAGE_SIZE, m++) {
-   if (pmap_pte_dirty(old_l2))
+   if (pmap_pte_dirty(pmap, old_l2))
vm_page_dirty(m);
if 

svn commit: r358326 - in head/sys/arm64: arm64 include

2020-02-26 Thread Andrew Turner
Author: andrew
Date: Wed Feb 26 11:29:03 2020
New Revision: 358326
URL: https://svnweb.freebsd.org/changeset/base/358326

Log:
  Add more arm64 CTR_EL0 register fields
  
  While here make the _SIZE macros return the size in bytes, not the log2
  of the size
  
  Sponsored by: Innovate UK

Modified:
  head/sys/arm64/arm64/machdep.c
  head/sys/arm64/include/armreg.h

Modified: head/sys/arm64/arm64/machdep.c
==
--- head/sys/arm64/arm64/machdep.c  Wed Feb 26 08:47:18 2020
(r358325)
+++ head/sys/arm64/arm64/machdep.c  Wed Feb 26 11:29:03 2020
(r358326)
@@ -1047,20 +1047,16 @@ bus_probe(void)
 static void
 cache_setup(void)
 {
-   int dcache_line_shift, icache_line_shift, dczva_line_shift;
+   int dczva_line_shift;
uint32_t ctr_el0;
uint32_t dczid_el0;
 
ctr_el0 = READ_SPECIALREG(ctr_el0);
 
-   /* Read the log2 words in each D cache line */
-   dcache_line_shift = CTR_DLINE_SIZE(ctr_el0);
/* Get the D cache line size */
-   dcache_line_size = sizeof(int) << dcache_line_shift;
-
+   dcache_line_size = CTR_DLINE_SIZE(ctr_el0);
/* And the same for the I cache */
-   icache_line_shift = CTR_ILINE_SIZE(ctr_el0);
-   icache_line_size = sizeof(int) << icache_line_shift;
+   icache_line_size = CTR_ILINE_SIZE(ctr_el0);
 
idcache_line_size = MIN(dcache_line_size, icache_line_size);
 

Modified: head/sys/arm64/include/armreg.h
==
--- head/sys/arm64/include/armreg.h Wed Feb 26 08:47:18 2020
(r358325)
+++ head/sys/arm64/include/armreg.h Wed Feb 26 11:29:03 2020
(r358326)
@@ -82,12 +82,39 @@
 #defineCPACR_TTA   (0x1 << 28)
 
 /* CTR_EL0 - Cache Type Register */
+#defineCTR_RES1(1 << 31)
+#defineCTR_TminLine_SHIFT  32
+#defineCTR_TminLine_MASK   (UL(0x3f) << CTR_TminLine_SHIFT)
+#defineCTR_TminLine_VAL(reg)   ((reg) & CTR_TminLine_MASK)
+#defineCTR_DIC_SHIFT   29
+#defineCTR_DIC_MASK(0x1 << CTR_DIC_SHIFT)
+#defineCTR_DIC_VAL(reg)((reg) & CTR_DIC_MASK)
+#defineCTR_IDC_SHIFT   28
+#defineCTR_IDC_MASK(0x1 << CTR_IDC_SHIFT)
+#defineCTR_IDC_VAL(reg)((reg) & CTR_IDC_MASK)
+#defineCTR_CWG_SHIFT   24
+#defineCTR_CWG_MASK(0xf << CTR_CWG_SHIFT)
+#defineCTR_CWG_VAL(reg)((reg) & CTR_CWG_MASK)
+#defineCTR_CWG_SIZE(reg)   (4 << (CTR_CWG_VAL(reg) >> 
CTR_CWG_SHIFT))
+#defineCTR_ERG_SHIFT   20
+#defineCTR_ERG_MASK(0xf << CTR_ERG_SHIFT)
+#defineCTR_ERG_VAL(reg)((reg) & CTR_ERG_MASK)
+#defineCTR_ERG_SIZE(reg)   (4 << (CTR_ERG_VAL(reg) >> 
CTR_ERG_SHIFT))
 #defineCTR_DLINE_SHIFT 16
 #defineCTR_DLINE_MASK  (0xf << CTR_DLINE_SHIFT)
-#defineCTR_DLINE_SIZE(reg) (((reg) & CTR_DLINE_MASK) >> 
CTR_DLINE_SHIFT)
+#defineCTR_DLINE_VAL(reg)  ((reg) & CTR_DLINE_MASK)
+#defineCTR_DLINE_SIZE(reg) (4 << (CTR_DLINE_VAL(reg) >> 
CTR_DLINE_SHIFT))
+#defineCTR_L1IP_SHIFT  14
+#defineCTR_L1IP_MASK   (0x3 << CTR_L1IP_SHIFT)
+#defineCTR_L1IP_VAL(reg)   ((reg) & CTR_L1IP_MASK)
+#define CTR_L1IP_VPIPT (0 << CTR_L1IP_SHIFT)
+#define CTR_L1IP_AIVIVT(1 << CTR_L1IP_SHIFT)
+#define CTR_L1IP_VIVT  (2 << CTR_L1IP_SHIFT)
+#define CTR_L1IP_PIPT  (3 << CTR_L1IP_SHIFT)
 #defineCTR_ILINE_SHIFT 0
 #defineCTR_ILINE_MASK  (0xf << CTR_ILINE_SHIFT)
-#defineCTR_ILINE_SIZE(reg) (((reg) & CTR_ILINE_MASK) >> 
CTR_ILINE_SHIFT)
+#defineCTR_ILINE_VAL(reg)  ((reg) & CTR_ILINE_MASK)
+#defineCTR_ILINE_SIZE(reg) (4 << (CTR_ILINE_VAL(reg) >> 
CTR_ILINE_SHIFT))
 
 /* DAIF - Interrupt Mask Bits */
 #defineDAIF_D_MASKED   (1 << 9)
___
svn-src-all@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 commit: r358325 - head/sys/net

2020-02-26 Thread Kristof Provost
Author: kp
Date: Wed Feb 26 08:47:18 2020
New Revision: 358325
URL: https://svnweb.freebsd.org/changeset/base/358325

Log:
  bridge: Move locking defines into if_bridge.c
  
  The locking defines for if_bridge used to live in if_bridgevar.h, but
  they're only ever used by the bridge implementation itself (in
  if_bridge.c). Moving them into the .c file.
  
  Reported by:  philip, emaste
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D23808

Modified:
  head/sys/net/if_bridge.c
  head/sys/net/if_bridgevar.h

Modified: head/sys/net/if_bridge.c
==
--- head/sys/net/if_bridge.cWed Feb 26 04:54:50 2020(r358324)
+++ head/sys/net/if_bridge.cWed Feb 26 08:47:18 2020(r358325)
@@ -185,6 +185,47 @@ extern voidnd6_setmtu(struct ifnet *);
 #defineBRIDGE_IFCAPS_STRIP IFCAP_LRO
 
 /*
+ * Bridge locking
+ */
+#define BRIDGE_LOCK_INIT(_sc)  do {\
+   mtx_init(&(_sc)->sc_mtx, "if_bridge", NULL, MTX_DEF);   \
+   cv_init(&(_sc)->sc_cv, "if_bridge_cv"); \
+} while (0)
+#define BRIDGE_LOCK_DESTROY(_sc)   do {\
+   mtx_destroy(&(_sc)->sc_mtx);\
+   cv_destroy(&(_sc)->sc_cv);  \
+} while (0)
+#define BRIDGE_LOCK(_sc)   mtx_lock(&(_sc)->sc_mtx)
+#define BRIDGE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
+#define BRIDGE_LOCK_ASSERT(_sc)mtx_assert(&(_sc)->sc_mtx, 
MA_OWNED)
+#define BRIDGE_UNLOCK_ASSERT(_sc)  mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED)
+#defineBRIDGE_LOCK2REF(_sc, _err)  do {\
+   mtx_assert(&(_sc)->sc_mtx, MA_OWNED);   \
+   if ((_sc)->sc_iflist_xcnt > 0)  \
+   (_err) = EBUSY; \
+   else\
+   (_sc)->sc_iflist_ref++; \
+   mtx_unlock(&(_sc)->sc_mtx); \
+} while (0)
+#defineBRIDGE_UNREF(_sc)   do {
\
+   mtx_lock(&(_sc)->sc_mtx);   \
+   (_sc)->sc_iflist_ref--; \
+   if (((_sc)->sc_iflist_xcnt > 0) && ((_sc)->sc_iflist_ref == 0)) \
+   cv_broadcast(&(_sc)->sc_cv);\
+   mtx_unlock(&(_sc)->sc_mtx); \
+} while (0)
+#defineBRIDGE_XLOCK(_sc)   do {\
+   mtx_assert(&(_sc)->sc_mtx, MA_OWNED);   \
+   (_sc)->sc_iflist_xcnt++;\
+   while ((_sc)->sc_iflist_ref > 0)\
+   cv_wait(&(_sc)->sc_cv, &(_sc)->sc_mtx); \
+} while (0)
+#defineBRIDGE_XDROP(_sc)   do {\
+   mtx_assert(&(_sc)->sc_mtx, MA_OWNED);   \
+   (_sc)->sc_iflist_xcnt--;\
+} while (0)
+
+/*
  * Bridge interface list entry.
  */
 struct bridge_iflist {

Modified: head/sys/net/if_bridgevar.h
==
--- head/sys/net/if_bridgevar.h Wed Feb 26 04:54:50 2020(r358324)
+++ head/sys/net/if_bridgevar.h Wed Feb 26 08:47:18 2020(r358325)
@@ -271,44 +271,6 @@ struct ifbpstpconf {
 
 #ifdef _KERNEL
 
-#define BRIDGE_LOCK_INIT(_sc)  do {\
-   mtx_init(&(_sc)->sc_mtx, "if_bridge", NULL, MTX_DEF);   \
-   cv_init(&(_sc)->sc_cv, "if_bridge_cv"); \
-} while (0)
-#define BRIDGE_LOCK_DESTROY(_sc)   do {\
-   mtx_destroy(&(_sc)->sc_mtx);\
-   cv_destroy(&(_sc)->sc_cv);  \
-} while (0)
-#define BRIDGE_LOCK(_sc)   mtx_lock(&(_sc)->sc_mtx)
-#define BRIDGE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
-#define BRIDGE_LOCK_ASSERT(_sc)mtx_assert(&(_sc)->sc_mtx, 
MA_OWNED)
-#define BRIDGE_UNLOCK_ASSERT(_sc)  mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED)
-#defineBRIDGE_LOCK2REF(_sc, _err)  do {\
-   mtx_assert(&(_sc)->sc_mtx, MA_OWNED);   \
-   if ((_sc)->sc_iflist_xcnt > 0)  \
-   (_err) = EBUSY; \
-   else\
-   (_sc)->sc_iflist_ref++; \
-   mtx_unlock(&(_sc)->sc_mtx); \
-} while (0)
-#defineBRIDGE_UNREF(_sc)   do {
\
-   mtx_lock(&(_sc)->sc_mtx);   \
-   (_sc)->sc_iflist_ref--; \
-   if (((_sc)->sc_iflist_xcnt > 0) && ((_sc)->sc_iflist_ref == 0)) \
-   cv_broadcast(&(_sc)->sc_cv);\
-   mtx_unlock(&(_sc)->sc_mtx); \
-} while (0)
-#defineBRIDGE_XLOCK(_sc)   do {\
-   mtx_assert(&(_sc)->sc_mtx, MA_OWNED);