History log of /arch/s390/kernel/setup.c
Revision Date Author Comments
8070361799ae1e3f4ef347bd10f0a508ac10acfb 06-Oct-2014 Martin Schwidefsky <schwidefsky@de.ibm.com> s390: add support for vector extension

The vector extension introduces 32 128-bit vector registers and a set of
instruction to operate on the vector registers.

The kernel can control the use of vector registers for the problem state
program with a bit in control register 0. Once enabled for a process the
kernel needs to retain the content of the vector registers on context
switch. The signal frame is extended to include the vector registers.
Two new register sets NT_S390_VXRS_LOW and NT_S390_VXRS_HIGH are added
to the regset interface for the debugger and core dumps.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
242a112af62ea73ce507cbe76c2c944c23b6a1e3 26-Sep-2014 Martin Schwidefsky <schwidefsky@de.ibm.com> s390/setup: correct 4-level kernel page table detection

Fix calculation to decide if a 4-level kernel page table is required.
Git commit c972cc60c23f5a63 "s390/vmalloc: have separate modules area"
added the separate module area which reduces the size of the vmalloc
area but fails to take it into account for the 3 vs 4 level page table
decision.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
bcfcbb6bae649c870037cc8c4e2685b2a8927c3d 11-Aug-2014 Martin Schwidefsky <schwidefsky@de.ibm.com> s390: add system information as device randomness

The virtual-machine cpu information data block and the cpu-id of
the boot cpu can be used as source of device randomness.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
bd858e84d4a179c3030dccba56efb6a93e455c10 10-Jul-2014 Michael Holzheu <holzheu@linux.vnet.ibm.com> s390/kdump: Return NOTIFY_OK for all actions other than MEM_GOING_OFFLINE

We only have to check kdump memory for the MEM_GOING_OFFLINE action.
Therefore skip the test and return NOTIFY_OK for all other memory
hotplug actions.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
bf28a5970de3a349ec05cea45ca5272404b6609f 14-Apr-2014 Michael Holzheu <holzheu@linux.vnet.ibm.com> s390/dump: Remove CONFIG_ZFCPDUMP

Currently there are two s390 kernel dump config options "CONFIG_ZFCPDUMP"
and "CONFIG_CRASH_DUMP". In order to keep things simple and because the
"CONFIG_ZFCPDUMP" option already has a dependency to "CONFIG_CRASH_DUMP"
remove the CONFIG_ZFCPDUMP option.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Eric Farman <farman@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
6c8cd5bbda7e6be166cf2e2dd4be5890193e17ac 07-Apr-2014 Philipp Hachtmann <phacht@linux.vnet.ibm.com> s390/spinlock: optimize spinlock code sequence

Use lowcore constant to improve the code generated for spinlocks.

[ Martin Schwidefsky: patch breakdown and code beautification ]

Signed-off-by: Philipp Hachtmann <phacht@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
50be634507284eea38df78154d22615d21200b42 29-Jan-2014 Philipp Hachtmann <phacht@linux.vnet.ibm.com> s390/mm: Convert bootmem to memblock

The original bootmem allocator is getting replaced by memblock. To
cover the needs of the s390 kdump implementation the physical memory
list is used.
With this patch the bootmem allocator and its bitmaps are completely
removed from s390.

Signed-off-by: Philipp Hachtmann <phacht@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
a960062e5826b88e75c3999db6e5997092da519b 08-Apr-2014 Heiko Carstens <heiko.carstens@de.ibm.com> s390: add 31 bit warning message

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
7385d0a550813c912094c5df22aeeb463712300e 27-Jan-2014 Heiko Carstens <heiko.carstens@de.ibm.com> s390/uaccess: remove dead kernel parameter 'user_mode='

Remove another leftover from the time when we supported running
user space in either home or primary address space.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
4f41c2b4567dbfb7ff93e5c552b869e2865bcd9d 23-Jan-2014 Heiko Carstens <heiko.carstens@de.ibm.com> s390/uaccess: get rid of indirect function calls

There are only two uaccess variants on s390 left: the version that is used
if the mvcos instruction is available, and the page table walk variant.
So there is no need for expensive indirect function calls.

By default the mvcos variant will be called. If the mvcos instruction is not
available it will call the page table walk variant.

For minimal performance impact the "if (mvcos_is_available)" is implemented
with a jump label, which will be a six byte nop on machines with mvcos.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
b4a960159e6f5254ac3c95dd183789f402431977 13-Dec-2013 Hendrik Brueckner <brueckner@linux.vnet.ibm.com> s390: Fix misspellings using 'codespell' tool

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
d80512f87474f2dfd67ef931737659acce20fe69 16-Dec-2013 Heiko Carstens <heiko.carstens@de.ibm.com> s390/smp: improve setup of possible cpu mask

Since under z/VM we cannot have more than 64 cpus, make sure the
cpu_possible_mask does not contain more bits.
This avoids wasting memory for dynamic per-cpu allocations if
CONFIG_NR_CPUS is larger than 64.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
e657d8fe2faf49ed5d35e2325bd0f1712b8058cd 13-Nov-2013 Michael Holzheu <holzheu@linux.vnet.ibm.com> s390/sclp: Determine HSA size dynamically for zfcpdump

Currently we have hardcoded the HSA size to 32 MiB. With this patch the
HSA size is determined dynamically via SCLP in early.c.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
e258d719ff28ecc7a048eb8f78380e68c4b3a3f0 24-Sep-2013 Martin Schwidefsky <schwidefsky@de.ibm.com> s390/uaccess: always run the kernel in home space

Simplify the uaccess code by removing the user_mode=home option.
The kernel will now always run in the home space mode.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
594712276e737961d30e11eae80d403b2b3815df 24-Jul-2013 Heiko Carstens <heiko.carstens@de.ibm.com> s390: add support for IBM zBC12 machine

Just add the new model number where appropiate.

Cc: stable@vger.kernel.org # v3.10
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
8bdc237ac113dd42a1c977c8cd3a65a82f774d5e 04-Jul-2013 Zhang Yanfei <zhangyanfei@cn.fujitsu.com> s390: remove setting for saved_max_pfn

The only user of saved_max_pfn in s390 is read_oldmem interface but we
have removed that interface, so saved_max_pfn is now unneeded in s390, and
we needn't set it anymore.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Matt Fleming <matt.fleming@intel.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
996b4a7d8f4e5dd531369396f2312b97e9400cdc 30-Apr-2013 Heiko Carstens <heiko.carstens@de.ibm.com> s390/mem_detect: remove artificial kdump memory types

Simplify the memory detection code a bit by removing the CHUNK_OLDMEM
and CHUNK_CRASHK memory types.
They are not needed. Everything that is needed is a mechanism to
insert holes into the detected memory.

Reviewed-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
df1bd59c5cc247d1d02588ff0a4e86a0cc5f9733 30-Apr-2013 Heiko Carstens <heiko.carstens@de.ibm.com> s390/mem_detect: limit memory detection loop to "mem=" parameter

The current memory detection loop will detect all present memory of
a machine. This is true even if the user specified the "mem=" parameter
on the kernel command line.
This can be a problem since the memory detection may cause a fully
populated host page table for the guest, even for those parts of the
memory that the guest will never use afterwards.

So fix this and only detect memory up to a user supplied "mem=" limit
if specified.

Reported-by: Michael Johanssen <johanssn@de.ibm.com>
Reviewed-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
67b5c3eeb4814bceb9a7e17fecb14ef59d511812 30-Apr-2013 Heiko Carstens <heiko.carstens@de.ibm.com> s390/kdump,bootmem: fix bootmem allocator bitmap size

When in kdump mode the kernel may access only the first couple of
megabytes for execution, the rest contains the dump. However
the size of the bitmap used by the bootmem allocator was calculated
for the whole amount of memory of the machine.

For very large machines this can lead to the situation that the kdump
kernel will not come up because not enough memory is available.

So fix this and calculate the size of the bitmap only for the piece
of memory that the kdump kernel actually uses.

Call reserve_oldmem() before setup_memory_end() so that the memory_chunk
array already has been updated with respect to oldmem chunks.
Afterwards setup_memory_end() will ignore those chunks.

Reviewed-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
118131a2d588f4a0fb74d0f2aa7d339a03b2f64c 29-Apr-2013 Heiko Carstens <heiko.carstens@de.ibm.com> s390: get rid of odd global real_memory_size

The variable real_memory_size has odd semantics and has been used in
a broken way by e.g. the old kvm code.
Therefore get rid of it before anybody else makes use of it.

Reviewed-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
fe72ffba3eaf4f07933dc2047be934290113d357 30-Apr-2013 Sebastian Ott <sebott@linux.vnet.ibm.com> s390/zfcpdump: exploit new cio_ignore keywords

