GitHub/LineageOS/android_kernel_motorola_exynos9610.git
16 years agox86: preallocate and prepopulate separately
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:13 +0000 (00:19 -0400)]
x86: preallocate and prepopulate separately

Jan Beulich points out that vmalloc_sync_all() assumes that the
kernel's pmd is always expected to be present in the pgd.  The current
pgd construction code will add the pgd to the pgd_list before its pmds
have been pre-populated, thereby making it visible to
vmalloc_sync_all().

However, because pgd_prepopulate_pmd also does the allocation, it may
block and cannot be done under spinlock.

The solution is to preallocate the pmds out of the spinlock, then
populate them while holding the pgd_list lock.

This patch also pulls the pmd preallocation and mop-up functions out
to be common, assuming that the compiler will generate no code for
them when PREALLOCTED_PMDS is 0.  Also, there's no need for pgd_ctor
to clear the pgd again, since it's allocated as a zeroed page.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86/paravirt: add a pgd_alloc/free hooks
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:12 +0000 (00:19 -0400)]
x86/paravirt: add a pgd_alloc/free hooks

Add hooks which are called at pgd_alloc/free time.  The pgd_alloc hook
may return an error code, which if non-zero, causes the pgd allocation
to be failed.  The hooks may be used to allocate/free auxillary
per-pgd information.

also fix:

> * Ingo Molnar <mingo@elte.hu> wrote:
>
>  include/asm/pgalloc.h: In function ‘paravirt_pgd_free':
>  include/asm/pgalloc.h:14: error: parameter name omitted
>  arch/x86/kernel/entry_64.S: In file included from
>  arch/x86/kernel/traps_64.c:51:include/asm/pgalloc.h: In function ‘paravirt_pgd_free':
>  include/asm/pgalloc.h:14: error: parameter name omitted

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: simplify vmalloc_sync_all
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:11 +0000 (00:19 -0400)]
x86: simplify vmalloc_sync_all

vmalloc_sync_all() is only called from register_die_notifier and
alloc_vm_area.  Neither is on any performance-critical paths, so
vmalloc_sync_all() itself is not on any hot paths.

Given that the optimisations in vmalloc_sync_all add a fair amount of
code and complexity, and are fairly hard to evaluate for correctness,
it's better to just remove them to simplify the code rather than worry
about its absolute performance.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, 64-bit: add sync_cmpxchg
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:10 +0000 (00:19 -0400)]
x86, 64-bit: add sync_cmpxchg

Add sync_cmpxchg to match 32-bit's sync_cmpxchg.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, 64-bit: add prototype for x86_64_start_kernel()
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:09 +0000 (00:19 -0400)]
x86, 64-bit: add prototype for x86_64_start_kernel()

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: build fix
Ingo Molnar [Thu, 26 Jun 2008 10:40:35 +0000 (12:40 +0200)]
x86: build fix

fix:

