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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C6A3C4332F for ; Fri, 28 Jan 2022 21:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344123AbiA1Ve4 (ORCPT ); Fri, 28 Jan 2022 16:34:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236367AbiA1Vex (ORCPT ); Fri, 28 Jan 2022 16:34:53 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45C76C061747 for ; Fri, 28 Jan 2022 13:34:53 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id z5so7329781plg.8 for ; Fri, 28 Jan 2022 13:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Sy/Y8yEWHigDuQdOlOLkaoU18i+f7DaCjn+DCmpwyFI=; b=hHmYyqdR9Q2JZUHGSGzbIgw7t9UNRsSBkuwDJ7oJU1ZVMuuh9q4jSdXlYRSA94DjTr V7R7MKNh/igjsct2gL3Zz4mzs1JXx2SE1S34DTakruz/UO9vRM/Mq2zEY3oQOUAOs2e9 bRTNzUmQfMlcWPrDx+wmUaQdVwdzHb8AKtf3Na5NqORiHpssCKgffjD7uMWNsDC88jxj zvYRWSooCK5VAGDOcoIwq4kDvd7skeQK9isV7CULeYCsenIm8ouoCSNj0lrxzJIIDcf4 XazTpdNAFlZ3tnnGjqh2ztDvByAn0dGNYTyHAaLt1VLG4+3BPhC0W2pGxqKHMEbx/SRD WZqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Sy/Y8yEWHigDuQdOlOLkaoU18i+f7DaCjn+DCmpwyFI=; b=RBc4wOS5lAGErU7voSjO8mxFthpCK0C6nvTzNIlm43hrbGIWHTmOu6bIEw9qDiP+rl ZimtBJaOFFJVuBblNoG6ZXN09F2M5eVYXahcqLIDpN64+RcoDy1LcrTjYcEkQSQqKs4w wnL9fEH8w+AjkJc3/OyU2cvz1k9/QfdTq/Ep5gPomMP6226p/adk4GpOdbok2au0gCTj 7I4nmaEup0WI8P7bh5N79fg2WRHJmQrWILv/uRUtSOTzuOvh7yJfS8ZyN8VMCMk0L/Bx /qgK0kPMyVgI1kNNtAtimD87gn61gCGRYNG7adSCv5iDrNIlv40iQwfJAaoiDQHpc+4+ ra+g== X-Gm-Message-State: AOAM533ZiGULSeqjcWB1XY2nlnRaZFsa/OR4QWdnk6sce0Qa9/oO7QJx FL6cpRr5ZHOLhKCe+Q24CpabHstrH9QyiqW0iQSWuQ== X-Google-Smtp-Source: ABdhPJwV3BKyuOcH+josgcsSnfOibgxLTtv/8nRGPI4s0kEVOgyMJ0vb3Sfq3qOJtImXOMdLHXVvRVouTbuj3d3aaZc= X-Received: by 2002:a17:90a:f485:: with SMTP id bx5mr21803979pjb.46.1643405692450; Fri, 28 Jan 2022 13:34:52 -0800 (PST) MIME-Version: 1.0 References: <20220120000409.2706549-1-rajatja@google.com> <20220121214117.GA1154852@bhelgaas> In-Reply-To: From: Rajat Jain Date: Fri, 28 Jan 2022 13:34:16 -0800 Message-ID: Subject: Re: [PATCH] PCI: ACPI: Allow internal devices to be marked as untrusted To: Mika Westerberg Cc: "Rafael J. Wysocki" , Greg Kroah-Hartman , Bjorn Helgaas , Len Brown , Bjorn Helgaas , ACPI Devel Maling List , Linux PCI , Linux Kernel Mailing List , Rajat Jain , Dmitry Torokhov , Jesse Barnes , Jean-Philippe Brucker , Pavel Machek , "Oliver O'Halloran" , Joerg Roedel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mika, All, On Thu, Jan 27, 2022 at 11:49 PM Mika Westerberg wrote: > > Hi, > > On Thu, Jan 27, 2022 at 02:26:07PM -0800, Rajat Jain wrote: > > Hello Rafael, Bjorn, Mika, Dmitry, Greg, > > > > Thanks a lot for your comments. > > > > On Tue, Jan 25, 2022 at 6:45 AM Rafael J. Wysocki wrote: > > > > > > On Tue, Jan 25, 2022 at 1:55 PM Mika Westerberg > > > wrote: > > > > > > > > On Tue, Jan 25, 2022 at 12:15:02PM +0100, Greg Kroah-Hartman wrote: > > > > > On Tue, Jan 25, 2022 at 12:58:52PM +0200, Mika Westerberg wrote: > > > > > > On Mon, Jan 24, 2022 at 08:27:17AM +0200, Mika Westerberg wrote: > > > > > > > > > This patch introduces a new "UntrustedDevice" property that can be used > > > > > > > > > by the firmware to mark any device as untrusted. > > > > > > > > > > > > > > I think this new property should be documented somewhere too (also > > > > > > > explain when to use it instead of ExternalFacingPort). If not in the > > > > > > > next ACPI spec or some supplemental doc then perhaps in the DT bindings > > > > > > > under Documentation/devicetree/bindings. > > > > > > > > > > > > Actually Microsoft has similar already: > > > > > > > > > > > > https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#identifying-internal-pcie-ports-accessible-to-users-and-requiring-dma-protection > > > > > > > > > > > > I think we should use that too here. > > > > But because this property also applies to a root port (only), it only > > helps if the device is downstream a PCIe root port. In our case, we > > have an internal (wifi) device 00:14.3 (sits on the internal PCI bus > > 0), so cannot use this. > > Right. I wonder if we can expand it to cover all internal devices, not > just PCIe root ports? We anyways need to support that property so does > not make much sense to me to invent yet another that does pretty much > the same thing. I'm open to doing so if the others also feel the same way. IMHO though, the semantics of ACPI "DmaProperty" differ from the semantics of the property I'm proposing here. The current (documented) semantics (of "DmaProperty"): *This device (root port) is trusted*, but any devices downstream are not to be trusted. What I need and am proposing (new "UntrustedDevice"): *This device as well as any downstream devices* are untrusted. Note that there may be firmware implementing "DmaProperty" already out there (for windows), and if we decide to use it for my purposes, then there shall be a discrepancy in how Linux uses that property vs Windows. Is that acceptable? Thanks & Best Regards, Rajat