dragonfly.git
14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 26 Jun 2009 23:19:38 +0000 (16:19 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoAHCI/SILI - Remove unused ScsiTypeArray array
Matthew Dillon [Fri, 26 Jun 2009 23:19:14 +0000 (16:19 -0700)]
AHCI/SILI - Remove unused ScsiTypeArray array

14 years agoSILI - Increase hard -> soft PM target delay to 5 seconds
Matthew Dillon [Fri, 26 Jun 2009 23:16:58 +0000 (16:16 -0700)]
SILI - Increase hard -> soft PM target delay to 5 seconds

* Unfortunately it looks like we have to seriously increase the delay
  between doing a hard reset via the PM to a target and initiating
  the softreset.

  The Silicon Image chip appears to brick the port if its softreset
  collides with the target device.  There is no way to fix it other
  then hard-resetting the port (which causes the PM to reset as well).

14 years agoSILI - Fix assertion panic during error handling.
Matthew Dillon [Fri, 26 Jun 2009 22:31:55 +0000 (15:31 -0700)]
SILI - Fix assertion panic during error handling.

* The error handling code could not distinguish between the use of the
  error ccb as part of a softreset sequence and the use of the error
  ccb as part of a error recovery sequence and asserted in the former
  case.

* Ensure that no commands are active on the port prior to initiating
  a hard reset through the port multiplier.

14 years agoAdd Colemak keyboard layout.
Sascha Wildner [Fri, 26 Jun 2009 21:58:25 +0000 (23:58 +0200)]
Add Colemak keyboard layout.

Submitted-by: Geert Hendrickx <ghen@telenet.be>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1409>

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 26 Jun 2009 16:48:11 +0000 (09:48 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoSILI - Add the SILI driver to the general module build
Matthew Dillon [Fri, 26 Jun 2009 16:47:56 +0000 (09:47 -0700)]
SILI - Add the SILI driver to the general module build

14 years agoSILI - Add serial number support, strip whitespace.
Matthew Dillon [Fri, 26 Jun 2009 16:47:25 +0000 (09:47 -0700)]
SILI - Add serial number support, strip whitespace.

* Add page inquiry emulation for DISK devices so CAM can probe the
  serial number.

* Strip whitespace when reporting the mode, firmware, and serial number
  from the inquiry data.

14 years agoAHCI - Add serial number support, strip whitespace.
Matthew Dillon [Fri, 26 Jun 2009 16:45:54 +0000 (09:45 -0700)]
AHCI - Add serial number support, strip whitespace.

* Add page inquiry emulation for DISK devices so CAM can probe the
  serial number.

* Strip whitespace when reporting the mode, firmware, and serial number
  from the inquiry data.

14 years agoCAM - Unconditionally print out the serial number
Matthew Dillon [Fri, 26 Jun 2009 16:26:33 +0000 (09:26 -0700)]
CAM - Unconditionally print out the serial number

Do not conditionalize the printing of the serial number on bootverbose any
more.  The serial number is fast becoming an important piece of information.

14 years agoutf2.5: Terminate quotation.
Sascha Wildner [Fri, 26 Jun 2009 06:46:01 +0000 (08:46 +0200)]
utf2.5: Terminate quotation.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 26 Jun 2009 03:56:52 +0000 (20:56 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoSILI - Cleanup, remove broken KKASSERT and remove DIAGNOSTICs
Matthew Dillon [Fri, 26 Jun 2009 03:55:50 +0000 (20:55 -0700)]
SILI - Cleanup, remove broken KKASSERT and remove DIAGNOSTICs

Reported-by: Sascha Wildner <swildner@crater.dragonflybsd.org>
14 years agoAHCI - Reduce console spew
Matthew Dillon [Fri, 26 Jun 2009 03:55:07 +0000 (20:55 -0700)]
AHCI - Reduce console spew

14 years agonrelease - img file - use boot0cfg to set packet mode
Matthew Dillon [Fri, 26 Jun 2009 03:53:50 +0000 (20:53 -0700)]
nrelease - img file - use boot0cfg to set packet mode

* Use packet mode by default in the usb key image file's boot blocks.

14 years agoProperly terminate some quotations in several manual pages.
Sascha Wildner [Fri, 26 Jun 2009 01:18:18 +0000 (03:18 +0200)]
Properly terminate some quotations in several manual pages.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Fri, 26 Jun 2009 01:05:53 +0000 (18:05 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agonrelease - img build - A usb stick will now probe starting at da8
Matthew Dillon [Fri, 26 Jun 2009 01:05:30 +0000 (18:05 -0700)]
nrelease - img build - A usb stick will now probe starting at da8

14 years agorc.conf.5: Document 'fixbootfile'.
Sascha Wildner [Thu, 25 Jun 2009 23:36:47 +0000 (01:36 +0200)]
rc.conf.5: Document 'fixbootfile'.

14 years agolastcomm(1): Sync with FreeBSD's RELENG_6.
Sascha Wildner [Sun, 14 Jun 2009 22:40:51 +0000 (00:40 +0200)]
lastcomm(1): Sync with FreeBSD's RELENG_6.

14 years agosubr_diskmbr.c: Fix some warning fixes.
Sascha Wildner [Thu, 25 Jun 2009 22:27:32 +0000 (00:27 +0200)]
subr_diskmbr.c: Fix some warning fixes.

* No need to cast dp_size at all, just fix the format.

* Add cast for size.

14 years agoAdjust hammer.sh for the new "fixbootfile" rc script.
Sascha Wildner [Thu, 25 Jun 2009 16:00:35 +0000 (18:00 +0200)]
Adjust hammer.sh for the new "fixbootfile" rc script.

Now that this cares about fixing kern.bootfile, there's no need to
mess in the user's /etc from outside.

14 years agoWe shouldn't need to drop and reaquire the lock here.
Hasso Tepper [Thu, 25 Jun 2009 21:04:23 +0000 (00:04 +0300)]
We shouldn't need to drop and reaquire the lock here.

Obtained-from: FreeBSD

14 years agoSome more cleanups for vblank code on Intel.
Hasso Tepper [Thu, 25 Jun 2009 21:00:18 +0000 (00:00 +0300)]
Some more cleanups for vblank code on Intel.

The Intel 2d driver calls modeset before reinstalling the handler on
a vt switch.  This means that vblank status ends up getting cleared
after it has been setup.  Restore saved values for the pipestat registers
rather than just wiping them out.

Obtained-from: FreeBSD

14 years agoInitialize max_vblank_count earlier.
Hasso Tepper [Thu, 25 Jun 2009 18:44:41 +0000 (21:44 +0300)]
Initialize max_vblank_count earlier.

Small cleanup of the error paths while I'm here.

Obtained-from: FreeBSD

14 years agoKeep track of the hardware counter more aggressively
Hasso Tepper [Thu, 25 Jun 2009 18:37:52 +0000 (21:37 +0300)]
Keep track of the hardware counter more aggressively

... while interrupts are enabled.  This should help to reduce cases
where the hardware counter reference jumps by large amounts.

Obtained-from: FreeBSD

14 years agoFix one use of atomic for refcount missed in last commit.
Hasso Tepper [Thu, 25 Jun 2009 18:34:58 +0000 (21:34 +0300)]
Fix one use of atomic for refcount missed in last commit.

Obtained-from: FreeBSD

14 years agoAdditional vblank cleanups.
Hasso Tepper [Thu, 25 Jun 2009 18:28:47 +0000 (21:28 +0300)]
Additional vblank cleanups.

Use the vbl_lock when manipulating the refcount.  Eventually I want to
convert this to use our internal refcount code.  Continue to use atomic
ops for manipulating vblank count since we access it often just for
reading.

Obtained-from: FreeBSD

14 years agoEnsure that we always hold the lock when executing vblank_disable_fn().
Hasso Tepper [Thu, 25 Jun 2009 18:21:43 +0000 (21:21 +0300)]
Ensure that we always hold the lock when executing vblank_disable_fn().

The original code in FreeBSD uses callout_init_mtx() we don't have,
therefore we lock/unlock in vblank_disable_fn itself.

14 years agopriv: Reduce some uses of PRISON_ROOT
Michael Neumann [Thu, 25 Jun 2009 20:24:25 +0000 (22:24 +0200)]
priv: Reduce some uses of PRISON_ROOT

Move decision whether the privilege is allowed or not into function
prison_priv_check().

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 25 Jun 2009 19:52:30 +0000 (12:52 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoHAMMER VFS - Take reserved space into account when reporting statvfs data
Matthew Dillon [Thu, 25 Jun 2009 19:50:50 +0000 (12:50 -0700)]
HAMMER VFS - Take reserved space into account when reporting statvfs data

Adjust statvfs data so reserved space is taken into account, so the
filesystem starts failing modifying operations closer to when 'df' would
otherwise say that 0 free space remains.

Submitted-by: Antonio Huete Jimenez <tuxillo@quantumachine.net> (with modification)
14 years agoHAMMER UTILS - Add to the newfs_hammer documentation.
Matthew Dillon [Thu, 25 Jun 2009 19:50:02 +0000 (12:50 -0700)]
HAMMER UTILS - Add to the newfs_hammer documentation.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Michael Neumann [Thu, 25 Jun 2009 19:36:33 +0000 (21:36 +0200)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoCAM - Auto unit number start based on device
Matthew Dillon [Thu, 25 Jun 2009 19:35:14 +0000 (12:35 -0700)]
CAM - Auto unit number start based on device

If no SCSI devices are wired CAM now automatically starts any umass sim
attachments at unit #8 instead of unit #0.  This reduces interference
between usb mass storage attachments and ahci/sili attachments.  Otherwise
the usb mass storage can steal "da0" away from ahci/sili.

14 years agopriv: Introduce prison_priv_check()
Michael Neumann [Thu, 25 Jun 2009 19:29:52 +0000 (21:29 +0200)]
priv: Introduce prison_priv_check()

One day the PRISON_ROOT flag, which when passed to priv_check_cred()
allows the privilege in a jail, will be gone and all privileges allowed
in a jail are centrally maintained in the prison_priv_check() function
instead of spreading it over all the calls.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Thu, 25 Jun 2009 18:59:03 +0000 (11:59 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoCAM/UMASS - use xpt_action_async() to ensure asynchronous scsi bus scan.
Matthew Dillon [Thu, 25 Jun 2009 18:57:14 +0000 (11:57 -0700)]
CAM/UMASS - use xpt_action_async() to ensure asynchronous scsi bus scan.

Use the new xpt_action_async() function to ensure that the scsi bus is
rescanned asynchronously.  XPT_SCAN_BUS already sets XPT_FC_QUEUED but
it doesn't apply to command initiation.  The new function does it properly.

14 years agonice(3): Return new nice value.
Stathis Kamperis [Wed, 24 Jun 2009 18:41:44 +0000 (21:41 +0300)]
nice(3): Return new nice value.

The nice(1) utility isn't affected by this change,
since it uses {get,set}priority() directly.

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1408>

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Michael Neumann [Thu, 25 Jun 2009 14:22:25 +0000 (16:22 +0200)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agorcng - add fixbootfile to Makefile for install
Matthew Dillon [Thu, 25 Jun 2009 14:13:08 +0000 (07:13 -0700)]
rcng - add fixbootfile to Makefile for install

14 years agopriv: Refactor kern_mknod and narrow privileges
Michael Neumann [Thu, 25 Jun 2009 13:42:09 +0000 (15:42 +0200)]
priv: Refactor kern_mknod and narrow privileges

14 years agopriv: Narrow privileges
Michael Neumann [Thu, 25 Jun 2009 13:15:30 +0000 (15:15 +0200)]
priv: Narrow privileges

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Michael Neumann [Thu, 25 Jun 2009 12:42:01 +0000 (14:42 +0200)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agorcng - add rcng script to fixup kern.bootfile
Matthew Dillon [Thu, 25 Jun 2009 06:09:49 +0000 (23:09 -0700)]
rcng - add rcng script to fixup kern.bootfile

In BOOT+ROOT setups the boot loader does not realize that the boot partition
will be mounted as /boot under the root partition.  This RCNG script fixes
up the kern.bootfile sysctl.

14 years agolibstand - remove iaddr_t, do not assume long double is a power of 2, clean up
Matthew Dillon [Thu, 25 Jun 2009 00:14:45 +0000 (17:14 -0700)]
libstand - remove iaddr_t, do not assume long double is a power of 2, clean up

* Remove iaddr_t.  Use uintptr_t instead.

* Remove use of long double to determine alignment.  Use a fixed 16 byte
  alignment instead.

* General cleanup

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 24 Jun 2009 23:46:26 +0000 (16:46 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoAMD64 - Support -m32 by conditionalizing 32 and 64 bit typedefs.
Matthew Dillon [Wed, 24 Jun 2009 23:43:30 +0000 (16:43 -0700)]
AMD64 - Support -m32 by conditionalizing 32 and 64 bit typedefs.

Conditionalize the typedefs in amd64-specific headers to support -m32
compilation.  This fixes the compilation of the boot loader from the
amd64 build.

14 years agoAdd some sysctl info so that we can see what is going on with vblanks.
Hasso Tepper [Tue, 23 Jun 2009 22:12:05 +0000 (01:12 +0300)]
Add some sysctl info so that we can see what is going on with vblanks.

Obtained-from: FreeBSD

14 years agoOnly release irq resources if we were actually using them.
Hasso Tepper [Tue, 23 Jun 2009 22:11:01 +0000 (01:11 +0300)]
Only release irq resources if we were actually using them.

Obtained-from: FreeBSD

14 years agoRemove signals for vblank events code.
Hasso Tepper [Tue, 23 Jun 2009 22:05:47 +0000 (01:05 +0300)]
Remove signals for vblank events code.

Using signals for vblank events is prone to issues.  There have never
been any consumers and likely will never be.  Furthermore, we have
never enabled the code for it, so just get rid of it.

Obtained-from: FreeBSD

14 years agoMore meaningful timeout for sleep.
Hasso Tepper [Tue, 23 Jun 2009 22:02:37 +0000 (01:02 +0300)]
More meaningful timeout for sleep.

Given that vblanks generally occur 60 times a second, waiting 3 seconds
seems rather excessive.

Obtained-from: FreeBSD

14 years agoDon't corrupt hardware vblank counter.
Hasso Tepper [Tue, 23 Jun 2009 21:58:04 +0000 (00:58 +0300)]
Don't corrupt hardware vblank counter.

vblank[crtc].last represents the hardware counter while request.sequence
represents the software counter.

Obtained-from: FreeBSD

14 years agoHold the lock while we save/restore register for suspend/resume.
Hasso Tepper [Tue, 23 Jun 2009 21:56:43 +0000 (00:56 +0300)]
Hold the lock while we save/restore register for suspend/resume.

Obtained-from: FreeBSD

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Wed, 24 Jun 2009 19:53:50 +0000 (12:53 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agoUSB - Fix compiler warning.
Matthew Dillon [Wed, 24 Jun 2009 19:53:32 +0000 (12:53 -0700)]
USB - Fix compiler warning.

14 years agoAMD64 - More %llX format fixes
Matthew Dillon [Wed, 24 Jun 2009 19:53:03 +0000 (12:53 -0700)]
AMD64 - More %llX format fixes

14 years agoMake atomic_load_acq_* and atomic_store_rel_* actually work.
Hasso Tepper [Wed, 24 Jun 2009 17:04:06 +0000 (20:04 +0300)]
Make atomic_load_acq_* and atomic_store_rel_* actually work.

Obtained-from: FreeBSD

14 years agoAMD64 - Fix many compile-time warnings. int/ptr type mismatches, %llx, etc.
Matthew Dillon [Wed, 24 Jun 2009 19:31:02 +0000 (12:31 -0700)]
AMD64 - Fix many compile-time warnings.  int/ptr type mismatches, %llx, etc.

14 years agousb ehci - Fix machine freezes from shutdown race (missing commit)
Matthew Dillon [Wed, 24 Jun 2009 17:28:55 +0000 (10:28 -0700)]
usb ehci - Fix machine freezes from shutdown race (missing commit)

EHCI's shutdown code was killing the chipset without first killing the
interrupt, and it was also handing EHCI back to the BIOS without first
waiting for the shutdown reset to complete.  Either can lock the machine

14 years agoHAMMER Util: Fix missing check on fopen result.
Matthew Dillon [Wed, 24 Jun 2009 15:51:11 +0000 (08:51 -0700)]
HAMMER Util: Fix missing check on fopen result.

Fix a missing check when the fopen() to create a new period file fails.

Reported-by: Antonio Huete Jimenez <tuxillo@quantumachine.net>
14 years agousb ehci - Fix machine freezes from shutdown race
Matthew Dillon [Wed, 24 Jun 2009 05:25:57 +0000 (22:25 -0700)]
usb ehci - Fix machine freezes from shutdown race

EHCI's shutdown code was killing the chipset without first killing the
interrupt, and it was also handing EHCI back to the BIOS without first
waiting for the shutdown reset to complete.  Either can lock the machine
up on shutdown/reboot.

14 years agousb - More interrupt livelock fixes.
Matthew Dillon [Wed, 24 Jun 2009 05:25:07 +0000 (22:25 -0700)]
usb - More interrupt livelock fixes.

Fix additional interrupt livelocks which occur during initialization due to
interrupts being enabled too early.

14 years agoMerge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Matthew Dillon [Tue, 23 Jun 2009 23:10:34 +0000 (16:10 -0700)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly

14 years agokernel diskmbr handling - Detect maxed out slice ds_size field.
Matthew Dillon [Tue, 23 Jun 2009 23:08:26 +0000 (16:08 -0700)]
kernel diskmbr handling - Detect maxed out slice ds_size field.

If the DOS slice field is found to be maxed out (0xFFFFFFFFU), use the
actual media size for calculations instead of ds_size.  This allows
disks > 2TB to have a conventional slice table and still contain a
disklabel64 which covers the actual size of the media.

14 years agodisklabel - expand warning if the media is too large.
Matthew Dillon [Tue, 23 Jun 2009 23:07:15 +0000 (16:07 -0700)]
disklabel - expand warning if the media is too large.

Instead of just warning that the media is too large and exiting, also
now suggest that disklabel64 be used.

14 years agofdisk - allow media sizes larger then 2TB
Matthew Dillon [Tue, 23 Jun 2009 23:05:51 +0000 (16:05 -0700)]
fdisk - allow media sizes larger then 2TB

If the media size is larger then 2TB set the 32 bit slice logical
size field, ds_size, to its maximum value of 0xFFFFFFFFU instead of
overflowing the field.

14 years agoAdd sili(4) and drm(4) manpages (from OpenBSD and NetBSD, respectively).
Sascha Wildner [Tue, 23 Jun 2009 18:38:00 +0000 (20:38 +0200)]
Add sili(4) and drm(4) manpages (from OpenBSD and NetBSD, respectively).

Thanks to Hasso Tepper for helping with the drm(4) one.

14 years agomake upgrade: Remove GNU cpio's info file, too.
Sascha Wildner [Tue, 23 Jun 2009 06:36:58 +0000 (08:36 +0200)]
make upgrade: Remove GNU cpio's info file, too.

14 years agoMake all G4X chips use the new framecount register.
Hasso Tepper [Mon, 22 Jun 2009 19:14:14 +0000 (22:14 +0300)]
Make all G4X chips use the new framecount register.

The G45 docs indicate that all G4X chips use the new framecount register.
Intel agrees with my reading of the docs, make it so for all G4X chips.

The new register also has a 32 bit width as opposed to 24 bits.  Fix
things up so that the counters roll over properly.

Obtained-from: FreeBSD

14 years agokrealloc() behaves identically to kmalloc when passed a NULL object pointer.
Hasso Tepper [Mon, 22 Jun 2009 19:12:25 +0000 (22:12 +0300)]
krealloc() behaves identically to kmalloc when passed a NULL object pointer.

If an error does occur we would have left max_context with an incorrect
value.

Obtained-from: FreeBSD

14 years agoDon't panic if drm_rmmap is called with a NULL map pointer.
Hasso Tepper [Mon, 22 Jun 2009 19:11:37 +0000 (22:11 +0300)]
Don't panic if drm_rmmap is called with a NULL map pointer.

Obtained-from: FreeBSD

14 years agoDon't try to setup interrupts for drivers that don't support them.
Hasso Tepper [Mon, 22 Jun 2009 19:09:32 +0000 (22:09 +0300)]
Don't try to setup interrupts for drivers that don't support them.

This causes sis and probably a couple of other drivers to panic and fail.

Obtained-from: FreeBSD

14 years agoCheck offsets for R300_ZB_ZPASS_ADDR.
Hasso Tepper [Mon, 22 Jun 2009 18:55:03 +0000 (21:55 +0300)]
Check offsets for R300_ZB_ZPASS_ADDR.

Obtained-from: FreeBSD

14 years agoAdd regs required for occlusion queries support.
Hasso Tepper [Mon, 22 Jun 2009 18:53:56 +0000 (21:53 +0300)]
Add regs required for occlusion queries support.

Obtained-from: FreeBSD

14 years agoAdd support for RV790 (HD 4890) asics.
Hasso Tepper [Mon, 22 Jun 2009 18:51:42 +0000 (21:51 +0300)]
Add support for RV790 (HD 4890) asics.

Obtained-from: FreeBSD

14 years agoRadeon microcode handling cleanup.
Hasso Tepper [Mon, 22 Jun 2009 18:50:04 +0000 (21:50 +0300)]
Radeon microcode handling cleanup.

A little more cleanup from AMD, if we don't have the right microcode
there is no reason to mess with the chip.

Obtained-from: FreeBSD

14 years agoMP table: Don't mix lapic/ioapic/imcr configuration information extraction
Sepherosa Ziehau [Mon, 22 Jun 2009 10:42:34 +0000 (18:42 +0800)]
MP table: Don't mix lapic/ioapic/imcr configuration information extraction

14 years agoMerge mptable_check() into mptable_probe()
Sepherosa Ziehau [Mon, 22 Jun 2009 10:24:17 +0000 (18:24 +0800)]
Merge mptable_check() into mptable_probe()

14 years agoUse madt_iterate_entries() in madt_pass2()
Sepherosa Ziehau [Sun, 21 Jun 2009 08:34:34 +0000 (16:34 +0800)]
Use madt_iterate_entries() in madt_pass2()

14 years agoACPI MADT: When locating lapic address, take Local APIC Address Override
Sepherosa Ziehau [Sun, 21 Jun 2009 07:58:53 +0000 (15:58 +0800)]
ACPI MADT: When locating lapic address, take Local APIC Address Override
into consideration.

14 years agoACPI MADT: Check existance of BSP in madt_check()
Sepherosa Ziehau [Sun, 21 Jun 2009 07:25:36 +0000 (15:25 +0800)]
ACPI MADT: Check existance of BSP in madt_check()

14 years agoACPI MADT: Add madt_iterate_entries()
Sepherosa Ziehau [Sun, 21 Jun 2009 06:53:21 +0000 (14:53 +0800)]
ACPI MADT: Add madt_iterate_entries()

14 years agoUse mptable_iterate_entries() in mptable_pass2()
Sepherosa Ziehau [Sun, 21 Jun 2009 05:41:28 +0000 (13:41 +0800)]
Use mptable_iterate_entries() in mptable_pass2()

14 years agoPull IMCR setting out of mptable_pass2()
Sepherosa Ziehau [Sun, 21 Jun 2009 04:37:23 +0000 (12:37 +0800)]
Pull IMCR setting out of mptable_pass2()

14 years agoLet mptable_pass2() call mptable_default()
Sepherosa Ziehau [Sun, 21 Jun 2009 04:30:00 +0000 (12:30 +0800)]
Let mptable_pass2() call mptable_default()

14 years agomptable_default() only configures ioapic stuffs
Sepherosa Ziehau [Sun, 21 Jun 2009 04:17:05 +0000 (12:17 +0800)]
mptable_default() only configures ioapic stuffs

14 years agoUse mptable_iterate_entries() in mptable_pass1()
Sepherosa Ziehau [Sun, 21 Jun 2009 04:08:50 +0000 (12:08 +0800)]
Use mptable_iterate_entries() in mptable_pass1()

14 years agoMP table: Remove global variables for HT fixup
Sepherosa Ziehau [Sat, 20 Jun 2009 12:49:49 +0000 (20:49 +0800)]
MP table: Remove global variables for HT fixup

14 years agoNAPICID 16 -> 256.
Sepherosa Ziehau [Sat, 20 Jun 2009 12:18:53 +0000 (20:18 +0800)]
NAPICID 16 -> 256.

This also makes sure that we could actually do 32 (MAXCPU) CPUs
instead of 16.

14 years agomptable_lapic_enumerate(): Fix comment
Sepherosa Ziehau [Sat, 20 Jun 2009 11:19:52 +0000 (19:19 +0800)]
mptable_lapic_enumerate(): Fix comment

14 years agoRearrange mptable_lapic_enumerate() by factoring out mptable_lapic_default()
Sepherosa Ziehau [Sat, 20 Jun 2009 10:59:08 +0000 (18:59 +0800)]
Rearrange mptable_lapic_enumerate() by factoring out mptable_lapic_default()

14 years agoAdd APIC_ID to extract apic id from local apic id field
Sepherosa Ziehau [Sat, 20 Jun 2009 10:29:27 +0000 (18:29 +0800)]
Add APIC_ID to extract apic id from local apic id field

14 years agoAdd lapic_init() to map local apic
Sepherosa Ziehau [Sat, 20 Jun 2009 10:18:51 +0000 (18:18 +0800)]
Add lapic_init() to map local apic

14 years agoMP table: Pull lapic related information extraction into seperate function
Sepherosa Ziehau [Sat, 20 Jun 2009 09:35:58 +0000 (17:35 +0800)]
MP table: Pull lapic related information extraction into seperate function

14 years agoMP table: Do preliminary checks before claiming that the MP table is valid
Sepherosa Ziehau [Sat, 20 Jun 2009 03:53:36 +0000 (11:53 +0800)]
MP table: Do preliminary checks before claiming that the MP table is valid

14 years agoPut mp_nbusses and bus_data under APIC_IO
Sepherosa Ziehau [Fri, 19 Jun 2009 13:40:55 +0000 (21:40 +0800)]
Put mp_nbusses and bus_data under APIC_IO

14 years agoStaticize mp_nbusses
Sepherosa Ziehau [Fri, 19 Jun 2009 12:19:18 +0000 (20:19 +0800)]
Staticize mp_nbusses

14 years agoRemove bsp_apic_ready
Sepherosa Ziehau [Fri, 19 Jun 2009 11:54:15 +0000 (19:54 +0800)]
Remove bsp_apic_ready

14 years agoCorrect the logical_cpus calculation in mptable_hyperthread_fixup()
Sepherosa Ziehau [Wed, 17 Jun 2009 11:54:22 +0000 (19:54 +0800)]
Correct the logical_cpus calculation in mptable_hyperthread_fixup()

The original code extracts logical_cpus directly from the output of
cpuid(eax=1), however,
According to Intel's #253668, section 7.7
"(CPUID.1:EBX[23:16]) -- Indicates the maximum number of addressable
 ID for logical processors in a physical package."
According to AMD's #25481 CPUID Fn0000_0001_EBX
"LogicalProcessorCount is the number of threads per CPU core times the
 number of CPU cores per processor."

So what we originally saved in logical_cpus is actually the upper limit
of the logical CPUs per phyical CPU package.  It may work correctly if
there is only one logical CPU per physical CPU package detected in MP
table.  But if more than one logical CPUs per phyical CPU package are
detected in the MP table, then the missing logical CPUs will not be
detected later, since the code assumed that logical_cpus is the number
of logical CPUs missed between two detected logical CPUs.

We try to fix the problem by calculating the distances between two nearest
APIC IDs.  If all such distances for all detect logical CPUs are same,
then the logical_cpus is set the calculated distance.  The value extracted
from cpuid(eax=1) just serves as the upper limit of the logical_cpus now.

Reported-and-Tested-by: Robert Luciani <rluciani@gmail.com>