Received: by 10.192.165.148 with SMTP id m20csp573866imm; Fri, 20 Apr 2018 11:27:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/SyCNaqCF7jLKL7XfADoWfWiJTG5tTCn8Qlwrp4b1grt46ddcwcutAe1yghWty/8VYXCby X-Received: by 10.101.97.8 with SMTP id z8mr4533051pgu.192.1524248856372; Fri, 20 Apr 2018 11:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524248856; cv=none; d=google.com; s=arc-20160816; b=MoEZAWkFAxnkQgAw/DzwshRsztKIjGDHzECVjIjQJ5Mftt/ruDEqlKd8zXo5NGf75Y nJq0C6kxIyWsQP2Vkj+wbG1C2Lc9fLjKGBPSfK4wOe2AuUd9EGVi2p51upbg4lkqmVq7 2S94jjj7KRP0DBuwqFctED9szuW7pA82ZGIjN6tdk+qJtghtLH9TGO1Y1kgRjj6FyIRb KlYgX38KSmoQnVmqBR+ayKKIIdVAWo+vXxAL1/xik2nqed+MjbbvVQ7xM0AVRJzViT39 ywjFDWFR0YYfgAW8d8+wgaKSMEc89Hv4joq9IrrweoNcxd6p52haUMk6OHIPx9lIkgc9 hgoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-language:thread-index :thread-topic:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=zaL9z5pX9pYXIygcpR1LZVheEcVHR0QNaB2rudPhcKs=; b=kt2NWetrx7nHfVVtqRgQsmeG8d0KJOKZ7EMx+Bfoozod3GBZc+H+abyuyYSYjH/vzf 69KTief7zdyMVK7802uSjaSSgz02dWPYAOMK+RbKM8GjTKVpua2/ipo6PnrlzL+Pivgf catRFgpeN9yHefs/GYSdMptVrRJ6FGP1bNIBrCvwl1D35cfs33aiVG8HMYy0eKHstfqp u0lv/Rp4ohOmhI1nNdeBU8E1Q5xZTvj8mCmNRsKx08Tlsi8V1va9D0JJ2lEeswVGkSWn urISrbDyKW6ilTzw16I4UDxlYMIdj2IDI3tntUiqZRynMNVDN2xYPP/Be4BLbVdquxjm w+Wg== 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 d20-v6si6427865plr.206.2018.04.20.11.27.22; Fri, 20 Apr 2018 11:27:36 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753933AbeDTSZq (ORCPT + 99 others); Fri, 20 Apr 2018 14:25:46 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52712 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753607AbeDTSZp (ORCPT ); Fri, 20 Apr 2018 14:25:45 -0400 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 B84E61435; Fri, 20 Apr 2018 11:25:44 -0700 (PDT) Received: from ostrya.localdomain (ostrya.cambridge.arm.com [10.1.210.33]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3D8F83F487; Fri, 20 Apr 2018 11:25:42 -0700 (PDT) Date: Fri, 20 Apr 2018 19:25:34 +0100 From: Jean-Philippe Brucker To: Alex Williamson Cc: Jacob Pan , "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: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180417131047.0a9c310f@w520.home> Thread-Topic: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function Thread-Index: AQHT1cx3i3O6vmaIl02/JIPlG/+icKQFU/yAgASEjYA= X-MS-Exchange-MessageSentRepresentingType: 1 Content-Language: en-US X-MS-Exchange-Organization-RecordReviewCfmType: 0 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-imapappendstamp: AM4PR0802MB2369.eurprd08.prod.outlook.com (15.20.0696.010) User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Thanks, Jean