than 32k.
A bootconf file is normally only a few hundred bytes long. If it is
much bigger than expected, we can't load it into an 8086 real mode
segment anyway.
Much more to the point, in the pxeboot case, someone may have
configured their dhcpd to return the filename for the kernel, not
realizing that the filename is now for boot.cfg which didn't used to
be the case. If we try to load the kernel here, thinking it is
boot.cfg by accident, the boot loader will die ignominiously and
without much of an error message, so we don't want to do that.
This needs to be pulled up to 5.0 if 5.0 has all this machinery
-- I'm not sure whether it does.
elansc_attach().
Let us detach gpio0 at elansc0.
Let us re-attach pci0 at elansc0.
Reduce code duplication between elansc_rescan() and elansc_attach():
call _rescan() from _attach() to attach elanpex0, elanpar0, gpio0, and
pci0.
Thomas Klausner.
Do not compile in the local variable "mba" in mainbus_rescan unless
NPNPBIOS > 0 || NACPI > 0 || NIPMI > 0 || NMCA > 0. This fixes the
build on systems such as Soekris where none of those options apply.
Extract code from mainbus_attach() to create a rescan hook,
mainbus_rescan(). Call mainbus_rescan(, "acpibus"/"ipmibus"/..., ) from
mainbus_attach() in the precise places where we used to attach acpi0,
ipmi0, pnpbios0, and mca0. This allows, for example, ipmi0 to detach
and re-attach:
# drvctl -d ipmi0
ipmi0: detached
# drvctl -r -a ipmibus mainbus0
ipmi0 at mainbus0
#
Future work will let us detach & re-attach CPUs and the ISA/PCI/EISA
buses at mainbus0.
Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.
Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks. For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.
Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown. Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags. Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).
Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.
Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag. The default for kern.detachall is 0. SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.
This is a work in progress. In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.
Also commit some changes that are not easily untangled from the rest:
(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.
(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs. Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.
The broken probe was causing the VIA padlock driver to never attach!
Now we can see that its AES appears to be broken -- it makes FAST_IPSEC
ESP not work, on systems where it works fine with cryptosoft.
Rework code to detect and (if necessary) enable VIA crypto and RNG.
Add RNG support to VIA padlock driver. In the process, have a quick
go at debugging the AES support but no luck thus far.
This will be used to support TLS. The MD method must match the ELF TLS spec
for that CPU architecture (if there is a spec).
At this time it is only implemented for i386, where it means setting the
per-thread base address for %gs. Please implement this for your platform!
in XEN2 and XEN3 kernels.
Xen really requires cgd, and as users are likely to get a domain given
to them without the possibility of recompiling a kernel for
themselves, we need to provide this by default.
As discussed with bouyer@, and with his OK.
Fix numerous problems:
1. LDT updates are not atomic.
2. Number of processes running with private LDTs and/or I/O bitmaps
is not capped. System with high maxprocs can be paniced.
3. LDTR can be leaked over context switch.
4. GDT slot allocations can race, giving the same LDT slot to two procs.
5. Incomplete interrupt/trap frames can be stacked.
6. In some rare cases segment faults are not handled correctly.
registers. if we faulted trying to set them, just fall into
"we_re_toast", and arrange for a SEGV to be delivered to the
userland process. fixes kernel mode faults.
from andrew doran.
that Juergen Hannken-Illjes reports:
sys/arch/i386/conf/MONOLITHIC:16: already have options `COMPAT_NOMID'
sys/arch/i386/conf/MONOLITHIC:17: already have options `COMPAT_09'
...
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
- x86_round_page, x86_trunc_page, x86_btop and x86_ptob macros are used with
physical addresses; cast to paddr_t instead of u_long. Issue pointed out
by jym@
- machine_to_phys_mapping[] is a long. This is fine as it holds page
frame numbers (and this fits in a 32bit int as physical addresses are
only 36bits), but cast to paddr_t before << PAGE_SHIFT
- xen_start_info.store_mfn is a long; cast it to paddr_t before << PAGE_SHIFT.
should fix issue pointed out by cegger@
types of changes:
- Add a few new methods to replace stuff like p_find(), CPU_INFO_FOREACH.
- Use db_read_bytes() instead of accessing kernel structures directly,
and similar changes.
- Add ifdef _KERNEL where the above hasn't been done, and an XXX comment.
Merge change from amd64 machdep.c revision 1.42:
in cpu_reboot(), only halt the other CPUs after we've done the powerdown stuff.
the ACPI code may end up removing some pmap entries, which wants the other
CPUs to still be running to handle TLB invalidations.
PR# kern/37506: Have to hold power button for 5 seconds to turn off Laptop
after "halt" command.
Transfer the system from ACPI to Legacy mode if RB_HALT is set.
Also do the missed rename of multiboot_ksyms_init to
multiboot_ksyms_addsyms_elf to compile with MULTIBOOT set.
This caused a minor and a more serious bug in the past:
- dmesg did not contain the information about the loader
- /dev/ksyms did not work when the kernel was booted with a
multiboot bootloader (grub for example)
Ok by jmcneill, joerg.
and amd64 where VESA VBE 2.0+ is available.
* Add helper library and stubs to invoke VBE bioscalls.
* Bump HEAP_START as we were already dangerously close to our limits.
* bootdataseg now allows access > 16MB so in the future we can scribble
on the framebuffer.
* Pass BTINFO_FRAMEBUFFER parameters to kernel when configured.
* VBE modes are configured with the new 'vesa' command. Usage, when present:
* vesa {enabled|disabled}
Enable / disable linear framebuffer, default mode is 640x480x8. May
be changed in the future to determine mode based on VBE/DDC where
available.
* vesa list
List modes supported by the firmware that meet the following criteria:
* linear framebuffer
* packed pixel or direct colour mode
* vesa {modenum|modestr}
Enable specific VBE mode. The mode can be specified either as a
VBE mode number (eg. 0x101) or as a string (eg. 800x600x16).
option MODULAR to using %MODULAR%. While it is now possible to only
request the new version in the affected Makefiles, it is made mandatory for
everybody because I just fixed a bug in config(1) that would not make it
fail in the case of a syntax error in the Makefile template.
generated by config(1) in the kernel compile directory no longer
contains IDENT=-DMODULAR. Instead, there's an opt_modular.h file that
might or might not contain "#define MODULAR 1".
Adapt to this by adding an OPT_MODULAR variable to relevant Makefiles,
set via an awk script that parses opt_modular.h.
call x86_bus_space_init() and x86_bus_space_mallocok() if we have ISA or PCI
devices configured; not only for non-Xen or dom0 Xen
On Xen, always call PHYSDEVOP_SET_IOPL on context switch
on amd64, also call PHYSDEVOP_SET_IOPL from x86_64_proc0_tss_ldt_init()
- renamed to MEMORY_DISK_RBFLAGS to better fit the rest of the
MEMORY_DISK options(4)
- change default value to RB_AUTOBOOT instead of RB_SINGLE, and adapt
the config(5) files accordingly
- document this option inside options(4)
See also http://mail-index.netbsd.org/tech-kern/2008/12/25/msg003924.html
Reviewed by abs@ in private mail.