From patchwork Fri Jun 21 11:35:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13707342 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 4F517C27C4F for ; Fri, 21 Jun 2024 11:38:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4B378D0161; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D5BC58D0160; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B61AD8D0161; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8F67F8D0160 for ; Fri, 21 Jun 2024 07:37:42 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 4D61EA31B2 for ; Fri, 21 Jun 2024 11:37:42 +0000 (UTC) X-FDA: 82254695964.19.2E9CA32 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf17.hostedemail.com (Postfix) with ESMTP id 1741140014 for ; Fri, 21 Jun 2024 11:37:39 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=PnM2VyUr; spf=pass (imf17.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=1718969852; 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=c61jtsuYwmT7TkyfffJK8Hu4ci6s6Nm2qTgHzoy0KuENfvkaNhgflmPAzn42+1HZSziyeK 0PUbLB0RDPBxF+Eh6snWmxqqDRHnrOYIdo0q2HJA+UJz4fo49owiiDlqnay1jYa1bGBDSJ U+gz0c+IRiLWI6TAMumQEsoidoyGcAs= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=PnM2VyUr; spf=pass (imf17.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=1718969852; a=rsa-sha256; cv=none; b=t8LZ0qfsJpZpZyWPCCeCopHnzNNMPJigiweAVCGnOr6RTcaFmVh7Y4+vtzq0+1DuM3x4YM st95FwwW/7oBmVKzrEk1+MBcItqdjtAKlPidvMG/xkGRbUTEd3fBjtLH3XdCK+g8KqcqWv vPLKTW6jAGgW40AZ8bQH3HKepWOGXOU= Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45L8D1FD021879; Fri, 21 Jun 2024 11:37:34 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=PnM2VyUrLwLHYDwwa+7hKTD9pVEoo NebLaDJzAQhWuQfIwxDBXvxo164vHbEa/h/kAqIEquRdfWu310idRcLY2iEmGSfQ YJisT4nqZKD4ouqZVq4+BJxuzXkpSsGWVfohBtvqliHgoZlkjYDAlQ/RL9SMD1rq 9/8ngArEoxjkjPwnYMAjqsKJPBqdJYzGvGOzMoMMEO2gxQLXnWM+VQUXUq5u0Cmt V7Ehtm/pltH0mO+eGGUIX1wsin0++ELL/6Cu4gfm4OUTbfG9HyeHp3tUNj/DlxyH 9mGzJQJXeTScF8J4TpbDe/eBMitDX0X47HbpG4OJb5oNuaeQ4MuSNdV6A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yw5ksrgv2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:34 +0000 (GMT) Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45LBbXVK011203; Fri, 21 Jun 2024 11:37:33 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 3yw5ksrgux-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:33 +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 45L9EaNq019935; Fri, 21 Jun 2024 11:37:32 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yvrqupw0c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jun 2024 11:37:32 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45LBbQvw39059716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 21 Jun 2024 11:37:28 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 446842004F; Fri, 21 Jun 2024 11:37:26 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9FC8720043; Fri, 21 Jun 2024 11:37:25 +0000 (GMT) Received: from black.boeblingen.de.ibm.com (unknown [9.155.200.166]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 21 Jun 2024 11:37:25 +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 v7 28/38] s390/diag: Unpoison diag224() output buffer Date: Fri, 21 Jun 2024 13:35:12 +0200 Message-ID: <20240621113706.315500-29-iii@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240621113706.315500-1-iii@linux.ibm.com> References: <20240621113706.315500-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: K1yfeVLY1XzD6dN6lzEspmtPxCXRFnpI X-Proofpoint-GUID: 0TwX7BudASTb7mZSUIMXE0d_8a29542w 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-21_04,2024-06-21_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 clxscore=1015 mlxscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210084 X-Stat-Signature: qsowx5yptgchm1tk77y78345gegixz5p X-Rspam-User: X-Rspamd-Queue-Id: 1741140014 X-Rspamd-Server: rspam02 X-HE-Tag: 1718969859-79400 X-HE-Meta: U2FsdGVkX19A4D97Cr0nnXJAzT0PZr6rbDu15DY8HrSI2LbV7IYpgvVkISYMVzBDn068rRFvz0uYfTZ1B19RlBeAg60MDh3kD2P5UODZrbTd6AtlkOZ9eJgIu9n09oAgSZPdZp3dOsDLwovvoc+k9meWOVQFDcLEgqt3y59L6oi66IpmEUazyV/I0HQdbMCyMkwuAbIQe2DDZ4AoCZxQ4ljEUxfa8Cf5LkLz2aTNeHKTwwZvQ3lx1z5tol5RuHMH48Gnj+bMsUUyde4yCfk/MDl0o+7c53NUDxVTn4IPVOYpPOOy45qBsAmbRVvpKVovWixMWeJ5zKdS16kcV0S59laYk5BmKhoQIJLdnWu6ZEYgAkaNwqbtmRPwBw5frK3Wn2B883I1lUjAZNF6ZvNGobwl7Yzizz5g1k8T2FyZe4iCpmaFuvWF1hpU3ywqqCa4//9ZaDgty1o0+eTWXPy9Wm+0VRvNm7Xc+gDmfUMuOQaPrx2tkelrvQKThbVDvooiyVGpiZHZ+dwO9jGMhPohEq+VoUlpNThI026OQp97fKNsA5SQAjQ8cJGb2IzOp9Xz+Dh5Hy8aQwX7mNIN+wwLrEPqwUbMgxtHQLuf8jE1FIKFDcsuZMblipYEcxtwNTmQuLjc+Bnr1EXxeXCn8U4vwcxTOPkomI8m5j8tMjoN77DFsB9JW575Exaa43CvAf3AI8U/odwUYVeuz/J7CRcFJnuyXLxLX2md//v6BuUOQsBEpaMRyVv3tzfFK0JNhBbari1kAgzDBCq0vZ/UT4tO+Vi9UV49lwxbznesaxz0/EKn59FTefG7LHIyeW5pnldr5MCHgh7gW6hDY3gg90Q3keGyCAbLamv5h8LDQ6ZmMdr8jGTkvW7IBZhc55fL5H2xonzwpOs6oinjK8FMfPgzYPgopTuV7fhJ6rTTPOZWp+tEy4zWgABUe0NRRmAX9Ov7NYMtDW6Z/Q9srdB/mfP 0tVnRJZ1 6IC4B09MvHxe8ZMP+DdnlAQkHhlu5k4ou3F5uaFqZ4MLeAht4eX5i9GVuYNS5yLl1SrmF5C215L818YC91aJS6zqRZqGKCr7LqO9bkvAJ2tTCqJLowSg5N/xypoEKW44op08WL7ubs0VpE0v0QOu689jIMuQmqkgr2Plit8C1Ykwkb0FDZh2hP3hW5lMyvQ2euFtbgHCaqpnTab5IAQEzJ4A2HicbnMhU6+V3Go5OmuL/sC4JEYPCD5UiAQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000022, 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);