In file included from arch/x86/kernel/setup.c:118:
include/asm/highmem.h:64: error: expected identifier or ‘(' before ‘do'
include/asm/highmem.h:64: error: expected identifier or ‘(' before ‘while'
include/asm/highmem.h:67: error: expected identifier or ‘(' before ‘do'
include/asm/highmem.h:67: error: expected identifier or ‘(' before ‘while'

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove extra newline from setup.c
Ingo Molnar [Thu, 26 Jun 2008 10:29:29 +0000 (12:29 +0200)]
x86: remove extra newline from setup.c

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: we only have init_pg_tables_end for 32bit
Yinghai Lu [Thu, 26 Jun 2008 01:02:06 +0000 (18:02 -0700)]
x86: we only have init_pg_tables_end for 32bit

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: change some functions in setup.c to static
Yinghai Lu [Thu, 26 Jun 2008 01:00:22 +0000 (18:00 -0700)]
x86: change some functions in setup.c to static

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: make x86_find_smp_config depends on 64 bit too
Yinghai Lu [Thu, 26 Jun 2008 00:59:41 +0000 (17:59 -0700)]
x86: make x86_find_smp_config depends on 64 bit too

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move parse elfvorehdr back to setup.c
Yinghai Lu [Thu, 26 Jun 2008 00:58:55 +0000 (17:58 -0700)]
x86: move parse elfvorehdr back to setup.c

Signed-off-by: Yinghai <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move reserve_standard_io_resources back to setup.c
Yinghai Lu [Thu, 26 Jun 2008 00:58:02 +0000 (17:58 -0700)]
x86: move reserve_standard_io_resources back to setup.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move back crashkernel back to setup.c
Yinghai Lu [Thu, 26 Jun 2008 00:57:13 +0000 (17:57 -0700)]
x86: move back crashkernel back to setup.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move parse_setup_data back to setup.c
Yinghai Lu [Thu, 26 Jun 2008 00:56:22 +0000 (17:56 -0700)]
x86: move parse_setup_data back to setup.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move boot_params back to setup.c
Yinghai Lu [Thu, 26 Jun 2008 00:55:20 +0000 (17:55 -0700)]
x86: move boot_params back to setup.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: rename setup_32.c to setup.c
Yinghai Lu [Thu, 26 Jun 2008 00:54:23 +0000 (17:54 -0700)]
x86: rename setup_32.c to setup.c

and let 64 bit use that instead of setup_64.c

[ mingo@elte.hu ]

x86: build fix

fix:

arch/x86/kernel/setup.c: In function ‘setup_arch':
arch/x86/kernel/setup.c:561: error: implicit declaration of function ‘efi_reserve_early'

and:

arch/x86/kernel/setup.c:766: error: implicit declaration of function 'init_cpu_to_node'

and:

arch/x86/kernel/setup.c:676: warning: operation on 'max_pfn_mapped' may be undefined

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: space to tab in setup_arch
Yinghai Lu [Thu, 26 Jun 2008 00:53:22 +0000 (17:53 -0700)]
x86: space to tab in setup_arch

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge 64bit setup_arch into setup_32
Yinghai Lu [Thu, 26 Jun 2008 00:52:35 +0000 (17:52 -0700)]
x86: merge 64bit setup_arch into setup_32

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add extra includes for 64bit support
Yinghai Lu [Thu, 26 Jun 2008 00:51:29 +0000 (17:51 -0700)]
x86: add extra includes for 64bit support

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: put global variable for 32bit all together
Yinghai Lu [Thu, 26 Jun 2008 00:50:06 +0000 (17:50 -0700)]
x86: put global variable for 32bit all together

those variables are not needed by 64 bit.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: update reserve_initrd to support 64bit
Yinghai Lu [Thu, 26 Jun 2008 00:49:26 +0000 (17:49 -0700)]
x86: update reserve_initrd to support 64bit

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: we can use full bootmem after have init_memory_mapping
Yinghai Lu [Thu, 26 Jun 2008 00:48:23 +0000 (17:48 -0700)]
x86: we can use full bootmem after have init_memory_mapping

So remove outdated comments

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: rename setup.c to setup_percpu.c
Yinghai Lu [Thu, 26 Jun 2008 00:48:14 +0000 (17:48 -0700)]
x86: rename setup.c to setup_percpu.c

some functions need to be moved to setup_numa.c
after we merge setup32/64.c, some funcs need to be moved back to setup.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix memory setup bug
Yinghai Lu [Thu, 26 Jun 2008 07:44:56 +0000 (00:44 -0700)]
x86: fix memory setup bug

interesting...

[    0.000000]   mapped low ram: 0 - 20000000
[    0.000000]   low ram: 00000000 - 1fff0000
[    0.000000]   bootmap 00002000 - 00006000

max_pfn_mapped > max_low_pfn?

it seems init_memory_mapping reveals an old bug.

please check attached test patch.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, crashdump, /proc/vmcore: remove CONFIG_EXPERIMENTAL from kdump
Bernhard Walle [Thu, 26 Jun 2008 07:23:21 +0000 (09:23 +0200)]
x86, crashdump, /proc/vmcore: remove CONFIG_EXPERIMENTAL from kdump

I would suggest to remove the "experimental" status from Kdump.
Kdump is now in the kernel since a long time and used by Enterprise
distributions. I don't think that "experimental" is true any more.

Signed-off-by: Bernhard Walle <bwalle@suse.de>
Cc: vgoyal@redhat.com
Cc: kexec@lists.infradead.org
Cc: Bernhard Walle <bwalle@suse.de>
Cc: akpm@linux-foundation.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86 boot: only pick up additional EFI memmap if add_efi_memmap flag
Paul Jackson [Wed, 25 Jun 2008 12:44:46 +0000 (05:44 -0700)]
x86 boot: only pick up additional EFI memmap if add_efi_memmap flag

Applies on top of the previous patch:
  x86 boot: add code to add BIOS provided EFI memory entries to kernel

Instead of always adding EFI memory map entries (if present) to the
memory map after initially finding either E820 BIOS memory map entries
and/or kernel command line memmap entries, -instead- only add such
additional EFI memory map entries if the kernel boot option:

    add_efi_memmap

is specified.

Requiring this 'add_efi_memmap' option is backward compatible with
kernels that didn't load such additional EFI memory map entries in
the first place, and it doesn't override a configuration that tries
to replace all E820 or EFI BIOS memory map entries with ones given
entirely on the kernel command line.

Signed-off-by: Paul Jackson <pj@sgi.com>
Cc: "Yinghai Lu" <yhlu.kernel@gmail.com>
Cc: "Jack Steiner" <steiner@sgi.com>
Cc: "Mike Travis" <travis@sgi.com>
Cc: "Huang
Cc: Ying" <ying.huang@intel.com>
Cc: "Andi Kleen" <andi@firstfloor.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agomm, generic, x86 boot: more tweaks to hex prints of some pfn addresses
Paul Jackson [Wed, 25 Jun 2008 12:44:40 +0000 (05:44 -0700)]
mm, generic, x86 boot: more tweaks to hex prints of some pfn addresses

Fix some problems with (and applies on top of) a previous patch:
  x86 boot: show pfn addresses in hex not decimal in some kernel info printks

Primarily change "0x%8lx" format, which displays with a right aligned
space filled hex number (spaces between the "0x" prefix and the number),
into "%0#10lx" format, which zero fills instead of space fills, and
which uses the printf flag '#' to request the "0x" prefix instead of
hard coding it.

Also replace some other "0x%lx" formats with "%#lx", making use of the
'#' printf flag again.

Signed-off-by: Paul Jackson <pj@sgi.com>
Cc: "Yinghai Lu" <yhlu.kernel@gmail.com>
Cc: "Jack Steiner" <steiner@sgi.com>
Cc: "Mike Travis" <travis@sgi.com>
Cc: "Huang
Cc: Ying" <ying.huang@intel.com>
Cc: "Andi Kleen" <andi@firstfloor.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: cleanup e820_setup_gap(), add e820_search_gap(), v2
Alok Kataria [Tue, 24 Jun 2008 18:48:30 +0000 (11:48 -0700)]
x86: cleanup e820_setup_gap(), add e820_search_gap(), v2

This is a preparatory patch for the next patch in series.
Moves some code from e820_setup_gap to a new function e820_search_gap.
This patch is a part of a bug fix where we walk the ACPI table to calculate
a gap for PCI optional devices.

v1->v2: Patch on top of tip/master.
Fixes a bug introduced in the last patch about the typeof "last".
Also the new function e820_search_gap now returns if we found a gap in
e820_map.

Signed-off-by: Alok N Kataria <akataria@vmware.com>
Cc: lenb@kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove end_pfn in 64bit
Yinghai Lu [Wed, 25 Jun 2008 05:14:09 +0000 (22:14 -0700)]
x86: remove end_pfn in 64bit

and use max_pfn directly.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: numa 32 using apicid_2_node to get node for logical_apicid
Yinghai Lu [Wed, 25 Jun 2008 05:13:15 +0000 (22:13 -0700)]
x86: numa 32 using apicid_2_node to get node for logical_apicid

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: change size if e820_update/remove_range
Yinghai Lu [Tue, 24 Jun 2008 21:58:38 +0000 (14:58 -0700)]
x86: change size if e820_update/remove_range

in case someone using crazy parameter while calling them.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add table_top check for alloc_low_page in 64 bit
Yinghai Lu [Tue, 24 Jun 2008 21:57:29 +0000 (14:57 -0700)]
x86: add table_top check for alloc_low_page in 64 bit

that range is from find_e820_area, so don't try to use end_pfn to see
if out of boundary...use table_top instead to avoid possible strange
result while cross the boundary...

also change early_printk to printk, because init_memory_mapping is after
early param parsing, and console=uart8250 already working at that time.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: get max_pfn_mapped in init_memory_mapping
Yinghai Lu [Tue, 24 Jun 2008 21:56:20 +0000 (14:56 -0700)]
x86: get max_pfn_mapped in init_memory_mapping

so don't shift that in the loop

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix e820_update_range size when overlapping
Yinghai Lu [Tue, 24 Jun 2008 21:55:32 +0000 (14:55 -0700)]
x86: fix e820_update_range size when overlapping

before that we relay on sanitize_e820_map to remove the overlap.

but e820_update_range(,,E820_RESERVED, E820_RAM) will not work

this patch fix that

who is going to use this?

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: introduce init_memory_mapping for 32bit #3
Yinghai Lu [Tue, 24 Jun 2008 19:19:41 +0000 (12:19 -0700)]
x86: introduce init_memory_mapping for 32bit #3

move kva related early backto initmem_init for numa32

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: introduce init_memory_mapping for 32bit #2
Yinghai Lu [Tue, 24 Jun 2008 19:18:58 +0000 (12:18 -0700)]
x86: introduce init_memory_mapping for 32bit #2

moving relocate_initrd early

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: introduce init_memory_mapping for 32bit #1
Yinghai Lu [Tue, 24 Jun 2008 19:18:14 +0000 (12:18 -0700)]
x86: introduce init_memory_mapping for 32bit #1

... so can we use mem below max_low_pfn earlier.

this allows us to move several functions more early instead of waiting
to after paging_init.

That includes moving relocate_initrd() earlier in the bootup, and kva
related early setup done in initmem_init. (in followup patches)

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify mmu_context.h
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:07 +0000 (00:19 -0400)]
x86: unify mmu_context.h

Some amount of asm-x86/mmu_context.h can be unified, including
activate_mm paravirt hook.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify pgd_index
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:06 +0000 (00:19 -0400)]
x86: unify pgd_index

pgd_index is common for 32 and 64-bit, so move it to a common place.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, 64-bit: use __pgd() on mk_kernel_pgd()
Eduardo Habkost [Wed, 25 Jun 2008 04:19:05 +0000 (00:19 -0400)]
x86, 64-bit: use __pgd() on mk_kernel_pgd()

Use __pgd() on mk_kernel_pgd()

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, 64-bit: add gate_offset() and gate_segment() macros
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:04 +0000 (00:19 -0400)]
x86, 64-bit: add gate_offset() and gate_segment() macros

For calculating the offset from struct gate_struct fields.

[ gate_offset and gate_segment were broken for 32-bit. ]

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, 64-bit: unify early_ioremap
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:03 +0000 (00:19 -0400)]
x86, 64-bit: unify early_ioremap

