Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3979949imm; Tue, 29 May 2018 18:42:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIrTra5MjeAF2VcbeisCdk0jPjxS3Xcgl87cWzl7WkINIDF5bLLneYlsri4MAnVDmeEDKkA X-Received: by 2002:a17:902:a585:: with SMTP id az5-v6mr780486plb.79.1527644546738; Tue, 29 May 2018 18:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527644546; cv=none; d=google.com; s=arc-20160816; b=JTxiskJw35p4SwJNDDLcUTs/bstdwYjSQdN5Kh8r0jz7zCHKWnkkxQK636e+TBm9Rk PsLl+E20xt/G1ztUCDguFpHEIFzCeSHzhJJm7Qz+SjUaHGOQCrOwI2mADMaXMA2F8sHp vb/TYypluPchh84FPINiGKZhjc/GR4+7inD9Z0+mqKahRXslqYIRTk2nlAtZ0ciBBhEv qkMUQP5D4nLqqfPMvNJgU/6sRDuG8kpTjre2Wz6Q3SrR5KcAfex7nF5Tsu5tLUpjibHa DKEAsabKjnfTJs/HPM1XfnOG18yKwDJcUcOcrSSYWmaVMPChXPgpgXf9Im3QCgeJJ2RZ SSkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=wjSGmd4tq1Cb6wMong4ts0Fewx1d/v8CgvwletwVlks=; b=I0/B4sLa7UQGHnX78St3SxHZmMwOYv29LiSoKKWCNkPAiTLmcazhnWjxx7YkhAhrxu PyFJDeXnYtM/IX23tDHh2q79zJdU4Tb35k9lna6AIyKN6jAcXz1h2FFkCfM79Z10BYN1 IW/xgNCtYKZ9L5VDbNfhU2DPO+cPM7A0d702Qwwu+bYs9UczYF0/z82UAUh2DwscYxs2 yWstRN4kCnczAugD9nnZ3YMMoswfl8nfwajij069YwOfW5KB7YAmUFSAJUJEM/r/ftel 6VVIXgqJBIRc4j7aHUNe5dfidZX9rK+9HkhIl40o0c1uj1a4qoly7s5TKelBwxgStorw jobQ== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11-v6si2966359pgq.506.2018.05.29.18.42.12; Tue, 29 May 2018 18:42:26 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968532AbeE3Blt convert rfc822-to-8bit (ORCPT + 99 others); Tue, 29 May 2018 21:41:49 -0400 Received: from mga06.intel.com ([134.134.136.31]:22833 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965337AbeE3Blr (ORCPT ); Tue, 29 May 2018 21:41:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2018 18:41:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,458,1520924400"; d="scan'208";a="44943883" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga007.jf.intel.com with ESMTP; 29 May 2018 18:41:46 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 29 May 2018 18:41:46 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 29 May 2018 18:41:46 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.82]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.70]) with mapi id 14.03.0319.002; Wed, 30 May 2018 09:41:44 +0800 From: "Tian, Kevin" To: Alex Williamson , Jacob Pan CC: Jean-Philippe Brucker , "iommu@lists.linux-foundation.org" , LKML , Joerg Roedel , "David Woodhouse" , Greg Kroah-Hartman , "Wysocki, Rafael J" , "Liu, Yi L" , "Raj, Ashok" , Jean Delvare , Christoph Hellwig , Lu Baolu , Yi L Subject: RE: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function Thread-Topic: [PATCH v4 04/22] iommu/vt-d: add bind_pasid_table function Thread-Index: AQHT1cxrC6UgpKcW20OywYDXDmuYDKQEzd+AgASqXQCAAFimgIA9Dz6AgADhuaA= Date: Wed, 30 May 2018 01:41:43 +0000 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> <20180420164251.5245f822@jacob-builder> <20180529140915.1f174689@w520.home> In-Reply-To: <20180529140915.1f174689@w520.home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGVhNTE5YzItNmRkMC00NmQ1LTkyMmItMGVkZmU1ZTA4ODEwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjdNTStuWjNcLzRWME1FOXNhMnB5V3JNWktBNDdnTUY1TzlcL0ZWU1RzczI5UT0ifQ== dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Alex Williamson [mailto:alex.williamson@redhat.com] > Sent: Wednesday, May 30, 2018 4:09 AM > > 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, > checking size, alignment, ... is OK, which I think is already considered by vendor IOMMU driver. However sanity testing table format might be difficult. The initial table provided by guest is likely just all ZEROs. whatever format violation may be caught only when a PASID entry is updated... Thanks Kevin