Commit Graph

8265 Commits

Author SHA1 Message Date
jym
bba2c41d59 Add Intel SpeedStep and AMD PowerNow! support in Xen dom0. MSR operations
are now compiled in by default.

Note that MSR support in Xen depends on its version. rdmsr() should always
succeed, but wrmsr() to certain registers can end in a NOOP. In that case,
the error will be logged (see xm dmesg).

Setting CPU frequency (SpeedStep) requires Xen 3.3 with the option
cpufreq="dom0-kernel" passed down to hypervisor during boot.

Compiled and tested for SpeedStep under i386 for XEN3_DOM0 and XEN3PAE_DOM0
by jym@. amd64 was tested by Joel Carnat.

See also http://mail-index.netbsd.org/port-xen/2009/08/02/msg005213.html .

Commit requested by bouyer@.
2009-08-05 20:15:36 +00:00
dsl
42c6f77e6e Add #if NPCI > 1 around call to mp_pci_childdetached()
Fixes rst of PR/41301
2009-08-04 06:55:26 +00:00
rmind
cbc808fd9c Reduce the difference between i386 and amd64 trap handler.
No functional changes intended.
2009-07-29 18:47:15 +00:00
rmind
52b85c5fb7 Fix KASSERT(1); 2009-07-29 17:16:56 +00:00
cegger
82843fbf43 nuke unused XEN3 option. The XEN option is sufficient now. 2009-07-29 13:37:57 +00:00
cegger
3518084fc6 remove Xen2 support.
ok bouyer@
2009-07-29 12:02:05 +00:00
mbalmer
071fb1f425 Fix (commented out) gpioow usage. 2009-07-29 11:58:31 +00:00
mbalmer
8bd20bf764 Add commented out entries for gpiosim and gpio at gpiosim. 2009-07-29 11:55:40 +00:00
mbalmer
3c801a163f Add pseudo-device gpiosim, fix gpioow usage. 2009-07-29 11:52:44 +00:00
kiyohara
ce1343fcd9 Support Marvell Hercules-I/II SATA Controllers. 2009-07-27 12:34:12 +00:00
cegger
880da38cf8 add GPIO_DEBUG 2009-07-25 19:04:41 +00:00
kiyohara
1f46950ef0 Support siisata@cardbus.
It tested on amd64 and i386 only.
2009-07-19 06:28:08 +00:00
rmind
7512d1e720 Make POSIX message queues a kernel module. 2009-07-19 02:50:44 +00:00
reinoud
69a586f230 Import read-only part of the NiLFS (v2) implementation for NetBSD. It has been
tested with a DEBUG+DIAGNOSTIC+LOCKDEBUG kernel. To summerise NiLFS, i'll
repeat my posting to tech-kern here:

NiLFS stands for New implementation of Logging File System; LFS done
right they claim :) It is at version 2 now and is being developed by NTT, the
Japanese telecom company and recently put into the linux source tree. See
http://www.nilfs.org. The on-disc format is not completely frozen and i expect
at least one minor revision to come in time.

The benefits of NiLFS are build-in fine-grained checkpointing, persistent
snapshots, multiple mounts and very large file and media support. Every
checkpoint can be transformed into a snapshot and v.v. It is said to perform
very well on flash media since it is not overwriting pieces apart from a
incidental update of the superblock, but that might change. It is accompanied
by a cleaner to clean up the segments and recover lost space.

My work is not a port of the linux code; its a new implementation. Porting the
code would be more work since its very linux oriented and never written to be
ported outside linux. The goal is to be fully interchangable. The code is non
intrusive to other parts of the kernel. It is also very light-weight.

The current state of the code is read-only access to both clean and dirty
NiLFS partitions. On mounting a dirty partition it rolls forward the log to
the last checkpoint. Full read-write support is however planned!

