GitHub/LineageOS/G12/android_kernel_amlogic_linux-4.9.git
16 years agox86: improve default idle
Ingo Molnar [Wed, 2 Apr 2008 11:23:22 +0000 (13:23 +0200)]
x86: improve default idle

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: support for new UV apic, fix
Jack Steiner [Mon, 31 Mar 2008 02:02:07 +0000 (21:02 -0500)]
x86: support for new UV apic, fix

Yinghai Lu pointed out a bug in the previous patches,
fix double-shift of apicid.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: set_cyc2ns_scale() remove prev scale
Ingo Molnar [Mon, 31 Mar 2008 12:52:15 +0000 (14:52 +0200)]
x86: set_cyc2ns_scale() remove prev scale

Peter Zijlstra pointed out that it's unused.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: clean up non-smp usage of cpu maps
Mike Travis [Tue, 25 Mar 2008 22:06:51 +0000 (15:06 -0700)]
x86: clean up non-smp usage of cpu maps

Cleanup references to the early cpu maps for the non-SMP configuration
and remove some functions called for SMP configurations only.

Cc: Andi Kleen <ak@suse.de>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: uv fix
Ingo Molnar [Sun, 30 Mar 2008 10:17:12 +0000 (12:17 +0200)]
x86: uv fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: support for new UV apic
Jack Steiner [Fri, 28 Mar 2008 19:12:16 +0000 (14:12 -0500)]
x86: support for new UV apic

UV supports really big systems. So big, in fact, that the APICID register
does not contain enough bits to contain an APICID that is unique across all
cpus.

The UV BIOS supports 3 APICID modes:

- legacy mode. This mode uses the old APIC mode where
  APICID is in bits [31:24] of the APICID register.

- x2apic mode. This mode is whitebox-compatible. APICIDs
  are unique across all cpus. Standard x2apic APIC operations
  (Intel-defined) can be used for IPIs. The node identifier
  fits within the Intel-defined portion of the APICID register.

- x2apic-uv mode. In this mode, the APICIDs on each node have
  unique IDs, but IDs on different node are not unique. For example,
  if each mode has 32 cpus, the APICIDs on each node might be
  0 - 31. Every node has the same set of IDs.
  The UV hub is used to route IPIs/interrupts to the correct node.
  Traditional APIC operations WILL NOT WORK.

In x2apic-uv mode, the ACPI tables all contain a full unique ID (note:
exact bit layout still changing but the following is close):

nnnnnnnnnnlc0cch
n = unique node number
l = socket number on board
c = core
h = hyperthread

Only the "lc0cch" bits are written to the APICID register. The remaining bits are
supplied by having the get_apic_id() function "OR" the extra bits into the value
read from the APICID register. (Hmmm.. why not keep the ENTIRE APICID register
in per-cpu data....)

The x2apic-uv mode is recognized by the MADT table containing:
  oem_id = "SGI"
  oem_table_id = "UV-X"

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: support for new UV apic, prepare
Ingo Molnar [Tue, 8 Apr 2008 10:20:50 +0000 (12:20 +0200)]
x86: support for new UV apic, prepare

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: define the macros and tables for blade functions
Jack Steiner [Fri, 28 Mar 2008 19:12:14 +0000 (14:12 -0500)]
x86: define the macros and tables for blade functions

Add UV macros for converting between cpu numbers, blade numbers
and node numbers. Note that these are used ONLY within x86_64 UV
modules, and are not for general kernel use.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: define the macros and tables for the basic UV infrastructure.
Jack Steiner [Fri, 28 Mar 2008 19:12:13 +0000 (14:12 -0500)]
x86: define the macros and tables for the basic UV infrastructure.

Define the macros and tables for the basic UV infrastructure.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add UV specific header for MMR definitions
Jack Steiner [Fri, 28 Mar 2008 19:12:11 +0000 (14:12 -0500)]
x86: add UV specific header for MMR definitions

Definitions of UV MMRs.
Note: this file is auto-generated by hardware design tools.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: parsing for ACPI "SAPIC" table
Jack Steiner [Fri, 28 Mar 2008 19:12:09 +0000 (14:12 -0500)]
x86: parsing for ACPI "SAPIC" table

Add kernel support for new ACPI "sapic" tables that contain 16-bit APICIDs.
This patch simply adds parsing of an optional SAPIC table if present.
Otherwise, the traditional local APIC table is used.

Note: the SAPIC table is not a new ACPI table - it exists on other architectures
but is not currently recognized by x86_64.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: increase size of APICID
Jack Steiner [Fri, 28 Mar 2008 19:12:08 +0000 (14:12 -0500)]
x86: increase size of APICID

Increase the number of bits in an apicid from 8 to 32.

By default, MP_processor_info() gets the APICID from the
mpc_config_processor structure. However, this structure limits
the size of APICID to 8 bits. This patch allows the caller of
MP_processor_info() to optionally pass a larger APICID that will
be used instead of the one in the mpc_config_processor struct.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add functions to determine if platform is a UV platform
Jack Steiner [Fri, 28 Mar 2008 19:12:06 +0000 (14:12 -0500)]
x86: add functions to determine if platform is a UV platform

Add functions that can be used to determine if an x86_64
system is a SGI "UV" system. UV systems come in 3 types and
are identified by the OEM ID in the MADT.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: change GET_APIC_ID() from an inline function to an out-of-line function
Jack Steiner [Fri, 28 Mar 2008 19:12:02 +0000 (14:12 -0500)]
x86: change GET_APIC_ID() from an inline function to an out-of-line function

Introduce a function to read the local APIC_ID.

This change is in preparation for additional changes to
the APICID functions that will come in a later patch.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: replace most VM86 flags with flags from processor-flags.h
gorcunov@gmail.com [Fri, 28 Mar 2008 14:56:56 +0000 (17:56 +0300)]
x86: replace most VM86 flags with flags from processor-flags.h

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: cleanup - rename VM_MASK to X86_VM_MASK
gorcunov@gmail.com [Fri, 28 Mar 2008 14:56:57 +0000 (17:56 +0300)]
x86: cleanup - rename VM_MASK to X86_VM_MASK

This patch renames VM_MASK to X86_VM_MASK (which
in turn defined as alias to X86_EFLAGS_VM) to better
distinguish from virtual memory flags. We can't just
use X86_EFLAGS_VM instead because it is also used
for conditional compilation

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: cleanup replace most vm86 flags with flags from processor-flags.h, fix
Ingo Molnar [Sun, 30 Mar 2008 09:45:23 +0000 (11:45 +0200)]
x86: cleanup replace most vm86 flags with flags from processor-flags.h, fix

- fix build error
- fix CONFIG_HEADERS_CHECK error

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: paravirt_ops: don't steal memory resources in paravirt_disable_iospace
Jeremy Fitzhardinge [Fri, 28 Mar 2008 00:28:40 +0000 (17:28 -0700)]
x86: paravirt_ops: don't steal memory resources in paravirt_disable_iospace

The memory resource is also used for main memory, and we need it to
allocate physical addresses for memory hotplug.  Knobbling io space is
enough to get the job done anyway.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: sparsemem: reduce i386 PAE section size
Jeremy Fitzhardinge [Fri, 28 Mar 2008 00:28:39 +0000 (17:28 -0700)]
x86: sparsemem: reduce i386 PAE section size

A 1G section size makes memory hotplug too coarse in a virtual
environment.  Retuce it by a factor of 2 to 512M.  I would have liked
to make it smaller, but it runs out of reserved flags in the page flags.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: mpparse: 64-bit fix
Ingo Molnar [Fri, 28 Mar 2008 11:33:52 +0000 (12:33 +0100)]
x86: mpparse: 64-bit fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge smp_32.h and smp_64.h into smp.h
Glauber Costa [Thu, 27 Mar 2008 17:06:04 +0000 (14:06 -0300)]
x86: merge smp_32.h and smp_64.h into smp.h

Merge what's left from smp_32.h and smp_64.h into smp.h
By now, they're basically extern definitions.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: change naming of cpu_initialized_mask for xen
Glauber Costa [Thu, 27 Mar 2008 17:06:03 +0000 (14:06 -0300)]
x86: change naming of cpu_initialized_mask for xen

xen does not use the global cpu_initialized mask, but rather,
a specific one. So we change its name so it won't conflict with the upcoming
movement of cpu_initialized_mask from smp_64.h to smp_32.h.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
CC: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge SMP definitions of smp.h
Glauber Costa [Thu, 27 Mar 2008 17:06:02 +0000 (14:06 -0300)]
x86: merge SMP definitions of smp.h

