Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1288966pxj; Fri, 4 Jun 2021 10:26:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzy5M7vvTkj4XJx71sWnStftnyI0ieBZkfoKkMfTZUScdBmHm6yRlfA5kZIlrPbSFbMGWSj X-Received: by 2002:a17:906:394:: with SMTP id b20mr5208726eja.108.1622827596065; Fri, 04 Jun 2021 10:26:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622827596; cv=none; d=google.com; s=arc-20160816; b=yRyBK2yPoP3wpP76E+md8UEGut5vQcTQMpebM+4IITI4g9wKrrNx6ZmZDeZ+IQ5QHz 9KM4rLGma8XdByYLfOMOolJTN5a7luDBv8PknxJznHxCrjKKCC/SnFBDn+3ugnbWF7uH RNctjGn15HAW2U1RFmwzbJzzF+ZUZCFAcq5c0R4Hx5W48IsrdBL/PZjBzORzH0ZbNCmv WK1oLq6JBVZdgSnamIDKHMDseyQZadfYwx3ci+fZn5r5MELY/PwZNMiIXgy4K25quyK4 sIWMkgANeXB7L3HVdBCvZrWtO/Ft3bwkodP7eThP++Tz2WjcbXE8INRXU89HuXzcDeQu WgSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:ironport-sdr:ironport-sdr; bh=wUi0nh+5WPheMkt22h6kzdgAftgxF5snIcScITDxgmg=; b=zxLWFgwIadPJ6VqqanMwUTw2bw8PlPzxJ8IFMDSwr5YUBiCey6szbf++4sm0NyV3XT /ndPWwfvYkmynyxFNFuj7yPflO6VRCjiGaKsELMKbZ41mFFxa7stYXa5qhBrHld1aBQb uBmRrJuZKFpWJ78m5GzVyWev5fcmQhyClAVaY5vH8Ls+LytdCfc2Ck4yDAQWp57t6V6t UecRVEUE2L8MnccLthKpupK07zqetnHGXJSraYTplgYspBraKakNw14sGdhE8KpWNyCV sFPG2KmMttplGsiIpcvQMJyrCKsJP6eLLHhaKEAsAkpye8AsXfx6KOSoUIvlEGQU0iz4 6oMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id w11si6582149ede.2.2021.06.04.10.26.13; Fri, 04 Jun 2021 10:26:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231147AbhFDR0y (ORCPT + 99 others); Fri, 4 Jun 2021 13:26:54 -0400 Received: from mga04.intel.com ([192.55.52.120]:23285 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230398AbhFDR0w (ORCPT ); Fri, 4 Jun 2021 13:26:52 -0400 IronPort-SDR: zjWDFz208ImDZht946Fuw0O9y11ztffPwMMSgviQXPFGbkdDtaJvMxn58T/FYJDCJiBA8GFosp Ivz8B0ndrF7Q== X-IronPort-AV: E=McAfee;i="6200,9189,10005"; a="202475779" X-IronPort-AV: E=Sophos;i="5.83,248,1616482800"; d="scan'208";a="202475779" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2021 10:25:05 -0700 IronPort-SDR: dAFKNKjtmaL7yQnr3K/eB0SbWboMG8HyiCrjLVTN866KgoOVn5Xfj6lI+c9gQvaihlmzACMUqi AwFe9T7+EZTg== X-IronPort-AV: E=Sophos;i="5.83,248,1616482800"; d="scan'208";a="401025402" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.7.199.155]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2021 10:25:05 -0700 Date: Fri, 4 Jun 2021 10:27:43 -0700 From: Jacob Pan To: Jason Gunthorpe Cc: Jean-Philippe Brucker , David Gibson , "Tian, Kevin" , LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "Alex Williamson (alex.williamson@redhat.com)" , Jason Wang , Eric Auger , Jonathan Corbet , "Raj, Ashok" , "Liu, Yi L" , "Wu, Hao" , "Jiang, Dave" , Kirti Wankhede , Robin Murphy , jacob.jun.pan@linux.intel.com Subject: Re: [RFC] /dev/ioasid uAPI proposal Message-ID: <20210604102743.0bebc26a@jacob-builder> In-Reply-To: <20210604120555.GH1002214@nvidia.com> References: <20210528195839.GO1002214@nvidia.com> <20210602165838.GA1002214@nvidia.com> <20210604120555.GH1002214@nvidia.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jason, On Fri, 4 Jun 2021 09:05:55 -0300, Jason Gunthorpe wrote: > On Fri, Jun 04, 2021 at 12:24:08PM +0200, Jean-Philippe Brucker wrote: > > > I think once it binds a device to an IOASID fd, QEMU will want to probe > > what hardware features are available before going further with the > > vIOMMU setup (is there PASID, PRI, which page table formats are > > supported, > > I think David's point was that qemu should be told what vIOMMU it is > emulating exactly (right down to what features it has) and then > the goal is simply to match what the vIOMMU needs with direct HW > support via /dev/ioasid and fall back to SW emulation when not > possible. > > If qemu wants to have some auto-configuration: 'pass host IOMMU > capabilities' similar to the CPU flags then qemu should probe the > /dev/ioasid - and maybe we should just return some highly rolled up > "this is IOMMU HW ID ARM SMMU vXYZ" out of some query to guide qemu in > doing this. > There can be mixed types of physical IOMMUs on the host. So not until a device is attached, we would not know if the vIOMMU can match the HW support of the device's IOMMU. Perhaps, vIOMMU should check the least common denominator features before commit. Thanks, Jacob