i386 4/4G split.The change makes the user and kernel address spaces on i386independent, giving each almost the full 4G of usable virtual addressesexcept for one PDE at top used for trampoline and
i386 4/4G split.The change makes the user and kernel address spaces on i386independent, giving each almost the full 4G of usable virtual addressesexcept for one PDE at top used for trampoline and per-CPU trampolinestacks, and system structures that must be always mapped, namely IDT,GDT, common TSS and LDT, and process-private TSS and LDT if allocated.By using 1:1 mapping for the kernel text and data, it appearedpossible to eliminate assembler part of the locore.S which bootstrapsinitial page table and KPTmap. The code is rewritten in C and movedinto the pmap_cold(). The comment in vmparam.h explains the KVAlayout.There is no PCID mechanism available in protected mode, so eachkernel/user switch forth and back completely flushes the TLB, exceptfor the trampoline PTD region. The TLB invalidations for userspacebecomes trivial, because IPI handlers switch page tables. On the otherhand, context switches no longer need to reload %cr3.copyout(9) was rewritten to use vm_fault_quick_hold(). An issue fornew copyout(9) is compatibility with wiring user buffers around sysctlhandlers. This explains two kind of locks for copyout ptes andaccounting of the vslock() calls. The vm_fault_quick_hold() AKA slowpath, is only tried after the 'fast path' failed, which temporarychanges mapping to the userspace and copies the data to/from smallper-cpu buffer in the trampoline. If a page fault occurs during thecopy, it is short-circuit by exception.s to not even reach C code.The change was motivated by the need to implement the Meltdownmitigation, but instead of KPTI the full split is done. The i386architecture already shows the sizing problems, in particular, it isimpossible to link clang and lld with debugging. I expect that theissues due to the virtual address space limits would only exaggerateand the split gives more liveness to the platform.Tested by: phoDiscussed with: bdeSponsored by: The FreeBSD FoundationMFC after: 1 monthDifferential revision: https://reviews.freebsd.org/D14633
show more ...
Create a new ISA_PNP_INFO macro. Use this macro every where we haveISA PNP card support (replace by hand version in if_ed). Move moduledeclarations to the end of some files. Fix PCCARD_PNP_INFO to
Create a new ISA_PNP_INFO macro. Use this macro every where we haveISA PNP card support (replace by hand version in if_ed). Move moduledeclarations to the end of some files. Fix PCCARD_PNP_INFO to usenitems(). Remove some stale comments about pc98, turns out the commentwas simply wrong.
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
Hide a normal probe warning message under bootverbose, similar to atkbdcSponsored by: Netflix
Add PCI Id for MosChip MCS9900.Submitted by: Robert Clausecker <[email protected]>PR: 214670MFC after: 1 week
Remove register keyword from sys/ and ANSIfy prototypesA long long time ago the register keyword told the compiler to storethe corresponding variable in a CPU register, but it is not relevantfor
Remove register keyword from sys/ and ANSIfy prototypesA long long time ago the register keyword told the compiler to storethe corresponding variable in a CPU register, but it is not relevantfor any compiler used in the FreeBSD world today.ANSIfy related prototypes while here.Reviewed by: cem, jhbSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D10193
sys/dev: Replace zero with NULL for pointers.Makes things easier to read, plus architectures may set NULL to somethingdifferent than zero.Found with: devel/coccinelleMFC after: 3 weeks
Remove pc98 support completely.I thank all developers and contributors for pc98.Relnotes: yes
Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.On some architectures, u_long isn't large enough for resource definitions.Particularly, powerpc and arm allow 36-bit (or larger) physic
Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.On some architectures, u_long isn't large enough for resource definitions.Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, buttype `long' is only 32-bit. This extends rman's resources to uintmax_t. Withthis change, any resource can feasibly be placed anywhere in physical memory(within the constraints of the driver).Why uintmax_t and not something machine dependent, or uint64_t? Though it'spossible for uintmax_t to grow, it's highly unlikely it will become 128-bit on32-bit architectures. 64-bit architectures should have plenty of RAM to absorbthe increase on resource sizes if and when this occurs, and the number ofresources on memory-constrained systems should be sufficiently small as to notpose a drastic overhead. That being said, uintmax_t was chosen for sourceclarity. If it's specified as uint64_t, all printf()-like calls would eitherneed casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_taren't horrible, but it would also bake into the API forresource_list_print_type() either a hidden assumption that entries get cast touintmax_t for printing, or these calls would need the PRI*64 macros. Sincesource code is meant to be read more often than written, I chose the clearestpath of simply using uintmax_t.Tested on a PowerPC p5020-based board, which places all device resources in0xfxxxxxxxx, and has 8GB RAM.Regression tested on qemu-system-i386Regression tested on qemu-system-mips (malta profile)Tested PAE and devinfo on virtualbox (live CD)Special thanks to bz for his testing on ARM.Reviewed By: bz, jhb (previous)Relnotes: YesSponsored by: Alex Perez/Inertial ComputingDifferential Revision: https://reviews.freebsd.org/D4544
Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Most calls to bus_alloc_resource() use "anywhere" as the range, with a givencount. Migrate these to use the new bus_alloc_
Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Most calls to bus_alloc_resource() use "anywhere" as the range, with a givencount. Migrate these to use the new bus_alloc_resource_anywhere() API.Reviewed by: jhbDifferential Revision: https://reviews.freebsd.org/D5370
Convert rman to use rman_res_t instead of u_longSummary:Migrate to using the semi-opaque type rman_res_t to specify rman resources. Fornow, this is still compatible with u_long.This is step on
Convert rman to use rman_res_t instead of u_longSummary:Migrate to using the semi-opaque type rman_res_t to specify rman resources. Fornow, this is still compatible with u_long.This is step one in migrating rman to use uintmax_t for resources instead ofu_long.Going forward, this could feasibly be used to specify architecture-specificdefinitions of resource ranges, rather than baking a specific integer type intothe API.This change has been broken out to facilitate MFC'ing drivers back to 10 withoutbreaking ABI.Reviewed By: jhbSponsored by: Alex Perez/Inertial ComputingDifferential Revision: https://reviews.freebsd.org/D5075
Add support for SIIG x1 pci-e single parallel port card (JJ-E01211-S1)PR: kern/182217Submitted by: Craig Leres <[email protected]>MFC After: 1 week
Fix build.
Replace splhigh() with critical_enter()/leave() to ensure we write theconfig mode unlock sequence quickly enough. This likely isn't too critical,since splhigh() has been a noop for a decade...
No longer need splhigh() since locking was done, delete it andcomments about it.
Rename device_delete_all_children() into device_delete_children().Suggested by: jhb @ and marius @MFC after: 1 week
Move the device_delete_all_children() function from usb_util.cto kern/subr_bus.c. Simplify this function so that it no longerdepends on malloc() to execute. Identify a few other places whereit mak
Move the device_delete_all_children() function from usb_util.cto kern/subr_bus.c. Simplify this function so that it no longerdepends on malloc() to execute. Identify a few other places whereit makes sense to use device_delete_all_children().MFC after: 1 week
- Add support for MosChip 9865 Single 1284 Printer portPR: kern/152663Submitted by: Jonathan Chen <[email protected]>Approved by: rwatson (mentor)
Add PCI ID for MCS9901's parallel port.PR: kern/144713Submitted by: gcooperMFC after: 2 weeks
Added entries for Lava SP-PCI (1 serial + 1 parallel) PCI card. Thecard is a multifunction PCI and report itself as two logical devices.
reset_epp and ecp_sync both return int.
Add locking to ppc and ppbus and mark the whole lot MPSAFE:- To avoid having a bunch of locks that end up always getting acquired as a group, give each ppc(4) device a mutex which it shares with a
Add locking to ppc and ppbus and mark the whole lot MPSAFE:- To avoid having a bunch of locks that end up always getting acquired as a group, give each ppc(4) device a mutex which it shares with all the child devices including ppbus(4), lpt(4), plip(4), etc. This mutex is then used for all the locking.- Rework the interrupt handling stuff yet again. Now ppbus drivers setup their interrupt handler during attach and tear it down during detach like most other drivers. ppbus(4) only invokes the interrupt handler of the device that currently owns the bus (if any) when an interrupt occurs, however. Also, interrupt handlers in general now accept their softc pointers as their argument rather than the device_t. Another feature of the ppbus interrupt handlers is that they are called with the parent ppc device's lock already held. This minimizes the number of lock operations during an interrupt.- Mark plip(4), lpt(4), pcfclock(4), ppi(4), vpo(4) MPSAFE.- lpbb(4) uses the ppc lock instead of Giant.- Other plip(4) changes: - Add a mutex to protect the global tables in plip(4) and free them on module unload. - Add a detach routine. - Split out the init/stop code from the ioctl routine into separate functions.- Other lpt(4) changes: - Use device_printf(). - Use a dedicated callout for the lptout timer. - Allocate the I/O buffers at attach and detach rather than during open and close as this simplifies the locking at the cost of 1024+32 bytes when the driver is attached.- Other ppi(4) changes: - Use an sx lock to serialize open and close. - Remove unused HADBUS flag. - Add a detach routine. - Use a malloc'd buffer for each read and write to avoid races with concurrent read/write.- Other pps(4) changes: - Use a callout rather than a callout handle with timeout(). - Conform to the new ppbus requirements (regular mutex, non-filter interrupt handler). pps(4) is probably going to have to become a standalone driver that doesn't use ppbus(4) to satisfy it's requirements for low latency as a result. - Use an sx lock to serialize open and close.- Other vpo(4) changes: - Use the parent ppc device's lock to create the CAM sim instead of Giant.- Other ppc(4) changes: - Fix ppc_isa's detach method to detach instead of calling attach.Tested by: no one :-(
Various whitespace and style fixes.
Fix build with PPC_PROBE_CHIPSET enabled.
Several cleanups to remove the need for explicit unit numbers and a fewother fixes:- Add pointers back to device_t objects in softc structures instead of storing the unit and using devclass_get_d
Several cleanups to remove the need for explicit unit numbers and a fewother fixes:- Add pointers back to device_t objects in softc structures instead of storing the unit and using devclass_get_device().- Add 'lpbb', 'pcf', 'pps', and 'vpo' child devices to every 'ppbus' device instead of just the first one.- Store softc pointers in si_drv1 of character devices instead of pulling the unit number from the minor number and using devclass_get_softc() and devclass_get_device().- Store the LP_BYPASS flag in si_drv2 instead of encoding it in the minor number.- Destroy character devices for lpt(4) when detaching the device.- Use bus_print_child_footer() instead of duplicating it in ppbus_print_child() and fix ppbus_print_child()'s return value.- Remove unused AVM ivar from ppbus.- Don't store the 'mode' ivar in the ppbus ivars since we always fetch it from the parent anyway.- Try to detach all the child devices before deleting them in ppbus_detach().- Use pause() instead of a tsleep() on a dummy address when polling the ppbus.- Use if_printf() and device_printf() instead of explicit names with unit numbers.Silence on: current@
1234