Use the 'ipldev' and 'condev' cio_ignore keywords to setup the
command line for zfcpdump.

Reviewed-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
dc7ee00d4771b3218b10e09e1071ee6eb176d381 24-Apr-2013 Martin Schwidefsky <schwidefsky@de.ibm.com> s390: lowcore stack pointer offsets

Store the stack pointers in the lowcore for the kernel stack, the async
stack and the panic stack with the offset required for the first user.
This avoids an unnecessary add instruction on the system call path.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
a7bb1ae749e8051434e54936dcefd37ef1cfa753 28-Feb-2013 Heiko Carstens <heiko.carstens@de.ibm.com> s390/mm: fix vmemmap size calculation

The size of the vmemmap must be a multiple of PAGES_PER_SECTION, since the
common code always initializes the vmemmap in such pieces.
So we must round up in order to not have a too small vmemmap.

Fixes an IPL crash on 31 bit with more than 1920MB.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
0872922f5dc24783101a2dd111ee406ea965a094 07-Jan-2013 Heiko Carstens <heiko.carstens@de.ibm.com> s390/pm: export pm_power_off

Export pm_power_off symbol. Needed by at least one of the new device
drivers that come with CONFIG_PCI.
And all other architectures export that symbol as well.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
991c15053a3fc209d76f03c73d4f0621025c9452 13-Nov-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390: add zEC12 code generation support

Allow to generate code that only runs on zEC12 machines.

Also add a check which prevents the kernel to run on machines which
do not have any of the following new facilities installed:

- (48) decimal-floating-point zoned-conversion
- (49) execution-hint
- (49) load-and-trap
- (49) miscellaneous-instruction-extensions
- (49) processor-assist
- (50) constrained transactional-execution
- (73) transactional-execution

48, 49, 50 and 73 are the bit numbers of the facility indications for
each of the required facilities.

Note that we assume that user-space gets compiled with the same
compiler options, therefore we also test for a dfp facility even
if the kernel doesn't make use of it.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
6b70a92080be508e16b2f53efba39e5155eff809 02-Nov-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/memory hotplug: use pfmf instruction to initialize storage keys

Move and rename init_storage_keys() to pageattr.c, so it can also be
used from the sclp memory hotplug code in order to initialize
storage keys.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
c972cc60c23f5a6309292bfcc91a441743ba027e 05-Oct-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/vmalloc: have separate modules area

Add a special module area on top of the vmalloc area, which may be only
used for modules and bpf jit generated code.
This makes sure that inter module branches will always happen without a
trampoline and in addition having all the code within a 2GB frame is
branch prediction unit friendly.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
85e9d0e5ffabfede5facbac5b0d9b90768bc6e90 27-Sep-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/mm: use pfmf instruction to initialize storage keys

Make use of the pfmf instruction, if available, to initialize storage keys
of whole 1MB or 2GB frames instead of initializing every single page with
the sske instruction.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
0ed23b3e495807809873bb607d12c857ae9ab7c2 17-Sep-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/kexec: remove CONFIG_KEXEC

Since "Kconfig: split the s390 base menu" CONFIG_KEXEC gets always selected.
Therefore there is no point in keeping CONFIG_KEXEC anywhere.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
bad4c9c82d7ecb3b6ce4dbe25b7810018b52b8c1 03-Sep-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/mm: shorten addressing mode initialization

Shorten the code for addressing mode initialization. Also add missing
__init annotations, since this code is only used during kernel initialization.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
d1b0d842c4450e410053083db837ef16532a4139 02-Sep-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/mm: rename addressing_mode to s390_user_mode

Renaming the globally visible variable "user_mode" to "addressing_mode" in
order to fix a name clash was not a good idea. (Commit 37fe1d73 "s390/mm:
rename user_mode variable to addressing_mode")
Looking at the code after a couple of weeks one thinks: addressing mode of
what?
So rename the variable again. This time to s390_user_mode. Which hopefully
makes more sense.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
3d5787c9976889bcf26cbd8f3124b91678a33275 31-Aug-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/mm: change default addressing mode

Change the default addressing mode so that user space runs in primary space
and the kernel runs in home space.
In addition remove the "switch_amode" kernel parameter so all users who
already specified they want the new default behaviour will stay in the
"switched" mode instead of in the opposite they intended.
If there is a need to switch addressing modes, this can be done with the
"user_mode" kernel parameter: user_mode=home

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
d35339a42dd1f53b0bb86cf75418a9b7cf5f0f30 31-Jul-2012 Martin Schwidefsky <schwidefsky@de.ibm.com> s390: add support for transactional memory

Allow user-space processes to use transactional execution (TX).
If the TX facility is available user space programs can use
transactions for fine-grained serialization based on the data
objects that are referenced during a transaction. This is
useful for lockless data structures and speculative compiler
optimizations.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
db2e1f43e7b2320d0450fe34e5ac4ac4d8c7708d 06-Sep-2012 Martin Schwidefsky <schwidefsky@de.ibm.com> s390/hwcaps: do not report high gprs for 31 bit kernel

The bit for high gprs in the AT_HWCAP auxiliary vector field and the
highgprs tag in the output of /proc/cpuinfo should not be set for
31 bit kernels.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
37fe1d73a449bdebc4908d04e518f5852d6c453b 27-Jul-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/mm: rename user_mode variable to addressing_mode

Fix name clash with user_mode() define which is also used in common code.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
a53c8fab3f87c995c30ac226a03af95361243144 20-Jul-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/comments: unify copyright messages and remove file names

Remove the file name from the comment at top of many files. In most
cases the file name was wrong anyway, so it's rather pointless.

Also unify the IBM copyright statement. We did have a lot of sightly
different statements and wanted to change them one after another
whenever a file gets touched. However that never happened. Instead
people start to take the old/"wrong" statements to use as a template
for new files.
So unify all of them in one go.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
fbe765680d1fe9d08187ea4dad5041a7955a2c3a 05-Jun-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/smp: make absolute lowcore / cpu restart parameter accesses more robust

Setting the cpu restart parameters is done in three different fashions:
- directly setting the four parameters individually
- copying the four parameters with memcpy (using 4 * sizeof(long))
- copying the four parameters using a private structure

In addition code in entry*.S relies on a certain order of the restart
members of struct _lowcore.

Make all of this more robust to future changes by adding a
mem_absolute_assign(dest, val) define, which assigns val to dest
using absolute addressing mode. Also the load multiple instructions
in entry*.S have been split into separate load instruction so the
order of the struct _lowcore members doesn't matter anymore.

In addition move the prototypes of memcpy_real/absolute from uaccess.h
to processor.h. These memcpy* variants are not related to uaccess at all.
string.h doesn't seem to match as well, so lets use processor.h.

Also replace the eight byte array in struct _lowcore which represents a
misaliged u64 with a u64. The compiler will always create code that
handles the misaligned u64 correctly.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
cd1834591fe9564720ac4b0193bf1c790fe89f0d 11-Jun-2012 Heinz Graalfs <graalfs@linux.vnet.ibm.com> KVM: s390: Perform early event mask processing during boot

For processing under KVM it is required to detect
the actual SCLP console type in order to set it as
preferred console.

Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
73bf463efaba6a1efe69349c6d7275d03468adf4 24-May-2012 Michael Holzheu <holzheu@linux.vnet.ibm.com> s390/kernel: Introduce memcpy_absolute() function

This patch introduces the new function memcpy_absolute() that allows to
copy memory using absolute addressing. This means that the prefix swap
does not apply when this function is used.

With this patch also all s390 kernel code that accesses absolute zero
now uses the new memcpy_absolute() function. The old and less generic
copy_to_absolute_zero() function is removed.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1e3cab2f2fbca25289094698fd1280ecfad7a8d4 30-Mar-2012 Heiko Carstens <h.carstens@de.ibm.com> [S390] Fix build errors (fallout from system.h disintegration)

Signed-off-by: Heiko Carstens <h.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
a0616cdebcfd575dcd4c46102d1b52fbb827fc29 28-Mar-2012 David Howells <dhowells@redhat.com> Disintegrate asm/system.h for S390

Disintegrate asm/system.h for S390.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-s390@vger.kernel.org
4857d4bbe9821c8d732cb84455e18e12b3d79add 11-Mar-2012 Michael Holzheu <holzheu@linux.vnet.ibm.com> [S390] kernel: Add OS info memory interface

In order to allow kdump based stand-alone dump, some information
has to be passed from the old kernel to the new dump kernel. This
is done via a the struct "os_info" that contains the following fields:
* crashkernel base and size
* reipl block
* vmcoreinfo
* init function
A pointer to os_info is stored at a well known storage location
and the whole structure as well as all fields are secured with
checksums.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
8b646bd759086f6090fe27acf414c0b5faa737f4 11-Mar-2012 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] rework smp code

