summaryrefslogtreecommitdiffstats
path: root/arch/s390/pci
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2016-03-14 15:47:23 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-03-14 16:19:09 +0100
commit80c544ded25ac14d7cc3e555abb8ed2c2da99b84 (patch)
tree031fb21ec6f5d6477f3bb820a0ef4a3f3687e065 /arch/s390/pci
parents390: fix floating pointer register corruption (again) (diff)
downloadlinux-80c544ded25ac14d7cc3e555abb8ed2c2da99b84.tar.xz
linux-80c544ded25ac14d7cc3e555abb8ed2c2da99b84.zip
s390/pci: enforce fmb page boundary rule
The function measurement block must not cross a page boundary. Ensure that by raising the alignment requirement to the smallest power of 2 larger than the size of the fmb. Fixes: d0b088531 ("s390/pci: performance statistics and debug infrastructure") Cc: stable@vger.kernel.org # v3.8+ Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/pci')
-rw-r--r--arch/s390/pci/pci.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index f76d01e69fb8..9fd59a7cfcd3 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -860,8 +860,11 @@ static inline int barsize(u8 size)
static int zpci_mem_init(void)
{
+ BUILD_BUG_ON(!is_power_of_2(__alignof__(struct zpci_fmb)) ||
+ __alignof__(struct zpci_fmb) < sizeof(struct zpci_fmb));
+
zdev_fmb_cache = kmem_cache_create("PCI_FMB_cache", sizeof(struct zpci_fmb),
- 16, 0, NULL);
+ __alignof__(struct zpci_fmb), 0, NULL);
if (!zdev_fmb_cache)
goto error_fmb;