we merge everything that is inside CONFIG_SMP
to smp.h. They differ a little bit, so we use
CONFIG_X86_32_SMP and CONFIG_X86_64_SMP as markers.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: split safe_smp_processor_id
Glauber Costa [Thu, 27 Mar 2008 17:06:01 +0000 (14:06 -0300)]
x86: split safe_smp_processor_id

This implementation in x86_64 is clean and consistent, but we
sacrifice it for the sake of being equal to i386 (since the other
way around would be harder).

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge includes in smp.h
Glauber Costa [Thu, 27 Mar 2008 17:06:00 +0000 (14:06 -0300)]
x86: merge includes in smp.h

move all include directives from smp_{32,64}.h to smp.h.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: surround apic headers in apic definitions
Glauber Costa [Thu, 27 Mar 2008 17:05:59 +0000 (14:05 -0300)]
x86: surround apic headers in apic definitions

Although those constants are always defined in x86_64,
and will have the effect of just including the headers
in the very way we did before, I'm doing this in a separate
patch to be conservative and avoid surprises.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge hard/logical_smp_processor_id
Glauber Costa [Thu, 27 Mar 2008 17:05:58 +0000 (14:05 -0300)]
x86: merge hard/logical_smp_processor_id

The code is now the same between i386 and x86_64. We already
know what happens when it reaches this point: They go away
from the arch-specific headers, and suddenly appears in the common
header.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: provide bogus hard_smp_processor_id
Glauber Costa [Thu, 27 Mar 2008 17:05:57 +0000 (14:05 -0300)]
x86: provide bogus hard_smp_processor_id

We provide a bogus macro for x86_64 in case CONFIG_X86_LOCAL_APIC
is not set. It will always be set for x86_64, so the effect
is just to make the code equal to i386.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: surround hard_smp_processor_id in APIC_DEFINITION
Glauber Costa [Thu, 27 Mar 2008 17:05:56 +0000 (14:05 -0300)]
x86: surround hard_smp_processor_id in APIC_DEFINITION

APIC_DEFINITION is not defined in x86_64, so in practice, we keep
our old code here. But as a nice side effect, the code is now
equal to smp_32.h.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: microcode: show results on success too
Ben Castricum [Thu, 27 Mar 2008 19:52:35 +0000 (20:52 +0100)]
x86: microcode: show results on success too

Report when microcode was successfully updated. It used to be there but
now with DEBUG unset it becomes very silent. Also some cosmetic fixes.