Define struct pcpu and merge some of the NR_CPUS arrays into it, including
__cpu_logical_map, current_set and smp_cpu_state. Split smp related
functions to those operating on physical cpus and the functions operating
on a logical cpu number. Make the functions for physical cpus use a
pointer to a struct pcpu. This hides the knowledge about cpu addresses in
smp.c, entry[64].S and swsusp_asm64.S, thus remove the sigp.h header.

The PSW restart mechanism is used to start secondary cpus, calling a
function on an online cpu, calling a function on the ipl cpu, and for
the nmi signal. Replace the different assembler functions with a
single function restart_int_handler. The new entry point calls a function
whose pointer is stored in the lowcore of the target cpu and it can wait
for the source cpu to stop. This covers all existing use cases.

Overall the code is now simpler and there are ~380 lines less code.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
4fdf7f432cc5db9531c03b9689b36a6395935fbc 11-Mar-2012 Michael Holzheu <holzheu@linux.vnet.ibm.com> [S390] Fix gcc 4.6.0 compile warning

With gcc 4.6.0 we get a false compile warning:

arch/s390/kernel/setup.c: In function 'setup_arch':
arch/s390/kernel/setup.c:767:3: warning: 'msg' may be used
uninitialized in this function [-Wuninitialized]
arch/s390/kernel/setup.c:753:8: note: 'msg' was declared here

This patch makes gcc quiet.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
048cd4e51d24ebf7f3552226d03c769d6ad91658 27-Feb-2012 Heiko Carstens <heiko.carstens@de.ibm.com> compat: fix compile breakage on s390

The new is_compat_task() define for the !COMPAT case in
include/linux/compat.h conflicts with a similar define in
arch/s390/include/asm/compat.h.

This is the minimal patch which fixes the build issues.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ddd6f9537dee9b713b87ecdc9ac920cd1935fdef 27-Dec-2011 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] kvm: move cmf host id constant out of lowcore

There is no reason for the cpu-measurement-facility host id constant to
reside in the lowcore where space is precious. Use an entry in the literal
pool in HANDLE_SIE_INTERCEPT and a stack slot in sie64a.
While we are at it replace the id -1 with 0 to indicate host execution.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14045ebf1e1156d966a796cacad91028e01797e5 27-Dec-2011 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] add support for physical memory > 4TB

The kernel address space of a 64 bit kernel currently uses a three level
page table and the vmemmap array has a fixed address and a fixed maximum
size. A three level page table is good enough for systems with less than
3.8TB of memory, for bigger systems four page table levels need to be
used. Each page table level costs a bit of performance, use 3 levels for
normal systems and 4 levels only for the really big systems.
To avoid bloating sparse.o too much set MAX_PHYSMEM_BITS to 46 for a
maximum of 64TB of memory.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
4999023aa95a00507d3f100ea75510c5c7270f74 27-Dec-2011 Michael Holzheu <holzheu@linux.vnet.ibm.com> [S390] Remove useless newline in reserve_kdump_bootmem()

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
ff38df377cfd23472fc0de63108781ad2388efbf 08-Dec-2011 Tejun Heo <tj@kernel.org> s390: Use HAVE_MEMBLOCK_NODE_MAP

s390 used early_node_map[] just to prime free_area_init_nodes(). Now
memblock can be used for the same purpose and early_node_map[] is
scheduled to be dropped. Use memblock instead.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux-s390@vger.kernel.org
5f894cbb6890d317699aa622b4dc9d73d009cd22 01-Dec-2011 Michael Holzheu <holzheu@linux.vnet.ibm.com> [S390] kdump: Replace is_kdump_kernel() with OLDMEM_BASE check

In order to have the same behavior for kdump based stand-alone dump
as for the kexec method, the is_kdump_kernel() check (only true for
the kexec method) has to be replaced by the OLDMEM_BASE check (true
for both methods).

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
3f25dc4fcbc371f86a61a6af759003ebd4965908 14-Nov-2011 Michael Holzheu <holzheu@linux.vnet.ibm.com> [S390] zfcpdump: Do not initialize zfcpdump in kdump mode

When the kernel is started in kdump mode, zfcpdump should not be
initialized because both dump methods can't be used at the same time.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
b50511e41aa51a89b4176784a670582424bc7db6 30-Oct-2011 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] cleanup psw related bits and pieces

Split out addressing mode bits from PSW_BASE_BITS, rename PSW_BASE_BITS
to PSW_MASK_BASE, get rid of psw_user32_bits, remove unused function
enabled_wait(), introduce PSW_MASK_USER, and drop PSW_MASK_MERGE macros.
Change psw_kernel_bits / psw_user_bits to contain only the bits that
are always set in the respective mode.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
dab7a7b1538fec48790a321a58180adae79a3f3c 30-Oct-2011 Michael Holzheu <holzheu@linux.vnet.ibm.com> [S390] Add architecture code for unmapping crashkernel memory

This patch implements the crash_map_pages() function for s390.
KEXEC_CRASH_MEM_ALIGN is set to HPAGE_SIZE, in order to support
kernel mappings that use large pages. We also use HPAGE_SIZE alignment
for CONFIG_HUGETLB_PAGE=n in order to have the same 1 MiB alignment on
all s390 systems.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
d38593f9387055566b782d00d38d9a347a96e7d9 30-Oct-2011 Michael Holzheu <holzheu@linux.vnet.ibm.com> [S390] Export vmcoreinfo note

This patch defines for s390 an ABI defined pointer to the vmcoreinfo note at
a well known address. With this patch tools are able to find this information
in dumps created by stand-alone or hypervisor dump tools.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
60a0c68df2632feaa4a986af084650d1165d89c5 30-Oct-2011 Michael Holzheu <holzheu@linux.vnet.ibm.com> [S390] kdump backend code

This patch provides the architecture specific part of the s390 kdump
support.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
3a81b171429113ae0af2920f5d4ecfe571230627 03-Aug-2011 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Add support for IBM zEnterprise 114

Just fix up the Kconfig description and the elf platform.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
7dd6b3343fdc190712d1620ee8848d25c4c77c33 03-Aug-2011 Michael Holzheu <holzheu@linux.vnet.ibm.com> [S390] Add PSW restart shutdown trigger

With this patch a new S390 shutdown trigger "restart" is added. If under
z/VM "systerm restart" is entered or under the HMC the "PSW restart" button
is pressed, the PSW located at 0 (31 bit) or 0x1a0 (64 bit) bit is loaded.
Now we execute do_restart() that processes the restart action that is
defined under /sys/firmware/shutdown_actions/on_restart. Currently the
following actions are possible: reipl (default), stop, vmcmd, dump, and
dump_reipl.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
043d07084b5347a26eab0a07aa13a4a929ad9e71 23-May-2011 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] Remove data execution protection

The noexec support on s390 does not rely on a bit in the page table
entry but utilizes the secondary space mode to distinguish between
memory accesses for instructions vs. data. The noexec code relies
on the assumption that the cpu will always use the secondary space
page table for data accesses while it is running in the secondary
space mode. Up to the z9-109 class machines this has been the case.
Unfortunately this is not true anymore with z10 and later machines.
The load-relative-long instructions lrl, lgrl and lgfrl access the
memory operand using the same addressing-space mode that has been
used to fetch the instruction.
This breaks the noexec mode for all user space binaries compiled
with march=z10 or later. The only option is to remove the current
noexec support.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
25985edcedea6396277003854657b5f3cb31a628 31-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi> Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
4cc69531f91dfa1668af5e9d8efe9e3bc7b64548 23-Mar-2011 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] setup: register bss section as resource

Make kernel bss section visible via /proc/iomem like on other
architectures.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
71189284e61fd818547430186f524c1db54fb7c7 23-Mar-2011 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] setup: simplify setup_resources()

Simplify setup_resources() and make it more generic. That way it is
easier to add additional resources.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
c84b9051d6b97d8c6533a194aedcd484c003d278 29-Oct-2010 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Add z196 machine type to setup_hwcaps

Add machine type for zEnterprise 196 to elf platform detection.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14375bc4eb8dd0fb0e765390650564c35bb31068 25-Oct-2010 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] cleanup facility list handling

Store the facility list once at system startup with stfl/stfle and
reuse the result for all facility tests.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
e2b8d7af0e3a9234de06606f9151f28cf847a8d6 25-Oct-2010 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] add support for nonquiescing sske

Improve performance of the sske operation by using the nonquiescing
variant if the affected page has no mappings established. On machines
with no support for the new sske variant the mask bit will be ignored.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
215b3096371907e5d866bb219be7ef3d5ce6c083 26-May-2010 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] spp: fix compilation for CONFIG_32BIT

