Received: by 10.223.164.202 with SMTP id h10csp50335wrb; Thu, 30 Nov 2017 06:52:12 -0800 (PST) X-Google-Smtp-Source: AGs4zMadd5cxQGtJ+mr9ifQPz5TIEZAvSp06qVwtGDBFSNpOMfZUuavOv+YRs7JePk6zeUzOdXY+ X-Received: by 10.159.247.22 with SMTP id d22mr2808758pls.284.1512053532525; Thu, 30 Nov 2017 06:52:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512053532; cv=none; d=google.com; s=arc-20160816; b=a7bYD63nF1jWqEMhurU8FLWqsq//i809YVIVinDGg5jvrpAQFQiPtTl0ugUw7XBsc/ WOn3T7+etdBk648zOjeV8oeblacJwMxuY1DPq4getv3fObWKNTvmW4NB60Bdvmcg2kxN GlyamtHpKtuEvc8KTpTbRwErbIrl2K0oYVnKQw5DU7C8nuJbpE206SP7VuO4ryfY8nGs vZJQZKPA4sdrputSqYP9Nd2LYtGMh43MV1LGqqr6yK3ophE9BKxrKd8kINu75ZnrImAV Upqzm4SpaD5rM4ZTcHukvvwWsIaPBHKLNJF+dEX+LNmuuWlghSJc9sz8jXYFx2cI8vaw ctaA== 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 :references:cc:to:from:subject:arc-authentication-results; bh=8CLbwv7uS8ZkHoZqSEw+nr+H474G478V3u7KrITXVuc=; b=PCTB2fdCy2zYEOOZYnf/wfW93lq7yGr/E3x0jiZqTZ3g4AZVDgP4hg6itFjESFHaEa qGN14wa7QQ4f2gmiyB1XvUW4Pay7rE1CsBtDvF7y5sJUWNhZ2A7N5QAOmgfDf9da2nQk itpEw6thvzDFzWEKdlA6yn+y2zE8keBU6MTGSQpdbvyKKgy1ZVOgUMK3xZAJxF4yVUeS ThGmAkOGNYTOf8Cs5AWIc/e6oEMn39JQDoip+z/XpHdRfitnzNrlcVckQ2LXBVNRBq0c vIecRPRfMBU09SfifpKvOY24MxOti0ty2J8Ow0DOPaS1W+JtqZrX2vNeeN5JvprLlJqy ubsw== 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 m37si3242093plg.444.2017.11.30.06.51.37; Thu, 30 Nov 2017 06:52:12 -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 S1753235AbdK3Otp (ORCPT + 99 others); Thu, 30 Nov 2017 09:49:45 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58858 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752816AbdK3Otn (ORCPT ); Thu, 30 Nov 2017 09:49:43 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAUEnBTQ027148 for ; Thu, 30 Nov 2017 09:49:41 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ejkw3gs79-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 30 Nov 2017 09:49:41 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 Nov 2017 14:49:39 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 30 Nov 2017 14:49:37 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vAUEnaIi45940970; Thu, 30 Nov 2017 14:49:36 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E0D2AE045; Thu, 30 Nov 2017 14:42:42 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E06B7AE04D; Thu, 30 Nov 2017 14:42:41 +0000 (GMT) Received: from [9.145.49.184] (unknown [9.145.49.184]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 30 Nov 2017 14:42:41 +0000 (GMT) Subject: Re: [PATCH] vfio/iommu_type1: report the IOMMU aperture info From: Pierre Morel To: Jean-Philippe Brucker , "alex.williamson@redhat.com" Cc: "cohuck@redhat.com" , "borntraeger@de.ibm.com" , "zyimin@linux.vnet.ibm.com" , "pasic@linux.vnet.ibm.com" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1512041678-4563-1-git-send-email-pmorel@linux.vnet.ibm.com> <1ad1aff9-1651-d1a9-cd1b-07bfd7dd0817@arm.com> <7cf3e03e-e9b4-0e27-098b-3bc391abcf96@linux.vnet.ibm.com> Date: Thu, 30 Nov 2017 15:49:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <7cf3e03e-e9b4-0e27-098b-3bc391abcf96@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 17113014-0008-0000-0000-000004B16885 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17113014-0009-0000-0000-00001E444E6C Message-Id: <76879d8a-3c5f-2fb0-c8f9-100368eafa6e@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-30_04:,, 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711300195 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/11/2017 15:16, Pierre Morel wrote: > On 30/11/2017 13:57, Jean-Philippe Brucker wrote: >> Hello, >> >> On 30/11/17 11:34, Pierre Morel wrote: >> [...] >>> +/** >>> + * vfio_get_aperture - report minimal aperture of a vfio_iommu >>> + * @iommu: the current vfio_iommu >>> + * @start: a pointer to the aperture start >>> + * @end� : a pointer to the aperture end >>> + * >>> + * This function iterate on the domains using the given vfio_iommu >>> + * and restrict the aperture to the minimal aperture common >>> + * to all domains sharing this vfio_iommu. >>> + */ >>> +static void vfio_get_aperture(struct vfio_iommu *iommu, uint64_t >>> *start, >>> +��������������� uint64_t *end) >>> +{ >>> +��� struct iommu_domain_geometry geometry; >>> +��� struct vfio_domain *domain; >>> + >>> +��� *start = 0; >>> +��� *end = U64_MAX; >> >> I wonder if the default values should also reflect what the VFIO >> implementation actually supports. Looking at vfio_dma_do_map, a 32-bit >> host will reject any iova greater than 32 bits. In addition, >> vfio_dma_do_unmap doesn't support unmapping the last page of a 64-bit >> address space (existing IOMMUs would probably reject map requests with >> IOVA > 52 bits anyway, but if they don't report a domain aperture, VFIO >> can't guess it). >> >> I think it's convenient to use VFIO_IOMMU_UNMAP_DMA on the full address >> space when an unmap-all is needed, maybe we could provide default >> aperture >> values that help doing this? (~0U for 32-bit and (~0ULL - PAGE_SIZE) for >> 64-bit) indeed the error is to use uint64_t, I should *never* use this hardware specific values but simply unsigned long and -1UL/~0U at this level. Shouldn't the 52bit problem be reported by the iommu geometry? >> >> Thanks, >> Jean >> > > Thanks, I will take care of this. > > Pierre > > -- Pierre Morel Linux/KVM/QEMU in B�blingen - Germany From 1585500970684669986@xxx Thu Nov 30 14:19:14 +0000 2017 X-GM-THRID: 1585490648319889089 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread