<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/s390/kernel/nmi.c, branch linux-4.6.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.6.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.6.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-10-27T08:33:57Z</updated>
<entry>
<title>s390/nmi: reduce size of percpu variable</title>
<updated>2015-10-27T08:33:57Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2015-10-12T11:04:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=36324963a3006d2c416095d87d8272e4825c679b'/>
<id>urn:sha1:36324963a3006d2c416095d87d8272e4825c679b</id>
<content type='text'>
Change the flag fields within struct mcck_struct to simple bit fields
to reduce the size of the structure which is used as percpu variable.

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/nmi: fix terminology</title>
<updated>2015-10-27T08:33:56Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2015-10-12T11:03:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=975be635d929e3cfdae149d6de055f31a17c92d7'/>
<id>urn:sha1:975be635d929e3cfdae149d6de055f31a17c92d7</id>
<content type='text'>
According to the architecture registers are validated and not
revalidated. So change comments and functions names to match.

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/nmi: remove casts</title>
<updated>2015-10-27T08:33:55Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2015-10-12T11:00:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dc6e15556a9f21d640a62ae6de3cbfa68ec687a4'/>
<id>urn:sha1:dc6e15556a9f21d640a62ae6de3cbfa68ec687a4</id>
<content type='text'>
Remove all the casts to and from the machine check interruption code.
This patch changes struct mci to a union, which contains an anonymous
structure with the already known bits and in addition an unsigned
long field, which contains the raw machine check interruption code.

This allows to simply assign and decoce the interruption code value
without the need for all those casts we had all the time.

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/nmi: remove pointless error strings</title>
<updated>2015-10-27T08:33:54Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2015-10-12T10:39:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3d68286a4304574c250ca3b0a5429d2901688f16'/>
<id>urn:sha1:3d68286a4304574c250ca3b0a5429d2901688f16</id>
<content type='text'>
s390_handle_damage() has character string parameter which was used as
a pointer to verbose error message. The hope was (a lot of years ago)
when analyzing dumps that register R2 would still contain the pointer
and therefore it would be rather easy to tell what went wrong.

However gcc optimizes the strings away since a long time. And even if
it wouldn't it is necessary to have a close look at the machine check
interruption code to tell what's wrong.

So remove the pointless error strings.

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/fpu: split fpu-internal.h into fpu internals, api, and type headers</title>
<updated>2015-10-16T07:41:12Z</updated>
<author>
<name>Hendrik Brueckner</name>
</author>
<published>2015-10-06T10:25:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b0753902d42f5cb01c33f0dec47ba2aa7ecfbb3f'/>
<id>urn:sha1:b0753902d42f5cb01c33f0dec47ba2aa7ecfbb3f</id>
<content type='text'>
Split the API and FPU type definitions into separate header files
similar to "x86/fpu: Rename fpu-internal.h to fpu/internal.h" (78f7f1e54b).

The new header files and their meaning are:

asm/fpu/types.h:
	FPU related data types, needed for 'struct thread_struct' and
	'struct task_struct'.

asm/fpu/api.h:
	FPU related 'public' functions for other subsystems and device
	drivers.

asm/fpu/internal.h:
	FPU internal functions mainly used to convert
	FPU register contents in signal handling.

Signed-off-by: Hendrik Brueckner &lt;brueckner@linux.vnet.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/etr,stp: fix possible deadlock on machine check</title>
<updated>2015-10-14T12:32:18Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2015-10-09T11:48:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=29b0a8250ba63beffba4fe3a42fa75dddf4bd06a'/>
<id>urn:sha1:29b0a8250ba63beffba4fe3a42fa75dddf4bd06a</id>
<content type='text'>
The first level machine check handler for etr and stp machine checks may
call queue_work() while in nmi context. This may deadlock e.g. if the
machine check happened when the interrupted context did hold a lock, that
also will be acquired by queue_work().
Therefore split etr and stp machine check handling into first and second
level handling. The second level handling will then issue the queue_work()
call in process context which avoids the potential deadlock.

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/nmi: initialize control register 0 earlier</title>
<updated>2015-08-19T08:40:38Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2015-08-17T06:09:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24d05ff863e78544e8538a792e3234291cdd5650'/>
<id>urn:sha1:24d05ff863e78544e8538a792e3234291cdd5650</id>
<content type='text'>
Change machine_check_init() to an early_initcall(). This makes sure it will
be called before all other cpus are online and therfore saves us a lot of
pointless smp_call_function() calls.
The control register settings will be forwarded to the other cpus when they
will be brought online.

Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Reviewed-by: Hendrik Brueckner &lt;brueckner@linux.vnet.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/kernel: lazy restore fpu registers</title>
<updated>2015-07-22T07:58:01Z</updated>
<author>
<name>Hendrik Brueckner</name>
</author>
<published>2015-06-10T10:53:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9977e886cbbc758b4b601a160b5825ba573b5ca8'/>
<id>urn:sha1:9977e886cbbc758b4b601a160b5825ba573b5ca8</id>
<content type='text'>
Improve the save and restore behavior of FPU register contents to use the
vector extension within the kernel.

