Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1619119ybv; Fri, 21 Feb 2020 00:24:29 -0800 (PST) X-Google-Smtp-Source: APXvYqy+LvTy8A1mR58GO6nb7Jm9niAN9AJxtSdbYPjg+ZbT8TaPFAcH1HBn2nWEHrcHyUv1gyyv X-Received: by 2002:aca:ac10:: with SMTP id v16mr948085oie.123.1582273469008; Fri, 21 Feb 2020 00:24:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273469; cv=none; d=google.com; s=arc-20160816; b=AGJZcEjhbJTFoRYwOOyom+RTRo3n2oewqn+1CxH8x4K7Nm+H7m8Bxtm03Ja8Cds6gx VOmfSNZW1Q5Hldr+5deOfneBa0HQTGlqpFvH39Q4HHBsSG3kgDjDaR/vq3tBO6q96sVA 1bjdCcmkRrqvlMevfeB8Hf6gQ/cJ59B9rV7HaYDK/C3iMyQnNeolE9Q2+jISJK524A5X kxLYb7/AdY941EMrCZonGpu2w6bzWWESjIv/QPHo/4+9VEHkU3HLEjdFzuvK2IbEHbNp 2a+YK6blrmR/WQSisrYR13UMs4k0G9WH+OuaUNBa4l4+IIP1ZdKvGX14MRvpIdYsc3Hz zrJQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BK3okoMu8eWkebP/MoqFBNyc0vf88sezUSe+6JWqtw0=; b=T9GmUu5gQPSl7yKW61M50u+p15miY4523AGD/jFCfeuriByEIhTRmJiy87xJDarLlQ x+KXvkl0J/Xqw2v15EUgQojnNJboYdauy2v/01OuZHGhfxAIfmdVhzSLqMbKXAUWjeeT DnMzTA56pYwr3blrpexI7TEW+1CLHyA9PYqLe59iQrmme67nXykFgPBlnVRSn15b0AlV 0kGZ6R0BEqA4R4PPcGLoCtsBCOeXhcuXCvBzZVQpf6sI4BDXo6neY/75B1U8F6V8sptC HhFHaNXERzw2jti4gnWuYbf+t19BlQ12a4dygHKUE/nNKCFJPpXF0B+PES2To030FPre 1h2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LjXPLC8K; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23si1178572oti.34.2020.02.21.00.24.16; Fri, 21 Feb 2020 00:24:28 -0800 (PST) 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=@kernel.org header.s=default header.b=LjXPLC8K; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388511AbgBUIXg (ORCPT + 99 others); Fri, 21 Feb 2020 03:23:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:35642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388490AbgBUIXe (ORCPT ); Fri, 21 Feb 2020 03:23:34 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2B25A206ED; Fri, 21 Feb 2020 08:23:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273413; bh=Mtlh610rIh1oU57Gn79F/DgIvT7mImV8G06VW8H0y+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LjXPLC8KO1sTPvesVluFmCBVO4Bwbu0QW2KMLNrsW9vlCVzfhW+w+31E58O9VtqKe ejC7IlvsiwKA8cb2G6/lTo2Kdja9oXNmW1hQ99eARIBmvCTIouEzokTwVM/3dpgG6A ZrLhcbuvK/ochwS+OF/GT2trMjxOM+tAbuESr1vk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lu Baolu , Joerg Roedel , Sasha Levin , Frank Subject: [PATCH 4.19 160/191] iommu/vt-d: Remove unnecessary WARN_ON_ONCE() Date: Fri, 21 Feb 2020 08:42:13 +0100 Message-Id: <20200221072310.035950622@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lu Baolu [ Upstream commit 857f081426e5aa38313426c13373730f1345fe95 ] Address field in device TLB invalidation descriptor is qualified by the S field. If S field is zero, a single page at page address specified by address [63:12] is requested to be invalidated. If S field is set, the least significant bit in the address field with value 0b (say bit N) indicates the invalidation address range. The spec doesn't require the address [N - 1, 0] to be cleared, hence remove the unnecessary WARN_ON_ONCE(). Otherwise, the caller might set "mask = MAX_AGAW_PFN_WIDTH" in order to invalidating all the cached mappings on an endpoint, and below overflow error will be triggered. [...] UBSAN: Undefined behaviour in drivers/iommu/dmar.c:1354:3 shift exponent 64 is too large for 64-bit type 'long long unsigned int' [...] Reported-and-tested-by: Frank Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/dmar.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 7f9824b0609e7..72994d67bc5b9 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c @@ -1345,7 +1345,6 @@ void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 pfsid, struct qi_desc desc; if (mask) { - WARN_ON_ONCE(addr & ((1ULL << (VTD_PAGE_SHIFT + mask)) - 1)); addr |= (1ULL << (VTD_PAGE_SHIFT + mask - 1)) - 1; desc.high = QI_DEV_IOTLB_ADDR(addr) | QI_DEV_IOTLB_SIZE; } else -- 2.20.1