From patchwork Wed Jun 19 15:44:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13704225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9491C27C53 for ; Wed, 19 Jun 2024 16:19:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 54C4E6B03C6; Wed, 19 Jun 2024 12:19:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4FC696B03C7; Wed, 19 Jun 2024 12:19:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34F1B6B03C8; Wed, 19 Jun 2024 12:19:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 11BF66B03C6 for ; Wed, 19 Jun 2024 12:19:33 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B201CA37B0 for ; Wed, 19 Jun 2024 16:19:32 +0000 (UTC) X-FDA: 82248148584.23.38FF3AF Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf11.hostedemail.com (Postfix) with ESMTP id 5354440016 for ; Wed, 19 Jun 2024 16:19:30 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=A5caICuy; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf11.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718813964; a=rsa-sha256; cv=none; b=gyT7CQUI5nTYqY0C/vPufRCD8XuFnV8o6J1BryRwvu0UF+DLu8iIe6ZEVXWHwj8teNk512 otUiRB9LyYPEajr/zM5eXZCSM8n6Dbd+JsbH9LmdcxXLCEx80679VU9bVtEB5TdjkQDCCW tuW5J66NrS5+juz4rJXN2aL4Oa1jcrM= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=A5caICuy; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf11.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718813964; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=//0Kc+3BL5cKzp2INWy7uHqYWutu2bfhjte7hQD65vA=; b=aC/IeYr4u7/6qdM6gepQSPNLaiYIVH1ZR9ahpFr0fkOOfS/W218WmOdatKqgzd4o5K6pfD 1D73ML/G7pVdIgJu3xNU3eRGXw9OcQmvet7dwzp0+8Z8hx08NdZHaS7b8rR86B79vmN4zn Lklj/Yn5qkY2aCRtPPedoPq42W1tEGs= Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45JFSRAC028320; Wed, 19 Jun 2024 15:45:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pp1; bh=//0Kc+3BL5cKz p2INWy7uHqYWutu2bfhjte7hQD65vA=; b=A5caICuydwXdeGUOB8feZbS6lZJBN RgoSfNIuLx2JiIPd5XdDr5butxXht3jkARF1VtnjjzdFshXK/nluDdFfCtGnibAH wVB6CkJtwcbP47oBSgpMcDn5WCzBwtAppRGwfy9+9wJ0/FcRo1UZbEgZ4OZ5bQkx v9CrjMesGGyOeKu4d9vkIJlW0Z6+AdPB+0//qWwXDs/I6QvoPmilR/YCICoD6F8c eCaBsQrgSYsnNBD8LATk8HFrTiiGzHPzMCHmL7UtYyKyW9aeLMv5stQUgj34ZPht fqtbmqlKVUtJttOXMXajUdOTbXssY/6LJAx7dLTpn7jSn95uKLjK/hf4A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yv20g81kq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jun 2024 15:45:51 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45JFjoT4023087; Wed, 19 Jun 2024 15:45:50 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yv20g81kk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jun 2024 15:45:50 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45JFclPS023957; Wed, 19 Jun 2024 15:45:49 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ysp9qdyqp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jun 2024 15:45:48 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45JFjhhx53149974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Jun 2024 15:45:45 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 43F5920040; Wed, 19 Jun 2024 15:45:43 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E6A2F2006C; Wed, 19 Jun 2024 15:45:42 +0000 (GMT) Received: from black.boeblingen.de.ibm.com (unknown [9.155.200.166]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 19 Jun 2024 15:45:42 +0000 (GMT) From: Ilya Leoshkevich To: Alexander Gordeev , Alexander Potapenko , Andrew Morton , Christoph Lameter , David Rientjes , Heiko Carstens , Joonsoo Kim , Marco Elver , Masami Hiramatsu , Pekka Enberg , Steven Rostedt , Vasily Gorbik , Vlastimil Babka Cc: Christian Borntraeger , Dmitry Vyukov , Hyeonggon Yoo <42.hyeyoo@gmail.com>, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Mark Rutland , Roman Gushchin , Sven Schnelle , Ilya Leoshkevich Subject: [PATCH v5 27/37] s390/diag: Unpoison diag224() output buffer Date: Wed, 19 Jun 2024 17:44:02 +0200 Message-ID: <20240619154530.163232-28-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240619154530.163232-1-iii@linux.ibm.com> References: <20240619154530.163232-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: QudXJDIvYziPgdRiaXecLoQXxGjFWwwP X-Proofpoint-ORIG-GUID: A9WWSzulaN_bPfxFgfkLwK1RnSV4YAj5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-19_02,2024-06-19_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 impostorscore=0 phishscore=0 clxscore=1015 mlxlogscore=999 priorityscore=1501 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406190115 X-Rspamd-Queue-Id: 5354440016 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ba45ujkfrw4o39dqtoodhia5i8gf3h6k X-HE-Tag: 1718813970-722470 X-HE-Meta: U2FsdGVkX18BsRjk0UkDvS6j8fzIUmj6HSwSdGqtnNmw3sEVFGr6/fYu1gvEG2AUfvitSlnDeQA6Hf/vassa0UIs2DeXfjJCjnmEcWmF/MrNdjSSBAJBx78pLeEoNNDGNln6M7PPyENm3bNfOao0sCYPsFEtCX6hmCRQQi8of8r7rARXM6grNd3bBUJVJ72DVvPbIZgVcqmbh0r9pxkbs1QEymJLjmX9/1cyVpbFzEPnuM0qg/NPMJb0rzRxJNiXqLb5BY8fvqCm4niEPNhj3Yui+LTB2hY/V5hZ5BcyyeYJ7POmb8GH5jylGOhmc6p9e0Ry5TMijgyVbFLDvZcMQatfKJP01aQGrJB4/6++uhH3loz3nIZ75h/IQ81piJ4b1tSsHq8mVkqTpF2+Af82H5g0rqCx/UJzeR8jfyBQ2G8HWYYFtLIz10wAz0ZcYe2Gwrqk4Aixx85QgL6vihBQjSzD2g12+oNhzyYXNJ4w+n03h8iaofNyKJBSTotMa5lPM7X8u1Nnuh+8y4tmP67Hp04tZZoSHBsjqKGnqPfIRmMHEDnLFOEzZlUxp7K1P7nlnB5eG1TogC5kLFpMoobcEY/gLpWHLxpPNAKUEaI2Yp2A8NsmTRlHbVkcjXUQkdAkNcerkr0YDAdRJ3TdxAJPTgEqWha+huGeSzX3VVB2Dt4m+g5j8THLHs9An/s2T5gYFSLETKzSDQy/zuifNfm4vJfZq5jjig5Z5119zAY1k6JEJIEO6bzZyUk2z42PWogoNKuZ6bI1NTe6NY9Wsur7AoQPuHA0unJk8EGzPOxQO5fjV4afUYgny7k5Mui+eDzVo4FJWEXt35zWSPZ9ySjLmqrDd4LIKEqFbuspCEwQ9+dClML1dSRfbN29UNDb8y/Kv8/KHxZz3xYgWiUvm7l2bFguTbtt+DH0zI8/n+2FtmbsffOe436S00CSpuemGCiYOYnx+OByG9PyotYUmLM /T6urTQL mfb99I0zwyywgPsRYoUVEX6c5/wtPvL2Jolpy7cXYw3kZYIjycL4jfem/AvjSCWMZJeT8ls1xw4Q0pgCJfLMdzhksVFla4772Dtntwi91bpEduGEKKZ2FywlEA7mNGHMD+0TqyNurCf0mVbnqVknptcKSNY++NRXlPcTifQ99YtOKkdEUBZx/fE70XAAsL81jt/0lSNr0yJ9NR2k3DiGy8A6U3t9bNHyCI1sbASRn4DdxTYCLgPnn1gxCIjdB55Zldpf6U4eDBxE9mCXkev9/uMUs/g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000034, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Diagnose 224 stores 4k bytes, which currently cannot be deduced from the inline assembly constraints. This leads to KMSAN false positives. Fix the constraints by using a 4k-sized struct instead of a raw pointer. While at it, prettify them too. Suggested-by: Heiko Carstens Reviewed-by: Alexander Potapenko Signed-off-by: Ilya Leoshkevich --- arch/s390/kernel/diag.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c index 8dee9aa0ec95..8a7009618ba7 100644 --- a/arch/s390/kernel/diag.c +++ b/arch/s390/kernel/diag.c @@ -278,12 +278,14 @@ int diag224(void *ptr) int rc = -EOPNOTSUPP; diag_stat_inc(DIAG_STAT_X224); - asm volatile( - " diag %1,%2,0x224\n" - "0: lhi %0,0x0\n" + asm volatile("\n" + " diag %[type],%[addr],0x224\n" + "0: lhi %[rc],0\n" "1:\n" EX_TABLE(0b,1b) - : "+d" (rc) :"d" (0), "d" (addr) : "memory"); + : [rc] "+d" (rc) + , "=m" (*(struct { char buf[PAGE_SIZE]; } *)ptr) + : [type] "d" (0), [addr] "d" (addr)); return rc; } EXPORT_SYMBOL(diag224);