Signed-off-by: Ben Castricum <lk08@bencastricum.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move generic_processor_info to apic_64.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:56:19 +0000 (23:56 +0300)]
x86: move generic_processor_info to apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move boot_cpu_physical_apicid to apic_64.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:56:12 +0000 (23:56 +0300)]
x86: move boot_cpu_physical_apicid to apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move disabled_cpus to smpboot.c (64bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:56:06 +0000 (23:56 +0300)]
x86: move disabled_cpus to smpboot.c (64bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move num_processors to smpboot.c (64 bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:59 +0000 (23:55 +0300)]
x86: move num_processors to smpboot.c (64 bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move phys_cpu_present_map to smpboot.c (64bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:53 +0000 (23:55 +0300)]
x86: move phys_cpu_present_map to smpboot.c (64bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move phys cpu present map to smpboot.c, 64-bit, prepare
Ingo Molnar [Tue, 8 Apr 2008 10:20:07 +0000 (12:20 +0200)]
x86: move phys cpu present map to smpboot.c, 64-bit, prepare

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_lapic_addr to apic_64.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:47 +0000 (23:55 +0300)]
x86: move mp_lapic_addr to apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't use MP_processor_info for ACPI mode (64bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:41 +0000 (23:55 +0300)]
x86: don't use MP_processor_info for ACPI mode (64bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: separate generic_processor_info into its own function (64bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:34 +0000 (23:55 +0300)]
x86: separate generic_processor_info into its own function (64bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't call MP_processor_info for disabled cpu (64bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:28 +0000 (23:55 +0300)]
x86: don't call MP_processor_info for disabled cpu (64bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: mpparse, move generic processor info to apic_32.c fix
Ingo Molnar [Fri, 28 Mar 2008 10:59:57 +0000 (11:59 +0100)]
x86: mpparse, move generic processor info to apic_32.c fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move generic_processor_info to apic_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:22 +0000 (23:55 +0300)]
x86: move generic_processor_info to apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move x86_bios_cpu_apicid to apic_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:16 +0000 (23:55 +0300)]
x86: move x86_bios_cpu_apicid to apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: mpparse, move boot cpu physical apicid to apic_32.c, fix
Ingo Molnar [Fri, 28 Mar 2008 11:22:10 +0000 (12:22 +0100)]
x86: mpparse, move boot cpu physical apicid to apic_32.c, fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move boot_cpu_physical_apicid to apic_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:10 +0000 (23:55 +0300)]
x86: move boot_cpu_physical_apicid to apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move def_to_bigsmp to setup_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:04 +0000 (23:55 +0300)]
x86: move def_to_bigsmp to setup_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: mpparse, move disabled cpus to smpboot.c, fix
Ingo Molnar [Fri, 28 Mar 2008 10:57:55 +0000 (11:57 +0100)]
x86: mpparse, move disabled cpus to smpboot.c, fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move disabled_cpus to smpboot.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:57 +0000 (23:54 +0300)]
x86: move disabled_cpus to smpboot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move num_processors to smpboot.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:50 +0000 (23:54 +0300)]
x86: move num_processors to smpboot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move phys_cpu_present_map to smpboot.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:44 +0000 (23:54 +0300)]
x86: move phys_cpu_present_map to smpboot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_lapic_addr to apic_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:38 +0000 (23:54 +0300)]
x86: move mp_lapic_addr to apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move apic_ver array to apic_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:31 +0000 (23:54 +0300)]
x86: move apic_ver array to apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't use MP_processor_info for ACPI mode
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:20 +0000 (23:54 +0300)]
x86: don't use MP_processor_info for ACPI mode

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: separate generic_processor_info into its own function
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:13 +0000 (23:54 +0300)]
x86: separate generic_processor_info into its own function

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't call MP_processor_info for disabled cpu
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:06 +0000 (23:54 +0300)]
x86: don't call MP_processor_info for disabled cpu

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move es7000_plat closer to its user
Alexey Starikovskiy [Thu, 27 Mar 2008 20:53:54 +0000 (23:53 +0300)]
x86: move es7000_plat closer to its user

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add comments to describe the new api's in cacheflush.h
Arjan van de Ven [Thu, 17 Apr 2008 15:41:31 +0000 (17:41 +0200)]
x86: add comments to describe the new api's in cacheflush.h

The new cacheflush.h API's didn't have any comments describing
how they're to be used yet and the conventions around these functions.
This patch adds comments to this effect; in order for that to be
a logical series, some prototypes had to move around.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: Centaur Isaiah processor to use sysenter in 64-bit compatibility mode rather...
Dave Jones [Wed, 26 Mar 2008 16:09:16 +0000 (12:09 -0400)]
x86: Centaur Isaiah processor to use sysenter in 64-bit compatibility mode rather than syscall

Upcoming 64 bit processors from Centaur can use sysenter.

Signed-off-by: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Jesse Ahrens <jahrens@centtech.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: simplify sync_test_bit(), improve
Jeremy Fitzhardinge [Sat, 22 Mar 2008 20:27:38 +0000 (13:27 -0700)]
x86: simplify sync_test_bit(), improve

Using a naked parameterless macro could lead to other tokens being
unexpectedly replaced.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86 floppy: kill off the 'register' keyword from header
Jesper Juhl [Wed, 26 Mar 2008 01:16:15 +0000 (02:16 +0100)]
x86 floppy: kill off the 'register' keyword from header

When compilers became generally better at optimizing code than humans, the
register keyword became mostly useless. For the floppy driver it certainly
is since it's so slow compared to the rest of the system that optimizing
access to a single variable or two isn't going to make any real difference
So let's just leave it to the compiler - it'll do a better job anyway.

This patch does away with a few register keywords in the x86 floppy driver.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move apic declarations to mach_apic.h
Glauber Costa [Tue, 25 Mar 2008 21:10:46 +0000 (18:10 -0300)]
x86: move apic declarations to mach_apic.h

take them out of the x86_64-specific asm/mach_apic.h

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: entry_32.S - use flags from processor-flags.h
Cyrill Gorcunov [Tue, 25 Mar 2008 19:16:32 +0000 (22:16 +0300)]
x86: entry_32.S - use flags from processor-flags.h

By including processor-flags.h we are allowed to use predefined
macroses instead of keeping own ones

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: ioremap of 64-bit resource on 32-bit kernel fix
Ingo Molnar [Tue, 25 Mar 2008 07:31:17 +0000 (08:31 +0100)]
x86: ioremap of 64-bit resource on 32-bit kernel fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move ipi definitions to mach_ipi.h
Glauber Costa [Tue, 25 Mar 2008 16:28:56 +0000 (13:28 -0300)]
x86: move ipi definitions to mach_ipi.h

take them out of the x86_64-only asm/mach_apic.h

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: split large page mapping for AMD TSEG
Andi Kleen [Wed, 12 Mar 2008 02:53:32 +0000 (03:53 +0100)]
x86: split large page mapping for AMD TSEG

On AMD SMM protected memory is part of the address map, but handled
internally like an MTRR. That leads to large pages getting split
internally which has some performance implications. Check for the
AMD TSEG MSR and split the large page mapping on that area
explicitely if it is part of the direct mapping.

There is also SMM ASEG, but it is in the first 1MB and already covered by
the earlier split first page patch.

Idea for this came from an earlier patch by Andreas Herrmann

On a RevF dual Socket Opteron system kernbench shows a clear
improvement from this:
(together with the earlier patches in this series, especially the
split first 2MB patch)

[lower is better]
              no split stddev         split  stddev    delta
Elapsed Time   87.146 (0.727516)     84.296 (1.09098)  -3.2%
User Time     274.537 (4.05226)     273.692 (3.34344)  -0.3%
System Time    34.907 (0.42492)      34.508 (0.26832)  -1.1%
Percent CPU   322.5   (38.3007)     326.5   (44.5128)  +1.2%

=> About 3.2% improvement in elapsed time for kernbench.

With GB pages on AMD Fam1h the impact of splitting is much higher of course,
since it would split two full GB pages (together with the first
1MB split patch) instead of two 2MB pages.  I could not benchmark
a clear difference in kernbench on gbpages, so I kept it disabled
for that case

That was only limited benchmarking of course, so if someone
was interested in running more tests for the gbpages case
that could be revisited (contributions welcome)

I didn't bother implementing this for 32bit because it is very
unlikely the 32bit lowmem mapping overlaps into the TSEG near 4GB
and the 2MB low split is already handled for both.

[ mingo@elte.hu: do it on gbpages kernels too, there's no clear reason
                 why it shouldnt help there. ]

Signed-off-by: Andi Kleen <ak@suse.de>
Acked-by: andreas.herrmann3@amd.com
Cc: mingo@elte.hu
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: re-add rdmsrl_safe
Andi Kleen [Sat, 22 Mar 2008 09:59:28 +0000 (10:59 +0100)]
x86: re-add rdmsrl_safe

RDMSR for 64bit values with exception handling.

Makes it easier to deal with 64bit valued MSRs. The old 64bit code
base had that too as checking_rdmsrl(), but it got dropped somehow.

Signed-off-by: Andi Kleen <andi@firstfloor.org>
Cc: andreas.herrmann3@amd.com
Cc: mingo@elte.hu
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't use large pages to map the first 2/4MB of memory
Andi Kleen [Wed, 12 Mar 2008 02:53:30 +0000 (03:53 +0100)]
x86: don't use large pages to map the first 2/4MB of memory

Intel recommends to not use large pages for the first 1MB
of the physical memory because there are fixed size MTRRs there
which cause splitups in the TLBs.

On AMD doing so is also a good idea.

The implementation is a little different between 32bit and 64bit.
On 32bit I just taught the initial page table set up about this
because it was very simple to do. This also has the advantage
that the risk of a prefetch ever seeing the page even
if it only exists for a short time is minimized.

On 64bit that is not quite possible, so use set_memory_4k() a little
later (in check_bugs) instead.

Signed-off-by: Andi Kleen <ak@suse.de>
Acked-by: andreas.herrmann3@amd.com
Cc: mingo@elte.hu
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add set_memory_4k to pageattr.c
Andi Kleen [Wed, 12 Mar 2008 02:53:29 +0000 (03:53 +0100)]
x86: add set_memory_4k to pageattr.c

