Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp446624lqp; Tue, 11 Jun 2024 08:58:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVfEcvLiAfwp4RpgejzdkBGrxJxuCQ8YeeG0sVxEFY543XfJiZIg81OzvL3cVJMWpjwKJw1Cd81s7JPXp2srLn8Zeg5Q76N6CYRA7bzJQ== X-Google-Smtp-Source: AGHT+IF/1wcpF+9p19vz+TCVzYAAIao1zV7poV/KqIBHWKZYocEuAWz2LNR7f0eIINSXv5SNSQkt X-Received: by 2002:a17:902:b202:b0:1f6:f0be:4099 with SMTP id d9443c01a7336-1f7287a775fmr32109315ad.11.1718121480980; Tue, 11 Jun 2024 08:58:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718121480; cv=pass; d=google.com; s=arc-20160816; b=vKDdGfzh8dl37055psIehWAPH9GD0sXqaiTPumyn8HxyHo//ihMq/OQ3BKtmo+cQbB t6OJvgHazCIAnEE24a2gLwkDSw/26OGv1bw3OikRpg5SrcdFU2IEq50TCZWWhcR+AHzZ 2T53sOlIS9vtbY5d1JFlb7Wd4a2+KD/i1dmdPwugwNkDHMksewEIczSui7z+EcAnTIOi D3q0voit6S+WfWs7KSuNQuxPufhgcjiA5Po4YKIknWVlnqKFAM/+RKixLO5Qx2kFrTiY qn6gixIsg75kCYmSkVUn/0T0Omb5jllpUfb3adzyCVEY9fD7qZRP/ZjU3d1K4iu2sZRQ 7oGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=45+dVaWKEseo9wRgdUbebA5x8u1OeoPOZXERLsoqD5A=; fh=2jaHY1cHumjbpqy16O3sCIG8UC12BT8t82KoX9umv8s=; b=AVPUGHoHVPYUBQRYIKFOz32TyXUhmnkfpnXs7loRwyWc3MtxqiE5ZYfYL+8N2gH2Ap H/y3XxHsB/TfyhXfL9Rqd4wH8lE6e8WzZhsNPGsy8XqTM6XNbZqPWy5nv03LvQ93UwSG vEONCsmD3mD2yUyLCBFIFBUPT4Kjzik9FtP5wI/or1lQxtpjhOPNK3Q8YkX119ECcujQ n9oxpEsoKNYg3kXKfahjH9823uwHE6SGh7QHlQpv4gydijH7bXK0Wn72aoxqK3ahtikI N/xQ7xeNueUPviS0XjC8J21NYS2CqLVhXUpktImQbBTtsZBADhsmRO9sbG+HjMyDhS75 mMqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=i0SwK53x; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-210190-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210190-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f720511b27si26161815ad.547.2024.06.11.08.58.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 08:58:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210190-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=i0SwK53x; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-210190-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210190-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 68EA2286541 for ; Tue, 11 Jun 2024 15:57:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0915239FD7; Tue, 11 Jun 2024 15:56:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="i0SwK53x" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B53051DA4E; Tue, 11 Jun 2024 15:56:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718121417; cv=none; b=jCwO2xDh9rpYdpsnT9pXxHIpHbPPkdDwz1LT48MLX/PZ9Pp9MVBpzVqe4f/4z+wc06ok2akifxjmTu4b6S3454m/IdJctdBsrfFwyIQRF0iOCiQAapfmkHuaCEA7n/or307hlldWQ95dscNvAhpiv8JHQvmQHMFG8PZ4YVObC6Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718121417; c=relaxed/simple; bh=45+dVaWKEseo9wRgdUbebA5x8u1OeoPOZXERLsoqD5A=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=I1u4HiZukwPTUmXWYcCEdEoX1NtKoT9HOTJGNbyvNfj3Ly2ryGgJXaVVgkbJTd4SI5E7t3KWSXYzIEKacoyZ1PIJ1Fe/b5KedqgIYffosLgRGAB4lg5CPfkhzyB7YHPazdtyYpIXoaD3e0yViN2OKMwlLtK3inKlwpw9co1JeBA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=i0SwK53x; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45BDRAPK030409; Tue, 11 Jun 2024 15:56:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h= message-id:subject:from:to:cc:date:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s=pp1; bh= 45+dVaWKEseo9wRgdUbebA5x8u1OeoPOZXERLsoqD5A=; b=i0SwK53xA6lC6JVJ gotszV1ia/m2nXYoEYtEPkir92GzedxRAwwqG5l3zA6kOn33KWvhItyXslXsxcLo u1b8E9xn1OhrUUnRotp6kMxb90cqVA5IvKTl66346ARHumFq/pgclsblE9ibL9Gm z4Xi+jKfFHhCzgke8caud+HOOqc/gDDPi/3X11Jn1PNRyuLNRFfVb2BUqB/w7JDA e1goxjBYz1xp7OZVHz97AVp0zWo1u+hhI1rmePOA0ZzfR+8MglrHvdE4pAPv6l6z pwEVWBKtQgZU7LOVImDrDkVCqDTeWb/L9CpacGu9iN8xGqdbWWQ747AQ/y92dk1D 0/EefA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ypnrcrnmf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 15:56:54 +0000 (GMT) Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45BFuJHP002650; Tue, 11 Jun 2024 15:56:53 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ypnrcrnmb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 15:56:53 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45BEVcSa020066; Tue, 11 Jun 2024 15:56:52 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yn34mxk54-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jun 2024 15:56:52 +0000 Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45BFun1845548140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Jun 2024 15:56:51 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B0DEF58059; Tue, 11 Jun 2024 15:56:49 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E46DD5804B; Tue, 11 Jun 2024 15:56:46 +0000 (GMT) Received: from [9.179.8.185] (unknown [9.179.8.185]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 11 Jun 2024 15:56:46 +0000 (GMT) Message-ID: Subject: Re: [PATCH v3 1/3] s390/pci: Fix s390_mmio_read/write syscall page fault handling From: Niklas Schnelle To: David Hildenbrand , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Alex Williamson , Gerd Bayer , Matthew Rosato , Jason Gunthorpe , Suren Baghdasaryan Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Date: Tue, 11 Jun 2024 17:56:46 +0200 In-Reply-To: <89c74380-6a60-4091-ba57-93c75d9a37d7@redhat.com> References: <20240529-vfio_pci_mmap-v3-0-cd217d019218@linux.ibm.com> <20240529-vfio_pci_mmap-v3-1-cd217d019218@linux.ibm.com> <98de56b1ba37f51639b9a2c15a745e19a45961a0.camel@linux.ibm.com> <30ecb17b7a3414aeb605c51f003582c7f2cf6444.camel@linux.ibm.com> <32b515269a31e177779f4d2d4fe2c05660beccc4.camel@linux.ibm.com> <89c74380-6a60-4091-ba57-93c75d9a37d7@redhat.com> Autocrypt: addr=schnelle@linux.ibm.com; prefer-encrypt=mutual; keydata=mQINBGHm3M8BEAC+MIQkfoPIAKdjjk84OSQ8erd2OICj98+GdhMQpIjHXn/RJdCZLa58k /ay5x0xIHkWzx1JJOm4Lki7WEzRbYDexQEJP0xUia0U+4Yg7PJL4Dg/W4Ho28dRBROoJjgJSLSHwc 3/1pjpNlSaX/qg3ZM8+/EiSGc7uEPklLYu3gRGxcWV/944HdUyLcnjrZwCn2+gg9ncVJjsimS0ro/ 2wU2RPE4ju6NMBn5Go26sAj1owdYQQv9t0d71CmZS9Bh+2+cLjC7HvyTHKFxVGOznUL+j1a45VrVS XQ+nhTVjvgvXR84z10bOvLiwxJZ/00pwNi7uCdSYnZFLQ4S/JGMs4lhOiCGJhJ/9FR7JVw/1t1G9a UlqVp23AXwzbcoV2fxyE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fgctfvrWWLBq7+oqx73CgxqTcGpfFy tD87R4ovR9W1doZbh7pjsH5Ae9xX5PnQFHruib3y35zC8+tvSgvYWv3Eg/8H4QWlrjLHHy2AfZDVl 9F5t5RfGL8NRsiTdVg9VFYg/GDdck9WPEgdO3L/qoq3Iuk0SZccGl+Nj8vtWYPKNlu2UvgYEbB8cl UoWhg+SjjYQka7/p6tc+CCPZ8JUpkgkAdt7yXt6370wP1gct2VztS6SEGcmAE1qxtGhi5Kuln4ZJ/ UO2yxhPHgoW99OuZw3IRHe0+mNR67JbIpSuFWDFNjZ0nckQcU1taSEUi0euWs7i4MEkm0NsOsVhbs 4D2vMiC6kO/FqWOPmWZeAjyJw/KRUG4PaJAr5zJUx57nhKWgeTniW712n4DwCUh77D/PHY0nqBTG/ B+QQCR/FYGpTFkO4DRVfapT8njDrsWyVpP9o64VNZP42S+DuRGWfUKCMAXsM/wPzRiDEVfnZMcUR9 vwLSHeoV7MiIFC0xIrp5ES9R00t4UFgqtGc36DV71qjR+66Im0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.2 (3.52.2-1.fc40) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 0nJyeWLg9QpUTK0SdVYcJDDvlXBRGmUk X-Proofpoint-GUID: Y-yDEF0epXdZjAlLdMais6SfnTi6TkgT 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-11_09,2024-06-11_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1015 mlxscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 mlxlogscore=787 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406110114 On Tue, 2024-06-11 at 17:10 +0200, David Hildenbrand wrote: > > >=20 > > > which checks mmap_assert_write_locked(). > > >=20 > > > Setting VMA flags would be racy with the mmap lock in read mode. > > >=20 > > >=20 > > > remap_pfn_range() documents: "this is only safe if the mm semaphore i= s > > > held when called." which doesn't spell out if it needs to be held in > > > write mode (which I think it does) :) > >=20 > > Logically this makes sense to me. At the same time it looks like > > fixup_user_fault() expects the caller to only hold mmap_read_lock() as > > I do here. In there it even retakes mmap_read_lock(). But then wouldn't > > any fault handling by its nature need to hold the write lock? >=20 > Well, if you're calling remap_pfn_range() right now the expectation is= =20 > that we hold it in write mode. :) >=20 > Staring at some random users, they all call it from mmap(), where you=20 > hold the mmap lock in write mode. >=20 >=20 > I wonder why we are not seeing that splat with vfio all of the time? >=20 > That mmap lock check was added "recently". In 1c71222e5f23 we started=20 > using vm_flags_set(). That (including the mmap_assert_write_locked())=20 > check was added via bc292ab00f6c almost 1.5 years ago. >=20 > Maybe vfio is a bit special and was never really run with lockdep? >=20 > >=20 > > >=20 > > >=20 > > > My best guess is: if you are using remap_pfn_range() from a fault > > > handler (not during mmap time) you are doing something wrong, that's = why > > > you get that report. > >=20 > > @Alex: I guess so far the vfio_pci_mmap_fault() handler is only ever > > triggered by "normal"/"actual" page faults where this isn't a problem? > > Or could it be a problem there too? > >=20 >=20 > I think we should see it there as well, unless I am missing something. >=20 > > >=20 > > > vmf_insert_pfn() and friends might be better alternatives, that make > > > sure that the VMA already received the proper VMA flags at mmap time. > > >=20 >=20 >=20 > There would be ways of silencing that check: for example, making sure at= =20 > mmap time that these flags are already set, and skipping modifications= =20 > if the flags are already set. >=20 > But, we'll run into more similar checks in x86 VM_PAT code, where we=20 > would do vm_flags_set(vma, VM_PAT) from track_pfn_remap. Some of that=20 > code really doesn't want to be called concurrently (e.g., "vma->vm_pgoff= =20 > =3D pfn;"). >=20 > I thought that we silenced some of these warnings in the past using=20 > __vm_flags_mod(). But it sounds hacky. >=20 > CCing Sureen. >=20 Before I forget it, thanks a lot for your incredible help David!