Just as the linux code, mount_nilfs allows for the `head' to be mounted
read/write and allows multiple read-only snapshots/checkpoint mounts next to
it.

By allowing the RW mount at a different snapshot for read-write it should be
possible eventually to revert back to a previous state; i.e. try to upgrade a
system and being able to revert to the exact state prior to the upgrade.

Compared to other FS's its pretty light-weight, suitable for embedded use and
on flash media. The read-only code is currently 17kb object code on
NetBSD/i386. I doubt the read-write code will surpass the 50 or 60. Compared
this to FFS being 156kb, UDF being 84 kb and NFS being 130kb. Run-time memory
usage is most likely not very different from other uses though maybe a bit
higher than FFS.
2009-07-18 16:31:41 +00:00
rmind
3cee4be877 - Fix rare crashe in the intr_lapic_tlb_bcast() handler: save and setup
%fs on i386, %gs on amd64 registers, before using them.  Otherwise, it
  might be invalid/garbage, eg. IPI can interrupt userspace.

- Explicitly initialize per-CPU emap generation number.

Thanks <drochner> for reporting and testing of patch.
2009-07-09 21:43:16 +00:00
mbalmer
38e0566d82 Have the boot countdown on i386 display "starting in N seconds." instead
of "starting in N" and eliminate a use of sprintf.  Note that on
some rare machines it can be that the BIOS does not provide the delay
function.  On such machines the countdown will almost immediately count down
to zero display "starting in 0 seconds."; apparently the net4801 is such a
machine.
Feedback, ideas, and inspiration from tron, ok tron/tonnerre
2009-06-29 09:23:16 +00:00
rmind
5c68e5d0ee Ephemeral mapping (emap) implementation. Concept is based on the idea that
activity of other threads will perform the TLB flush for the processes using
emap as a side effect.  To track that, global and per-CPU generation numbers
are used.  This idea was suggested by Andrew Doran; various improvements to
it by me.  Notes:

- For now, zero-copy on pipe is not yet enabled.
- TCP socket code would likely need more work.
- Additional UVM loaning improvements are needed.

Proposed on <tech-kern>, silence there.
Quickly reviewed by <ad>.
2009-06-28 15:18:50 +00:00
ad
6cdc8b7df8 Define __HAVE_ATOMIC64_OPS only in kernel, since it doesn't work in
userspace on the i486.
2009-06-28 09:24:09 +00:00
dyoung
aeb6a78d82 During a normal shutdown, gracefully tear down arbitrary stacks of
filesystems and (pseudo-)devices, according to the algorithm at A3
and A4, below.

Proposed and discussed at
<http://mail-index.netbsd.org/tech-kern/2009/04/20/msg004864.html>.  No
objections.

During an emergency shutdown (e.g., shutdown -n, or after a panic),
shutdown is simple as always: filesystems are not sync'd or unmounted,
and devices are not detached.

It was necessary to change the order of operations during shutdown,
but the new order is more sensible: if a core dump is desired, then
cpu_reboot(9) dumps it first.  cpu_reboot(9) does not call legacy
shutdown hooks any longer: they can interfere with device detachment
and PMF shutdown, and very few legacy hooks remain.

Here is the old order of operations:

B1 sync filesystems and TOD clock
B2 unmount filesystems
B3 dump core
B4 detach devices
B5 run legacy shutdown hooks
B6 run PMF shutdown hooks
B7 suspend interrupts
B8 MD reboot/shutdown/powerdown

And here is the new order:

A1 dump core
A2 sync filesystems and TOD clock
A3 unmount one or more filesystems OR
   detach one or more devices OR
   forcefully unmount one filesystem OR
   skip to 5
A4 repeat at 3
A5 run PMF shutdown hooks
A6 suspend interrupts
A7 MD reboot/shutdown/powerdown

Tested on Dell Dimension 3000, Dell PowerEdge 1950, Sun Fire V120,
Soekris net4521 and net4801.

VS: ----------------------------------------------------------------------
2009-06-26 23:40:27 +00:00
dyoung
6935f27815 Add drvctl(4). 2009-06-23 17:06:15 +00:00
christos
e7604a3d54 PR/41629: Kouji Matsui: Fixed identical ESS1878 on Fujitsu FMV-5100 NC/S by PnPBIOS 2009-06-23 15:00:18 +00:00
cegger
5fbf0e67ec use M_ZERO, no need for memset.
Ansify kvm86_init function definition.
2009-06-20 08:31:37 +00:00
bouyer
3ac2dfe9bf Split mc146818-related functions from clock.c into rtc.c.
Call rtc_set_ymdhms() from xen/xen/clock.c:xen_rtc_set() for xen3 dom0
kernels as the Xen3 hypervisor doesn't write the new date/time to the CMOS
by itself.
Now a XEN3_DOM0 kernel properly updates the CMOS time.
2009-06-16 21:05:33 +00:00
tsutsui
9c2e10416b Apply fixes from jmcneill@ for PR port-i386/38729
(ACPI kernel booted under qemu cannot detect devices):
- make MP SCANPCI function for ACPI_SCANPCI and MPBIOS_SCANPCI
  return a number of attached PCI busses
- if no valid PCI busses are attached in the MP SCANPCI function,
  try to probe and attach pci0 at mainbus as well as kernels
  with no SCANPCI options

"Feel free to check it in" from jmcneill@.
Tested in pkgsrc qemu-0.9.1 (both i386 and x86_64) on NetBSD/i386.

Note original jmcneill's patch was posted on March:
http://mail-index.NetBSD.org/port-i386/2009/03/24/msg001281.html
and I also applied it to amd64:
http://mail-index.NetBSD.org/port-i386/2009/03/24/msg001283.html
but x86 MP attach functions have been reorganized by dyoung@ on April:
http://mail-index.NetBSD.org/source-changes/2009/04/17/msg219992.html
so I've modified the original patches to adapt the changes.
(mpacpi_scan_pci() and mpbios_scan_pci() have been merged into
 common mp_pci_scan() in new arch/x86/x86/mp.c)
For netbsd-5 and netbsd-5-0 branches, the original patches should be
applied cleanly, and they have been tested by abs@ on a selection of
i386 boxes and in qemu.
2009-06-13 13:35:11 +00:00
skrll
e03976623a Add TLS relocation definitions. 2009-05-30 05:56:52 +00:00
dyoung
ec6c5ec835 For the 'tags' target, use the right path to the Atheros HAL sources. 2009-05-28 18:13:46 +00:00
bouyer
cc56ebe228 on Xen the GDT has to be updated though HYPERVISOR_update_descriptor().
Export i386/i386/gdt.c:update_descriptor() and use it in x86_set_sdbase(),
as a direct write to the GDT will cause a kernel trap.
Fix PR port-xen/41401.
2009-05-17 18:24:23 +00:00
cegger
53537c2dae KNF, same object code generated. 2009-05-16 16:52:03 +00:00
elad
d009a1bb6c Add IPKDB options, but commented out as it doesn't build at the moment. 2009-05-10 15:26:23 +00:00
pgoyette
b3c79debe6 Initial implementation of sdtemp(4) driver for on-DIMM temp sensor.
(These optional sensors are specified by JEDEC Standard No. 21-C
Section 4-7 and implemented by multiple vendors.  Tested on my
amd64 machine with Kingston KVR1066D3E7S/2G memory which includes
a STMicro STTS424E02 sensor.)
2009-05-09 15:04:25 +00:00
cegger
6a970ea21d device_t/softc split 2009-05-05 09:51:23 +00:00
cegger
463905bb9c struct cfdata * -> cfdata_t 2009-05-04 12:38:51 +00:00
cegger
1a57d635a0 struct device * -> device_t
No functional changes intended.
2009-05-04 12:19:29 +00:00
cegger
ad6eeaade5 struct device * -> device_t, use device_private()
No functional changes intended.
2009-05-04 12:15:51 +00:00
cegger
a4a2ef3bd3 struct device * -> device_t
No functional changes intended.
2009-05-04 12:14:31 +00:00
cegger
46919b98ad struct device * -> device_t, use device_private 2009-05-04 12:13:19 +00:00
ad
557443fab0 PR kern/41342: BSDi binaries cause panic
XXX Manuel, please have a look as I am not sure what to do for XEN here!
2009-05-04 11:47:29 +00:00
cegger
85834d03a8 add ale(4) 2009-05-01 06:25:50 +00:00
dyoung
82e9f91ec4 Add elansc_shutdown() for turning off the watchdog.
Don't try to unregister the watchdog in elansc_detach() if we are
shutting the system down, because unregistering is designed to fail if
the watchdog is armed.
2009-04-29 23:50:53 +00:00
dyoung
458342a90c Delete dead code. 2009-04-29 23:18:09 +00:00
ad
c28dc6f757 A workaround for a bug with some Opteron revisions where locked operations
sometimes do not serve as memory barriers, allowing memory references to
bleed outside of critical sections.  It's possible that this is the
reason for pkgbuild's longstanding crashiness.

This is not complete (atomic ops need some work too).
2009-04-24 17:45:40 +00:00
nonaka
e4decce5b3 Add SD/MMC related devices. 2009-04-21 22:47:55 +00:00
elad
78fa90b2d3 Remove extra ')'. 2009-04-21 14:51:49 +00:00
nonaka
e0297d1ead Added SD/MMC support from OpenBSD.
tested on i386, amd64 at current-users ML by pgoyette@.
tested on zaurus by myself.
2009-04-21 03:00:29 +00:00
cegger
327f4a8c43 add ale(4) 2009-04-20 20:49:21 +00:00
ad
4d8f47ae2f cpuctl:
- Add interrupt shielding (direct hardware interrupts away from the
  specified CPUs). Not documented just yet but will be soon.

- Redo /dev/cpu time_t compat so no kernel changes are needed.

x86:

- Make intr_establish, intr_disestablish safe to use when !cold.

- Distribute hardware interrupts among the CPUs, instead of directing
  everything to the boot CPU.

- Add MD code for interrupt sheilding. This works in most cases but there is
  a bug where delivery is not accepted by an LAPIC after redistribution. It
  also needs re-balancing to make things fair after interrupts are turned
  back on for a CPU.
2009-04-19 14:11:36 +00:00
dyoung
c94ffba5d6 Introduce sys/arch/x86/x86/mp.c for common x86 MP configuration code.
mpacpi_scan_pci() and mpbios_scan_pci() are identical code, so replace
them with mp_pci_scan().

Introduce mp_pci_childdetached(), which helps us to detach root PCI
buses that were enumerated either by MP BIOS or by ACPI.

Let us detach and re-attach PCI buses from mainbus0 on i386.  This is
necessarily a work-in-progress, because testing detach and re-attach
is very difficult: to detach and re-attach the entire PCI tree on most
x86 computers that I own is not possible because some essential device
attaches under the PCI subtree: the console, com0, NIC, or storage
controller always attaches in the PCI tree.
2009-04-17 21:07:58 +00:00
rmind
3de18e79b4 - Add macros to handle (some) trapframe registers for common x86 code.
- Merge i386 and amd64 syscall.c into x86.  No functional changes intended.

Proposed on (port-i386 & port-amd64).  Unfortunately, I cannot merge these
lists into the single port-x86. :(
2009-04-16 15:34:23 +00:00
elad
2d1c968399 Remove a few KAUTH_GENERIC_ISSUSER in favor of more descriptive
alternatives.

Discussed on tech-kern:

	http://mail-index.netbsd.org/tech-kern/2009/04/11/msg004798.html

Input from ad@, christos@, dyoung@, tsutsui@.

Okay ad@.
2009-04-15 20:44:24 +00:00
cegger
cb572d026d No Execute bit is available in PAE-paging mode.
However to use it, NXE bit in EFER register must be set.
2009-04-15 13:05:47 +00:00