Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1069322ybt; Wed, 1 Jul 2020 18:00:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU73m1lk94XGXRJ2/J8zGfVk45REM5tyulE1rkefNVAZ1dDQPzDUpFp9b2XMyY+Vvc0P4q X-Received: by 2002:a50:83c6:: with SMTP id 64mr33107155edi.41.1593651607988; Wed, 01 Jul 2020 18:00:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593651607; cv=none; d=google.com; s=arc-20160816; b=SvLcJVE9ohjungOJibG0NMty9bFTXICqT42pYlYKaQM/dJzV2jqRJo2YSXj0ugIS7Z p6g6xbioAmQrozOULUelBc1L7tSzupBbcZCtELhz6h3J6Y7130F/f5dF/mF3tMJkSHM5 d8iPhZ2xEi5AbZaeXooDvkvDonTw0wSbNlMNiIdLAA8YtlnKFWsd9drBSGxy/VnxNkHJ 7y/dB1eBk3+VVY5mKizpm2KuhEcm0KJN73GImT4+013yZ7qBjKCBaDPGHwfWtGOmZUV+ W0IWKNin+6xMFM2/EyEDkPu+bE7yPN/FFTHU2Xcgl12iuyWovtF+k7Z0kr0SGO5mUQym h19A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:cc:ironport-sdr:ironport-sdr; bh=NcSKBhX8vlef4EnhTAuTKN3fCJWdbB/DXizucC+cm4Q=; b=uL1uoU81Y7FkDjPY+EB5KniVwH7dD+kbtxNbla46/B2p/x9l0ASF9PNT371dfSvL6d 9hG86XcMJsScjT5MO49kKfJD0iV5jf5sSJ1Ym0lg+tBerylTfsUKc7HWjMkF2ufO+GXQ Nzn9z3KRh32xGhJh8WVuiyE7AMYbQigwPrtniwFxOZxC/+d26S/c4CCTtwd1k+qH1G/F q2AkOhQg1OZGstRCW8fY/NQgMO5TuirnnpyA/lD0B9TWvydmb+aRzvU8vjIqfpmxlYqg z6wDueTJbaj7+2sDsvKbunuPLoizcb1/FXK5nDwlVjwhhim7OsRmUwvkgc/72jMia/2Y qumg== 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 bk19si4943687ejb.338.2020.07.01.17.59.45; Wed, 01 Jul 2020 18:00:07 -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 S1726985AbgGBA7i (ORCPT + 99 others); Wed, 1 Jul 2020 20:59:38 -0400 Received: from mga18.intel.com ([134.134.136.126]:36580 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbgGBA7i (ORCPT ); Wed, 1 Jul 2020 20:59:38 -0400 IronPort-SDR: E39jGFPxKgcQR13ZbuAHIdV5uR3poGiAjRuL0VO9y88aiSPNS2Cy5oXUclwdyfTsgfeWgJ247H 0tfwQIiFWA5w== X-IronPort-AV: E=McAfee;i="6000,8403,9669"; a="134215309" X-IronPort-AV: E=Sophos;i="5.75,302,1589266800"; d="scan'208";a="134215309" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2020 17:59:37 -0700 IronPort-SDR: k5ecF3Q6zcI3nWdx6Qxil4zw34HSk4hd+mydaYVi7w6tm8PQg46p6c+8WxquLmwqn9ztPbCacq Z4wN3zre0KZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,302,1589266800"; d="scan'208";a="304061442" Received: from allen-box.sh.intel.com (HELO [10.239.159.139]) ([10.239.159.139]) by fmsmga004.fm.intel.com with ESMTP; 01 Jul 2020 17:59:34 -0700 Cc: baolu.lu@linux.intel.com, Yi Liu , "Tian, Kevin" , Raj Ashok , Eric Auger Subject: Re: [PATCH v3 6/7] iommu/vt-d: Warn on out-of-range invalidation address To: Jacob Pan , iommu@lists.linux-foundation.org, LKML , Joerg Roedel , David Woodhouse References: <1593617636-79385-1-git-send-email-jacob.jun.pan@linux.intel.com> <1593617636-79385-7-git-send-email-jacob.jun.pan@linux.intel.com> From: Lu Baolu Message-ID: Date: Thu, 2 Jul 2020 08:55:11 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <1593617636-79385-7-git-send-email-jacob.jun.pan@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/1/20 11:33 PM, Jacob Pan wrote: > For guest requested IOTLB invalidation, address and mask are provided as > part of the invalidation data. VT-d HW silently ignores any address bits > below the mask. SW shall also allow such case but give warning if > address does not align with the mask. This patch relax the fault > handling from error to warning and proceed with invalidation request > with the given mask. > > Signed-off-by: Jacob Pan Fixes: 6ee1b77ba3ac0 ("iommu/vt-d: Add svm/sva invalidate function") Acked-by: Lu Baolu Best regards, baolu > --- > drivers/iommu/intel/iommu.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c > index 6a0c62c7395c..2e1b53ade784 100644 > --- a/drivers/iommu/intel/iommu.c > +++ b/drivers/iommu/intel/iommu.c > @@ -5439,13 +5439,12 @@ intel_iommu_sva_invalidate(struct iommu_domain *domain, struct device *dev, > > switch (BIT(cache_type)) { > case IOMMU_CACHE_INV_TYPE_IOTLB: > + /* HW will ignore LSB bits based on address mask */ > if (inv_info->granularity == IOMMU_INV_GRANU_ADDR && > size && > (inv_info->addr_info.addr & ((BIT(VTD_PAGE_SHIFT + size)) - 1))) { > - pr_err_ratelimited("Address out of range, 0x%llx, size order %llu\n", > - inv_info->addr_info.addr, size); > - ret = -ERANGE; > - goto out_unlock; > + pr_err_ratelimited("User address not aligned, 0x%llx, size order %llu\n", > + inv_info->addr_info.addr, size); > } > > /* >