The 32-bit early_ioremap will work equally well for 64-bit, so just use it.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, 64-bit: use p??_populate() to attach pages to pagetable
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:02 +0000 (00:19 -0400)]
x86, 64-bit: use p??_populate() to attach pages to pagetable

Use the _populate() functions to attach new pages to a pagetable, to
make sure the right paravirt_ops calls get called.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86, 64-bit: use write_gdt_entry in vsyscall_set_cpu
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:01 +0000 (00:19 -0400)]
x86, 64-bit: use write_gdt_entry in vsyscall_set_cpu

Use write_gdt_entry to generate the special vgetcpu descriptor in the
vsyscall page.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove open-coded save/load segment operations
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:19:00 +0000 (00:19 -0400)]
x86: remove open-coded save/load segment operations

This removes a pile of buggy open-coded implementations of savesegment
and loadsegment.

(They are buggy because they don't have memory barriers to prevent
them from being reordered with respect to memory accesses.)

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add memory barriers to wrmsr
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:18:59 +0000 (00:18 -0400)]
x86: add memory barriers to wrmsr

wrmsr is a special instruction which can have arbitrary system-wide
effects.  We don't want the compiler to reorder it with respect to
memory operations, so make it a memory barrier.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add memory clobber to save/loadsegment
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:18:58 +0000 (00:18 -0400)]
x86: add memory clobber to save/loadsegment

