Message ID | 20240613153924.961511-27-iii@linux.ibm.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 BB959C27C4F for <linux-mm@archiver.kernel.org>; Thu, 13 Jun 2024 17:37:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 309AD6B00BD; Thu, 13 Jun 2024 13:37:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B7A96B00C3; Thu, 13 Jun 2024 13:37:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 17FBD6B00D2; Thu, 13 Jun 2024 13:37:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EDEA96B00BD for <linux-mm@kvack.org>; Thu, 13 Jun 2024 13:37:22 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A0A1816025B for <linux-mm@kvack.org>; Thu, 13 Jun 2024 17:37:22 +0000 (UTC) X-FDA: 82226571924.30.4B1FFC5 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf23.hostedemail.com (Postfix) with ESMTP id E0800140004 for <linux-mm@kvack.org>; Thu, 13 Jun 2024 17:37:18 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=S+yKKexk; spf=pass (imf23.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718300239; a=rsa-sha256; cv=none; b=mHJj6bQpAvG9JA+F8r2Wyn0Q6uCxABorW9st9YQNDXKFdNE+U84PYCl+4UgeqApqu1xJad x+N8R73NHRdgsj0/e6E5UhXXe8jcUnHVyuiVFws5MwwRTn/YciHieRLOv4f5TE7hWrr2Uw aLYVZ1BnmEPm+ar/fD0cbTgM4d7FzBc= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=S+yKKexk; spf=pass (imf23.hostedemail.com: domain of iii@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=iii@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718300239; 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=fXcYk+VdmTRPCkYYKoxIVDK6lI96vBOrCjw2t1Z32BM=; b=wlyhd+NrKQQMAn0bo4jNGWt5CQVv3rK+LIuzN20sB7sSQPwe6oDxCKoyzxN3M3qU89YrhH CmX4oAGONYQunEeUe9vsrVJjDv6r9CvCbka3UQNSM53/s5ErzDlIvGX7GTlYIa0NBivYVt aEJ8Ag4LaoxbWxZxIkiYSilStk5835M= Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45DEZMqu011319; Thu, 13 Jun 2024 15:39:55 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=fXcYk+VdmTRPC kYYKoxIVDK6lI96vBOrCjw2t1Z32BM=; b=S+yKKexkhzK6llI32AH9rCLuxFk7Y MuK0rSwnyynnXT2Of/r6V1Z4cZA9AwA+6y86s5MYcZ9F4AkoFwokKBegDvw+RS85 NL3G9O7h2KGgiYWy04i4/MUJdQC3A+LDg9wFF7ybPScd4ohOfuakUuIJ6ICO2Dr4 oUMUJQuFgVV64aSPvj8bsBr/l/LrqKUYAopuE2hz/iPX0iE/P2CxGY6bXsjOgBOK T8ptqc4MpL9vq+zGPXybfYWw/30rswf0CmNmZdCtL7RlY2c8Nj/E16heHyo6zVCc 7empj83Z5CUppmcsASS6xp11XGDrEjPSyl9UiwuiDu52VIi3xnDWKUk3w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yqx9b11u6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:54 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45DFdr6p006622; Thu, 13 Jun 2024 15:39:54 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yqx9b11u3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:53 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45DEIs5l008716; Thu, 13 Jun 2024 15:39:53 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3yn4b3rk1n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 15:39:53 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45DFdlCw34538120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2024 15:39:49 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 36F3820043; Thu, 13 Jun 2024 15:39:47 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B8B4120067; Thu, 13 Jun 2024 15:39:46 +0000 (GMT) Received: from black.boeblingen.de.ibm.com (unknown [9.155.200.166]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 13 Jun 2024 15:39:46 +0000 (GMT) From: Ilya Leoshkevich <iii@linux.ibm.com> To: Alexander Gordeev <agordeev@linux.ibm.com>, Alexander Potapenko <glider@google.com>, Andrew Morton <akpm@linux-foundation.org>, Christoph Lameter <cl@linux.com>, David Rientjes <rientjes@google.com>, Heiko Carstens <hca@linux.ibm.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, Marco Elver <elver@google.com>, Masami Hiramatsu <mhiramat@kernel.org>, Pekka Enberg <penberg@kernel.org>, Steven Rostedt <rostedt@goodmis.org>, Vasily Gorbik <gor@linux.ibm.com>, Vlastimil Babka <vbabka@suse.cz> Cc: Christian Borntraeger <borntraeger@linux.ibm.com>, Dmitry Vyukov <dvyukov@google.com>, 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 <mark.rutland@arm.com>, Roman Gushchin <roman.gushchin@linux.dev>, Sven Schnelle <svens@linux.ibm.com>, Ilya Leoshkevich <iii@linux.ibm.com> Subject: [PATCH v4 26/35] s390/diag: Unpoison diag224() output buffer Date: Thu, 13 Jun 2024 17:34:28 +0200 Message-ID: <20240613153924.961511-27-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240613153924.961511-1-iii@linux.ibm.com> References: <20240613153924.961511-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: sBifeLqkoYZGxv3xk2zoKYFp6VPoCgvk X-Proofpoint-GUID: m5hntwp6bIJOI40CcQ7BmmQ7MU6AE2Xn 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-13_09,2024-06-13_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406130112 X-Stat-Signature: j55wbirinn8pj6wifyi9qbe3yb5u5k5n X-Rspamd-Queue-Id: E0800140004 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1718300238-439559 X-HE-Meta: U2FsdGVkX1/avKGm1NuuivfwX/fMxU6fgisJIbmLYFDD3m9nyI9nKIJWsn86hJdkO4OXN2EmQ8ny3vKihIldWcAnA8gPizk8BKKj5xdLS/WZE1kx4MdOYa4E4nxcBb4zvzAUcfEQIE9Tj+bu8aoKyR1+WUuqKP2Jj7A3wsTOHET7IbY5kacRKxmvxePqaIH+OzperH5P4ZJEzBCXo3fLKEabJJPvW7xQEP0sGCQh4YOBwidOJ1EW1N6t8e89HSd56BSG03P3YiGof9vp/HyWnMYQ7T+yTY+rClzd7Ulyi3Gnai0F255kqnEp2i7p3WLw1ij2knMTLGUBBTtVLvX9WwiT7SP+MeKWiEoyvUjy5jheLRJxI+Ofpx2+3lUL6r7JCFWsLdPp+YyiDOB4vspxpYwKmWRIdIfpRDHR79VjK8PBOecTbK22ZwLapHnJT/PS94WryR0dFTCOEJHV4C86xZkTuRYYTYMvrHeoInLQMrg692lgMK0/reZ0XskLKDagFZ//paQICzi2Q7NfPHIm2zeRewi2sZRMlnJ5fVbceBYfAYGII3+9wYdsGIpomvIOBcGa5Mla+mVqT3FJX9jOnPg6fIb9lREENB5MVmNBndHNk448OfmKN1pxnGvFYDqj/ka8mcmF7Pv580zz/ftq3P5eDcjkmPQkD+w4sZS36yuvEuGACAQpqppAFLKLpOZQbJvZ16ijvi7kl8R0otiINY4IukRobvcHCXIf1RZyNtBHUKR4zzPqnzzQ92Js4IgS6QF7BxV1qMKDfXg93WMaoJL+5LI9qvm6KzJ6m2PfADJfM/jD2QUAjToU6ERjTlCYaspbmERZciru1JveiZZmPGuTMTJ9fBlUPWTevdt35QcTW9SmgzBH5KDQJR+B7q+sgqOClgSPsIY0qd7n9U29CoSkQNb/7gMkBabLR3pkri2zKcRq5OlId7ifRdCfnYGjJ4DPMy+l7JLQ5T4rxiD jujc0GBh hrTQBmO2e1uls/f/jZJtn5MHQkk1bbEQSpkAWxcbC0OPQjW6Lalraps0yK3G5oGxWAPpUfCHQc+jg+12PqUf1FpG6q98VVBO/cEIEnomPeQdAe5RnrTxne7jS4eVPrtWBlsy5QtAcu/T03LIsKu2sRJKUIXe12wdVADZHO+kQFnQ5ikSbbL54jbxnS9tvT5W4vNBe/WJCdAICSGj4vtFmHWAs5seJAmgIOvaS+DaDsaButGnl2MeYEV9OVwR/EW/npGF7zoYbzz5cU6v3BqVa/EgGLXV3HrPKogU818Y7NENlq8rmSZ++4b8Xq0Y7Y5SuXGmUWRolhzCQ3jMapN1IrugkVg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000070, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
kmsan: Enable on s390
|
expand
|
On Thu, Jun 13, 2024 at 5:40 PM Ilya Leoshkevich <iii@linux.ibm.com> wrote: > > 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 <hca@linux.ibm.com> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Alexander Potapenko <glider@google.com>
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);
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 <hca@linux.ibm.com> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> --- arch/s390/kernel/diag.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)