module which is linked into the kernel and cannot be unloaded.
The main purpose is to get the proper constructors run and create
any /dev nodes necessary for said component. Once more of the
kernel (e.g. networking stack and device drivers) are converted to
MODULE and devfs pops up from somewhere, rump components can be
retired.
limit values from the device driver, remove the high_limit and low_limit
entries from the hw.dbcool<#>.<sensor> sysctl(8) tree. These limits are
now directly accessible via envstat(8). Simplify the remaining code
somewhat.
No objections raised on either tech-kern@ or current-users@
XXX The fan controllers's parameters (including those that are tied to
XXX temperature sensors) are still in sysctl, since there isn't any clean
XXX way to implement the fan controllers in sysmon_envsys yet. It is on
XXX my To-Do list...
for paddr_t values under i386 PAE. Use ctob() instead.
Although amd64 is not affected by this vaddr_t vs paddr_t issue (both
having the same size), for the sake of completeness, switch to
ctob() when manipulating paddr_t/psize_t entities in amd64 machdep.c.
Compile tested for i386 and amd64. No regression expected.
(instead of size_t) to avoid possible overflow when system may have more
than 4GB of memory (like PAE).
The behavior of rbus_min_start_hint() remains the same. While here, fix
printf's format strings (paddr_t => PRIxPADDR).
Use ctob() and cast physmem to psize_t to avoid losing bits above 4GB.
Comes from PAE patch from Jeremy Morse; adaptation by me.
Compile tested for GENERIC only. No regression expected.
* * *
XXX: The internal memory tracking of ACPICA, available when
ACPI_DBG_TRACK_ALLOCATIONS is defined, has been removed
from ACPI_DEBUG.
This is due to the instability of the ABI of ACPICA.
If the memory tracking is enabled, ACPICA will insert a header
to each memory allocation. As a consequence, when ACPI specific
code is loaded as a kernel module and the running kernel has
been compiled with ACPI_DEBUG, the result is an instant panic.
This happens because of unaligned memory access when the code
tries to use ACPI_FREE for a buffer obtained via ACPI_ALLOCATE,
AcpiEvaluateObject(), and related calls.
If the involved memory statistics are required, a separate constant
ACPI_DEBUG_ALLOC is available in options(4) for ACPI_DEBUG kernels.
* * *
Discussed with, and ok'ed by, jmcneill@ and pooka@.
* Semantics.
* Remove ACPI_LID_DEBUG.
* Reduce the amount of error reporting.
* As the status of the lid (open/closed) is known upon suspend, move the
state variable to the softc, and avoid one object evaluation this way.
conditionally build DEV_BSIZE adjustments for kernel. fsck_ffs shares
the same code but accesses physical blocks.
Also compute correct block numbers for each physical sector.
- NBPD_* macros are set to the types that better match their architecture
(UL for i386 and amd64, ULL for i386 PAE) - will revisit when paddr_t is
set to 64 bits for i386 non-PAE.
- type fixes in printf/printk messages (Use PRIxPADDR when printing paddr_t
values, instead of %lx - paddr_t/pd_entry_t being 64 bits with PAE)
- remove casts that are no more needed now that Xen2 support has been dropped
Some fixes are from jmorse@ patches for PAE.
Compile + tested for i386 GENERIC and XEN3 kernels. Only compile tested for
amd64.
Reviewed by bouyer@.
See also http://mail-index.netbsd.org/tech-kern/2010/02/22/msg007373.html
the source files from src/sys/rump/librump/rumpuser to src/lib/librumpuser
(from where it is already built). Even so, keep rumpuser.h in
sys/rump/include for kernel source tree self-containment.
to the total free memory available to the system, use the smallest value
between VM_MAXUSER_ADDRESS and total free memory (having a RSS limit
bigger than VM_MAXUSER_ADDRESS has no real meaning).
Fix a possible int overflow when ptoa(uvmexp.free) is bigger than 4GB
with a 32 bits vaddr_t.
This change is similar to the one made in rev 1.144 of uvm/uvm_glue.c.
Cardbus_conf_{read,write}() instead of cardbus_conf_{read,write}().
Delete all of the CARDBUS_ constants and macros that replicate PCI_.
Compile-tested, only.
Stop calling (*cardbus_ctrl) to enable bus mastering, I/O and memory
spaces on the CardBus bridge. cbb(4) always enables that stuff,
anyway. In the process, avoid remembering what BAR we mapped by
writing CARDBUS_{IO,MEM}_ENABLE to sc_cben or sc_cbenable, and
record the BAR in use sc_bar, instead.
Replace more CARDBUS_ constants with PCI_ constants.
Compile-tested, only.
to the total free memory available to the system, use the smallest value
between VM_MAXUSER_ADDRESS and total free memory (having a RSS limit
bigger than VM_MAXUSER_ADDRESS has no real meaning).
Fix a possible int overflow when ptoa(uvmexp.free) is bigger than 4GB
with a 32 bits vaddr_t.
Reviewed by bouyer@.
See also http://mail-index.netbsd.org/tech-kern/2010/02/24/msg007395.html
Loosely based on patch from Brian Brombacher,
with other inspriation from vnd(4).
This should fix PR kern/42799.
While here, a few prototype, style and namespace pollution-related changes.
code to override the default pci(9) behavior by creating a non-NULL
pci_attach_args_t (on x86, pci_attach_args_t is always NULL) containing
one or more non-NULL function pointers.
Since we don't have any documentationthis driver is unaccelerated and thanks
to the insane state we get the hardware in it's also slow and scrolling
looks weird.
Some hardware info came from OpenBSD's ifb driver.
substitution: for all practical purposes, pcitag_t and cardbustag_t are
interchangeable, so just use pcitag_t. Ditto pcireg_t and cardbusreg_t.
Poison new uses of cardbusreg_t and cardbustag_t by deleting the type
definitions.
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
pci_chipset_tag *pci_chipset_tag_t' for an improvement in type safety.
(Back when I did the same for cardbus_chipset_tag_t, it helped to turn
up some bugs!)
substitution: for all practical purposes, pcitag_t and cardbustag_t
are interchangeable, so just use pcitag_t. Ditto pcireg_t and
cardbusreg_t.
While I'm here, don't make a copy (sc_intrline) of
cardbus_attach_args.ca_intrline unless we use it, later.
slipped in about sixteen years ago. Fortunately, it had been working
for ages because some devices used address zero and other devices
ignored wrong higher bits.
Tested on we(4) (SMC Elite Ultra) and ne(4) (NE2000 compatible
named UL0001) on ISA.
Note FreeBSD also uses the same correct value in their ed(4) driver.
pmap_update() without calling pmap_enter().
(Probably calling only once after loop (as done in uvm_fault_lower_lookup())
is enough. If done so, other threads see entered neighbor pages as reflected
a little latter.)
the right USI/USIII version.
- define tlb_flush_pte() in terms of sp_tlb_flush_pte() for the
!MULTIPROCESSOR case
this centralises some CPU_IS_USIII_UP() tests.
numbers. Using ptoa() will cast to vaddr_t, which might no be adequate
for architectures where sizeof(paddr_t) > sizeof(vaddr_t) (like i386 PAE).
- small fix inside AGP heuristics to avoid masking high order bits for
systems with more than 4GB.
Reviewed by bouyer@.
See also http://mail-index.netbsd.org/tech-kern/2010/02/22/msg007373.html
here is not touching SError while BSY is asserted). Fix random
behavior (serial console corruption/misfunction, misbehavior of USB
controllers, crasy interrupts crashing the Xen hypervisor, ...)
of Intel ESB2 controller with some brand of hitachi drives.
Also change access to filesystem blocks to be done by fragment instead
of by physical block. Fragments are the fundamental blocks of the
filesystem.
For a theoretical filesystem that accesses the disk in smaller units
than stored in mp->mnt_fs_bshift, the assumption might be wrong. But
this will also break other subsystems. The value mp->mnt_dev_bshift
which formerly represents the physical sector size is currently only
virtual in NetBSD (always DEV_BSIZE).
new helper function.
Use this information to query physical sector sizes for WAPBL
instead of hardcoded defaults.
No longer limits physical sector sizes to 512 bytes.
than 0. This is still not the intent of PIE, but it allows them to
run with VA 0 disabled.
(The PAX_ASLR stuff which should deal with this needs work.)
CV: ----------------------------------------------------------------------
- remove patch_kernel() since it isn't necessary and has been patching
the wrong thing in general.
- implement USIII versions of blast_icache(), dcache_flush_page() and
cache_flush_phys(). use the newly recorded cache size/line sizes.
- in winfixsave, flush the D$ with the right size index and ops. this
kills one of the wrong tag->inval patches.
- for blast_dcache(), use the newly recorded dcache_size/line_size.
- for blast_icache(), use the newly recorded cache size/line sizes.
for the USIII verison, disable the I$ while writing to ASI_ICACHE_TAG.
these changes removed several hard coded cache sizes values, some very
wrong kernel patching, and seem to make the current failure modes for
USIII less common, but not gone.
same issue. Also add a BUS_DMASYNC_POSTWRITE to the POLL operation.
Problem pointed out by tsutsui@.
Still not perfect (a BUS_DMASYNC_PREREAD would be needed after the
testing the condition in the POLL() macro), but closer.
User's manual rev 1.3.
The values of ULCON_PARITY_SHIFT and ULCON_IR are now same to those
for S3C2410. So the definitions are moved to s3c2xx0reg.h. (Old
definitions from User's manual rev1.1 were differ to those for
S3C2410, and that was why I put them in s3c2800reg.h and s3c24x0reg.h.
There's no description in errata about this changes.)
Also, fix the value for UMSTAT_DCTS on 2800.
The values of UMCON_AFC and UMSTAT_DCTS still differ between 2800 and
2410.
Reported by Brett Slager. Thank you very much.
DTrace adds a pointer to the lwp and proc structures which it uses to
manage its state. These are opaque from the kernel perspective to keep
the kernel free of CDDL code. The state arenas are kmem_alloced and freed
as proccesses and threads are created and destoyed.
Also add a check for trap06 (privileged/illegal instruction) so that
DTrace can check for D scripts that may have triggered the trap so it
can clean up after them and resume normal operation.
Ok with core@.
out of the way before trying to get a unit number. If we cannot
get a unit number, we call config_devfree(), which expects for
fields such as dv_flags, dv_cfattach, and dv_private to be initialized.
It also changes product id after being configured. Without this
change the device just lingers in u3ginit forever. With this change:
u3ginit0 at uhub0 port 1: Switching to 3G mode
u3ginit0: detached
u3ginit0: at uhub0 port 1 (addr 2) disconnected
u3g0 at uhub0 port 1 configuration 1 interface 0
ucom0 at u3g0 portno 0: 3G Modem
u3g1 at uhub0 port 1 configuration 1 interface 1
ucom1 at u3g1 portno 1: 3G Modem
u3g2 at uhub0 port 1 configuration 1 interface 2
ucom2 at u3g2 portno 2: 3G Modem
u3g3 at uhub0 port 1 configuration 1 interface 3
ucom3 at u3g3 portno 3: 3G Modem
(tested with rump)
is exactly like the former, except it returns with ENXIO if sc is
NULL instead of continuing on to use it. Most of the time this is
handled by the fd layer and you get EBADF, but sometimes it's
possible to race into the device method for whatever reason and
you get a kernel panic. I have no idea what the "whatever reason"
might be.
and signal the root hub interrupt only once we are succesfully able
to open the device node. This makes it possible to insert a device
after the rump kernel was booted and have it succesfully attach
(does not make detach possible yet, though, as there are some
ugen and host kernel uhci/ohci/ehci evil crashies with that).
XXX: optimally, match would fail if there is a permanent error in
opening. However, it is difficult to figure out the difference
between the device backing ugen not being present, a transient
error in opening and a permanent error in opening. For example,
which of the latter two would EPERM be? And, ugen returns ENXIO
if the device is not present, but how would be know that's really
the case and not some other ENXIO from elsewhere in the stack?
This blocks an easy exploit of kernel bugs leading to dereference
of a NULL pointer on some architectures (eg i386).
The check can be disabled in various ways:
-by CPP definitions in machine/types.h (portmaster's choice)
-by a kernel config option USER_VA0_DISABLED_DEFAULT=0
-at runtime by sysctl vm.user_va0_disabled (cannot be cleared
at securelevel>0)
They will cause unnecessary non-equiv alias handling on PA1.x machines if
PA2.0 cpu support is compiled into the kernel. GENERIC currently doesn't
have this support enabled.
The performance hit of this needs testing.
- drop the notion of frags (LFS fragments) vs fsb (FFS fragments)
The code uses a complicated unity function that just makes the
code difficult to understand.
- support larger sector sizes. Fix disk address computations
to use DEV_BSIZE in the kernel as required by device drivers
and to use sector sizes in userland.
- Fix several locking bugs in lfs_bio.c and lfs_subr.c.
three registers. Let us think of the kernel operating the registers
in two steps:
1) Select: enable configuration cycles and select a range of
configuration-space addresses.
2) Access: read or write a word in PCI configuration space.
To make the steps more explicit, extract some helper subroutines
from pci_conf_read(9) and pci_conf_write(9):
pci_conf_selector(tag, reg): from a pcitag_t and a register offset,
create a word that enables configuration cycles and selects a
configuration address range.
pci_conf_select(w): for `w' a word created by pci_conf_selector(),
enable configuration cycles and select the address range indicated
by `w'.
pci_conf_select(0): disable configuration cycles.
pci_conf_port(tag, reg): map a pcitag_t and a register offset to an I/O
port where the configuration access should occur.
While I'm in here, change the panic(9) calls to panic("%s: ...",
__func__) instead of hard-coding a subroutine name.
- Apply the patch for 82575 from Wolfgang Stukenbrock (PR#42422). We use
only one RX ring and with the legacy mode.
- Add support for 82576.
- Partial support for 82580.
- Partial support for the serdes systems.
native i386 by using PDP_SIZE
- introduce pmap_unmap_apdp(), used to clear the APDP entries in PD, and
replace the relevant code parts with this function.
Comes from Jeremy Morse's patch for i386 PAE support. Adjustments by me.
that initializes pci_mode, which I have moved to the top.
Make pci_mode private to pci_machdep.c.
Provide pci_mode_set() for pcibios.c to configure the PCI Configuration
Mechanism. KASSERT() in pci_mode_set() that the mechanism is not
changing from anything but the "don't know" value, -1.
necessary. #define TLB_FLUSH_LOWVA to turn it back on.
- remove the #if 0'd code in sparc64_ipi_flush_pte_usiii(), i have
verified that it is not required.
- add a missing membar #Sync to sp_tlb_flush_pte_usiii().
use it to patch up TLB flush instructions that don't match for USI/II
and later. we can also hopefully use this to make GENERIC.MP minimally
expensive on single CPU machines as well.
this is the last piece needed to get GENERIC/GENERIC.MP to boot on the
USIII* machines.
idea and some initial code from openbsd.
per PR port-i386/42787 (the panic happens due to a GPF when a
privileged descriptor is tried to be loaded with the UPL bit set)
The original bug is very old (pre-2.0, i386/svr4_machdep.c rev. 1.69),
but it was relatively harmless until the order of GDT entries was
shuffled (pre-5.0, i386/segments.h rev. 1.42). Before, it caused
a userlevel data selector to be used for CS which broke the emulation
(likely the reason of PR port-i386/32424). The shuffle made that
a privileged selector was used, causing the GPF.
(recent -current doesn't panic on that GPF which seems to be a
side effect of another change)
1) Add support for multiple filesystems including ffsv1, ffsv2, lfsv1 and lfsv2.
(ffsv1 and lfsv2 are known to work. ffv2 support needs more work. lfsv1 is
probably untested.)
2) Only 32-bit Fcodes are used. All 64-bit math uses two cells. This means it
should work on 32-bit machines.
Additional work to consider:
1) Rename genfth.cf to genffs.cf, or keep it and move the ffs symbols to genffs.cf
2) Move the ffs code and the lfs code to different source files so you can
selectively fload the just the filesystems you want.
3) Add code to load ELF files directly instead of relying on the host firmware
ELF support. But, since the binary is now 7250 bytes there may not be room.