Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1889788imu; Thu, 17 Jan 2019 05:05:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN7acPKPFVYKu7Mnes94V2eQ9M5EYa0U32/A874CETi5RmKtIviAM7rQjdG6F2DW1t39ctNi X-Received: by 2002:a63:6346:: with SMTP id x67mr13387383pgb.183.1547730359287; Thu, 17 Jan 2019 05:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547730359; cv=none; d=google.com; s=arc-20160816; b=eh8hDvdFuImS2c1fQ+xHy22uJtuJZu4hspXK43smMiqgqrqRikix2LAgQuQkeZB+t1 ekxLXNLi7E9MchHyH2CSJkIKTajJpV8Cv8BP9mwOJjtPh9zoY/hXMLUwqgABsZ2pYjmf qlN6IpX4x2F0QtyXeWOYYAVBYd3unI1l+q5QBzQI0bDWaAbE9PI/46N1WlmL2/IulooA ily+u+oqPR3lv5FvzoywWJFMdj5bZ5OtoZkyFdTES0Mez5jXBQ6i3pX5KNMqzwBwX16j 0P21SjpmfmjgBacSy1t7NsMKfNEhSIedtWyN3tHsFtROF8mMOSJxgEmQFCy8lb1I22jC EyJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=xJr1xuSlpW+rlDzG0cZEenbHPLb02/W4GglNO4t2Tk4=; b=U5qIHRBHqbWNq4RfhY4XbEwy+SL/YtfkGgjwtMarDmVEBtzZ2xysfAJ7SqpLUdIR8e 6AzMm75iNmmX7d3VSRX9eHAoIU269Qbt2q9IUQY90NK9k/Evrdmv/1uHYZx4taUPq3Wh Iuf9bfFKYkcVmu3G5n7BE/dEeg3qSs3iRIlKg4CGUxK9XkyMozFA6UlHcrZHr95jLbtr 0yULAvh0dIYjDJQk4xwf8UxMc2iTO2vjLbzZmRbFAb5LEztESTDJEhuWNDCRyhiI4AAK kiMYdBuMfHIOE483ZEhRNl+s4ldPI3uCzhuO1+ve8JEUSDstzBeBIxQ0/ABwAqNrQapO YMQw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16si1470424pgh.283.2019.01.17.05.05.41; Thu, 17 Jan 2019 05:05: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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727903AbfAQNCT (ORCPT + 99 others); Thu, 17 Jan 2019 08:02:19 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:39580 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727334AbfAQNCT (ORCPT ); Thu, 17 Jan 2019 08:02:19 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C3EAA80D; Thu, 17 Jan 2019 05:02:18 -0800 (PST) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6B9393F557; Thu, 17 Jan 2019 05:02:17 -0800 (PST) Subject: Re: [PATCH v1] iommu/s390: Declare s390 iommu reserved regions To: Pierre Morel , 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: Robin Murphy Message-ID: Date: Thu, 17 Jan 2019 13:02:12 +0000 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: <1547573850-9459-1-git-send-email-pmorel@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > 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(+) >