Fix build breakage for CONFIG_32BIT caused by cd3b70f5
"[S390] virtualization aware cpu measurement"

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
cd3b70f5d4d82f85d1e1d6e822f38ae098cf7c72 17-May-2010 Carsten Otte <cotte@de.ibm.com> [S390] virtualization aware cpu measurement

Use the SPP instruction to set a tag on entry to / exit of the virtual
machine context. This allows the cpu measurement facility to distinguish
the samples from the host and the different guests.

Signed-off-by: Carsten Otte <cotte@de.ibm.com>
6a2df3a87276cdc08fd87070d09ea18d1fb9d622 17-May-2010 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] improve irq tracing code in entry[64].S

The system call path in entry[64].S is run with interrupts enabled.
Remove the irq tracing check from the system call exit code. If a
program check interrupted a context enabled for interrupts do a
call to trace_irq_off_caller in the program check handler before
branching to the system call exit code.
Restructure the system call and io interrupt return code to avoid
avoid the lpsw[e] to disable machine checks.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
94038a99119c171aea27608f81c7ba359de98c4e 17-May-2010 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] More cleanup for struct _lowcore

Remove cpu_id from lowcore and replace addr_t with __u64.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
a08786568a7e334d8a07a7bb8f4fafa3f7afb89c 24-Mar-2010 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] smp: fix lowcore allocation

The intermediate lowcore for CONFIG_SMP is allocated using a call to
__alloc_bootmem() with a goal of 0. That however doesn't guarantee that
the allocated piece of memory is below 2GB.
Instead we should call __alloc_bootmem_low().

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
cbb870c8221147ae337612e04b2bb0211f31a74b 26-Feb-2010 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Cleanup struct _lowcore usage and defines.

Use asm offsets to make sure the offset defines to struct _lowcore and
its layout don't get out of sync.
Also add a BUILD_BUG_ON() which checks that the size of the structure
is sane.
And while being at it change those sites which use odd casts to access
the current lowcore. These should use S390_lowcore instead.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
27d71602b4a605fbb31088e69ac12187e69a9443 26-Feb-2010 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] add MACHINE_IS_LPAR flag

Introduce the MACHINE_IS_LPAR flag for code that should only be
executed if Linux is running in an LPAR.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
fb380aadfe34e8d3ce628cb3e386882351940874 13-Jan-2010 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Move __cpu_logical_map to smp.c

Finally move it to the place where it belongs to and make get rid of
it for !CONFIG_SMP.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
c6a5f8cea2e5454fce3859ca5ed381c2535184cf 13-Jan-2010 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] smp: remove volatile type quilifier from __cpu_logical_map

Remove pointless qualifier.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
02beaccc901b7a28ac1de79f3ed122f5fda220b1 13-Jan-2010 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] smp: setup smp_processor_id early

smp_processor_id() is supposed to work before setup_arch() gets called.
Before that smp_processor_id() may return just an arbitrary value that
is contained in the uninitialized boot lowcore.
So provide the arch function which will override the weak function in
init/main.c.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
bebf023d415fd8984994a596aaa83cd0a3046d0b 13-Jan-2010 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] remove superfluous TIF_USEDFPU bit

The TIF_USEDFPU bit is always 0 for s390 and it is not tested anywhere.
Remove the bit. At the same time remove the calls to clear_used_math()
as well. The PF_USED_MATH bit is never set for s390 either.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
b11b53342773361f3353b285eb6a3fd6074e7997 07-Dec-2009 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] Improve address space mode selection.

Introduce user_mode to replace the two variables switch_amode and
s390_noexec. There are three valid combinations of the old values:
1) switch_amode == 0 && s390_noexec == 0
2) switch_amode == 1 && s390_noexec == 0
3) switch_amode == 1 && s390_noexec == 1
They get replaced by
1) user_mode == HOME_SPACE_MODE
2) user_mode == PRIMARY_SPACE_MODE
3) user_mode == SECONDARY_SPACE_MODE
The new kernel parameter user_mode=[primary,secondary,home] lets
you choose the address space mode the user space processes should
use. In addition the CONFIG_S390_SWITCH_AMODE config option
is removed.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
ea2a4d3a3a929ef494952bba57a0ef1a8a877881 06-Oct-2009 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] 64-bit register support for 31-bit processes

From: Heiko Carstens <heiko.carstens@de.ibm.com>
From: Martin Schwidefsky <schwidefsky@de.ibm.com>

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
c4de0c1a18237c2727dde8ad392e333539b0af3c 11-Sep-2009 Hendrik Brueckner <brueckner@linux.vnet.ibm.com> [S390] kvm: use console_initcall() to initialize s390 virtio console

Use a console_initcall() to initialize the s390 virtio console and
clean up s390 console initialization in setup.c.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
637952ca689013339b977558061fa4ca8e07e1c1 23-Aug-2009 Hendrik Brueckner <brueckner@linux.vnet.ibm.com> [S390] set preferred console based on conmode

setup_arch() unconditionally sets the preferred console to ttyS.
This breaks the use of 3270 devices as the console. Provide a new
function to set the default preferred console for s390. The preferred
console depends on the conmode parameter that is used to switch
between 3270 and 3215 terminal/console mode.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
dfd9f7abc0fb67b5781f340d982384cea53b2884 12-Jun-2009 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] ftrace: add dynamic ftrace support

Dynamic ftrace support for s390.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
ab96e798cbd562a53edd802272e49a5100b29efb 14-Apr-2009 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] boot cputime accounting

Start the cpu time accounting very early to catch the cpu time spent
for the initial kernel setup. To make the output of /proc/uptime
match the sum of all cpu accounting values of the boot cpu reset
xtime and wall_to_monotonic to sane values based on the TOD clock.
The values set by timekeeping_init are off by up to a second.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
25097bf153391f7be4c591d47061b3dc4990dac2 14-Apr-2009 Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> [S390] s390: move machine flags to lowcore

Currently the storage of the machine flags is a globally exported unsigned
long long variable. By moving the storage location into the lowcore struct we
allow assembler code to check machine_flags directly even without needing a
register. Addtionally the lowcore and therefore the machine flags too will be
in cache most of the time.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
488253ce49714f4e9d42413c1d60b7724059a338 26-Mar-2009 Andreas Krebbel <krebbel@linux.vnet.ibm.com> [S390] Add hwcap flag for the etf3 enhancement facility

The Extended Translation Facility 3 (ETF3) added instructions which
allow conversions between different unicode character maps (UTF-8,
UTF-32 ...). These instructions got enhanced with a later version of
the ETF3 allowing malformed multibyte chars to be recognized and
reported correctly. The attached patch reserves bit 8 in the elf
hwcaps vector for the enhanced version of ETF3. The bit corresponds to
the stfle bits 22 and 30 and will only be set if both of the stfle
bits are set.

Signed-off-by: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2ac3307f275c2a91af0417e16d2cfb95ae478661 26-Mar-2009 Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> [S390] fix dfp elf hwcap/facility bit detection

The old dfp detection wanted to check bit 43 (dfp high performance), but due
to a wrong calculation always used to check bit 42. Additionally the
"userspace expectation" is, that the dfp capability bit is set is if facility
bit 42 (decimal floating point facility available) and bit 44 (perform floating
point operation facility avail).
The patch fixes the bit calculation and extends the check to work like:
elf hw cap dfp bit = facility bits 42 (dfp) & 44 (pfpo) available

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
6aa0d3a922c4f58fc36cc1502c6ac72f999e26bb 26-Mar-2009 Stoyan Gaydarov <stoyboyker@gmail.com> [S390] BUG to BUG_ON changes

Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
59f2e69d0f95bc00353628ef33fd534fbb8e3597 26-Mar-2009 Michael Holzheu <holzheu@linux.vnet.ibm.com> [S390] zfcpdump: Prevent zcore from beeing built as a kernel module.

The zcore code switches to real addressing mode when creating a kernel dump.
This is not possible, if it is built as a kernel module. With this patch
zcore (zfcpdump) can't be built as a kernel module any more.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
da292bbe1f620221b08c4b589424f370168d642b 26-Mar-2009 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] eliminate ipl_device from lowcore

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
7b4684880dfc6c45bc56039ca5eada771d7643ab 26-Mar-2009 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] eliminate cpuinfo_S390 structure

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
4b2a8b6043979f1e6cc8aaa4116c95b31ae942ec 26-Mar-2009 Gerald Schaefer <gerald.schaefer@de.ibm.com> [S390] kernel: Disable switch_amode by default

Disable switch_amode by default because pagetable walk on pre z9
hardware has negative performance impact.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1485c5c88483d200c9c4c71ed7e8eef1a1e317a1 26-Mar-2009 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] move EXPORT_SYMBOLs to definitions