The kernel does not use floating-point or vector registers and, therefore,
saving and restoring the FPU register contents are performed for handling
signals or switching processes only.  To prepare for using vector
instructions and vector registers within the kernel, enhance the save
behavior and implement a lazy restore at return to user space from a
system call or interrupt.

To implement the lazy restore, the save_fpu_regs() sets a CPU information
flag, CIF_FPU, to indicate that the FPU registers must be restored.
Saving and setting CIF_FPU is performed in an atomic fashion to be
interrupt-safe.  When the kernel wants to use the vector extension or
wants to change the FPU register state for a task during signal handling,
the save_fpu_regs() must be called first.  The CIF_FPU flag is also set at
process switch.  At return to user space, the FPU state is restored.  In
particular, the FPU state includes the floating-point or vector register
contents, as well as, vector-enablement and floating-point control.  The
FPU state restore and clearing CIF_FPU is also performed in an atomic
fashion.

For KVM, the restore of the FPU register state is performed when restoring
the general-purpose guest registers before the SIE instructions is started.
Because the path towards the SIE instruction is interruptible, the CIF_FPU
flag must be checked again right before going into SIE.  If set, the guest
registers must be reloaded again by re-entering the outer SIE loop.  This
is the same behavior as if the SIE critical section is interrupted.

Signed-off-by: Hendrik Brueckner &lt;brueckner@linux.vnet.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/kernel: introduce fpu-internal.h with fpu helper functions</title>
<updated>2015-07-22T07:58:00Z</updated>
<author>
<name>Hendrik Brueckner</name>
</author>
<published>2015-06-11T13:33:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=904818e2f229f3d94ec95f6932a6358c81e73d78'/>
<id>urn:sha1:904818e2f229f3d94ec95f6932a6358c81e73d78</id>
<content type='text'>
Introduce a new structure to manage FP and VX registers. Refactor the
save and restore of floating point and vector registers with a set
of helper functions in fpu-internal.h.

Signed-off-by: Hendrik Brueckner &lt;brueckner@linux.vnet.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/nmi: fix vector register corruption</title>
<updated>2015-07-13T09:02:21Z</updated>
<author>
<name>Heiko Carstens</name>
</author>
<published>2015-07-07T06:40:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cad49cfc44a5160e3fa09b18e4e7f7cacd13f27d'/>
<id>urn:sha1:cad49cfc44a5160e3fa09b18e4e7f7cacd13f27d</id>
<content type='text'>
If a machine check happens, the machine has the vector facility installed
and the extended save area exists, the cpu will save vector register
contents into the extended save area. This is regardless of control
register 0 contents, which enables and disables the vector facility during
runtime.

On each machine check we should validate the vector registers. The current
code however tries to validate the registers only if the running task is
using vector registers in user space.

However even the current code is broken and causes vector register
corruption on machine checks, if user space uses them:
the prefix area contains a pointer (absolute address) to the machine check
extended save area. In order to save some space the save area was put into
an unused area of the second prefix page.
When validating vector register contents the code uses the absolute address
of the extended save area, which is wrong. Due to prefixing the vector
instructions will then access contents using absolute addresses instead
of real addresses, where the machine stored the contents.

If the above would work there is still the problem that register validition
would only happen if user space uses vector registers. If kernel space uses
them also, this may also lead to vector register content corruption:
if the kernel makes use of vector instructions, but the current running
user space context does not, the machine check handler will validate
floating point registers instead of vector registers.
Given the fact that writing to a floating point register may change the
upper halve of the corresponding vector register, we also experience vector
register corruption in this case.

Fix all of these issues, and always validate vector registers on each
machine check, if the machine has the vector facility installed and the
extended save area is defined.

Cc: &lt;stable@vger.kernel.org&gt; # 4.1+
Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
</content>
</entry>
</feed>