Add "memory" clobbers to savesegment and loadsegment, since they can
affect memory accesses and we never want the compiler to reorder them
with respect to memory references.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: asm-x86/pgtable.h: fix compiler warning
Jeremy Fitzhardinge [Wed, 25 Jun 2008 04:18:57 +0000 (00:18 -0400)]
x86: asm-x86/pgtable.h: fix compiler warning

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: nmi_watchdog - introduce nmi_watchdog_active() helper
Cyrill Gorcunov [Tue, 24 Jun 2008 20:52:06 +0000 (22:52 +0200)]
x86: nmi_watchdog - introduce nmi_watchdog_active() helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: macro@linux-mips.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: nmi_watchdog - use NMI_NONE by default
Cyrill Gorcunov [Tue, 24 Jun 2008 20:52:05 +0000 (22:52 +0200)]
x86: nmi_watchdog - use NMI_NONE by default

There is no need to keep NMI_DISABLED definition and use it
for nmi_watchdog by default. Here is the point why:

- IO-APIC and APIC chips are programmed for nmi_watchdog support at very
  early stage of kernel booting and not having nmi_watchdog specified as
  boot option lead only to nmi_watchdog becomes to NMI_NONE anyway
- enable nmi_watchdog thru /proc/sys/kernel/nmi if it was not specified at
  boot is not possible too (even having this sysfs entry)

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: macro@linux-mips.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: nmi_watchdog - remove useless check
Cyrill Gorcunov [Tue, 24 Jun 2008 20:52:04 +0000 (22:52 +0200)]
x86: nmi_watchdog - remove useless check

