Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1788544ybj; Sun, 22 Sep 2019 11:58:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFg633U5/8rBTMvzEAlxcoH9cLGmwV/Og/FJ+uj3CGFSYJkimg0AtGt/tSNJ8vJLoOVgN9 X-Received: by 2002:a50:da44:: with SMTP id a4mr19281531edk.120.1569178704960; Sun, 22 Sep 2019 11:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569178704; cv=none; d=google.com; s=arc-20160816; b=njSxR8cUiCVr2HNXSQYbno3dX3Yf2XmKKuGtvmB2fDKkxhyKFcQtLUOdZT3cK6koFR P9tImweAtAJpAAT8N8he2+NQHmukr6iJ9EeV5IcTdr5K9ezO85z+0Z9SvWOEkWu6vOi8 ijxzzq2UAE/6ZgTw7F4qauEQ01j4LffVMfU0EF5kmrO1iODWPsFjnC9BGHz+AHJ2m3Gq rzXlv/D3PWLK5ZLb1Y/QUX2ZIY1B7Sc83oojOfc3UdwFH36zEEmoNcEHSHIvBWhRmz68 o2XZKfnoTJ78vntUOl207e8uE6IGgNkz/8YI/XVDmYZygQKxQ3Gx1yzCwMFcUUEl6RRL NEgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+JjVHOFtPkrIu+975k/69BRdOa3f1zZRGu6VFUJO+SE=; b=Ua6WcYcakj7ht5SZhAyok5Lx5YTVk863jubkQ3rU4H5n8VvSPyGhh5t9+HnaacsZwR qEvT/oF7eqX8QtRNlrJyGLsGUveMUULdTrh+ErHjZrouWpTB1NUKp8iiXcMojRSihsqn jatPKZrbjRASXfvsOevxjxDbMfqmaT6FKmnKYaZS7Qx+KfV9tdIoo+8Cldl2BpAB2sVS hl6aafs4aZTJdHPUyNiSHvX0PC04QD+hGADnkOgUaRERxqASErChKHNXyWC/aSWYJKII c3txG6S2TdkwMVNJIoxfDnyibQdX8zIYBd8BaE/cA7/6BfdH6SJeD+/vD718VfzgPd/L hSog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oof2UcZt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12si4017811ejt.21.2019.09.22.11.58.01; Sun, 22 Sep 2019 11:58:24 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Oof2UcZt; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729396AbfITQis (ORCPT + 99 others); Fri, 20 Sep 2019 12:38:48 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:37570 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729372AbfITQis (ORCPT ); Fri, 20 Sep 2019 12:38:48 -0400 Received: by mail-ed1-f66.google.com with SMTP id r4so7101766edy.4 for ; Fri, 20 Sep 2019 09:38:46 -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:user-agent; bh=+JjVHOFtPkrIu+975k/69BRdOa3f1zZRGu6VFUJO+SE=; b=Oof2UcZtDBoL9r9YUCMpa+YnL1BKRRXdv7Tg4CF5oueJtWk+uI/AjuBbiD2CpsKKDn AJyUm43wEixxj0qrSfWYAMFH/5/QhaW282DyEwlTgG4FfNoIRDvyhemzDmKmj1JIloiA 1NcnNuKU8cn5kN+lFOgJAV49GCt2d3K5r+DV3ZOuIgTWx74V5iWK9PH66MBrRLVPBEUp U5x9zERtv5LXZcdyFhAHH4kVijTEt98/vZF2jd80k77DoUU2q1UJen0oKmMMC2UaTi1U QOkg3f/Z+qjV88usI7PtEbXVbx0F5kKrmQmI2iY+Xp11ZQ4LcSYhXXD2ejNv6YjUuMVc L6Nw== 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:user-agent; bh=+JjVHOFtPkrIu+975k/69BRdOa3f1zZRGu6VFUJO+SE=; b=Yj2kIUdgXKE6HEsr5hwO8aohSbn90ORv7SMQTsSTBWKQk5eV2voPpSGqjBQKYb9UcY Ml1hW4V+vvdHf29KSOzxBVUGgTenEAo/XqxYdZOoDgo/XJvZWOxrZ7BDXC33ANhrkc/h /qkQ83BwzFHtIde38I8aoqNSJfc7FjRbuM1wiHYUOVbXpUPk+qTMHN6J+/cjKMroKjyN rb1H6v7hlnjiBGq3ylGG0ywoltsLTggc/eOlzw4anFPUEt67K4kRlDCUYTnupHoWFjdf J4mxi7QZb3IT5mvINHo4lSxDI1fftcsjqYkW1DK565nys9uCTJYq9KMS+w7w/V2dPQb6 VAog== X-Gm-Message-State: APjAAAXp7YweMz0e1+p1JWJqIdTXgD+kC7Vxx9/3oaCoVrt3+RkR1Ca1 RLqSye5e6FQqPTsOh/NRzw0Gpw== X-Received: by 2002:a17:907:20a2:: with SMTP id pw2mr19642839ejb.163.1568997526248; Fri, 20 Sep 2019 09:38:46 -0700 (PDT) Received: from lophozonia ([85.195.192.192]) by smtp.gmail.com with ESMTPSA id e39sm407528edb.69.2019.09.20.09.38.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 09:38:45 -0700 (PDT) Date: Fri, 20 Sep 2019 18:38:43 +0200 From: Jean-Philippe Brucker To: Jacob Pan Cc: iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse , Alex Williamson , Jean-Philippe Brucker , "Tian, Kevin" , Raj Ashok , Jonathan Cameron Subject: Re: [PATCH 4/4] iommu: Introduce guest PASID bind function Message-ID: <20190920163843.GD1533866@lophozonia> References: <1568849194-47874-1-git-send-email-jacob.jun.pan@linux.intel.com> <1568849194-47874-5-git-send-email-jacob.jun.pan@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1568849194-47874-5-git-send-email-jacob.jun.pan@linux.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 18, 2019 at 04:26:34PM -0700, Jacob Pan wrote: > Guest shared virtual address (SVA) may require host to shadow guest > PASID tables. Guest PASID can also be allocated from the host via > enlightened interfaces. In this case, guest needs to bind the guest > mm, i.e. cr3 in guest physical address to the actual PASID table in > the host IOMMU. Nesting will be turned on such that guest virtual > address can go through a two level translation: > - 1st level translates GVA to GPA > - 2nd level translates GPA to HPA > This patch introduces APIs to bind guest PASID data to the assigned > device entry in the physical IOMMU. See the diagram below for usage > explaination. explanation Otherwise Looks fine to me. I was wondering if we would be able to reuse the API for Arm SMMUv2, which allows nesting translation, but without PASID - there is a single address space per device, with two stages of translation. I think it would work, although it would look better with something like "PGD" instead of "PASID" in the API names (e.g. iommu_sva_bind_gpgd) since that case wouldn't use PASID at all. But I don't want to quibble over names, so Reviewed-by: Jean-Philippe Brucker