diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2023-07-03 14:34:25 +0200 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2023-07-24 12:12:21 +0200 |
commit | 86e74965bbdf534b9c7f1f678b963492de41276e (patch) | |
tree | ecf31dd47c74d00388a3cf38c73340e38ff291a5 /arch/s390/kernel/sthyi.c | |
parent | c83cd4fe31d52bca0587370d9e98f00072aefa27 (diff) |
s390/sthyi: enforce 4k alignment of vmalloc'ed area
vmalloc() does not guarantee any alignment, unless it is explicitly
requested with e.g. __vmalloc_node(). Using diag204() with subcode 7
requires a 4k aligned virtual buffer. Therefore switch to __vmalloc_node().
Note: with the current vmalloc() implementation callers would still get a
4k aligned area, even though this is quite non-obvious looking at the
code. So changing this in sthyi doesn't fix a real bug. It is just to make
sure the code will not suffer from some obscure options, like it happened
in the past with kmalloc() where debug options changed the assumed
alignment of allocated memory areas.
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/sthyi.c')
-rw-r--r-- | arch/s390/kernel/sthyi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/s390/kernel/sthyi.c b/arch/s390/kernel/sthyi.c index 4d141e2c132e..98ebedbb5761 100644 --- a/arch/s390/kernel/sthyi.c +++ b/arch/s390/kernel/sthyi.c @@ -317,7 +317,9 @@ static void fill_diag(struct sthyi_sctns *sctns) if (pages <= 0) return; - diag204_buf = vmalloc(array_size(pages, PAGE_SIZE)); + diag204_buf = __vmalloc_node(array_size(pages, PAGE_SIZE), + PAGE_SIZE, GFP_KERNEL, NUMA_NO_NODE, + __builtin_return_address(0)); if (!diag204_buf) return; |