Move all EXPORT_SYMBOLs to their corresponding definitions.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
099b765139929efdcf232f8870804accf8c4cdc5 26-Mar-2009 Frank Munzert <munzert@de.ibm.com> [S390] Automatic IPL after dump

Provide new shutdown action "dump_reipl" for automatic ipl after dump.

Signed-off-by: Frank Munzert <munzert@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
23d75d9cadd79bc9fd6553857d57c679cf18d4cb 19-Feb-2009 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] fix "mem=" handling in case of standby memory

Standby memory detected with the sclp interface gets always registered
with add_memory calls without considering the limitationt that the
"mem=" kernel paramater implies.
So fix this and only register standby memory that is below the specified
limit.
This fixes zfcpdump since it uses "mem=32M". In case there is appr.
2GB standby memory present all of usable memory would be used for the
struct pages needed for standby memory.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
c742b31c03f37c5c499178f09f57381aa6c70131 31-Dec-2008 Martin Schwidefsky <schwidefsky@de.ibm.com> [PATCH] fast vdso implementation for CLOCK_THREAD_CPUTIME_ID

The extract cpu time instruction (ectg) instruction allows the user
process to get the current thread cputime without calling into the
kernel. The code that uses the instruction needs to switch to the
access registers mode to get access to the per-cpu info page that
contains the two base values that are needed to calculate the current
cputime from the CPU timer with the ectg instruction.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
395d31d40cc38270dd7c024691404e2eddf0678d 25-Dec-2008 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] convert cpu related printks to pr_xxx macros.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
3b6ed4ab48be2110aa93d9828783bfe86193331d 25-Dec-2008 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] convert setup printks to pr_xxx macros.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
0946100f566d04cc93e86654f3ba588ee94b3f4c 25-Dec-2008 Hendrik Brueckner <brueckner@linux.vnet.ibm.com> [S390] s390/setup: set default preferred console device "ttyS"

This patch sets the default console device for s390.

The console= kernel parameter can be still used to switch the preferred
console to some other device. In that case, console messages are also
printed on the default console device (ttyS0).

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
9fee8db222a344b9ee407fad9c652ed823690788 25-Dec-2008 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] add new machine types to setup_hwcaps.

Add the machine types for z9-bc, z10-ec and z10-bc to the elf_platform
detection in setup_hwcaps.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
320c04c068c62b71fe9ea55e06e4968b4edc9e48 25-Dec-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Move stfle to header file.

stfle will be needed by the ap_bus module to figure out wether the AP
queue adapter interruption facility is installed.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
fb2e7c5e33b341699f139b2ed972dca0a463a670 14-Nov-2008 Gerald Schaefer <gerald.schaefer@de.ibm.com> [S390] Fix range for add_active_range() in setup_memory()

add_active_range() expects start_pfn + size as end_pfn value, i.e. not
the pfn of the last page frame but the one behind that.
We used the pfn of the last page frame so far, which can lead to a
BUG_ON in move_freepages(), when the kernelcore parameter is specified
(page_zone(start_page) != page_zone(end_page)).

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
faeba830b086bc9e58748869054e994cb09693cd 20-Jun-2008 Christian Borntraeger <borntraeger@de.ibm.com> s390: use virtio_console for KVM on s390

This patch enables virtio_console as the default console on kvm for
s390. We currently use the same notify hack as lguest for early
console output. I will try to address this for lguest and s390 later.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1d030370f09036e8dcb3cc40915f3f9cf92bb54c 14-Jul-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Remove P390 support.

Most likely it is broken anyway because of the changes in memory
detection. Since we can't test it and there are probably better ways
that using a P390 card, remove support for it.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
23d1742179170b69e61ac9166248ffd64857e55a 14-Jul-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Move memory detection code to own file.

Move memory detection code to own file and also simplify it.
Also add an interface which can be called at any time to get the
current memory layout. This interface is needed by our kernel
internal system dumper.

Cc: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Cc: Michael Holzheu <holzheu@de.ibm.com>
Cc: Frank Munzert <munzert@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
a0443fbb467af5e5930b9b059b52190605f70059 14-Jul-2008 Hendrik Brueckner <brueckner@linux.vnet.ibm.com> [S390] Extra Kernel Parameters via VMPARM

Now it is possible to specify additional kernel parameters on the IPL
command line using the IPL PARM option.
If the Linux system is already running, the new reipl sysfs attribute
'parm' can be used to change kernel parameters for the next reboot.
Examples:
IPL C PARM dasd=1234 root=/dev/dasda1
IPL 1234 PARM savesys=mylnxnss
echo "init=/bin/bash" > /sys/firmware/reipl/ccw/parm

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
b4a33acb690525c5ca37e177f5cd26c62d3ef976 14-Jul-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Remove ipldelay kernel parameter.

Using the ipldelay kernel parameter leads to a crash at IPL time.
Since this is broken since a long time it looks like nobody is using
it anymore. So remove it instead of fixing it.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
53492b1de46a7576170e865062ffcfc93bb5650b 30-Apr-2008 Gerald Schaefer <geraldsc@de.ibm.com> [S390] System z large page support.

This adds hugetlbfs support on System z, using both hardware large page
support if available and software large page emulation on older hardware.
Shared (large) page tables are implemented in software emulation mode,
by using page->index of the first tail page from a compound large page
to store page table information.

Signed-off-by: Gerald Schaefer <geraldsc@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2e5061e40af88070984e3769eafb5a06022375fd 30-Apr-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Convert machine feature detection code to C.

From: Heiko Carstens <heiko.carstens@de.ibm.com>
From: Carsten Otte <cotte@de.ibm.com>

This lets us use defines for the magic bits in machine flags instead
of using plain numbers all over the place.
In addition on newer machines features/facilities are indicated by the
result of the stfl instruction. So we use these bits instead of trying
to execute new instructions and check wether we get an exception or
not.
Also the mvpg instruction is always available when in zArch mode,
whereas the idte instruction is only available in zArch mode. This
results in some minor optimizations.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
484875b11f355b1b54d508a3f4671888f07e643c 30-Apr-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Move stfl to system.h and delete duplicated version.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
fa5877439d5a062d91c3abd5a690483bbdb4268e 25-Mar-2008 Carsten Otte <cotte@de.ibm.com> s390: KVM guest: detect when running on kvm

This patch adds functionality to detect if the kernel runs under the KVM
hypervisor. A macro MACHINE_IS_KVM is exported for device drivers. This
allows drivers to skip device detection if the systems runs non-virtualized.
We also define a preferred console to avoid having the ttyS0, which is a line
mode only console.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
402b08622d9ac6e32e25289573272e0f21bb58a7 25-Mar-2008 Carsten Otte <cotte@de.ibm.com> s390: KVM preparation: provide hook to enable pgstes in user pagetable

The SIE instruction on s390 uses the 2nd half of the page table page to
virtualize the storage keys of a guest. This patch offers the s390_enable_sie
function, which reorganizes the page tables of a single-threaded process to
reserve space in the page table:
s390_enable_sie makes sure that the process is single threaded and then uses
dup_mm to create a new mm with reorganized page tables. The old mm is freed
and the process has now a page status extended field after every page table.

Code that wants to exploit pgstes should SELECT CONFIG_PGSTE.

This patch has a small common code hit, namely making dup_mm non-static.

Edit (Carsten): I've modified Martin's patch, following Jeremy Fitzhardinge's
review feedback. Now we do have the prototype for dup_mm in
include/linux/sched.h. Following Martin's suggestion, s390_enable_sie() does now
call task_lock() to prevent race against ptrace modification of mm_users.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Avi Kivity <avi@qumranet.com>
5a62b192196af9a798e2f2f4c6a1324e7edf2f4b 17-Apr-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Convert s390 to GENERIC_CLOCKEVENTS.

This way we get rid of s390's NO_IDLE_HZ and use the generic dynticks
variant instead. In addition we get high resolution timers for free.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
dbd70fb499952d0ba282f0159dafacfc31d50313 17-Apr-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] cpu topology support for s390.

Add s390 backend so we can give the scheduler some hints about the
cpu topology.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
7b758389a29cb7f456ec2d27b7a08cb3cc4e1f1c 17-Apr-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Export stfle.

Make stfle visible so other code can call this.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
0c1f1dcd8c7792aeff6ef62e9508b0041928ab87 09-Feb-2008 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] Remove a.out header file.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
72a7fe3967dbf86cb34e24fbf1d957fe24d2f246 07-Feb-2008 Bernhard Walle <bwalle@suse.de> Introduce flags for reserve_bootmem()

This patchset adds a flags variable to reserve_bootmem() and uses the
BOOTMEM_EXCLUSIVE flag in crashkernel reservation code to detect collisions
between crashkernel area and already used memory.

This patch:

Change the reserve_bootmem() function to accept a new flag BOOTMEM_EXCLUSIVE.
If that flag is set, the function returns with -EBUSY if the memory already
has been reserved in the past. This is to avoid conflicts.

Because that code runs before SMP initialisation, there's no race condition
inside reserve_bootmem_core().

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: fix powerpc build]
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Cc: <linux-arch@vger.kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
0189103c69f47712a0c542a8bc28ff46ebe53a8a 05-Feb-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Remove BUILD_BUG_ON() in vmem code.

Remove BUILD_BUG_ON() in vmem code since it causes build failures if
the size of struct page increases. Instead calculate at compile time
the address of the highest physical address that can be added to the
1:1 mapping.
This supposed to fix a build failure with the page owner tracking leak
detector patches as reported by akpm.

page-owner-tracking-leak-detector-broken-on-s390.patch can be removed
from -mm again when this is merged.

Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
8c0933eeb701eb8f526d88b1915af7bb35748e7b 05-Feb-2008 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] console: allow vt220 console to be the only console

Fix console detection logic to support configurations in which the
vt220 console is the only available Linux console.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2bc89b5ece48dc888734e8760ba5ad8566431912 05-Feb-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Fix couple of section mismatches.

Fix couple of section mismatches. And since we touch the code
anyway change the IPL code to use C99 initializers.

Cc: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
5c81cdbeff72e7fc2eb62ee5dc26197e54f9a06c 26-Jan-2008 Jan Engelhardt <jengelh@computergmbh.de> [S390] constify function pointer tables.

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
99ca4e582d4a4088969681efff97be44d98421a1 26-Jan-2008 Michael Holzheu <holzheu@de.ibm.com> [S390] kernel: Shutdown Actions Interface

In case of a kernel panic it is currently possible to specify that a dump
should be created, the system should be rebooted or stopped. Virtual sysfs
files under the directory /sys/firmware/ are used for that configuration.
In addition to that, there are kernel parameters 'vmhalt', 'vmpoff'
and 'vmpanic', which can be used to specify z/VM commands, which are
automatically executed in case of halt, power off or a kernel panic.
This patch combines both functionalities and allows to specify the z/VM CP
commands also via sysfs attributes. In addition to that, it enhances the
existing handling of shutdown triggers (e.g. halt or panic) and associated
shutdown actions (e.g. dump or reipl) and makes it more flexible.

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
48483b3290988952a593c6e66ca354c19f1a4350 26-Jan-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Get rid of additional_cpus kernel parameter.

It caused only a lot of confusion. From now on cpu hotplug of up to
NR_CPUS will work by default. If somebody wants to limit that then
the possible_cpus parameter can be used.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
9f4b0ba81f158df459fa2cfc98ab1475c090f29c 26-Jan-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Get rid of HOLES_IN_ZONE requirement.

Align everything to MAX_ORDER so we can get rid of the extra checks.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
5fd9c6e214547a32d3da6ee4284c79004d667bc8 26-Jan-2008 Christian Borntraeger <borntraeger@de.ibm.com> [S390] Change vmalloc defintions

Currently the vmalloc area starts at a dynamic address depending on
the memory size. There was also an 8MB security hole after the
physical memory to catch out-of-bounds accesses.
We can simplify the code by putting the vmalloc area explicitely at
the top of the kernel mapping and setting the vmalloc size to a fixed
value of 128MB/128GB for 31bit/64bit systems. Part of the vmalloc
area will be used for the vmem_map. This leaves an area of 96MB/1GB
for normal vmalloc allocations.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
08d07968277cd898c88bf12b7720d89c02c4f139 26-Jan-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Standby cpu activation/deactivation.

Add a new interface so that cpus can be put into standby state and
configured state.
Only offline cpus can be put into standby state or configured state.
For that the new percpu sysfs attribute "configure" must be used.
To put a cpu in standby state a "0" must be written to the attribute.
In order to switch it into configured state a "1" must be written to
the attribute.
Only cpus in configured state can be brought online.
In addition this patch introduces a static mapping of physical to
logical cpus. As a result only the sysfs directories of present cpus
will be created. To scan for new cpus the new sysfs attribute "rescan"
must be used.
Writing to /sys/devices/system/cpu/rescan will trigger a rescan of
cpus and will create directories for new cpus.

On IPL only configured cpus will be used. And on reboot/shutdown all
cpus will remain in their current state (configured/standby).

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
7af0d6f753f5adf773f99470666b50490d3379f1 04-Dec-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Make sure the restore psw masks are initialized.

In case of TRACE_IRQFLAGS the restore psw masks will not be
initialized if noexec is turned on. This will lead to an
immediate system crash.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
411788ea7fca01ee803af8225ac35807b4d02050 20-Nov-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Fix irq tracing and lockdep_sys_exit calls.

Current support for TRACE_IRQFLAGS and lockdep_sys_exit is broken.
IRQ flag tracing is broken for program checks. Even worse is that
the newly introduced calls to lockdep_sys_exit are in the critical
section code which is not supposed to call any C functions. In
addition the checks if locks are still held are also done when
returning to kernel code which is broken as well.
Fix all this by disabling interrupts and machine checks at the
exit paths and then do the appropriate checks and calls.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
7aa8dac7ac68f5c2293e2ecf5ef542aa849f541f 20-Nov-2007 Christian Borntraeger <borntraeger@de.ibm.com> [S390] magic sysrq: check for in_atomic before doing an console_unblank

When doing an magic sysrq reboot on s390 the following bug message
appears:

SysRq : Resetting
BUG: sleeping function called from invalid context at include/asm/semaphore.h:61

in_atomic():1, irqs_disabled():0
07000000004002a8 000000000fe6bc48 0000000000000002 0000000000000000
000000000fe6bce8 000000000fe6bc60 000000000fe6bc60 000000000012a79a
0000000000000000 07000000004002a8 0000000000000006 0000000000000000
0000000000000000 000000000fe6bc48 000000000000000d 000000000fe6bcb8
00000000004000c8 0000000000103234 000000000fe6bc48 000000000fe6bc90
Call Trace:
(¬<00000000001031b2>| show_trace+0x12e/0x148)
¬<000000000011ffca>| __might_sleep+0x10a/0x118
¬<0000000000129fba>| acquire_console_sem+0x92/0xf4
¬<000000000012a2ca>| console_unblank+0xc2/0xc8
¬<0000000000107bb4>| machine_restart+0x54/0x6c
¬<000000000028e806>| sysrq_handle_reboot+0x26/0x30
¬<000000000028e52a>| __handle_sysrq+0xa6/0x180
¬<0000000000140134>| run_workqueue+0xcc/0x18c
¬<000000000014029a>| worker_thread+0xa6/0x108
¬<00000000001458e4>| kthread+0x64/0x9c
¬<0000000000106f0e>| kernel_thread_starter+0x6/0xc
¬<0000000000106f08>| kernel_thread_starter+0x0/0xc

The only reason for doing a console_unblank on s390 is to flush the
log buffer. We have to check for in_atomic before doing a
console_unblank as the console is otherwise filled with an unrelated
bug message.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
0a71a312437d444e1a45317823fda8160df37ee4 19-Jun-2007 Michael Holzheu <holzheu@de.ibm.com> [S390] Missing blank when appending cio_ignore kernel parameter

When appending the 'cio_ignore' kernel parameter to the command line, a blank
has to be inserted in order to separate 'cio_ignore' from the preceding kernel
parameters.

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
ea1f4eece943968940a399c72c1ca675d51e466e 31-May-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Fix section annotations.

Use the __cpuinit instead of __devinit section annotations for code
that deals with cpu hotplug. In addition add some more annotations on
functions that have been left out so far.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
cf8ba7a95511b86608acb481ad96219fe2da4b3a 04-May-2007 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] add hardware capability support (ELF_HWCAP).

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
d4ee453bcfcc0ce76de8522e099868dc440cba23 04-May-2007 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] Export uaccess as non-gpl symbol.

Commit c1821c2e9711adc3cd298a16b7237c92a2cee78d introduced the
uaccess structure that is used to select the correct set of user
copy functions for the different execution modes (standard vs.
noexec vs. z9 optimized user copy). The uaccess symbol is exported
with EXPORT_SYMBOL_GPL. This breaks all non-gpl modules that use
user copy. To make them work again change the export to
EXPORT_SYMBOL.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
411ed3225733dbd83b4cbaaa992ef80d6ec1534e 27-Apr-2007 Michael Holzheu <holzheu@de.ibm.com> [S390] zfcpdump support.

