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

2020-11-27 Thread John Baldwin
Author: jhb
Date: Sat Nov 28 04:21:22 2020
New Revision: 368119
URL: https://svnweb.freebsd.org/changeset/base/368119

Log:
  Suspend I/O on ahci-cd devices during a snapshot.
  
  Submitted by: Vitaliy Gusev 

Modified:
  head/usr.sbin/bhyve/snapshot.c

Modified: head/usr.sbin/bhyve/snapshot.c
==
--- head/usr.sbin/bhyve/snapshot.c  Sat Nov 28 04:06:09 2020
(r368118)
+++ head/usr.sbin/bhyve/snapshot.c  Sat Nov 28 04:21:22 2020
(r368119)
@@ -154,7 +154,7 @@ const struct vm_snapshot_dev_info snapshot_devs[] = {
{ "e1000",  pci_snapshot,   NULL,   NULL
},
{ "ahci",   pci_snapshot,   pci_pause,  pci_resume  
},
{ "ahci-hd",pci_snapshot,   pci_pause,  pci_resume  
},
-   { "ahci-cd",pci_snapshot,   NULL,   NULL
},
+   { "ahci-cd",pci_snapshot,   pci_pause,  pci_resume  
},
 };
 
 const struct vm_snapshot_kern_info snapshot_kern_structs[] = {
___
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: r368118 - head/usr.sbin/bhyve

2020-11-27 Thread John Baldwin
Author: jhb
Date: Sat Nov 28 04:06:09 2020
New Revision: 368118
URL: https://svnweb.freebsd.org/changeset/base/368118

Log:
  bhyve: Add snapshot support for virtio-rnd.
  
  This uses the same snapshot routine as other VirtIO devices.
  
  Submitted by: Vitaliy Gusev 
  Differential Revision:https://reviews.freebsd.org/D26265

Modified:
  head/usr.sbin/bhyve/pci_virtio_rnd.c
  head/usr.sbin/bhyve/snapshot.c

Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c
==
--- head/usr.sbin/bhyve/pci_virtio_rnd.cSat Nov 28 03:54:48 2020
(r368117)
+++ head/usr.sbin/bhyve/pci_virtio_rnd.cSat Nov 28 04:06:09 2020
(r368118)
@@ -205,6 +205,9 @@ struct pci_devemu pci_de_vrnd = {
.pe_emu =   "virtio-rnd",
.pe_init =  pci_vtrnd_init,
.pe_barwrite =  vi_pci_write,
-   .pe_barread =   vi_pci_read
+   .pe_barread =   vi_pci_read,
+#ifdef BHYVE_SNAPSHOT
+   .pe_snapshot =  vi_pci_snapshot,
+#endif
 };
 PCI_EMUL_SET(pci_de_vrnd);

Modified: head/usr.sbin/bhyve/snapshot.c
==
--- head/usr.sbin/bhyve/snapshot.c  Sat Nov 28 03:54:48 2020
(r368117)
+++ head/usr.sbin/bhyve/snapshot.c  Sat Nov 28 04:06:09 2020
(r368118)
@@ -147,6 +147,7 @@ const struct vm_snapshot_dev_info snapshot_devs[] = {
{ "atkbdc", atkbdc_snapshot,NULL,   NULL
},
{ "virtio-net", pci_snapshot,   pci_pause,  pci_resume  
},
{ "virtio-blk", pci_snapshot,   pci_pause,  pci_resume  
},
+   { "virtio-rnd", pci_snapshot,   NULL,   NULL
},
{ "lpc",pci_snapshot,   NULL,   NULL
},
{ "fbuf",   pci_snapshot,   NULL,   NULL
},
{ "xhci",   pci_snapshot,   NULL,   NULL
},
___
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: r368117 - head/usr.sbin/bhyve

2020-11-27 Thread John Baldwin
Author: jhb
Date: Sat Nov 28 03:54:48 2020
New Revision: 368117
URL: https://svnweb.freebsd.org/changeset/base/368117

Log:
  bhyve: 'xhci,tablet' snapshot fixes
  
  Permit suspend/resume of a XHCI device model that has not been
  attached to by a driver in a guest OS.
  
  Submitted by: Vitaliy Gusev 
  Differential Revision:https://reviews.freebsd.org/D26264

Modified:
  head/usr.sbin/bhyve/pci_xhci.c

Modified: head/usr.sbin/bhyve/pci_xhci.c
==
--- head/usr.sbin/bhyve/pci_xhci.c  Sat Nov 28 01:21:11 2020
(r368116)
+++ head/usr.sbin/bhyve/pci_xhci.c  Sat Nov 28 03:54:48 2020
(r368117)
@@ -2251,7 +2251,6 @@ pci_xhci_write(struct vmctx *ctx, int vcpu, struct pci
 
assert(baridx == 0);
 
-
pthread_mutex_lock(>mtx);
if (offset < XHCI_CAPLEN)   /* read only registers */
WPRINTF(("pci_xhci: write RO-CAPs offset %ld", offset));
@@ -2981,11 +2980,11 @@ pci_xhci_snapshot(struct vm_snapshot_meta *meta)
 
/* opregs.cr_p */
SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(sc->opregs.cr_p,
-   XHCI_GADDR_SIZE(sc->opregs.cr_p), false, meta, ret, done);
+   XHCI_GADDR_SIZE(sc->opregs.cr_p), true, meta, ret, done);
 
/* opregs.dcbaa_p */
SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(sc->opregs.dcbaa_p,
-   XHCI_GADDR_SIZE(sc->opregs.dcbaa_p), false, meta, ret, done);
+   XHCI_GADDR_SIZE(sc->opregs.dcbaa_p), true, meta, ret, done);
 
/* rtsregs */
SNAPSHOT_VAR_OR_LEAVE(sc->rtsregs.mfindex, meta, ret, done);
@@ -3000,11 +2999,11 @@ pci_xhci_snapshot(struct vm_snapshot_meta *meta)
 
/* rtsregs.erstba_p */
SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(sc->rtsregs.erstba_p,
-   XHCI_GADDR_SIZE(sc->rtsregs.erstba_p), false, meta, ret, done);
+   XHCI_GADDR_SIZE(sc->rtsregs.erstba_p), true, meta, ret, done);
 
/* rtsregs.erst_p */
SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(sc->rtsregs.erst_p,
-   XHCI_GADDR_SIZE(sc->rtsregs.erst_p), false, meta, ret, done);
+   XHCI_GADDR_SIZE(sc->rtsregs.erst_p), true, meta, ret, done);
 
SNAPSHOT_VAR_OR_LEAVE(sc->rtsregs.er_deq_seg, meta, ret, done);
SNAPSHOT_VAR_OR_LEAVE(sc->rtsregs.er_enq_idx, meta, ret, done);
@@ -3090,12 +3089,14 @@ pci_xhci_snapshot(struct vm_snapshot_meta *meta)
continue;
 
SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(dev->dev_ctx,
-   XHCI_GADDR_SIZE(dev->dev_ctx), false, meta, ret, done);
+   XHCI_GADDR_SIZE(dev->dev_ctx), true, meta, ret, done);
 