Add a new function to force split large pages into 4k pages.
This is needed for some followup optimizations.

I had to add a new field to cpa_data to pass down the information
that try_preserve_large_page should not run.

Right now no set_page_4k() because I didn't need it and all the
specialized users I have in mind would be more comfortable with
pure addresses. I also didn't export it because it's unlikely
external code needs it.

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: andreas.herrmann3@amd.com
Cc: mingo@elte.hu
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: account overlapped mappings in max_pfn_mapped
Andi Kleen [Wed, 12 Mar 2008 02:53:28 +0000 (03:53 +0100)]
x86: account overlapped mappings in max_pfn_mapped

When end_pfn is not aligned to 2MB (or 1GB) then the kernel might
map more memory than end_pfn. Account this in max_pfn_mapped.

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: andreas.herrmann3@amd.com
Cc: mingo@elte.hu
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: replace the now useless max_pfn_mapped define
Thomas Gleixner [Fri, 21 Mar 2008 20:27:10 +0000 (21:27 +0100)]
x86: replace the now useless max_pfn_mapped define

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: implement true end_pfn_mapped for 32bit
Andi Kleen [Wed, 12 Mar 2008 02:53:27 +0000 (03:53 +0100)]
x86: implement true end_pfn_mapped for 32bit

Even on 32bit 2MB pages can map more memory than is in the true
max_low_pfn if end_pfn is not highmem and not aligned to 2MB.
Add a end_pfn_map similar to x86-64 that accounts for this
fact. This is important for code that really needs to know about
all mapping aliases.

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: andreas.herrmann3@amd.com
Cc: mingo@elte.hu
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move early exception handlers into init.text
Andi Kleen [Tue, 11 Mar 2008 01:23:21 +0000 (02:23 +0100)]
x86: move early exception handlers into init.text

Currently they are in .text.head because the rest of head_64.S.
.text.head is not removed as init data, but the early exception handlers
should be because they are not needed after early boot of the BP.
So move them over.

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: mingo@elte.hu
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: replace early exception setup macro recursion with loop
Andi Kleen [Tue, 11 Mar 2008 01:23:22 +0000 (02:23 +0100)]
x86: replace early exception setup macro recursion with loop

The early exception handlers are currently set up using a macro
recursion. There is only one user left. Replace the macro with a
standard loop in place.

Noop patch, just a cleanup.

[ tglx@linutronix.de: simplified ]

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: mingo@elte.hu
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't set up early exception handlers for external interrupts
Andi Kleen [Tue, 11 Mar 2008 01:23:20 +0000 (02:23 +0100)]
x86: don't set up early exception handlers for external interrupts

All of early setup runs with interrupts disabled, so there is no
need to set up early exception handlers for vectors >= 32

This saves some minor text size.

Signed-off-by: Andi Kleen <ak@suse.de>
Cc: mingo@elte.hu
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: relocate_kernel - use predefined macroses for page attributes
gorcunov@gmail.com [Sat, 22 Mar 2008 21:00:09 +0000 (00:00 +0300)]
x86: relocate_kernel - use predefined macroses for page attributes

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: relocate_kernel - use predefined macroses for processor state
gorcunov@gmail.com [Sat, 22 Mar 2008 21:00:08 +0000 (00:00 +0300)]
x86: relocate_kernel - use predefined macroses for processor state

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: relocate_kernel - use PAGE_SIZE instead of numeric constant
gorcunov@gmail.com [Sat, 22 Mar 2008 21:00:07 +0000 (00:00 +0300)]
x86: relocate_kernel - use PAGE_SIZE instead of numeric constant

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: relocate_kernel_32.S - clear register in more elegant way
gorcunov@gmail.com [Sat, 22 Mar 2008 21:00:06 +0000 (00:00 +0300)]
x86: relocate_kernel_32.S - clear register in more elegant way

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix test_poke for vmalloced pages
Mathieu Desnoyers [Wed, 12 Mar 2008 15:54:16 +0000 (11:54 -0400)]
x86: fix test_poke for vmalloced pages

* Ingo Molnar (mingo@elte.hu) wrote:
>
> * Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
>
> > The shadow vmap for DEBUG_RODATA kernel text modification uses
> > virt_to_page to get the pages from the pointer address.
> >
> > However, I think vmalloc_to_page would be required in case the page is
> > used for modules.
> >
> > Since only the core kernel text is marked read-only, use
> > kernel_text_address() to make sure we only shadow map the core kernel
> > text, not modules.
>
> actually, i think we should mark module text readonly too.
>

