Commit Graph

124795 Commits

Author SHA1 Message Date
msaitoh a23b292638 Pull up following revision(s) (requested by riastradh in ticket #949):
sys/ufs/ffs/ffs_alloc.c: revision 1.151
Need wapbl transaction around ffs_blkfree_cg.  Fixes wapbl+discard.
2015-08-14 05:29:14 +00:00
snj 810f58a3ee Welcome to 7.0_RC3! 2015-08-11 05:37:41 +00:00
snj b92e1eb930 Pull up following revision(s) (requested by msaitoh in ticket #947):
sys/arch/x86/x86/mpacpi.c: revision 1.98
Fix wrong output in mpacpi_pci_foundbus() with MPVERBOSE. Assign
vaues before printing them.
2015-08-11 05:15:25 +00:00
snj d8e4dc21f3 Pull up following revision(s) (requested by msaitoh in ticket #945):
sys/arch/x86/x86/cpu_ucode_intel.c: revisions 1.7, 1.8
Re-allocale buffer if a buffer for microcode is not 16byte aligned.
--
Use roundup2() and uintptr_t. Adviced by riastradh@.
2015-08-11 05:13:44 +00:00
snj 7a93abab25 Pull up following revision(s) (requested by msaitoh in ticket #946):
sys/arch/x86/x86/coretemp.c: revision 1.34
- Change the Upper limit of Tjmax from 100 to 110 because some new
  CPUs have 105. This change is the same as FreeBSD.
- Print Tjmax with aprint_verbose().
- Reduce the diff against FreeBSD.
2015-08-11 05:11:08 +00:00
snj f33b7c6d75 Pull up following revision(s) (requested by msaitoh in ticket #948):
sys/arch/x86/x86/mpacpi.c: revisions 1.99, 1.100
	sys/arch/x86/x86/lapic.c: revision 1.49
- Add lapic_dump() to print lapic's setting.
- Add mpacpi_dump() to dump mp_intrs[].
--
Configure ioapic before lapic because lapic(lapic_set_lvt()) checks the
existence of ioapic. This change fixes a problem that some machines hang
after attaching ehci (little after writing EHCI_USBINTR to enable interrupt).
Even though cold == 1, LAPIC_LVINT0 was not set as masked. Perhaps it's the
reason of the problem.
This problem was observed on SuperMicro X10SLX-F, X10SDV-TLN4F and
Shuttle DS57U without wm(4) driver.
2015-08-11 05:07:16 +00:00
martin 3eb2f2ce5b Pull up following revision(s) (requested by mlelstv in ticket #943):
sys/kern/vfs_wapbl.c: revision 1.62
Refactor disk address calculation from physical block numbers in
the journal into a function. Make that function work correctly with
sector sizes != DEV_BSIZE when compiled outside the kernel (i.e.
fsck_ffs).
Fixes PR bin/45933
2015-08-09 10:15:15 +00:00
martin a0e5c8a575 Pull up following revision(s) (requested by maxv in ticket #942):
sys/kern/uipc_syscalls.c: revision 1.179
Memory leak. Triggerable from an unprivileged user via COMPAT_43.
2015-08-08 15:45:47 +00:00
martin 40be23e7da Pull up following revision(s) (requested by maxv in ticket #941):
sys/compat/netbsd32/netbsd32_socket.c: revision 1.42
Memory leak, triggerable from an unprivileged user.
2015-08-08 15:41:54 +00:00
martin 36c3bf3db9 Pull up following revision(s) (requested by prlw1 in ticket #939):
sys/external/bsd/ipf/netinet/ip_nat.h: revision 1.7
	sys/external/bsd/ipf/netinet/ip_nat.c: revision 1.14
	sys/external/bsd/ipf/netinet/ip_nat6.c: revision 1.8
Avoid panic in SIOCGNATL dereferencing a NULL softc.
Solution suggestion from Martin Husemann.
2015-08-08 10:09:57 +00:00
snj aafcbf7a9d Apply patch (requested by dholland in ticket #935):
Comment out some KASSERTs.
2015-08-06 21:57:28 +00:00
snj f3ef739816 Pull up following revision(s) (requested by maxv in ticket #912):
sys/kern/sys_pset.c: revision 1.19
Don't forget to unlock the LWP.
ok rmind@
2015-08-06 21:47:11 +00:00
snj 49908678ea Pull up following revision(s) (requested by maxv in ticket #914):
sys/dev/pci/if_et.c: revision 1.9
Use-after-free.
ok christos@
Found by Brainy.
2015-08-04 21:16:43 +00:00
snj 8c7343de46 Pull up following revision(s) (requested by maxv in ticket #913):
sys/dev/pci/if_ti.c: revisions 1.94, 1.95
fix mbuf leak on failure (Brainy)
--
Memory leak. Same as r1.93. I don't know why Brainy didn't detect it
earlier; or perhaps I forgot to report it.
Found by Brainy.
2015-08-04 21:14:49 +00:00
snj a7264f23c5 Pull up following revision(s) (requested by prlw1 in ticket #934):
sys/arch/xen/x86/cpu.c: revision 1.100
Move all pmap-related cpu_info initialisations, including
initializing ci_kpm_mtx, in cpu_attach_common() from cpu_init()
(ci_pmap and ci_tlbstate as already initialized in cpu_attach_common()).
2015-08-04 18:12:28 +00:00
snj 909b53e441 Pull up following revision(s) (requested by christos in ticket #933):
sys/kern/kern_descrip.c: revision 1.229
1. mask fflags so we don't tack on whateve oflags were passed from userland
2. honor O_CLOEXEC, so the children of daemons that use cloning devices, don't
   end up with the parents descriptors
fd_clone and in general the fd approach of 'allocate' > 'play with guts' >
'attach' should be converted to be more constructor like.
2015-08-04 17:24:59 +00:00
snj 195291cacc Pull up following revision(s) (requested by dholland in ticket #932):
sys/ufs/lfs/lfs_segment.c: revision 1.247 via patch
Fix catastrophic bug in lfs_rewind() that changed segment numbers
(lfs_curseg/lfs_nextseg in the superblock) using the wrong units.
These fields are for whatever reason the start addresses of segments
(measured in frags) rather than the segment numbers 0..n.
This only apparently affects dumping from a mounted fs; however, it
trashes the fs.
I would really, really like to have a static analysis tool that can
keep track of the units things are measured in, since fs code is full
of conversion macros and the macros are named inscrutable things like
"sntod" whose letters don't necessarily even correspond to the units
they convert. It is surprising that more of these are not wrong.
2015-08-04 17:20:58 +00:00
snj 9d223c0ed9 Pull up following revision(s) (requested by tsutsui in ticket #931):
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.32
Pull upstream fix to avoid kernel panic on starting X on Intel 855GM machines.
Reported in PR kern/49875, and ok'ed to commit by riastradh@.
2015-08-04 17:18:39 +00:00
martin 361594579a Pull up following revision(s) (requested by maxv in ticket #930):
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.82
Wrong logic. Here, userland can control the size and the data copied, which
basically means it can overflow kernel memory.
ok martin@ christos@
2015-08-02 11:29:10 +00:00
snj b1d90f8563 Pull up following revision(s) (requested by christos in ticket #924):
sys/dev/ccd.c: revision 1.163
initialized sc_unit (from Riastradh)
XXX: pullup-7
2015-07-31 17:29:45 +00:00
snj 598f87d2e2 Pull up following revision(s) (requested by riastradh in ticket #911):
sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c: revision 1.3
Fix two issues in NetBSD implementation of igp_read_bios_from_vram():
 * Allocate the correct buffer for the VGA BIOS image.
 * Abort if buffer allocation failed, not if buffer allocation succeeded.
Not directly tested, but I can't imagine this makes anything worse.
2015-07-30 16:29:38 +00:00
snj e24ad86ee2 Pull up following revision(s) (requested by hannken in ticket #910):
sys/dev/ic/mpt_netbsd.c: revision 1.32
Adapter leaks requests when mpt_event_notify_reply() has to acknowledge
an event leading to "adapter resource shortage" messages when the scsipi
subsystem tries to use all adapt_openings.
Change mpt_ctlop() to free the request on event MPI_FUNCTION_EVENT_ACK.
Tested on a SunFire X4275 with Symbios Logic SAS1068E (1000:0058, rev. 4).
2015-07-30 15:53:39 +00:00
snj 431ad58fc7 Pull up following revision(s) (requested by riastradh in ticket #908):
sys/dev/usb/uplcom.c: revision 1.75
Null suspend/resume handler for uplcom(4).
2015-07-30 15:51:58 +00:00
snj d8a6782de3 Pull up following revision(s) (requested by riastradh in ticket #907):
sys/external/bsd/drm2/linux/linux_ww_mutex.c: revision 1.2
	sys/external/bsd/drm2/include/linux/ww_mutex.h: revision 1.11
Adapt ww_mutex to use LOCKDEBUG.
Should help track down PR 49862.
2015-07-30 15:50:15 +00:00
snj f3ee2248a3 Pull up following revision(s) (requested by riastradh in ticket #906):
sys/external/bsd/drm2/include/linux/pci.h: revisions 1.18, 1.19
	sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c: revision 1.4
Save the location of the found ROM so caller can bus_space_read it.
--
Use bus_space_read rather than kmemdup to read ROM.
jakllsch@ reports that on some 64-bit systems, kmemdup does 8-byte
reads, which yield garbage in the high word.  bus_space_read_region_1
does 1-byte reads instead, which seem to work.
Derived from a patch from jakllsch@.
--
Fix type of pd_rom_found_size: it's a size, not a handle.
2015-07-30 15:46:41 +00:00
snj 1a862671d1 Pull up following revision(s) (requested by riastradh in ticket #904):
sys/external/bsd/drm2/dist/drm/drm_bufs.c: revision 1.7
	sys/external/bsd/drm2/dist/include/drm/drmP.h: revision 1.11
	sys/external/bsd/drm2/drm/drm_memory.c: revision 1.7
	sys/external/bsd/drm2/pci/drm_pci.c: revision 1.13
Replace drm_ioremap by drm_core_ioremap, reducing diff a little.
2015-07-30 15:43:36 +00:00
snj 58bf942f2a Pull up following revision(s) (requested by riastradh in ticket #903):
sys/external/bsd/drm2/ttm/ttm_agp_backend.c: revision 1.4
kmem_free the container structure, not a substructure.
2015-07-30 15:41:44 +00:00
snj a3da9b5d8e Pull up following revision(s) (requested by riastradh in ticket #901):
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.30
Remove workaround for PR kern/49195.
Problem seems to have been properly fixed in rev. 1.25.
2015-07-30 15:38:39 +00:00
snj f731b0126b Pull up following revision(s) (requested by riastradh in ticket #897):
sys/external/bsd/drm2/dist/drm/radeon/radeon_connectors.c: revisions 1.2, 1.3
Don't pass along null encoder.  Noted by Coverity, CID 113253.
--
Add XXX comment for previous.
2015-07-30 15:32:46 +00:00
snj b5504f021a Pull up following revision(s) (requested by riastradh in ticket #894):
sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revisions 1.9, 1.10
Fix error branch: ttm_bo_unreserve on failure after ttm_bo_reserve.
Tiny chance this will fix PR kern/49862 by not leaking a ww_mutex
lock.
--
ttm_bo_unreserve in case of ttm_bo_uvm_fault_idle restart.
Better chance of fixing PR kern/49862 by avoiding leaking a buffer
ww_mutex lock.
2015-07-30 15:29:25 +00:00
snj a6e2049b00 Pull up following revision(s) (requested by abs in ticket #892):
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c: revision 1.7
Avoid NULL dev_priv->vlv_pctx-> deref in a WARN check on Lenovo B50-30,
add an additional check for the NULL dev_priv->vlv_pctx.
System now boots (though does not recognise any of the USB(3) ports)
2015-07-30 15:21:50 +00:00
snj e02b4a9318 Pull up following revision(s) (requested by martin in ticket #887):
sys/dev/pci/oboe.c: revision 1.43
Pass the device, not the struct softc to config_found().
Avoids a crash at attach time, PR port-i386/50076.
2015-07-30 15:19:07 +00:00
martin c040976b7f Pull up following revision(s) (requested by tsutsui in ticket #893):
sys/arch/macppc/stand/ofwboot/Locore.c: revision 1.26
Don't set garbages into BAT registers, which was broken in rev 1.25.
Should fix PR port-macppc/50018 (though there is no response for 3 weeks),
and should be pulled up to netbsd-7.
2015-07-30 10:22:12 +00:00
martin 614d7b2a75 Pull up following revision(s) (requested by skrll in ticket #890):
sys/arch/arm/pic/pic.c: revision 1.27-1.32
	sys/arch/arm/omap/omap5430_intr.h: revision 1.3
	sys/arch/arm/broadcom/bcm2835_obio.c: revision 1.25
	sys/arch/arm/cortex/gic.c: revision 1.18
	sys/arch/arm/broadcom/bcm2835reg.h: revision 1.15
	sys/arch/evbarm/rpi/rpi_machdep.c: revision 1.61
	sys/arch/arm/broadcom/bcm2835_intr.h: revision 1.2
	sys/arch/arm/marvell/mvsoc_intr.h: revision 1.5
	sys/arch/arm/broadcom/bcm2835_intr.c: revision 1.8-1.10
	sys/arch/arm/pic/picvar.h: revision 1.12-1.14
	sys/arch/arm/omap/omap4430_intr.h: revision 1.3

Don't clear CI_ASTPENDING in exception return, do it in ast() instead.
Add basic support for __HAVE_PREEMPTION.
Use atomic ops for ci_astpending if __HAVE_PREEMPTION is defined.
Use kpreempt_disable/kpreempt_enable
Add __HAVE_PIC_HAVE_PENDING_INTRS and define it if __HAVE_PIC_SET_PRIORITY
is undefined (also define in mvsoc_intr.h since their use of the latter is
peculiar).  This new define controls whether the pending interrupt logic is
compiled.  The GIC doesn't use pending interrupts since it uses the priority
level on the GIC to control delivery of interrupts, thus there can never
be a pending interrupt.  The kernel shrinks about 4KB with the removal of
the pending interupt support,
Only if we __HAVE_PIC_PENDING_INTRS do we need the variables to track them.
Add #define __HAVE_PIC_PENDING_INTRS for the non-GIC PICs.
Add a pic_cpus to the softc which specifies which cpus the pic can send
IPIs to.  For GIC, initialize pic_cpus to kcpuset_running since it can handle
all the cpus.
Adapt pic to deal with the BCM2836 interrupts.
Move pic_pending_pics, pic_pending_ipls, and pic_blocked_irqs into a
structure and make then per-cpu.  There is no global interrupt state anymore.
Use right kcpuset call.
Don't need pic_ipi_sender anymore.
Don't send IPIs to ourselves if sending to everyone.
RPI2 MP support.
Thanks to Matt Thomas for making this possible with his changes to pic.c
Use a bit per IPI type in local mailbox 0 registers. Ok matt@
IPIs should be IPL_HIGH according to rmind@
Fix bcm2836mp_pic_{un,}block_irqs to handle timer AND mailbox interrupts
if they're both passed.  Thanks to nat@ for finding this.
Sprinkle some KASSERTs
2015-07-30 09:37:37 +00:00
martin a4a1e71ed1 Pull up following revision(s) (requested by maxv in ticket #889):
sys/dev/pci/if_bge.c: revision 1.283
	sys/dev/pci/if_pcn.c: revision 1.60
Fix mbuf leaks in error branches (found by the Brainy code scanner)
2015-07-30 09:23:05 +00:00
martin 08092d4dff Pull up following revision(s) (requested by matt in ticket #886):
sys/netinet/tcp_output.c: revision 1.184
	sys/netinet/tcp_input.c: revision 1.343

If we are sending a window probe and there's unacked data in the
socket, make sure at least the persist timer is running.
Make sure that snd_win doesn't go negative.
2015-07-24 07:30:40 +00:00
snj 5cd0b8f81d Welcome to 7.0_RC2! 2015-07-23 18:45:15 +00:00
snj e6561ca938 Pull up following revision(s) (requested by bouyer in ticket #884):
sys/arch/amd64/conf/XEN3_DOM0: revision 1.114
	sys/arch/amd64/conf/XEN3_DOMU: revision 1.62
	sys/arch/i386/conf/XEN3_DOM0: revision 1.96
	sys/arch/i386/conf/XEN3_DOMU: revision 1.68
Uncoment options IPSEC, as requested by Gary Duzan in PR port-amd64/50052
2015-07-22 16:53:34 +00:00
snj bf068cf4df Pull up following revision(s) (requested by martin in ticket #842):
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c: revision 1.14
	sys/arch/sparc/stand/ofwboot/version: revision 1.21
	sys/arch/sparc64/include/cpu.h: revision 1.115
	sys/arch/sparc64/sparc64/autoconf.c: revision 1.203
	sys/arch/sparc64/sparc64/mp_subr.S: revision 1.9 via patch
	sys/arch/sparc64/sparc64/pmap.c: revisions 1.295, 1.295 via patch
Fix available length calculation in kvamap_extract when reusing existing
mappings.
--
Bump version now that we can load kernels with sizeof(.data)+sizeof(.bss)> 4 MB
--
Do not hardcode the assumption that .data and .bss fit together in a single
4 MB page. This allows booting kernels with options USB_DEBUG again.
--
Slightly optimize the ITLB usage on secondary processors
2015-07-20 06:12:23 +00:00
snj 70c8beb657 Apply patch (requested by nonaka in ticket #881):
Deregister pmf hook when attach failed.
2015-07-17 04:44:41 +00:00
snj 5c1a190371 Pull up following revision(s) (requested by rmind in ticket #880):
sys/net/npf/npf_if.c: revision 1.5
	sys/net/npf/npf_mbuf.c: revision 1.14
	usr.sbin/npf/npf.7: revision 1.3
	usr.sbin/npf/npfctl/npf_var.c: revision 1.9
npfkern: eliminate INACTIVE_ID and use 0 for unregistered interfaces.
--
- npfvar_get_type1: check for NULL first.
- Minor fix for the npf(7) man page.
2015-07-17 04:37:22 +00:00
snj a5a0be836e Pull up following revision(s) (requested by martin in ticket #879):
sys/compat/netbsd32/netbsd32_time.c: revision 1.43
Use the right type in sizeof() for copyin() in adjtime
2015-07-17 04:34:34 +00:00
snj 83d79b0622 Pull up following revision(s) (requested by christos in ticket #876):
sys/arch/arm/arm32/arm32_reboot.c: revisions 1.7, 1.8
- print a warning about powerdown not supported like other ports do
- merge duplicated code
- if halt is requested and there is no console, keep looping instead of
  rebooting.
--
Mark end of cpu_reboot as unreachable.
2015-07-17 03:48:00 +00:00
snj f59281dfbb Pull up following revision(s) (requested by matt in ticket #868):
sys/arch/powerpc/include/psl.h: revision 1.20
	sys/arch/powerpc/include/userret.h: revisions 1.29, 1.30
	sys/arch/powerpc/oea/altivec.c: revision 1.30
	sys/arch/powerpc/oea/oea_machdep.c: revision 1.72
	sys/arch/powerpc/powerpc/fpu.c: revision 1.36
Add a check to make sure that if PSL_FP is set, we own the FPU.
--
Don't clear PSL_FP/PSL_VEC
--
Don't reload if just re-enabling
--
Don't reload the FPU register if this is just a re-enable.
--
Remove PSL_SPV from BOOKE PSL_USERMOD
--
Don't preserve PSL_FP/PSL_VEC in cpu_setmcontext.
2015-07-17 03:34:01 +00:00
snj 0a15e86d21 Pull up following revision(s) (requested by hannken in ticket #850):
sys/ufs/ufs/ufs_inode.c: revisions 1.93-1.95
Release the glock on VOP_GETPAGES failure.
Tripped over by nick@'s failing disk, missing unlock in error branch
discovered by jmcneill@.
--
ufs_inactive: take UFS_WAPBL_BEGIN() before calling chkiq().
Should fix PR kern/49948 (quota panic)
--
ufs_inactive: stop overwriting error status and return the last error seen.
Should resolve CID 1306276 (UNUSED_VALUE)
2015-07-16 21:40:22 +00:00
riz ad77557cd7 Pull up following revision(s) (requested by martin in ticket #846):
sys/arch/mips/include/ansi.h: revision 1.29
	sys/arch/sh3/include/ansi.h: revision 1.16
	sys/arch/sparc64/include/ansi.h: revision 1.18
	sys/arch/m68k/include/ansi.h: revision 1.24
	sys/arch/powerpc/include/ansi.h: revision 1.30
	sys/arch/hppa/include/ansi.h: revision 1.14
	sys/arch/i386/include/ansi.h: revision 1.27
	sys/arch/alpha/include/ansi.h: revision 1.25
	sys/arch/usermode/include/ansi.h: revision 1.5
	sys/arch/sparc/include/ansi.h: revision 1.24
Make _BSD_CLOCK_T_ unsigned int so it's the same for IPL32 and LP64
environments.  We don't really have a powerpc64 native userland
and the mips64 native userland is IPL32 so this shouldn't affect anything.
Make clock_t unsigned
Make clock_t unsigned int everywhere.
Ok: matt@, mrg@
2015-07-16 18:27:22 +00:00
snj 6afa892253 Pull up following revision(s) (requested by alnsn in ticket #872):
sys/arch/amd64/include/sljit_machdep.h: revision 1.2
Include <i386/sljit_machdep.h> for i386 compat build.
2015-07-08 21:58:53 +00:00
snj 4e79745d41 Pull up following revision(s) (requested by chs in ticket #854):
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.31
fix Xorg coredumps that have started happening recently.
the problem is that we get a SIGALRM while we're sleeping during a page fault
on a mapping of a GEM object, and since we're sleeping interruptibly,
the GEM operation fails with EINTR.  this error is returned all the way back
through uvm_fault() to the trap handler, which responds to that error
by delivering a SIGSEGV.
fix this by doing like the linux version of the GEM fault handler and converting
EINTR into success, which results in delivering the original signal and
retrying the fault.
2015-07-05 21:31:48 +00:00
snj 44cd68da9b Pull up following revision(s) (requested by chs in ticket #848):
sys/external/bsd/drm2/drm/drm_vma_manager.c: revision 1.3
plug memory leak in drm_vma_node_revoke().
2015-07-05 21:29:26 +00:00
snj 7dc331bf55 Pull up following revision(s) (requested by maxv in ticket #858):
sys/dev/ic/ac97.c: revision 1.96
fix memory leak, found by Brainy.
XXX: is there anything else that we need to cleanup at this point?
2015-07-05 20:37:01 +00:00