Since nmi_watchdog is unsigned variable we may
safely remove the check for negative value.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: macro@linux-mips.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: nmi_watchdog - use nmi_watchdog variable for printing
Cyrill Gorcunov [Tue, 24 Jun 2008 20:52:04 +0000 (22:52 +0200)]
x86: nmi_watchdog - use nmi_watchdog variable for printing

Since it is possible NMI_ definitions could be changed
one day we better print out real nmi_watchdog value instead
of constant string.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: macro@linux-mips.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: perfctr-watchdog.c - coding style cleanup
Cyrill Gorcunov [Tue, 24 Jun 2008 20:52:03 +0000 (22:52 +0200)]
x86: perfctr-watchdog.c - coding style cleanup

Just some code beautification. Nothing else.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: macro@linux-mips.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86 boot: more consistently use type int for node ids
Paul Jackson [Sun, 22 Jun 2008 14:22:17 +0000 (07:22 -0700)]
x86 boot: more consistently use type int for node ids

Everywhere I look, node id's are of type 'int', except in this one
case, which has 'unsigned long'.  Change this one to 'int' as well.
There is nothing special about the way this variable 'nid' is used in
this routine to justify using an unusual type here.

Signed-off-by: Paul Jackson <pj@sgi.com>
Cc: "Yinghai Lu" <yhlu.kernel@gmail.com>
Cc: "Jack Steiner" <steiner@sgi.com>
Cc: "Mike Travis" <travis@sgi.com>
Cc: "Huang
Cc: Ying" <ying.huang@intel.com>
Cc: "Andi Kleen" <andi@firstfloor.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86 boot: show pfn addresses in hex not decimal in some kernel info printks
Paul Jackson [Sun, 22 Jun 2008 14:22:12 +0000 (07:22 -0700)]
x86 boot: show pfn addresses in hex not decimal in some kernel info printks

Page frame numbers (the portion of physical addresses above the low
order page offsets) are displayed in several kernel debug and info
prints in decimal, not hex.  Decimal addresse are unreadable.  Use hex.

Signed-off-by: Paul Jackson <pj@sgi.com>
Cc: "Yinghai Lu" <yhlu.kernel@gmail.com>
Cc: "Jack Steiner" <steiner@sgi.com>
Cc: "Mike Travis" <travis@sgi.com>
Cc: "Huang
Cc: Ying" <ying.huang@intel.com>
Cc: "Andi Kleen" <andi@firstfloor.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86 boot: allow overlapping early reserve memory ranges
Paul Jackson [Sun, 22 Jun 2008 14:22:07 +0000 (07:22 -0700)]
x86 boot: allow overlapping early reserve memory ranges

Add support for overlapping early memory reservations.

In general, they still can't overlap, and will panic
with "Overlapping early reservations" if they do overlap.

But if a memory range is reserved with the new call:
    reserve_early_overlap_ok()
rather than with the usual call:
    reserve_early()
then subsequent early reservations are allowed to overlap.

This new reserve_early_overlap_ok() call is only used in one
place so far, which is the "BIOS reserved" reservation for the
the EBDA region, which out of Paranoia reserves more than what
the BIOS might have specified, and which thus might overlap with
another legitimate early memory reservation (such as, perhaps,
the EFI memmap.)

Signed-off-by: Paul Jackson <pj@sgi.com>
Cc: "Yinghai Lu" <yhlu.kernel@gmail.com>
Cc: "Jack Steiner" <steiner@sgi.com>
Cc: "Mike Travis" <travis@sgi.com>
Cc: "Huang
Cc: Ying" <ying.huang@intel.com>
Cc: "Andi Kleen" <andi@firstfloor.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86 boot: x86_64 efi compiler warning fix
Paul Jackson [Sun, 22 Jun 2008 14:22:02 +0000 (07:22 -0700)]
x86 boot: x86_64 efi compiler warning fix

