<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/s390, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-02-06T16:34:51Z</updated>
<entry>
<title>s390/smp: fix CPU hotplug deadlock with CPU rescan</title>
<updated>2019-02-06T16:34:51Z</updated>
<author>
<name>Gerald Schaefer</name>
</author>
<published>2019-01-09T12:00:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0c4373e61d68178be9f20cd465e48579b799922a'/>
<id>urn:sha1:0c4373e61d68178be9f20cd465e48579b799922a</id>
<content type='text'>
commit b7cb707c373094ce4008d4a6ac9b6b366ec52da5 upstream.

smp_rescan_cpus() is called without the device_hotplug_lock, which can lead
to a dedlock when a new CPU is found and immediately set online by a udev
rule.

This was observed on an older kernel version, where the cpu_hotplug_begin()
loop was still present, and it resulted in hanging chcpu and systemd-udev
processes. This specific deadlock will not show on current kernels. However,
there may be other possible deadlocks, and since smp_rescan_cpus() can still
trigger a CPU hotplug operation, the device_hotplug_lock should be held.

For reference, this was the deadlock with the old cpu_hotplug_begin() loop:

        chcpu (rescan)                       systemd-udevd

 echo 1 &gt; /sys/../rescan
 -&gt; smp_rescan_cpus()
 -&gt; (*) get_online_cpus()
    (increases refcount)
 -&gt; smp_add_present_cpu()
    (new CPU found)
 -&gt; register_cpu()
 -&gt; device_add()
 -&gt; udev "add" event triggered -----------&gt; udev rule sets CPU online
                                         -&gt; echo 1 &gt; /sys/.../online
                                         -&gt; lock_device_hotplug_sysfs()
                                            (this is missing in rescan path)
                                         -&gt; device_online()
                                         -&gt; (**) device_lock(new CPU dev)
                                         -&gt; cpu_up()
                                         -&gt; cpu_hotplug_begin()
                                            (loops until refcount == 0)
                                            -&gt; deadlock with (*)
 -&gt; bus_probe_device()
 -&gt; device_attach()
 -&gt; device_lock(new CPU dev)
    -&gt; deadlock with (**)

Fix this by taking the device_hotplug_lock in the CPU rescan path.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Gerald Schaefer &lt;gerald.schaefer@de.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>s390/cpum_cf: Reject request for sampling in event initialization</title>
<updated>2018-12-17T09:07:09Z</updated>
<author>
<name>Thomas Richter</name>
</author>
<published>2018-11-13T15:38:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9453bca3441e67f70f1860a493d3989cd597aca2'/>
<id>urn:sha1:9453bca3441e67f70f1860a493d3989cd597aca2</id>
<content type='text'>
[ Upstream commit 613a41b0d16e617f46776a93b975a1eeea96417c ]

On s390 command perf top fails
[root@s35lp76 perf] # ./perf top -F100000  --stdio
   Error:
   cycles: PMU Hardware doesn't support sampling/overflow-interrupts.
   	Try 'perf stat'
[root@s35lp76 perf] #

Using event -e rb0000 works as designed.  Event rb0000 is the event
number of the sampling facility for basic sampling.

During system start up the following PMUs are installed in the kernel's
PMU list (from head to tail):
   cpum_cf --&gt; s390 PMU counter facility device driver
   cpum_sf --&gt; s390 PMU sampling facility device driver
   uprobe
   kprobe
   tracepoint
   task_clock
   cpu_clock

Perf top executes following functions and calls perf_event_open(2) system
call with different parameters many times:

cmd_top
--&gt; __cmd_top
    --&gt; perf_evlist__add_default
        --&gt; __perf_evlist__add_default
            --&gt; perf_evlist__new_cycles (creates event type:0 (HW)
			    		config 0 (CPU_CYCLES)
	        --&gt; perf_event_attr__set_max_precise_ip
		    Uses perf_event_open(2) to detect correct
		    precise_ip level. Fails 3 times on s390 which is ok.

Then functions cmd_top
--&gt; __cmd_top
    --&gt; perf_top__start_counters
        --&gt;perf_evlist__config
	   --&gt; perf_can_comm_exec
               --&gt; perf_probe_api
	           This functions test support for the following events:
		   "cycles:u", "instructions:u", "cpu-clock:u" using
		   --&gt; perf_do_probe_api
		       --&gt; perf_event_open_cloexec
		           Test the close on exec flag support with
			   perf_event_open(2).
	               perf_do_probe_api returns true if the event is
		       supported.
		       The function returns true because event cpu-clock is
		       supported by the PMU cpu_clock.
	               This is achieved by many calls to perf_event_open(2).

Function perf_top__start_counters now calls perf_evsel__open() for every
event, which is the default event cpu_cycles (config:0) and type HARDWARE
(type:0) which a predfined frequence of 4000.

Given the above order of the PMU list, the PMU cpum_cf gets called first
and returns 0, which indicates support for this sampling. The event is
fully allocated in the function perf_event_open (file kernel/event/core.c
near line 10521 and the following check fails:

        event = perf_event_alloc(&amp;attr, cpu, task, group_leader, NULL,
		                 NULL, NULL, cgroup_fd);
	if (IS_ERR(event)) {
		err = PTR_ERR(event);
		goto err_cred;
	}

        if (is_sampling_event(event)) {
		if (event-&gt;pmu-&gt;capabilities &amp; PERF_PMU_CAP_NO_INTERRUPT) {
			err = -EOPNOTSUPP;
			goto err_alloc;
		}
	}

The check for the interrupt capabilities fails and the system call
perf_event_open() returns -EOPNOTSUPP (-95).

Add a check to return -ENODEV when sampling is requested in PMU cpum_cf.
This allows common kernel code in the perf_event_open() system call to
test the next PMU in above list.

Fixes: 97b1198fece0 (" "s390, perf: Use common PMU interrupt disabled code")
Signed-off-by: Thomas Richter &lt;tmricht@linux.ibm.com&gt;
Reviewed-by: Hendrik Brueckner &lt;brueckner@linux.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/vdso: add missing FORCE to build targets</title>
<updated>2018-11-27T15:05:36Z</updated>
<author>
<name>Vasily Gorbik</name>
</author>
<published>2018-10-19T13:37:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e6c0fca311fae4da9147ec3381cf0953748d8650'/>
<id>urn:sha1:e6c0fca311fae4da9147ec3381cf0953748d8650</id>
<content type='text'>
[ Upstream commit b44b136a3773d8a9c7853f8df716bd1483613cbb ]

According to Documentation/kbuild/makefiles.txt all build targets using
if_changed should use FORCE as well. Add missing FORCE to make sure
vdso targets are rebuild properly when not just immediate prerequisites
have changed but also when build command differs.

Reviewed-by: Philipp Rudo &lt;prudo@linux.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/ftrace/jprobes: Fix conflict between jprobes and function graph tracing</title>
<updated>2018-11-10T15:39:13Z</updated>
<author>
<name>Jiri Olsa</name>
</author>
<published>2016-07-31T12:52:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=464f644cc5ac7f63aadcd4a2c5e2fc7486eee049'/>
<id>urn:sha1:464f644cc5ac7f63aadcd4a2c5e2fc7486eee049</id>
<content type='text'>
[ Upstream commit e64a5470dcd2900ab8f8f83638c00098b10e6300 ]

This fixes the same issue Steven already fixed for x86
in following commit:

  237d28db036e ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing

It fixes the crash, that happens when function graph tracing
and jprobes are used simultaneously. Please refer to above
commit for details.

Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/kvm: REPLACE barrier fixup with READ_ONCE</title>
<updated>2018-11-10T15:39:13Z</updated>
<author>
<name>Christian Borntraeger</name>
</author>
<published>2014-11-25T12:17:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a7e7a99c2cdd98f0fa091f7d1070704b6a1a668'/>
<id>urn:sha1:3a7e7a99c2cdd98f0fa091f7d1070704b6a1a668</id>
<content type='text'>
[ Upstream commit 5de72a2247ac05bde7c89039631b3d0c6186fafb ]

ACCESS_ONCE does not work reliably on non-scalar types. For
example gcc 4.6 and 4.7 might remove the volatile tag for such
accesses during the SRA (scalar replacement of aggregates) step
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145)

Commit 1365039d0cb3 ("KVM: s390: Fix ipte locking") replace
ACCESS_ONCE with barriers. Lets use READ_ONCE instead.

Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Acked-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/extmem: fix gcc 8 stringop-overflow warning</title>
<updated>2018-10-13T07:09:25Z</updated>
<author>
<name>Vasily Gorbik</name>
</author>
<published>2018-06-16T22:30:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8963aa53b25d7d41e187e793192c1d98082c0de0'/>
<id>urn:sha1:8963aa53b25d7d41e187e793192c1d98082c0de0</id>
<content type='text'>
[ Upstream commit 6b2ddf33baec23dace85bd647e3fc4ac070963e8 ]

arch/s390/mm/extmem.c: In function '__segment_load':
arch/s390/mm/extmem.c:436:2: warning: 'strncat' specified bound 7 equals
source length [-Wstringop-overflow=]
  strncat(seg-&gt;res_name, " (DCSS)", 7);

What gcc complains about here is the misuse of strncat function, which
in this case does not limit a number of bytes taken from "src", so it is
in the end the same as strcat(seg-&gt;res_name, " (DCSS)");

Keeping in mind that a res_name is 15 bytes, strncat in this case
would overflow the buffer and write 0 into alignment byte between the
fields in the struct. To avoid that increasing res_name size to 16,
and reusing strlcat.

Reviewed-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>s390/pci: fix out of bounds access during irq setup</title>
<updated>2018-09-05T07:16:23Z</updated>
<author>
<name>Sebastian Ott</name>
</author>
<published>2018-08-13T09:26:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=be4f8c44a1c7045a313121ad4549b000c861efab'/>
<id>urn:sha1:be4f8c44a1c7045a313121ad4549b000c861efab</id>
<content type='text'>
commit 866f3576a72b2233a76dffb80290f8086dc49e17 upstream.

During interrupt setup we allocate interrupt vectors, walk the list of msi
descriptors, and fill in the message data. Requesting more interrupts than
supported on s390 can lead to an out of bounds access.

When we restrict the number of interrupts we should also stop walking the
msi list after all supported interrupts are handled.

Cc: stable@vger.kernel.org
Signed-off-by: Sebastian Ott &lt;sebott@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>s390/qdio: reset old sbal_state flags</title>
<updated>2018-09-05T07:16:23Z</updated>
<author>
<name>Julian Wiedmann</name>
</author>
<published>2018-05-16T07:37:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dc826c93cd8015370182b9362dea84250399a9eb'/>
<id>urn:sha1:dc826c93cd8015370182b9362dea84250399a9eb</id>
<content type='text'>
commit 64e03ff72623b8c2ea89ca3cb660094e019ed4ae upstream.

When allocating a new AOB fails, handle_outbound() is still capable of
transmitting the selected buffer (just without async completion).

But if a previous transfer on this queue slot used async completion, its
sbal_state flags field is still set to QDIO_OUTBUF_STATE_FLAG_PENDING.
So when the upper layer driver sees this stale flag, it expects an async
completion that never happens.

Fix this by unconditionally clearing the flags field.

Fixes: 104ea556ee7f ("qdio: support asynchronous delivery of storage blocks")
Cc: &lt;stable@vger.kernel.org&gt; #v3.2+
Signed-off-by: Julian Wiedmann &lt;jwi@linux.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>s390/kvm: fix deadlock when killed by oom</title>
<updated>2018-09-05T07:16:22Z</updated>
<author>
<name>Claudio Imbrenda</name>
</author>
<published>2018-07-16T08:38:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ef2d2e24f2123445a4bef1f604499b0bf80057c8'/>
<id>urn:sha1:ef2d2e24f2123445a4bef1f604499b0bf80057c8</id>
<content type='text'>
commit 306d6c49ac9ded11114cb53b0925da52f2c2ada1 upstream.

When the oom killer kills a userspace process in the page fault handler
while in guest context, the fault handler fails to release the mm_sem
if the FAULT_FLAG_RETRY_NOWAIT option is set. This leads to a deadlock
when tearing down the mm when the process terminates. This bug can only
happen when pfault is enabled, so only KVM clients are affected.

The problem arises in the rare cases in which handle_mm_fault does not
release the mm_sem. This patch fixes the issue by manually releasing
the mm_sem when needed.

Fixes: 24eb3a824c4f3 ("KVM: s390: Add FAULT_FLAG_RETRY_NOWAIT for guest fault")
Cc: &lt;stable@vger.kernel.org&gt; # 3.15+
Signed-off-by: Claudio Imbrenda &lt;imbrenda@linux.vnet.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf: fix invalid bit in diagnostic entry</title>
<updated>2018-08-09T10:20:29Z</updated>
<author>
<name>Thomas Richter</name>
</author>
<published>2018-05-08T05:53:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=745255bd21c47468a70471c378080fcfded0b11c'/>
<id>urn:sha1:745255bd21c47468a70471c378080fcfded0b11c</id>
<content type='text'>
[ Upstream commit 3c0a83b14ea71fef5ccc93a3bd2de5f892be3194 ]

The s390 CPU measurement facility sampling mode supports basic entries
and diagnostic entries. Each entry has a valid bit to indicate the
status of the entry as valid or invalid.

This bit is bit 31 in the diagnostic entry, but the bit mask definition
refers to bit 30.

Fix this by making the reserved field one bit larger.

Fixes: 7e75fc3ff4cf ("s390/cpum_sf: Add raw data sampling to support the diagnostic-sampling function")
Signed-off-by: Thomas Richter &lt;tmricht@linux.ibm.com&gt;
Reviewed-by: Hendrik Brueckner &lt;brueckner@linux.ibm.com&gt;
Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