s390 machines provide hardware support for creating Linux dumps on SCSI
disks. For creating a dump a special purpose dump Linux is used. The first
32 MB of memory are saved by the hardware before the dump Linux is
booted. Via an SCLP interface, the saved memory can be accessed from
Linux. This patch exports memory and registers of the crashed Linux to
userspace via a debugfs file. For more information refer to
Documentation/s390/zfcpdump.txt, which is included in this patch.

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
615b04b301fd4e1b7680a498b873c4ae9baad92f 21-Feb-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] nss: Free unused memory in kernel image.

With CONFIG_SHARED_KERNEL the kernel text segment that might be in a
read only memory sections starts at 1MB. Memory between 0x12000 and
0x100000 is unused then. Free this, so we have appr. an extra MB
of memory available.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
46b05d2617c8efd8ec6b19acd2c95541a0118c13 21-Feb-2007 Michael Holzheu <holzheu@de.ibm.com> [S390] New header file ipl.h

Setup.h has been misused for ipl related stuff in the past. We now move
everything, which has to do with ipl and reipl to a new header file named
"ipl.h".

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
72960a02c270950253126ee8b339afd400f55273 21-Feb-2007 Michael Holzheu <holzheu@de.ibm.com> [S390] New get_cpu_id() inline assembly

Replace two stidp inline assemblies with one global implementation.

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
e06b1a3513bdd897e3c37c98ed7b16fa237dcb63 12-Feb-2007 Alon Bar-Lev <alon.barlev@gmail.com> [PATCH] Dynamic kernel command-line: s390

Rename saved_command_line into boot_command_line.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
4d284cac76d0bfebc42d76b428c4e44d921200a9 05-Feb-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Avoid excessive inlining.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
ab14de6c37fae22911ba99f4171613e6d758050b 05-Feb-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Convert memory detection into C code.

Hopefully this will make it more maintainable and less error prone.
Code makes use of search_exception_tables(). Since it calls this
function before the kernel exeception table is sorted, there is an
early call to sort_main_extable().

This way it's easy to use the already present infrastructure of fixup
sections. Also this would allows to easily convert the rest of
head[31|64].S into C code.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
31ee4b2f40994e8b21691f85cdd4052551a789b7 05-Feb-2007 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] Calibrate delay and bogomips.

Preset the bogomips number to the cpu capacity value reported by
store system information in SYSIB 1.2.2. This value is constant
for a particular machine model and can be used to determine
relative performance differences between machines.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
fe355b7f1c7400cbb71762a1237461be03f88265 05-Feb-2007 Hongjie Yang <hongjie@us.ibm.com> [S390] boot from NSS support

Add support to boot from a named saved segment (NSS).

Signed-off-by: Hongjie Yang <hongjie@us.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
c1821c2e9711adc3cd298a16b7237c92a2cee78d 05-Feb-2007 Gerald Schaefer <geraldsc@de.ibm.com> [S390] noexec protection

This provides a noexec protection on s390 hardware. Our hardware does
not have any bits left in the pte for a hw noexec bit, so this is a
different approach using shadow page tables and a special addressing
mode that allows separate address spaces for code and data.

As a special feature of our "secondary-space" addressing mode, separate
page tables can be specified for the translation of data addresses
(storage operands) and instruction addresses. The shadow page table is
used for the instruction addresses and the standard page table for the
data addresses.
The shadow page table is linked to the standard page table by a pointer
in page->lru.next of the struct page corresponding to the page that
contains the standard page table (since page->private is not really
private with the pte_lock and the page table pages are not in the LRU
list).
Depending on the software bits of a pte, it is either inserted into
both page tables or just into the standard (data) page table. Pages of
a vma that does not have the VM_EXEC bit set get mapped only in the
data address space. Any try to execute code on such a page will cause a
page translation exception. The standard reaction to this is a SIGSEGV
with two exceptions: the two system call opcodes 0x0a77 (sys_sigreturn)
and 0x0aad (sys_rt_sigreturn) are allowed. They are stored by the
kernel to the signal stack frame. Unfortunately, the signal return
mechanism cannot be modified to use an SA_RESTORER because the
exception unwinding code depends on the system call opcode stored
behind the signal stack frame.

This feature requires that user space is executed in secondary-space
mode and the kernel in home-space mode, which means that the addressing
modes need to be switched and that the noexec protection only works
for user space.
After switching the addressing modes, we cannot use the mvcp/mvcs
instructions anymore to copy between kernel and user space. A new
mvcos instruction has been added to the z9 EC/BC hardware which allows
to copy between arbitrary address spaces, but on older hardware the
page tables need to be walked manually.

Signed-off-by: Gerald Schaefer <geraldsc@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
60383201c2c155fae2aaffd483d09eb4198b6356 05-Feb-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Remove pointless/unreliable kernel messages.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2b67fc46061b2171fb8fbb55d1ac717abd533569 05-Feb-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Get rid of a lot of sparse warnings.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
de338a3795bbcb3c3d77591f65118cbec776cc39 09-Jan-2007 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Fix vmalloc area size calculation.

setup_memory_end() uses VMALLOC_END instead of VMALLOC_END_INIT to
calculate the maximum supported size of physical memory. Since
VMALLOC_END is zero, this will cause a crash on 31 bit systems.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
39b742f957a287a7514a8a35c9f516cdf30b9ff5 08-Dec-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Use add_active_range() and free_area_init_nodes().

Size zones and holes in an architecture independent manner for s390.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
f4eb07c17df2e6cf9bd58bfcd9cc9e05e9489d07 08-Dec-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Virtual memmap for s390.

Virtual memmap support for s390. Inspired by the ia64 implementation.

Unlike ia64 we need a mechanism which allows us to dynamically attach
shared memory regions.
These memory regions are accessed via the dcss device driver. dcss
implements the 'direct_access' operation, which requires struct pages
for every single shared page.
Therefore this implementation provides an interface to attach/detach
shared memory:

int add_shared_memory(unsigned long start, unsigned long size);
int remove_shared_memory(unsigned long start, unsigned long size);

The purpose of the add_shared_memory function is to add the given
memory range to the 1:1 mapping and to make sure that the
corresponding range in the vmemmap is backed with physical pages.
It also initialises the new struct pages.

remove_shared_memory in turn only invalidates the page table
entries in the 1:1 mapping. The page tables and the memory used for
struct pages in the vmemmap are currently not freed. They will be
reused when the next segment will be attached.
Given that the maximum size of a shared memory region is 2GB and
in addition all regions must reside below 2GB this is not too much of
a restriction, but there is room for improvement.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
8b62bc9642300471737bc3b77b2a4a2ead46dedb 04-Dec-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Memory detection fixes.

VMALLOC_END on 31bit should be 0x8000000UL instead of 0x7fffffffL.
The page mask which is used to make sure memory_end is on 4MB/2MB
boundary is wrong and not needed. Therefore remove it.
Make sure a vmalloc area does also exist and work on (future)
machines with 4TB and more memory.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
36a2bd425d9b3ba2a40b0653e08d17702c78558e 04-Dec-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Cleanup memory_chunk array usage.

Need this at yet another file and don't want to add yet another
extern...

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
740b5706b9c4b3767f597b3ea76654c6f2a800b2 04-Dec-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] cpcmd <-> __cpcmd calling issues

In case of reipl cpcmd gets called when all other cpus are not running
anymore. To prevent deadlocks change __cpcmd so that it doesn't take
any locks and call cpcmd or __cpcmd, whatever is correct in the current
context.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
c4972f33169e3e1ce06ad00917ddaf2c3b49b36a 06-Nov-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] IRQs too early enabled.

setup_lowcore() calls ctl_set_bit() which returns withs interrupts
enabled. The setup arch code is not supposed to enable interrupts that
early. Therefore use the __ctl_set_bit() variant.
This fixes the not working lock dependency validator on non 64 bit
systems.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
bcc8bcb1f0cc51c0042497d5de2d79743050e3bb 06-Nov-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] revert add_active_range() usage patch.

Commit 7676bef9c183fd573822cac9992927ef596d584c breaks DCSS support on
s390. DCSS needs initialized struct pages to work. With the usage of
add_active_range() only the struct pages for physically present pages
are initialized.
This could be fixed if the DCSS driver would initiliaze the struct pages
itself, but this doesn't work too. This is because the mem_map array
does not include holes after the last present memory area and therefore
there is nothing that could be initialized.
To fix this and to avoid some dirty hacks revert this patch for now.
Will be added later when we move to a virtual mem_map.

Cc: Carsten Otte <cotte@de.ibm.com>
Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
7676bef9c183fd573822cac9992927ef596d584c 04-Oct-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Have s390 use add_active_range() and free_area_init_nodes.

Size zones and holes in an architecture independent manner for s390.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
94c12cc7d196bab34aaa98d38521549fa1e5ef76 28-Sep-2006 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] Inline assembly cleanup.

