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=-4.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 695CFC433E3 for ; Wed, 26 Aug 2020 15:04:27 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 32AF32078A for ; Wed, 26 Aug 2020 15:04:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="11lGJPy9"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="bTbd1zT0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32AF32078A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=omOgxAONlxHb5n9QGiOTIHD4yOu3i8vAABF3Wfaw2g0=; b=11lGJPy9mpWzpax9o5EUPiDFc uaJETk9kOlsxSpsOADewOs+sS6Yp0w1i1NXifItEw5UXGg1vR4Kua+Xu13uhPqCUHO63T2vACHPYv Hhqb3GzNtVRe9t/eNurJ6JA2ABORkhUJUnlEZBX0l1/vhqfRGYB4comFL6cxiIp/1wJfwUi2IG0FP 03M74qa3vhfn3PSsLrj2VWvDmFJG3QQdCgoxmAsiMjrZhrKccJlMw+DL2P6CrXMoch2xq+I13RYT9 VUiuFGOjZIIftU+9eXrF6EQmc97DiCTgwjK7hMpnMhfS+vlgHe0H4mON8S2uPiDBlXqAt6QN9cZ46 pa6y5uWmw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAwwV-0007hl-Rz; Wed, 26 Aug 2020 15:02:29 +0000 Received: from m43-7.mailgun.net ([69.72.43.7]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAwvs-0007PJ-BH for linux-arm-kernel@lists.infradead.org; Wed, 26 Aug 2020 15:02:01 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1598454112; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=Es/0pFaKnR2kzEaSjZ72M+ID+T80ab88lrWvsjkbJzY=; b=bTbd1zT0mgUNHTnz2pW9ebfERmiw3CoEvJkieDVtsrsZdr7c20AonLSfaWy2vBBLfMp3fmw5 haFUlBSmOtspTECHcvCAH+fU+Oy8A4kdi6SfKRxJ7Ngbp+i2ifEAQpejSILpzLRx/Qixlj1v 3SQJw7YK2PCYbqvth7HBoxRkANc= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyJiYzAxZiIsICJsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-west-2.postgun.com with SMTP id 5f467931fb5eb2479ceaef6c (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 26 Aug 2020 15:01:05 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 0457EC433A0; Wed, 26 Aug 2020 15:01:04 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan) by smtp.codeaurora.org (Postfix) with ESMTPSA id 73DB9C433A1; Wed, 26 Aug 2020 15:01:03 +0000 (UTC) MIME-Version: 1.0 Date: Wed, 26 Aug 2020 20:31:03 +0530 From: Sai Prakash Ranjan To: Robin Murphy Subject: Re: [PATCH] iommu: Add support to filter non-strict/lazy mode based on device names In-Reply-To: References: <20200825154249.20011-1-saiprakash.ranjan@codeaurora.org> Message-ID: X-Sender: saiprakash.ranjan@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200826_110153_098780_1FCB2A87 X-CRM114-Status: GOOD ( 22.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Joerg Roedel , Douglas Anderson , Stephen Boyd , iommu@lists.linux-foundation.org, linux-arm-msm@vger.kernel.org, Tomasz Figa , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-08-26 19:21, Robin Murphy wrote: > On 2020-08-26 13:17, Sai Prakash Ranjan wrote: >> On 2020-08-26 17:07, Robin Murphy wrote: >>> On 2020-08-25 16:42, Sai Prakash Ranjan wrote: >>>> Currently the non-strict or lazy mode of TLB invalidation can only >>>> be set >>>> for all or no domains. This works well for development platforms >>>> where >>>> setting to non-strict/lazy mode is fine for performance reasons but >>>> on >>>> production devices, we need a more fine grained control to allow >>>> only >>>> certain peripherals to support this mode where we can be sure that >>>> it is >>>> safe. So add support to filter non-strict/lazy mode based on the >>>> device >>>> names that are passed via cmdline parameter >>>> "iommu.nonstrict_device". >>> >>> There seems to be considerable overlap here with both the existing >>> patches for per-device default domain control [1], and the broader >>> ongoing development on how to define, evaluate and handle "trusted" >>> vs. "untrusted" devices (e.g. [2],[3]). I'd rather see work done to >>> make sure those integrate properly together and work well for >>> everyone's purposes, than add more disjoint mechanisms that only >>> address small pieces of the overall issue. >>> >>> Robin. >>> >>> [1] >>> https://lore.kernel.org/linux-iommu/20200824051726.7xaJRTTszJuzdFWGJ8YNsshCtfNR0BNeMrlILAyqt_0@z/ >>> [2] >>> https://lore.kernel.org/linux-iommu/20200630044943.3425049-1-rajatja@google.com/ >>> [3] >>> https://lore.kernel.org/linux-iommu/20200626002710.110200-2-rajatja@google.com/ >> >> Thanks for the links, [1] definitely sounds interesting, I was under >> the impression >> that changing such via sysfs is late, but seems like other Sai has got >> it working >> for the default domain type. So we can extend that and add a strict >> attribute as well, >> we should be definitely OK with system booting with default strict >> mode for all >> peripherals as long as we have an option to change that later, Doug? > > Right, IIRC there was initially a proposal of a command line option > there too, and it faced the same criticism around not being very > generic or scalable. I believe sysfs works as a reasonable compromise > since in many cases it can be tweaked relatively early from an initrd, > and non-essential devices can effectively be switched at any time by > removing and reprobing their driver. > Ah I see, so the catch is that device must not be bound to the driver and won't work for the internal devices or builtin drivers probed early. -Sai > As for a general approach for internal devices where you do believe > the hardware is honest but don't necessarily trust whatever firmware > it happens to be running, I'm pretty sure that's come up already, but > I'll be sure to mention it at Rajat's imminent LPC talk if nobody else > does. > > Robin. -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel