Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4486513imu; Mon, 12 Nov 2018 11:52:03 -0800 (PST) X-Google-Smtp-Source: AJdET5f54FVOv0hE8LA9jWigVvnA53qWCotmTI8KCSdXFL8JZ8CmP10VocvvbDhA+3GhSvy86loO X-Received: by 2002:a62:7dcc:: with SMTP id y195-v6mr2144082pfc.60.1542052323029; Mon, 12 Nov 2018 11:52:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542052323; cv=none; d=google.com; s=arc-20160816; b=iJRCOTPpk139h16odyTiZ17w/e4O4kfQjhsAMdcQ+q464GypZ3cHh61cA988jq3cto m+CsNmKJbAopL+wsScVJ7w3hN4POgu/LH60DsQCb0fvoZLZqtSTS7+1W5P1rYv2PcPxD anz87in/4yfqp2dbcnkBtchQQgfZSNZHioPtK7aX7KpQTF2pqzA8WSYVBMAV/Fq3r1e3 LQJOs1/+1/b08Red1KIwh2jwPHhfXkUTJtLfL9PzrYYtt4aYINasBO/i0CtO94GyDMuQ 70gxe8tK80nWBCVgu3AE1UAUSW0t3ANqvcCVRhPoucHXCZhyF1lZ6KvfxdmzK+Xmkq1J L1aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=zkh11tfYo06VZIlkCEKiWik2xOziwhjwCFCEWTcQgCE=; b=SBZAUE4X0xIBpp7VXM7S8c6LgWFI5aR8RN02GYpkTvbmBx4O+kh+DPP0JZD2EO5oFB GiN6fH/RtuoGyWnqZFcbnwm30Uxebb2rsrStKPumNFL2I5tb4OxYY4e+DI+Eh4FL7z1O UdCviKFXhY/6ADe3H5e3cvCwUm1bGuZ3vLzN7M+VnFpPK65PLA596HgG3dh7Ba9rrOlU N2/rhAmq4HD38MJNS5urhS604MdBNdapEWa17tN79bYSUovNS/MquZaJL/UMN+xRY84R jJC3meFWU2K9dVwezHmLJk2qeaRcmIpHrNVLsrZvR7IRKzYS1XgcY8PgiMYyrrKGOOIe AZPw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l68-v6si20569674pfl.56.2018.11.12.11.51.46; Mon, 12 Nov 2018 11:52:02 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726483AbeKMFqE (ORCPT + 99 others); Tue, 13 Nov 2018 00:46:04 -0500 Received: from mga01.intel.com ([192.55.52.88]:11230 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725790AbeKMFqD (ORCPT ); Tue, 13 Nov 2018 00:46:03 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Nov 2018 11:51:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,496,1534834800"; d="scan'208";a="273433761" Received: from araj-mobl1.jf.intel.com ([10.24.14.254]) by orsmga005.jf.intel.com with ESMTP; 12 Nov 2018 11:51:21 -0800 Date: Mon, 12 Nov 2018 11:51:21 -0800 From: "Raj, Ashok" To: Alex Williamson Cc: Mika Westerberg , iommu@lists.linux-foundation.org, Mario.Limonciello@dell.com, Michael Jamet , Christian Kellner , "Rafael J. Wysocki" , Yehezkel Bernat , Anthony Wong , Andreas Noever , Lukas Wunner , Jacob jun Pan , linux-pci@vger.kernel.org, Bjorn Helgaas , linux-acpi@vger.kernel.org, David Woodhouse , linux-kernel@vger.kernel.org, Ashok Raj Subject: Re: [PATCH 2/4] iommu/vt-d: Force IOMMU on for platform opt in hint Message-ID: <20181112195121.GC5367@araj-mobl1.jf.intel.com> References: <20181112160628.86620-1-mika.westerberg@linux.intel.com> <20181112160628.86620-3-mika.westerberg@linux.intel.com> <20181112110900.16cfee48@t450s.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181112110900.16cfee48@t450s.home> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 12, 2018 at 11:09:00AM -0700, Alex Williamson wrote: > On Mon, 12 Nov 2018 19:06:26 +0300 > Mika Westerberg wrote: > > > From: Lu Baolu > > > > Intel VT-d spec added a new DMA_CTRL_PLATFORM_OPT_IN_FLAG flag > > in DMAR ACPI table for BIOS to report compliance about platform > > initiated DMA restricted to RMRR ranges when transferring control > > to the OS. The OS treats this as a hint that the IOMMU should be > > enabled to prevent DMA attacks from possible malicious devices. > > Does this in any way suggest that there are additional recommended uses > cases from Intel for RMRRs? My concern here is the incompatibility we > have with RMRRs and device assignment as we currently cannot assign > devices where the IOVA address space is encumbered by RMRR > requirements. Unfortunately RMRRs do not indicate any sort or > lifespan, so firmware enabling an RMRR simply to support some boot-time > DMA encumbers the device with that RMRR for the life of that boot, > unless we have VT-d code that decides it knows better. Thanks, IMO any new platform that requires RMRR should be a bug. It was designed originally for some legacy keyboard emulation etc. The best behavior is to continue to not allow devices with RMRR be direct assigned. Technically ignoring RMRR's and continuing to assign those devices is risky. The problem is IF BIOS/SMM initiates some IO in the RMRR range and it happens to be mapped by the direct assigned GPA its going to be ugly failure.