From patchwork Fri Jun 21 00:25: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: 13706587 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 D7E7DC2BA18 for ; Fri, 21 Jun 2024 00:28:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4DD7C8D0106; Thu, 20 Jun 2024 20:27:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 23CF38D0109; Thu, 20 Jun 2024 20:27:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE5FC8D0108; Thu, 20 Jun 2024 20:27:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id AF2F78D0106 for ; Thu, 20 Jun 2024 20:27:10 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 693581206DA for ; Fri, 21 Jun 2024 00:27:10 +0000 (UTC) X-FDA: 82253006220.19.87C2429 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf06.hostedemail.com (Postfix) with ESMTP id 2021E180007 for ; Fri, 21 Jun 2024 00:27:07 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=PNF7gbL2; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf06.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=1718929617; 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=gr+fjR5se/zrOL48K91luHlaHrgB6ButquThF3PGxs3w+5hh+I6hm+tZ8k8KdOGanUYbVX LBI23N6B6XeveG/CMdLfCTh2Gj0ww/1cpRHXMvMTTkrhAommiQ/Aet+T/mBANp7AoMmf6Z 1tKs/tAQP/Mf02+OfG+4sGlgOIQATZE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718929617; a=rsa-sha256; cv=none; b=cBcpQqQCYYz9y3ZB6v4Cj48fnkemWTsVGyYV1CQiWFAgfPnooNcdcfAMyn09P6nMSP/eJH Aa7ICBwZK/vo8RQxNUW07IvlTbpvBWldXgZFYK6DJ0/R1KCBfaSWvfslJD2Q8n8gvFTumk kuAdS1e3bS31KitxqZ4po6adUnsh/PE= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=PNF7gbL2; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf06.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=iii@linux.ibm.com Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45KNtjEU028042; Fri, 21 Jun 2024 00:27:02 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=PNF7gbL2puZuQ+js/w+zDJTHu/+C9 CEQ/m504q8i3T4mqudfRdya9hSrjEodUkeke8DarSdwPD3jceJAWgB1D6VM/VpVp j7Kh5D9FGaWDsB2l5a1Dg+8PDV7LtkTh07U59cN+55mDRMMlmPN5Nnf7Kp3+C+6q rcgz2nDLzulci9yeR/yZUCsshoXuoIycM4u0mCrRV8C6aXTWrlFLfW/AmMBymZz4 sJJbfFwA3DVQAgVxt7n0Jfhnh9mZb93BSTkcP64eDCNMtyEYTzAWz3FXt53UkSte wad5R6D+6i2GzvX8qwURobdjfNG8AW6WQ8y6sfGxTbfvYHJbsajRLOcUw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yvw8c876e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 00:27:01 +0000 (GMT) Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45L0R1Ns007963; Fri, 21 Jun 2024 00:27:01 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yvw8c876a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 00:27:00 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45L0GVt1025708; Fri, 21 Jun 2024 00:26:59 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yvrqv2np5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 00:26:59 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45L0Qsuj16253276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 00:26:56 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 46D862004B; Fri, 21 Jun 2024 00:26:54 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 257B420043; Fri, 21 Jun 2024 00:26:53 +0000 (GMT) Received: from heavy.ibm.com (unknown [9.171.10.44]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 21 Jun 2024 00:26:53 +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 v6 28/39] s390/diag: Unpoison diag224() output buffer Date: Fri, 21 Jun 2024 02:25:02 +0200 Message-ID: <20240621002616.40684-29-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240621002616.40684-1-iii@linux.ibm.com> References: <20240621002616.40684-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: dR-59j4Kk4tyD4-uSWRXBGdaB4Fdihzm X-Proofpoint-ORIG-GUID: UqQveLdo15GSMG0ihOGcB2yNIYG0gRJI 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-20_11,2024-06-20_04,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 mlxscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210001 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 2021E180007 X-Stat-Signature: z66gw6zp68f5n4taay463r5bety6eiwe X-Rspam-User: X-HE-Tag: 1718929627-155813 X-HE-Meta: U2FsdGVkX1+gjp11Een+vJFIWoSCdLbhfv6GJlECDl5BN9kgQAY4GJLxw6CeV19R4P47Y+dR2xj2pQtGooNMSJ+AROPdJF+wcag1hIVK8JWPew2LvEwKIB8qYBOFhvLSUfD6EJVEik+zA0ejCXhHdS25jPSa1SOUEw4eRanH159I2FBWrMgmPYAV8oVMuPo0xAcGL6p1v3qIKzL6LQZOHuCOEjzloog8a5xrGSxbMqZz+crDmkuj0yXLEwgxch2LQh8H3EPeU9yr8Ik6Qi9MWsCMcufEE5DGhmNk049TLR0BSpfYvBc6klo+2XFo82U/PKjy88B2Ve3k0ZjzK/JJ1mIUbdKWSn8M4QTowRzW8XpgluFSBjGQYYbaGSAKo3qZDIsz5IYSp6wYF5Akpk2HhfyObE+KRAxQVdbkVBAVYsV/KvJq/lu5uGWwiSC8DdTfjTRH/Y59WzuHMY3EGtFE40pJaOeHxf3xCiLR6jc2uBd1vzn8Lx8s3H+MbpyoHHgGa/WnjSfOwhkbQOTP9IiVqzG6QcS4Q8P2Hj6OUFvtXbNI0lHK55sPd/eFScpTDjwu77JPuUxFhlq9XzDzueJa+OZL0a1e6FZDYEsE5CId8uWojttGtpPm8Smlp69OWysmh5DmXk2mKMH5L33T4CtmSY6dLmbjpzpKkPmVHCVDYVWcBaGSZ6VxfdC7T66koZA/kdDdMIvmGblbeVUNgZ4YRf6JYsy+/8tdpTqEVVg26EDY9QDH/YrtWsbppMJuyHy1bWKfT28f5BWIWohD6BoIebkMNUcaY6rD9ke7kcwyAH/shvYFgw+TteYlkRW0zaA8aGeHiaw0hyOZ9XAGpChsPm3zzbEsTTgiiQpzVj5ZU/X5B5/KUkT8DTA66nUEyuKia/jCmOIZY5bD060QFabz4wSg8Z0eKrU/VraDj/lnzHBExZ9uREHdz4VySGPbrS7hjx2KRjV1yptHq7QS8SP 8jQLsgXW CzKN+szlA/pknyezDH3U/Yy7ZRXpD4yMjuEufD5OQfP0wRCvevGHXW1Fet+L7cVydq8yg3zkjrx7UHEVl7ELzkn8ZrNYwES5alowUP968HY4kLfoxQBBxr2YMsfJzbiLU81lhLtOJRxC0zJNsEBT2mJQcdywQr7Dyz38K4AGatXSQJhAcTklhnbBGK68bAijNXYXSu/yqZoxNoy9oUlTLzICw8QOm7BJjm4wF7BQetGk/+PCenksHgRdzd7n1qWijvMur+Z6nMz6GwewaQdEQXWRSb11Q64HT+hI1NgdWWuEDpszxTEyDq+cLJ4ZY18AiCAPYHTXcmBYBj9hvCuZ7yizUUC+t8XY5K0jlFV52ENj2M5AeSPcNTcZBqQ== 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);