Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp711399ybz; Wed, 15 Apr 2020 17:15:56 -0700 (PDT) X-Google-Smtp-Source: APiQypJKiCk0+bi8Vns8vFYzu1YGAl2p4vu8jfvVI/V1jq1HqPSI9ok6b/swu8kPhrrBSQuYz5BZ X-Received: by 2002:a17:906:4003:: with SMTP id v3mr7330118ejj.144.1586996155908; Wed, 15 Apr 2020 17:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586996155; cv=none; d=google.com; s=arc-20160816; b=04y1d+KqXaOFXlnAtE2EjQZXb5eQd1Gmf0bOw9JeDfkRQeg8CWTZteFmTtDsnR4XM/ ny/btz5VCGu5BuR3zQLnu0MZdREFdrLKK85X+gno2euj8r9GEApOcD3lqtAdSilIB7pV Gh3637zqBs8sWryCjPHY0x7bhRY5qd0W4rSo7laMIQ21g8twn3vfdu+RUsp8iXKSPL+U djEwdWcebANC4VHIXdAqVuxIWfNPyD9ip4HeWOvTHmnanDSAuWUG8Hswa5d+nvNMw+nk Jwu9Tlv6gZDyVz67CKYWaxIWNFoe97F0oDF+BP5OV2YVzEBXed8D9nl4kIaxcs8WKCBg eHiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Vzn5Qi0ZG5I2dfN+j2Q0PXBNrTKg5GnbDO72sf5kYmE=; b=FwwcIf6LRgHzAg9VEO+tg4jEm8vwhikqNgMg4SBJ/vcFc8XneJgY6pC4P5how7b7xq IPTLFO1arbRBr8V381eOenkPkTnXgDvWRJDyxNKLb3PxtOGDM4SlVnxhplAIY0BVxL2u CLaiiHSaqvUxObMvdTu/4n4LfUUbTm3sBDZMZ0Xs9ytGwfipYmkRIiUSY/3K1bJ0A9xL xdL602ZhVmgrsCHkxZlbbzJnD7SLVPJZbYwHtVTvm0kN2/3xY7eg01G7TV1UmzJ2lm30 a/ca9YpfjIrpRhcUuMxWT9Bzu1VL8YYnFbz1uXO8HALPAnLOFt7eGpYWdtipR4e25+kg ETAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kZ4BXox0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si3043419eds.605.2020.04.15.17.15.32; Wed, 15 Apr 2020 17:15:55 -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; dkim=pass header.i=@linaro.org header.s=google header.b=kZ4BXox0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393142AbgDOPL1 (ORCPT + 99 others); Wed, 15 Apr 2020 11:11:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2393131AbgDOPLY (ORCPT ); Wed, 15 Apr 2020 11:11:24 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8BF5C061A0C for ; Wed, 15 Apr 2020 08:11:23 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id u13so292504wrp.3 for ; Wed, 15 Apr 2020 08:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Vzn5Qi0ZG5I2dfN+j2Q0PXBNrTKg5GnbDO72sf5kYmE=; b=kZ4BXox0LCjCv71j6mhvSC6hJT0Z/VGQda1i6/OdAyN4W1ETBfMrmBAaUNfak62dI3 3RgoMqf4NrWAUABEgfHAShe0W9Ugx0uqNG9HBnqOjFxKen/NZrjX0Kb3TvjWgSRd5gs0 dlJSrbOOrGLjqJ65EYoQ+JQMoKJpmuTUVFeMQiv6GD/OXOuy0ROSiOpexEVW72YZL4ne 0OEx7p7O1RogVyTytQu6MdFp3uSbs3LBH4q+J6zMCsGLvBXD8XsoV76qaJGgdzoAikzc 9WM+V67zjUXRTeO4PdviJ4iCQ5dpsQ41nKcBL0kDP0/dwn+24klk82G1y0HwHLzgBR3P 2+9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Vzn5Qi0ZG5I2dfN+j2Q0PXBNrTKg5GnbDO72sf5kYmE=; b=LU9H8428VIYFlyQlDJr7gEx/U9miVnE56E5BR2e3vStCfHXrKZsa9oRYj8A3JwLtg7 aCwFOk8AL7nN4Exmc26PWaCZGBP391uOKdxj34gSdqDMhB+x1NgBdxSwsxytR8env8zW ILgsnJ7rKclNDWU6iM2wd/N7jF70vu7hiXKoVGEPcm5K0ABdvhY6qiTtJ2a+Al8F5kSw zGaWhxMgUePxnLftL1/D5vgTs1lRRilSfCoN4IIVBtpmb7Pv1AaeZK+xGTHMCGM3D/RI G3k0IsZ8PhN5El/XIcRooGvS1yK3k1ubaAwWIfHxhiuJFEpmjBU09Q/H/E2FHeI1aq0E 7OHw== X-Gm-Message-State: AGi0PuZuFh4cpy1+PKO9krrAVrHMnUa4uKxJBcv9wXTT5iGFLrcqeKc1 KyMNcsHX0VjYaDhkmro688kNzQ== X-Received: by 2002:adf:f844:: with SMTP id d4mr10793811wrq.362.1586963452757; Wed, 15 Apr 2020 08:10:52 -0700 (PDT) Received: from myrica ([2001:171b:226b:54a0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id k184sm22809016wmf.9.2020.04.15.08.10.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 08:10:51 -0700 (PDT) Date: Wed, 15 Apr 2020 17:10:43 +0200 From: Jean-Philippe Brucker To: Jacob Pan Cc: Joerg Roedel , Alex Williamson , Lu Baolu , iommu@lists.linux-foundation.org, LKML , David Woodhouse , Jean-Philippe Brucker , Yi Liu , "Tian, Kevin" , Raj Ashok , Christoph Hellwig , Jonathan Cameron , Eric Auger Subject: Re: [PATCH 05/10] iommu/ioasid: Create an IOASID set for host SVA use Message-ID: <20200415151043.GB738821@myrica> References: <1585158931-1825-1-git-send-email-jacob.jun.pan@linux.intel.com> <1585158931-1825-6-git-send-email-jacob.jun.pan@linux.intel.com> <20200401135316.GF882512@myrica> <20200406083353.73efda5b@jacob-builder> <20200407110146.GB285264@myrica> <20200413150631.60e54d85@jacob-builder> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200413150631.60e54d85@jacob-builder> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 13, 2020 at 03:06:31PM -0700, Jacob Pan wrote: > > > > But quotas are only necessary for VMs, when the host shares the > > > > PASID space with them (which isn't a use-case for Arm systems as > > > > far as I know, each VM gets its own PASID space). > > > Is there a host-guest PASID translation? or the PASID used by the > > > VM is physical PASID? When a page request comes in to SMMU, how > > > does it know the owner of the PASID if PASID range can overlap > > > between host and guest? > > > > We assign PCI functions to VMs, so Page Requests are routed with > > RID:PASID, not PASID alone. The SMMU finds the struct device > > associated with the RID, and submits the fault with > > iommu_report_device_fault(). If the VF is assigned to a VM, then the > > page request gets injected into the VM, otherwise it uses the host > > IOPF handler > > > Got it, VM private PASID space works then. > For VM, the IOASID search is within the VM ioasid_set. > For SVA, the IOASID search is within host default set. > Should be faster than global search once we have per set xarray. > I guess the PASID table is per VM instead of per RID (device)? Sorry if > you already answered it before. The PASID table is per IOMMU domain, so it's closer to per RID than per VM, unless userspace puts all devices in the same VFIO container (hence in the same IOMMU domain). Thanks, Jean