Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4623447pxj; Wed, 12 May 2021 09:27:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2J5upJeiO6Q0/d2mdmUBW56qRoRZuXIYzEaRnIqb/S3TOK/lPf1myLnq9eHk3/PZe3mU7 X-Received: by 2002:a2e:a0c7:: with SMTP id f7mr30049069ljm.13.1620836866536; Wed, 12 May 2021 09:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836866; cv=none; d=google.com; s=arc-20160816; b=F5ZdbhlhR5ZG7HD87nY7xUa84+cWSqGm/v1lQ9pYC/IVCj8aa6J40fKJywvE/dZLK0 fDH4tGK9QaMES5xf++fTmyIU+C2gtKBNZAPFZLSNA4rr/87zXBF8zFb0G3QdlS3mG47v ggAvM1esQ4EajXYzwd4RFjSNBh2AUWDa0XGBxRopyjC9P7aCRzs7ZPFmZRb6tFklUo4S /cTroPLCALu5iPmgJHJzkhMGXj+fnI0olz6LmUk2mubzIHfuFq4b20jxez/yMfkGLTMY O9AwOm19SbGCzuGtVdTQZKB3GduLSYXUsBUsNaeECLEMc8Qzn6sUpjwwg54g0lkvZesK k8Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WA0mRikx35fCkS2B+d7GT6zczxC0rZZkDCxB2zQ9FwE=; b=cd4/zPxy67UHZOrBUduFqJ/v57nfwroUAJ+2qeuHz/lTg84O9zRW15ifT7V/FHIdtr LDZ+zoUWhVEf7nYo3KgSze10q6SANY0gSSmKEyxGeK+hoDp0PKRu3FnwqaO6OAC2lPu7 epDniLvq4KNinfMtLKQtg9VcaAc4pXfUIqcPjxANNXl/Af++rUjyzFuKL2EPhXHdBoSB tFfBzd4QPjkb6ENPB1LFvzfQQYLh7hZocCc8zM36/YYPr8C1uD/lbM+qWoDMIRYIl/XQ wBfJ/mmFY7FP2Mc2vOxMQ+H0CVJUhxK1HuixElOqF3ZZmrycGbFlq640fR1PZacmn1NW iY+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=y6iE+FsX; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x16si410781lfn.562.2021.05.12.09.27.07; Wed, 12 May 2021 09:27:46 -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=@linuxfoundation.org header.s=korg header.b=y6iE+FsX; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235845AbhELQXc (ORCPT + 99 others); Wed, 12 May 2021 12:23:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:56786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236149AbhELPhJ (ORCPT ); Wed, 12 May 2021 11:37:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7584E61C48; Wed, 12 May 2021 15:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832710; bh=CZB6/ouM4GGtl/Mx5KrH+icS/E+GTm/MqgX2o6T++gM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y6iE+FsXaf/J1dwDuiHtx332K+IF8/rUwDucoMEgudbXaEuFwcSFfb8uXTeJkCjys 5yPK20331+5H77J2+FPTyi9sbk55+sHV4rHRs8znQINMlCj+ozGHO3eXLjsidzOk+H afIHBZ28ExobEWI1LzcgAPFFbNf+hsLPkdjfrtLU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lu Baolu , Joerg Roedel , Sasha Levin Subject: [PATCH 5.10 391/530] iommu/vt-d: Report the right page fault address Date: Wed, 12 May 2021 16:48:21 +0200 Message-Id: <20210512144832.628089537@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lu Baolu [ Upstream commit 03d205094af45bca4f8e0498c461a893aa3ec6d9 ] The Address field of the Page Request Descriptor only keeps bit [63:12] of the offending address. Convert it to a full address before reporting it to device drivers. Fixes: eb8d93ea3c1d3 ("iommu/vt-d: Report page request faults for guest SVA") Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20210320025415.641201-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/intel/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel/svm.c b/drivers/iommu/intel/svm.c index d79639b5b8a9..6168dec7cb40 100644 --- a/drivers/iommu/intel/svm.c +++ b/drivers/iommu/intel/svm.c @@ -899,7 +899,7 @@ intel_svm_prq_report(struct device *dev, struct page_req_dsc *desc) /* Fill in event data for device specific processing */ memset(&event, 0, sizeof(struct iommu_fault_event)); event.fault.type = IOMMU_FAULT_PAGE_REQ; - event.fault.prm.addr = desc->addr; + event.fault.prm.addr = (u64)desc->addr << VTD_PAGE_SHIFT; event.fault.prm.pasid = desc->pasid; event.fault.prm.grpid = desc->prg_index; event.fault.prm.perm = prq_to_iommu_prot(desc); -- 2.30.2