kernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds.
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 9 Dec 2010 22:09:17 +0000 (14:09 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 9 Dec 2010 22:09:17 +0000 (14:09 -0800)
commitda23a592849ab6010314c28c571f343b43c9b6d5
treef7233d8d9894ca8520561bb33bcc1ef8d6d413b0
parent1e636427bd23ef42b096523819e10ade665192f0
kernel - Add support for up to 63 cpus & 512G of ram for 64-bit builds.

* Increase SMP_MAXCPU to 63 for 64-bit builds.

* cpumask_t is 64 bits on 64-bit builds now.  It remains 32 bits on 32-bit
  builds.

* Add #define's for atomic_set_cpumask(), atomic_clear_cpumask, and
  atomic_cmpset_cpumask().  Replace all use cases on cpu masks with
  these functions.

* Add CPUMASK(), BSRCPUMASK(), and BSFCPUMASK() macros.  Replace all
  use cases on cpu masks with these functions.

  In particular note that (1 << cpu) just doesn't work with a 64-bit
  cpumask.

  Numerous bits of assembly also had to be adjusted to use e.g. btq instead
  of btl, etc.

* Change __uint32_t declarations that were meant to be cpu masks to use
  cpumask_t (most already have).

  Also change other bits of code which work on cpu masks to be more agnostic.
  For example, poll_cpumask0 and lwp_cpumask.

* 64-bit atomic ops cannot use "iq", they must use "r", because most x86-64
  do NOT have 64-bit immediate value support.

* Rearrange initial kernel memory allocations to start from KvaStart and
  not KERNBASE, because only 2GB of KVM is available after KERNBASE.

  Certain VM allocations with > 32G of ram can exceed 2GB.  For example,
  vm_page_array[].  2GB was not enough.

* Remove numerous mdglobaldata fields that are not used.

* Align CPU_prvspace[] for now.  Eventually it will be moved into a
  mapped area.  Reserve sufficient space at MPPTDI now, but it is
  still unused.

* When pre-allocating kernel page table PD entries calculate the number
  of page table pages at KvaStart and at KERNBASE separately, since
  the KVA space starting at KERNBASE caps out at 2GB.

* Change kmem_init() and vm_page_startup() to not take memory range
  arguments.  Instead the globals (virtual_start and virtual_end) are
  manipualted directly.
67 files changed:
sys/cpu/i386/include/atomic.h
sys/cpu/i386/include/types.h
sys/cpu/x86_64/include/atomic.h
sys/cpu/x86_64/include/param.h
sys/cpu/x86_64/include/types.h
sys/dev/acpica5/acpi_cpu.c
sys/kern/init_main.c
sys/kern/kern_mplock.c
sys/kern/kern_poll.c
sys/kern/kern_proc.c
sys/kern/kern_synch.c
sys/kern/kern_usched.c
sys/kern/lwkt_ipiq.c
sys/kern/usched_bsd4.c
sys/kern/usched_dummy.c
sys/netinet/tcp_subr.c
sys/platform/pc32/acpica5/madt.c
sys/platform/pc32/apic/mpapic.c
sys/platform/pc32/i386/genassym.c
sys/platform/pc32/i386/machdep.c
sys/platform/pc32/i386/mp_machdep.c
sys/platform/pc32/i386/pmap.c
sys/platform/pc32/i386/pmap_inval.c
sys/platform/pc32/i386/vm_machdep.c
sys/platform/pc32/include/globaldata.h
sys/platform/pc32/include/pmap.h
sys/platform/pc32/include/smp.h
sys/platform/pc64/acpica5/madt.c
sys/platform/pc64/apic/apic_vector.s
sys/platform/pc64/apic/mpapic.c
sys/platform/pc64/include/globaldata.h
sys/platform/pc64/include/pmap.h
sys/platform/pc64/include/smp.h
sys/platform/pc64/include/vmparam.h
sys/platform/pc64/isa/clock.c
sys/platform/pc64/x86_64/db_interface.c
sys/platform/pc64/x86_64/genassym.c
sys/platform/pc64/x86_64/global.s
sys/platform/pc64/x86_64/machdep.c
sys/platform/pc64/x86_64/mp_machdep.c
sys/platform/pc64/x86_64/pmap.c
sys/platform/pc64/x86_64/pmap_inval.c
sys/platform/pc64/x86_64/swtch.s
sys/platform/vkernel/i386/cpu_regs.c
sys/platform/vkernel/i386/db_interface.c
sys/platform/vkernel/i386/genassym.c
sys/platform/vkernel/i386/mp.c
sys/platform/vkernel/include/globaldata.h
sys/platform/vkernel/include/pmap.h
sys/platform/vkernel/include/smp.h
sys/platform/vkernel/platform/pmap.c
sys/platform/vkernel64/include/globaldata.h
sys/platform/vkernel64/include/pmap.h
sys/platform/vkernel64/include/smp.h
sys/platform/vkernel64/platform/pmap.c
sys/platform/vkernel64/x86_64/cpu_regs.c
sys/platform/vkernel64/x86_64/db_interface.c
sys/platform/vkernel64/x86_64/mp.c
sys/platform/vkernel64/x86_64/swtch.s
sys/sys/globaldata.h
sys/sys/mplock2.h
sys/sys/thread2.h
sys/vm/vm_extern.h
sys/vm/vm_init.c
sys/vm/vm_kern.c
sys/vm/vm_page.c
sys/vm/vm_page.h