From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF899C35DE4 for ; Mon, 24 Feb 2020 23:33:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B1A220732 for ; Mon, 24 Feb 2020 23:33:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728429AbgBXXds (ORCPT ); Mon, 24 Feb 2020 18:33:48 -0500 Received: from mga05.intel.com ([192.55.52.43]:28745 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbgBXXds (ORCPT ); Mon, 24 Feb 2020 18:33:48 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2020 15:33:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,481,1574150400"; d="scan'208";a="237485225" Received: from jacob-xps-13-9365.jf.intel.com (HELO jacob-XPS-13-9365) ([10.54.75.153]) by orsmga003.jf.intel.com with ESMTP; 24 Feb 2020 15:33:45 -0800 Date: Mon, 24 Feb 2020 15:34:10 -0800 From: Jacob Pan To: iommu@lists.linux-foundation.org, LKML , "Lu Baolu" , Joerg Roedel , David Woodhouse Cc: "Yi Liu" , "Tian, Kevin" , Raj Ashok , Jean-Philippe Brucker , Eric Auger , Dave Jiang , jacob.jun.pan@linux.intel.com Subject: Re: [PATCH 1/2] iommu/vt-d: report SVA feature with generic flag Message-ID: <20200224153410.23a96bc1@jacob-XPS-13-9365> In-Reply-To: <1582586797-61697-2-git-send-email-jacob.jun.pan@linux.intel.com> References: <1582586797-61697-1-git-send-email-jacob.jun.pan@linux.intel.com> <1582586797-61697-2-git-send-email-jacob.jun.pan@linux.intel.com> Organization: OTC X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Please ignore this one, use "[PATCH 1/2] iommu/vt-d: Report SVA feature with generic flag" instead. Sorry about the noise. On Mon, 24 Feb 2020 15:26:35 -0800 Jacob Pan wrote: > Query Shared Virtual Address/Memory capability is a generic feature. > Report Intel SVM as SVA feature such that generic code such as Uacce > [1] can use it. > [1] https://lkml.org/lkml/2020/1/15/604 > > Signed-off-by: Jacob Pan > --- > drivers/iommu/intel-iommu.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c > index 92c2f2e4197b..5eca6e10d2a4 100644 > --- a/drivers/iommu/intel-iommu.c > +++ b/drivers/iommu/intel-iommu.c > @@ -6346,9 +6346,14 @@ intel_iommu_dev_has_feat(struct device *dev, > enum iommu_dev_features feat) static int > intel_iommu_dev_enable_feat(struct device *dev, enum > iommu_dev_features feat) { > + struct intel_iommu *intel_iommu = dev_to_intel_iommu(dev); > + > if (feat == IOMMU_DEV_FEAT_AUX) > return intel_iommu_enable_auxd(dev); > > + if (feat == IOMMU_DEV_FEAT_SVA) > + return intel_iommu->flags & VTD_FLAG_SVM_CAPABLE; > + > return -ENODEV; > } > [Jacob Pan]