Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3141461imu; Fri, 18 Jan 2019 05:34:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN7kJIX56zTNDnLvTo9JDD/56h6x4IZSROjZVOcSziq2dDZxZxiJ9edW5LaM4zWAUxZMeeKF X-Received: by 2002:a63:2744:: with SMTP id n65mr17644848pgn.65.1547818499361; Fri, 18 Jan 2019 05:34:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547818499; cv=none; d=google.com; s=arc-20160816; b=dmsWSh2yYf3fQvJ6QV5s7qQZ2xqwcoonDBKJLOYkb0JNd2TWS5lrzjlcOs2AvueGmq G72hCVtiBfQ1VBR/sBP2uOUt8mXH+Ip/Zt9me5Mb4Hm84Dp1xa+p/zyfWklO2gvIB8Ar 4pRXzRDGawGFbMSkOybG5Fui0J4+yu0VuO64/qDdBvdTM0spIZ+xcpGVf//593Af0iMt WrrIbEw4KRIEABC8o2vRjkXQazU5bTM4SkDv+EeVcDkb13CWa5OP7ukbNNnXsapZJhir 61rV44IE+9bqWV8j93MzsjZc6wENB8cCgerieP/PFddnbGlH1nx1p4iHlU7nOzu/o0U6 8tww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject:reply-to; bh=P6g9ESZJSK3st6e+iF02Z4+e9YZG2m7CruzVv2T9emY=; b=0eWKM4DTryx7SeGfOjz1K5+sMxQEqtWkTNoF69IfimKSWRTpvQpp2VprDEl9MuaNfY xbQuStFj0oB+ILOJ5nTYQaK4FzT0KO1WBYAHB8tQO6bq0IXCp1qRRy+TstAdvXPNxfyJ ZtnwUw25vdbV7Yk+VMNg+HnURkXThujb/Y8gAYUSrZSMfTLBV0dRIkYQgK/BgTt630n2 VZJnzD8Vt+Q69BVBDq/RwYriv1Rujt+P6+xUqkKxkB9iL5CmDkIXRpbpKj5jSpIvjkgG EMNt4M2jDVsFAnoDMwbM1t3Q5syDZ2k+K1XCJEG08Lb9hCXnkzB4lXY8nMBffw/LbOnD 7uOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8si4607379plr.343.2019.01.18.05.34.44; Fri, 18 Jan 2019 05:34:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727332AbfARN33 (ORCPT + 99 others); Fri, 18 Jan 2019 08:29:29 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59762 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727115AbfARN33 (ORCPT ); Fri, 18 Jan 2019 08:29:29 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0IDSB87068980 for ; Fri, 18 Jan 2019 08:29:27 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2q3cxqen8x-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 18 Jan 2019 08:29:27 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 18 Jan 2019 13:29:25 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 18 Jan 2019 13:29:22 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0IDTLYA64225510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 18 Jan 2019 13:29:21 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3A677A4054; Fri, 18 Jan 2019 13:29:21 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D1F9FA405B; Fri, 18 Jan 2019 13:29:20 +0000 (GMT) Received: from [9.145.184.65] (unknown [9.145.184.65]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 18 Jan 2019 13:29:20 +0000 (GMT) Reply-To: pmorel@linux.ibm.com Subject: Re: [PATCH v1] iommu/s390: Declare s390 iommu reserved regions To: Robin Murphy , gerald.schaefer@de.ibm.com Cc: linux-s390@vger.kernel.org, walling@linux.ibm.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, alex.williamson@redhat.com, Jean-Philippe Brucker References: <1547573850-9459-1-git-send-email-pmorel@linux.ibm.com> From: Pierre Morel Date: Fri, 18 Jan 2019 14:29:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19011813-0012-0000-0000-000002E9C8D7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19011813-0013-0000-0000-00002120E938 Message-Id: <3cd790d6-aa6f-e817-27ce-56d7a9b6b6e5@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-18_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901180096 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/01/2019 14:02, Robin Murphy wrote: > On 15/01/2019 17:37, Pierre Morel wrote: >> The s390 iommu can only allow DMA transactions between the zPCI device >> entries start_dma and end_dma. >> >> Let's declare the regions before start_dma and after end_dma as >> reserved regions using the appropriate callback in iommu_ops. >> >> The reserved region may later be retrieved from sysfs or from >> the vfio iommu internal interface. > > For this particular case, I think the best solution is to give VFIO the > ability to directly interrogate the domain geometry (which s390 appears > to set correctly already). The idea of reserved regions was really for > 'unexpected' holes inside the usable address space - using them to also > describe places that are entirely outside that address space rather > confuses things IMO. > > Furthermore, even if we *did* end up going down the route of actively > reserving addresses beyond the usable aperture, it doesn't seem sensible > for individual drivers to do it themselves when the core API already > describes the relevant information generically. > > Robin. Robin, I already posted a patch retrieving the geometry through VFIO_IOMMU_GET_INFO using a specific capability for the geometry [1], and AFAIU, Alex did not agree with this. What is different in what you propose? @Alex: I was hoping that this patch goes in your direction. What do you think? Thanks, Pierre [1]: https://lore.kernel.org/patchwork/patch/1030369/ > >> >> This seems to me related with the work Shameer has started on >> vfio_iommu_type1 so I add Alex and Shameer to the CC list. >> >> >> Pierre Morel (1): >>    iommu/s390: Declare s390 iommu reserved regions >> >>   drivers/iommu/s390-iommu.c | 29 +++++++++++++++++++++++++++++ >>   1 file changed, 29 insertions(+) >> > -- Pierre Morel Linux/KVM/QEMU in Böblingen - Germany