-   for (j = 1; j < XHCI_MAX_ENDPOINTS; j++) {
-   ret = pci_xhci_snapshot_ep(sc, dev, j, meta);
-   if (ret != 0)
-   goto done;
+   if (dev->dev_ctx != NULL) {
+   for (j = 1; j < XHCI_MAX_ENDPOINTS; j++) {
+   ret = pci_xhci_snapshot_ep(sc, dev, j, meta);
+   if (ret != 0)
+   goto done;
+   }
}
 
SNAPSHOT_VAR_OR_LEAVE(dev->dev_slotstate, meta, ret, done);
___
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: r368116 - head/sys/kern

2020-11-27 Thread Kyle Evans
Author: kevans
Date: Sat Nov 28 01:21:11 2020
New Revision: 368116
URL: https://svnweb.freebsd.org/changeset/base/368116

Log:
  kern: cpuset: drop the lock to allocate domainsets
  
  Restructure the loop a little bit to make it a little more clear how it
  really operates: we never allocate any domains at the beginning of the first
  iteration, and it will run until we've satisfied the amount we need or we
  encounter an error.
  
  The lock is now taken outside of the loop to make stuff inside the loop
  easier to evaluate w.r.t. locking.
  
  This fixes it to not try and allocate any domains for the freelist under the
  spinlock, which would have happened before if we needed any new domains.
  
  Reported by:  syzbot+6743fa07b9b7528dc...@syzkaller.appspotmail.com
  Reviewed by:  markj
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D27371

Modified:
  head/sys/kern/kern_cpuset.c

Modified: head/sys/kern/kern_cpuset.c
==
--- head/sys/kern/kern_cpuset.c Sat Nov 28 01:16:59 2020(r368115)
+++ head/sys/kern/kern_cpuset.c Sat Nov 28 01:21:11 2020(r368116)
@@ -794,14 +794,11 @@ cpuset_modify_domain(struct cpuset *set, struct domain
return (EPERM);
domainset_freelist_init(, 0);
domain = domainset_create(domain);
-   ndomains = needed = 0;
-   do {
-   if (ndomains < needed) {
-   domainset_freelist_add(, needed - ndomains);
-   ndomains = needed;
-   }
+   ndomains = 0;
+
+   mtx_lock_spin(_lock);
+   for (;;) {
root = cpuset_getroot(set);
-   mtx_lock_spin(_lock);
dset = root->cs_domain;
/*
 * Verify that we have access to this set of domains.
@@ -826,7 +823,15 @@ cpuset_modify_domain(struct cpuset *set, struct domain
, 0);
if (error)
goto out;
-   } while (ndomains < needed);
+   if (ndomains >= needed)
+   break;
+
+   /* Dropping the lock; we'll need to re-evaluate again. */
+   mtx_unlock_spin(_lock);
+   domainset_freelist_add(, needed - ndomains);
+   ndomains = needed;
+   mtx_lock_spin(_lock);
+   }
dset = set->cs_domain;
cpuset_update_domain(set, domain, dset, );
 out:
___
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: r368115 - in head/sys/amd64: include vmm vmm/amd vmm/intel

2020-11-27 Thread Peter Grehan
Author: grehan
Date: Sat Nov 28 01:16:59 2020
New Revision: 368115
URL: https://svnweb.freebsd.org/changeset/base/368115

Log:
  Convert vmm_ops calls to IFUNC
  
  There is no need for these to be function pointers since they are
  never modified post-module load.
  
  Rename AMD/Intel ops to be more consistent.
  
  Submitted by: adam_fenn.io
  Reviewed by:  markj, grehan
  Approved by:  grehan (bhyve)
  MFC after:3 weeks
  Differential Revision:https://reviews.freebsd.org/D27375

Modified:
  head/sys/amd64/include/vmm.h
  head/sys/amd64/vmm/amd/svm.c
  head/sys/amd64/vmm/intel/vmx.c
  head/sys/amd64/vmm/intel/vmx.h
  head/sys/amd64/vmm/vmm.c
  head/sys/amd64/vmm/vmm_util.c
  head/sys/amd64/vmm/vmm_util.h

Modified: head/sys/amd64/include/vmm.h
==
--- head/sys/amd64/include/vmm.hFri Nov 27 21:38:03 2020
(r368114)
+++ head/sys/amd64/include/vmm.hSat Nov 28 01:16:59 2020
(r368115)
@@ -189,32 +189,32 @@ typedef int   (*vmi_snapshot_vmcx_t)(void *vmi, 
struct v
 typedef int(*vmi_restore_tsc_t)(void *vmi, int vcpuid, uint64_t now);
 
 struct vmm_ops {
-   vmm_init_func_t init;   /* module wide initialization */
-   vmm_cleanup_func_t  cleanup;
-   vmm_resume_func_t   resume;
+   vmm_init_func_t modinit;/* module wide initialization */
+   vmm_cleanup_func_t  modcleanup;
+   vmm_resume_func_t   modresume;
 
-   vmi_init_func_t vminit; /* vm-specific initialization */
-   vmi_run_func_t  vmrun;
-   vmi_cleanup_func_t  vmcleanup;
-   vmi_get_register_t  vmgetreg;
-   vmi_set_register_t  vmsetreg;
-   vmi_get_desc_t  vmgetdesc;
-   vmi_set_desc_t  vmsetdesc;
-   vmi_get_cap_t   vmgetcap;
-   vmi_set_cap_t   vmsetcap;
+   vmi_init_func_t init;   /* vm-specific initialization */
+   vmi_run_func_t  run;
+   vmi_cleanup_func_t  cleanup;
+   vmi_get_register_t  getreg;
+   vmi_set_register_t  setreg;
+   vmi_get_desc_t  getdesc;
+   vmi_set_desc_t  setdesc;
+   vmi_get_cap_t   getcap;
+   vmi_set_cap_t   setcap;
vmi_vmspace_alloc   vmspace_alloc;
vmi_vmspace_freevmspace_free;
vmi_vlapic_init vlapic_init;
vmi_vlapic_cleanup  vlapic_cleanup;
 
/* checkpoint operations */
-   vmi_snapshot_t  vmsnapshot;
+   vmi_snapshot_t  snapshot;
vmi_snapshot_vmcx_t vmcx_snapshot;
-   vmi_restore_tsc_t   vm_restore_tsc;
+   vmi_restore_tsc_t   restore_tsc;
 };
 
-extern struct vmm_ops vmm_ops_intel;
-extern struct vmm_ops vmm_ops_amd;
+extern const struct vmm_ops vmm_ops_intel;
+extern const struct vmm_ops vmm_ops_amd;
 
 int vm_create(const char *name, struct vm **retvm);
 void vm_destroy(struct vm *vm);

Modified: head/sys/amd64/vmm/amd/svm.c
==
--- head/sys/amd64/vmm/amd/svm.cFri Nov 27 21:38:03 2020
(r368114)
+++ head/sys/amd64/vmm/amd/svm.cSat Nov 28 01:16:59 2020
(r368115)
@@ -132,6 +132,7 @@ static VMM_STAT_AMD(VCPU_EXITINTINFO, "VM exits during
 static VMM_STAT_AMD(VCPU_INTINFO_INJECTED, "Events pending at VM entry");
 static VMM_STAT_AMD(VMEXIT_VINTR, "VM exits due to interrupt window");
 
+static int svm_getdesc(void *arg, int vcpu, int reg, struct seg_desc *desc);
 static int svm_setreg(void *arg, int vcpu, int ident, uint64_t val);
 
 static __inline int
@@ -162,7 +163,7 @@ svm_disable(void *arg __unused)
  * Disable SVM on all CPUs.
  */
 static int
-svm_cleanup(void)
+svm_modcleanup(void)
 {
 
smp_rendezvous(NULL, svm_disable, NULL, NULL);
@@ -240,7 +241,7 @@ svm_available(void)
 }
 
 static int
-svm_init(int ipinum)
+svm_modinit(int ipinum)
 {
int error, cpu;
 
@@ -274,7 +275,7 @@ svm_init(int ipinum)
 }
 
 static void
-svm_restore(void)
+svm_modresume(void)
 {
 
svm_enable(NULL);
@@ -551,7 +552,7 @@ vmcb_init(struct svm_softc *sc, int vcpu, uint64_t iop
  * Initialize a virtual machine.
  */
 static void *
-svm_vminit(struct vm *vm, pmap_t pmap)
+svm_init(struct vm *vm, pmap_t pmap)
 {
struct svm_softc *svm_sc;
struct svm_vcpu *vcpu;
@@ -728,7 +729,7 @@ svm_inout_str_seginfo(struct svm_softc *svm_sc, int vc
vis->seg_name = vm_segment_name(s);
}
 
-   error = vmcb_getdesc(svm_sc, vcpu, vis->seg_name, >seg_desc);
+   error = svm_getdesc(svm_sc, vcpu, vis->seg_name, >seg_desc);
KASSERT(error == 0, ("%s: svm_getdesc error %d", __func__, error));
 }
 
@@ -1984,7 +1985,7 @@ svm_dr_leave_guest(struct svm_regctx *gctx)
  * Start vcpu with specified RIP.
  */
 static int
-svm_vmrun(void *arg, int vcpu, register_t rip, pmap_t 

svn commit: r368114 - head/contrib/elftoolchain/addr2line

2020-11-27 Thread Ed Maste
Author: emaste
Date: Fri Nov 27 21:38:03 2020
New Revision: 368114
URL: https://svnweb.freebsd.org/changeset/base/368114

Log:
  addr2line: add label checks when DW_AT_range and DW_AT_low_pc cannot be used
  
  Check label's ranges for address we want to translate if a CU doesn't
  have usable DW_AT_range or DW_AT_low_pc.
  
  Use more appropriate names: "struct CU" -> "struct range"
  
  Developed as part of upstream ELF Tool Chain bug report
  https://sourceforge.net/p/elftoolchain/tickets/552/ although this does
  not address the specific case reported there.
  
  Submitted by: Tiger Gao 
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D23782

Modified:
  head/contrib/elftoolchain/addr2line/addr2line.c

Modified: head/contrib/elftoolchain/addr2line/addr2line.c
==
--- head/contrib/elftoolchain/addr2line/addr2line.c Fri Nov 27 21:37:48 
2020(r368113)
+++ head/contrib/elftoolchain/addr2line/addr2line.c Fri Nov 27 21:38:03 
2020(r368114)
@@ -57,8 +57,8 @@ struct Func {
STAILQ_ENTRY(Func) next;
 };
 
-struct CU {
-   RB_ENTRY(CU) entry;
+struct range {
+   RB_ENTRY(range) entry;
Dwarf_Off off;
Dwarf_Unsigned lopc;
Dwarf_Unsigned hipc;
@@ -89,16 +89,16 @@ static char unknown[] = { '?', '?', '\0' };
 static Dwarf_Addr section_base;
 /* Need a new curlopc that stores last lopc value. */
 static Dwarf_Unsigned curlopc = ~0ULL;
-static RB_HEAD(cutree, CU) cuhead = RB_INITIALIZER();
+static RB_HEAD(cutree, range) cuhead = RB_INITIALIZER();
 
 static int
-lopccmp(struct CU *e1, struct CU *e2)
+lopccmp(struct range *e1, struct range *e2)
 {
return (e1->lopc < e2->lopc ? -1 : e1->lopc > e2->lopc);
 }
 
-RB_PROTOTYPE(cutree, CU, entry, lopccmp);
-RB_GENERATE(cutree, CU, entry, lopccmp)
+RB_PROTOTYPE(cutree, range, entry, lopccmp);
+RB_GENERATE(cutree, range, entry, lopccmp)
 
 #defineUSAGE_MESSAGE   "\
 Usage: %s [options] hexaddress...\n\
@@ -171,7 +171,7 @@ handle_high_pc(Dwarf_Die die, Dwarf_Unsigned lopc, Dwa
 }
 
 static struct Func *
-search_func(struct CU *cu, Dwarf_Unsigned addr)
+search_func(struct range *range, Dwarf_Unsigned addr)
 {
struct Func *f, *f0;
Dwarf_Unsigned lopc, hipc, addr_base;
@@ -179,7 +179,7 @@ search_func(struct CU *cu, Dwarf_Unsigned addr)
 
f0 = NULL;
 
-   STAILQ_FOREACH(f, >funclist, next) {
+   STAILQ_FOREACH(f, >funclist, next) {
if (f->ranges != NULL) {
addr_base = 0;
for (i = 0; i < f->ranges_cnt; i++) {
@@ -216,7 +216,8 @@ search_func(struct CU *cu, Dwarf_Unsigned addr)
 }
 
 static void
-collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Func *parent, struct CU 
*cu)
+collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Func *parent,
+struct range *range)
 {
Dwarf_Die ret_die, abst_die, spec_die;
Dwarf_Error de;
@@ -238,7 +239,7 @@ collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Fu
goto cont_search;
}
if (tag == DW_TAG_subprogram || tag == DW_TAG_entry_point ||
-   tag == DW_TAG_inlined_subroutine) {
+   tag == DW_TAG_inlined_subroutine || tag == DW_TAG_label) {
/*
 * Function address range can be specified by either
 * a DW_AT_ranges attribute which points to a range list or
@@ -258,14 +259,21 @@ collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Fu
}
 
/*
-* Search for DW_AT_low_pc/DW_AT_high_pc if ranges pointer
-* not found.
-*/
-   if (dwarf_attrval_unsigned(die, DW_AT_low_pc, , ) ||
-   dwarf_attrval_unsigned(die, DW_AT_high_pc, , ))
-   goto cont_search;
-   if (handle_high_pc(die, lopc, ) != DW_DLV_OK)
-   goto cont_search;
+* Ranges pointer not found.  Search for DW_AT_low_pc, and
+* DW_AT_high_pc iff die is not a label.  Labels doesn't have
+* hipc attr. */
+   if (tag == DW_TAG_label) {
+   if (dwarf_attrval_unsigned(die, DW_AT_low_pc, ,
+   ) != DW_DLV_OK)
+   goto cont_search;
+   } else {
+   if (dwarf_attrval_unsigned(die, DW_AT_low_pc, ,
+   ) || dwarf_attrval_unsigned(die, DW_AT_high_pc,
+   , ))
+   goto cont_search;
+   if (handle_high_pc(die, lopc, ) != DW_DLV_OK)
+   goto cont_search;
+   }
 
get_func_name:
/*
@@ -323,7 +331,7 @@ collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Fu
dwarf_attrval_unsigned(die, 

svn commit: r368113 - in head/sys: amd64/conf i386/conf

2020-11-27 Thread Ruslan Bukin
Author: br
Date: Fri Nov 27 21:37:48 2020
New Revision: 368113
URL: https://svnweb.freebsd.org/changeset/base/368113

Log:
  o Move options IOMMU from Debugging section back to the Bus section
where it originally was. The bug introduced in r366267.
  o Remove options IOMMU from i386/MINIMAL as we don't have it in
i386/GENERIC.
  
  Reported by:  Harry Schmalzbauer 
  Reviewed by:  kib
  Sponsored by: Innovate DSbD
  Differential Revision:https://reviews.freebsd.org/D27399

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/amd64/conf/MINIMAL
  head/sys/i386/conf/MINIMAL

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Fri Nov 27 20:46:02 2020(r368112)
+++ head/sys/amd64/conf/GENERIC Fri Nov 27 21:37:48 2020(r368113)
@@ -102,7 +102,6 @@ options WITNESS # Enable checks to 
detect deadlocks
 optionsWITNESS_SKIPSPIN# Don't run witness on spinlocks for 
speed
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
 optionsVERBOSE_SYSINIT=0   # Support debug.verbose_sysinit, off by 
default
-optionsIOMMU
 
 # Kernel Sanitizers
 #options   COVERAGE# Generic kernel coverage. Used by KCOV
@@ -128,6 +127,7 @@ device  cpufreq
 
 # Bus support.
 device acpi
+optionsIOMMU
 device pci
 optionsPCI_HP  # PCI-Express native HotPlug
 optionsPCI_IOV # PCI SR-IOV support

Modified: head/sys/amd64/conf/MINIMAL
==
--- head/sys/amd64/conf/MINIMAL Fri Nov 27 20:46:02 2020(r368112)
+++ head/sys/amd64/conf/MINIMAL Fri Nov 27 21:37:48 2020(r368113)
@@ -93,7 +93,6 @@ options   WITNESS # Enable checks to 
detect deadlocks
 optionsWITNESS_SKIPSPIN# Don't run witness on spinlocks for 
speed
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
 optionsVERBOSE_SYSINIT=0   # Support debug.verbose_sysinit, off by 
default
-optionsIOMMU
 
 # Make an SMP-capable kernel by default
 optionsSMP # Symmetric MultiProcessor Kernel
@@ -104,6 +103,7 @@ device  cpufreq
 
 # Bus support.
 device acpi
+optionsIOMMU
 device pci
 
 # atkbdc0 controls both the keyboard and the PS/2 mouse

Modified: head/sys/i386/conf/MINIMAL
==
--- head/sys/i386/conf/MINIMAL  Fri Nov 27 20:46:02 2020(r368112)
+++ head/sys/i386/conf/MINIMAL  Fri Nov 27 21:37:48 2020(r368113)
@@ -93,7 +93,6 @@ options   WITNESS # Enable checks to 
detect deadlocks
 optionsWITNESS_SKIPSPIN# Don't run witness on spinlocks for 
speed
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
 optionsVERBOSE_SYSINIT=0   # Support debug.verbose_sysinit, off by 
default
-optionsIOMMU
 
 # Make an SMP-capable kernel by default
 optionsSMP # Symmetric MultiProcessor Kernel
___
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: r368112 - in head/sys: kern sys

2020-11-27 Thread Mark Johnston
Author: markj
Date: Fri Nov 27 20:46:02 2020
New Revision: 368112
URL: https://svnweb.freebsd.org/changeset/base/368112

Log:
  callout(9): Remove some leftover APM BIOS support
  
  This code is obsolete since r366546.
  
  Reviewed by:  imp
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D27267

Modified:
  head/sys/kern/kern_timeout.c
  head/sys/sys/systm.h

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cFri Nov 27 18:40:51 2020
(r368111)
+++ head/sys/kern/kern_timeout.cFri Nov 27 20:46:02 2020
(r368112)
@@ -1339,71 +1339,6 @@ _callout_init_lock(struct callout *c, struct lock_obje
c->c_cpu = cc_default_cpu;
 }
 
-#ifdef APM_FIXUP_CALLTODO
-/* 
- * Adjust the kernel calltodo timeout list.  This routine is used after 
- * an APM resume to recalculate the calltodo timer list values with the 
- * number of hz's we have been sleeping.  The next hardclock() will detect 
- * that there are fired timers and run softclock() to execute them.
- *
- * Please note, I have not done an exhaustive analysis of what code this
- * might break.  I am motivated to have my select()'s and alarm()'s that
- * have expired during suspend firing upon resume so that the applications
- * which set the timer can do the maintanence the timer was for as close
- * as possible to the originally intended time.  Testing this code for a 
- * week showed that resuming from a suspend resulted in 22 to 25 timers 
- * firing, which seemed independent on whether the suspend was 2 hours or
- * 2 days.  Your milage may vary.   - Ken Key 
- */
-void
-adjust_timeout_calltodo(struct timeval *time_change)
-{
-   struct callout *p;
-   unsigned long delta_ticks;
-
-   /* 
-* How many ticks were we asleep?
-* (stolen from tvtohz()).
-*/
-
-   /* Don't do anything */
-   if (time_change->tv_sec < 0)
-   return;
-   else if (time_change->tv_sec <= LONG_MAX / 100)
-   delta_ticks = howmany(time_change->tv_sec * 100 +
-   time_change->tv_usec, tick) + 1;
-   else if (time_change->tv_sec <= LONG_MAX / hz)
-   delta_ticks = time_change->tv_sec * hz +
-   howmany(time_change->tv_usec, tick) + 1;
-   else
-   delta_ticks = LONG_MAX;
-
-   if (delta_ticks > INT_MAX)
-   delta_ticks = INT_MAX;
-
-   /* 
-* Now rip through the timer calltodo list looking for timers
-* to expire.
-*/
-
-   /* don't collide with softclock() */
-   CC_LOCK(cc);
-   for (p = calltodo.c_next; p != NULL; p = p->c_next) {
-   p->c_time -= delta_ticks;
-
-   /* Break if the timer had more time on it than delta_ticks */
-   if (p->c_time > 0)
-   break;
-
-   /* take back the ticks the timer didn't use (p->c_time <= 0) */
-   delta_ticks = -p->c_time;
-   }
-   CC_UNLOCK(cc);
-
-   return;
-}
-#endif /* APM_FIXUP_CALLTODO */
-
 static int
 flssbt(sbintime_t sbt)
 {

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hFri Nov 27 18:40:51 2020(r368111)
+++ head/sys/sys/systm.hFri Nov 27 20:46:02 2020(r368112)
@@ -482,11 +482,6 @@ extern cpu_tick_f *cpu_ticks;
 uint64_t cpu_tickrate(void);
 uint64_t cputick2usec(uint64_t tick);
 
-#ifdef APM_FIXUP_CALLTODO
-struct timeval;
-void   adjust_timeout_calltodo(struct timeval *time_change);
-#endif /* APM_FIXUP_CALLTODO */
-
 #include 
 
 /* Initialize the world */
___
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: r368111 - head/usr.sbin/rtsold

2020-11-27 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Nov 27 18:40:51 2020
New Revision: 368111
URL: https://svnweb.freebsd.org/changeset/base/368111

Log:
  fix casper initialization for setting scripts.
  
  MFC after:1 week

Modified:
  head/usr.sbin/rtsold/rtsold.c

Modified: head/usr.sbin/rtsold/rtsold.c
==
--- head/usr.sbin/rtsold/rtsold.c   Fri Nov 27 16:51:58 2020
(r368110)
+++ head/usr.sbin/rtsold/rtsold.c   Fri Nov 27 18:40:51 2020
(r368111)
@@ -333,6 +333,7 @@ init_capabilities(void)
 #ifdef WITH_CASPER
const char *const scripts[] =
{ resolvconf_script, managedconf_script, otherconf_script };
+   const char *scripts_set[nitems(scripts)];
cap_channel_t *capcasper;
nvlist_t *limits;
int count;
@@ -351,9 +352,9 @@ init_capabilities(void)
count = 0;
for (size_t i = 0; i < nitems(scripts); i++)
if (scripts[i] != NULL)
-   count++;
+   scripts_set[count++] = scripts[i];
limits = nvlist_create(0);
-   nvlist_add_string_array(limits, "scripts", scripts, count);
+   nvlist_add_string_array(limits, "scripts", scripts_set, count);
if (cap_limit_set(capscript, limits) != 0)
return (-1);
 
___
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: r368108 - head/sys/arm/include

2020-11-27 Thread Mark Johnston
Author: markj
Date: Fri Nov 27 16:35:43 2020
New Revision: 368108
URL: https://svnweb.freebsd.org/changeset/base/368108

Log:
  arm: Correctly report the size of FPA registers to GDB
  
  Modern ARM systems do not have an FPA unit but GDB reserves register
  indices for FPA registers and expects the stub to know their sizes.
  
  PR:   251022
  Submitted by: Dmitry Salychev 
  MFC after:2 weeks

Modified:
  head/sys/arm/include/gdb_machdep.h

Modified: head/sys/arm/include/gdb_machdep.h
==
--- head/sys/arm/include/gdb_machdep.h  Fri Nov 27 16:29:54 2020
(r368107)
+++ head/sys/arm/include/gdb_machdep.h  Fri Nov 27 16:35:43 2020
(r368108)
@@ -36,9 +36,13 @@
 #defineGDB_REG_PC  15
 
 static __inline size_t
-gdb_cpu_regsz(int regnum __unused)
+gdb_cpu_regsz(int regnum)
 {
-   return (sizeof(int));
+   /*
+* GDB expects the FPA registers f0-f7, each 96 bits wide, to be placed
+* in between the PC and CSPR in response to a "g" packet.
+*/
+   return (regnum >= 16 && regnum <= 23 ? 12 : sizeof(int));
 }
 
 static __inline int
___
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: r368105 - head/sys/dev/isp

2020-11-27 Thread Alexander Motin
Author: mav
Date: Fri Nov 27 15:50:20 2020
New Revision: 368105
URL: https://svnweb.freebsd.org/changeset/base/368105

Log:
  Some code reorganization.
  
   - Remove code duplication by adding two new functions to execute prepared
  queue entry via either mbox or request queue and wait for result.
   - Since the new function executing via request queue sleeps any way, make
  it sleep also in case of overflows or handle shortages.  It should make it
  more reliable and less affecting other less flexible request queue users.
   - Turn isp_target_put_entry() into not target-specific isp_send_entry().
   - Make handling of responses with control handles more universal.
   - Move RQSTYPE_RPT_ID_ACQ handling into new function.
   - Inline isp_handle_other_response(), becoming trivial after above.
   - Clean the list of IOCBs from pre-24xx ones.

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/isp_library.c
  head/sys/dev/isp/isp_library.h
  head/sys/dev/isp/isp_target.c
  head/sys/dev/isp/isp_target.h
  head/sys/dev/isp/ispmbox.h
  head/sys/dev/isp/ispvar.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Fri Nov 27 13:25:12 2020(r368104)
+++ head/sys/dev/isp/isp.c  Fri Nov 27 15:50:20 2020(r368105)
@@ -93,7 +93,8 @@ static const uint8_t alpa_map[] = {
 /*
  * Local function prototypes.
  */
-static int isp_handle_other_response(ispsoftc_t *, int, isphdr_t *, uint32_t 
*, uint16_t);
+static int isp_handle_control(ispsoftc_t *, isphdr_t *);
+static void isp_handle_rpt_id_acq(ispsoftc_t *, isphdr_t *);
 static void isp_parse_status_24xx(ispsoftc_t *, isp24xx_statusreq_t *, XS_T *);
 static void isp_clear_portdb(ispsoftc_t *, int);
 static void isp_mark_portdb(ispsoftc_t *, int);
@@ -1020,8 +1021,7 @@ isp_fc_enable_vp(ispsoftc_t *isp, int chan)
 {
fcparam *fcp = FCPARAM(isp, chan);
vp_modify_t vp;
-   void *reqp;
-   uint8_t resp[QENTRY_LEN];
+   int retval;
 
/* Build a VP MODIFY command in memory */
ISP_MEMZERO(, sizeof(vp));
@@ -1044,37 +1044,13 @@ isp_fc_enable_vp(ispsoftc_t *isp, int chan)
MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwpn, fcp->isp_wwpn);
MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwnn, fcp->isp_wwnn);
 
-   /* Prepare space for response in memory */
-   memset(resp, 0xff, sizeof(resp));
-   vp.vp_mod_hdl = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL);
-   if (vp.vp_mod_hdl == 0) {
-   isp_prt(isp, ISP_LOGERR,
-   "%s: VP_MODIFY of Chan %d out of handles", __func__, chan);
-   return (EIO);
+   retval = isp_exec_entry_queue(isp, , , 5);
+   if (retval != 0) {
+   isp_prt(isp, ISP_LOGERR, "%s: VP_MODIFY of chan %d error %d",
+   __func__, chan, retval);
+   return (retval);
}
 
-   /* Send request and wait for response. */
-   reqp = isp_getrqentry(isp);
-   if (reqp == NULL) {
-   isp_prt(isp, ISP_LOGERR,
-   "%s: VP_MODIFY of Chan %d out of rqent", __func__, chan);
-   isp_destroy_handle(isp, vp.vp_mod_hdl);
-   return (EIO);
-   }
-   isp_put_vp_modify(isp, , (vp_modify_t *)reqp);
-   if (isp->isp_dblev & ISP_LOGDEBUG1)
-   isp_print_bytes(isp, "IOCB VP_MODIFY", QENTRY_LEN, reqp);
-   ISP_SYNC_REQUEST(isp);
-   if (msleep(resp, >isp_lock, 0, "VP_MODIFY", 5*hz) == EWOULDBLOCK) {
-   isp_prt(isp, ISP_LOGERR,
-   "%s: VP_MODIFY of Chan %d timed out", __func__, chan);
-   isp_destroy_handle(isp, vp.vp_mod_hdl);
-   return (EIO);
-   }
-   if (isp->isp_dblev & ISP_LOGDEBUG1)
-   isp_print_bytes(isp, "IOCB VP_MODIFY response", QENTRY_LEN, 
resp);
-   isp_get_vp_modify(isp, (vp_modify_t *)resp, );
-
if (vp.vp_mod_hdr.rqs_flags != 0 || vp.vp_mod_status != VP_STS_OK) {
isp_prt(isp, ISP_LOGERR,
"%s: VP_MODIFY of Chan %d failed with flags %x status %d",
@@ -1088,8 +1064,7 @@ static int
 isp_fc_disable_vp(ispsoftc_t *isp, int chan)
 {
vp_ctrl_info_t vp;
-   void *reqp;
-   uint8_t resp[QENTRY_LEN];
+   int retval;
 
/* Build a VP CTRL command in memory */
ISP_MEMZERO(, sizeof(vp));
@@ -1105,37 +1080,13 @@ isp_fc_disable_vp(ispsoftc_t *isp, int chan)
vp.vp_ctrl_vp_count = 1;
vp.vp_ctrl_idmap[chan / 16] |= (1 << chan % 16);
 
-   /* Prepare space for response in memory */
-   memset(resp, 0xff, sizeof(resp));
-   vp.vp_ctrl_handle = isp_allocate_handle(isp, resp, ISP_HANDLE_CTRL);
-   if (vp.vp_ctrl_handle == 0) {
-   isp_prt(isp, ISP_LOGERR,
-   "%s: VP_CTRL of Chan %d out of handles", __func__, chan);
-   return (EIO);
+   retval = isp_exec_entry_queue(isp, 

Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk

2020-11-27 Thread Alan Somers
On Fri, Nov 27, 2020 at 5:08 AM Bjoern A. Zeeb <
bzeeb-li...@lists.zabbadoz.net> wrote:

> On 26 Nov 2020, at 18:51, Alan Somers wrote:
>
> > On Thu, Nov 26, 2020 at 2:16 AM Bjoern A. Zeeb <
> > bzeeb-li...@lists.zabbadoz.net> wrote:
> >
> >> On 26 Nov 2020, at 4:29, Alan Somers wrote:
> >>
> >>> Author: asomers
> >>> Date: Thu Nov 26 04:29:30 2020
> >>> New Revision: 368045
> >>> URL: https://svnweb.freebsd.org/changeset/base/368045
> >>>
> >>> Log:
> >>>   Merge ping6 to ping
> >>>
> >>>   There is now a single ping binary, which chooses to use ICMP or
> >>> ICMPv4
> >>>   based on the -4 and -6 options, and the format of the address.
> >>>
> >>>   Submitted by:   Ján Sučan 
> >>>   Sponsored by:   Google LLC (Google Summer of Code 2019)
> >>>   MFC after:  Never
> >>>   Differential Revision:  https://reviews.freebsd.org/D21377
> >>
> >> I don’t have IPv4 anymore.
> >> I don’t see any WITHOUT_INET or -DINET checks.
> >> How can I compile INET out now?
> >>
> >
> > I don't see any such checks before, either.  Was it ever possible to
> > exclude ping by building WITHOUT_INET?
>
> No, for various reasons including startup scripts relying on it etc.
> I think no one ever bothered to fully find it all.
>
> But it was possible to just ditch the binary (not installing it into
> custom images, or rm -f it post-install along with other things).
>
>
> Now it’s a “dual-stack handling” binary and those we’ve tried
> with a lot of care to make sure they grow compiling out both ways as you
> cannot throw away the binary anymore.
>
> I don’t know how hard it is to do this now.  I’ll be happy to have a
> look and help if it’s not a 5 minute job for you knowing the code and
> split up.   Would we just have to handle main.c with #ifdefs and the old
> ping[4] files from the Makefile or is ping6 also using shared code from
> the former ping[4]?
>
>
> /bz
>

Yes, that's about right.  ping.c is the old ping.c, and ping6.c is the old
ping6.c, with main() removed from both.  So it should be pretty easy to
compile out INET.
-Alan
___
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: r368104 - stable/12/sys/cam

2020-11-27 Thread Alexander Motin
Author: mav
Date: Fri Nov 27 13:25:12 2020
New Revision: 368104
URL: https://svnweb.freebsd.org/changeset/base/368104

Log:
  MFC r367862: Microoptimize cam_num_doneqs math in xpt_done().

Modified:
  stable/12/sys/cam/cam_xpt.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/cam_xpt.c
==
--- stable/12/sys/cam/cam_xpt.c Fri Nov 27 11:51:07 2020(r368103)
+++ stable/12/sys/cam/cam_xpt.c Fri Nov 27 13:25:12 2020(r368104)
@@ -179,7 +179,7 @@ struct cam_doneq {
 };
 
 static struct cam_doneq cam_doneqs[MAXCPU];
-static int cam_num_doneqs;
+static u_int __read_mostly cam_num_doneqs;
 static struct proc *cam_proc;
 
 SYSCTL_INT(_kern_cam, OID_AUTO, num_doneqs, CTLFLAG_RDTUN,
@@ -4671,7 +4671,7 @@ xpt_done(union ccb *done_ccb)
 
/* Store the time the ccb was in the sim */
done_ccb->ccb_h.qos.periph_data = 
cam_iosched_delta_t(done_ccb->ccb_h.qos.periph_data);
-   hash = (done_ccb->ccb_h.path_id + done_ccb->ccb_h.target_id +
+   hash = (u_int)(done_ccb->ccb_h.path_id + done_ccb->ccb_h.target_id +
done_ccb->ccb_h.target_lun) % cam_num_doneqs;
queue = _doneqs[hash];
mtx_lock(>cam_doneq_mtx);
___
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: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk

2020-11-27 Thread Bjoern A. Zeeb

On 26 Nov 2020, at 18:51, Alan Somers wrote:


On Thu, Nov 26, 2020 at 2:16 AM Bjoern A. Zeeb <
bzeeb-li...@lists.zabbadoz.net> wrote:


On 26 Nov 2020, at 4:29, Alan Somers wrote:


Author: asomers
Date: Thu Nov 26 04:29:30 2020
New Revision: 368045
URL: https://svnweb.freebsd.org/changeset/base/368045

Log:
  Merge ping6 to ping

  There is now a single ping binary, which chooses to use ICMP or
ICMPv4
  based on the -4 and -6 options, and the format of the address.

  Submitted by:   Ján Sučan 
  Sponsored by:   Google LLC (Google Summer of Code 2019)
  MFC after:  Never
  Differential Revision:  https://reviews.freebsd.org/D21377


I don’t have IPv4 anymore.
I don’t see any WITHOUT_INET or -DINET checks.
How can I compile INET out now?



I don't see any such checks before, either.  Was it ever possible to
exclude ping by building WITHOUT_INET?


No, for various reasons including startup scripts relying on it etc.
I think no one ever bothered to fully find it all.

But it was possible to just ditch the binary (not installing it into 
custom images, or rm -f it post-install along with other things).



Now it’s a “dual-stack handling” binary and those we’ve tried 
with a lot of care to make sure they grow compiling out both ways as you 
cannot throw away the binary anymore.


I don’t know how hard it is to do this now.  I’ll be happy to have a 
look and help if it’s not a 5 minute job for you knowing the code and 
split up.   Would we just have to handle main.c with #ifdefs and the old 
ping[4] files from the Makefile or is ping6 also using shared code from 
the former ping[4]?



/bz


___
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: r368103 - stable/12/sys/dev/sound/pcm

2020-11-27 Thread Konstantin Belousov
Author: kib
Date: Fri Nov 27 11:51:07 2020
New Revision: 368103
URL: https://svnweb.freebsd.org/changeset/base/368103

Log:
  MFC r367892:
  Unlock channels when any of them are locked, when returning for non-busy 
state.

Modified:
  stable/12/sys/dev/sound/pcm/dsp.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/sound/pcm/dsp.c
==
--- stable/12/sys/dev/sound/pcm/dsp.c   Fri Nov 27 11:48:33 2020
(r368102)
+++ stable/12/sys/dev/sound/pcm/dsp.c   Fri Nov 27 11:51:07 2020
(r368103)
@@ -858,6 +858,8 @@ dsp_io_ops(struct cdev *i_dev, struct uio *buf)
getchns(i_dev, , , prio);
 
if (*ch == NULL || !((*ch)->flags & CHN_F_BUSY)) {
+   if (rdch != NULL || wrch != NULL)
+   relchns(i_dev, rdch, wrch, prio);
PCM_GIANT_EXIT(d);
return (EBADF);
}
___
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: r368102 - stable/12/sys/fs/msdosfs

2020-11-27 Thread Konstantin Belousov
Author: kib
Date: Fri Nov 27 11:48:33 2020
New Revision: 368102
URL: https://svnweb.freebsd.org/changeset/base/368102

Log:
  MFC r367890:
  msdosfs: Add trivial support for suspension.

Modified:
  stable/12/sys/fs/msdosfs/msdosfs_vfsops.c
  stable/12/sys/fs/msdosfs/msdosfs_vnops.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/fs/msdosfs/msdosfs_vfsops.c
==
--- stable/12/sys/fs/msdosfs/msdosfs_vfsops.c   Fri Nov 27 11:12:59 2020
(r368101)
+++ stable/12/sys/fs/msdosfs/msdosfs_vfsops.c   Fri Nov 27 11:48:33 2020
(r368102)
@@ -941,6 +941,12 @@ loop:
error = msdosfs_fsiflush(pmp, waitfor);
if (error != 0)
allerror = error;
+
+   if (allerror == 0 && waitfor == MNT_SUSPEND) {
+   MNT_ILOCK(mp);
+   mp->mnt_kern_flag |= MNTK_SUSPEND2 | MNTK_SUSPENDED;
+   MNT_IUNLOCK(mp);
+   }
return (allerror);
 }
 

Modified: stable/12/sys/fs/msdosfs/msdosfs_vnops.c
==
--- stable/12/sys/fs/msdosfs/msdosfs_vnops.cFri Nov 27 11:12:59 2020
(r368101)
+++ stable/12/sys/fs/msdosfs/msdosfs_vnops.cFri Nov 27 11:48:33 2020
(r368102)
@@ -849,7 +849,7 @@ msdosfs_fsync(struct vop_fsync_args *ap)
* Non-critical metadata for associated directory entries only
* gets synced accidentally, as in most file systems.
*/
-   if (ap->a_waitfor == MNT_WAIT) {
+   if (ap->a_waitfor != MNT_NOWAIT) {
devvp = VTODE(ap->a_vp)->de_pmp->pm_devvp;
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
allerror = VOP_FSYNC(devvp, MNT_WAIT, ap->a_td);
@@ -857,7 +857,7 @@ msdosfs_fsync(struct vop_fsync_args *ap)
} else
allerror = 0;
 
-   error = deupdat(VTODE(ap->a_vp), ap->a_waitfor == MNT_WAIT);
+   error = deupdat(VTODE(ap->a_vp), ap->a_waitfor != MNT_NOWAIT);
if (allerror == 0)
allerror = error;
return (allerror);
___
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: r368101 - stable/12/tests/sys/netpfil/pf

2020-11-27 Thread Kristof Provost
Author: kp
Date: Fri Nov 27 11:12:59 2020
New Revision: 368101
URL: https://svnweb.freebsd.org/changeset/base/368101

Log:
  MFC r367869:
  
  pf tests: Basic source tracking test

Added:
  stable/12/tests/sys/netpfil/pf/src_track.sh
 - copied unchanged from r367869, head/tests/sys/netpfil/pf/src_track.sh
Modified:
  stable/12/tests/sys/netpfil/pf/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/netpfil/pf/Makefile
==
--- stable/12/tests/sys/netpfil/pf/Makefile Fri Nov 27 11:12:10 2020
(r368100)
+++ stable/12/tests/sys/netpfil/pf/Makefile Fri Nov 27 11:12:59 2020
(r368101)
@@ -12,6 +12,7 @@ ATF_TESTS_SH+=anchor \
names \
nat \
set_tos \
+   src_track \
rdr \
route_to \
synproxy \

Copied: stable/12/tests/sys/netpfil/pf/src_track.sh (from r367869, 
head/tests/sys/netpfil/pf/src_track.sh)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/tests/sys/netpfil/pf/src_track.sh Fri Nov 27 11:12:59 2020
(r368101, copy of r367869, head/tests/sys/netpfil/pf/src_track.sh)
@@ -0,0 +1,66 @@
+# $FreeBSD$
+#
+# SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+#
+# Copyright (c) 2020 Kristof Provost 
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+. $(atf_get_srcdir)/utils.subr
+
+atf_test_case "source_track" "cleanup"
+source_track_head()
+{
+   atf_set descr 'Basic source tracking test'
+   atf_set require.user root
+}
+
+source_track_body()
+{
+   pft_init
+
+   epair=$(vnet_mkepair)
+
+   vnet_mkjail alcatraz ${epair}b
+
+   ifconfig ${epair}a 192.0.2.2/24 up
+   jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up
+
+   # Enable pf!
+   jexec alcatraz pfctl -e
+   pft_set_rules alcatraz \
+   "pass in keep state (source-track)" \
+   "pass out keep state (source-track)"
+
+   ping -c 3 192.0.2.1
+   jexec alcatraz pfctl -s all -v
+}
+
+source_track_cleanup()
+{
+   pft_cleanup
+}
+
+atf_init_test_cases()
+{
+   atf_add_test_case "source_track"
+}
___
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: r368100 - stable/12/sys/netpfil/pf

2020-11-27 Thread Kristof Provost
Author: kp
Date: Fri Nov 27 11:12:10 2020
New Revision: 368100
URL: https://svnweb.freebsd.org/changeset/base/368100

Log:
  MFC r367867:
  
  pf: Fix incorrect assertion
  
  We never set PFRULE_RULESRCTRACK when calling pf_insert_src_node(). We do set
  PFRULE_SRCTRACK, so update the assertion to match.

Modified:
  stable/12/sys/netpfil/pf/pf.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netpfil/pf/pf.c
==
--- stable/12/sys/netpfil/pf/pf.c   Fri Nov 27 09:07:46 2020
(r368099)
+++ stable/12/sys/netpfil/pf/pf.c   Fri Nov 27 11:12:10 2020
(r368100)
@@ -705,7 +705,7 @@ pf_insert_src_node(struct pf_src_node **sn, struct pf_
 struct pf_addr *src, sa_family_t af)
 {
 
-   KASSERT((rule->rule_flag & PFRULE_RULESRCTRACK ||
+   KASSERT((rule->rule_flag & PFRULE_SRCTRACK ||
rule->rpool.opts & PF_POOL_STICKYADDR),
("%s for non-tracking rule %p", __func__, rule));
 
___
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: r368072 - in head/contrib/bc: . gen include manuals manuals/bc manuals/dc src src/bc src/dc src/history src/rand tests

2020-11-27 Thread Stefan Esser

Am 26.11.20 um 23:47 schrieb Cy Schubert:

A clean build (sort of) did fix it: rm the appropriate subdir actually.


Now I see what caused your issues:

The file lib.c is created by running strgen.sh with parameters
from the Makefile, and the invocation of this script changed.

I have made the generated files depend on the Makefile to catch
and parameter changes. Maybe I should have added a dependency
on the script too, but do not expect it to change again.

Regards, STefan
___
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: r368097 - head/usr.bin/gh-bc

2020-11-27 Thread Stefan Eßer
Author: se
Date: Fri Nov 27 09:00:21 2020
New Revision: 368097
URL: https://svnweb.freebsd.org/changeset/base/368097

Log:
  Make generated C files depend on this Makefile
  
  The contents of lib.c, lib2.c, bc_help.c, and dc_help.c depends on the
  parameters passed to strgen.sh in this Makefile. A change to the number
  of parameters of strgen.sh has been applied to the invocation of this
  command, but this did not cause a rebuild of the generated files.
  
  Reported by:  cy.schub...@cschubert.com

Modified:
  head/usr.bin/gh-bc/Makefile

Modified: head/usr.bin/gh-bc/Makefile
==
--- head/usr.bin/gh-bc/Makefile Fri Nov 27 08:53:59 2020(r368096)
+++ head/usr.bin/gh-bc/Makefile Fri Nov 27 09:00:21 2020(r368097)
@@ -95,16 +95,16 @@ NLSLINKS_pt_PT.ISO8859-1+= pt_BR.ISO8859-1
 NLSLINKS_pt_PT.ISO8859-1+= pt_PT.ISO8859-15
 .endif
 
-lib.c: lib.bc
+lib.c: lib.bc Makefile
cd ${BCDIR} && sh gen/strgen.sh gen/lib.bc ${.OBJDIR}/lib.c 
bc_lib bc_lib_name 1 1
 
-lib2.c:lib2.bc
+lib2.c:lib2.bc Makefile
cd ${BCDIR} && sh gen/strgen.sh gen/lib2.bc ${.OBJDIR}/lib2.c 
bc_lib2 bc_lib2_name 1 1
 
-bc_help.c: bc_help.txt
+bc_help.c: bc_help.txt Makefile
cd ${BCDIR} && sh gen/strgen.sh gen/bc_help.txt 
${.OBJDIR}/bc_help.c bc_help
 
-dc_help.c: dc_help.txt
+dc_help.c: dc_help.txt Makefile
cd ${BCDIR} && sh gen/strgen.sh gen/dc_help.txt 
${.OBJDIR}/dc_help.c dc_help
 
 bc.1:
___
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: r368095 - stable/12/usr.bin/grep

2020-11-27 Thread Eugene Grosbein
Author: eugen
Date: Fri Nov 27 08:45:43 2020
New Revision: 368095
URL: https://svnweb.freebsd.org/changeset/base/368095

Log:
  MFC r367866: bzgrep: make flag --no-filename work
  
  PR:   248813

Modified:
  stable/12/usr.bin/grep/zgrep.sh
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/grep/zgrep.sh
==
--- stable/12/usr.bin/grep/zgrep.sh Fri Nov 27 08:41:38 2020
(r368094)
+++ stable/12/usr.bin/grep/zgrep.sh Fri Nov 27 08:45:43 2020
(r368095)
@@ -90,6 +90,10 @@ do
pattern_found=1
shift
;;
+   -h|--no-filename)
+   silent=1
+   shift
+   ;;
--*)
grep_args="${grep_args} $1"
shift
@@ -118,10 +122,6 @@ do
;;
-)
hyphen=1
-   shift
-   ;;
-   -h)
-   silent=1
shift
;;
-r|-R)
___
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"


Masques personnalisables 100 lavages 2,50€

2020-11-27 Thread Jérôme Sebbane
[ SANS DOUTE LE MEILLEUR MASQUE ! ]( 
http://r.pros2.nje-diffusion.com/mk/cl/f/3ouiZPPu5GvblaqUyH7_Vk4oOUSu6idliHGHJv-3azopVY6dfuEKL3f5GPR9uuCTH3sgJOoete41yE4d42CfYzLmUHAuqdRp2RKXg1KDUugafVl1DIKZord-vj0M0OupkiSHcLAE5Ml82d0VlAb-llASEsDLtq8byUX4I9LsGMk8ae9FVp9K
 )   [ PERSONNALISABLE • TESTÉ 100 LAVAGES ]( 
http://r.pros2.nje-diffusion.com/mk/cl/f/ELEht_wTuR8GLy4-tjsCF3WiB23eFDATBVJw5qmZDnY3dq8VDL64yo1YIvzn-7WSOYan6YckVIiXy_7zpEWhBiidwiRFrE28KgJhoB95zEalLPk-P9680K4lijgbk7EGrSV5wpM0T8tFfYa7VuBAxoQPoMZnKjfKDoybsCHKl1Crs27Qyfc7
 )
[ Cliquez ici : www.tous-en-masque.com ]( 
http://r.pros2.nje-diffusion.com/mk/cl/f/6CJLG_RlP1wBokGmqdxSAoZpbQgOPPcCxQ24cIQ0Srzqk9vwFuLsGRYGFwQXGe9i_TQrbtvUxLs9YpbVzNSP68VIfMEfYsawLHmlH0VKS3X2hxUaOFF48ZNqTu7ONwtC90_m_hD1O4BT_-Yylq4hEeCKAYFaEhl9ZSYJyYI7ODymn7Yshxr8
 )

COMMUNIQUEZ GRÂCE À VOS MASQUES !
     
[ Cliquez ici : www.tous-en-masque.com ]( 
http://r.pros2.nje-diffusion.com/mk/cl/f/v54sKkM7ptyJi3xsDb9E-SnHlOM7E3HWwlJlIAcUjSAtu8TSk1UaOWikr6UvxRsg5uyWmydAvavHUFQMbeSLia-Ck6Og7VqFJQLjstYzGimvJi1StpuCLOP4qY8KtcXhAVobC0NgEN_aunBElmt_MtxLqJGgzN-XTMvityl7tUwS9S_QcFre
 )
 
DADA ART

13, rue Emmanuel Chabrier
26000 VALENCE

RCS 751 108 002 000 21
Capital: 100 000€
[ 04 27 24 04 69 ]( tel:+33427240469 )
[ jer...@tous-en-masque.com ]( mailto:jer...@tous-en-masque.com )

___
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: r368093 - head/usr.sbin/bhyve

2020-11-27 Thread Rebecca Cran
Author: bcran
Date: Fri Nov 27 08:00:32 2020
New Revision: 368093
URL: https://svnweb.freebsd.org/changeset/base/368093

Log:
  Fix bhyve SMBIOS type 19 handling to avoid misreporting total RAM amount
  
  This fixes the amount of memory displayed in the EDK2 UiApp to be the same
  as passed on the bhyve command line. Otherwise, 8GB is displayed as 4GB,
  32GB as 28GB etc.
  
  Reviewed by:  jhb, kib, rgrimes
  Differential Revision:https://reviews.freebsd.org/D27348

Modified:
  head/usr.sbin/bhyve/smbiostbl.c

Modified: head/usr.sbin/bhyve/smbiostbl.c
==
--- head/usr.sbin/bhyve/smbiostbl.c Fri Nov 27 07:53:15 2020
(r368092)
+++ head/usr.sbin/bhyve/smbiostbl.c Fri Nov 27 08:00:32 2020
(r368093)
@@ -758,7 +758,7 @@ smbios_type19_initializer(struct smbios_structure *tem
type19 = (struct smbios_table_type19 *)curaddr;
type19->arrayhand = type16_handle;
type19->xsaddr = 4*GB;
-   type19->xeaddr = guest_himem;
+   type19->xeaddr = type19->xsaddr + guest_himem;
}
 
return (0);
___
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"