Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp483239ybb; Fri, 20 Mar 2020 02:44:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtXBpFIUtppZH/AY02JRiytgxKFiAl0n3VAI9ekEaAkwbTDNRvIzHWhyIneIN0q9sx0yByt X-Received: by 2002:a9d:5c0c:: with SMTP id o12mr5934082otk.145.1584697463116; Fri, 20 Mar 2020 02:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584697463; cv=none; d=google.com; s=arc-20160816; b=wxWlA8RIJlQ3djwzhJA6yKXhsPif7TIknFNqo3yB//Hln0sTbq4yWfOXvtIIzl8R6k JZxhivlsMz9qh4NxF9zjySuo31VqyY8dVIg2XMqpMoNNQ5e1bFXbrJf5Qwv3SZfRgHDD FJ9z9hZj+AaDBff3yKeYrYasHY4gMltLXJfOzLjUSvMuTzLvJpO6SnU4ZTBigJvsERdg tPgGEbkmSsYByD3UtC+GulhrzMMytp+GvVNlyvedILH691pHusDSHf9Vll9M8Xw/Qs5e k1uKqpC8rmdGQjhh/oWCGwcWpfErYeXFO+nCJhKtu6IYn1bODcqZK5af9wW5FFzd6j84 M5JA== 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=lYxvjXA9SuRqdZ2yHHpJOFiSDlizNvxYxQBAXFzGsQM=; b=muGMRgp68gf26elc+0eZLjlmc/lJ3IbGdaGBA1XjBj7HqFc36SQ9GmLpCG/He3VkhL mgK+zcq6WbJC/zW5TNwYbhlGe9ECwTYLCYMS9i/KsUe/seior4OiBfON+hQbY6rUfgfX gC4F3WbmilK9ch2zqGVj7bzNpWNvcBnlPn7VwNZvM3xzcIpzZZa4b/fsYzwsaUus4LsH NVnxDcwZulI0BtAxTpaWp6CX/R/UMlopUyP0vqD1c6HSSWARktTI42QcLN49gtyJ4TYS RZdUgZqJehmU+q4bO2OeoYOsRU9+yB43mqyNojMdgzf/Gw/e1IpEUDMxzZirNB3TW+vA C/Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="AN0/jotY"; 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 e18si2040644oie.189.2020.03.20.02.44.10; Fri, 20 Mar 2020 02:44:23 -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="AN0/jotY"; 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 S1726954AbgCTJni (ORCPT + 99 others); Fri, 20 Mar 2020 05:43:38 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35634 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726602AbgCTJnh (ORCPT ); Fri, 20 Mar 2020 05:43:37 -0400 Received: by mail-wr1-f66.google.com with SMTP id h4so6624592wru.2 for ; Fri, 20 Mar 2020 02:43:36 -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=lYxvjXA9SuRqdZ2yHHpJOFiSDlizNvxYxQBAXFzGsQM=; b=AN0/jotY82HkOV40gcAtQ6S/IqIUIIOT0kFkdTYMalnn8PgFiMqhSgdS4obDDhJv/d VK6mkXj5WYfZ6uDDyCSyns/IuVPNHC7APKVKGC5BZqIGehAvyMXND3T0SwVY4uotygYC HYESDVGXpZ6PW4rU1oTHLRVwExmqzGaTG4R14+9DiQt9lQziGrNBkhSu1jz3HuMxh9FM gdoVDBZFI5YAyKVqgEAGej7HEWqxZbj2MAnhktqo+mdY+gvdf2SRLThr9a2YCNJmN0Te eC4mWE14h7Ttk3kgfN/CJ0lVdA5Aa/G06NCdpSu5AMd6CEL66UmrGqTLHrEVE69T1hGY bKSQ== 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=lYxvjXA9SuRqdZ2yHHpJOFiSDlizNvxYxQBAXFzGsQM=; b=Yl6FURUmiuhvS4tkiQtukFKW+eLLKWxbAiFjXS27lszByAfOPDjaA2jFMqewOzWkYr mp9R+QWr5Zn4DylcKFwkWZRolk8N2QbB5ZXso+W+8hkyslxzTZz5yQtCFInBLp5Pt6ey eRDb3N6wIQoAJrVY68lkET2sktoFGyx5I+nm/73h+2uqoiR9G+5XDlcDqDCmA6Gk9Sn+ bAbTmj3w5orJmftrFGeRixIV7enWM8Do0f3sQKqKoqrg2aFp2YE5xTTLq/DNV/5TGwKH IkgMvsW3PbNNWmLkbuDAlIeKw34Hdauxyr6lxM32rTjOOE3michFcv1Wv6YW0KF8ECiA yT+g== X-Gm-Message-State: ANhLgQ10Rtva6uOH7aTJE15tR7LIuym9EEDYHe78TV1UeExYACD4CLVQ SPeuHRo2fzkTEQWQ0VISZf0ozTGxZmk= X-Received: by 2002:a5d:4b8e:: with SMTP id b14mr9264279wrt.33.1584697415630; Fri, 20 Mar 2020 02:43:35 -0700 (PDT) Received: from myrica ([2001:171b:226b:54a0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id n1sm7532148wrj.77.2020.03.20.02.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2020 02:43:35 -0700 (PDT) Date: Fri, 20 Mar 2020 10:43:28 +0100 From: Jean-Philippe Brucker To: Jacob Pan Cc: "Tian, Kevin" , Dave Jiang , Raj Ashok , Jean-Philippe Brucker , LKML , iommu@lists.linux-foundation.org, David Woodhouse Subject: Re: [PATCH 2/2] iommu/vt-d: Replace intel SVM APIs with generic SVA APIs Message-ID: <20200320094328.GC1702630@myrica> References: <1582586797-61697-1-git-send-email-jacob.jun.pan@linux.intel.com> <1582586797-61697-4-git-send-email-jacob.jun.pan@linux.intel.com> <20200320092955.GA1702630@myrica> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200320092955.GA1702630@myrica> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 20, 2020 at 10:29:55AM +0100, Jean-Philippe Brucker wrote: > > - success: > > - *pasid = svm->pasid; > > +success: > > + sdev->pasid = svm->pasid; > > + sdev->sva.dev = dev; > > + if (sd) > > + *sd = sdev; > > One thing that might be missing: calling bind() multiple times with the > same (dev, mm) pair should take references to the svm struct, so device > drivers can call unbind() on it that many times. Please disregard this, I missed sdev->users Thanks, Jean