Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3761675imm; Tue, 29 May 2018 13:09:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpXBGHyzUFJyKf5sPXJyWR9iz3KOPYSgCrgMup0bwHOr0vosoxdenPjc2Hl3dN6ror5EoL0 X-Received: by 2002:a65:6604:: with SMTP id w4-v6mr15037961pgv.102.1527624599030; Tue, 29 May 2018 13:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527624599; cv=none; d=google.com; s=arc-20160816; b=tuMSmWQOv8wg73vCOqJLeXpXL/xsAzsYaakEzdUZUajQAY41TGyNRtqmrDQC2LaA3E 0WCqHIc17h6UNagFHBrWkS7KxwT4OQj8oEW8haNxPOaDlW5eZSNd51Yf7vtmLApEWzfW 0y+BgwgICuFKfl/JxJzklr89E7oR4l0RLXID9+SO+abNKh+rtcmJ8OKYRCD5/iEsEbYu NlKRRvqlof3M6pHCAsBDH3I18axNZ6QWc3ZNlE7A+nEFrU64zNrENiOPL6VpjAoYduaH nlor9Rdi3n2V+a2TKvFDCmbCknwnikzTH4e7kpwrhyhnbmA5617IxdEvVoLKNjF3tOoF QUHQ== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=15fw3AiY7LTGQqfdbQR+uzYiwwx/wPAE6DHOvTkW/80=; b=VAxusuQ2p4cmra3VKAPu42bed9AURLz9dg9Tp2ORGPeEsXzNO44oh7AOv5Fm4WNISy e6Zinvo8BbKtVEsQ2/dOHiXC3YjSxP+0bfO416NOnZ8siFZXoW6WivEWoeCvs6P6fbMe +j/PDprYldL40pkeXrwpGtAvwjXp6cupfXu8SjfiWTmvNztCw09zlEV6WDJpgRdp/wgw /Ew5rcHDIKtPoayoCL8IaQy1KmTHuDNAOiH7et2wiJX/mEwr5Iy6+mjspKew6j0BgLzM Wk3vmr58t8MTwGQM5WEjdIk4fH9UFBjEreG4wxWwl6w5k0jzlPpTjyUMTtZzu9LzzpWo E1Ag== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i4-v6si32940211plt.581.2018.05.29.13.09.44; Tue, 29 May 2018 13:09:58 -0700 (PDT) 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966562AbeE2UJS (ORCPT + 99 others); Tue, 29 May 2018 16:09:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40227 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966179AbeE2UJR (ORCPT ); Tue, 29 May 2018 16:09:17 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B05D0300196C; Tue, 29 May 2018 20:09:16 +0000 (UTC) Received: from w520.home (ovpn-116-135.phx2.redhat.com [10.3.116.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C4EA2010CA4; Tue, 29 May 2018 20:09:15 +0000 (UTC) Date: Tue, 29 May 2018 14:09:15 -0600 From: Alex Williamson To: Jacob Pan Cc: Jean-Philippe Brucker , "iommu@lists.linux-foundation.org" , LKML , Joerg Roedel , David Woodhouse , Greg Kroah-Hartman , Rafael Wysocki , "Liu, Yi L" , "Tian, Kevin" , Raj Ashok , Jean Delvare , Christoph Hellwig , Lu Baolu , Yi L Subject: Re: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function Message-ID: <20180529140915.1f174689@w520.home> In-Reply-To: <20180420164251.5245f822@jacob-builder> References: <1523915351-54415-1-git-send-email-jacob.jun.pan@linux.intel.com> <1523915351-54415-5-git-send-email-jacob.jun.pan@linux.intel.com> <20180417131047.0a9c310f@w520.home> <20180420164251.5245f822@jacob-builder> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 29 May 2018 20:09:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Apr 2018 16:42:51 -0700 Jacob Pan wrote: > On Fri, 20 Apr 2018 19:25:34 +0100 > Jean-Philippe Brucker wrote: > > > On Tue, Apr 17, 2018 at 08:10:47PM +0100, Alex Williamson wrote: > > [...] > > > > + /* Assign guest PASID table pointer and size order */ > > > > + ctx_lo = (pasidt_binfo->base_ptr & VTD_PAGE_MASK) | > > > > + (pasidt_binfo->pasid_bits - MIN_NR_PASID_BITS); > > > > > > Where does this IOMMU API interface define that base_ptr is 4K > > > aligned or the format of the PASID table? Are these all > > > standardized or do they vary by host IOMMU? If they're standards, > > > maybe we could note that and the spec which defines them when we > > > declare base_ptr. If they're IOMMU specific then I don't > > > understand how we'll match a user provided PASID table to the > > > requirements and format of the host IOMMU. Thanks, > > > > On SMMUv3 the minimum alignment for base_ptr is 64 bytes, so a guest > > under a vSMMU might pass a pointer that's not aligned on 4k. > > > PASID table pointer for VT-d is 4K aligned. > > Maybe this information could be part of the data passed to userspace > > about IOMMU table formats and features? They're not part of this > > series, but I think we wanted to communicate IOMMU-specific features > > via sysfs. > > > Agreed, I believe Yi Liu is working on a sysfs interface such that QEMU > can match IOMMU model and features. Digging this up again since v5 still has this issue. The IOMMU API is a kernel internal abstraction of the IOMMU. sysfs is a userspace interface. Are we suggesting that the /only/ way to make use of the internal IOMMU API here is to have a user provided opaque pasid table that we can't even do minimal compatibility sanity testing on and we simply hope that hardware covers all the fault conditions without taking the host down with it? I guess we have to assume the latter since the user has full control of the table, but I have a hard time getting past lack of internal ability to use the interface and no ability to provide even the slimmest sanity testing. Thanks, Alex