Yes, but in the meantime, the x86 tree would need this patch to make
kprobes work correctly on modules.

I suspect that without this fix, with the enhanced hotplug and kprobes
patch, kprobes will use text_poke to insert breakpoints in modules
(vmalloced pages used), which will map the wrong pages and corrupt
random kernel locations instead of updating the correct page.

Work that would write protect the module pages should clearly be done,
but it can come in a later time. We have to make sure we interact
correctly with the page allocation debugging, as an example.

Here is the patch against x86.git 2.6.25-rc5 :

The shadow vmap for DEBUG_RODATA kernel text modification uses virt_to_page to
get the pages from the pointer address.

However, I think vmalloc_to_page would be required in case the page is used for
modules.

Since only the core kernel text is marked read-only, use kernel_text_address()
to make sure we only shadow map the core kernel text, not modules.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: akpm@linux-foundation.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: clean up vSMP detection
Ravikiran G Thirumalai [Mon, 24 Mar 2008 21:48:36 +0000 (14:48 -0700)]
x86: clean up vSMP detection

vSMP detection: access pci config space early in boot to detect if the
system is a vSMPowered box, and cache the result in a flag, so that
is_vsmp_box() retrieves the value of the flag always.

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: pgtable, document pde bits
Jiri Slaby [Sat, 22 Mar 2008 17:50:22 +0000 (18:50 +0100)]
x86: pgtable, document pde bits

Some of pde bits weren't documented, add the short description to them.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: spinlock ops are always-inlined
Ingo Molnar [Fri, 29 Feb 2008 09:29:38 +0000 (10:29 +0100)]
x86: spinlock ops are always-inlined

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: only enable interrupts when kernel state has been set up
Jeremy Fitzhardinge [Mon, 24 Mar 2008 23:43:21 +0000 (16:43 -0700)]
x86: only enable interrupts when kernel state has been set up

The sysenter path tries to enable interrupts immediately.  Unfortunately
this doesn't work in a paravirt environment, because not enough kernel
state has been set up at that point (namely, pointing %fs to the kernel
percpu data segment).  To fix this, defer ENABLE_INTERRUPTS until after
the kernel state has been set up.

Unfortunately this means that we're running with interrupts disabled
for a while without calling the IRQ tracing code, but that can't be
called without setting up %fs either.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/xor_64.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:04:03 +0000 (01:04 -0700)]
include/asm-x86/xor_64.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/xor_32.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:04:02 +0000 (01:04 -0700)]
include/asm-x86/xor_32.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/voyager.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:04:00 +0000 (01:04 -0700)]
include/asm-x86/voyager.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/vmi.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:59 +0000 (01:03 -0700)]
include/asm-x86/vmi.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/vm86.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:58 +0000 (01:03 -0700)]
include/asm-x86/vm86.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/vga.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:57 +0000 (01:03 -0700)]
include/asm-x86/vga.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/vdso.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:56 +0000 (01:03 -0700)]
include/asm-x86/vdso.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/user_64.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:55 +0000 (01:03 -0700)]
include/asm-x86/user_64.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/user32.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:54 +0000 (01:03 -0700)]
include/asm-x86/user32.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/user_32.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:53 +0000 (01:03 -0700)]
include/asm-x86/user_32.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/unistd_64.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:52 +0000 (01:03 -0700)]
include/asm-x86/unistd_64.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/unistd_32.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:51 +0000 (01:03 -0700)]
include/asm-x86/unistd_32.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/unaligned.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:50 +0000 (01:03 -0700)]
include/asm-x86/unaligned.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/uaccess_64.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:49 +0000 (01:03 -0700)]
include/asm-x86/uaccess_64.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/uaccess_32.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:48 +0000 (01:03 -0700)]
include/asm-x86/uaccess_32.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/tsc.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:47 +0000 (01:03 -0700)]
include/asm-x86/tsc.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoinclude/asm-x86/topology.h: checkpatch cleanups - formatting only
Joe Perches [Sun, 23 Mar 2008 08:03:46 +0000 (01:03 -0700)]
include/asm-x86/topology.h: checkpatch cleanups - formatting only

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>