Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp287938ybt; Wed, 17 Jun 2020 00:33:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkT8iyB0as1893MsPB7O08U72J0GLntdoIhrV7dNlbi+CzuQ3FfZRI0d3PyeYmSW4aiHRq X-Received: by 2002:a05:6402:549:: with SMTP id i9mr6010357edx.159.1592379209275; Wed, 17 Jun 2020 00:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592379209; cv=none; d=google.com; s=arc-20160816; b=MR7uVcV+cWVtwMtZO5Xo7yA9uu78TYVEQAjlsR5I4cBzlrgTLhf1t6bxHRD2iJus7p EX5+rUuHADukCHnuLB9UtT6w/2oslPSuptWyrlRfs8yha4cche+jAAHPTohLANfzaata xuoCmW+ST0P/jnMNM4eltPkuV2xQj5OggLta7aVC6E7gB0R+4p+xWn0idTRw8iyA4sac WO5FmRqCRap5zKK6Hl1t88QxhxHNxKWDZU6s7sF1wvR6cVSxP4OvYNg1RXGBnIbiuETw rX0tev6cyL/kx+1QnK/k4feW8gT14/PfNtx9I7DReIfJmtv8PE8XWS/d2dMEa2ZfTiE6 U3NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=VsRI05MA0gDChQhjvYubCNupJCQDGQ1QnOVaSmjuu3k=; b=v0dLmK0jNr8SNmqU3Om6U70D4/kBQArcbUMReJz7IMIRKJMQC8D8FwVXVXKDG6O4r4 qWIto9n/YwxjKc3CPjj+vjL8hxg1lXzP/e/v4iWLbCNvVcOgWvQy2zUGAITAQHZG/T3C 3WcGvOxOIApuAwb2dllYM6Ui7rhmx9q2dARn8INz1TLD7k1fGn16oqw7pHpAYzUfX5MI tsgw3wnX124cVY3tSshcEvqiofQU/0INFtTqLdXFssLtG3/vd5p3Mx0+WnunDy38fVU/ FCLW7Iwx7oeDoybFcje83nRPwhKzdMSUJn0+ASo8GiJfQMcdPqjx/xZ9G8OcDDx3F4Le b0vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kWk0gBem; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm15si13931898ejc.728.2020.06.17.00.33.07; Wed, 17 Jun 2020 00:33:29 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kWk0gBem; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726594AbgFQHbM (ORCPT + 99 others); Wed, 17 Jun 2020 03:31:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbgFQHbK (ORCPT ); Wed, 17 Jun 2020 03:31:10 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2405DC061573; Wed, 17 Jun 2020 00:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VsRI05MA0gDChQhjvYubCNupJCQDGQ1QnOVaSmjuu3k=; b=kWk0gBemtnwCgsITYbRvHBkqjL 3AIZtFbTmv21DTS/4oF9tbP5Cw3TPXVdxBOY81ArT9mVW8FSDhBY7/wqvYgjiNCoLrnwr09vJdtxo wlpRbOv9RoQiILqqXKpWMZ3npQkUS6VGIPHDsyIPVCfczXbhIiKWlt6OdSMSJmjiEtXbEayG8hZgI 9D1WAtQYuGmfhV3iI/eO30JWOn0AHGCv/XAx4M1Gp8Xk5fPC/qoEkttIX36nrzTBHnJRM7yqJh0w/ XOpf6uRZ+TQoK0ltVPX0CVqKVZ9M1OMERNukKHKSDAv4dwE1AMfFHLsyGb+OmDXa6WZBNxYKTtl2l h3h2aWDg==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jlSXE-0006rs-QY; Wed, 17 Jun 2020 07:31:00 +0000 Date: Wed, 17 Jun 2020 00:31:00 -0700 From: Christoph Hellwig To: Rajat Jain Cc: Christoph Hellwig , David Woodhouse , Lu Baolu , Joerg Roedel , Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , iommu@lists.linux-foundation.org, Linux Kernel Mailing List , linux-pci , linux-acpi@vger.kernel.org, Raj Ashok , "Krishnakumar, Lalithambika" , Mika Westerberg , Jean-Philippe Brucker , Prashant Malani , Benson Leung , Todd Broch , Alex Levin , Mattias Nissler , Rajat Jain , Bernie Keany , Aaron Durbin , Diego Rivas , Duncan Laurie , Furquan Shaikh , Jesse Barnes , Christian Kellner , Alex Williamson , Greg Kroah-Hartman , Oliver O'Halloran Subject: Re: [PATCH 4/4] pci: export untrusted attribute in sysfs Message-ID: <20200617073100.GA14424@infradead.org> References: <20200616011742.138975-1-rajatja@google.com> <20200616011742.138975-4-rajatja@google.com> <20200616073249.GB30385@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 16, 2020 at 12:27:35PM -0700, Rajat Jain wrote: > Need clarification. The flag "untrusted" is currently a part of > pci_dev struct, and is populated within the PCI subsystem. Yes, and that is the problem. > > 1) Is your suggestion to move this flag as well as the attribute to > device core (in "struct device")? This would allow other buses to > populate/use this flag if they want. By default it'll be set to 0 for > all devices (PCI subsystem will populate it based on platform info, > like it does today). > > OR > > 2) Are you suggesting to keep the "untrusted" flag within PCI, but > attach the sysfs attribute to the base device? (&pci_dev->dev)? (1). As for IOMMUs and userspace policy it really should not matter what bus a device is on if it is external and not trustworthy.