From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Gerald Schaefer <gerald.schaefer@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [ 10/46] s390/memory hotplug: prevent offline of active memory increments
Date: Mon, 6 May 2013 15:58:16 -0700 [thread overview]
Message-ID: <20130506225821.772355556@linuxfoundation.org> (raw)
In-Reply-To: <20130506225820.628893970@linuxfoundation.org>
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiko Carstens <heiko.carstens@de.ibm.com>
commit 94c163663fc1dcfc067a5fb3cc1446b9469975ce upstream.
In case a machine supports memory hotplug all active memory increments
present at IPL time have been initialized with a "usecount" of 1.
This is wrong if the memory increment size is larger than the memory
section size of the memory hotplug code. If that is the case the
usecount must be initialized with the number of memory sections that
fit into one memory increment.
Otherwise it is possible to put a memory increment into standby state
even if there are still active sections.
Afterwards addressing exceptions might happen which cause the kernel
to panic.
However even worse, if a memory increment was put into standby state
and afterwards into active state again, it's contents would have been
zeroed, leading to memory corruption.
This was only an issue for machines that support standby memory and
have at least 256GB memory.
This is broken since commit fdb1bb15 "[S390] sclp/memory hotplug: fix
initial usecount of increments".
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/s390/char/sclp_cmd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -507,6 +507,8 @@ static void __init sclp_add_standby_memo
add_memory_merged(0);
}
+#define MEM_SCT_SIZE (1UL << SECTION_SIZE_BITS)
+
static void __init insert_increment(u16 rn, int standby, int assigned)
{
struct memory_increment *incr, *new_incr;
@@ -519,7 +521,7 @@ static void __init insert_increment(u16
new_incr->rn = rn;
new_incr->standby = standby;
if (!standby)
- new_incr->usecount = 1;
+ new_incr->usecount = rzm > MEM_SCT_SIZE ? rzm/MEM_SCT_SIZE : 1;
last_rn = 0;
prev = &sclp_mem_list;
list_for_each_entry(incr, &sclp_mem_list, list) {
next prev parent reply other threads:[~2013-05-06 22:58 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-06 22:58 [ 00/46] 3.0.77-stable review Greg Kroah-Hartman
2013-05-06 22:58 ` [ 01/46] powerpc: Add isync to copy_and_flush Greg Kroah-Hartman
2013-05-06 22:58 ` [ 02/46] powerpc/spufs: Initialise inode->i_ino in spufs_new_inode() Greg Kroah-Hartman
2013-05-06 22:58 ` [ 03/46] USB: serial: option: Added support Olivetti Olicard 145 Greg Kroah-Hartman
2013-05-06 22:58 ` [ 04/46] USB: option: add a D-Link DWM-156 variant Greg Kroah-Hartman
2013-05-06 22:58 ` [ 05/46] usb/misc/appledisplay: Add 24" LED Cinema display Greg Kroah-Hartman
2013-05-06 22:58 ` [ 06/46] USB: add ftdi_sio USB ID for GDM Boost V1.x Greg Kroah-Hartman
2013-05-06 22:58 ` [ 07/46] USB: ftdi_sio: correct ST Micro Connect Lite PIDs Greg Kroah-Hartman
2013-05-06 22:58 ` [ 08/46] usbfs: Always allow ctrl requests with USB_RECIP_ENDPOINT on the ctrl ep Greg Kroah-Hartman
2013-05-06 22:58 ` [ 09/46] usb-storage: CY7C68300A chips do not support Cypress ATACB Greg Kroah-Hartman
2013-05-06 22:58 ` Greg Kroah-Hartman [this message]
2013-05-06 22:58 ` [ 11/46] xen/time: Fix kasprintf splat when allocating timer%d IRQ line Greg Kroah-Hartman
2013-05-06 22:58 ` [ 12/46] serial_core.c: add put_device() after device_find_child() Greg Kroah-Hartman
2013-05-06 22:58 ` [ 13/46] tty: fix up atime/mtime mess, take three Greg Kroah-Hartman
2013-05-06 22:58 ` [ 14/46] fbcon: when font is freed, clear also vc_font.data Greg Kroah-Hartman
2013-05-06 22:58 ` [ 15/46] tracing: Use stack of calling function for stack tracer Greg Kroah-Hartman
2013-05-06 22:58 ` [ 16/46] tracing: Fix stack tracer with fentry use Greg Kroah-Hartman
2013-05-06 22:58 ` [ 17/46] tracing: Remove most or all of stack tracer stack size from stack_max_size Greg Kroah-Hartman
2013-05-06 22:58 ` [ 18/46] tracing: Fix off-by-one on allocating stat->pages Greg Kroah-Hartman
2013-05-06 22:58 ` [ 19/46] tracing: Check return value of tracing_init_dentry() Greg Kroah-Hartman
2013-05-06 22:58 ` [ 20/46] tracing: Reset ftrace_graph_filter_enabled if count is zero Greg Kroah-Hartman
2013-05-06 22:58 ` [ 21/46] i2c: xiic: must always write 16-bit words to TX_FIFO Greg Kroah-Hartman
2013-05-06 22:58 ` [ 22/46] Fix initialization of CMCI/CMCP interrupts Greg Kroah-Hartman
2013-05-06 22:58 ` [ 23/46] PCI / ACPI: Dont query OSC support with all possible controls Greg Kroah-Hartman
2013-05-06 22:58 ` [ 24/46] Wrong asm register contraints in the futex implementation Greg Kroah-Hartman
2013-05-06 22:58 ` [ 25/46] Wrong asm register contraints in the kvm implementation Greg Kroah-Hartman
2013-05-06 22:58 ` [ 26/46] fs/fscache/stats.c: fix memory leak Greg Kroah-Hartman
2013-05-06 22:58 ` [ 27/46] ALSA: usb-audio: disable autopm for MIDI devices Greg Kroah-Hartman
2013-05-06 22:58 ` [ 28/46] ALSA: usb-audio: Fix autopm error during probing Greg Kroah-Hartman
2013-05-06 22:58 ` [ 29/46] ASoC: max98088: Fix logging of hardware revision Greg Kroah-Hartman
2013-05-06 22:58 ` [ 30/46] hrtimer: Fix ktime_add_ns() overflow on 32bit architectures Greg Kroah-Hartman
2013-05-06 22:58 ` [ 31/46] hrtimer: Add expiry time overflow check in hrtimer_interrupt Greg Kroah-Hartman
2013-05-06 22:58 ` [ 32/46] drivers/rtc/rtc-cmos.c: dont disable hpet emulation on suspend Greg Kroah-Hartman
2013-05-06 22:58 ` [ 33/46] cgroup: fix an off-by-one bug which may trigger BUG_ON() Greg Kroah-Hartman
2013-05-06 22:58 ` [ 34/46] clockevents: Set dummy handler on CPU_DEAD shutdown Greg Kroah-Hartman
2013-05-06 22:58 ` [ 35/46] LOCKD: Ensure that nlmclnt_block resets block->b_status after a server reboot Greg Kroah-Hartman
2013-05-06 22:58 ` [ 36/46] NFSv4: Handle NFS4ERR_DELAY and NFS4ERR_GRACE in nfs4_open_delegation_recall Greg Kroah-Hartman
2013-05-06 22:58 ` [ 37/46] nfsd4: dont close read-write opens too soon Greg Kroah-Hartman
2013-05-06 22:58 ` [ 38/46] nfsd: Decode and send 64bit time values Greg Kroah-Hartman
2013-05-06 22:58 ` [ 39/46] wireless: regulatory: fix channel disabling race condition Greg Kroah-Hartman
2013-05-06 22:58 ` [ 40/46] ipc: sysv shared memory limited to 8TiB Greg Kroah-Hartman
2013-05-06 22:58 ` [ 41/46] ext4: fix Kconfig documentation for CONFIG_EXT4_DEBUG Greg Kroah-Hartman
2013-05-06 22:58 ` [ 42/46] x86: Eliminate irq_mis_count counted in arch_irq_stat Greg Kroah-Hartman
2013-05-06 22:58 ` [ 43/46] mmc: core: Fix bit width test failing on old eMMC cards Greg Kroah-Hartman
2013-05-06 22:58 ` [ 44/46] mfd: adp5520: Restore mode bits on resume Greg Kroah-Hartman
2013-05-06 22:58 ` [ 45/46] s390: move dummy io_remap_pfn_range() to asm/pgtable.h Greg Kroah-Hartman
2013-05-06 22:58 ` [ 46/46] Revert :can: sja1000: fix handling on dt properties on little endian systems" Greg Kroah-Hartman
[not found] ` <CAKocOOM7rXbFbD73ZZ2zmS6SGgaytmWd-36uV+G2OVO88Zb=Og@mail.gmail.com>
2013-05-07 19:14 ` [ 00/46] 3.0.77-stable review Shuah Khan
2013-05-07 19:26 ` gregkh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130506225821.772355556@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=gerald.schaefer@de.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox