Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1053859lqj; Mon, 3 Jun 2024 08:50:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXQXToQc8SIvLCScnRYTvRbaUx44j3K+AMZGmrTk63veAHghiURnkyV6r1xiS/kbZvLQu4EqSFeKo/oBLpj3RnfUNww0fSXbsZrorlECQ== X-Google-Smtp-Source: AGHT+IH+nL6reD8wj06vVD6Et7gAoQqjPDq+KtUoARzDGNV+D0D1LGW7mgOSLXVTxeyI9+9xZYNc X-Received: by 2002:a05:6a20:da92:b0:1b0:2865:fc28 with SMTP id adf61e73a8af0-1b26f1ace35mr11796571637.18.1717429849452; Mon, 03 Jun 2024 08:50:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717429849; cv=pass; d=google.com; s=arc-20160816; b=MpDnJDC/zJh6Sj2l9E3BnhBXNs4l0dn7hllAWXW3xvUBvniycSJM64NnuVxr4HDAW8 UdMgL9xVzrgbwAVyGODg8KPM2Fvamq1UZX5T88ho48mkyoW13xtChj7xeWPV356720wN d0Lba/1SrT58/QbZp3Orf9UAh/A1g9A0SRbqi+03BmSBv38I98yqm5434dH3ZE2lRyYB KrbgXpHfznOBgy00TWgN2VziFMCoAkTAN4PGNraEFSfH6Y0dCWOexSYt5sVmy6mzMwXF Ljg3qSVdHP8PHxcUgRBCvJ6NCg9l0YDDZOTgOdTdhtVyUFQW0+JuF31VNtoWpaCCklSF MIpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ePULW9uS93kgG+OIgTAxeB/WyHwiznBkNJw1F1YpuBE=; fh=ZgsXmTCx+Nx2OCJunOV0ZUa7sVG/jShf6UtlzPsmriU=; b=1Ja+BhXV0ciMyCnpXYIs4JbhHHJiaG217p0UOlylTeU5/QWnXpiQBCwg7spFzOO85D 6yZSQNDH84bwl3SNqp5/35PuWVgoLttoMU7r416DtIA9t7NRwJyH8+vEEz0O8rV2Xfq5 qoU/U244nJbKQQCjv0nwWicET5MPVmRMbDCrkZyELQSlFm92GiFULVW0L3PCcDQflPEM UvMfHvg7iu6irir2AHG/DMJ8oDhmq/gTQJVDGxtpke9SbkeDzOJANR7cnfInhQn+vbo9 MilruimT7x32G1JkYa/KHVWkbYbRCj9RjUFGsAUUULKFspfsSaHRt+gbwFDQx2FJcV89 WlrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=QwdmpTse; 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-199390-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199390-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35c73b854si580900a12.708.2024.06.03.08.50.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 08:50:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199390-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=QwdmpTse; 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-199390-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199390-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 1989F285771 for ; Mon, 3 Jun 2024 15:50:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCF72135A5A; Mon, 3 Jun 2024 15:50:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="QwdmpTse" Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 B667013211F; Mon, 3 Jun 2024 15:50:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717429825; cv=none; b=mc9ljL5ZOIU6Cam0o7jccq/4uqUj9csoL5y2Ndn7SY4+BrmLiItKG0xZB3I5MDJvXGdUBuM78pODI//yZp4kI9LD6DcGp99R5O5M4mLAXCyQ9kdfnSespKAt5swhcgnRfPXBXt2SRoXmk6IpBVdx8zu+NdZN6hg/X6QO6++rNsQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717429825; c=relaxed/simple; bh=09GW141vyhA3TWVs31bX+SwPdXlmzElACeiTQ7Wkt5U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nNj+Y4nvKe0Mj9J14FZOptjoTJFwZ24evBayO3k7qhrVto3QG7N3R4mqA5xx22XGl+4mzGkCFalOwhCDx3XB7nwfiYWl3mAuH5rgrR4owC4QxA8qpfGGIWGorgZRaG5Uvt6nOy39kXfZaog8Wdo/tnL5S85rHDPsXA77dzZ/HeU= 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=QwdmpTse; arc=none smtp.client-ip=148.163.156.1 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 (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 453EML8h011843; Mon, 3 Jun 2024 15:50:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc : content-transfer-encoding : content-type : date : from : in-reply-to : message-id : mime-version : references : subject : to; s=pp1; bh=ePULW9uS93kgG+OIgTAxeB/WyHwiznBkNJw1F1YpuBE=; b=QwdmpTseb4DoqUJZONNMyuTdOn1J31an/jDi+UobJiCyf74Hspz5UtUeCSG3XdegDFug /ocHPQ+NDJJZRtQI6WVbyOnQoQo4ODl3gCVBjdkhF2TDXEt3zZPikUz2J9t10IibTKrs y45w0qZoW05psOZYrC0HtUQgOytIqU7DYjm3AHNUiw7w2BH/TxPYXColqHcpjyBZ3fVf tRauuNhUJgdojrmahftaTWagN4zPKE/6h0EhGqU3HYeY2q0jqjtIaWfzZGxF+RZ/KrvN U0j6F5EQ73pZpG1Fv3fA9445yDqAt+Z4qxOg9zrJFHgL7NdihePu1ttXN5qCcxGxc9j4 SA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yhfhf08yd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 15:50:21 +0000 Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 453FoKMe027561; Mon, 3 Jun 2024 15:50:21 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 3yhfhf08yb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 15:50:20 +0000 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 453DsDn8022851; Mon, 3 Jun 2024 15:50:20 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3ygg6m0d8v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2024 15:50:19 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 453FoEY530212802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Jun 2024 15:50:16 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B1B32004D; Mon, 3 Jun 2024 15:50:14 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B41CF20043; Mon, 3 Jun 2024 15:50:13 +0000 (GMT) Received: from [9.171.29.243] (unknown [9.171.29.243]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 3 Jun 2024 15:50:13 +0000 (GMT) Message-ID: <0a4622ce-3826-4b08-ab81-375887ab6a46@linux.ibm.com> Date: Mon, 3 Jun 2024 17:50:13 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 0/3] vfio/pci: s390: Fix issues preventing VFIO_PCI_MMAP=y for s390 and enable it To: Niklas Schnelle , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Sven Schnelle , Alex Williamson , Gerd Bayer , Matthew Rosato , Jason Gunthorpe Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <20240529-vfio_pci_mmap-v3-0-cd217d019218@linux.ibm.com> Content-Language: en-US From: Christian Borntraeger In-Reply-To: <20240529-vfio_pci_mmap-v3-0-cd217d019218@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: yLwbTIUJCGJRQ7SW9Ff88cFp0q37B-SI X-Proofpoint-ORIG-GUID: cCbs5DZtHoS1VFTHzvR-EER9Z_FDY-XW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-06-03_12,2024-05-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 clxscore=1011 mlxscore=0 bulkscore=0 spamscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 mlxlogscore=877 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406030131 Am 29.05.24 um 13:36 schrieb Niklas Schnelle: > With the introduction of memory I/O (MIO) instructions enbaled in commit > 71ba41c9b1d9 ("s390/pci: provide support for MIO instructions") s390 > gained support for direct user-space access to mapped PCI resources. > Even without those however user-space can access mapped PCI resources > via the s390 specific MMIO syscalls. There is thus nothing fundamentally > preventing s390 from supporting VFIO_PCI_MMAP allowing user-space drivers > to access PCI resources without going through the pread() interface. > To actually enable VFIO_PCI_MMAP a few issues need fixing however. > > Firstly the s390 MMIO syscalls do not cause a page fault when > follow_pte() fails due to the page not being present. This breaks > vfio-pci's mmap() handling which lazily maps on first access. > > Secondly on s390 there is a virtual PCI device called ISM which has > a few oddities. For one it claims to have a 256 TiB PCI BAR (not a typo) > which leads to any attempt to mmap() it fail with the following message: > > vmap allocation for size 281474976714752 failed: use vmalloc= to increase size > > Even if one tried to map this BAR only partially the mapping would not > be usable on systems with MIO support enabled. So just block mapping > BARs which don't fit between IOREMAP_START and IOREMAP_END. > > Note: > For your convenience the code is also available in the tagged > b4/vfio_pci_mmap branch on my git.kernel.org site below: > https: //git.kernel.org/pub/scm/linux/kernel/git/niks/linux.git/ I guess its now mostly a question of who picks those patches? Alex? Any patch suitable for stable?