Fix a compiler warning.  Rather than always casting a u32 to a pointer
(which generates a warning on x86_64 systems) instead separate the
x86_32 and x86_64 assignments entirely with ifdefs.  Until other recent
changes to this code, it used to have x86_64 separated like this.

Signed-off-by: Paul Jackson <pj@sgi.com>
Cc: "Yinghai Lu" <yhlu.kernel@gmail.com>
Cc: "Jack Steiner" <steiner@sgi.com>
Cc: "Mike Travis" <travis@sgi.com>
Cc: "Huang
Cc: Ying" <ying.huang@intel.com>
Cc: "Andi Kleen" <andi@firstfloor.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86 boot: e820 code indentation fix
Paul Jackson [Sun, 22 Jun 2008 14:21:57 +0000 (07:21 -0700)]
x86 boot: e820 code indentation fix

Fix indentation.  An earlier code merge got the
indentation of four lines of code off by a tab.

Signed-off-by: Paul Jackson <pj@sgi.com>
Cc: "Yinghai Lu" <yhlu.kernel@gmail.com>
Cc: "Jack Steiner" <steiner@sgi.com>
Cc: "Mike Travis" <travis@sgi.com>
Cc: "Huang
Cc: Ying" <ying.huang@intel.com>
Cc: "Andi Kleen" <andi@firstfloor.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: setup_arch 32bit move kvm_guest_init later
Yinghai Lu [Tue, 24 Jun 2008 02:55:05 +0000 (19:55 -0700)]
x86: setup_arch 32bit move kvm_guest_init later

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: setup_arch 32bit move command line copying early
Yinghai Lu [Tue, 24 Jun 2008 02:54:23 +0000 (19:54 -0700)]
x86: setup_arch 32bit move command line copying early

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: setup_arch 32bit move efi check later
Yinghai Lu [Tue, 24 Jun 2008 02:53:33 +0000 (19:53 -0700)]
x86: setup_arch 32bit move efi check later

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move some func calling from setup_arch to paging_init
Yinghai Lu [Tue, 24 Jun 2008 02:51:10 +0000 (19:51 -0700)]
x86: move some func calling from setup_arch to paging_init

those function depend on paging setup pgtable, so they could access
the ram in bootmem region but just get mapped.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: numa32 pfn print out using hex instead
Yinghai Lu [Mon, 23 Jun 2008 23:41:30 +0000 (16:41 -0700)]
x86: numa32 pfn print out using hex instead

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix compile warning in init_64.c
Yinghai Lu [Mon, 23 Jun 2008 21:02:36 +0000 (14:02 -0700)]
x86: fix compile warning in init_64.c

len is long and ret is only for NUMA

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: build fix
Ingo Molnar [Mon, 23 Jun 2008 20:19:22 +0000 (22:19 +0200)]
x86: build fix

fix:

arch/x86/kernel/setup_32.c:409: error: 'enable_local_apic' undeclared (first use in this function)
arch/x86/kernel/setup_32.c:409: error: (Each undeclared identifier is reported only once
arch/x86/kernel/setup_32.c:409: error: for each function it appears in.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: clean up min_low_pfn
Yinghai Lu [Mon, 23 Jun 2008 10:06:14 +0000 (03:06 -0700)]
x86: clean up min_low_pfn

for 32bit
we already had early_res support, so don't need to track min_low_pfn.
keep it to 0 always.

also use init_bootmem_node instead of init_bootmem, so don't touch
min_low_pfn.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: clean up using max_low_pfn on 32-bit
Yinghai Lu [Mon, 23 Jun 2008 10:05:30 +0000 (03:05 -0700)]
x86: clean up using max_low_pfn on 32-bit

so that max_low_pfn is not changed after it is set.
so we can move that early and out of initmem_init.

could call find_low_pfn_range just after max_pfn is set.

also could move reserve_initrd out of setup_bootmem_allocator

so 32bit is more like 64bit.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move reservetop and vmalloc parsing to pgtable_32.c
Yinghai Lu [Mon, 23 Jun 2008 00:40:10 +0000 (17:40 -0700)]
x86: move reservetop and vmalloc parsing to pgtable_32.c

also change reserve_top_address to __init attibute

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move find_max_low_pfn to init_32.c
Yinghai Lu [Mon, 23 Jun 2008 19:00:45 +0000 (21:00 +0200)]
x86: move find_max_low_pfn to init_32.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move boot_params declaring to setup.c
Yinghai Lu [Mon, 23 Jun 2008 00:37:54 +0000 (17:37 -0700)]
x86: move boot_params declaring to setup.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: introduce reserve_initrd
Yinghai Lu [Sun, 22 Jun 2008 09:46:58 +0000 (02:46 -0700)]
x86: introduce reserve_initrd

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: introduce initmem_init for 32 bit
Yinghai Lu [Sun, 22 Jun 2008 09:45:39 +0000 (02:45 -0700)]
x86: introduce initmem_init for 32 bit

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: introduce initmem_init for 64 bit
Yinghai Lu [Sun, 22 Jun 2008 09:44:49 +0000 (02:44 -0700)]
x86: introduce initmem_init for 64 bit

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move elfcorehdr parsing to setup.c
Yinghai Lu [Sun, 22 Jun 2008 04:02:20 +0000 (21:02 -0700)]
x86: move elfcorehdr parsing to setup.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move reserve_standard_io_resource to setup.c
Yinghai Lu [Sun, 22 Jun 2008 03:22:09 +0000 (20:22 -0700)]
x86: move reserve_standard_io_resource to setup.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove two duplicated funcs in setup_32.c
Yinghai Lu [Sun, 22 Jun 2008 02:16:52 +0000 (19:16 -0700)]
x86: remove two duplicated funcs in setup_32.c

early_cpu_init is declared in processor.h
memory_setup is defined in e820.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge setup64.c into common_64.c
Yinghai Lu [Sat, 21 Jun 2008 23:25:37 +0000 (16:25 -0700)]
x86: merge setup64.c into common_64.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: seperate probe_roms into another file
Yinghai Lu [Sat, 21 Jun 2008 22:39:41 +0000 (15:39 -0700)]
x86: seperate probe_roms into another file

it is only needed for 32bit

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add e820_remove_range
Yinghai Lu [Sat, 21 Jun 2008 21:48:05 +0000 (14:48 -0700)]
x86: add e820_remove_range

... so could add real hole in e820

agp check is using request_mem_region, and could fail if e820 is reserved...

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: change identify_cpu to static
Yinghai Lu [Sat, 21 Jun 2008 10:24:00 +0000 (03:24 -0700)]
x86: change identify_cpu to static

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: seperate funcs from setup_64 to cpu common_64.c
Yinghai Lu [Sat, 21 Jun 2008 10:24:19 +0000 (03:24 -0700)]
x86: seperate funcs from setup_64 to cpu common_64.c

Signed-off-by: Yinghai Lu <yhlu.kernel@mail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove some acpi ifdefs in setup_32/64
Yinghai Lu [Sat, 21 Jun 2008 08:38:41 +0000 (01:38 -0700)]
x86: remove some acpi ifdefs in setup_32/64

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: clean up init_amd()
Yinghai Lu [Sat, 21 Jun 2008 08:14:27 +0000 (01:14 -0700)]
x86: clean up init_amd()

1. move out calling of check_enable_amd_mmconf_dmi out of setup_64.c
   put it into init_amd(), so don't need to make extra dmi check for
   system with other cpus.
2. 15 --> 0xf

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: check command line when CONFIG_X86_MPPARSE is not set, v2
Yinghai Lu [Fri, 20 Jun 2008 23:11:20 +0000 (16:11 -0700)]
x86: check command line when CONFIG_X86_MPPARSE is not set, v2

if acpi=off, acpi=noirq and pci=noacpi, we need to disable apic.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoxen: set max_pfn_mapped
Jeremy Fitzhardinge [Mon, 16 Jun 2008 21:54:51 +0000 (14:54 -0700)]
xen: set max_pfn_mapped

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: the arch/x86 maintainers <x86@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoxen: reserve ISA space in e820 map
Jeremy Fitzhardinge [Mon, 16 Jun 2008 21:54:49 +0000 (14:54 -0700)]
xen: reserve ISA space in e820 map

[ TODO: release the underlying memory back to Xen. ]

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: the arch/x86 maintainers <x86@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoxen: reserve Xen-specific memory in e820 map
Jeremy Fitzhardinge [Mon, 16 Jun 2008 21:54:46 +0000 (14:54 -0700)]
xen: reserve Xen-specific memory in e820 map

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: the arch/x86 maintainers <x86@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoRFC x86: try to remove arch_get_ram_range
Yinghai Lu [Tue, 17 Jun 2008 03:10:55 +0000 (20:10 -0700)]
RFC x86: try to remove arch_get_ram_range

want to remove arch_get_ram_range, and use early_node_map instead.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix sleep.c build error
Ingo Molnar [Fri, 13 Jun 2008 18:31:54 +0000 (20:31 +0200)]
x86: fix sleep.c build error

fix:

arch/x86/kernel/acpi/sleep.c: In function ‘acpi_save_state_mem':
arch/x86/kernel/acpi/sleep.c:75: error: ‘stack_start' undeclared (first use in this function)
arch/x86/kernel/acpi/sleep.c:75: error: (Each undeclared identifier is reported
only once
arch/x86/kernel/acpi/sleep.c:75: error: for each function it appears in.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: take load_sp0 out of smpboot.c
Glauber Costa [Thu, 5 Jun 2008 06:05:39 +0000 (23:05 -0700)]
x86: take load_sp0 out of smpboot.c

there's no particular reason to do load_sp0 in different
places for i386 and x86_64. They should all be in cpu_init.
Right now, cpu_init itself is not integrated, but with this patch,
the code becomes closer to each other, making in easier to integrate
when the time comes.

Furthermore, although doing it in do_boot_cpu for x86_64 is fine, since it's
only a copy, load_sp0 should be executed in the cpu it refers to anyway.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move cpu_exit_clear to process_32.c
Glauber Costa [Wed, 4 Jun 2008 18:35:03 +0000 (15:35 -0300)]
x86: move cpu_exit_clear to process_32.c

Take it out of smpboot.c, and move it to process_32.c, closer
to its only user.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove cpu from maps
Glauber Costa [Wed, 4 Jun 2008 05:05:03 +0000 (02:05 -0300)]
x86: remove cpu from maps

during cpu disable, take cpus out of all maps in i386, instead
of just the online map.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: change naming to match x86_64
Glauber Costa [Wed, 4 Jun 2008 05:03:07 +0000 (02:03 -0300)]
x86: change naming to match x86_64

Change unmap_cpu_to_logical_apicid to numa_remove_cpu.
Besides being shorter, it is the same name x86_64 uses. We
can save an ifdef in the code this way.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: provide connect_bsp_APIC for x86_64
Glauber Costa [Wed, 28 May 2008 16:38:28 +0000 (13:38 -0300)]
x86: provide connect_bsp_APIC for x86_64

Although it is not really needed, we provide it to get
closer to i386. ifdefs around it are removed in smpboot.c

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: change __setup_vector_irq with setup_vector_irq
Glauber Costa [Thu, 29 May 2008 03:34:19 +0000 (20:34 -0700)]
x86: change __setup_vector_irq with setup_vector_irq

We create a version of it for i386, and then take the CONFIG_X86_64
ifdef out of the game. We could create a __setup_vector_irq for i386,
but it would incur in an unnecessary lock taking. Moreover, it is better
practice to only export setup_vector_irq anyway.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove ifdef from stepping
Glauber Costa [Thu, 29 May 2008 03:05:46 +0000 (20:05 -0700)]
x86: remove ifdef from stepping

The stepping won't affect x86_64, since there are not x86_64 k7's
or pentiums. So, although it adds to the binary size, remove the ifdef
for smoother integration

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: clearing io_apic harmless for x86_64
Glauber Costa [Thu, 29 May 2008 00:09:53 +0000 (17:09 -0700)]
x86: clearing io_apic harmless for x86_64

so remove ifdef.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: boot secondary cpus through initial_code
Glauber Costa [Wed, 28 May 2008 16:01:54 +0000 (13:01 -0300)]
x86: boot secondary cpus through initial_code

remove "initialize_secondary". Boot both architectures via
initial_code.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: use initial_code for i386
Glauber Costa [Wed, 28 May 2008 15:57:02 +0000 (12:57 -0300)]
x86: use initial_code for i386

x86_64 jumps to whatever is written in "initial_code" symbol,
instead of a fixed address. Do it for i386 too. It will allow us
to integrate more of the smp boot code.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move x86_64 gdt closer to i386
Glauber Costa [Wed, 28 May 2008 23:19:53 +0000 (16:19 -0700)]
x86: move x86_64 gdt closer to i386

i386 and x86_64 used two different schemes for maintaining the gdt.
With this patch, x86_64 initial gdt table is defined in a .c file,
same way as i386 is now. Also, we call it "gdt_page", and the descriptor,
"early_gdt_descr". This way we achieve common naming, which can allow for
more code integration.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>