Major cleanup of all s390 inline assemblies. They now have a common
coding style. Quite a few have been shortened, mainly by using register
asm variables. Use of the EX_TABLE macro helps as well. The atomic ops,
bit ops and locking inlines new use the Q-constraint if a newer gcc
is used. That results in slightly better code.

Thanks to Christian Borntraeger for proof reading the changes.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
6c2a9e6df60478e712f3c3d98b5047778a82a3d7 20-Sep-2006 Gerald Schaefer <geraldsc@de.ibm.com> [S390] Use alternative user-copy operations for new hardware.

This introduces new user-copy operations which are optimized for
copying more than 256 Bytes on new hardware.

Signed-off-by: Gerald Schaefer <geraldsc@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
d02765d1af743567398eb6d523dea0ba5e5e7e8e 20-Sep-2006 Gerald Schaefer <geraldsc@de.ibm.com> [S390] Make user-copy operations run-time configurable.

Introduces a struct uaccess_ops which allows setting user-copy
operations at run-time.

Signed-off-by: Gerald Schaefer <geraldsc@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
ff6b8ea68f4b7353f88b97024f28127e2148aa00 20-Sep-2006 Michael Holzheu <holzheu@de.ibm.com> [S390] ipl/dump on panic.

It is now possible to specify a ccw/fcp dump device which is used to
automatically create a system dump in case of a kernel panic. The dump
device can be configured under /sys/firmware/dump.
In addition it is now possible to specify a ccw/fcp device which is used
for the next reboot of Linux. The reipl device can be configured under
/sys/firmware/reipl.

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
65912a84c0f33304fa5ea004c7b6ee58d5f5572e 20-Sep-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] initrd vs. bootmem bitmap.

Move initrd if the bitmap of the bootmem allocator would overwrite it.
In addition this patch sets the default size and address of the initrd to 0.
Therefore all boot loaders must set the initrd size and address correctly.
This is especially relevant for ftp boot via HMC/SE, where this change
requires a special patch file entry in the .ins file which sets these two
values contained at address 0x10408 and 0x10410.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
d7cf0d57ef9e07cf0f65c58c19a8e7c4a9db72b5 18-Jul-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] sysfs_create_xxx return values.

Take return values of sysfs_create_group & friends into account.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
585c3047a881d0f54b93a0dd8ab499b07ed25d09 29-Jun-2006 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [S390] Add vmpanic parameter.

Implementation of new kernel parameter vmpanic that provides a means to
perform a z/VM CP command after a kernel panic occurred.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
06fa46a2fcb7e13386707a3eac74f11140a9f818 29-Jun-2006 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] console_unblank woes.

The software watchdog calls machine_restart from a timer function.
The s390 machine_restart calls console_unblank to flush the console
output. This is needed for panic to get the panic message printed.
If console_unblank is called in interrupt a BUG is triggered in
acquire_console_sem. That makes the software watchdog panic instead
of restarting the machine. To get around this problem the call to
console_unblank is made conditionally on !in_interrupt() ||
oops_in_progress.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
cc13ad6217018833e590a0e2ef5937aa16162d34 25-Jun-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [PATCH] s390: setup.c cleanup + build fix

Cleanup & fix 31 bit compilation:

CC arch/s390/kernel/setup.o
arch/s390/kernel/setup.c:83: error: initializer element is not computable at
load time
arch/s390/kernel/setup.c:83: error: (near initialization for
'code_resource.start')
Not sure which patch in the -mm tree breaks this, but since this can be
considered a cleanup it can be merged anyway.

Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
596852967ce3208b90132895dd1992a31b058bc8 24-Mar-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [PATCH] s390: early parameter parsing

Use common code parser for early parameters instead of our own.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
255acee706b333b79f593dd366f16e1f107cccc3 17-Feb-2006 Heiko Carstens <heiko.carstens@de.ibm.com> [PATCH] s390: additional_cpus parameter

Introduce additional_cpus command line option. By default no additional cpu
can be attached to the system anymore. Only the cpus present at IPL time can
be switched on/off. If it is desired that additional cpus can be attached to
the system the maximum number of additional cpus needs to be specified with
this option.

This change is necessary in order to limit the waste of per_cpu data
structures.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
53df751ccd0a404cca169dbd61bae571cc21559a 14-Jan-2006 Martin Schwidefsky <schwidefsky@de.ibm.com> [PATCH] s390: add dummy pm_power_off

Define a dummy pm_power_off pointer to make sys_reboot happy.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
68c119177890afff4759abda8da2b4ff5e06efa1 14-Jan-2006 Alexey Dobriyan <adobriyan@gmail.com> [PATCH] s390: fix cpcmd calls on UP

Add missing fourth argument to cpcmd calls under !CONFIG_SMP.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
347a8dc3b815f0c0fa62a1df075184ffe4cbdcf1 06-Jan-2006 Martin Schwidefsky <schwidefsky@de.ibm.com> [PATCH] s390: cleanup Kconfig

Sanitize some s390 Kconfig options. We have ARCH_S390, ARCH_S390X,
ARCH_S390_31, 64BIT, S390_SUPPORT and COMPAT. Replace these 6 options by
S390, 64BIT and COMPAT.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1e8e338325fa0f2bd5c1c800086e900cf188d2cd 31-Oct-2005 Heiko Carstens <heiko.carstens@de.ibm.com> [PATCH] s390: export ipl device parameters

Sysfs interface to export ipl device parameters. Dependent on the ipl type
the interface will look like this:

- ccw ipl:

/sys/firmware/ipl/device
/ipl_type

- fcp ipl:

/sys/firmware/ipl/binary_parameter
/bootprog
/br_lba
/device
/ipl_type
/lun
/scp_data
/wwpn

- otherwise (unknown that is):

/sys/firmware/ipl/ipl_type

Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
c782268be8892962a1ae2c09a2e87e7849454ef1 17-Sep-2005 Volker Sameske <sameske@de.ibm.com> [PATCH] s390: diag 0x308 reipl

Add code to support the re-IPL method using diagnose 0x308.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
b7ae9dd80a3ecf070ea0c5fe1d405cd7687d6c51 17-Sep-2005 Heiko Carstens <heiko.carstens@de.ibm.com> [PATCH] s390: show_cpuinfo fix

Disable preemption in show_cpuinfo to avoid problems and the warning about
smp_processor_id.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
951f22d5b1f0eaae35dafc669e3774a0c2084d10 27-Jul-2005 Martin Schwidefsky <schwidefsky@de.ibm.com> [PATCH] s390: spin lock retry

Split spin lock and r/w lock implementation into a single try which is done
inline and an out of line function that repeatedly tries to get the lock
before doing the cpu_relax(). Add a system control to set the number of
retries before a cpu is yielded.

The reason for the spin lock retry is that the diagnose 0x44 that is used to
give up the virtual cpu is quite expensive. For spin locks that are held only
for a short period of time the costs of the diagnoses outweights the savings
for spin locks that are held for a longer timer. The default retry count is
1000.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
59586e5a262a29361c45c929ea3253d4aec830b0 26-Jul-2005 Eric W. Biederman <ebiederm@xmission.com> [PATCH] Don't export machine_restart, machine_halt, or machine_power_off.

machine_restart, machine_halt and machine_power_off are machine
specific hooks deep into the reboot logic, that modules
have no business messing with. Usually code should be calling
kernel_restart, kernel_halt, kernel_power_off, or
emergency_restart. So don't export machine_restart,
machine_halt, and machine_power_off so we can catch buggy users.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
6b979de395c7e1b7e59f74a870e1d1911853eccb 25-Jun-2005 Christian Borntraeger <cborntra@de.ibm.com> [PATCH] s390: add vmcp interface

Add interface to issue VM control program commands.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
77fa22450de00d535de2cc8be653983560828000 25-Jun-2005 Heiko Carstens <heiko.carstens@de.ibm.com> [PATCH] s390: improved machine check handling

Improved machine check handling. Kernel is now able to receive machine checks
while in kernel mode (system call, interrupt and program check handling).
Also register validation is now performed.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
0b642ede47969d4180b0922d982777fe64379228 01-May-2005 Peter Oberparleiter <peter.oberparleiter@de.ibm.com> [PATCH] s390: default storage key

Provide an easy way to define a non-zero storage key at compile time. This is
useful for debugging purposes.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
c9e3735359ac2d74ee61c6f1e5724f4a6db570bf 01-May-2005 Heiko Carstens <heiko.carstens@de.ibm.com> [PATCH] s390: fix memory holes and cleanup setup_arch

The memory setup didn't take care of memory holes and this makes the memory
management think there would be more memory available than there is in
reality. That causes the OOM killer to kill processes even if there is enough
memory left that can be written to the swap space.

The patch fixes this by using free_area_init_node with an array of memory
holes instead of free_area_init. Further the patch cleans up the code in
setup.c by splitting setup_arch into smaller pieces.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!