Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3526160pxb; Tue, 20 Apr 2021 10:08:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx/WvzHFXNxaQXYFBNWkHw9QK2aL6ClLb+9ZKUEGtBS75TrhAlANoirvEWP/S2s/JtNKrZ X-Received: by 2002:a17:906:5619:: with SMTP id f25mr28034269ejq.393.1618938530855; Tue, 20 Apr 2021 10:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618938530; cv=none; d=google.com; s=arc-20160816; b=eWSJWmszGSEt2hV260ePA6zBnz9mRj31nLKrFVdLqAn2t1KV5cI1PRomEpgl/ZQ4ru OESWRYDNJwbq5TyriG5oPIj2lcpg9Z1JAbcW6Jux+fQOWinFSGlIjKGKzPGn4smYajVi ou3ILKFrCOmb6+O6lPQh6zWG4sTPV5E2vqaFS8jZLRD9ab2r/1KXzX7aoztNYN43cLNO qaOA5XtA1hDh17QAhX+O3TfDs8kBqygxCgKnBg5Ks7fIlv8CM8lbgXUoEZ9fG6BhcZ4M hiIjqUc8oZpIobyAcqYo8fyEhNI+/FQHnExZfJU0zZh4DcTZqOhnnUZGCrxU17U+RJ/y E0jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=HBkpVB1MpxqGTIA9YDrGc/8oHhIaMnCJrLkJXUkd240=; b=F5qLhDWvGhrxsupJof4KiX7bZAd+ISZo4kK85hjHjlb8ygX7XFOsckxB2aSzJSc4fW 5xxTArtk0RDOpCc9XXuFsMIvFtgef90Pv0e+OV1RUeVLULOGucgSD6ytcyUxroKWwQDr 1HdP9g/FjyN2ub8N9TYJaA47Sz4M/Pp4bmhG9OnsEEBxAl035HbZIRnqwBo146tiEKle Cote9aCX543BM/p3CQ4qLI9q3pCOUR2omBu+FITWrVkA96mDiXSi8zMbpiwG4sQEldmb CBj9zZediFAnMQAmwwhGpv4nxa9mE39SYBgPKBhQOJwWyVIcgc6/p7l8SrK4MxJrintT BmsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HFxLz7ao; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si14604171edr.252.2021.04.20.10.08.27; Tue, 20 Apr 2021 10:08:50 -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=@kernel.org header.s=k20201202 header.b=HFxLz7ao; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233242AbhDTRHn (ORCPT + 99 others); Tue, 20 Apr 2021 13:07:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:50974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232913AbhDTRHn (ORCPT ); Tue, 20 Apr 2021 13:07:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BB4FF613AE; Tue, 20 Apr 2021 17:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618938431; bh=GE4+p/0+TSRy9zrXwA+A3hbFODGJvMZhR/Foyysj8Xk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=HFxLz7aoFzH0dK6/RmYz4uKvPbOqqsrjZrNLFT0IJFHa0MGYHmSLVuRUkf6NJfcp2 xKYJ31miuYE07A0VOVwkFofARekVV5uPsH53TlwnCvLpvAGTuCz47Qo3Dk0Qb6kBqO bEjzYiW24Lt7yrxTk8OtCnQkT/PyQdDy0OsDNNWgJbU6LB0Z5T+8vi7ZwOYLMzR4K0 Jw+g+vqjjmzGPjUzQmz8qO/yeUSA1YZnuxjVNDIUrl/m4/mtN9qOEfyPFy7lsvnZ3o me17wq+dO+YMneqYiukxrKqXKJOdGLshp5NDe0HQxB6Je8dtVvJ11HL0YJTctGz0HH rf4sI5yfBAR4w== Date: Tue, 20 Apr 2021 12:07:08 -0500 From: Bjorn Helgaas To: Christoph Hellwig Cc: Rajat Jain , Joerg Roedel , Will Deacon , David Woodhouse , Lu Baolu , Bjorn Helgaas , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, rajatxjain@gmail.com Subject: Re: [PATCH] pci: Rename pci_dev->untrusted to pci_dev->external Message-ID: <20210420170708.GA2813156@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210420061006.GA3523612@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 20, 2021 at 07:10:06AM +0100, Christoph Hellwig wrote: > On Mon, Apr 19, 2021 at 05:30:49PM -0700, Rajat Jain wrote: > > The current flag name "untrusted" is not correct as it is populated > > using the firmware property "external-facing" for the parent ports. In > > other words, the firmware only says which ports are external facing, so > > the field really identifies the devices as external (vs internal). > > > > Only field renaming. No functional change intended. > > I don't think this is a good idea. First the field should have been > added to the generic struct device as requested multiple times before. Fair point. There isn't anything PCI-specific about this idea. The ACPI "ExternalFacingPort" and DT "external-facing" are currently only defined for PCI devices, but could be applied elsewhere. > Right now this requires horrible hacks in the IOMMU code to get at the > pci_dev, and also doesn't scale to various other potential users. Agreed, this is definitely suboptimal. Do you have other users in mind? Maybe they could help inform the plan. > Second the untrusted is objectively a better name. Because untrusted > is how we treat the device, which is what mattes. External is just > how we come to that conclusion. The decision to treat "external" as being "untrusted" is a little bit of policy that the PCI core really doesn't care about, so I think it does make some sense to let the places that *do* care decide what to trust based on "external" and possibly other factors, e.g., whether the device is a BMC or processes untrusted data, etc. But I guess it makes sense to wait until we have a better motivation before renaming it, since we don't gain any functionality here. Bjorn